@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,406 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: validate-plan
|
|
3
|
+
description: Validate implementation plans against DRY, YAGNI, TDD principles and best practices. Use when reviewing development plans created by writing-plans or similar planning workflows to identify gaps, anti-patterns, and improvement opportunities before execution.
|
|
4
|
+
category: planning
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Validate Plan
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Comprehensive validation workflow for development implementation plans. This skill systematically analyzes plans against DRY (Don't Repeat Yourself), YAGNI (You Aren't Gonna Need It), and TDD (Test-Driven Development) principles while performing codebase-aware gap analysis to prevent implementation disasters.
|
|
12
|
+
|
|
13
|
+
**Use when:**
|
|
14
|
+
- Reviewing implementation plans created by /writing-plans
|
|
15
|
+
- Validating development plans before execution
|
|
16
|
+
- Checking plans for DRY/YAGNI/TDD compliance
|
|
17
|
+
- Preventing over-engineering and scope creep
|
|
18
|
+
- Ensuring test-first approach in development workflow
|
|
19
|
+
|
|
20
|
+
**Triggers:** `/validate-plan` or "Validate this implementation plan"
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Validation Workflow
|
|
25
|
+
|
|
26
|
+
### Step 1: Plan Discovery
|
|
27
|
+
|
|
28
|
+
**Ask user:** "Which plan should I validate? (Provide file path or plan name)"
|
|
29
|
+
|
|
30
|
+
If user provides plan:
|
|
31
|
+
1. Load plan file
|
|
32
|
+
2. Extract metadata: feature name, tech stack, hypothesis
|
|
33
|
+
3. Identify all tasks and their structure
|
|
34
|
+
|
|
35
|
+
### Step 2: Codebase Analysis
|
|
36
|
+
|
|
37
|
+
**Scan existing codebase for:**
|
|
38
|
+
- Existing implementations of similar functionality
|
|
39
|
+
- Reusable components, utilities, patterns
|
|
40
|
+
- Project structure and conventions
|
|
41
|
+
- Test patterns and frameworks
|
|
42
|
+
- Previous implementations that could be referenced
|
|
43
|
+
|
|
44
|
+
**Key questions:**
|
|
45
|
+
- What functionality already exists that could be reused?
|
|
46
|
+
- What patterns are established in the codebase?
|
|
47
|
+
- Where should new files be placed?
|
|
48
|
+
- What testing approach is already used?
|
|
49
|
+
|
|
50
|
+
### Step 3: DRY Validation
|
|
51
|
+
|
|
52
|
+
**Checklist for Don't Repeat Yourself:**
|
|
53
|
+
|
|
54
|
+
| Check | Description | Finding Level |
|
|
55
|
+
|-------|-------------|---------------|
|
|
56
|
+
| **Functionality Check** | Does the plan propose implementing functionality that already exists? | CRITICAL |
|
|
57
|
+
| **Code Reuse** | Are there existing utilities/components that could be reused? | CRITICAL |
|
|
58
|
+
| **Abstraction** | Does the plan duplicate similar patterns without abstraction? | WARNING |
|
|
59
|
+
| **Library Choice** | Is the plan using the same libraries already in the project? | INFO |
|
|
60
|
+
|
|
61
|
+
**Common DRY violations to detect:**
|
|
62
|
+
- Creating new validation logic when validation utilities exist
|
|
63
|
+
- Reimplementing API clients when shared clients exist
|
|
64
|
+
- Duplicating UI components instead of extending existing ones
|
|
65
|
+
- Writing new auth logic when auth system exists
|
|
66
|
+
|
|
67
|
+
### Step 4: YAGNI Validation
|
|
68
|
+
|
|
69
|
+
**Checklist for You Aren't Gonna Need It:**
|
|
70
|
+
|
|
71
|
+
| Check | Description | Finding Level |
|
|
72
|
+
|-------|-------------|---------------|
|
|
73
|
+
| **Over-abstraction** | Does the plan create abstractions without concrete use cases? | WARNING |
|
|
74
|
+
| **Future-proofing** | Are there features planned for hypothetical future needs? | WARNING |
|
|
75
|
+
| **Complexity** | Is the solution more complex than the problem requires? | CRITICAL |
|
|
76
|
+
| **Scope Creep** | Are there tasks outside the core requirement? | WARNING |
|
|
77
|
+
|
|
78
|
+
**Common YAGNI violations to detect:**
|
|
79
|
+
- Creating plugin architectures when no plugins are planned
|
|
80
|
+
- Adding configuration options that won't be changed
|
|
81
|
+
- Building admin interfaces before user features are proven
|
|
82
|
+
- Optimizing for scale before product-market fit
|
|
83
|
+
|
|
84
|
+
### Step 5: TDD Validation
|
|
85
|
+
|
|
86
|
+
**Checklist for Test-Driven Development:**
|
|
87
|
+
|
|
88
|
+
| Check | Description | Finding Level |
|
|
89
|
+
|-------|-------------|---------------|
|
|
90
|
+
| **Test-First** | Are tests written BEFORE implementation? | CRITICAL |
|
|
91
|
+
| **Red-Green** | Does each task follow red-green-refactor cycle? | CRITICAL |
|
|
92
|
+
| **Test Commands** | Are exact test commands specified with expected output? | WARNING |
|
|
93
|
+
| **Coverage** | Is there a clear testing strategy for each component? | WARNING |
|
|
94
|
+
| **Commits** | Are commits tied to test milestones? | INFO |
|
|
95
|
+
|
|
96
|
+
**TDD Anti-patterns to detect:**
|
|
97
|
+
- "Write tests" as a separate task at the end
|
|
98
|
+
- Implementation without corresponding test steps
|
|
99
|
+
- Vague test instructions without expected outcomes
|
|
100
|
+
- Missing edge case testing
|
|
101
|
+
|
|
102
|
+
### Step 6: Gap Analysis
|
|
103
|
+
|
|
104
|
+
**Technical Specification Gaps:**
|
|
105
|
+
- Missing exact file paths
|
|
106
|
+
- Unclear acceptance criteria
|
|
107
|
+
- Vague implementation details
|
|
108
|
+
- Missing error handling specifications
|
|
109
|
+
- No rollback/contingency plans
|
|
110
|
+
|
|
111
|
+
**Architecture Gaps:**
|
|
112
|
+
- Wrong file locations (violating project structure)
|
|
113
|
+
- Missing integration patterns
|
|
114
|
+
- No database schema changes specified
|
|
115
|
+
- Missing API contract details
|
|
116
|
+
|
|
117
|
+
**Disaster Prevention:**
|
|
118
|
+
- Breaking changes not identified
|
|
119
|
+
- Missing security considerations
|
|
120
|
+
- No performance requirements
|
|
121
|
+
- Missing dependency analysis
|
|
122
|
+
|
|
123
|
+
### Step 7: Generate Validation Report
|
|
124
|
+
|
|
125
|
+
**Report Structure:**
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
# Plan Validation Report: [Feature Name]
|
|
129
|
+
|
|
130
|
+
## Executive Summary
|
|
131
|
+
- **Critical Issues:** [N] blockers must be fixed
|
|
132
|
+
- **Warnings:** [N] improvements recommended
|
|
133
|
+
- **Info:** [N] suggestions for enhancement
|
|
134
|
+
- **Overall Grade:** [A-F]
|
|
135
|
+
|
|
136
|
+
## DRY Analysis
|
|
137
|
+
[Findings with specific recommendations]
|
|
138
|
+
|
|
139
|
+
## YAGNI Analysis
|
|
140
|
+
[Findings with specific recommendations]
|
|
141
|
+
|
|
142
|
+
## TDD Analysis
|
|
143
|
+
[Findings with specific recommendations]
|
|
144
|
+
|
|
145
|
+
## Gap Analysis
|
|
146
|
+
[Missing requirements and potential disasters]
|
|
147
|
+
|
|
148
|
+
## Codebase Context
|
|
149
|
+
[Reusable components, patterns found]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Step 8: Interactive Improvement
|
|
153
|
+
|
|
154
|
+
**Present findings to user:**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
🎯 **PLAN VALIDATION COMPLETE**
|
|
158
|
+
|
|
159
|
+
Found [N] critical issues, [N] warnings, [N] info suggestions.
|
|
160
|
+
|
|
161
|
+
## 🚨 CRITICAL (Must Fix)
|
|
162
|
+
1. [Issue with specific location in plan]
|
|
163
|
+
2. [Issue with recommendation]
|
|
164
|
+
|
|
165
|
+
## ⚡ WARNINGS (Should Fix)
|
|
166
|
+
1. [Warning with explanation]
|
|
167
|
+
|
|
168
|
+
## ✨ INFO (Nice to Have)
|
|
169
|
+
1. [Suggestion]
|
|
170
|
+
|
|
171
|
+
**IMPROVEMENT OPTIONS:**
|
|
172
|
+
- **all** - Apply all suggested improvements
|
|
173
|
+
- **critical** - Apply only critical issues
|
|
174
|
+
- **select** - Choose specific items
|
|
175
|
+
- **none** - Keep plan as-is
|
|
176
|
+
- **details** - Show more details
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**After user selection:**
|
|
180
|
+
- Apply accepted changes to plan
|
|
181
|
+
- Ensure changes look natural (not "added" or "enhanced")
|
|
182
|
+
- Maintain original plan structure
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Validation Principles
|
|
187
|
+
|
|
188
|
+
### DRY - Don't Repeat Yourself
|
|
189
|
+
|
|
190
|
+
**Principle:** Every piece of knowledge must have a single, unambiguous representation.
|
|
191
|
+
|
|
192
|
+
**Validation Approach:**
|
|
193
|
+
- Search codebase for similar functionality
|
|
194
|
+
- Identify reuse opportunities
|
|
195
|
+
- Flag duplicate logic patterns
|
|
196
|
+
- Check for existing abstractions
|
|
197
|
+
|
|
198
|
+
**Questions to Ask:**
|
|
199
|
+
1. Is this functionality already implemented elsewhere?
|
|
200
|
+
2. Can this use existing utilities/components?
|
|
201
|
+
3. Should this be a shared abstraction?
|
|
202
|
+
4. Is this the right place for this logic?
|
|
203
|
+
|
|
204
|
+
### YAGNI - You Aren't Gonna Need It
|
|
205
|
+
|
|
206
|
+
**Principle:** Don't implement functionality until it's actually needed.
|
|
207
|
+
|
|
208
|
+
**Validation Approach:**
|
|
209
|
+
- Check for speculative features
|
|
210
|
+
- Identify over-engineering
|
|
211
|
+
- Flag premature optimization
|
|
212
|
+
- Detect scope creep
|
|
213
|
+
|
|
214
|
+
**Questions to Ask:**
|
|
215
|
+
1. Is this feature required for the current scope?
|
|
216
|
+
2. Is this abstraction solving a real problem?
|
|
217
|
+
3. Will this configuration ever be changed?
|
|
218
|
+
4. Is this optimization necessary now?
|
|
219
|
+
|
|
220
|
+
### TDD - Test-Driven Development
|
|
221
|
+
|
|
222
|
+
**Principle:** Write tests before implementation; red-green-refactor cycle.
|
|
223
|
+
|
|
224
|
+
**Validation Approach:**
|
|
225
|
+
- Verify test-first approach
|
|
226
|
+
- Check for red-green-refactor steps
|
|
227
|
+
- Validate test coverage
|
|
228
|
+
- Ensure commit granularity
|
|
229
|
+
|
|
230
|
+
**Questions to Ask:**
|
|
231
|
+
1. Is the test written before the implementation?
|
|
232
|
+
2. Does the plan specify expected test failures?
|
|
233
|
+
3. Are test commands exact with expected output?
|
|
234
|
+
4. Are commits at test milestones?
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Example Usage
|
|
239
|
+
|
|
240
|
+
### Input: Plan to Validate
|
|
241
|
+
|
|
242
|
+
```markdown
|
|
243
|
+
# User Authentication Implementation Plan
|
|
244
|
+
|
|
245
|
+
**Goal:** Add user login functionality
|
|
246
|
+
|
|
247
|
+
### Task 1: Create Login Component
|
|
248
|
+
|
|
249
|
+
**Files:**
|
|
250
|
+
- Create: `src/components/LoginForm.tsx`
|
|
251
|
+
|
|
252
|
+
**Step 1: Write test**
|
|
253
|
+
```typescript
|
|
254
|
+
// Test login form renders
|
|
255
|
+
describe('LoginForm', () => {
|
|
256
|
+
it('renders email and password inputs', () => {
|
|
257
|
+
render(<LoginForm />);
|
|
258
|
+
expect(screen.getByLabelText('Email')).toBeInTheDocument();
|
|
259
|
+
expect(screen.getByLabelText('Password')).toBeInTheDocument();
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Step 2: Run test to verify failure**
|
|
265
|
+
```bash
|
|
266
|
+
npm test LoginForm.test.tsx
|
|
267
|
+
```
|
|
268
|
+
Expected: FAIL - component not found
|
|
269
|
+
|
|
270
|
+
**Step 3: Implement minimal component**
|
|
271
|
+
```tsx
|
|
272
|
+
export function LoginForm() {
|
|
273
|
+
return (
|
|
274
|
+
<form>
|
|
275
|
+
<input name="email" />
|
|
276
|
+
<input name="password" type="password" />
|
|
277
|
+
</form>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Step 4: Run test to verify pass**
|
|
283
|
+
Expected: PASS
|
|
284
|
+
|
|
285
|
+
**Step 5: Commit**
|
|
286
|
+
```bash
|
|
287
|
+
git add .
|
|
288
|
+
git commit -m "feat: add LoginForm component with tests"
|
|
289
|
+
```
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Output: Validation Report
|
|
293
|
+
|
|
294
|
+
```markdown
|
|
295
|
+
# Plan Validation Report: User Authentication
|
|
296
|
+
|
|
297
|
+
## Executive Summary
|
|
298
|
+
- **Critical Issues:** 0
|
|
299
|
+
- **Warnings:** 1
|
|
300
|
+
- **Info:** 1
|
|
301
|
+
- **Overall Grade:** A
|
|
302
|
+
|
|
303
|
+
## DRY Analysis
|
|
304
|
+
- No duplicate functionality detected
|
|
305
|
+
- Consider using existing `Input` component from `src/components/ui/`
|
|
306
|
+
|
|
307
|
+
## YAGNI Analysis
|
|
308
|
+
- Clean implementation, no over-engineering detected
|
|
309
|
+
|
|
310
|
+
## TDD Analysis
|
|
311
|
+
- Follows red-green-refactor cycle
|
|
312
|
+
- Test commands are specific
|
|
313
|
+
- Minor: Add edge case test for invalid email format
|
|
314
|
+
|
|
315
|
+
## Codebase Context
|
|
316
|
+
- Existing `src/components/ui/Input.tsx` can be reused
|
|
317
|
+
- Auth utilities exist in `src/lib/auth.ts`
|
|
318
|
+
- Form validation pattern in `src/hooks/useForm.ts`
|
|
319
|
+
|
|
320
|
+
## Recommendations
|
|
321
|
+
1. **INFO:** Reuse `Input` component for consistency
|
|
322
|
+
2. **WARNING:** Add error handling test case
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Common Anti-Patterns to Detect
|
|
328
|
+
|
|
329
|
+
### Plan Structure Issues
|
|
330
|
+
|
|
331
|
+
1. **Missing acceptance criteria**
|
|
332
|
+
- ❌ "Implement the feature"
|
|
333
|
+
- ✅ "Feature accepts X input and returns Y output"
|
|
334
|
+
|
|
335
|
+
2. **Vague test instructions**
|
|
336
|
+
- ❌ "Write tests"
|
|
337
|
+
- ✅ "Write test: when input is invalid, show error message"
|
|
338
|
+
|
|
339
|
+
3. **Missing file paths**
|
|
340
|
+
- ❌ "Create component"
|
|
341
|
+
- ✅ "Create: `src/components/UserProfile.tsx`"
|
|
342
|
+
|
|
343
|
+
4. **Implementation without tests**
|
|
344
|
+
- ❌ Write code → Test later
|
|
345
|
+
- ✅ Write failing test → Make it pass → Refactor
|
|
346
|
+
|
|
347
|
+
### DRY Violations
|
|
348
|
+
|
|
349
|
+
1. **Reinventing utilities**
|
|
350
|
+
- ❌ Create new `formatDate()` when `date-fns` is available
|
|
351
|
+
- ✅ Use existing library
|
|
352
|
+
|
|
353
|
+
2. **Duplicate API logic**
|
|
354
|
+
- ❌ New fetch wrapper per component
|
|
355
|
+
- ✅ Use shared API client
|
|
356
|
+
|
|
357
|
+
### YAGNI Violations
|
|
358
|
+
|
|
359
|
+
1. **Premature abstraction**
|
|
360
|
+
- ❌ "Create plugin system for future extensions"
|
|
361
|
+
- ✅ Implement direct solution first
|
|
362
|
+
|
|
363
|
+
2. **Over-configuration**
|
|
364
|
+
- ❌ "Add 10 config options"
|
|
365
|
+
- ✅ Hardcode defaults, expose when needed
|
|
366
|
+
|
|
367
|
+
### TDD Violations
|
|
368
|
+
|
|
369
|
+
1. **Testing after implementation**
|
|
370
|
+
- ❌ Task 1: Implement → Task 5: Add tests
|
|
371
|
+
- ✅ Each task: Test → Implement → Commit
|
|
372
|
+
|
|
373
|
+
2. **Missing red phase**
|
|
374
|
+
- ❌ "Write test and run it"
|
|
375
|
+
- ✅ "Run test, verify it FAILS with expected error"
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Integration with Workflows
|
|
380
|
+
|
|
381
|
+
### With /writing-plans
|
|
382
|
+
|
|
383
|
+
After writing-plans creates a plan:
|
|
384
|
+
1. User runs `/validate-plan`
|
|
385
|
+
2. Load the generated plan
|
|
386
|
+
3. Perform comprehensive validation
|
|
387
|
+
4. Apply improvements if needed
|
|
388
|
+
5. Proceed to /executing-plans
|
|
389
|
+
|
|
390
|
+
### With /executing-plans
|
|
391
|
+
|
|
392
|
+
Validated plans have:
|
|
393
|
+
- Clear, testable steps
|
|
394
|
+
- Exact file paths
|
|
395
|
+
- Verified DRY/YAGNI/TDD compliance
|
|
396
|
+
- Lower risk of implementation issues
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Resources
|
|
401
|
+
|
|
402
|
+
### references/
|
|
403
|
+
- `references/dry-principles.md` - Detailed DRY guidelines
|
|
404
|
+
- `references/yagni-checklist.md` - YAGNI detection patterns
|
|
405
|
+
- `references/tdd-patterns.md` - TDD workflow patterns
|
|
406
|
+
- `references/gap-analysis-guide.md` - Comprehensive gap analysis framework
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# DRY Principles - Detailed Guidelines
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [What is DRY?](#what-is-dry)
|
|
6
|
+
- [DRY Violation Types](#dry-violation-types)
|
|
7
|
+
- [Codebase Scanning Checklist](#codebase-scanning-checklist)
|
|
8
|
+
- [Common Reuse Opportunities](#common-reuse-opportunities)
|
|
9
|
+
- [Plan Validation Questions](#plan-validation-questions)
|
|
10
|
+
- [Red Flags in Plans](#red-flags-in-plans)
|
|
11
|
+
- [Resolution Strategies](#resolution-strategies)
|
|
12
|
+
- [Examples](#examples)
|
|
13
|
+
|
|
14
|
+
## What is DRY?
|
|
15
|
+
|
|
16
|
+
**Don't Repeat Yourself (DRY)** is a principle stating that every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
|
|
17
|
+
|
|
18
|
+
## DRY Violation Types
|
|
19
|
+
|
|
20
|
+
### 1. Code Duplication
|
|
21
|
+
|
|
22
|
+
**Symptoms:**
|
|
23
|
+
- Copy-pasted code blocks
|
|
24
|
+
- Similar functions with minor variations
|
|
25
|
+
- Same logic in multiple places
|
|
26
|
+
|
|
27
|
+
**Detection:**
|
|
28
|
+
```python
|
|
29
|
+
# ❌ DRY Violation: Same validation in multiple places
|
|
30
|
+
def validate_user_email(email):
|
|
31
|
+
if not re.match(r'^[\w\.-]+@[\w\.-]+\.\w+$', email):
|
|
32
|
+
raise ValueError("Invalid email")
|
|
33
|
+
|
|
34
|
+
def validate_admin_email(email):
|
|
35
|
+
if not re.match(r'^[\w\.-]+@[\w\.-]+\.\w+$', email):
|
|
36
|
+
raise ValueError("Invalid email")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
# ✅ DRY: Single source of truth
|
|
41
|
+
EMAIL_REGEX = r'^[\w\.-]+@[\w\.-]+\.\w+$'
|
|
42
|
+
|
|
43
|
+
def validate_email(email):
|
|
44
|
+
if not re.match(EMAIL_REGEX, email):
|
|
45
|
+
raise ValueError("Invalid email")
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Knowledge Duplication
|
|
49
|
+
|
|
50
|
+
**Symptoms:**
|
|
51
|
+
- Business rules defined in multiple locations
|
|
52
|
+
- Same validation logic in frontend and backend
|
|
53
|
+
- Configuration scattered across files
|
|
54
|
+
|
|
55
|
+
**Detection:**
|
|
56
|
+
- Search for magic numbers/strings
|
|
57
|
+
- Check for parallel validation logic
|
|
58
|
+
- Look for configuration duplication
|
|
59
|
+
|
|
60
|
+
### 3. Structural Duplication
|
|
61
|
+
|
|
62
|
+
**Symptoms:**
|
|
63
|
+
- Similar component structures
|
|
64
|
+
- Repeated patterns without abstraction
|
|
65
|
+
- Boilerplate without templates/generics
|
|
66
|
+
|
|
67
|
+
## Codebase Scanning Checklist
|
|
68
|
+
|
|
69
|
+
When validating a plan, scan the codebase for:
|
|
70
|
+
|
|
71
|
+
### Utilities & Helpers
|
|
72
|
+
- [ ] Existing validation functions
|
|
73
|
+
- [ ] Date/time formatting utilities
|
|
74
|
+
- [ ] String manipulation helpers
|
|
75
|
+
- [ ] Number/currency formatters
|
|
76
|
+
- [ ] API request wrappers
|
|
77
|
+
- [ ] Error handling patterns
|
|
78
|
+
|
|
79
|
+
### Components & UI
|
|
80
|
+
- [ ] Input components
|
|
81
|
+
- [ ] Button variants
|
|
82
|
+
- [ ] Modal/dialog patterns
|
|
83
|
+
- [ ] Form wrappers
|
|
84
|
+
- [ ] List/table components
|
|
85
|
+
- [ ] Card/container patterns
|
|
86
|
+
|
|
87
|
+
### Business Logic
|
|
88
|
+
- [ ] Authentication/authorization
|
|
89
|
+
- [ ] Permission checks
|
|
90
|
+
- [ ] Data transformations
|
|
91
|
+
- [ ] Business rule validators
|
|
92
|
+
- [ ] State management patterns
|
|
93
|
+
|
|
94
|
+
### Infrastructure
|
|
95
|
+
- [ ] Database queries
|
|
96
|
+
- [ ] Cache implementations
|
|
97
|
+
- [ ] Logging patterns
|
|
98
|
+
- [ ] Configuration loading
|
|
99
|
+
|
|
100
|
+
## Common Reuse Opportunities
|
|
101
|
+
|
|
102
|
+
### 1. Form Validation
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// Check for existing validation schemas
|
|
106
|
+
// - Zod schemas
|
|
107
|
+
// - Yup validations
|
|
108
|
+
// - Joi validations
|
|
109
|
+
// - Class-validator decorators
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 2. API Clients
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
// Check for:
|
|
116
|
+
// - Axios instances
|
|
117
|
+
// - Fetch wrappers
|
|
118
|
+
// - GraphQL clients
|
|
119
|
+
// - gRPC clients
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 3. UI Components
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// Check for component libraries:
|
|
126
|
+
// - shadcn/ui
|
|
127
|
+
// - Material-UI
|
|
128
|
+
// - Ant Design
|
|
129
|
+
// - Custom design system
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 4. Hooks & Composables
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// Check for:
|
|
136
|
+
// - useFetch / useApi
|
|
137
|
+
// - useForm
|
|
138
|
+
// - useAuth
|
|
139
|
+
// - useLocalStorage
|
|
140
|
+
// - useDebounce
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Plan Validation Questions
|
|
144
|
+
|
|
145
|
+
For each proposed task in a plan, ask:
|
|
146
|
+
|
|
147
|
+
1. **Does functionality already exist?**
|
|
148
|
+
```bash
|
|
149
|
+
grep -r "function_name" src/
|
|
150
|
+
find . -name "*similar*" -type f
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
2. **Can we use existing utilities?**
|
|
154
|
+
```bash
|
|
155
|
+
ls src/utils/ src/lib/ src/helpers/
|
|
156
|
+
ls src/common/ src/shared/
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
3. **Are there similar patterns?**
|
|
160
|
+
```bash
|
|
161
|
+
git log --oneline --all -- "*similar-feature*"
|
|
162
|
+
grep -r "similar_pattern" src/ --include="*.ts"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
4. **Is this the right place?**
|
|
166
|
+
- Check project structure conventions
|
|
167
|
+
- Verify file organization patterns
|
|
168
|
+
- Confirm naming conventions
|
|
169
|
+
|
|
170
|
+
## Red Flags in Plans
|
|
171
|
+
|
|
172
|
+
### High Priority
|
|
173
|
+
- Creating new utilities without checking existing ones
|
|
174
|
+
- Implementing validation logic from scratch
|
|
175
|
+
- Creating new API clients
|
|
176
|
+
- Writing auth logic when auth system exists
|
|
177
|
+
|
|
178
|
+
### Medium Priority
|
|
179
|
+
- Not using shared types/interfaces
|
|
180
|
+
- Creating similar components without extending existing ones
|
|
181
|
+
- Duplicating configuration patterns
|
|
182
|
+
- Not leveraging existing hooks
|
|
183
|
+
|
|
184
|
+
### Low Priority
|
|
185
|
+
- Not using shared constants
|
|
186
|
+
- Missing opportunity for shared styling
|
|
187
|
+
- Not utilizing existing error handling
|
|
188
|
+
|
|
189
|
+
## Resolution Strategies
|
|
190
|
+
|
|
191
|
+
### When DRY Violation Found
|
|
192
|
+
|
|
193
|
+
1. **Identify the existing implementation**
|
|
194
|
+
- File location
|
|
195
|
+
- Function/component name
|
|
196
|
+
- How to import/use it
|
|
197
|
+
|
|
198
|
+
2. **Determine the right approach**
|
|
199
|
+
- Use existing implementation directly
|
|
200
|
+
- Extend existing implementation
|
|
201
|
+
- Refactor to share common logic
|
|
202
|
+
- Keep separate (if legitimately different)
|
|
203
|
+
|
|
204
|
+
3. **Update the plan**
|
|
205
|
+
- Replace with reuse instructions
|
|
206
|
+
- Add reference to existing code
|
|
207
|
+
- Update file paths
|
|
208
|
+
|
|
209
|
+
## Examples
|
|
210
|
+
|
|
211
|
+
### Example 1: Form Validation
|
|
212
|
+
|
|
213
|
+
**Plan says:**
|
|
214
|
+
```markdown
|
|
215
|
+
Create email validation logic in LoginForm
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**DRY Check:**
|
|
219
|
+
```bash
|
|
220
|
+
$ grep -r "validateEmail\|email.*validation" src/
|
|
221
|
+
src/utils/validation.ts: export const validateEmail = (email: string) => ...
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Recommendation:**
|
|
225
|
+
```markdown
|
|
226
|
+
Use existing validation from `src/utils/validation.ts`:
|
|
227
|
+
```typescript
|
|
228
|
+
import { validateEmail } from '@/utils/validation';
|
|
229
|
+
```
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Example 2: API Client
|
|
233
|
+
|
|
234
|
+
**Plan says:**
|
|
235
|
+
```markdown
|
|
236
|
+
Create fetch wrapper for API calls
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**DRY Check:**
|
|
240
|
+
```bash
|
|
241
|
+
$ ls src/lib/
|
|
242
|
+
api.ts axios.ts client.ts
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Recommendation:**
|
|
246
|
+
```markdown
|
|
247
|
+
Use existing API client from `src/lib/api.ts`:
|
|
248
|
+
```typescript
|
|
249
|
+
import { apiClient } from '@/lib/api';
|
|
250
|
+
```
|
|
251
|
+
```
|