Skip to content

Commit 7c05ebf

Browse files
committed
Update project from its own Copier template (v1.44).
1 parent d896c75 commit 7c05ebf

24 files changed

Lines changed: 360 additions & 239 deletions

.auxiliary/configuration/claude/agents/python-conformer.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
22
name: python-conformer
33
description: |
4-
Use this agent ONLY when changes include Python code (.py and .pyi files) and you need to review them for
5-
compliance with project practices, style guidelines, and nomenclature standards, then systematically fix violations.
4+
Use this agent ONLY when changes include Python code (.py and .pyi files) and you need to review them for
5+
compliance with project practices, style guidelines, and nomenclature standards, then systematically fix violations.
66
Do NOT use this agent for non-Python changes such as documentation, configuration files, or other file types.
7-
7+
88
Examples:
9-
9+
1010
<example>
1111
Context: The user has just written a new Python function and wants to ensure it follows project standards.
1212
user: 'I just wrote this function for processing user data. Can you review it?'
1313
assistant: 'I'll use the python-conformer agent to check your function against our project practices and style guidelines, then fix any violations.'
1414
<commentary>Since the user wants code reviewed for compliance, use the python-conformer agent to analyze the code against project standards.</commentary>
1515
</example>
16-
16+
1717
<example>
1818
Context: The user has completed a module refactor and wants to verify compliance before committing.
1919
user: 'I've finished refactoring the authentication module. Please check if it meets our coding standards.'
2020
assistant: 'Let me use the python-conformer agent to thoroughly review your refactored module for compliance with our practices guidelines.'
2121
<commentary>The user needs compliance verification for recently refactored code, so use the python-conformer agent.</commentary>
2222
</example>
23-
23+
2424
<example>
2525
Context: The user wants to review staged Python changes before committing.
2626
user: 'I've modified several Python modules. Please review my staged changes for compliance before I commit.'
@@ -144,7 +144,9 @@ functionality.
144144
**Unacceptable Suppressions (require investigation):**
145145
- `type: ignore` MUST NOT be used, except in extremely rare circumstances. Such
146146
suppressions usually indicate missing third-party dependencies or type stubs,
147-
inappropriate type variables, or a bad inheritance pattern.
147+
inappropriate type variables, or a bad inheritance pattern. For complex type
148+
suppression investigation and dependency management, delegate to the
149+
`python-annotator` agent.
148150
- `__.typx.cast` SHOULD NOT be used, except in extremely rare circumstances.
149151
Such casts suppress normal type checking and usually the same problems as
150152
`type: ignore`.
@@ -263,7 +265,7 @@ def _group_documents_by_field(
263265

264266
**Violations identified:**
265267
1. **Narrow parameter types**: `list[dict[...]]` instead of wide `__.cabc.Sequence[__.cabc.Mapping[...]]`
266-
2. **Type suppression abuse**: `# type: ignore[arg-type]` masks real design issue
268+
2. **Type suppression abuse**: `# type: ignore[arg-type]` masks real design issue (delegate to `python-annotator` agent for systematic suppression resolution)
267269
3. **Mutable container return**: Returns `dict` instead of `__.immut.Dictionary`
268270
4. **Function body blank lines**: Empty lines breaking vertical compactness
269271
5. **Vertical compactness**: `return { }` could be same line as `if`
@@ -323,8 +325,6 @@ def _group_documents_by_field(
323325
## TOOL PREFERENCES
324326

325327
- **Precise coordinates**: Use `rg --line-number --column` for exact line/column positions
326-
- **File editing**: Prefer `text-editor` MCP tools for line-based edits to avoid conflicts
327-
- **File synchronization**: Always reread files with `text-editor` tools after modifications by other tools (like `pyright` or `ruff`)
328328
- **Batch operations**: Group related changes together to minimize file modification conflicts between different MCP tools
329329

330330
## EXECUTION REQUIREMENTS
@@ -335,4 +335,5 @@ def _group_documents_by_field(
335335
- **Focus on compliance**: Maintain exact functionality while improving standards adherence
336336
- **Reference specific lines**: Always include line numbers and concrete examples
337337
- **Document reasoning**: Explain why each standard matters and how fixes align with project practices
338+
- **Agent delegation**: When type annotation issues exceed basic compliance scope, consider delegating to the `python-annotator` agent for comprehensive type work
338339
- **Guide access**: If any prerequisite guide cannot be accessed, stop and inform the user

.auxiliary/configuration/claude/commands/cs-annotate-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You are tasked with creating Towncrier news fragments for user-facing changes
1212
since the last release cleanup. This command analyzes recent commits and
1313
generates appropriate changelog entries.
1414

15-
Special instructions: `$ARGUMENTS`
15+
Special instructions: $ARGUMENTS
1616
(If above line is empty, then no special instructions were given by the user.)
1717

1818
## Context

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

Lines changed: 97 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
allowed-tools: [Read, Write, Edit, MultiEdit, LS, Glob, Grep, Bash, TodoWrite, mcp__text-editor__get_text_file_contents, mcp__text-editor__edit_text_file_contents, mcp__ruff__diagnostics, mcp__ruff__edit_file, mcp__ruff__hover, mcp__ruff__references, mcp__ruff__rename_symbol, mcp__ruff__definition, mcp__pyright__diagnostics, mcp__pyright__edit_file, mcp__pyright__hover, mcp__pyright__references, mcp__pyright__rename_symbol, mcp__pyright__definition, mcp__context7__resolve-library-id, mcp__context7__get-library-docs]
2+
allowed-tools: [Read, Write, Edit, MultiEdit, LS, Glob, Grep, Bash, TodoWrite, mcp__ruff__diagnostics, mcp__ruff__edit_file, mcp__ruff__hover, mcp__ruff__references, mcp__ruff__rename_symbol, mcp__ruff__definition, mcp__pyright__diagnostics, mcp__pyright__edit_file, mcp__pyright__hover, mcp__pyright__references, mcp__pyright__rename_symbol, mcp__pyright__definition, mcp__context7__resolve-library-id, mcp__context7__get-library-docs]
33
description: Python implementation following established patterns and practices
44
---
55

@@ -33,11 +33,12 @@ Before implementing Python code, ensure:
3333
## Process Summary
3434

3535
Key functional areas:
36-
1. **Requirements Analysis**: Understand implementation requirements and context
37-
2. **Design Conformance**: Ensure alignment with established patterns and practices
36+
1. **Requirements Analysis**: Understand implementation requirements and create persistent tracking
37+
2. **Session Continuity**: Check for existing work and preserve context across sessions
3838
3. **Implementation**: Write Python code following style guidelines and best practices
39-
4. **Quality Assurance**: Run linters, type checkers, and tests to validate code
40-
5. **Documentation**: Provide implementation summary and any necessary documentation
39+
4. **Progress Tracking**: Maintain session and cross-session implementation progress
40+
5. **Quality Assurance**: Run linters, type checkers, and tests to validate code
41+
6. **Documentation**: Update persistent tracking and provide implementation summary
4142

4243
## Safety Requirements
4344

@@ -63,15 +64,87 @@ Analyze implementation requirements and gather context:
6364
- Understand expected behavior and edge cases
6465
- Document implementation scope and constraints
6566

66-
### 2. Design Conformance Checklist
67-
Ensure implementation aligns with project standards:
68-
- [ ] Module organization follows practices guidelines (imports → type aliases → defaults → public API → private functions)
67+
#### 1.1 Create Implementation Tracking File
68+
Before beginning implementation, create a persistent tracking file with descriptive naming:
69+
- Format: `.auxiliary/notes/<short-implementation-title>--progress.md`
70+
- Example: `.auxiliary/notes/user-metrics-export--progress.md`
71+
72+
Choose a concise but descriptive title that captures the main implementation goal.
73+
74+
Structure the tracking file with these sections:
75+
76+
### Context and References
77+
- **Implementation Title**: [Brief description of what is being implemented]
78+
- **Start Date**: [YYYY-MM-DD]
79+
- **Reference Files**: [List all files explicitly provided as context/references at start]
80+
- `path/to/reference1.py` - [Brief description of relevance]
81+
- `path/to/reference2.rst` - [Brief description of relevance]
82+
- **Design Documents**: [Any architecture or design docs referenced]
83+
- **Session Notes**: [Link to current session TodoWrite items]
84+
85+
### Design and Style Conformance Checklist
86+
- [ ] Module organization follows practices guidelines
6987
- [ ] Function signatures use wide parameter, narrow return patterns
70-
- [ ] Type annotations are comprehensive and use proper TypeAlias patterns
88+
- [ ] Type annotations comprehensive with TypeAlias patterns
7189
- [ ] Exception handling follows Omniexception → Omnierror hierarchy
72-
- [ ] Naming follows nomenclature conventions with appropriate linguistic consistency
73-
- [ ] Immutability preferences are applied where appropriate
74-
- [ ] Code style follows spacing, vertical compactness, and formatting guidelines
90+
- [ ] Naming follows nomenclature conventions
91+
- [ ] Immutability preferences applied
92+
- [ ] Code style follows formatting guidelines
93+
94+
### Implementation Progress Checklist
95+
- [ ] [Specific function/class/module 1]
96+
- [ ] [Specific function/class/module 2]
97+
- [ ] [Integration point 1] tested
98+
- [ ] [Integration point 2] tested
99+
100+
### Quality Gates Checklist
101+
- [ ] Linters pass (`hatch --env develop run linters`)
102+
- [ ] Type checker passes
103+
- [ ] Tests pass (`hatch --env develop run testers`)
104+
- [ ] Code review ready
105+
106+
### Decision Log
107+
Document significant decisions made during implementation:
108+
- [Date] [Decision made] - [Rationale]
109+
- [Date] [Trade-off chosen] - [Why this approach over alternatives]
110+
111+
### Handoff Notes
112+
For future sessions or other developers:
113+
- **Current State**: [What's implemented and what's not]
114+
- **Next Steps**: [Immediate next actions needed]
115+
- **Known Issues**: [Any problems or concerns to address]
116+
- **Context Dependencies**: [Critical knowledge for continuing work]
117+
118+
### 2. Session Continuity and Context Preservation
119+
Before proceeding with implementation:
120+
121+
#### Check for Existing Implementation
122+
```bash
123+
ls .auxiliary/notes/*--progress.md
124+
```
125+
126+
If continuing previous work:
127+
- Read existing tracking file completely to understand context
128+
- Review reference files listed in context section
129+
- Check decision log for previous design choices
130+
- Update "Current State" in handoff notes as you resume work
131+
132+
#### Context Preservation Requirements
133+
Before beginning implementation:
134+
- [ ] Create descriptive tracking file (`.auxiliary/notes/<title>--progress.md`)
135+
- [ ] Record all reference files provided at session start
136+
- [ ] Document initial understanding of requirements
137+
- [ ] Note any existing related implementations or patterns found
138+
139+
During implementation:
140+
- [ ] Update decision log when making design choices
141+
- [ ] Record integration points and dependencies discovered
142+
- [ ] Document deviations from original plan with rationale
143+
144+
Before session end:
145+
- [ ] Update current state in handoff notes
146+
- [ ] Ensure TodoWrite completions are reflected in persistent tracking where granularity aligns
147+
- [ ] Record next steps for continuation
75148

76149
### 3. Implementation
77150
Write Python code following established patterns:
@@ -83,13 +156,14 @@ Write Python code following established patterns:
83156
- Apply nomenclature patterns for consistent naming
84157
- Ensure functions are ≤30 lines and modules are ≤600 lines
85158

86-
### 4. Implementation Tracking Checklist
87-
Track progress against requirements:
88-
- [ ] All specified functions/classes have been implemented
89-
- [ ] Required functionality is complete and tested
90-
- [ ] Integration points with existing code are working
91-
- [ ] Edge cases and error conditions are handled
92-
- [ ] Documentation requirements are satisfied
159+
For complex type annotation issues or when adding comprehensive type annotations to existing code, consider using the `python-annotator` agent.
160+
161+
### 4. Progress Tracking Requirements
162+
Maintain dual tracking systems:
163+
- **Session Level**: Use TodoWrite tool for immediate task management within current session
164+
- **Cross-Session**: Update `.auxiliary/notes/<implementation-title>--progress.md` for persistent tracking
165+
- **Synchronization**: When TodoWrite items align with persistent checklist granularity, update corresponding persistent checklist items (TodoWrite may be more fine-grained)
166+
- **Context Preservation**: Record all reference files and design decisions in persistent file for future session continuity
93167

94168
### 5. Quality Assurance
95169
Validate code quality and conformance following zero-tolerance policy:
@@ -114,6 +188,7 @@ Type Error Resolution Process:
114188
- Generate stubs: `hatch --env develop run pyright --createsub <package>`
115189
- Complete necessary stub definitions
116190
- 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.
117192

118193
Stop and consult user if:
119194
- Type errors cannot be categorized as code issues or third-party stub gaps
@@ -128,8 +203,10 @@ Ensure all tests pass, including any new tests created.
128203

129204
### 6. Documentation and Summary
130205
Provide implementation documentation:
131-
- Document any non-obvious design decisions or trade-offs
206+
- Update persistent tracking file with final implementation state
207+
- Document any non-obvious design decisions or trade-offs in decision log
132208
- Create or update relevant docstrings following narrative mood guidelines
209+
- Complete handoff notes with current state and next steps
133210
- Note any TODO items for future enhancements
134211
- Verify alignment with filesystem organization patterns
135212

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

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Systematically conform Python code to project style and practice st
77

88
For bringing existing Python code into full compliance with project standards.
99

10-
Target code: `$ARGUMENTS`
10+
Target: $ARGUMENTS
1111

1212
Focus on style/practice conformance, not functionality changes.
1313

@@ -121,7 +121,9 @@ Acceptable Suppressions:
121121
Unacceptable Suppressions (require investigation):
122122
- `type: ignore` MUST NOT be used, except in extremely rare circumstances. Such
123123
suppressions usually indicate missing third-party dependencies or type stubs,
124-
inappropriate type variables, or a bad inheritance pattern.
124+
inappropriate type variables, or a bad inheritance pattern. For systematic
125+
investigation and resolution of type suppressions, consider using the
126+
`python-annotator` agent.
125127
- `__.typx.cast` SHOULD NOT be used, except in extremely rare circumstances.
126128
Such casts suppress normal type checking and usually the same problems as
127129
`type: ignore`.
@@ -297,17 +299,10 @@ Phase 2 Output:
297299
3. **Files Modified**: Complete list with brief description of changes
298300
4. **Manual Review Required**: Any issues requiring human judgment
299301

300-
## Tool Preferences
301-
302-
- **Precise coordinates**: Use `rg --line-number --column` for exact line/column positions
303-
- **File editing**: Prefer `text-editor` MCP tools for line-based edits to avoid conflicts
304-
- **File synchronization**: Always reread files with `text-editor` tools after modifications by other tools (like `pyright` or `ruff`)
305-
- **Batch operations**: Group related changes together to minimize file modification conflicts between different MCP tools
306-
307302
## Conformance Process
308303

309304
### 1. Analysis Phase (PHASE 1)
310-
- Examine target files to understand current state
305+
- Examine target files to understand current state
311306
- Run linters to identify specific violations
312307
- Identify architectural patterns that need updating
313308
- Generate comprehensive compliance report
@@ -319,14 +314,14 @@ Apply fixes in systematic order:
319314
1. **Module Organization**: Reorder imports, type aliases, functions per practices guide
320315
2. **Wide/Narrow Types**: Convert function parameters to wide abstract types
321316
3. **Import Cleanup**: Remove namespace pollution, use private aliases and __ subpackage
322-
4. **Type Annotations**: Add missing hints, create `TypeAlias` for complex types
317+
4. **Type Annotations**: Add missing hints, create `TypeAlias` for complex types. For comprehensive type annotation work or complex type checking issues, consider using the `python-annotator` agent.
323318
5. **Exception Handling**: Narrow try block scope, ensure proper chaining
324319
6. **Immutability**: Replace mutable with immutable containers where appropriate
325320
7. **Spacing/Delimiters**: Fix `( )`, `[ ]`, `{ }` patterns
326321
8. **Docstrings**: Triple single quotes, narrative mood, proper spacing
327322
9. **Line Length**: Split at 79 columns using parentheses
328323

329-
**Requirements**:
324+
**Requirements**:
330325
- Maintain exact functionality while improving standards adherence
331326
- Validate with `hatch --env develop run linters` (must produce clean output)
332327
- Run `hatch --env develop run testers` to ensure no functionality breaks

.auxiliary/configuration/claude/commands/cs-conform-toml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Systematically conform TOML files to project style and practice sta
77

88
For bringing existing TOML configuration files into full compliance with project standards.
99

10-
Target files: `$ARGUMENTS`
10+
Target files: $ARGUMENTS
1111

1212
Focus on style/practice conformance, not functionality changes.
1313

.auxiliary/configuration/claude/commands/cs-develop-pytests.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Implement tests according to the provided test plan only.
1515

1616
- Current git status: !`git status --porcelain`
1717
- Current branch: !`git branch --show-current`
18-
- Test plan to implement: !`ls "$ARGUMENTS" 2>/dev/null && echo "Present" || echo "Missing"`
1918
- Existing test structure: !`find tests -name "*.py" | head -20`
2019
- Test organization: @documentation/architecture/testplans/summary.rst
2120
- Test plans index: @documentation/architecture/testplans/index.rst
@@ -66,6 +65,8 @@ Stop and consult the user if:
6665

6766
**Your responsibilities:**
6867
- Follow the test plan precisely while adhering to project conventions
68+
- Focus only on uncovered areas specified in the plan
69+
- Avoid redundant testing of functionality already covered by doctests
6970
- Use dependency injection patterns as specified in the plan
7071
- Implement tests exactly as planned without adding extras
7172
- Maintain systematic test numbering as outlined in the plan
@@ -74,8 +75,6 @@ Stop and consult the user if:
7475

7576
## Test Implementation Process
7677

77-
Execute the following steps for test plan: `$ARGUMENTS`
78-
7978
### 0. Pre-Flight Verification
8079
Verify access to project guidelines:
8180

@@ -89,11 +88,6 @@ You must successfully access and read all three guides before proceeding. If any
8988
### 1. Test Plan Reading and Validation
9089
Read and validate the provided test plan:
9190

92-
Read the test plan document at the provided path:
93-
```
94-
Read the test plan file at: $ARGUMENTS
95-
```
96-
9791
**Validate plan completeness:**
9892
- Verify plan contains coverage analysis summary
9993
- Confirm test strategy is clearly defined
@@ -118,7 +112,25 @@ Stop if the plan is incomplete, unclear, or missing critical sections.
118112
- Ensure no duplication of existing test coverage
119113

120114
### 3. Test Data and Fixture Setup
121-
**Prepare test data as specified in the plan:**
115+
**Prepare test data and dependencies as specified in the plan:**
116+
117+
**Ensure required test dependencies are available:**
118+
If the test plan requires dependencies not in the current environment, add them to `pyproject.toml`:
119+
120+
```toml
121+
[tool.hatch.envs.develop]
122+
dependencies = [
123+
# ... existing dependencies
124+
"pyfakefs", # For filesystem mocking
125+
"pytest-asyncio", # For async test support
126+
# ... other test-specific dependencies in alphabetical order
127+
]
128+
```
129+
130+
After adding dependencies, rebuild the environment to ensure consistency:
131+
```bash
132+
hatch env prune
133+
```
122134

123135
**Create required test data under tests/data/:**
124136
- Set up fake packages for extension mechanisms (if planned)
@@ -175,6 +187,18 @@ hatch --env develop run linters
175187

176188
## Test Pattern Examples
177189

190+
**Import Patterns:**
191+
192+
*Direct imports (preferred for most cases):*
193+
```python
194+
from mypackage import mymodule
195+
196+
def test_100_basic_functionality( ):
197+
''' Module function works correctly with valid input. '''
198+
result = mymodule.process_data( 'test' )
199+
assert result == 'processed: test'
200+
```
201+
178202
**Dependency Injection Pattern:**
179203
```python
180204
async def test_100_process_with_custom_processor( ):

.auxiliary/configuration/claude/commands/cs-inquire.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Provide analytical responses, technical opinions, and architectural discussion
99
based on user questions. Focus on analysis and reasoning without making code
1010
modifications.
1111

12-
User question or topic: `$ARGUMENTS`
12+
User question or topic: $ARGUMENTS
1313

1414
Stop and consult if:
1515
- The request explicitly asks for code changes or implementation

0 commit comments

Comments
 (0)