Skip to content

Commit c4357db

Browse files
committed
Update project from its own Copier template (v1.47.1).
1 parent f9ee034 commit c4357db

10 files changed

Lines changed: 335 additions & 376 deletions

.auxiliary/configuration/claude/commands/cs-code-python.md

Lines changed: 52 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Request from user: $ARGUMENTS
1616
- Architecture overview: @documentation/architecture/summary.rst
1717
- Filesystem patterns: @documentation/architecture/filesystem.rst
1818
- Python practices: @.auxiliary/instructions/practices.rst
19+
- Python development guide: @.auxiliary/instructions/practices-python.rst
1920
- Code style: @.auxiliary/instructions/style.rst
2021
- Nomenclature: @.auxiliary/instructions/nomenclature.rst
2122
- Germanic variants: @.auxiliary/instructions/nomenclature-germanic.rst
@@ -26,10 +27,25 @@ Request from user: $ARGUMENTS
2627

2728
Before implementing Python code, ensure:
2829
- Understanding of implementation requirements and expected behavior
29-
- Familiarity with project practices, style, and nomenclature guidelines
30-
- Knowledge of existing codebase structure and patterns
30+
- Knowledge of existing codebase structure and patterns
3131
- Clear design specifications or existing design documents if referenced
3232

33+
### Guide Consultation Requirements
34+
35+
Before implementing Python code, you MUST:
36+
1. Read @.auxiliary/instructions/practices.rst for general development principles
37+
2. Read @.auxiliary/instructions/practices-python.rst for Python-specific patterns
38+
3. In a step on your TODO list, please attest that you have read the general and Python-specific practices guides and demonstrate your knowledge by writing one-sentence summaries on any three of the following topics:
39+
40+
- the comprehensive examples showing multiple principles cohesively
41+
- proper module organization content order
42+
- import organization and centralized import patterns
43+
- wide parameter, narrow return type patterns for robust interfaces
44+
- immutability preferences for data structures and containers
45+
- exception handling with narrow try blocks and proper chaining
46+
- documentation formatting requirements including narrative mood
47+
- quality assurance principles including linter compliance
48+
3349
## Process Summary
3450

3551
Key functional areas:
@@ -147,16 +163,11 @@ Before session end:
147163
- [ ] Record next steps for continuation
148164

149165
### 3. Implementation
150-
Write Python code following established patterns:
151-
- Implement functions, classes, or modules as specified
152-
- Apply centralized import patterns via `__` subpackage
153-
- Use proper type annotations with `__.typx.TypeAlias` for complex types
154-
- Follow style guidelines for spacing, formatting, and structure
155-
- Implement proper exception handling with narrow try blocks
156-
- Apply nomenclature patterns for consistent naming
157-
- Ensure functions are ≤30 lines and modules are ≤600 lines
158166

159-
For complex type annotation issues or when adding comprehensive type annotations to existing code, consider using the `python-annotator` agent.
167+
**Write Python code following established patterns**:
168+
- Apply comprehensive guide patterns for module organization, imports, annotations, immutability, exception handling, and documentation
169+
- Consult the comprehensive guides when you need specific implementation details
170+
- For complex annotation work or systematic annotation issues, consider using the `python-annotator` agent
160171

161172
### 4. Progress Tracking Requirements
162173
Maintain dual tracking systems:
@@ -166,54 +177,55 @@ Maintain dual tracking systems:
166177
- **Context Preservation**: Record all reference files and design decisions in persistent file for future session continuity
167178

168179
### 5. Quality Assurance
169-
Validate code quality and conformance following zero-tolerance policy:
170180

171-
#### Linting Validation
181+
Before proceeding, add this quality verification checklist to your TODO list:
182+
- [ ] Code follows proper module organization patterns
183+
- [ ] Imports follow organization rules with centralized patterns
184+
- [ ] Type annotations use wide parameter, narrow return patterns
185+
- [ ] Functions ≤30 lines, modules ≤600 lines
186+
- [ ] Immutability preferences applied to data structures
187+
- [ ] Exception handling uses narrow try blocks with proper chaining
188+
- [ ] Documentation follows narrative mood requirements
189+
- [ ] Quality assurance principles applied
190+
191+
#### Validation Commands
192+
**Linting Validation** (zero-tolerance policy):
172193
```bash
173194
hatch --env develop run linters
174195
```
175-
All linting issues must be addressed. Do not use `noqa` pragma comments without explicit user approval.
196+
All issues must be addressed per comprehensive guide principles. Do not use `noqa` without explicit approval.
176197

177-
#### Type Checking Validation
178-
Run type checker and analyze results:
198+
**Type Checking** (systematic resolution):
179199
```bash
180200
hatch --env develop run linters # Includes Pyright
181201
```
182202

183-
Type Error Resolution Process:
184-
1. Code Issues: Fix all type errors in project code immediately
185-
2. Third-party Stub Issues: If errors are due to missing/incomplete third-party type stubs:
186-
- Verify package is listed in `pyproject.toml`
187-
- Rebuild environment: `hatch env prune`
188-
- Generate stubs: `hatch --env develop run pyright --createsub <package>`
189-
- Complete necessary stub definitions
190-
- Re-run type checker to verify resolution
191-
3. Complex Type Issues: For comprehensive type annotation work, systematic suppression resolution, or complex dependency management, consider using the `python-annotator` agent.
192-
193-
Stop and consult user if:
194-
- Type errors cannot be categorized as code issues or third-party stub gaps
195-
- Stub generation fails or requires extensive manual type definitions
196-
- Multiple conflicting approaches exist for resolving type issues
197-
198-
#### Test Validation
203+
**Type Error Resolution Process**:
204+
1. **Code Issues**: Fix immediately using comprehensive guide type annotation patterns
205+
2. **Third-party Stubs**: Follow guidance in Python-specific practices guide (ensure dependency in `pyproject.toml`, prune Hatch environment, Pyright `createstub`, manage stubs)
206+
3. **Complex Issues**: Use `python-annotator` agent for systematic resolution
207+
208+
Stop and consult user if type errors cannot be categorized or require architectural decisions.
209+
210+
**Test Validation**:
199211
```bash
200212
hatch --env develop run testers
201213
```
202-
Ensure all tests pass, including any new tests created.
214+
All tests must pass, including new implementations.
203215

204216
### 6. Documentation and Summary
205-
Provide implementation documentation:
206-
- Update persistent tracking file with final implementation state
207-
- Document any non-obvious design decisions or trade-offs in decision log
208-
- Create or update relevant docstrings following narrative mood guidelines
209-
- Complete handoff notes with current state and next steps
210-
- Note any TODO items for future enhancements
211-
- Verify alignment with filesystem organization patterns
217+
218+
**Provide implementation documentation**:
219+
- Update persistent tracking file with implementation state
220+
- Document design decisions and trade-offs in decision log
221+
- Complete handoff notes for session continuity
222+
- Note TODO items for future work
212223

213224
### 7. Summarize Implementation
214225
Provide concise summary of what was implemented, including:
215226
- Functions, classes, or modules created or modified
216227
- Key design decisions and rationale
217228
- Integration points and dependencies
218229
- Quality assurance status: Confirm all linters, type checkers, and tests pass
230+
- Checklist of principles and patterns applied during implementation
219231
- Any remaining tasks or follow-up items

0 commit comments

Comments
 (0)