|
| 1 | +--- |
| 2 | +name: /rulebook-task-create |
| 3 | +id: rulebook-task-create |
| 4 | +category: Rulebook |
| 5 | +description: Create a new Rulebook task following OpenSpec-compatible format with Context7 MCP validation. |
| 6 | +--- |
| 7 | +<!-- RULEBOOK:START --> |
| 8 | +**Guardrails** |
| 9 | +- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required. |
| 10 | +- Keep changes tightly scoped to the requested outcome. |
| 11 | +- Refer to `/rulebook/RULEBOOK.md` for complete task management guidelines and format requirements. |
| 12 | +- **CRITICAL**: Context7 MCP is REQUIRED for task creation to ensure correct OpenSpec-compatible format. |
| 13 | +- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files. |
| 14 | + |
| 15 | +**Steps** |
| 16 | +1. **Check Context7 MCP (MANDATORY)**: Query Context7 for OpenSpec documentation to get the official format: |
| 17 | + ``` |
| 18 | + @Context7 /fission-ai/openspec task creation format spec structure |
| 19 | + ``` |
| 20 | + Review official format requirements: spec delta format, requirement structure, scenario formatting, delta headers (ADDED/MODIFIED/REMOVED/RENAMED). |
| 21 | + |
| 22 | +2. **Explore Current State**: |
| 23 | + - Run `rulebook task list` to see existing tasks |
| 24 | + - Review related code or docs (e.g., via `rg`/`ls`) to understand current behavior |
| 25 | + - Note any gaps that require clarification |
| 26 | + |
| 27 | +3. **Choose Task ID**: Use verb-led kebab-case (e.g., `add-feature`, `update-api`, `refactor-module`). Must be unique. |
| 28 | + |
| 29 | +4. **Create Task Structure**: |
| 30 | + ```bash |
| 31 | + rulebook task create <task-id> |
| 32 | + ``` |
| 33 | + This creates `/rulebook/tasks/<task-id>/` with: |
| 34 | + - `proposal.md` - Why and what changes |
| 35 | + - `tasks.md` - Implementation checklist |
| 36 | + - `specs/` - Directory for spec deltas |
| 37 | + |
| 38 | +5. **Write Proposal** (`proposal.md`): |
| 39 | + - **Why**: Minimum 20 characters explaining why this change is needed |
| 40 | + - **What Changes**: Detailed description of what will change |
| 41 | + - **Impact**: Affected specs, code, breaking changes, user benefits |
| 42 | + |
| 43 | +6. **Write Tasks Checklist** (`tasks.md`): |
| 44 | + - Organize by phases (Implementation, Testing, Documentation) |
| 45 | + - Use checkbox format: `- [ ] Task description` |
| 46 | + - Include validation steps (tests, coverage checks) |
| 47 | + |
| 48 | +7. **Write Spec Delta** (`specs/<module>/spec.md`): |
| 49 | + - Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers |
| 50 | + - Requirements MUST use `### Requirement: [Name]` with SHALL/MUST keywords |
| 51 | + - Scenarios MUST use `#### Scenario:` (4 hashtags, NOT 3) |
| 52 | + - Scenarios MUST use Given/When/Then structure |
| 53 | + - Example: |
| 54 | + ```markdown |
| 55 | + ## ADDED Requirements |
| 56 | + |
| 57 | + ### Requirement: Feature Name |
| 58 | + The system SHALL do something specific and testable. |
| 59 | + |
| 60 | + #### Scenario: Scenario Name |
| 61 | + Given some precondition |
| 62 | + When an action occurs |
| 63 | + Then an expected outcome happens |
| 64 | + ``` |
| 65 | + |
| 66 | +8. **Validate Task**: |
| 67 | + ```bash |
| 68 | + rulebook task validate <task-id> |
| 69 | + ``` |
| 70 | + Fix any validation errors before proceeding. |
| 71 | + |
| 72 | +9. **Verify Format**: |
| 73 | + - Purpose section: ≥20 characters ✅ |
| 74 | + - Requirements: Contain SHALL or MUST ✅ |
| 75 | + - Scenarios: Use `#### Scenario:` (4 hashtags) ✅ |
| 76 | + - Scenarios: Use Given/When/Then structure ✅ |
| 77 | + - Delta headers: Use ADDED/MODIFIED/REMOVED/RENAMED ✅ |
| 78 | + |
| 79 | +**Reference** |
| 80 | +- See `/rulebook/RULEBOOK.md` for complete task management guidelines |
| 81 | +- Use `rulebook task show <task-id>` to view task details |
| 82 | +- Use `rulebook task list` to see all tasks |
| 83 | +- Search existing requirements with `rg -n "Requirement:|Scenario:" rulebook/tasks` before writing new ones |
| 84 | +- Explore the codebase with `rg <keyword>`, `ls`, or direct file reads so proposals align with current implementation realities |
| 85 | + |
| 86 | +**Common Pitfalls to Avoid** |
| 87 | +- ❌ Using 3 hashtags for scenarios (`### Scenario:`) - MUST use 4 (`#### Scenario:`) |
| 88 | +- ❌ Missing SHALL/MUST keywords in requirements |
| 89 | +- ❌ Using bullet points for scenarios instead of Given/When/Then |
| 90 | +- ❌ Purpose section too short (<20 characters) |
| 91 | +- ❌ Wrong delta headers (use ADDED/MODIFIED/REMOVED/RENAMED, not "New Requirements" or "Changes") |
| 92 | +<!-- RULEBOOK:END --> |
| 93 | + |
0 commit comments