@tinkcarlos/skillora 0.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/.claude/skills/.temp-skill-index.md +245 -0
- package/.claude/skills/SKILL.md +264 -0
- package/.claude/skills/api-scaffolding/SKILL.md +431 -0
- package/.claude/skills/api-scaffolding/agents/backend-architect.md +282 -0
- package/.claude/skills/api-scaffolding/agents/django-pro.md +144 -0
- package/.claude/skills/api-scaffolding/agents/fastapi-pro.md +156 -0
- package/.claude/skills/api-scaffolding/agents/graphql-architect.md +146 -0
- package/.claude/skills/api-scaffolding/skills/fastapi-templates/SKILL.md +171 -0
- package/.claude/skills/api-testing-observability/SKILL.md +583 -0
- package/.claude/skills/api-testing-observability/agents/api-documenter.md +146 -0
- package/.claude/skills/api-testing-observability/commands/api-mock.md +1320 -0
- package/.claude/skills/brainstorming/SKILL.md +283 -0
- package/.claude/skills/bug-fixing/SKILL.md +382 -0
- package/.claude/skills/bug-fixing/references/backend-guide.md +132 -0
- package/.claude/skills/bug-fixing/references/bug-guide.md +354 -0
- package/.claude/skills/bug-fixing/references/bug-record-template.md +134 -0
- package/.claude/skills/bug-fixing/references/bug-records.md +88 -0
- package/.claude/skills/bug-fixing/references/code-review-gate.md +81 -0
- package/.claude/skills/bug-fixing/references/common-bugs.md +140 -0
- package/.claude/skills/bug-fixing/references/complete-workflow.md +361 -0
- package/.claude/skills/bug-fixing/references/config-driven-fixes.md +136 -0
- package/.claude/skills/bug-fixing/references/context-isolation-protocol.md +268 -0
- package/.claude/skills/bug-fixing/references/cross-surface-regression.md +120 -0
- package/.claude/skills/bug-fixing/references/database-investigation.md +129 -0
- package/.claude/skills/bug-fixing/references/dependency-and-integrity-protocol.md +369 -0
- package/.claude/skills/bug-fixing/references/fix-completeness-checklist.md +239 -0
- package/.claude/skills/bug-fixing/references/frontend-guide.md +219 -0
- package/.claude/skills/bug-fixing/references/fullstack-joint-guide.md +123 -0
- package/.claude/skills/bug-fixing/references/functional-breakage.md +117 -0
- package/.claude/skills/bug-fixing/references/ide-lint-errors-guide.md +176 -0
- package/.claude/skills/bug-fixing/references/impact-analysis.md +511 -0
- package/.claude/skills/bug-fixing/references/investigation-checklist.md +263 -0
- package/.claude/skills/bug-fixing/references/knowledge-extraction-guide.md +531 -0
- package/.claude/skills/bug-fixing/references/knowledge-workflow.md +212 -0
- package/.claude/skills/bug-fixing/references/post-edit-quality-gate.md +30 -0
- package/.claude/skills/bug-fixing/references/python-env-and-testing.md +126 -0
- package/.claude/skills/bug-fixing/references/rca-guide.md +428 -0
- package/.claude/skills/bug-fixing/references/similar-bug-patterns.md +113 -0
- package/.claude/skills/bug-fixing/references/skill-delegation-guide.md +350 -0
- package/.claude/skills/bug-fixing/references/skill-orchestration.md +155 -0
- package/.claude/skills/bug-fixing/references/testing-strategy.md +350 -0
- package/.claude/skills/bug-fixing/references/tooling-build-scripts.md +162 -0
- package/.claude/skills/bug-fixing/references/user-input-validation.md +77 -0
- package/.claude/skills/bug-fixing/references/ux-patterns.md +158 -0
- package/.claude/skills/bug-fixing/references/windows-terminal-hygiene.md +106 -0
- package/.claude/skills/bug-fixing/references/zero-regression-matrix.md +239 -0
- package/.claude/skills/bug-fixing/references/zero-risk-protocol.md +102 -0
- package/.claude/skills/bug-fixing/scripts/format_code.py +611 -0
- package/.claude/skills/bug-fixing/scripts/generate_report_template.py +74 -0
- package/.claude/skills/bug-fixing/scripts/lint_check.py +816 -0
- package/.claude/skills/bug-fixing/scripts/requirements.txt +36 -0
- package/.claude/skills/cicd-pipeline/SKILL.md +300 -0
- package/.claude/skills/code-review/SKILL.md +535 -0
- package/.claude/skills/code-review/references/anti-pattern-scan.md +102 -0
- package/.claude/skills/code-review/references/automated-analysis.md +456 -0
- package/.claude/skills/code-review/references/backend-common-issues.md +589 -0
- package/.claude/skills/code-review/references/backend-expert-guide.md +415 -0
- package/.claude/skills/code-review/references/backend-review.md +868 -0
- package/.claude/skills/code-review/references/batch-processing-strategy.md +198 -0
- package/.claude/skills/code-review/references/call-chain-analysis-protocol.md +166 -0
- package/.claude/skills/code-review/references/common-patterns.md +321 -0
- package/.claude/skills/code-review/references/configuration-review.md +425 -0
- package/.claude/skills/code-review/references/control-flow-completeness.md +114 -0
- package/.claude/skills/code-review/references/database-review.md +298 -0
- package/.claude/skills/code-review/references/dependency-and-integrity-protocol.md +313 -0
- package/.claude/skills/code-review/references/external-standards.md +51 -0
- package/.claude/skills/code-review/references/feature-review.md +329 -0
- package/.claude/skills/code-review/references/file-review-template.md +326 -0
- package/.claude/skills/code-review/references/frontend-advanced.md +654 -0
- package/.claude/skills/code-review/references/frontend-common-issues.md +482 -0
- package/.claude/skills/code-review/references/frontend-expert-guide.md +342 -0
- package/.claude/skills/code-review/references/frontend-review.md +783 -0
- package/.claude/skills/code-review/references/fullstack-consistency.md +418 -0
- package/.claude/skills/code-review/references/fullstack-review.md +477 -0
- package/.claude/skills/code-review/references/functional-completeness.md +386 -0
- package/.claude/skills/code-review/references/hidden-bugs-detection.md +473 -0
- package/.claude/skills/code-review/references/ide-lint-errors-guide.md +173 -0
- package/.claude/skills/code-review/references/infrastructure-review.md +453 -0
- package/.claude/skills/code-review/references/iteration-review.md +264 -0
- package/.claude/skills/code-review/references/job-review.md +335 -0
- package/.claude/skills/code-review/references/layered-checklist-protocol.md +157 -0
- package/.claude/skills/code-review/references/logic-completeness.md +535 -0
- package/.claude/skills/code-review/references/mandatory-checklist.md +288 -0
- package/.claude/skills/code-review/references/multi-language-guide.md +800 -0
- package/.claude/skills/code-review/references/new-project-review.md +226 -0
- package/.claude/skills/code-review/references/non-code-files-review.md +451 -0
- package/.claude/skills/code-review/references/overlooked-issues.md +657 -0
- package/.claude/skills/code-review/references/platform-specific-review.md +195 -0
- package/.claude/skills/code-review/references/precision-analysis-protocol.md +260 -0
- package/.claude/skills/code-review/references/python-patterns.md +494 -0
- package/.claude/skills/code-review/references/rca-techniques.md +362 -0
- package/.claude/skills/code-review/references/report-template.md +430 -0
- package/.claude/skills/code-review/references/resource-limits-and-degradation.md +137 -0
- package/.claude/skills/code-review/references/review-dimensions.md +311 -0
- package/.claude/skills/code-review/references/review-guide.md +202 -0
- package/.claude/skills/code-review/references/review-knowledge-workflow.md +257 -0
- package/.claude/skills/code-review/references/review-progress-tracker-protocol.md +172 -0
- package/.claude/skills/code-review/references/review-record-template.md +195 -0
- package/.claude/skills/code-review/references/skill-orchestration.md +143 -0
- package/.claude/skills/code-review/references/ui-ux-review.md +470 -0
- package/.claude/skills/containerization/SKILL.md +313 -0
- package/.claude/skills/database-migrations/agents/database-admin.md +142 -0
- package/.claude/skills/database-migrations/agents/database-optimizer.md +144 -0
- package/.claude/skills/database-migrations/commands/migration-observability.md +408 -0
- package/.claude/skills/database-migrations/commands/sql-migrations.md +492 -0
- package/.claude/skills/finishing-a-development-branch/SKILL.md +319 -0
- package/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/.claude/skills/frontend-design/SKILL.md +587 -0
- package/.claude/skills/frontend-design/references/color-consistency.md +487 -0
- package/.claude/skills/frontend-design/references/color-palettes-full.md +657 -0
- package/.claude/skills/frontend-design/references/design-system-generator.md +285 -0
- package/.claude/skills/frontend-design/references/font-pairings-full.md +705 -0
- package/.claude/skills/frontend-design/references/industry-anti-patterns.md +281 -0
- package/.claude/skills/frontend-design/references/layout-anti-patterns.md +582 -0
- package/.claude/skills/frontend-design/references/motion-patterns.md +659 -0
- package/.claude/skills/frontend-design/references/pre-delivery-checklist.md +153 -0
- package/.claude/skills/frontend-design/references/responsive-design.md +555 -0
- package/.claude/skills/frontend-design/references/style-modification-rules.md +335 -0
- package/.claude/skills/frontend-design/references/ui-styles-full.md +383 -0
- package/.claude/skills/frontend-design/references/ui-styles-rating.md +191 -0
- package/.claude/skills/frontend-design/references/ux-guidelines.md +640 -0
- package/.claude/skills/fullstack-developer/SKILL.md +512 -0
- package/.claude/skills/fullstack-developer/references/api-contract-guide.md +312 -0
- package/.claude/skills/fullstack-developer/references/api-response-patterns.md +223 -0
- package/.claude/skills/fullstack-developer/references/async-patterns.md +220 -0
- package/.claude/skills/fullstack-developer/references/bug-prevention.md +914 -0
- package/.claude/skills/fullstack-developer/references/code-quality-checklist.md +271 -0
- package/.claude/skills/fullstack-developer/references/complete-development-workflow.md +278 -0
- package/.claude/skills/fullstack-developer/references/context-isolation-protocol.md +256 -0
- package/.claude/skills/fullstack-developer/references/database-migration.md +331 -0
- package/.claude/skills/fullstack-developer/references/dependency-and-integrity-protocol.md +390 -0
- package/.claude/skills/fullstack-developer/references/development-phases.md +333 -0
- package/.claude/skills/fullstack-developer/references/expert-guide.md +214 -0
- package/.claude/skills/fullstack-developer/references/file-import-patterns.md +114 -0
- package/.claude/skills/fullstack-developer/references/graceful-degradation-patterns.md +78 -0
- package/.claude/skills/fullstack-developer/references/ide-lint-errors-guide.md +183 -0
- package/.claude/skills/fullstack-developer/references/integration-testing.md +301 -0
- package/.claude/skills/fullstack-developer/references/mock-api-patterns.md +307 -0
- package/.claude/skills/fullstack-developer/references/phase-gate-template.md +249 -0
- package/.claude/skills/fullstack-developer/references/post-edit-quality-gate.md +30 -0
- package/.claude/skills/fullstack-developer/references/python-engineering.md +79 -0
- package/.claude/skills/fullstack-developer/references/skill-orchestration.md +214 -0
- package/.claude/skills/fullstack-developer/references/skill-router-table.md +304 -0
- package/.claude/skills/fullstack-developer/references/state-sync.md +217 -0
- package/.claude/skills/fullstack-developer/references/ui-testing-checklist.md +292 -0
- package/.claude/skills/fullstack-developer/scripts/format_code.py +611 -0
- package/.claude/skills/fullstack-developer/scripts/lint_check.py +816 -0
- package/.claude/skills/fullstack-developer/scripts/requirements.txt +36 -0
- package/.claude/skills/performance-optimization/SKILL.md +250 -0
- package/.claude/skills/product-requirements/SKILL.md +357 -0
- package/.claude/skills/product-requirements/references/acceptance-criteria.md +335 -0
- package/.claude/skills/product-requirements/references/answer-first-questioning-protocol.md +299 -0
- package/.claude/skills/product-requirements/references/competitive-analysis-guide.md +183 -0
- package/.claude/skills/product-requirements/references/document-accuracy-protocol.md +253 -0
- package/.claude/skills/product-requirements/references/document-management-protocol.md +278 -0
- package/.claude/skills/product-requirements/references/external-standards.md +62 -0
- package/.claude/skills/product-requirements/references/feature-spec-template.md +359 -0
- package/.claude/skills/product-requirements/references/knowledge-acquisition-protocol.md +251 -0
- package/.claude/skills/product-requirements/references/plan-execution-protocol.md +334 -0
- package/.claude/skills/product-requirements/references/plan-generation-protocol.md +264 -0
- package/.claude/skills/product-requirements/references/prioritization-frameworks.md +80 -0
- package/.claude/skills/product-requirements/references/requirement-decomposition-protocol.md +291 -0
- package/.claude/skills/product-requirements/references/user-story-examples.md +297 -0
- package/.claude/skills/product-requirements/references/workflow-templates.md +266 -0
- package/.claude/skills/react-best-practices/SKILL.md +198 -0
- package/.claude/skills/react-best-practices/references/advanced-patterns.md +94 -0
- package/.claude/skills/react-best-practices/references/bundle-optimization.md +182 -0
- package/.claude/skills/react-best-practices/references/client-data-fetching.md +112 -0
- package/.claude/skills/react-best-practices/references/complete-guide.md +2249 -0
- package/.claude/skills/react-best-practices/references/eliminating-waterfalls.md +169 -0
- package/.claude/skills/react-best-practices/references/javascript-performance.md +256 -0
- package/.claude/skills/react-best-practices/references/rendering-performance.md +230 -0
- package/.claude/skills/react-best-practices/references/rerender-optimization.md +214 -0
- package/.claude/skills/react-best-practices/references/server-performance.md +182 -0
- package/.claude/skills/security-audit/SKILL.md +226 -0
- package/.claude/skills/shared-references/advanced-debugging-techniques.md +186 -0
- package/.claude/skills/shared-references/code-quality-checklist.md +218 -0
- package/.claude/skills/shared-references/code-review-efficiency-guide.md +125 -0
- package/.claude/skills/shared-references/mcp-dependency-compatibility-protocol.md +276 -0
- package/.claude/skills/shared-references/skill-call-graph.md +230 -0
- package/.claude/skills/shared-references/skill-orchestration-protocol.md +281 -0
- package/.claude/skills/shared-references/subagent-dispatch-templates.md +199 -0
- package/.claude/skills/skill-expert-skills/LICENSE.txt +204 -0
- package/.claude/skills/skill-expert-skills/QUICK_NAVIGATION.md +374 -0
- package/.claude/skills/skill-expert-skills/SKILL.md +247 -0
- package/.claude/skills/skill-expert-skills/docs/_index.md +91 -0
- package/.claude/skills/skill-expert-skills/references/deep-research-methodology.md +389 -0
- package/.claude/skills/skill-expert-skills/references/docs-generation-workflow.md +398 -0
- package/.claude/skills/skill-expert-skills/references/domain-expertise-protocol.md +343 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/_index.md +54 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/backend-expertise.md +517 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/bug-fixing-expertise.md +363 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/code-review-expertise.md +392 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/frontend-expertise.md +410 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge-template.md +503 -0
- package/.claude/skills/skill-expert-skills/references/examples.md +782 -0
- package/.claude/skills/skill-expert-skills/references/integration-examples.md +655 -0
- package/.claude/skills/skill-expert-skills/references/knowledge-validation-checklist.md +246 -0
- package/.claude/skills/skill-expert-skills/references/latest-knowledge-acquisition.md +461 -0
- package/.claude/skills/skill-expert-skills/references/mcp-tools-guide.md +439 -0
- package/.claude/skills/skill-expert-skills/references/official-best-practices.md +616 -0
- package/.claude/skills/skill-expert-skills/references/patterns.md +218 -0
- package/.claude/skills/skill-expert-skills/references/plugin-skills-guide.md +432 -0
- package/.claude/skills/skill-expert-skills/references/requirement-elicitation-protocol.md +290 -0
- package/.claude/skills/skill-expert-skills/references/skill-creator-SKILL.md +353 -0
- package/.claude/skills/skill-expert-skills/references/skill-templates.md +583 -0
- package/.claude/skills/skill-expert-skills/references/skills-knowledge-base.md +561 -0
- package/.claude/skills/skill-expert-skills/references/tools-guide.md +379 -0
- package/.claude/skills/skill-expert-skills/references/troubleshooting.md +378 -0
- package/.claude/skills/skill-expert-skills/references/universality-guide.md +205 -0
- package/.claude/skills/skill-expert-skills/references/writing-style-guide.md +466 -0
- package/.claude/skills/skill-expert-skills/scripts/__pycache__/quick_validate.cpython-313.pyc +0 -0
- package/.claude/skills/skill-expert-skills/scripts/__pycache__/universal_validate.cpython-313.pyc +0 -0
- package/.claude/skills/skill-expert-skills/scripts/analyze_trigger.py +425 -0
- package/.claude/skills/skill-expert-skills/scripts/diff_with_official.py +188 -0
- package/.claude/skills/skill-expert-skills/scripts/init_skill.py +349 -0
- package/.claude/skills/skill-expert-skills/scripts/package_skill.py +156 -0
- package/.claude/skills/skill-expert-skills/scripts/quick_validate.py +493 -0
- package/.claude/skills/skill-expert-skills/scripts/requirements.txt +2 -0
- package/.claude/skills/skill-expert-skills/scripts/universal_validate.py +182 -0
- package/.claude/skills/skill-expert-skills/scripts/upgrade_skill.py +431 -0
- package/.claude/skills/subagent-driven-development/SKILL.md +268 -0
- package/.claude/skills/test-driven-development/SKILL.md +246 -0
- package/.claude/skills/test-driven-development/references/testing-anti-patterns.md +192 -0
- package/.claude/skills/using-git-worktrees/SKILL.md +266 -0
- package/.claude/skills/using-skillstack/SKILL.md +127 -0
- package/.claude/skills/vercel-deploy/SKILL.md +166 -0
- package/.claude/skills/vercel-deploy/scripts/deploy.sh +249 -0
- package/.claude/skills/verification-before-completion/SKILL.md +305 -0
- package/.claude/skills/writing-plans/SKILL.md +259 -0
- package/README.md +69 -0
- package/bin/cli.js +468 -0
- package/lib/init.js +333 -0
- package/package.json +29 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Skill Upgrader - Analyze and upgrade existing skills to best practices
|
|
4
|
+
|
|
5
|
+
Features:
|
|
6
|
+
- Detect missing best practice elements (decision tree, output contract, etc.)
|
|
7
|
+
- Generate upgrade suggestions with code snippets
|
|
8
|
+
- Auto-insert missing sections (optional)
|
|
9
|
+
- Compare against skill-expert-skills standards
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
python upgrade_skill.py <path/to/skill-folder> [--auto-fix]
|
|
13
|
+
|
|
14
|
+
Examples:
|
|
15
|
+
python upgrade_skill.py .claude/skills/my-old-skill
|
|
16
|
+
python upgrade_skill.py .claude/skills/my-old-skill --auto-fix
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
import sys
|
|
20
|
+
import re
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
from typing import List, Tuple, Dict, Optional
|
|
23
|
+
from dataclasses import dataclass
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _configure_stdio() -> None:
|
|
27
|
+
"""Ensure UTF-8 encoding for stdout/stderr on Windows"""
|
|
28
|
+
for stream in (sys.stdout, sys.stderr):
|
|
29
|
+
try:
|
|
30
|
+
stream.reconfigure(encoding='utf-8', errors='replace')
|
|
31
|
+
except Exception:
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_configure_stdio()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclass
|
|
39
|
+
class UpgradeSuggestion:
|
|
40
|
+
priority: str # "high", "medium", "low"
|
|
41
|
+
category: str
|
|
42
|
+
issue: str
|
|
43
|
+
suggestion: str
|
|
44
|
+
code_snippet: Optional[str] = None
|
|
45
|
+
line_to_insert_after: Optional[int] = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class SkillUpgrader:
|
|
49
|
+
"""Analyze and upgrade skills to best practices"""
|
|
50
|
+
|
|
51
|
+
BEST_PRACTICE_PATTERNS = {
|
|
52
|
+
'decision_tree': {
|
|
53
|
+
'patterns': [r'decision\s*tree', r'决策树', r'┌─', r'├─', r'└─'],
|
|
54
|
+
'priority': 'high',
|
|
55
|
+
'suggestion': 'Add a decision tree for clear workflow guidance',
|
|
56
|
+
'template': '''
|
|
57
|
+
## Decision Tree
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
61
|
+
│ Task Decision Tree │
|
|
62
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
63
|
+
│ │
|
|
64
|
+
│ 【Scenario A】 │
|
|
65
|
+
│ → Step 1: [action] │
|
|
66
|
+
│ → Step 2: [action] │
|
|
67
|
+
│ │
|
|
68
|
+
│ 【Scenario B】 │
|
|
69
|
+
│ → Step 1: [action] │
|
|
70
|
+
│ → Step 2: [action] │
|
|
71
|
+
│ │
|
|
72
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
73
|
+
```
|
|
74
|
+
'''
|
|
75
|
+
},
|
|
76
|
+
'output_contract': {
|
|
77
|
+
'patterns': [r'output\s*contract', r'输出契约', r'deliverable', r'交付'],
|
|
78
|
+
'priority': 'high',
|
|
79
|
+
'suggestion': 'Define clear output contract for predictable results',
|
|
80
|
+
'template': '''
|
|
81
|
+
## Output Contract
|
|
82
|
+
|
|
83
|
+
### Required Deliverables
|
|
84
|
+
- [ ] Updated `SKILL.md` with YAML frontmatter
|
|
85
|
+
- [ ] Validation results (quick_validate + universal_validate)
|
|
86
|
+
|
|
87
|
+
### Optional Deliverables
|
|
88
|
+
- `references/`: Detailed documentation
|
|
89
|
+
- `scripts/`: Automation scripts
|
|
90
|
+
- `assets/`: Templates and resources
|
|
91
|
+
'''
|
|
92
|
+
},
|
|
93
|
+
'quick_start': {
|
|
94
|
+
'patterns': [r'quick\s*start', r'快速开始', r'getting\s*started'],
|
|
95
|
+
'priority': 'medium',
|
|
96
|
+
'suggestion': 'Add Quick Start section for immediate usability',
|
|
97
|
+
'template': '''
|
|
98
|
+
## Quick Start
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# 1. Initialize
|
|
102
|
+
python scripts/init.py <args>
|
|
103
|
+
|
|
104
|
+
# 2. Validate
|
|
105
|
+
python scripts/validate.py <path>
|
|
106
|
+
|
|
107
|
+
# 3. Run
|
|
108
|
+
python scripts/run.py <path>
|
|
109
|
+
```
|
|
110
|
+
'''
|
|
111
|
+
},
|
|
112
|
+
'troubleshooting': {
|
|
113
|
+
'patterns': [r'troubleshoot', r'faq', r'common\s*issues', r'常见问题', r'排障'],
|
|
114
|
+
'priority': 'medium',
|
|
115
|
+
'suggestion': 'Add troubleshooting section for common issues',
|
|
116
|
+
'template': '''
|
|
117
|
+
## Troubleshooting
|
|
118
|
+
|
|
119
|
+
| Issue | Solution |
|
|
120
|
+
|-------|----------|
|
|
121
|
+
| [Common issue 1] | [Solution] |
|
|
122
|
+
| [Common issue 2] | [Solution] |
|
|
123
|
+
'''
|
|
124
|
+
},
|
|
125
|
+
'references_navigation': {
|
|
126
|
+
'patterns': [r'references\s*navigation', r'references\s*导航', r'\|\s*文件\s*\|\s*用途'],
|
|
127
|
+
'priority': 'medium',
|
|
128
|
+
'suggestion': 'Add references navigation table',
|
|
129
|
+
'template': '''
|
|
130
|
+
## References Navigation
|
|
131
|
+
|
|
132
|
+
| File | Purpose | When to Read |
|
|
133
|
+
|------|---------|--------------|
|
|
134
|
+
| `references/xxx.md` | [Purpose] | [Condition] |
|
|
135
|
+
'''
|
|
136
|
+
},
|
|
137
|
+
'definition_of_done': {
|
|
138
|
+
'patterns': [r'definition\s*of\s*done', r'dod', r'完成定义', r'必须达标'],
|
|
139
|
+
'priority': 'low',
|
|
140
|
+
'suggestion': 'Add Definition of Done checklist',
|
|
141
|
+
'template': '''
|
|
142
|
+
## Definition of Done
|
|
143
|
+
|
|
144
|
+
- [ ] [Criterion 1]
|
|
145
|
+
- [ ] [Criterion 2]
|
|
146
|
+
- [ ] Validation passed (quick_validate)
|
|
147
|
+
- [ ] No project-specific information
|
|
148
|
+
'''
|
|
149
|
+
},
|
|
150
|
+
'use_when_in_description': {
|
|
151
|
+
'patterns': [], # Special check in description
|
|
152
|
+
'priority': 'high',
|
|
153
|
+
'suggestion': 'Add "Use when:" section in description for better triggering',
|
|
154
|
+
'template': None
|
|
155
|
+
},
|
|
156
|
+
'not_for_boundary': {
|
|
157
|
+
'patterns': [r'not\s*for', r'不使用', r'out\s*of\s*scope'],
|
|
158
|
+
'priority': 'low',
|
|
159
|
+
'suggestion': 'Add "Not for:" section to set clear boundaries',
|
|
160
|
+
'template': '''
|
|
161
|
+
> **Not for:** [Describe what this skill should NOT be used for]
|
|
162
|
+
'''
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
def __init__(self, skill_path: Path):
|
|
167
|
+
self.skill_path = skill_path
|
|
168
|
+
self.skill_md = skill_path / 'SKILL.md'
|
|
169
|
+
self.content = ""
|
|
170
|
+
self.frontmatter = {}
|
|
171
|
+
self.body = ""
|
|
172
|
+
self.suggestions: List[UpgradeSuggestion] = []
|
|
173
|
+
|
|
174
|
+
def analyze(self) -> List[UpgradeSuggestion]:
|
|
175
|
+
"""Analyze skill and generate upgrade suggestions"""
|
|
176
|
+
if not self.skill_md.exists():
|
|
177
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
178
|
+
priority='high',
|
|
179
|
+
category='structure',
|
|
180
|
+
issue='SKILL.md not found',
|
|
181
|
+
suggestion='Create SKILL.md with proper frontmatter'
|
|
182
|
+
))
|
|
183
|
+
return self.suggestions
|
|
184
|
+
|
|
185
|
+
# Read content
|
|
186
|
+
try:
|
|
187
|
+
self.content = self.skill_md.read_text(encoding='utf-8-sig')
|
|
188
|
+
except Exception as e:
|
|
189
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
190
|
+
priority='high',
|
|
191
|
+
category='encoding',
|
|
192
|
+
issue=f'Cannot read SKILL.md: {e}',
|
|
193
|
+
suggestion='Ensure file is UTF-8 encoded'
|
|
194
|
+
))
|
|
195
|
+
return self.suggestions
|
|
196
|
+
|
|
197
|
+
# Parse frontmatter
|
|
198
|
+
self._parse_frontmatter()
|
|
199
|
+
|
|
200
|
+
# Check best practices
|
|
201
|
+
self._check_best_practices()
|
|
202
|
+
|
|
203
|
+
# Check description quality
|
|
204
|
+
self._check_description_quality()
|
|
205
|
+
|
|
206
|
+
# Check resources structure
|
|
207
|
+
self._check_resources()
|
|
208
|
+
|
|
209
|
+
# Sort by priority
|
|
210
|
+
priority_order = {'high': 0, 'medium': 1, 'low': 2}
|
|
211
|
+
self.suggestions.sort(key=lambda x: priority_order.get(x.priority, 3))
|
|
212
|
+
|
|
213
|
+
return self.suggestions
|
|
214
|
+
|
|
215
|
+
def _parse_frontmatter(self):
|
|
216
|
+
"""Parse YAML frontmatter"""
|
|
217
|
+
match = re.match(r'^---\r?\n(.*?)\r?\n---\r?\n?(.*)', self.content, re.DOTALL)
|
|
218
|
+
if match:
|
|
219
|
+
try:
|
|
220
|
+
import yaml
|
|
221
|
+
self.frontmatter = yaml.safe_load(match.group(1)) or {}
|
|
222
|
+
self.body = match.group(2)
|
|
223
|
+
except Exception:
|
|
224
|
+
self.body = self.content
|
|
225
|
+
else:
|
|
226
|
+
self.body = self.content
|
|
227
|
+
|
|
228
|
+
def _check_best_practices(self):
|
|
229
|
+
"""Check for best practice patterns in body"""
|
|
230
|
+
body_lower = self.body.lower()
|
|
231
|
+
|
|
232
|
+
for name, config in self.BEST_PRACTICE_PATTERNS.items():
|
|
233
|
+
if name == 'use_when_in_description':
|
|
234
|
+
continue # Handled separately
|
|
235
|
+
|
|
236
|
+
patterns = config['patterns']
|
|
237
|
+
found = any(re.search(p, body_lower) for p in patterns)
|
|
238
|
+
|
|
239
|
+
if not found and config.get('template'):
|
|
240
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
241
|
+
priority=config['priority'],
|
|
242
|
+
category='best_practice',
|
|
243
|
+
issue=f"Missing: {name.replace('_', ' ').title()}",
|
|
244
|
+
suggestion=config['suggestion'],
|
|
245
|
+
code_snippet=config['template']
|
|
246
|
+
))
|
|
247
|
+
|
|
248
|
+
def _check_description_quality(self):
|
|
249
|
+
"""Check description for best practices"""
|
|
250
|
+
description = self.frontmatter.get('description', '')
|
|
251
|
+
if not description:
|
|
252
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
253
|
+
priority='high',
|
|
254
|
+
category='frontmatter',
|
|
255
|
+
issue='Missing description in frontmatter',
|
|
256
|
+
suggestion='Add comprehensive description with trigger scenarios'
|
|
257
|
+
))
|
|
258
|
+
return
|
|
259
|
+
|
|
260
|
+
desc_lower = description.lower()
|
|
261
|
+
|
|
262
|
+
# Check for "Use when:" section
|
|
263
|
+
if 'use when' not in desc_lower and 'trigger' not in desc_lower:
|
|
264
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
265
|
+
priority='high',
|
|
266
|
+
category='frontmatter',
|
|
267
|
+
issue='Description lacks "Use when:" section',
|
|
268
|
+
suggestion='Add "Use when:" with 3-5 specific trigger scenarios',
|
|
269
|
+
code_snippet='''description: |
|
|
270
|
+
[What this skill does - one sentence]
|
|
271
|
+
|
|
272
|
+
Use when:
|
|
273
|
+
- [Trigger scenario 1]
|
|
274
|
+
- [Trigger scenario 2]
|
|
275
|
+
- [Trigger scenario 3]
|
|
276
|
+
|
|
277
|
+
Outputs: [What gets produced]
|
|
278
|
+
'''
|
|
279
|
+
))
|
|
280
|
+
|
|
281
|
+
# Check for output description
|
|
282
|
+
if not any(kw in desc_lower for kw in ['output', 'produce', 'generate', 'create', '输出']):
|
|
283
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
284
|
+
priority='medium',
|
|
285
|
+
category='frontmatter',
|
|
286
|
+
issue='Description does not describe outputs',
|
|
287
|
+
suggestion='Add output description (e.g., "Outputs: structured report with...")'
|
|
288
|
+
))
|
|
289
|
+
|
|
290
|
+
# Check for "Not for:" section
|
|
291
|
+
if 'not for' not in desc_lower:
|
|
292
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
293
|
+
priority='low',
|
|
294
|
+
category='frontmatter',
|
|
295
|
+
issue='Description lacks "Not for:" boundary',
|
|
296
|
+
suggestion='Add "Not for:" to set clear scope boundaries'
|
|
297
|
+
))
|
|
298
|
+
|
|
299
|
+
# Check for allowed-tools
|
|
300
|
+
if 'allowed-tools' not in self.frontmatter:
|
|
301
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
302
|
+
priority='medium',
|
|
303
|
+
category='frontmatter',
|
|
304
|
+
issue='Missing allowed-tools field',
|
|
305
|
+
suggestion='Add allowed-tools for least-privilege security',
|
|
306
|
+
code_snippet='allowed-tools: [read, write, execute]'
|
|
307
|
+
))
|
|
308
|
+
|
|
309
|
+
def _check_resources(self):
|
|
310
|
+
"""Check resources structure"""
|
|
311
|
+
refs_dir = self.skill_path / 'references'
|
|
312
|
+
scripts_dir = self.skill_path / 'scripts'
|
|
313
|
+
|
|
314
|
+
# Check references
|
|
315
|
+
if not refs_dir.exists():
|
|
316
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
317
|
+
priority='medium',
|
|
318
|
+
category='structure',
|
|
319
|
+
issue='No references/ directory',
|
|
320
|
+
suggestion='Add references/ for detailed documentation'
|
|
321
|
+
))
|
|
322
|
+
else:
|
|
323
|
+
ref_files = list(refs_dir.glob('*.md'))
|
|
324
|
+
if len(ref_files) == 0:
|
|
325
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
326
|
+
priority='low',
|
|
327
|
+
category='structure',
|
|
328
|
+
issue='references/ is empty',
|
|
329
|
+
suggestion='Add reference files for detailed knowledge'
|
|
330
|
+
))
|
|
331
|
+
|
|
332
|
+
# Check if body is too long without references
|
|
333
|
+
body_lines = self.body.count('\n')
|
|
334
|
+
refs_exist = refs_dir.exists() and any(refs_dir.glob('*.md'))
|
|
335
|
+
|
|
336
|
+
if body_lines > 300 and not refs_exist:
|
|
337
|
+
self.suggestions.append(UpgradeSuggestion(
|
|
338
|
+
priority='high',
|
|
339
|
+
category='conciseness',
|
|
340
|
+
issue=f'SKILL.md body is long ({body_lines} lines) without references',
|
|
341
|
+
suggestion='Move detailed content to references/ for progressive disclosure'
|
|
342
|
+
))
|
|
343
|
+
|
|
344
|
+
def format_report(self) -> str:
|
|
345
|
+
"""Format analysis as human-readable report"""
|
|
346
|
+
lines = []
|
|
347
|
+
lines.append("=" * 70)
|
|
348
|
+
lines.append("🔍 SKILL UPGRADE ANALYSIS")
|
|
349
|
+
lines.append("=" * 70)
|
|
350
|
+
lines.append(f"\nSkill: {self.skill_path.name}")
|
|
351
|
+
lines.append(f"Suggestions: {len(self.suggestions)}")
|
|
352
|
+
lines.append("")
|
|
353
|
+
|
|
354
|
+
if not self.suggestions:
|
|
355
|
+
lines.append("✅ No upgrade suggestions - skill follows best practices!")
|
|
356
|
+
return "\n".join(lines)
|
|
357
|
+
|
|
358
|
+
# Group by priority
|
|
359
|
+
high = [s for s in self.suggestions if s.priority == 'high']
|
|
360
|
+
medium = [s for s in self.suggestions if s.priority == 'medium']
|
|
361
|
+
low = [s for s in self.suggestions if s.priority == 'low']
|
|
362
|
+
|
|
363
|
+
if high:
|
|
364
|
+
lines.append("🔴 HIGH PRIORITY (Must Fix):")
|
|
365
|
+
for s in high:
|
|
366
|
+
lines.append(f"\n [{s.category}] {s.issue}")
|
|
367
|
+
lines.append(f" → {s.suggestion}")
|
|
368
|
+
if s.code_snippet:
|
|
369
|
+
lines.append(f"\n Suggested template:")
|
|
370
|
+
for code_line in s.code_snippet.strip().split('\n'):
|
|
371
|
+
lines.append(f" {code_line}")
|
|
372
|
+
lines.append("")
|
|
373
|
+
|
|
374
|
+
if medium:
|
|
375
|
+
lines.append("🟡 MEDIUM PRIORITY (Should Fix):")
|
|
376
|
+
for s in medium:
|
|
377
|
+
lines.append(f"\n [{s.category}] {s.issue}")
|
|
378
|
+
lines.append(f" → {s.suggestion}")
|
|
379
|
+
if s.code_snippet:
|
|
380
|
+
lines.append(f"\n Suggested template:")
|
|
381
|
+
for code_line in s.code_snippet.strip().split('\n'):
|
|
382
|
+
lines.append(f" {code_line}")
|
|
383
|
+
lines.append("")
|
|
384
|
+
|
|
385
|
+
if low:
|
|
386
|
+
lines.append("🟢 LOW PRIORITY (Nice to Have):")
|
|
387
|
+
for s in low:
|
|
388
|
+
lines.append(f"\n [{s.category}] {s.issue}")
|
|
389
|
+
lines.append(f" → {s.suggestion}")
|
|
390
|
+
lines.append("")
|
|
391
|
+
|
|
392
|
+
lines.append("=" * 70)
|
|
393
|
+
lines.append("💡 Next Steps:")
|
|
394
|
+
lines.append(" 1. Address HIGH priority items first")
|
|
395
|
+
lines.append(" 2. Run quick_validate.py after changes")
|
|
396
|
+
lines.append(" 3. Run universal_validate.py for portability")
|
|
397
|
+
lines.append("=" * 70)
|
|
398
|
+
|
|
399
|
+
return "\n".join(lines)
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def main():
|
|
403
|
+
if len(sys.argv) < 2:
|
|
404
|
+
print("Usage: python upgrade_skill.py <path/to/skill-folder> [--auto-fix]")
|
|
405
|
+
print("\nExamples:")
|
|
406
|
+
print(" python upgrade_skill.py .claude/skills/my-old-skill")
|
|
407
|
+
print(" python upgrade_skill.py .claude/skills/my-old-skill --auto-fix")
|
|
408
|
+
sys.exit(1)
|
|
409
|
+
|
|
410
|
+
skill_path = Path(sys.argv[1]).resolve()
|
|
411
|
+
auto_fix = '--auto-fix' in sys.argv
|
|
412
|
+
|
|
413
|
+
if not skill_path.exists():
|
|
414
|
+
print(f"❌ Error: Path not found: {skill_path}")
|
|
415
|
+
sys.exit(1)
|
|
416
|
+
|
|
417
|
+
if auto_fix:
|
|
418
|
+
print("⚠️ Auto-fix mode is not yet implemented. Showing analysis only.\n")
|
|
419
|
+
|
|
420
|
+
upgrader = SkillUpgrader(skill_path)
|
|
421
|
+
suggestions = upgrader.analyze()
|
|
422
|
+
print(upgrader.format_report())
|
|
423
|
+
|
|
424
|
+
# Exit code based on high priority issues
|
|
425
|
+
high_priority = [s for s in suggestions if s.priority == 'high']
|
|
426
|
+
sys.exit(1 if high_priority else 0)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
if __name__ == "__main__":
|
|
430
|
+
main()
|
|
431
|
+
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subagent-driven-development
|
|
3
|
+
description: |
|
|
4
|
+
Execute implementation plans using fresh subagents per task with two-stage review.
|
|
5
|
+
|
|
6
|
+
Use when:
|
|
7
|
+
- You have an approved implementation plan
|
|
8
|
+
- Want fast iteration with quality gates
|
|
9
|
+
- Need fresh context for each task
|
|
10
|
+
|
|
11
|
+
Key Features:
|
|
12
|
+
- Fresh subagent per task (no context pollution)
|
|
13
|
+
- Two-stage review: spec compliance + code quality
|
|
14
|
+
- Automatic rollback on failure
|
|
15
|
+
- Progress tracking
|
|
16
|
+
|
|
17
|
+
Prerequisite: Implementation plan from `/writing-plans`
|
|
18
|
+
allowed-tools: [read, write, execute, grep, glob]
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Subagent-Driven Development
|
|
22
|
+
|
|
23
|
+
**Core Principle**: Dispatch fresh subagent per task, review between tasks, maintain quality through two-stage review.
|
|
24
|
+
|
|
25
|
+
## The Iron Law
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
NEVER SKIP REVIEW. NEVER PARALLEL DISPATCH.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- **Never skip any review stage** - Both Stage 1 and Stage 2 are mandatory
|
|
32
|
+
- **Never dispatch multiple subagents in parallel** - One task at a time
|
|
33
|
+
- **Never proceed with unfixed issues** - Fix before moving on
|
|
34
|
+
- **Never let subagent read plan file directly** - You provide the context
|
|
35
|
+
|
|
36
|
+
## When to Use
|
|
37
|
+
|
|
38
|
+
- After `/writing-plans` creates implementation plan
|
|
39
|
+
- When you want fast iteration in current session
|
|
40
|
+
- When tasks are well-defined and independent
|
|
41
|
+
|
|
42
|
+
**Announce at start:** "I'm using the subagent-driven-development skill to execute the plan."
|
|
43
|
+
|
|
44
|
+
## The Process
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
For each task in plan:
|
|
48
|
+
1. Dispatch fresh subagent with task context
|
|
49
|
+
2. Subagent executes task
|
|
50
|
+
3. Stage 1 Review: Spec compliance
|
|
51
|
+
4. Stage 2 Review: Code quality
|
|
52
|
+
5. If pass: commit and continue
|
|
53
|
+
6. If fail: rollback and retry or escalate
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Subagent Dispatch Template
|
|
57
|
+
|
|
58
|
+
When dispatching a subagent for a task:
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
## Task Context
|
|
62
|
+
|
|
63
|
+
**Task N of M:** [Task Title]
|
|
64
|
+
|
|
65
|
+
**Goal:** [One sentence]
|
|
66
|
+
|
|
67
|
+
**Files to touch:**
|
|
68
|
+
- Create: `path/to/file.py`
|
|
69
|
+
- Modify: `path/to/existing.py`
|
|
70
|
+
- Test: `tests/path/to/test.py`
|
|
71
|
+
|
|
72
|
+
**Instructions:**
|
|
73
|
+
[Copy exact steps from plan]
|
|
74
|
+
|
|
75
|
+
**Constraints:**
|
|
76
|
+
- Follow TDD: test first, then implement
|
|
77
|
+
- Minimal code only
|
|
78
|
+
- Do not modify files outside scope
|
|
79
|
+
- Commit when tests pass
|
|
80
|
+
|
|
81
|
+
**Success Criteria:**
|
|
82
|
+
- [ ] Test written and fails for expected reason
|
|
83
|
+
- [ ] Implementation passes test
|
|
84
|
+
- [ ] All existing tests still pass
|
|
85
|
+
- [ ] Code committed
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Two-Stage Review
|
|
89
|
+
|
|
90
|
+
### Stage 1: Spec Compliance
|
|
91
|
+
|
|
92
|
+
Check if the implementation matches the plan:
|
|
93
|
+
|
|
94
|
+
| Check | Pass Criteria |
|
|
95
|
+
|-------|---------------|
|
|
96
|
+
| Files touched | Only files listed in task |
|
|
97
|
+
| Test exists | Test written before implementation |
|
|
98
|
+
| Test fails first | Verified test failed before code |
|
|
99
|
+
| Implementation | Matches plan's code |
|
|
100
|
+
| Tests pass | All tests green |
|
|
101
|
+
|
|
102
|
+
**If Stage 1 fails:** Rollback and retry with clearer instructions.
|
|
103
|
+
|
|
104
|
+
### Stage 2: Code Quality
|
|
105
|
+
|
|
106
|
+
Check code quality standards:
|
|
107
|
+
|
|
108
|
+
| Check | Pass Criteria |
|
|
109
|
+
|-------|---------------|
|
|
110
|
+
| No lint errors | `read_lints` returns clean |
|
|
111
|
+
| No type errors | Type checker passes |
|
|
112
|
+
| No warnings | Console output clean |
|
|
113
|
+
| Code style | Matches project conventions |
|
|
114
|
+
| No over-engineering | Minimal code only |
|
|
115
|
+
|
|
116
|
+
**If Stage 2 fails:** Fix issues before proceeding.
|
|
117
|
+
|
|
118
|
+
## Progress Tracking
|
|
119
|
+
|
|
120
|
+
Maintain progress in conversation:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
## Execution Progress
|
|
124
|
+
|
|
125
|
+
| Task | Status | Stage 1 | Stage 2 | Commit |
|
|
126
|
+
|------|--------|---------|---------|--------|
|
|
127
|
+
| 1. User Model | ✅ Done | ✅ | ✅ | abc123 |
|
|
128
|
+
| 2. Login Endpoint | 🔄 In Progress | - | - | - |
|
|
129
|
+
| 3. Auth Middleware | ⏳ Pending | - | - | - |
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Handling Failures
|
|
133
|
+
|
|
134
|
+
### Task Execution Failure
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
## Task N Failed
|
|
138
|
+
|
|
139
|
+
**Reason:** [What went wrong]
|
|
140
|
+
|
|
141
|
+
**Options:**
|
|
142
|
+
1. **Retry** - Dispatch new subagent with clarified instructions
|
|
143
|
+
2. **Modify Plan** - Update plan if task is unclear
|
|
144
|
+
3. **Escalate** - Ask human for guidance
|
|
145
|
+
|
|
146
|
+
**Recommended:** [Option N because...]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Rollback Procedure
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Undo uncommitted changes
|
|
153
|
+
git checkout -- .
|
|
154
|
+
|
|
155
|
+
# Or reset to last commit
|
|
156
|
+
git reset --hard HEAD
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Subagent Constraints
|
|
160
|
+
|
|
161
|
+
Each subagent MUST:
|
|
162
|
+
|
|
163
|
+
1. **Read only task-relevant files** - No exploring unrelated code
|
|
164
|
+
2. **Follow TDD strictly** - Test first, always
|
|
165
|
+
3. **Write minimal code** - No over-engineering
|
|
166
|
+
4. **Stay in scope** - Only touch files listed in task
|
|
167
|
+
5. **Commit on success** - Lock in progress
|
|
168
|
+
|
|
169
|
+
Each subagent MUST NOT:
|
|
170
|
+
|
|
171
|
+
1. **Modify unrelated files** - Even if "improvements" seem obvious
|
|
172
|
+
2. **Add features not in task** - YAGNI
|
|
173
|
+
3. **Skip tests** - Ever
|
|
174
|
+
4. **Refactor beyond task scope** - Save for dedicated refactor task
|
|
175
|
+
|
|
176
|
+
## Integration with Other Skills
|
|
177
|
+
|
|
178
|
+
| Before | After |
|
|
179
|
+
|--------|-------|
|
|
180
|
+
| `/brainstorming` | Design approved |
|
|
181
|
+
| `/using-git-worktrees` | Isolated workspace |
|
|
182
|
+
| `/writing-plans` | Plan created |
|
|
183
|
+
| **This skill** | Execute plan |
|
|
184
|
+
| `/verification-before-completion` | Final verification |
|
|
185
|
+
| `/finishing-a-development-branch` | Merge/PR |
|
|
186
|
+
|
|
187
|
+
## Output Contract
|
|
188
|
+
|
|
189
|
+
After each task:
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
## Task N Complete
|
|
193
|
+
|
|
194
|
+
**Summary:** [What was done]
|
|
195
|
+
|
|
196
|
+
**Files Changed:**
|
|
197
|
+
- `path/to/file.py` - Created
|
|
198
|
+
- `tests/path/to/test.py` - Created
|
|
199
|
+
|
|
200
|
+
**Review:**
|
|
201
|
+
- Stage 1 (Spec): ✅ Pass
|
|
202
|
+
- Stage 2 (Quality): ✅ Pass
|
|
203
|
+
|
|
204
|
+
**Commit:** `abc123` - "feat: add user model"
|
|
205
|
+
|
|
206
|
+
**Next:** Task N+1 - [Title]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
After all tasks:
|
|
210
|
+
|
|
211
|
+
```markdown
|
|
212
|
+
## Plan Execution Complete
|
|
213
|
+
|
|
214
|
+
**Tasks Completed:** N/N
|
|
215
|
+
|
|
216
|
+
**Commits:**
|
|
217
|
+
- `abc123` - feat: add user model
|
|
218
|
+
- `def456` - feat: add login endpoint
|
|
219
|
+
- ...
|
|
220
|
+
|
|
221
|
+
**Ready for:** `/verification-before-completion`
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Quick Reference
|
|
225
|
+
|
|
226
|
+
| Phase | Action |
|
|
227
|
+
|-------|--------|
|
|
228
|
+
| Dispatch | Send task to fresh subagent |
|
|
229
|
+
| Execute | Subagent follows TDD, implements task |
|
|
230
|
+
| Review 1 | Check spec compliance |
|
|
231
|
+
| Review 2 | Check code quality |
|
|
232
|
+
| Commit | Lock in progress |
|
|
233
|
+
| Next | Move to next task |
|
|
234
|
+
|
|
235
|
+
## Example Session
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
User: Execute the user authentication plan
|
|
239
|
+
|
|
240
|
+
Claude: I'm using the subagent-driven-development skill.
|
|
241
|
+
|
|
242
|
+
## Task 1 of 5: Create User Model
|
|
243
|
+
|
|
244
|
+
Dispatching subagent...
|
|
245
|
+
|
|
246
|
+
[Subagent executes task]
|
|
247
|
+
|
|
248
|
+
## Task 1 Review
|
|
249
|
+
|
|
250
|
+
**Stage 1 (Spec Compliance):**
|
|
251
|
+
- [x] Test written first
|
|
252
|
+
- [x] Test failed for expected reason
|
|
253
|
+
- [x] Implementation matches plan
|
|
254
|
+
- [x] All tests pass
|
|
255
|
+
✅ Stage 1 Pass
|
|
256
|
+
|
|
257
|
+
**Stage 2 (Code Quality):**
|
|
258
|
+
- [x] No lint errors
|
|
259
|
+
- [x] No type errors
|
|
260
|
+
- [x] Minimal code
|
|
261
|
+
✅ Stage 2 Pass
|
|
262
|
+
|
|
263
|
+
**Committed:** `abc123` - "feat: add User model"
|
|
264
|
+
|
|
265
|
+
## Task 2 of 5: Create Login Endpoint
|
|
266
|
+
|
|
267
|
+
Dispatching subagent...
|
|
268
|
+
```
|