Skip to content

Commit 0342f16

Browse files
emcdclaude
andcommitted
Add python-annotator agent integration to Python tools.
Create clear escalation path from general Python commands and conformer agent to specialized python-annotator agent for complex type annotation work. Update cs-conform-python, cs-code-python commands and python-conformer agent with targeted references that delegate type suppression investigation, dependency management, and comprehensive type annotation tasks to the specialized agent. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 59d849b commit 0342f16

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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`
@@ -333,4 +335,5 @@ def _group_documents_by_field(
333335
- **Focus on compliance**: Maintain exact functionality while improving standards adherence
334336
- **Reference specific lines**: Always include line numbers and concrete examples
335337
- **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
336339
- **Guide access**: If any prerequisite guide cannot be accessed, stop and inform the user

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Write Python code following established patterns:
8383
- Apply nomenclature patterns for consistent naming
8484
- Ensure functions are ≤30 lines and modules are ≤600 lines
8585

86+
For complex type annotation issues or when adding comprehensive type annotations to existing code, consider using the `python-annotator` agent.
87+
8688
### 4. Implementation Tracking Checklist
8789
Track progress against requirements:
8890
- [ ] All specified functions/classes have been implemented
@@ -114,6 +116,7 @@ Type Error Resolution Process:
114116
- Generate stubs: `hatch --env develop run pyright --createsub <package>`
115117
- Complete necessary stub definitions
116118
- Re-run type checker to verify resolution
119+
3. Complex Type Issues: For comprehensive type annotation work, systematic suppression resolution, or complex dependency management, consider using the `python-annotator` agent.
117120

118121
Stop and consult user if:
119122
- Type errors cannot be categorized as code issues or third-party stub gaps

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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`.
@@ -312,7 +314,7 @@ Apply fixes in systematic order:
312314
1. **Module Organization**: Reorder imports, type aliases, functions per practices guide
313315
2. **Wide/Narrow Types**: Convert function parameters to wide abstract types
314316
3. **Import Cleanup**: Remove namespace pollution, use private aliases and __ subpackage
315-
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.
316318
5. **Exception Handling**: Narrow try block scope, ensure proper chaining
317319
6. **Immutability**: Replace mutable with immutable containers where appropriate
318320
7. **Spacing/Delimiters**: Fix `( )`, `[ ]`, `{ }` patterns

0 commit comments

Comments
 (0)