Skip to content

Commit 8106bfb

Browse files
chrisdpurcellclaude
andcommitted
chore: add Serena project config and onboarding memories
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8b4873b commit 8106bfb

6 files changed

Lines changed: 202 additions & 0 deletions

File tree

.serena/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/cache
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# TextTools — Project Overview
2+
3+
## Purpose
4+
PySide6 desktop app for text processing on Linux: encoding conversion (UTF-8), text formatting/cleaning, find/replace, file management. MVVM framework and UI shell are in place; feature logic is mostly unimplemented scaffolding. `DESIGN.md` is the authoritative spec.
5+
6+
## Tech Stack
7+
- Python 3.14, PySide6 6.8.0+, MVVM architecture, Qt Designer for UI
8+
- Testing: pytest + pytest-qt (coverage auto-enabled via pyproject.toml addopts)
9+
- Type checking: mypy (strict mode)
10+
- Formatting: Black (88 chars) + isort (black profile)
11+
12+
## Architecture — MVVM (strictly enforced)
13+
```
14+
View (src/views/) → Loads .ui files, connects signals, updates UI
15+
↕ Qt Signals/Slots
16+
ViewModel (src/viewmodels/) → QObject, emits signals, calls services
17+
↕ Method calls
18+
Service (src/services/) → External I/O (files, APIs), injected into ViewModels
19+
↕ Method calls
20+
Model (src/models/) → Pure dataclasses, business logic, validation
21+
```
22+
23+
## Layer Rules
24+
- Model: pure Python, no Qt imports
25+
- ViewModel: QObject + Signal/Slot, no widget manipulation
26+
- View: loads .ui files, findChild(), signal connections; no business logic
27+
- Service: file I/O, external APIs; no Qt imports
28+
29+
## Key Patterns
30+
- `create_application()` in `src/main.py` is sole composition root (dependency injection)
31+
- ServiceProtocol pattern: each ViewModel defines its Protocol in the same file
32+
- UI defined in Qt Designer .ui files under `src/views/ui/`
33+
- Widget objectNames defined in DESIGN.md Appendix A — must match exactly
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# TextTools — Style and Conventions
2+
3+
- Type hints required on all functions (mypy strict)
4+
- Google-style docstrings on all public APIs
5+
- Files: snake_case.py, classes: PascalCase, private: _leading_underscore
6+
- Signals for cross-layer communication — never call View methods from ViewModel
7+
- Long operations must use QThread; never block UI thread
8+
- Black (88 chars) + isort (black profile)
9+
- Qt tests: always consult qt:qtest-patterns skill first
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# TextTools — Development Commands
2+
3+
```bash
4+
python -m src.main # Run the application
5+
pytest tests/ # Run all tests (coverage auto-enabled)
6+
pytest tests/unit/test_X.py # Single test file
7+
mypy src/ # Type checking (strict)
8+
black src/ tests/ # Format
9+
isort src/ tests/ # Sort imports
10+
uv pip install -r requirements.txt # Install deps
11+
```
12+
13+
## Git
14+
- Work on `testing` branch only
15+
- Never commit to `main`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TextTools — Task Completion
2+
3+
```bash
4+
pytest tests/ # All tests pass (coverage auto-reported)
5+
mypy src/ # Zero errors (strict mode)
6+
black src/ tests/ # Formatting consistent
7+
isort src/ tests/ # Import order consistent
8+
```
9+
10+
- Commit on `testing` branch only

.serena/project.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# the name by which the project can be referenced within Serena
2+
project_name: "texttools"
3+
4+
5+
# list of languages for which language servers are started; choose from:
6+
# al bash clojure cpp csharp
7+
# csharp_omnisharp dart elixir elm erlang
8+
# fortran fsharp go groovy haskell
9+
# java julia kotlin lua markdown
10+
# matlab nix pascal perl php
11+
# php_phpactor powershell python python_jedi r
12+
# rego ruby ruby_solargraph rust scala
13+
# swift terraform toml typescript typescript_vts
14+
# vue yaml zig
15+
# (This list may be outdated. For the current list, see values of Language enum here:
16+
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
17+
# For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
18+
# Note:
19+
# - For C, use cpp
20+
# - For JavaScript, use typescript
21+
# - For Free Pascal/Lazarus, use pascal
22+
# Special requirements:
23+
# Some languages require additional setup/installations.
24+
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
25+
# When using multiple languages, the first language server that supports a given file will be used for that file.
26+
# The first language is the default language and the respective language server will be used as a fallback.
27+
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
28+
languages:
29+
- python
30+
31+
# the encoding used by text files in the project
32+
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
33+
encoding: "utf-8"
34+
35+
# whether to use project's .gitignore files to ignore files
36+
ignore_all_files_in_gitignore: true
37+
38+
# whether the project is in read-only mode
39+
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
40+
# Added on 2025-04-18
41+
read_only: false
42+
43+
# list of additional paths to ignore in this project.
44+
# Same syntax as gitignore, so you can use * and **.
45+
# Note: global ignored_paths from serena_config.yml are also applied additively.
46+
ignored_paths:
47+
- ".venv/"
48+
- "__pycache__/"
49+
- "*.pyc"
50+
- ".git/"
51+
- "dist/"
52+
- "build/"
53+
- "*.egg-info/"
54+
- "htmlcov/"
55+
56+
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
57+
# Below is the complete list of tools for convenience.
58+
# To make sure you have the latest list of tools, and to view their descriptions,
59+
# execute `uv run scripts/print_tool_overview.py`.
60+
#
61+
# * `activate_project`: Activates a project by name.
62+
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
63+
# * `create_text_file`: Creates/overwrites a file in the project directory.
64+
# * `delete_lines`: Deletes a range of lines within a file.
65+
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
66+
# * `execute_shell_command`: Executes a shell command.
67+
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
68+
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
69+
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
70+
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
71+
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
72+
# * `initial_instructions`: Gets the initial instructions for the current project.
73+
# Should only be used in settings where the system prompt cannot be set,
74+
# e.g. in clients you have no control over, like Claude Desktop.
75+
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
76+
# * `insert_at_line`: Inserts content at a given line in a file.
77+
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
78+
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
79+
# * `list_memories`: Lists memories in Serena's project-specific memory store.
80+
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
81+
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
82+
# * `read_file`: Reads a file within the project directory.
83+
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
84+
# * `remove_project`: Removes a project from the Serena configuration.
85+
# * `replace_lines`: Replaces a range of lines within a file with new content.
86+
# * `replace_symbol_body`: Replaces the full definition of a symbol.
87+
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
88+
# * `search_for_pattern`: Performs a search for a pattern in the project.
89+
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
90+
# * `switch_modes`: Activates modes by providing a list of their names
91+
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
92+
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
93+
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
94+
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
95+
excluded_tools: []
96+
97+
# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default)
98+
included_optional_tools: []
99+
100+
# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
101+
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
102+
fixed_tools: []
103+
104+
# list of mode names to that are always to be included in the set of active modes
105+
# The full set of modes to be activated is base_modes + default_modes.
106+
# If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
107+
# Otherwise, this setting overrides the global configuration.
108+
# Set this to [] to disable base modes for this project.
109+
# Set this to a list of mode names to always include the respective modes for this project.
110+
base_modes:
111+
112+
# list of mode names that are to be activated by default.
113+
# The full set of modes to be activated is base_modes + default_modes.
114+
# If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
115+
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
116+
# This setting can, in turn, be overridden by CLI parameters (--mode).
117+
default_modes:
118+
119+
# time budget (seconds) per tool call for the retrieval of additional symbol information
120+
# such as docstrings or parameter information.
121+
# This overrides the corresponding setting in the global configuration; see the documentation there.
122+
# If null or missing, use the setting from the global configuration.
123+
symbol_info_budget:
124+
125+
# The language backend to use for this project.
126+
# If not set, the global setting from serena_config.yml is used.
127+
# Valid values: LSP, JetBrains
128+
# Note: the backend is fixed at startup. If a project with a different backend
129+
# is activated post-init, an error will be returned.
130+
language_backend:
131+
132+
# initial prompt for the project. It will always be given to the LLM upon activating the project
133+
# (contrary to the memories, which are loaded on demand).
134+
initial_prompt: ''

0 commit comments

Comments
 (0)