You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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
31
31
- Clear design specifications or existing design documents if referenced
32
32
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
+
33
49
## Process Summary
34
50
35
51
Key functional areas:
@@ -147,16 +163,11 @@ Before session end:
147
163
-[ ] Record next steps for continuation
148
164
149
165
### 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
158
166
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
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.
176
197
177
-
#### Type Checking Validation
178
-
Run type checker and analyze results:
198
+
**Type Checking** (systematic resolution):
179
199
```bash
180
200
hatch --env develop run linters # Includes Pyright
181
201
```
182
202
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**:
199
211
```bash
200
212
hatch --env develop run testers
201
213
```
202
-
Ensure all tests pass, including any new tests created.
214
+
All tests must pass, including new implementations.
203
215
204
216
### 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
212
223
213
224
### 7. Summarize Implementation
214
225
Provide concise summary of what was implemented, including:
215
226
- Functions, classes, or modules created or modified
216
227
- Key design decisions and rationale
217
228
- Integration points and dependencies
218
229
- Quality assurance status: Confirm all linters, type checkers, and tests pass
230
+
- Checklist of principles and patterns applied during implementation
0 commit comments