|
| 1 | +# Create Plan Skill |
| 2 | + |
| 3 | +Tools and scripts for creating and validating implementation plans. |
| 4 | + |
| 5 | +## Files |
| 6 | + |
| 7 | +- `SKILL.md` - Main skill instructions for AI agents |
| 8 | +- `validate-plan.sh` - Validates a single plan file |
| 9 | +- `validate-all-plans.sh` - Validates all plans in a directory |
| 10 | + |
| 11 | +## Validation Scripts |
| 12 | + |
| 13 | +### validate-plan.sh |
| 14 | + |
| 15 | +Validates the structure and content of a single plan file. |
| 16 | + |
| 17 | +**Usage:** |
| 18 | +```bash |
| 19 | +./.forge/skills/create-plan/validate-plan.sh plans/2025-11-27-example-v1.md |
| 20 | +``` |
| 21 | + |
| 22 | +**Checks:** |
| 23 | +- ✓ Filename follows convention: `YYYY-MM-DD-task-name-vN.md` |
| 24 | + - Year is reasonable (2020 to current year + 1) |
| 25 | + - Month is valid (01-12) |
| 26 | + - Day is valid (01-31) |
| 27 | + - Task name is meaningful (not generic like "test", "task", "temp") |
| 28 | + - Task name length is reasonable (5-60 characters) |
| 29 | + - Version number is reasonable (not > 50) |
| 30 | + - No uppercase letters or underscores (use lowercase and hyphens only) |
| 31 | +- ✓ File is in `plans/` directory |
| 32 | +- ✓ All required sections present: |
| 33 | + - Main heading (`# Title`) |
| 34 | + - `## Objective` |
| 35 | + - `## Implementation Plan` |
| 36 | + - `## Verification Criteria` |
| 37 | + - `## Potential Risks and Mitigations` |
| 38 | + - `## Alternative Approaches` |
| 39 | +- ✓ Implementation Plan uses checkbox format (`- [ ]`) |
| 40 | +- ✓ No numbered lists or plain bullets in Implementation Plan |
| 41 | +- ✓ No code blocks (` ``` `) in the plan |
| 42 | +- ✓ No code snippets (detects suspicious patterns) |
| 43 | +- ✓ No placeholder tasks (TODO, TBD, etc.) |
| 44 | +- ✓ **Task quality and density:** |
| 45 | + - Task descriptions are descriptive (≥ 20 characters recommended) |
| 46 | + - Average task length is substantial (30-200 chars recommended) |
| 47 | + - No generic/vague descriptions ("implement feature", "fix bug", etc.) |
| 48 | + - No duplicate or highly similar tasks |
| 49 | + - Consistent and sequential numbering if tasks are numbered |
| 50 | +- ✓ Verification criteria have content |
| 51 | +- ✓ Risks include mitigations |
| 52 | +- ✓ Reasonable number of tasks (3-20) |
| 53 | + |
| 54 | +**Exit Codes:** |
| 55 | +- `0` - Validation passed |
| 56 | +- `1` - Validation failed (errors found) |
| 57 | + |
| 58 | +### validate-all-plans.sh |
| 59 | + |
| 60 | +Validates all plan files in a directory. |
| 61 | + |
| 62 | +**Usage:** |
| 63 | +```bash |
| 64 | +# Validate all plans in default directory (plans/) |
| 65 | +./.forge/skills/create-plan/validate-all-plans.sh |
| 66 | + |
| 67 | +# Validate plans in custom directory |
| 68 | +./.forge/skills/create-plan/validate-all-plans.sh path/to/plans |
| 69 | +``` |
| 70 | + |
| 71 | +**Exit Codes:** |
| 72 | +- `0` - All plans passed validation |
| 73 | +- `1` - One or more plans failed validation |
| 74 | + |
| 75 | +## Integration |
| 76 | + |
| 77 | +### Pre-commit Hook |
| 78 | + |
| 79 | +Add to `.git/hooks/pre-commit`: |
| 80 | + |
| 81 | +```bash |
| 82 | +#!/bin/bash |
| 83 | +# Validate plans before committing |
| 84 | + |
| 85 | +if git diff --cached --name-only | grep -q "^plans/.*\.md$"; then |
| 86 | + echo "Validating modified plans..." |
| 87 | + ./.forge/skills/create-plan/validate-all-plans.sh plans/ |
| 88 | + exit $? |
| 89 | +fi |
| 90 | +``` |
| 91 | + |
| 92 | +### CI/CD |
| 93 | + |
| 94 | +Add to your CI pipeline: |
| 95 | + |
| 96 | +```yaml |
| 97 | +- name: Validate Plans |
| 98 | + run: ./.forge/skills/create-plan/validate-all-plans.sh plans/ |
| 99 | +``` |
| 100 | +
|
| 101 | +## Example Valid Plan |
| 102 | +
|
| 103 | +See `SKILL.md` for the complete plan template structure. |
| 104 | + |
| 105 | +## Common Validation Errors |
| 106 | + |
| 107 | +1. **Invalid filename format**: Must follow `YYYY-MM-DD-task-name-vN.md` pattern |
| 108 | + - Use lowercase letters only |
| 109 | + - Use hyphens (not underscores) to separate words |
| 110 | + - Use valid date (month 01-12, day 01-31, year 2020+) |
| 111 | + - Avoid generic names like "test", "task", "temp" |
| 112 | +2. **Missing checkboxes**: Use `- [ ]` not `1.` or `-` |
| 113 | +3. **Code blocks**: Plans should use natural language, not code |
| 114 | +4. **Missing sections**: All required sections must be present |
| 115 | +5. **Empty sections**: Sections should have meaningful content |
| 116 | +6. **Poor task quality**: Tasks should be descriptive and specific |
| 117 | + - Avoid short descriptions like "Do this", "Fix that", "Update code" |
| 118 | + - Avoid generic descriptions like "implement feature", "add functionality" |
| 119 | + - Include rationale and context in task descriptions |
| 120 | + - Aim for 30-150 characters per task description |
0 commit comments