x-ipe 1.0.23__py3-none-any.whl → 1.0.25__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- x_ipe/app.py +32 -1
- x_ipe/handlers/terminal_handlers.py +6 -0
- x_ipe/handlers/voice_handlers.py +5 -0
- x_ipe/resources/copilot-instructions.md +19 -6
- x_ipe/resources/skills/lesson-learned/SKILL.md +208 -0
- x_ipe/resources/skills/lesson-learned/references/examples.md +238 -0
- x_ipe/resources/skills/project-quality-board-management/SKILL.md +135 -298
- x_ipe/resources/skills/project-quality-board-management/references/evaluation-principles.md +213 -0
- x_ipe/resources/skills/project-quality-board-management/references/evaluation-procedures.md +214 -0
- x_ipe/resources/skills/project-quality-board-management/templates/quality-report.md +70 -18
- x_ipe/resources/skills/task-execution-guideline/SKILL.md +2 -2
- x_ipe/resources/skills/task-execution-guideline/templates/task-record.yaml +1 -1
- x_ipe/resources/skills/task-type-code-implementation/SKILL.md +72 -270
- x_ipe/resources/skills/task-type-code-implementation/references/implementation-guidelines.md +432 -0
- x_ipe/resources/skills/task-type-code-refactor-v2/SKILL.md +127 -353
- x_ipe/resources/skills/task-type-code-refactor-v2/references/refactoring-techniques.md +373 -0
- x_ipe/resources/skills/task-type-feature-breakdown/SKILL.md +31 -243
- x_ipe/resources/skills/task-type-feature-breakdown/references/breakdown-guidelines.md +330 -0
- x_ipe/resources/skills/task-type-feature-refinement/SKILL.md +27 -180
- x_ipe/resources/skills/task-type-feature-refinement/references/specification-writing-guide.md +267 -0
- x_ipe/resources/skills/task-type-idea-mockup/SKILL.md +38 -276
- x_ipe/resources/skills/task-type-idea-mockup/references/mockup-guidelines.md +299 -0
- x_ipe/resources/skills/task-type-idea-to-architecture/SKILL.md +20 -218
- x_ipe/resources/skills/task-type-idea-to-architecture/references/architecture-patterns.md +342 -0
- x_ipe/resources/skills/task-type-ideation/SKILL.md +10 -266
- x_ipe/resources/skills/task-type-ideation/references/folder-naming-guide.md +55 -0
- x_ipe/resources/skills/task-type-ideation/references/tool-usage-guide.md +236 -0
- x_ipe/resources/skills/task-type-ideation-v2/SKILL.md +488 -0
- x_ipe/resources/skills/task-type-ideation-v2/references/examples.md +377 -0
- x_ipe/resources/skills/task-type-ideation-v2/references/folder-naming-guide.md +74 -0
- x_ipe/resources/skills/task-type-ideation-v2/references/tool-usage-guide.md +145 -0
- x_ipe/resources/skills/task-type-ideation-v2/references/visualization-guide.md +160 -0
- x_ipe/resources/skills/task-type-ideation-v2/templates/idea-summary.md +86 -0
- x_ipe/resources/skills/task-type-refactoring-analysis/SKILL.md +83 -145
- x_ipe/resources/skills/task-type-refactoring-analysis/references/output-schema.md +172 -0
- x_ipe/resources/skills/task-type-technical-design/SKILL.md +28 -214
- x_ipe/resources/skills/task-type-technical-design/references/design-templates.md +422 -0
- x_ipe/resources/skills/task-type-test-generation/SKILL.md +47 -332
- x_ipe/resources/skills/task-type-test-generation/references/test-patterns.md +368 -0
- x_ipe/resources/skills/tool-tracing-creator/SKILL.md +312 -0
- x_ipe/resources/skills/tool-tracing-creator/references/examples.md +324 -0
- x_ipe/resources/skills/tool-tracing-instrumentation/SKILL.md +373 -0
- x_ipe/resources/skills/tool-tracing-instrumentation/references/examples.md +264 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/SKILL.md +486 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/10. example-gate-conditions.md +73 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/11. reference-quality-standards.md +127 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/2. reference-section-order.md +127 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/3. example-step-based-code-review.md +84 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/4. example-step-based-feature-implementation.md +113 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/5. example-function-based-validation.md +73 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/6. example-function-based-analysis.md +94 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/7. example-task-io-code-implementation.md +36 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/8. example-structured-summary.md +43 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/9. example-dor-dod.md +77 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/examples.md +429 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/references/skill-general-guidelines-v2.md +611 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-meta.md +153 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-task-based.md +324 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-task-category.md +109 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-tool.md +205 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-meta.md +334 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-task-based.md +279 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-tool.md +175 -0
- x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-workflow-orchestration.md +329 -0
- x_ipe/resources/skills/x-ipe-task-based-ideation/SKILL.md +487 -0
- x_ipe/resources/skills/x-ipe-task-based-ideation/references/examples.md +377 -0
- x_ipe/resources/skills/x-ipe-task-based-ideation/references/folder-naming-guide.md +74 -0
- x_ipe/resources/skills/x-ipe-task-based-ideation/references/tool-usage-guide.md +145 -0
- x_ipe/resources/skills/x-ipe-task-based-ideation/references/visualization-guide.md +160 -0
- x_ipe/resources/skills/x-ipe-task-based-ideation/templates/idea-summary.md +86 -0
- x_ipe/routes/__init__.py +2 -0
- x_ipe/routes/ideas_routes.py +289 -0
- x_ipe/routes/kb_routes.py +80 -0
- x_ipe/routes/main_routes.py +18 -0
- x_ipe/routes/project_routes.py +7 -0
- x_ipe/routes/proxy_routes.py +10 -2
- x_ipe/routes/quality_evaluation_routes.py +193 -0
- x_ipe/routes/settings_routes.py +6 -0
- x_ipe/routes/tools_routes.py +6 -0
- x_ipe/routes/tracing_routes.py +232 -0
- x_ipe/routes/uiux_feedback_routes.py +50 -0
- x_ipe/services/__init__.py +5 -0
- x_ipe/services/config_service.py +6 -0
- x_ipe/services/file_service.py +20 -0
- x_ipe/services/homepage_service.py +160 -0
- x_ipe/services/ideas_service.py +535 -2
- x_ipe/services/kb_service.py +378 -0
- x_ipe/services/proxy_service.py +37 -7
- x_ipe/services/settings_service.py +13 -0
- x_ipe/services/skills_service.py +4 -0
- x_ipe/services/terminal_service.py +24 -0
- x_ipe/services/themes_service.py +4 -0
- x_ipe/services/tools_config_service.py +4 -0
- x_ipe/services/tracing_service.py +333 -0
- x_ipe/services/uiux_feedback_service.py +148 -1
- x_ipe/services/voice_input_service_v2.py +11 -0
- x_ipe/static/css/base.css +7 -0
- x_ipe/static/css/homepage-infinity.css +330 -0
- x_ipe/static/css/kb-core.css +301 -0
- x_ipe/static/css/quality-evaluation.css +345 -0
- x_ipe/static/css/sidebar.css +14 -4
- x_ipe/static/css/terminal.css +23 -0
- x_ipe/static/css/tracing-dashboard.css +796 -0
- x_ipe/static/css/uiux-feedback.css +7 -1
- x_ipe/static/css/workplace.css +636 -0
- x_ipe/static/img/homepage-infinity-loop.png +0 -0
- x_ipe/static/js/features/confirm-dialog.js +169 -0
- x_ipe/static/js/features/folder-view.js +742 -0
- x_ipe/static/js/features/homepage-infinity.js +314 -0
- x_ipe/static/js/features/kb-core.js +371 -0
- x_ipe/static/js/features/quality-evaluation.js +387 -0
- x_ipe/static/js/features/sidebar.js +255 -12
- x_ipe/static/js/features/tracing-dashboard.js +855 -0
- x_ipe/static/js/features/tracing-graph.js +1031 -0
- x_ipe/static/js/features/tree-drag.js +227 -0
- x_ipe/static/js/features/tree-search.js +228 -0
- x_ipe/static/js/features/workplace.js +661 -33
- x_ipe/static/js/init.js +76 -0
- x_ipe/static/js/terminal-v2.js +45 -14
- x_ipe/static/js/terminal.js +50 -49
- x_ipe/static/js/uiux-feedback.js +75 -16
- x_ipe/templates/base.html +24 -0
- x_ipe/templates/index.html +10 -1
- x_ipe/templates/knowledge-base.html +110 -0
- x_ipe/templates/workplace.html +4 -0
- x_ipe/tracing/__init__.py +37 -0
- x_ipe/tracing/buffer.py +135 -0
- x_ipe/tracing/context.py +125 -0
- x_ipe/tracing/decorator.py +288 -0
- x_ipe/tracing/middleware.py +197 -0
- x_ipe/tracing/parser.py +235 -0
- x_ipe/tracing/redactor.py +111 -0
- x_ipe/tracing/writer.py +122 -0
- {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/METADATA +2 -2
- {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/RECORD +138 -65
- x_ipe/app.py.bak +0 -1333
- x_ipe/resources/skills/x-ipe-skill-creator/SKILL.md +0 -329
- x_ipe/resources/skills/x-ipe-skill-creator/references/output-patterns.md +0 -169
- x_ipe/resources/skills/x-ipe-skill-creator/references/skill-structure.md +0 -162
- x_ipe/resources/skills/x-ipe-skill-creator/references/workflows.md +0 -110
- x_ipe/resources/skills/x-ipe-skill-creator/templates/references/examples.md +0 -113
- x_ipe/resources/skills/x-ipe-skill-creator/templates/skill-category-skill.md +0 -296
- x_ipe/resources/skills/x-ipe-skill-creator/templates/task-type-skill.md +0 -269
- {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/WHEEL +0 -0
- {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/entry_points.txt +0 -0
- {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
# Implementation Guidelines Reference
|
|
2
|
+
|
|
3
|
+
This document contains detailed implementation guidelines, coding standards, TDD workflow examples, and error handling patterns for the Code Implementation task type.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Implementation Principles (Detailed)
|
|
8
|
+
|
|
9
|
+
### KISS (Keep It Simple, Stupid)
|
|
10
|
+
|
|
11
|
+
**Core Principles:**
|
|
12
|
+
- Write simple, readable code
|
|
13
|
+
- No complex abstractions unless specified in design
|
|
14
|
+
- Use standard patterns from technical design
|
|
15
|
+
- Prefer clarity over cleverness
|
|
16
|
+
- If implementation seems complex, question the design
|
|
17
|
+
|
|
18
|
+
**Examples:**
|
|
19
|
+
```python
|
|
20
|
+
# ✅ GOOD: Simple and clear
|
|
21
|
+
def get_user_display_name(user):
|
|
22
|
+
return f"{user.first_name} {user.last_name}"
|
|
23
|
+
|
|
24
|
+
# ❌ BAD: Over-engineered
|
|
25
|
+
def get_user_display_name(user, formatter=None, cache=None, observer=None):
|
|
26
|
+
if formatter is None:
|
|
27
|
+
formatter = DefaultNameFormatter()
|
|
28
|
+
# ... unnecessary complexity
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### YAGNI (You Aren't Gonna Need It)
|
|
34
|
+
|
|
35
|
+
**Core Principles:**
|
|
36
|
+
- Implement ONLY what's in technical design
|
|
37
|
+
- No extra features "just in case"
|
|
38
|
+
- No "nice to have" additions
|
|
39
|
+
- If it's not in the design doc, don't implement it
|
|
40
|
+
- Defer future features to future tasks
|
|
41
|
+
|
|
42
|
+
**Examples:**
|
|
43
|
+
```python
|
|
44
|
+
# ✅ GOOD: Only what's needed
|
|
45
|
+
class UserService:
|
|
46
|
+
def create_user(self, data):
|
|
47
|
+
# Only the create operation needed now
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
# ❌ BAD: Features for "later"
|
|
51
|
+
class UserService:
|
|
52
|
+
def create_user(self, data): pass
|
|
53
|
+
def bulk_create_users(self, data_list): pass # Not in design!
|
|
54
|
+
def import_users_from_csv(self, file): pass # Not in design!
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### Test Driven Development (TDD) Workflow
|
|
60
|
+
|
|
61
|
+
**The Red-Green-Refactor Cycle:**
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
65
|
+
│ 1. RED: Write a failing test │
|
|
66
|
+
│ ↓ │
|
|
67
|
+
│ 2. GREEN: Write minimum code to pass the test │
|
|
68
|
+
│ ↓ │
|
|
69
|
+
│ 3. REFACTOR: Improve code quality while keeping tests green│
|
|
70
|
+
│ ↓ │
|
|
71
|
+
│ 4. REPEAT: Next test case │
|
|
72
|
+
└─────────────────────────────────────────────────────────────┘
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Detailed TDD Example:**
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# Step 1: RED - Write failing test
|
|
79
|
+
def test_calculate_discount_applies_percentage():
|
|
80
|
+
result = calculate_discount(100, 20)
|
|
81
|
+
assert result == 80.0
|
|
82
|
+
|
|
83
|
+
# Run: pytest -v → FAILS (no implementation yet)
|
|
84
|
+
|
|
85
|
+
# Step 2: GREEN - Minimum code to pass
|
|
86
|
+
def calculate_discount(price: float, percent: int) -> float:
|
|
87
|
+
return price * (1 - percent / 100)
|
|
88
|
+
|
|
89
|
+
# Run: pytest -v → PASSES
|
|
90
|
+
|
|
91
|
+
# Step 3: REFACTOR - Clean up if needed (in this case, already clean)
|
|
92
|
+
# Step 4: REPEAT - Next test case
|
|
93
|
+
def test_calculate_discount_zero_percent():
|
|
94
|
+
result = calculate_discount(100, 0)
|
|
95
|
+
assert result == 100.0
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Mockup Reference Guidelines (Frontend)
|
|
101
|
+
|
|
102
|
+
**When implementing frontend code:**
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
IF Technical Scope in specification.md includes [Frontend] OR [Full Stack]:
|
|
106
|
+
1. MUST open and reference "Linked Mockups" from specification.md
|
|
107
|
+
2. Keep mockup visible during frontend implementation
|
|
108
|
+
3. Match implementation to mockup:
|
|
109
|
+
- Component structure and hierarchy
|
|
110
|
+
- Layout and positioning
|
|
111
|
+
- Interactive elements and behaviors
|
|
112
|
+
- Form fields and their validations
|
|
113
|
+
- Visual states (hover, active, disabled, error)
|
|
114
|
+
4. Verify implementation visually matches mockup
|
|
115
|
+
5. Note any deviations and document reasons
|
|
116
|
+
|
|
117
|
+
ELSE (Backend/API Only/Database/Infrastructure):
|
|
118
|
+
- Skip mockup reference
|
|
119
|
+
- Implement based on technical design only
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Implementation Order for Frontend:**
|
|
123
|
+
1. Component structure (HTML/JSX)
|
|
124
|
+
2. Styling (CSS) to match mockup
|
|
125
|
+
3. Interactivity (event handlers)
|
|
126
|
+
4. State management
|
|
127
|
+
5. API integration
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### Coverage vs. Complexity
|
|
132
|
+
|
|
133
|
+
**CRITICAL RULE: DO NOT make code complex just for test coverage!**
|
|
134
|
+
|
|
135
|
+
- Keep code simple and testable
|
|
136
|
+
- Target reasonable coverage (80%+), not 100% at all costs
|
|
137
|
+
- If code is hard to test, simplify the code
|
|
138
|
+
- Avoid testing implementation details
|
|
139
|
+
- Do NOT add parameters, abstractions, or indirection just to hit coverage metrics
|
|
140
|
+
|
|
141
|
+
**Good Example:**
|
|
142
|
+
```python
|
|
143
|
+
# Simple, testable function
|
|
144
|
+
def calculate_discount(price: float, percent: int) -> float:
|
|
145
|
+
return price * (1 - percent / 100)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Bad Example (DON'T DO THIS):**
|
|
149
|
+
```python
|
|
150
|
+
# Over-complicated just for "testability"
|
|
151
|
+
def calculate_discount(price, percent,
|
|
152
|
+
logger=None, cache=None,
|
|
153
|
+
event_bus=None, metrics=None):
|
|
154
|
+
# Unnecessary complexity added for coverage
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Coding Standards
|
|
160
|
+
|
|
161
|
+
### General Standards
|
|
162
|
+
|
|
163
|
+
- Follow project coding standards
|
|
164
|
+
- Use linters and formatters
|
|
165
|
+
- Consistent naming conventions
|
|
166
|
+
- Meaningful variable/function names
|
|
167
|
+
- Document public APIs
|
|
168
|
+
- Handle errors appropriately
|
|
169
|
+
|
|
170
|
+
### Naming Conventions
|
|
171
|
+
|
|
172
|
+
| Type | Python | JavaScript/TypeScript |
|
|
173
|
+
|------|--------|----------------------|
|
|
174
|
+
| Variables | `snake_case` | `camelCase` |
|
|
175
|
+
| Functions | `snake_case` | `camelCase` |
|
|
176
|
+
| Classes | `PascalCase` | `PascalCase` |
|
|
177
|
+
| Constants | `UPPER_SNAKE_CASE` | `UPPER_SNAKE_CASE` |
|
|
178
|
+
| Private | `_leading_underscore` | `#private` or `_underscore` |
|
|
179
|
+
|
|
180
|
+
### Documentation Standards
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
def create_user(user_data: dict) -> User:
|
|
184
|
+
"""
|
|
185
|
+
Create a new user in the system.
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
user_data: Dictionary containing user fields (name, email, role)
|
|
189
|
+
|
|
190
|
+
Returns:
|
|
191
|
+
User: The created user object
|
|
192
|
+
|
|
193
|
+
Raises:
|
|
194
|
+
ValidationError: If required fields are missing
|
|
195
|
+
DuplicateError: If email already exists
|
|
196
|
+
"""
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Error Handling Patterns
|
|
202
|
+
|
|
203
|
+
### Python Error Handling
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
# ✅ GOOD: Specific exception handling
|
|
207
|
+
def get_user(user_id: str) -> User:
|
|
208
|
+
try:
|
|
209
|
+
user = db.find_user(user_id)
|
|
210
|
+
if user is None:
|
|
211
|
+
raise UserNotFoundError(f"User {user_id} not found")
|
|
212
|
+
return user
|
|
213
|
+
except DatabaseConnectionError as e:
|
|
214
|
+
logger.error(f"Database error: {e}")
|
|
215
|
+
raise ServiceUnavailableError("Database unavailable")
|
|
216
|
+
|
|
217
|
+
# ❌ BAD: Catching everything
|
|
218
|
+
def get_user(user_id: str) -> User:
|
|
219
|
+
try:
|
|
220
|
+
return db.find_user(user_id)
|
|
221
|
+
except Exception: # Too broad!
|
|
222
|
+
return None
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Error Response Format (APIs)
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
# Standard error response structure
|
|
229
|
+
{
|
|
230
|
+
"error": {
|
|
231
|
+
"code": "USER_NOT_FOUND",
|
|
232
|
+
"message": "User with ID 123 not found",
|
|
233
|
+
"details": {}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Implementation Structure
|
|
241
|
+
|
|
242
|
+
### Standard Project Layout
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
src/
|
|
246
|
+
├── models/ # Data models from design
|
|
247
|
+
├── services/ # Business logic from design
|
|
248
|
+
├── routes/ # API endpoints from design (if applicable)
|
|
249
|
+
├── middleware/ # Cross-cutting concerns
|
|
250
|
+
└── utils/ # Helper functions
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Implementation Order
|
|
254
|
+
|
|
255
|
+
1. **Data Models** - Define entities and their relationships
|
|
256
|
+
2. **Business Logic/Services** - Core functionality
|
|
257
|
+
3. **API Endpoints** - Route handlers (if applicable)
|
|
258
|
+
4. **Integration Points** - External service connections
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Step-by-Step Procedure Details
|
|
263
|
+
|
|
264
|
+
### Step 4: Load Tests (Detailed)
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
1. LOCATE test files created by Test Generation task:
|
|
268
|
+
- tests/unit/{feature}/
|
|
269
|
+
- tests/integration/{feature}/
|
|
270
|
+
- tests/api/{feature}/
|
|
271
|
+
- tests/test_{feature}.py
|
|
272
|
+
|
|
273
|
+
2. RUN all tests to verify baseline:
|
|
274
|
+
- pytest tests/ -v (Python)
|
|
275
|
+
- npm test (Node.js)
|
|
276
|
+
|
|
277
|
+
3. VERIFY tests FAIL:
|
|
278
|
+
- ⚠️ All feature-related tests should FAIL
|
|
279
|
+
- This proves no implementation exists yet
|
|
280
|
+
- Document: "X tests failing, 0 passing (TDD ready)"
|
|
281
|
+
|
|
282
|
+
4. IF tests pass:
|
|
283
|
+
- STOP: Implementation may already exist
|
|
284
|
+
- Review what code exists
|
|
285
|
+
- Determine if this is a duplicate task
|
|
286
|
+
|
|
287
|
+
5. IF tests don't exist:
|
|
288
|
+
- ⚠️ STOP immediately
|
|
289
|
+
- Report: "Test Generation task not completed"
|
|
290
|
+
- Go back to Test Generation task FIRST
|
|
291
|
+
- Do NOT proceed without tests
|
|
292
|
+
|
|
293
|
+
6. UNDERSTAND what tests expect:
|
|
294
|
+
- Review test assertions
|
|
295
|
+
- Note expected inputs/outputs
|
|
296
|
+
- Identify test structure
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Step 5: Implement Code (Detailed)
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
1. IMPLEMENT in order specified by technical design:
|
|
303
|
+
- Data models
|
|
304
|
+
- Business logic/services
|
|
305
|
+
- API endpoints (if applicable)
|
|
306
|
+
- Integration points
|
|
307
|
+
|
|
308
|
+
2. FOR EACH component:
|
|
309
|
+
- Write code following technical design exactly
|
|
310
|
+
- Run related tests
|
|
311
|
+
- Verify tests pass (GREEN phase)
|
|
312
|
+
- Refactor if needed (keep simple!)
|
|
313
|
+
- Verify tests still pass
|
|
314
|
+
|
|
315
|
+
3. AVOID:
|
|
316
|
+
- Adding features not in design
|
|
317
|
+
- Over-engineering
|
|
318
|
+
- Premature optimization
|
|
319
|
+
- Complex abstractions
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Step 6: Verify & Ensure Quality (Detailed)
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
1. RUN all tests:
|
|
326
|
+
- pytest tests/ -v (Python)
|
|
327
|
+
- npm test (Node.js)
|
|
328
|
+
|
|
329
|
+
2. CHECK coverage (aim for 80%+, but don't add complexity for it):
|
|
330
|
+
- pytest --cov=src tests/
|
|
331
|
+
|
|
332
|
+
3. RUN linter:
|
|
333
|
+
- ruff check src/ tests/
|
|
334
|
+
- flake8 src/ tests/
|
|
335
|
+
- eslint src/ tests/
|
|
336
|
+
|
|
337
|
+
4. RUN formatter:
|
|
338
|
+
- ruff format src/ tests/
|
|
339
|
+
- black src/ tests/
|
|
340
|
+
- prettier --write src/ tests/
|
|
341
|
+
|
|
342
|
+
5. VERIFY:
|
|
343
|
+
- [ ] All tests pass
|
|
344
|
+
- [ ] No linter errors
|
|
345
|
+
- [ ] Code matches technical design
|
|
346
|
+
- [ ] No extra features added
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Tracing Instrumentation
|
|
352
|
+
|
|
353
|
+
### Step 7: Apply Tracing (Detailed)
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
1. INVOKE tool-tracing-instrumentation skill:
|
|
357
|
+
- Target: All files modified/created in this implementation
|
|
358
|
+
- Example: "Add tracing to src/x_ipe/services/new_service.py"
|
|
359
|
+
|
|
360
|
+
2. REVIEW proposed decorators:
|
|
361
|
+
- Verify level assignments (INFO for public, DEBUG for helpers)
|
|
362
|
+
- Verify sensitive params detected (password, token, secret, key)
|
|
363
|
+
- Approve or modify as needed
|
|
364
|
+
|
|
365
|
+
3. APPLY decorators:
|
|
366
|
+
- Let skill add @x_ipe_tracing decorators
|
|
367
|
+
- Let skill add imports if missing
|
|
368
|
+
|
|
369
|
+
4. RE-RUN tests to ensure decorators don't break functionality:
|
|
370
|
+
- pytest tests/ -v
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Skip Conditions:**
|
|
374
|
+
- Skip if project has no tracing infrastructure (no `x_ipe.tracing` module)
|
|
375
|
+
- Skip for test files (test_*.py)
|
|
376
|
+
- Skip for configuration files
|
|
377
|
+
|
|
378
|
+
### Tracing Levels
|
|
379
|
+
|
|
380
|
+
| Level | Use For |
|
|
381
|
+
|-------|---------|
|
|
382
|
+
| INFO | Public APIs, endpoints, key business functions |
|
|
383
|
+
| DEBUG | Helper functions, internal utilities |
|
|
384
|
+
|
|
385
|
+
### Sensitive Parameter Handling
|
|
386
|
+
|
|
387
|
+
```python
|
|
388
|
+
# Parameters to redact: password, token, secret, key, credential, auth
|
|
389
|
+
@x_ipe_tracing(level="INFO", redact=["password", "token"])
|
|
390
|
+
def login(username: str, password: str, token: str) -> User:
|
|
391
|
+
pass
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## Web Search Guidelines
|
|
397
|
+
|
|
398
|
+
**Use web search capability when you encounter:**
|
|
399
|
+
- Library/framework API questions → Search official documentation
|
|
400
|
+
- Error messages → Search Stack Overflow, GitHub Issues
|
|
401
|
+
- Implementation patterns → Search for best practices
|
|
402
|
+
- Performance issues → Search for optimization techniques
|
|
403
|
+
- Security concerns → Search for secure coding practices
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## Design Update Procedure
|
|
408
|
+
|
|
409
|
+
**If implementation reveals design issues, UPDATE the design BEFORE proceeding:**
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
IF during implementation you discover:
|
|
413
|
+
- Design is not working as expected
|
|
414
|
+
- Better implementation approach exists
|
|
415
|
+
- Design needs changes to support feature properly
|
|
416
|
+
- Key component interfaces need modification
|
|
417
|
+
|
|
418
|
+
THEN:
|
|
419
|
+
1. STOP implementation
|
|
420
|
+
2. UPDATE technical-design.md:
|
|
421
|
+
- Modify affected sections in Part 1 and/or Part 2
|
|
422
|
+
- Add entry to Design Change Log:
|
|
423
|
+
| Date | Phase | Change Summary |
|
|
424
|
+
|------|-------|----------------|
|
|
425
|
+
| {today} | Code Implementation | {What changed, why, impact ~100 words} |
|
|
426
|
+
3. RESUME implementation with updated design
|
|
427
|
+
|
|
428
|
+
DO NOT:
|
|
429
|
+
- Implement something different from the design without updating it
|
|
430
|
+
- Make incompatible changes to key components without documenting
|
|
431
|
+
- Skip the change log entry
|
|
432
|
+
```
|