Skip to content

Commit 49d785d

Browse files
emcdclaude
andcommitted
Template: Strengthen cs-design-python command and improve conventions guidance.
Address downstream feedback by: (1) Adding stronger practices guide compliance enforcement with specific pattern examples for function signatures; (2) Adding explicit language about implementations, especially for exceptions; (3) Removing problematic text-editor MCP tools recommendations that Claude instances struggle with. These changes ensure better adherence to project practices and cleaner design-only outputs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f029d1b commit 49d785d

4 files changed

Lines changed: 38 additions & 32 deletions

File tree

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Stop and consult if:
1313
- Architectural decisions are needed instead of design specifications
1414
- Implementation details are requested instead of design specifications
1515
- Requirements analysis is needed instead of design specifications
16+
- User requests actual code implementations instead of specifications
1617

1718
## Context
1819

@@ -63,11 +64,13 @@ Examine existing Python structure and patterns:
6364
- Document current design strengths and improvement opportunities
6465

6566
### 2. Interface Specification
66-
Define clean API boundaries and contracts:
67-
- Specify public interfaces using wide parameter, narrow return patterns
67+
Define clean API boundaries and contracts following practices guidelines:
68+
- All function and class signatures must follow @.auxiliary/instructions/practices.rst patterns exactly
69+
- Specify public interfaces using wide parameter, narrow return patterns (e.g., __.cabc.Sequence, __.cabc.Mapping for inputs)
70+
- Return narrow concrete types (list, dict, tuple, __.immut.Dictionary for outputs)
6871
- Design class hierarchies following Omniexception → Omnierror patterns
6972
- Apply appropriate naming conventions from nomenclature guidelines
70-
- Define type annotations using proper TypeAlias patterns
73+
- Define type annotations using proper TypeAlias patterns with __.typx.TypeAlias
7174
- Consider immutability preferences and container design patterns
7275

7376
### 3. Filesystem and Module Organization Design
@@ -80,20 +83,21 @@ Apply Python-specific organizational patterns and filesystem structure:
8083
- Plan type alias organization and dependency management
8184

8285
### 4. Class and Function Design
83-
Create maintainable Python structures:
84-
- Design class hierarchies with appropriate base classes and mixins
85-
- Specify function signatures with proper type annotations
86-
- Apply nomenclature patterns for methods, attributes, and functions
86+
Create maintainable Python structures following practices guide exactly:
87+
- Design class hierarchies with appropriate base classes and mixins (__.immut.Object, __.immut.Protocol, etc.)
88+
- Specify function signatures using practices guide patterns (wide inputs, narrow outputs, proper spacing)
89+
- Apply nomenclature patterns for methods, attributes, and functions from nomenclature guidelines
8790
- Design immutable data structures and container patterns
88-
- Plan dependency injection and configuration patterns
91+
- Plan dependency injection and configuration patterns with sensible defaults
8992

9093
### 5. Design Documentation
91-
Create comprehensive design specifications:
92-
- Document interface contracts and expected behaviors
93-
- Provide design examples following style guidelines
94-
- Specify exception handling patterns and error propagation
94+
Create comprehensive design specifications without implementations:
95+
- Provide only signatures, contracts, and interface specifications - no implementations
96+
- Do not provide exception class implementations, function bodies, or method implementations
97+
- Document interface contracts and expected behaviors (contracts only, not code)
98+
- Provide design examples using signatures and type annotations only
99+
- Specify exception handling patterns and error propagation (exception classes by name/signature only)
95100
- Document design rationale and trade-off decisions
96-
- Create interface specifications without implementation details
97101

98102
### 6. Design Validation
99103
Ensure design quality and consistency:

.auxiliary/configuration/conventions.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
# Operation
1616

1717
- Use `rg --line-number --column` to get precise coordinates for MCP tools that require line/column positions.
18-
- Prefer `text-editor` MCP tools over other text editing tools (line number-based edits are less error-prone).
19-
- Always reread files with `text-editor` tools after modifying files via other tools to avoid file hash conflicts.
20-
- Batch related changes together to minimize file modification conflicts between different MCP tools.
18+
- Choose appropriate editing tools based on the task complexity and your familiarity with the tools.
19+
- Batch related changes together when possible to maintain consistency.
2120
- Use relative paths rather than absolute paths when possible.
2221
- Do not write to paths outside the current project unless explicitly requested.
2322
- Use the `.auxiliary/scribbles` directory for scratch space instead of `/tmp`.

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Stop and consult if:
1313
- Architectural decisions are needed instead of design specifications
1414
- Implementation details are requested instead of design specifications
1515
- Requirements analysis is needed instead of design specifications
16+
- User requests actual code implementations instead of specifications
1617

1718
## Context
1819

@@ -63,11 +64,13 @@ Examine existing Python structure and patterns:
6364
- Document current design strengths and improvement opportunities
6465

6566
### 2. Interface Specification
66-
Define clean API boundaries and contracts:
67-
- Specify public interfaces using wide parameter, narrow return patterns
67+
Define clean API boundaries and contracts following practices guidelines:
68+
- All function and class signatures must follow @.auxiliary/instructions/practices.rst patterns exactly
69+
- Specify public interfaces using wide parameter, narrow return patterns (e.g., __.cabc.Sequence, __.cabc.Mapping for inputs)
70+
- Return narrow concrete types (list, dict, tuple, __.immut.Dictionary for outputs)
6871
- Design class hierarchies following Omniexception → Omnierror patterns
6972
- Apply appropriate naming conventions from nomenclature guidelines
70-
- Define type annotations using proper TypeAlias patterns
73+
- Define type annotations using proper TypeAlias patterns with __.typx.TypeAlias
7174
- Consider immutability preferences and container design patterns
7275

7376
### 3. Filesystem and Module Organization Design
@@ -80,20 +83,21 @@ Apply Python-specific organizational patterns and filesystem structure:
8083
- Plan type alias organization and dependency management
8184

8285
### 4. Class and Function Design
83-
Create maintainable Python structures:
84-
- Design class hierarchies with appropriate base classes and mixins
85-
- Specify function signatures with proper type annotations
86-
- Apply nomenclature patterns for methods, attributes, and functions
86+
Create maintainable Python structures following practices guide exactly:
87+
- Design class hierarchies with appropriate base classes and mixins (__.immut.Object, __.immut.Protocol, etc.)
88+
- Specify function signatures using practices guide patterns (wide inputs, narrow outputs, proper spacing)
89+
- Apply nomenclature patterns for methods, attributes, and functions from nomenclature guidelines
8790
- Design immutable data structures and container patterns
88-
- Plan dependency injection and configuration patterns
91+
- Plan dependency injection and configuration patterns with sensible defaults
8992

9093
### 5. Design Documentation
91-
Create comprehensive design specifications:
92-
- Document interface contracts and expected behaviors
93-
- Provide design examples following style guidelines
94-
- Specify exception handling patterns and error propagation
94+
Create comprehensive design specifications without implementations:
95+
- Provide only signatures, contracts, and interface specifications - no implementations
96+
- Do not provide exception class implementations, function bodies, or method implementations
97+
- Document interface contracts and expected behaviors (contracts only, not code)
98+
- Provide design examples using signatures and type annotations only
99+
- Specify exception handling patterns and error propagation (exception classes by name/signature only)
95100
- Document design rationale and trade-off decisions
96-
- Create interface specifications without implementation details
97101

98102
### 6. Design Validation
99103
Ensure design quality and consistency:

template/.auxiliary/configuration/conventions.md.jinja

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
# Operation
1616

1717
- Use `rg --line-number --column` to get precise coordinates for MCP tools that require line/column positions.
18-
- Prefer `text-editor` MCP tools over other text editing tools (line number-based edits are less error-prone).
19-
- Always reread files with `text-editor` tools after modifying files via other tools to avoid file hash conflicts.
20-
- Batch related changes together to minimize file modification conflicts between different MCP tools.
18+
- Choose appropriate editing tools based on the task complexity and your familiarity with the tools.
19+
- Batch related changes together when possible to maintain consistency.
2120
- Use relative paths rather than absolute paths when possible.
2221
- Do not write to paths outside the current project unless explicitly requested.
2322
- Use the `.auxiliary/scribbles` directory for scratch space instead of `/tmp`.

0 commit comments

Comments
 (0)