x-ipe 1.0.24__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 +25 -3
- 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 +17 -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 +2 -0
- 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 +30 -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 +19 -0
- x_ipe/services/kb_service.py +378 -0
- x_ipe/services/proxy_service.py +4 -0
- 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 +32 -0
- 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 +1 -0
- x_ipe/static/css/tracing-dashboard.css +796 -0
- x_ipe/static/css/workplace.css +20 -0
- x_ipe/static/img/homepage-infinity-loop.png +0 -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-search.js +6 -2
- x_ipe/static/js/features/workplace.js +200 -6
- x_ipe/static/js/init.js +76 -0
- x_ipe/static/js/uiux-feedback.js +18 -2
- x_ipe/templates/base.html +19 -0
- x_ipe/templates/index.html +7 -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.24.dist-info → x_ipe-1.0.25.dist-info}/METADATA +2 -2
- {x_ipe-1.0.24.dist-info → x_ipe-1.0.25.dist-info}/RECORD +132 -62
- 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.24.dist-info → x_ipe-1.0.25.dist-info}/WHEEL +0 -0
- {x_ipe-1.0.24.dist-info → x_ipe-1.0.25.dist-info}/entry_points.txt +0 -0
- {x_ipe-1.0.24.dist-info → x_ipe-1.0.25.dist-info}/licenses/LICENSE +0 -0
|
@@ -20,13 +20,12 @@ Generate comprehensive test cases for a single feature by:
|
|
|
20
20
|
## Important Notes
|
|
21
21
|
|
|
22
22
|
### Skill Prerequisite
|
|
23
|
-
- If you HAVE NOT learned `task-execution-guideline` skill, please learn it first
|
|
24
|
-
|
|
25
|
-
**Important:** If Agent DO NOT have skill capability, can directly go to `skills/` folder to learn skills. And SKILL.md file is the entry point to understand each skill.
|
|
23
|
+
- If you HAVE NOT learned `task-execution-guideline` skill, please learn it first.
|
|
24
|
+
- If Agent DO NOT have skill capability, go to `skills/` folder to learn skills (SKILL.md is entry point).
|
|
26
25
|
|
|
27
26
|
---
|
|
28
27
|
|
|
29
|
-
## Task Type
|
|
28
|
+
## Task Type Attributes
|
|
30
29
|
|
|
31
30
|
| Attribute | Value |
|
|
32
31
|
|-----------|-------|
|
|
@@ -35,35 +34,24 @@ Generate comprehensive test cases for a single feature by:
|
|
|
35
34
|
| Next Task Type | Code Implementation |
|
|
36
35
|
| Require Human Review | No |
|
|
37
36
|
| Feature Phase | Test Generation |
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Task Type Required Input Attributes
|
|
42
|
-
|
|
43
|
-
| Attribute | Default Value |
|
|
44
|
-
|-----------|---------------|
|
|
45
|
-
| Auto Proceed | False |
|
|
37
|
+
| Auto Proceed (Input) | False (default) |
|
|
46
38
|
|
|
47
39
|
---
|
|
48
40
|
|
|
49
41
|
## Skill/Task Completion Output
|
|
50
42
|
|
|
51
|
-
This skill MUST return these attributes to the Task Data Model upon task completion:
|
|
52
|
-
|
|
53
43
|
```yaml
|
|
54
44
|
Output:
|
|
55
45
|
category: feature-stage
|
|
56
46
|
status: completed | blocked
|
|
57
47
|
next_task_type: Code Implementation
|
|
58
48
|
require_human_review: No
|
|
59
|
-
auto_proceed: {from input
|
|
49
|
+
auto_proceed: {from input}
|
|
60
50
|
task_output_links: [tests/]
|
|
61
51
|
feature_id: FEATURE-XXX
|
|
62
52
|
feature_title: {title}
|
|
63
53
|
feature_version: {version}
|
|
64
54
|
feature_phase: Test Generation
|
|
65
|
-
|
|
66
|
-
# Test generation specific
|
|
67
55
|
tests_created: [list of test files]
|
|
68
56
|
test_count: {number}
|
|
69
57
|
baseline_status: "X tests failing, 0 passing (TDD ready)"
|
|
@@ -84,8 +72,6 @@ Output:
|
|
|
84
72
|
|
|
85
73
|
## Execution Flow
|
|
86
74
|
|
|
87
|
-
Execute Test Generation by following these steps in order:
|
|
88
|
-
|
|
89
75
|
| Step | Name | Action | Gate to Next |
|
|
90
76
|
|------|------|--------|--------------|
|
|
91
77
|
| 1 | Query Board | Get Feature Data Model from feature board | Feature data received |
|
|
@@ -106,293 +92,69 @@ Execute Test Generation by following these steps in order:
|
|
|
106
92
|
|
|
107
93
|
### Step 1: Query Feature Board
|
|
108
94
|
|
|
109
|
-
**Action:** Get full Feature Data Model for context
|
|
110
|
-
|
|
111
95
|
```
|
|
112
96
|
CALL feature-stage+feature-board-management skill:
|
|
113
97
|
operation: query_feature
|
|
114
98
|
feature_id: {feature_id from task_data}
|
|
115
99
|
|
|
116
|
-
RECEIVE
|
|
117
|
-
feature_id: FEATURE-XXX
|
|
118
|
-
title: {Feature Title}
|
|
119
|
-
version: v1.0
|
|
120
|
-
status: Designed
|
|
121
|
-
specification_link: x-ipe-docs/requirements/FEATURE-XXX/specification.md
|
|
122
|
-
technical_design_link: x-ipe-docs/requirements/FEATURE-XXX/technical-design.md
|
|
100
|
+
RECEIVE: feature_id, title, version, status, specification_link, technical_design_link
|
|
123
101
|
```
|
|
124
102
|
|
|
125
|
-
---
|
|
126
|
-
|
|
127
103
|
### Step 2: Read Technical Design Document
|
|
128
104
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
2. EXTRACT testable components from Part 1 (Agent-Facing Summary):
|
|
136
|
-
- Components and their scope
|
|
137
|
-
- Key interfaces and method signatures
|
|
138
|
-
- Usage examples (basis for test cases)
|
|
139
|
-
- Tags for context
|
|
140
|
-
|
|
141
|
-
3. EXTRACT test details from Part 2 (Implementation Guide):
|
|
142
|
-
- Data models (fields to validate)
|
|
143
|
-
- API endpoints (request/response to test)
|
|
144
|
-
- Workflows (sequences to verify)
|
|
145
|
-
- Edge cases and error handling (negative test cases)
|
|
146
|
-
|
|
147
|
-
4. CHECK Design Change Log for any updates
|
|
148
|
-
|
|
149
|
-
5. NOTE any references to architecture designs
|
|
150
|
-
|
|
151
|
-
6. **🎨 CHECK Technical Scope for mockup-based tests:**
|
|
152
|
-
```
|
|
153
|
-
IF Technical Scope includes [Frontend] OR [Full Stack]:
|
|
154
|
-
a. Review "Linked Mockups" in specification.md
|
|
155
|
-
b. Open mockup files to understand UI expectations
|
|
156
|
-
c. Generate frontend-specific tests:
|
|
157
|
-
- Component rendering tests
|
|
158
|
-
- User interaction tests (click, input, submit)
|
|
159
|
-
- Visual state tests (loading, error, success)
|
|
160
|
-
- Form validation tests
|
|
161
|
-
- Accessibility tests (if applicable)
|
|
162
|
-
d. Reference mockup elements in test descriptions
|
|
163
|
-
|
|
164
|
-
ELSE (Backend/API Only/Database):
|
|
165
|
-
- Skip frontend/UI tests
|
|
166
|
-
- Focus on unit tests, integration tests, API tests
|
|
167
|
-
```
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**⚠️ STRICT REQUIREMENT:**
|
|
171
|
-
- Tests MUST be based on the technical design document
|
|
172
|
-
- All components in Part 1 must have corresponding tests
|
|
173
|
-
- All edge cases in Part 2 must have test coverage
|
|
174
|
-
- If design is unclear or incomplete - STOP and request design update first
|
|
105
|
+
1. READ `{technical_design_link}` from Feature Data Model
|
|
106
|
+
2. EXTRACT from Part 1 (Agent-Facing Summary): Components, interfaces, method signatures, usage examples
|
|
107
|
+
3. EXTRACT from Part 2 (Implementation Guide): Data models, API endpoints, workflows, edge cases
|
|
108
|
+
4. CHECK Design Change Log for updates
|
|
109
|
+
5. NOTE references to architecture designs
|
|
110
|
+
6. **If Technical Scope includes [Frontend] or [Full Stack]:** Review mockups for UI tests
|
|
175
111
|
|
|
176
|
-
|
|
112
|
+
**⚠️ Tests MUST be based on technical design. If design is unclear - STOP and request update.**
|
|
177
113
|
|
|
178
114
|
### Step 3: Read Architecture Designs (If Referenced)
|
|
179
115
|
|
|
180
|
-
**Action:** If technical design mentions common architecture rules, understand them for testing
|
|
181
|
-
|
|
182
116
|
```
|
|
183
117
|
IF technical design references architecture components:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
- Common patterns that need testing
|
|
187
|
-
- Shared utilities to mock/stub
|
|
188
|
-
- Integration requirements to verify
|
|
189
|
-
|
|
190
|
-
COMMON REFERENCES:
|
|
191
|
-
- Database patterns → Test data access
|
|
192
|
-
- API standards → Test request/response formats
|
|
193
|
-
- Error handling → Test error cases
|
|
194
|
-
- Authentication → Test auth flows
|
|
118
|
+
READ x-ipe-docs/architecture/technical-designs/{component}.md
|
|
119
|
+
UNDERSTAND: patterns to test, utilities to mock, integration requirements
|
|
195
120
|
```
|
|
196
121
|
|
|
197
|
-
---
|
|
198
|
-
|
|
199
122
|
### Step 4: Read Feature Specification
|
|
200
123
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
1. READ {specification_link} from Feature Data Model
|
|
205
|
-
Location: x-ipe-docs/requirements/FEATURE-XXX/specification.md
|
|
206
|
-
|
|
207
|
-
2. EXTRACT acceptance criteria:
|
|
208
|
-
- Each criterion becomes at least one test
|
|
209
|
-
- Note edge cases documented
|
|
210
|
-
- Note business rules to verify
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
---
|
|
124
|
+
1. READ `{specification_link}` from Feature Data Model
|
|
125
|
+
2. EXTRACT acceptance criteria (each becomes at least one test)
|
|
214
126
|
|
|
215
127
|
### Step 5: Design Test Strategy
|
|
216
128
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
**🌐 Web Search (Recommended):**
|
|
220
|
-
Use web search capability to research:
|
|
221
|
-
- Testing best practices for the technology stack
|
|
222
|
-
- Framework-specific testing patterns (pytest, jest, etc.)
|
|
223
|
-
- Mocking strategies for external services
|
|
224
|
-
- Test coverage strategies and industry standards
|
|
225
|
-
- Integration testing patterns
|
|
226
|
-
- API testing best practices
|
|
227
|
-
|
|
228
|
-
```
|
|
229
|
-
1. CATEGORIZE tests needed:
|
|
230
|
-
|
|
231
|
-
UNIT TESTS (isolated components):
|
|
232
|
-
- Each public method
|
|
233
|
-
- Each data model validation
|
|
234
|
-
- Each utility function
|
|
235
|
-
|
|
236
|
-
INTEGRATION TESTS (component interactions):
|
|
237
|
-
- Service → Repository
|
|
238
|
-
- Controller → Service
|
|
239
|
-
- Component A → Component B
|
|
240
|
-
|
|
241
|
-
API TESTS (endpoint validation):
|
|
242
|
-
- Each endpoint from technical design
|
|
243
|
-
- Success responses
|
|
244
|
-
- Error responses
|
|
245
|
-
|
|
246
|
-
2. PRIORITIZE:
|
|
247
|
-
- Core functionality first
|
|
248
|
-
- Happy path before edge cases
|
|
249
|
-
- Critical paths before optional
|
|
250
|
-
|
|
251
|
-
3. DEFINE test data:
|
|
252
|
-
- Mock data for unit tests
|
|
253
|
-
- Fixtures for integration tests
|
|
254
|
-
- Request/response samples for API tests
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
### Step 6: Generate Unit Tests
|
|
260
|
-
|
|
261
|
-
**Action:** Create unit tests for all components
|
|
262
|
-
|
|
263
|
-
**For each component/function from technical design:**
|
|
264
|
-
|
|
265
|
-
```
|
|
266
|
-
1. TEST happy path:
|
|
267
|
-
- Valid inputs → Expected outputs
|
|
268
|
-
- Normal conditions → Success
|
|
269
|
-
|
|
270
|
-
2. TEST edge cases:
|
|
271
|
-
- Boundary values (min, max, zero)
|
|
272
|
-
- Empty inputs
|
|
273
|
-
- Maximum values
|
|
274
|
-
|
|
275
|
-
3. TEST error conditions:
|
|
276
|
-
- Invalid inputs → Appropriate errors
|
|
277
|
-
- Missing dependencies → Handled gracefully
|
|
278
|
-
- Exception scenarios → Caught and reported
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
**Test Naming Convention:**
|
|
282
|
-
```
|
|
283
|
-
test_<function>_<scenario>_<expected_result>
|
|
284
|
-
|
|
285
|
-
Examples:
|
|
286
|
-
- test_authenticate_valid_credentials_returns_token
|
|
287
|
-
- test_authenticate_invalid_email_raises_error
|
|
288
|
-
- test_authenticate_expired_token_returns_401
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
**Test Structure (Arrange-Act-Assert):**
|
|
292
|
-
```python
|
|
293
|
-
def test_login_with_valid_credentials_returns_token(self):
|
|
294
|
-
"""AC: User receives JWT token on successful login"""
|
|
295
|
-
# ARRANGE (Given)
|
|
296
|
-
email = "user@test.com"
|
|
297
|
-
password = "ValidPass123"
|
|
298
|
-
|
|
299
|
-
# ACT (When)
|
|
300
|
-
result = auth_service.authenticate(email, password)
|
|
301
|
-
|
|
302
|
-
# ASSERT (Then)
|
|
303
|
-
assert result.access_token is not None
|
|
304
|
-
assert result.token_type == "Bearer"
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
---
|
|
129
|
+
**🌐 Web Search (Recommended):** Research testing best practices for tech stack.
|
|
308
130
|
|
|
309
|
-
|
|
131
|
+
1. CATEGORIZE: Unit (isolated), Integration (interactions), API (endpoints)
|
|
132
|
+
2. PRIORITIZE: Core functionality → Happy path → Edge cases
|
|
133
|
+
3. DEFINE test data: Mocks, fixtures, request/response samples
|
|
310
134
|
|
|
311
|
-
|
|
135
|
+
### Step 6: Generate Tests
|
|
312
136
|
|
|
313
|
-
|
|
314
|
-
1.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
- Feature → External service
|
|
318
|
-
|
|
319
|
-
2. FOR EACH integration:
|
|
320
|
-
- Test successful flow end-to-end
|
|
321
|
-
- Test failure handling and recovery
|
|
322
|
-
- Test timeout/retry behavior (if applicable)
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
---
|
|
137
|
+
For each component from technical design:
|
|
138
|
+
1. **Happy path:** Valid inputs → Expected outputs
|
|
139
|
+
2. **Edge cases:** Boundary values, empty inputs, max values
|
|
140
|
+
3. **Error conditions:** Invalid inputs, missing dependencies, exceptions
|
|
326
141
|
|
|
327
|
-
|
|
142
|
+
> 📖 See [references/test-patterns.md](references/test-patterns.md) for templates, naming conventions, mock examples
|
|
328
143
|
|
|
329
|
-
|
|
144
|
+
### Step 7: Verify TDD Ready
|
|
330
145
|
|
|
331
146
|
```
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
- Correct status code
|
|
337
|
-
- Response body matches schema
|
|
338
|
-
|
|
339
|
-
2. TEST error cases:
|
|
340
|
-
- Missing required fields → 400 Bad Request
|
|
341
|
-
- Invalid data format → 400 Bad Request
|
|
342
|
-
- Unauthorized → 401 Unauthorized
|
|
343
|
-
- Not found → 404 Not Found
|
|
344
|
-
|
|
345
|
-
3. TEST edge cases:
|
|
346
|
-
- Empty body
|
|
347
|
-
- Extra fields (should be ignored or rejected)
|
|
348
|
-
- Boundary values
|
|
147
|
+
1. RUN all tests: pytest tests/ -v
|
|
148
|
+
2. VERIFY all tests FAIL (missing implementation, not test errors)
|
|
149
|
+
3. FIX any test syntax/setup issues
|
|
150
|
+
4. RECORD baseline: "X tests failing, 0 passing (TDD ready)"
|
|
349
151
|
```
|
|
350
152
|
|
|
351
|
-
|
|
153
|
+
### Step 8: Generate Tracing Tests
|
|
352
154
|
|
|
353
|
-
|
|
155
|
+
> 📖 See [references/test-patterns.md](references/test-patterns.md) for tracing test templates
|
|
354
156
|
|
|
355
|
-
**
|
|
356
|
-
|
|
357
|
-
```
|
|
358
|
-
1. CREATE test coverage documentation:
|
|
359
|
-
|
|
360
|
-
| Component | Unit Tests | Integration | API Tests |
|
|
361
|
-
|-----------|------------|-------------|-----------|
|
|
362
|
-
| AuthService | 8 | 2 | - |
|
|
363
|
-
| TokenManager | 5 | - | - |
|
|
364
|
-
| UserRepository | 4 | 3 | - |
|
|
365
|
-
| /login endpoint | - | - | 4 |
|
|
366
|
-
| /logout endpoint | - | - | 3 |
|
|
367
|
-
| **TOTAL** | **17** | **5** | **7** |
|
|
368
|
-
|
|
369
|
-
2. DOCUMENT test data:
|
|
370
|
-
- Mock data definitions
|
|
371
|
-
- Test fixtures created
|
|
372
|
-
- Setup/teardown requirements
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
---
|
|
376
|
-
|
|
377
|
-
### Step 10: Verify Tests Fail (TDD Ready)
|
|
378
|
-
|
|
379
|
-
**Action:** Run all tests to establish baseline
|
|
380
|
-
|
|
381
|
-
```
|
|
382
|
-
1. RUN all tests:
|
|
383
|
-
pytest tests/ -v
|
|
384
|
-
|
|
385
|
-
2. VERIFY all tests FAIL:
|
|
386
|
-
- Expected: X tests failing, 0 passing
|
|
387
|
-
- Failure reason: Missing implementation (not test errors)
|
|
388
|
-
|
|
389
|
-
3. FIX any test syntax/setup issues:
|
|
390
|
-
- Tests should fail because code doesn't exist
|
|
391
|
-
- NOT because tests have bugs
|
|
392
|
-
|
|
393
|
-
4. RECORD baseline:
|
|
394
|
-
baseline_status: "29 tests failing, 0 passing (TDD ready)"
|
|
395
|
-
```
|
|
157
|
+
**Skip if:** No tracing infrastructure OR pure utility modules
|
|
396
158
|
|
|
397
159
|
---
|
|
398
160
|
|
|
@@ -408,67 +170,25 @@ FOR EACH endpoint in technical design:
|
|
|
408
170
|
| 6 | Tests follow project conventions | Yes |
|
|
409
171
|
| 7 | All tests fail for right reason (TDD ready) | Yes |
|
|
410
172
|
| 8 | Test coverage documented | Yes |
|
|
173
|
+
| 9 | Tracing assertions included in tests | Yes |
|
|
411
174
|
|
|
412
|
-
**Important:** After completing
|
|
175
|
+
**Important:** After completing, return to `task-execution-guideline` skill to continue the flow.
|
|
413
176
|
|
|
414
177
|
---
|
|
415
178
|
|
|
416
179
|
## Patterns
|
|
417
180
|
|
|
418
181
|
### Pattern: API Feature
|
|
419
|
-
|
|
420
182
|
**When:** Feature includes REST endpoints
|
|
421
|
-
**Then:**
|
|
422
|
-
```
|
|
423
|
-
1. Unit tests for service layer
|
|
424
|
-
2. Integration tests for full flow
|
|
425
|
-
3. API tests for each endpoint
|
|
426
|
-
4. Test auth and error responses
|
|
427
|
-
```
|
|
183
|
+
**Then:** Unit tests (service) + Integration tests (flow) + API tests (endpoints) + Auth/error tests
|
|
428
184
|
|
|
429
185
|
### Pattern: Background Service
|
|
430
|
-
|
|
431
186
|
**When:** Feature runs as async/background process
|
|
432
|
-
**Then:**
|
|
433
|
-
```
|
|
434
|
-
1. Unit tests for core logic
|
|
435
|
-
2. Mock external dependencies
|
|
436
|
-
3. Test timeout and retry behavior
|
|
437
|
-
4. Verify cleanup on failure
|
|
438
|
-
```
|
|
187
|
+
**Then:** Unit tests (core) + Mock dependencies + Timeout/retry tests + Cleanup verification
|
|
439
188
|
|
|
440
189
|
### Pattern: Data Processing
|
|
441
|
-
|
|
442
190
|
**When:** Feature processes/transforms data
|
|
443
|
-
**Then:**
|
|
444
|
-
```
|
|
445
|
-
1. Test with valid input → expected output
|
|
446
|
-
2. Test with edge cases (empty, null, max)
|
|
447
|
-
3. Test with invalid input → proper errors
|
|
448
|
-
4. Use parameterized tests for variations
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
---
|
|
452
|
-
|
|
453
|
-
## Test File Structure
|
|
454
|
-
|
|
455
|
-
```
|
|
456
|
-
tests/
|
|
457
|
-
├── unit/ # Unit tests (isolated)
|
|
458
|
-
│ ├── services/
|
|
459
|
-
│ │ └── auth_service_test.py
|
|
460
|
-
│ ├── models/
|
|
461
|
-
│ │ └── user_test.py
|
|
462
|
-
│ └── utils/
|
|
463
|
-
│ └── token_utils_test.py
|
|
464
|
-
├── integration/ # Integration tests
|
|
465
|
-
│ └── auth_flow_test.py
|
|
466
|
-
├── api/ # API tests
|
|
467
|
-
│ └── auth_api_test.py
|
|
468
|
-
├── fixtures/ # Shared test data
|
|
469
|
-
│ └── users.py
|
|
470
|
-
└── conftest.py # Test configuration
|
|
471
|
-
```
|
|
191
|
+
**Then:** Valid input tests + Edge cases + Invalid input tests + Parameterized tests
|
|
472
192
|
|
|
473
193
|
---
|
|
474
194
|
|
|
@@ -477,8 +197,8 @@ tests/
|
|
|
477
197
|
| Anti-Pattern | Why Bad | Do Instead |
|
|
478
198
|
|--------------|---------|------------|
|
|
479
199
|
| Skip reading design | Tests miss requirements | Read technical design first |
|
|
480
|
-
| Test implementation details | Brittle
|
|
481
|
-
| One giant test | Hard to debug
|
|
200
|
+
| Test implementation details | Brittle tests | Test behavior only |
|
|
201
|
+
| One giant test | Hard to debug | One assertion per test |
|
|
482
202
|
| Test private methods | Couples to internals | Test via public interface |
|
|
483
203
|
| Skip edge cases | Bugs hide in edges | Prioritize edge cases |
|
|
484
204
|
| Hardcoded test data | Hard to maintain | Use test fixtures |
|
|
@@ -486,23 +206,18 @@ tests/
|
|
|
486
206
|
|
|
487
207
|
---
|
|
488
208
|
|
|
489
|
-
##
|
|
209
|
+
## References
|
|
490
210
|
|
|
491
|
-
|
|
492
|
-
- Standard TDD
|
|
493
|
-
- Incremental addition to existing test file
|
|
494
|
-
- Missing technical design (blocked)
|
|
495
|
-
- JavaScript/TypeScript project with Jest
|
|
211
|
+
- [Test Patterns & Templates](references/test-patterns.md) - Naming conventions, mock examples, coverage requirements
|
|
212
|
+
- [Execution Examples](references/examples.md) - Standard TDD, incremental tests, blocked scenarios
|
|
496
213
|
|
|
497
214
|
---
|
|
498
215
|
|
|
499
216
|
## Notes
|
|
500
217
|
|
|
501
|
-
- Work on ONE feature at a time
|
|
502
|
-
- Query feature board FIRST
|
|
218
|
+
- Work on ONE feature at a time
|
|
219
|
+
- Query feature board FIRST for context
|
|
503
220
|
- Read technical design THOROUGHLY before writing tests
|
|
504
|
-
- Read architecture designs IF referenced
|
|
505
221
|
- Create ALL tests before Code Implementation starts
|
|
506
222
|
- Verify tests FAIL (TDD ready state)
|
|
507
223
|
- Output feature_phase = "Test Generation" for correct board update
|
|
508
|
-
- Code Implementation will use these tests to drive development
|