@rfxlamia/skillkit 1.1.0 → 1.2.0
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.
- package/agents/agents/creative-copywriter.md +212 -0
- package/agents/agents/dario-amodei.md +135 -0
- package/agents/agents/doc-simplifier.md +63 -0
- package/agents/agents/kotlin-pro.md +433 -0
- package/agents/agents/red-team.md +136 -0
- package/agents/agents/sam-altman.md +121 -0
- package/agents/agents/seo-manager.md +184 -0
- package/package.json +1 -1
- package/skills/skillkit-help/SKILL.md +81 -0
- package/skills/skillkit-help/knowledge/application/09-case-studies.md +257 -0
- package/skills/skillkit-help/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skillkit-help/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skillkit-help/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skillkit-help/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skillkit-help/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skillkit-help/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skillkit-help/template/SKILL.md +52 -0
- package/skills/skills/adversarial-review/SKILL.md +219 -0
- package/skills/skills/baby-education/SKILL.md +260 -0
- package/skills/skills/baby-education/references/advanced-techniques.md +323 -0
- package/skills/skills/baby-education/references/transformations.md +345 -0
- package/skills/skills/been-there-done-that/SKILL.md +455 -0
- package/skills/skills/been-there-done-that/references/analysis-patterns.md +162 -0
- package/skills/skills/been-there-done-that/references/git-commands.md +132 -0
- package/skills/skills/been-there-done-that/references/tree-insertion-logic.md +145 -0
- package/skills/skills/coolhunter/SKILL.md +270 -0
- package/skills/skills/coolhunter/assets/elicitation-methods.csv +51 -0
- package/skills/skills/coolhunter/knowledge/elicitation-methods.md +312 -0
- package/skills/skills/coolhunter/references/workflow-execution.md +238 -0
- package/skills/skills/coolhunter/workflow-plan-coolhunter.md +232 -0
- package/skills/skills/creative-copywriting/SKILL.md +324 -0
- package/skills/skills/creative-copywriting/databases/README.md +60 -0
- package/skills/skills/creative-copywriting/databases/carousel-structures.csv +16 -0
- package/skills/skills/creative-copywriting/databases/emotional-arcs.csv +11 -0
- package/skills/skills/creative-copywriting/databases/hook-formulas.csv +51 -0
- package/skills/skills/creative-copywriting/databases/power-words.csv +201 -0
- package/skills/skills/creative-copywriting/databases/psychological-triggers.csv +21 -0
- package/skills/skills/creative-copywriting/databases/read-more-patterns.csv +26 -0
- package/skills/skills/creative-copywriting/databases/swipe-triggers.csv +31 -0
- package/skills/skills/creative-copywriting/references/carousel-psychology.md +223 -0
- package/skills/skills/creative-copywriting/references/hook-anatomy.md +169 -0
- package/skills/skills/creative-copywriting/references/power-word-science.md +134 -0
- package/skills/skills/creative-copywriting/references/storytelling-frameworks.md +157 -0
- package/skills/skills/diverse-content-gen/SKILL.md +201 -0
- package/skills/skills/diverse-content-gen/references/advanced-techniques.md +320 -0
- package/skills/skills/diverse-content-gen/references/research-findings.md +379 -0
- package/skills/skills/diverse-content-gen/references/task-workflows.md +241 -0
- package/skills/skills/diverse-content-gen/references/tool-integration.md +419 -0
- package/skills/skills/diverse-content-gen/references/troubleshooting.md +426 -0
- package/skills/skills/diverse-content-gen/references/vs-core-technique.md +240 -0
- package/skills/skills/framework-critical-thinking/SKILL.md +220 -0
- package/skills/skills/framework-critical-thinking/references/bias_detector.md +375 -0
- package/skills/skills/framework-critical-thinking/references/fallback_handler.md +239 -0
- package/skills/skills/framework-critical-thinking/references/memory_curator.md +161 -0
- package/skills/skills/framework-critical-thinking/references/metacognitive_monitor.md +297 -0
- package/skills/skills/framework-critical-thinking/references/producer_critic_orchestrator.md +333 -0
- package/skills/skills/framework-critical-thinking/references/reasoning_router.md +235 -0
- package/skills/skills/framework-critical-thinking/references/reasoning_validator.md +97 -0
- package/skills/skills/framework-critical-thinking/references/reflection_trigger.md +78 -0
- package/skills/skills/framework-critical-thinking/references/self_verification.md +388 -0
- package/skills/skills/framework-critical-thinking/references/uncertainty_quantifier.md +207 -0
- package/skills/skills/framework-initiative/SKILL.md +231 -0
- package/skills/skills/framework-initiative/references/examples.md +150 -0
- package/skills/skills/framework-initiative/references/impact-analysis.md +157 -0
- package/skills/skills/framework-initiative/references/intent-patterns.md +145 -0
- package/skills/skills/framework-initiative/references/star-framework.md +165 -0
- package/skills/skills/humanize-docs/SKILL.md +203 -0
- package/skills/skills/humanize-docs/references/advanced-techniques.md +13 -0
- package/skills/skills/humanize-docs/references/core-transformations.md +368 -0
- package/skills/skills/humanize-docs/references/detection-patterns.md +400 -0
- package/skills/skills/humanize-docs/references/examples-gallery.md +374 -0
- package/skills/skills/imagine/SKILL.md +190 -0
- package/skills/skills/imagine/references/artstyle-corporate-memphis.md +625 -0
- package/skills/skills/imagine/references/artstyle-crewdson-hyperrealism.md +295 -0
- package/skills/skills/imagine/references/artstyle-iphone-social-media.md +426 -0
- package/skills/skills/imagine/references/artstyle-sciencesaru.md +276 -0
- package/skills/skills/pre-deploy-checklist/README.md +26 -0
- package/skills/skills/pre-deploy-checklist/SKILL.md +153 -0
- package/skills/skills/pre-deploy-checklist/references/checklist-categories.md +174 -0
- package/skills/skills/pre-deploy-checklist/references/domain-prompts.md +216 -0
- package/skills/skills/prompt-engineering/SKILL.md +209 -0
- package/skills/skills/prompt-engineering/references/advanced-combinations.md +444 -0
- package/skills/skills/prompt-engineering/references/chain-of-thought.md +140 -0
- package/skills/skills/prompt-engineering/references/decision_matrix.md +220 -0
- package/skills/skills/prompt-engineering/references/few-shot.md +346 -0
- package/skills/skills/prompt-engineering/references/json-format.md +270 -0
- package/skills/skills/prompt-engineering/references/natural-language.md +420 -0
- package/skills/skills/prompt-engineering/references/pitfalls.md +365 -0
- package/skills/skills/prompt-engineering/references/prompt-chaining.md +498 -0
- package/skills/skills/prompt-engineering/references/react.md +108 -0
- package/skills/skills/prompt-engineering/references/self-consistency.md +322 -0
- package/skills/skills/prompt-engineering/references/tree-of-thoughts.md +386 -0
- package/skills/skills/prompt-engineering/references/xml-format.md +220 -0
- package/skills/skills/prompt-engineering/references/yaml-format.md +488 -0
- package/skills/skills/prompt-engineering/references/zero-shot.md +74 -0
- package/skills/skills/quick-spec/SKILL.md +280 -0
- package/skills/skills/quick-spec/assets/tech-spec-template.md +74 -0
- package/skills/skills/quick-spec/references/step-01-understand.md +189 -0
- package/skills/skills/quick-spec/references/step-02-investigate.md +144 -0
- package/skills/skills/quick-spec/references/step-03-generate.md +128 -0
- package/skills/skills/quick-spec/references/step-04-review.md +173 -0
- package/skills/skills/quick-spec/tests/__pycache__/test_skill.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skills/quick-spec/tests/test_scenarios.md +83 -0
- package/skills/skills/quick-spec/tests/test_skill.py +136 -0
- package/skills/skills/readme-expert/SKILL.md +538 -0
- package/skills/skills/readme-expert/knowledge/INDEX.md +192 -0
- package/skills/skills/readme-expert/knowledge/application/quality-standards.md +470 -0
- package/skills/skills/readme-expert/knowledge/application/script-executor.md +604 -0
- package/skills/skills/readme-expert/knowledge/application/template-library.md +822 -0
- package/skills/skills/readme-expert/knowledge/foundation/codebase-scanner.md +361 -0
- package/skills/skills/readme-expert/knowledge/foundation/validation-checklist.md +481 -0
- package/skills/skills/red-teaming/SKILL.md +321 -0
- package/skills/skills/red-teaming/references/ai-llm-redteam.md +517 -0
- package/skills/skills/red-teaming/references/attack-techniques.md +410 -0
- package/skills/skills/red-teaming/references/cybersecurity-redteam.md +383 -0
- package/skills/skills/red-teaming/references/tools-frameworks.md +446 -0
- package/skills/skills/releasing/.skillkit-mode +1 -0
- package/skills/skills/releasing/SKILL.md +225 -0
- package/skills/skills/releasing/references/version-detection.md +108 -0
- package/skills/skills/screenwriter/SKILL.md +273 -0
- package/skills/skills/screenwriter/references/advanced-techniques.md +216 -0
- package/skills/skills/screenwriter/references/pipeline-integration.md +266 -0
- package/skills/skills/skillkit/.claude/settings.local.json +7 -0
- package/skills/skills/skillkit/.claude-plugin/plugin.json +27 -0
- package/skills/skills/skillkit/CHANGELOG.md +484 -0
- package/skills/skills/skillkit/SKILL.md +511 -0
- package/skills/skills/skillkit/commands/skillkit.md +6 -0
- package/skills/skills/skillkit/commands/validate-plan.md +6 -0
- package/skills/skills/skillkit/commands/verify.md +6 -0
- package/skills/skills/skillkit/knowledge/INDEX.md +352 -0
- package/skills/skills/skillkit/knowledge/application/09-case-studies.md +257 -0
- package/skills/skills/skillkit/knowledge/application/10-technical-architecture.md +324 -0
- package/skills/skills/skillkit/knowledge/application/11-adoption-strategy.md +267 -0
- package/skills/skills/skillkit/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skills/skillkit/knowledge/application/13-competitive-landscape.md +198 -0
- package/skills/skills/skillkit/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skills/skillkit/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skills/skillkit/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skills/skillkit/knowledge/foundation/04-hybrid-patterns.md +308 -0
- package/skills/skills/skillkit/knowledge/foundation/05-token-economics.md +275 -0
- package/skills/skills/skillkit/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skills/skillkit/knowledge/foundation/07-security-concerns.md +322 -0
- package/skills/skills/skillkit/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skills/skillkit/knowledge/plugin-guide.md +614 -0
- package/skills/skills/skillkit/knowledge/tools/14-validation-tools-guide.md +150 -0
- package/skills/skills/skillkit/knowledge/tools/15-cost-tools-guide.md +157 -0
- package/skills/skills/skillkit/knowledge/tools/16-security-tools-guide.md +122 -0
- package/skills/skills/skillkit/knowledge/tools/17-pattern-tools-guide.md +161 -0
- package/skills/skills/skillkit/knowledge/tools/18-decision-helper-guide.md +243 -0
- package/skills/skills/skillkit/knowledge/tools/19-test-generator-guide.md +275 -0
- package/skills/skills/skillkit/knowledge/tools/20-split-skill-guide.md +149 -0
- package/skills/skills/skillkit/knowledge/tools/21-quality-scorer-guide.md +226 -0
- package/skills/skills/skillkit/knowledge/tools/22-migration-helper-guide.md +356 -0
- package/skills/skills/skillkit/knowledge/tools/23-subagent-creation-guide.md +448 -0
- package/skills/skills/skillkit/knowledge/tools/24-behavioral-testing-guide.md +122 -0
- package/skills/skills/skillkit/references/proposal-generation.md +982 -0
- package/skills/skills/skillkit/references/rationalization-catalog.md +75 -0
- package/skills/skills/skillkit/references/research-methodology.md +661 -0
- package/skills/skills/skillkit/references/section-2-full-creation-workflow.md +452 -0
- package/skills/skills/skillkit/references/section-3-validation-workflow-existing-skill.md +63 -0
- package/skills/skills/skillkit/references/section-4-decision-workflow-skills-vs-subagents.md +64 -0
- package/skills/skills/skillkit/references/section-5-migration-workflow-doc-to-skill.md +58 -0
- package/skills/skills/skillkit/references/section-6-subagent-creation-workflow.md +499 -0
- package/skills/skills/skillkit/references/section-7-knowledge-reference-map.md +72 -0
- package/skills/skills/skillkit/scripts/__pycache__/decision_helper.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/test_generator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skills/skillkit/scripts/decision_helper.py +799 -0
- package/skills/skills/skillkit/scripts/init_skill.py +400 -0
- package/skills/skills/skillkit/scripts/init_subagent.py +231 -0
- package/skills/skills/skillkit/scripts/migration_helper.py +669 -0
- package/skills/skills/skillkit/scripts/package_skill.py +211 -0
- package/skills/skills/skillkit/scripts/pattern_detector.py +381 -0
- package/skills/skills/skillkit/scripts/pattern_detector_new.py +382 -0
- package/skills/skills/skillkit/scripts/pressure_tester.py +157 -0
- package/skills/skills/skillkit/scripts/quality_scorer.py +999 -0
- package/skills/skills/skillkit/scripts/quick_validate.py +100 -0
- package/skills/skills/skillkit/scripts/security_scanner.py +474 -0
- package/skills/skills/skillkit/scripts/split_skill.py +540 -0
- package/skills/skills/skillkit/scripts/test_generator.py +695 -0
- package/skills/skills/skillkit/scripts/token_estimator.py +493 -0
- package/skills/skills/skillkit/scripts/utils/__init__.py +49 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/budget_tracker.py +388 -0
- package/skills/skills/skillkit/scripts/utils/output_formatter.py +263 -0
- package/skills/skills/skillkit/scripts/utils/reference_validator.py +401 -0
- package/skills/skills/skillkit/scripts/validate_skill.py +594 -0
- package/skills/skills/skillkit/tests/test_behavioral.py +39 -0
- package/skills/skills/skillkit/tests/test_scenarios.md +83 -0
- package/skills/skills/skillkit/tests/test_skill.py +136 -0
- package/skills/skills/skillkit-help/SKILL.md +81 -0
- package/skills/skills/skillkit-help/knowledge/application/09-case-studies.md +257 -0
- package/skills/skills/skillkit-help/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skills/skillkit-help/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skills/skillkit-help/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skills/skillkit-help/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skills/skillkit-help/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skills/skillkit-help/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skills/skillkit-help/template/SKILL.md +52 -0
- package/skills/skills/social-media-seo/SKILL.md +278 -0
- package/skills/skills/social-media-seo/databases/caption-styles.csv +31 -0
- package/skills/skills/social-media-seo/databases/engagement-tactics.csv +16 -0
- package/skills/skills/social-media-seo/databases/hashtag-strategies.csv +21 -0
- package/skills/skills/social-media-seo/databases/hook-formulas.csv +26 -0
- package/skills/skills/social-media-seo/databases/keyword-clusters.csv +11 -0
- package/skills/skills/social-media-seo/databases/thread-structures.csv +26 -0
- package/skills/skills/social-media-seo/databases/viral-patterns.csv +21 -0
- package/skills/skills/social-media-seo/references/analytics-guide.md +321 -0
- package/skills/skills/social-media-seo/references/instagram-seo.md +235 -0
- package/skills/skills/social-media-seo/references/threads-seo.md +305 -0
- package/skills/skills/social-media-seo/references/x-twitter-seo.md +337 -0
- package/skills/skills/social-media-seo/scripts/query_database.py +191 -0
- package/skills/skills/storyteller/SKILL.md +241 -0
- package/skills/skills/storyteller/references/transformation-methodology.md +293 -0
- package/skills/skills/storyteller/references/visual-vocabulary.md +177 -0
- package/skills/skills/thread-pro/SKILL.md +162 -0
- package/skills/skills/thread-pro/anti-ai-patterns.md +120 -0
- package/skills/skills/thread-pro/hook-formulas.md +138 -0
- package/skills/skills/thread-pro/references/anti-ai-patterns.md +120 -0
- package/skills/skills/thread-pro/references/hook-formulas.md +138 -0
- package/skills/skills/thread-pro/references/thread-structures.md +240 -0
- package/skills/skills/thread-pro/references/voice-injection.md +130 -0
- package/skills/skills/thread-pro/thread-structures.md +240 -0
- package/skills/skills/thread-pro/voice-injection.md +130 -0
- package/skills/skills/tinkering/SKILL.md +251 -0
- package/skills/skills/tinkering/references/graduation-checklist.md +100 -0
- package/skills/skills/validate-plan/.skillkit-mode +1 -0
- package/skills/skills/validate-plan/SKILL.md +406 -0
- package/skills/skills/validate-plan/references/dry-principles.md +251 -0
- package/skills/skills/validate-plan/references/gap-analysis-guide.md +320 -0
- package/skills/skills/validate-plan/references/tdd-patterns.md +413 -0
- package/skills/skills/validate-plan/references/yagni-checklist.md +330 -0
- package/skills/skills/verify-before-ship/.skillkit-mode +1 -0
- package/skills/skills/verify-before-ship/SKILL.md +116 -0
- package/skills/skills/verify-before-ship/references/anti-rationalization.md +212 -0
- package/skills/skills/verify-before-ship/references/verification-gates.md +305 -0
- package/skills-manifest.json +8 -2
- package/src/picker.js +11 -5
- package/src/picker.test.js +36 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Gap Analysis Guide
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Overview](#overview)
|
|
6
|
+
- [Analysis Framework](#analysis-framework)
|
|
7
|
+
- [Codebase Intelligence](#codebase-intelligence)
|
|
8
|
+
- [Gap Categories](#gap-categories)
|
|
9
|
+
- [Analysis Process](#analysis-process)
|
|
10
|
+
- [Common Gaps by Category](#common-gaps-by-category)
|
|
11
|
+
- [Report Template](#report-template)
|
|
12
|
+
- [Integration with Other Validations](#integration-with-other-validations)
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Gap analysis identifies missing requirements, potential disasters, and opportunities to prevent implementation failures before they happen.
|
|
17
|
+
|
|
18
|
+
## Analysis Framework
|
|
19
|
+
|
|
20
|
+
### 1. Technical Specification Gaps
|
|
21
|
+
|
|
22
|
+
#### Missing File Paths
|
|
23
|
+
**What to check:**
|
|
24
|
+
- Are all file paths exact and specific?
|
|
25
|
+
- Do paths follow project conventions?
|
|
26
|
+
- Are line numbers provided for modifications?
|
|
27
|
+
|
|
28
|
+
**Examples:**
|
|
29
|
+
```markdown
|
|
30
|
+
❌ "Create component file"
|
|
31
|
+
✅ "Create: `src/components/UserProfile.tsx`"
|
|
32
|
+
|
|
33
|
+
❌ "Update the service"
|
|
34
|
+
✅ "Modify: `src/services/user.ts:45-67`"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Vague Acceptance Criteria
|
|
38
|
+
**What to check:**
|
|
39
|
+
- Can success be objectively verified?
|
|
40
|
+
- Are edge cases defined?
|
|
41
|
+
- Are error conditions specified?
|
|
42
|
+
|
|
43
|
+
**Examples:**
|
|
44
|
+
```markdown
|
|
45
|
+
❌ "Implement user authentication"
|
|
46
|
+
✅ "User can log in with email/password. On success: redirect to /dashboard. On failure: show specific error message."
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Missing Implementation Details
|
|
50
|
+
**What to check:**
|
|
51
|
+
- Are algorithms specified?
|
|
52
|
+
- Are data structures defined?
|
|
53
|
+
- Are validation rules clear?
|
|
54
|
+
|
|
55
|
+
### 2. Architecture Gaps
|
|
56
|
+
|
|
57
|
+
#### Project Structure Violations
|
|
58
|
+
**Questions to ask:**
|
|
59
|
+
- Does the plan follow existing directory structure?
|
|
60
|
+
- Are files in the right location?
|
|
61
|
+
- Does it match established patterns?
|
|
62
|
+
|
|
63
|
+
**Check:**
|
|
64
|
+
```bash
|
|
65
|
+
# Common patterns to verify
|
|
66
|
+
src/components/ # UI components
|
|
67
|
+
src/services/ # Business logic
|
|
68
|
+
src/utils/ # Utilities
|
|
69
|
+
src/hooks/ # React hooks
|
|
70
|
+
src/lib/ # Shared libraries
|
|
71
|
+
tests/ # Test files
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Integration Gaps
|
|
75
|
+
**What to check:**
|
|
76
|
+
- How does this connect to existing systems?
|
|
77
|
+
- Are API contracts defined?
|
|
78
|
+
- Are database changes specified?
|
|
79
|
+
- Are environment variables documented?
|
|
80
|
+
|
|
81
|
+
#### Security Gaps
|
|
82
|
+
**What to check:**
|
|
83
|
+
- Authentication requirements
|
|
84
|
+
- Authorization rules
|
|
85
|
+
- Input validation
|
|
86
|
+
- Output sanitization
|
|
87
|
+
- Secrets management
|
|
88
|
+
|
|
89
|
+
### 3. Disaster Prevention
|
|
90
|
+
|
|
91
|
+
#### Breaking Changes
|
|
92
|
+
**What to detect:**
|
|
93
|
+
- API contract changes
|
|
94
|
+
- Database schema modifications
|
|
95
|
+
- Configuration changes
|
|
96
|
+
- Dependency updates
|
|
97
|
+
|
|
98
|
+
**Questions:**
|
|
99
|
+
- Will this break existing functionality?
|
|
100
|
+
- Is there a migration strategy?
|
|
101
|
+
- Are backward compatibility concerns addressed?
|
|
102
|
+
|
|
103
|
+
#### Performance Disasters
|
|
104
|
+
**What to check:**
|
|
105
|
+
- N+1 query patterns
|
|
106
|
+
- Unbounded data loading
|
|
107
|
+
- Missing pagination
|
|
108
|
+
- Inefficient algorithms
|
|
109
|
+
- Memory leaks
|
|
110
|
+
|
|
111
|
+
#### Error Handling Gaps
|
|
112
|
+
**What to check:**
|
|
113
|
+
- Are failure modes identified?
|
|
114
|
+
- Is there error recovery?
|
|
115
|
+
- Are retry strategies defined?
|
|
116
|
+
- Is there graceful degradation?
|
|
117
|
+
|
|
118
|
+
## Codebase Intelligence
|
|
119
|
+
|
|
120
|
+
### Previous Story Intelligence
|
|
121
|
+
|
|
122
|
+
When story_num > 1, extract:
|
|
123
|
+
- **Dev notes and learnings**
|
|
124
|
+
- **Review feedback**
|
|
125
|
+
- **Files created/modified**
|
|
126
|
+
- **Testing approaches**
|
|
127
|
+
- **Problems encountered**
|
|
128
|
+
|
|
129
|
+
### Git History Analysis
|
|
130
|
+
|
|
131
|
+
Look for patterns:
|
|
132
|
+
```bash
|
|
133
|
+
# Recent changes in related areas
|
|
134
|
+
git log --oneline --all -- "src/feature/"
|
|
135
|
+
|
|
136
|
+
# Files frequently modified together
|
|
137
|
+
git log --name-only --oneline | grep -A5 "feature"
|
|
138
|
+
|
|
139
|
+
# Code conventions from existing files
|
|
140
|
+
head -50 src/existing-similar-file.ts
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Existing Pattern Discovery
|
|
144
|
+
|
|
145
|
+
**Search for:**
|
|
146
|
+
1. Similar implementations
|
|
147
|
+
2. Shared utilities
|
|
148
|
+
3. Common patterns
|
|
149
|
+
4. Established conventions
|
|
150
|
+
|
|
151
|
+
## Gap Categories
|
|
152
|
+
|
|
153
|
+
### Critical (Must Fix)
|
|
154
|
+
|
|
155
|
+
**Definition:** Issues that will cause implementation failure or significant problems.
|
|
156
|
+
|
|
157
|
+
**Examples:**
|
|
158
|
+
- Missing critical requirements
|
|
159
|
+
- Wrong technical approach
|
|
160
|
+
- Breaking changes not addressed
|
|
161
|
+
- Security vulnerabilities
|
|
162
|
+
- Missing error handling
|
|
163
|
+
|
|
164
|
+
### Warning (Should Fix)
|
|
165
|
+
|
|
166
|
+
**Definition:** Issues that could cause problems or reduce quality.
|
|
167
|
+
|
|
168
|
+
**Examples:**
|
|
169
|
+
- Incomplete acceptance criteria
|
|
170
|
+
- Missing edge cases
|
|
171
|
+
- Vague implementation details
|
|
172
|
+
- Missing tests for error conditions
|
|
173
|
+
|
|
174
|
+
### Info (Nice to Have)
|
|
175
|
+
|
|
176
|
+
**Definition:** Suggestions for improvement.
|
|
177
|
+
|
|
178
|
+
**Examples:**
|
|
179
|
+
- Performance optimization hints
|
|
180
|
+
- Better naming suggestions
|
|
181
|
+
- Additional documentation
|
|
182
|
+
- Alternative approaches
|
|
183
|
+
|
|
184
|
+
## Analysis Process
|
|
185
|
+
|
|
186
|
+
### Step 1: Load All Context
|
|
187
|
+
|
|
188
|
+
1. **Load the plan file**
|
|
189
|
+
2. **Load related epics/requirements**
|
|
190
|
+
3. **Load architecture documentation**
|
|
191
|
+
4. **Scan codebase for patterns**
|
|
192
|
+
|
|
193
|
+
### Step 2: Systematic Review
|
|
194
|
+
|
|
195
|
+
For each task in the plan:
|
|
196
|
+
1. Check for exact file paths
|
|
197
|
+
2. Verify test-first approach
|
|
198
|
+
3. Validate acceptance criteria
|
|
199
|
+
4. Check for DRY violations
|
|
200
|
+
5. Check for YAGNI violations
|
|
201
|
+
6. Identify missing requirements
|
|
202
|
+
|
|
203
|
+
### Step 3: Cross-Reference
|
|
204
|
+
|
|
205
|
+
1. **Against requirements:** Is everything covered?
|
|
206
|
+
2. **Against architecture:** Does it fit?
|
|
207
|
+
3. **Against patterns:** Is it consistent?
|
|
208
|
+
4. **Against previous work:** Are learnings applied?
|
|
209
|
+
|
|
210
|
+
### Step 4: Generate Findings
|
|
211
|
+
|
|
212
|
+
Document each finding with:
|
|
213
|
+
- **Location:** Where in the plan
|
|
214
|
+
- **Issue:** What's missing or wrong
|
|
215
|
+
- **Impact:** Critical/Warning/Info
|
|
216
|
+
- **Recommendation:** How to fix it
|
|
217
|
+
|
|
218
|
+
## Common Gaps by Category
|
|
219
|
+
|
|
220
|
+
### Frontend Implementation
|
|
221
|
+
|
|
222
|
+
**Often Missing:**
|
|
223
|
+
- Loading states
|
|
224
|
+
- Error boundaries
|
|
225
|
+
- Empty states
|
|
226
|
+
- Responsive considerations
|
|
227
|
+
- Accessibility requirements
|
|
228
|
+
- Analytics/tracking
|
|
229
|
+
|
|
230
|
+
**Check for:**
|
|
231
|
+
- Form validation feedback
|
|
232
|
+
- API error handling
|
|
233
|
+
- State management approach
|
|
234
|
+
- Component composition
|
|
235
|
+
|
|
236
|
+
### Backend Implementation
|
|
237
|
+
|
|
238
|
+
**Often Missing:**
|
|
239
|
+
- Input validation
|
|
240
|
+
- Error response format
|
|
241
|
+
- Rate limiting
|
|
242
|
+
- Logging strategy
|
|
243
|
+
- Transaction boundaries
|
|
244
|
+
- Database indexing
|
|
245
|
+
|
|
246
|
+
**Check for:**
|
|
247
|
+
- Authentication/authorization
|
|
248
|
+
- API versioning
|
|
249
|
+
- Pagination
|
|
250
|
+
- Caching strategy
|
|
251
|
+
|
|
252
|
+
### Database Changes
|
|
253
|
+
|
|
254
|
+
**Often Missing:**
|
|
255
|
+
- Migration scripts
|
|
256
|
+
- Rollback strategy
|
|
257
|
+
- Index considerations
|
|
258
|
+
- Data migration
|
|
259
|
+
- Constraint definitions
|
|
260
|
+
|
|
261
|
+
**Check for:**
|
|
262
|
+
- Schema documentation
|
|
263
|
+
- Relationship definitions
|
|
264
|
+
- Cascade rules
|
|
265
|
+
- Audit trail
|
|
266
|
+
|
|
267
|
+
### Testing
|
|
268
|
+
|
|
269
|
+
**Often Missing:**
|
|
270
|
+
- Edge case tests
|
|
271
|
+
- Error condition tests
|
|
272
|
+
- Integration tests
|
|
273
|
+
- Performance tests
|
|
274
|
+
- Accessibility tests
|
|
275
|
+
|
|
276
|
+
**Check for:**
|
|
277
|
+
- Test data setup
|
|
278
|
+
- Mock strategy
|
|
279
|
+
- Coverage requirements
|
|
280
|
+
- CI/CD integration
|
|
281
|
+
|
|
282
|
+
## Report Template
|
|
283
|
+
|
|
284
|
+
```markdown
|
|
285
|
+
## Gap Analysis: [Feature Name]
|
|
286
|
+
|
|
287
|
+
### Critical Gaps
|
|
288
|
+
1. **[Location]:** [Issue]
|
|
289
|
+
- **Impact:** [Why this matters]
|
|
290
|
+
- **Fix:** [Specific recommendation]
|
|
291
|
+
|
|
292
|
+
### Warning Gaps
|
|
293
|
+
1. **[Location]:** [Issue]
|
|
294
|
+
- **Impact:** [Why this matters]
|
|
295
|
+
- **Fix:** [Specific recommendation]
|
|
296
|
+
|
|
297
|
+
### Info Gaps
|
|
298
|
+
1. **[Location]:** [Issue]
|
|
299
|
+
- **Suggestion:** [Improvement idea]
|
|
300
|
+
|
|
301
|
+
### Codebase Context
|
|
302
|
+
- **Reusable components:** [List]
|
|
303
|
+
- **Established patterns:** [List]
|
|
304
|
+
- **Previous learnings:** [List]
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Integration with Other Validations
|
|
308
|
+
|
|
309
|
+
### DRY + Gap Analysis
|
|
310
|
+
- Check for missing reuse opportunities
|
|
311
|
+
- Identify where existing patterns should be applied
|
|
312
|
+
|
|
313
|
+
### YAGNI + Gap Analysis
|
|
314
|
+
- Detect missing scope boundaries
|
|
315
|
+
- Identify premature abstractions
|
|
316
|
+
|
|
317
|
+
### TDD + Gap Analysis
|
|
318
|
+
- Find missing test cases
|
|
319
|
+
- Identify untested error conditions
|
|
320
|
+
- Check for missing test infrastructure
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# TDD Patterns - Test-Driven Development Guidelines
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [What is TDD?](#what-is-tdd)
|
|
6
|
+
- [The Red-Green-Refactor Cycle](#the-red-green-refactor-cycle)
|
|
7
|
+
- [TDD in Plans](#tdd-in-plans)
|
|
8
|
+
- [Common TDD Violations](#common-tdd-violations)
|
|
9
|
+
- [Plan Validation Checklist](#plan-validation-checklist)
|
|
10
|
+
- [Red Flags in Plans](#red-flags-in-plans)
|
|
11
|
+
- [TDD Task Patterns](#tdd-task-patterns)
|
|
12
|
+
- [Test Coverage Expectations](#test-coverage-expectations)
|
|
13
|
+
- [Commits in TDD](#commits-in-tdd)
|
|
14
|
+
- [Framework-Specific Patterns](#framework-specific-patterns)
|
|
15
|
+
- [Validation Examples](#validation-examples)
|
|
16
|
+
|
|
17
|
+
## What is TDD?
|
|
18
|
+
|
|
19
|
+
**Test-Driven Development (TDD)** is a software development process where tests are written before the implementation code, following the **Red-Green-Refactor** cycle.
|
|
20
|
+
|
|
21
|
+
## The Red-Green-Refactor Cycle
|
|
22
|
+
|
|
23
|
+
### 1. RED - Write a failing test
|
|
24
|
+
- Write a test for the next bit of functionality
|
|
25
|
+
- Run the test and watch it fail
|
|
26
|
+
- Verify the failure message is meaningful
|
|
27
|
+
|
|
28
|
+
### 2. GREEN - Make it pass
|
|
29
|
+
- Write minimal code to make the test pass
|
|
30
|
+
- Focus on correctness, not elegance
|
|
31
|
+
- All tests should pass now
|
|
32
|
+
|
|
33
|
+
### 3. REFACTOR - Improve the code
|
|
34
|
+
- Clean up the implementation
|
|
35
|
+
- Improve design without changing behavior
|
|
36
|
+
- Keep tests passing
|
|
37
|
+
|
|
38
|
+
## TDD in Plans
|
|
39
|
+
|
|
40
|
+
### Correct TDD Task Structure
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
### Task N: [Feature Component]
|
|
44
|
+
|
|
45
|
+
**Files:**
|
|
46
|
+
- Create: `src/path/to/file.ts`
|
|
47
|
+
- Test: `src/path/to/file.test.ts`
|
|
48
|
+
|
|
49
|
+
**Step 1: Write the failing test**
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
describe('ComponentName', () => {
|
|
53
|
+
it('should do X when Y', () => {
|
|
54
|
+
const result = functionUnderTest(input);
|
|
55
|
+
expect(result).toBe(expectedOutput);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Step 2: Run test to verify it fails**
|
|
61
|
+
|
|
62
|
+
Run: `npm test ComponentName.test.ts`
|
|
63
|
+
Expected: FAIL - "functionUnderTest is not defined"
|
|
64
|
+
|
|
65
|
+
**Step 3: Write minimal implementation**
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
export function functionUnderTest(input) {
|
|
69
|
+
return expectedOutput;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Step 4: Run test to verify it passes**
|
|
74
|
+
|
|
75
|
+
Run: `npm test ComponentName.test.ts`
|
|
76
|
+
Expected: PASS
|
|
77
|
+
|
|
78
|
+
**Step 5: Refactor if needed**
|
|
79
|
+
|
|
80
|
+
[Refactoring steps if applicable]
|
|
81
|
+
|
|
82
|
+
**Step 6: Commit**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git add .
|
|
86
|
+
git commit -m "feat: add functionUnderTest"
|
|
87
|
+
```
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Common TDD Violations
|
|
91
|
+
|
|
92
|
+
### 1. Testing After Implementation
|
|
93
|
+
|
|
94
|
+
**❌ Violation:**
|
|
95
|
+
```markdown
|
|
96
|
+
### Task 1: Implement feature
|
|
97
|
+
- Write all the code
|
|
98
|
+
|
|
99
|
+
### Task 5: Add tests
|
|
100
|
+
- Write tests for the code
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**✅ Correct:**
|
|
104
|
+
```markdown
|
|
105
|
+
### Task 1: Feature X
|
|
106
|
+
**Step 1:** Write failing test
|
|
107
|
+
**Step 2:** Run test (expect FAIL)
|
|
108
|
+
**Step 3:** Write minimal code
|
|
109
|
+
**Step 4:** Run test (expect PASS)
|
|
110
|
+
**Step 5:** Commit
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 2. Missing Red Phase
|
|
114
|
+
|
|
115
|
+
**❌ Violation:**
|
|
116
|
+
```markdown
|
|
117
|
+
**Step 1:** Write test
|
|
118
|
+
**Step 2:** Run test
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**✅ Correct:**
|
|
122
|
+
```markdown
|
|
123
|
+
**Step 1:** Write failing test
|
|
124
|
+
**Step 2:** Run test - Expected: FAIL with "[specific error]"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 3. Vague Test Instructions
|
|
128
|
+
|
|
129
|
+
**❌ Violation:**
|
|
130
|
+
```markdown
|
|
131
|
+
- Write tests for the component
|
|
132
|
+
- Make sure it works
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**✅ Correct:**
|
|
136
|
+
```markdown
|
|
137
|
+
- Write test: "when user is authenticated, show dashboard"
|
|
138
|
+
- Write test: "when user is not authenticated, redirect to login"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 4. Big Bang Implementation
|
|
142
|
+
|
|
143
|
+
**❌ Violation:**
|
|
144
|
+
```markdown
|
|
145
|
+
### Task 1: Build entire feature
|
|
146
|
+
- Implement all components
|
|
147
|
+
- Add all tests at the end
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**✅ Correct:**
|
|
151
|
+
```markdown
|
|
152
|
+
### Task 1: Component A - test & implement
|
|
153
|
+
### Task 2: Component B - test & implement
|
|
154
|
+
### Task 3: Integration - test & implement
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Plan Validation Checklist
|
|
158
|
+
|
|
159
|
+
### For Each Task
|
|
160
|
+
|
|
161
|
+
- [ ] Is there a test step BEFORE implementation?
|
|
162
|
+
- [ ] Is the expected failure specified?
|
|
163
|
+
- [ ] Is the exact test command provided?
|
|
164
|
+
- [ ] Is the expected pass output specified?
|
|
165
|
+
- [ ] Is there a commit step after tests pass?
|
|
166
|
+
|
|
167
|
+
### Test Structure
|
|
168
|
+
|
|
169
|
+
- [ ] Are test descriptions specific?
|
|
170
|
+
- [ ] Do tests cover edge cases?
|
|
171
|
+
- [ ] Is there a test for error conditions?
|
|
172
|
+
- [ ] Are tests independent of each other?
|
|
173
|
+
|
|
174
|
+
### Implementation Steps
|
|
175
|
+
|
|
176
|
+
- [ ] Is implementation minimal to pass tests?
|
|
177
|
+
- [ ] Is refactoring explicitly mentioned?
|
|
178
|
+
- [ ] Are there implementation examples?
|
|
179
|
+
- [ ] Is the scope appropriate (not too large)?
|
|
180
|
+
|
|
181
|
+
## Red Flags in Plans
|
|
182
|
+
|
|
183
|
+
### Critical (Must Fix)
|
|
184
|
+
- Tests mentioned only at the end
|
|
185
|
+
- No specific test commands
|
|
186
|
+
- Implementation without test steps
|
|
187
|
+
- Missing expected failure verification
|
|
188
|
+
|
|
189
|
+
### Warning (Should Improve)
|
|
190
|
+
- Tests in separate section from implementation
|
|
191
|
+
- Vague test descriptions
|
|
192
|
+
- No commit after test milestones
|
|
193
|
+
- Missing edge case coverage
|
|
194
|
+
|
|
195
|
+
### Info (Nice to Have)
|
|
196
|
+
- Could add more specific test cases
|
|
197
|
+
- Could include performance tests
|
|
198
|
+
- Could add integration test examples
|
|
199
|
+
|
|
200
|
+
## TDD Task Patterns
|
|
201
|
+
|
|
202
|
+
### Pattern 1: New Function/Method
|
|
203
|
+
|
|
204
|
+
```markdown
|
|
205
|
+
**Step 1:** Write failing test
|
|
206
|
+
```typescript
|
|
207
|
+
expect(calculateTotal([1, 2, 3])).toBe(6);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Step 2:** Run test - Expected: "calculateTotal is not defined"
|
|
211
|
+
|
|
212
|
+
**Step 3:** Write minimal implementation
|
|
213
|
+
```typescript
|
|
214
|
+
export const calculateTotal = (items) => items.reduce((a, b) => a + b, 0);
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Step 4:** Run test - Expected: PASS
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Pattern 2: Component Rendering
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
**Step 1:** Write failing test
|
|
224
|
+
```typescript
|
|
225
|
+
render(<Button>Click me</Button>);
|
|
226
|
+
expect(screen.getByText('Click me')).toBeInTheDocument();
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Step 2:** Run test - Expected: "Button is not defined"
|
|
230
|
+
|
|
231
|
+
**Step 3:** Write minimal implementation
|
|
232
|
+
```tsx
|
|
233
|
+
export const Button = ({ children }) => <button>{children}</button>;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Step 4:** Run test - Expected: PASS
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Pattern 3: API Endpoint
|
|
240
|
+
|
|
241
|
+
```markdown
|
|
242
|
+
**Step 1:** Write failing test
|
|
243
|
+
```typescript
|
|
244
|
+
const response = await request(app).get('/api/users');
|
|
245
|
+
expect(response.status).toBe(200);
|
|
246
|
+
expect(response.body).toEqual([{ id: 1, name: 'John' }]);
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Step 2:** Run test - Expected: "Cannot GET /api/users"
|
|
250
|
+
|
|
251
|
+
**Step 3:** Write minimal implementation
|
|
252
|
+
```typescript
|
|
253
|
+
app.get('/api/users', (req, res) => {
|
|
254
|
+
res.json([{ id: 1, name: 'John' }]);
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Step 4:** Run test - Expected: PASS
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Test Coverage Expectations
|
|
262
|
+
|
|
263
|
+
### Minimum Coverage
|
|
264
|
+
|
|
265
|
+
| Component Type | Minimum Tests |
|
|
266
|
+
|----------------|---------------|
|
|
267
|
+
| Utility function | 1 success, 1 failure case |
|
|
268
|
+
| React component | Render, interaction, edge case |
|
|
269
|
+
| API endpoint | Success, error, validation |
|
|
270
|
+
| Database model | Create, read, update, delete |
|
|
271
|
+
|
|
272
|
+
### Edge Cases to Test
|
|
273
|
+
|
|
274
|
+
1. **Empty/null inputs**
|
|
275
|
+
```typescript
|
|
276
|
+
expect(processItems([])).toEqual([]);
|
|
277
|
+
expect(processItems(null)).toThrow();
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
2. **Boundary values**
|
|
281
|
+
```typescript
|
|
282
|
+
expect(validateAge(0)).toBe(false);
|
|
283
|
+
expect(validateAge(120)).toBe(true);
|
|
284
|
+
expect(validateAge(121)).toBe(false);
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
3. **Error conditions**
|
|
288
|
+
```typescript
|
|
289
|
+
expect(() => divide(10, 0)).toThrow('Division by zero');
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Commits in TDD
|
|
293
|
+
|
|
294
|
+
### Commit Granularity
|
|
295
|
+
|
|
296
|
+
**After each test passes:**
|
|
297
|
+
```bash
|
|
298
|
+
git commit -m "test: add failing test for [feature]"
|
|
299
|
+
git commit -m "feat: implement [feature] to pass tests"
|
|
300
|
+
git commit -m "refactor: simplify [feature] implementation"
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Commit Messages
|
|
304
|
+
|
|
305
|
+
| Phase | Message Format |
|
|
306
|
+
|-------|----------------|
|
|
307
|
+
| Red | `test: add failing test for [feature]` |
|
|
308
|
+
| Green | `feat: implement [feature]` |
|
|
309
|
+
| Refactor | `refactor: improve [feature]` |
|
|
310
|
+
|
|
311
|
+
## Framework-Specific Patterns
|
|
312
|
+
|
|
313
|
+
### Jest
|
|
314
|
+
|
|
315
|
+
```markdown
|
|
316
|
+
**Step 1:** Write test
|
|
317
|
+
```typescript
|
|
318
|
+
describe('Feature', () => {
|
|
319
|
+
it('should do X', () => {
|
|
320
|
+
expect(result).toBe(expected);
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Step 2:** Run `jest Feature.test.ts`
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Vitest
|
|
329
|
+
|
|
330
|
+
```markdown
|
|
331
|
+
**Step 1:** Write test
|
|
332
|
+
```typescript
|
|
333
|
+
import { describe, it, expect } from 'vitest';
|
|
334
|
+
|
|
335
|
+
describe('Feature', () => {
|
|
336
|
+
it('should do X', () => {
|
|
337
|
+
expect(result).toBe(expected);
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
**Step 2:** Run `vitest run Feature.test.ts`
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### pytest
|
|
346
|
+
|
|
347
|
+
```markdown
|
|
348
|
+
**Step 1:** Write test
|
|
349
|
+
```python
|
|
350
|
+
def test_feature_does_x():
|
|
351
|
+
result = function()
|
|
352
|
+
assert result == expected
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**Step 2:** Run `pytest test_feature.py::test_feature_does_x -v`
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Validation Examples
|
|
359
|
+
|
|
360
|
+
### Example 1: Missing TDD Structure
|
|
361
|
+
|
|
362
|
+
**Plan says:**
|
|
363
|
+
```markdown
|
|
364
|
+
### Task 1: Implement login
|
|
365
|
+
- Create login form
|
|
366
|
+
- Add validation
|
|
367
|
+
- Write tests
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Issue:** Tests after implementation
|
|
371
|
+
|
|
372
|
+
**Recommendation:**
|
|
373
|
+
```markdown
|
|
374
|
+
### Task 1: Login form
|
|
375
|
+
**Step 1:** Write failing test for form rendering
|
|
376
|
+
**Step 2:** Run test (expect FAIL)
|
|
377
|
+
**Step 3:** Create minimal LoginForm component
|
|
378
|
+
**Step 4:** Run test (expect PASS)
|
|
379
|
+
**Step 5:** Commit
|
|
380
|
+
|
|
381
|
+
### Task 2: Form validation
|
|
382
|
+
**Step 1:** Write failing test for validation
|
|
383
|
+
...
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Example 2: Vague Test Step
|
|
387
|
+
|
|
388
|
+
**Plan says:**
|
|
389
|
+
```markdown
|
|
390
|
+
- Write tests for the feature
|
|
391
|
+
- Run tests
|
|
392
|
+
- Implement feature
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Issue:** No specific tests, no expected outcomes
|
|
396
|
+
|
|
397
|
+
**Recommendation:**
|
|
398
|
+
```markdown
|
|
399
|
+
**Step 1:** Write failing tests
|
|
400
|
+
```typescript
|
|
401
|
+
it('rejects invalid email', () => {
|
|
402
|
+
expect(validateEmail('invalid')).toBe(false);
|
|
403
|
+
});
|
|
404
|
+
it('accepts valid email', () => {
|
|
405
|
+
expect(validateEmail('user@example.com')).toBe(true);
|
|
406
|
+
});
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**Step 2:** Run tests - Expected: "validateEmail is not defined"
|
|
410
|
+
|
|
411
|
+
**Step 3:** Implement validateEmail function
|
|
412
|
+
...
|
|
413
|
+
```
|