|
| 1 | +# CANARY: REQ=CBIN-132; FEATURE="NextCmd"; ASPECT=CLI; STATUS=STUB; OWNER=canary; UPDATED=2025-10-16 |
| 2 | + |
| 3 | +Identify and implement the next highest priority CANARY requirement. |
| 4 | + |
| 5 | +## Workflow |
| 6 | + |
| 7 | +1. **Query next priority:** |
| 8 | + ```bash |
| 9 | + canary next --prompt |
| 10 | + ``` |
| 11 | + |
| 12 | +2. **Review generated guidance:** |
| 13 | + - Read specification details |
| 14 | + - Review constitutional principles |
| 15 | + - Check dependencies |
| 16 | + - Understand test requirements |
| 17 | + |
| 18 | +3. **Implement following test-first approach:** |
| 19 | + - Write tests first (Article IV) |
| 20 | + - Place CANARY token |
| 21 | + - Implement functionality |
| 22 | + - Verify success criteria |
| 23 | + - Update token STATUS |
| 24 | + |
| 25 | +4. **Verify completion:** |
| 26 | + ```bash |
| 27 | + canary scan --root . --project-only |
| 28 | + canary scan --root . --verify GAP_ANALYSIS.md --project-only |
| 29 | + ``` |
| 30 | + |
| 31 | +## Command Options |
| 32 | + |
| 33 | +- `canary next` - Show next priority requirement summary |
| 34 | +- `canary next --prompt` - Generate full implementation guidance |
| 35 | +- `canary next --json` - Machine-readable output |
| 36 | +- `canary next --status STUB` - Filter by status |
| 37 | +- `canary next --aspect API` - Filter by aspect |
| 38 | + |
| 39 | +## Priority Factors |
| 40 | + |
| 41 | +The system determines priority based on: |
| 42 | +1. **PRIORITY field** (1=highest, 10=lowest) |
| 43 | +2. **STATUS** (STUB > IMPL > TESTED) |
| 44 | +3. **Dependencies** (DEPENDS_ON must be satisfied) |
| 45 | +4. **Age** (older UPDATED dates get priority boost) |
| 46 | + |
| 47 | +## Constitutional Principles |
| 48 | + |
| 49 | +Every implementation must follow: |
| 50 | +- **Article I**: Requirement-First Development |
| 51 | +- **Article IV**: Test-First Imperative |
| 52 | +- **Article V**: Simplicity and Anti-Abstraction |
| 53 | +- **Article VII**: Documentation Currency |
| 54 | + |
| 55 | +See `.canary/memory/constitution.md` for complete principles. |
| 56 | + |
| 57 | +## Example Usage |
| 58 | + |
| 59 | +```bash |
| 60 | +# AI agent automatically gets next task |
| 61 | +/canary.next |
| 62 | + |
| 63 | +# The system will: |
| 64 | +# 1. Query database (or scan filesystem) |
| 65 | +# 2. Identify highest priority STUB/IMPL requirement |
| 66 | +# 3. Load specification from .canary/specs/ |
| 67 | +# 4. Load constitutional principles |
| 68 | +# 5. Resolve dependencies |
| 69 | +# 6. Generate comprehensive implementation prompt |
| 70 | +# 7. Provide test examples and token placement guidance |
| 71 | +``` |
| 72 | + |
| 73 | +## Expected Output |
| 74 | + |
| 75 | +The command generates a comprehensive prompt including: |
| 76 | +- Requirement specification details |
| 77 | +- Constitutional guidance for this implementation |
| 78 | +- Dependency verification |
| 79 | +- Test-first implementation steps |
| 80 | +- CANARY token examples |
| 81 | +- Success criteria checklist |
| 82 | +- Suggested file locations |
| 83 | +- Verification steps |
| 84 | + |
| 85 | +## Notes |
| 86 | + |
| 87 | +- If no requirements are available, displays completion message |
| 88 | +- If dependencies are blocking, selects next unblocked requirement |
| 89 | +- Falls back to filesystem scan if database unavailable |
| 90 | +- Prompts are 2,000-5,000 words for comprehensive guidance |
0 commit comments