|
| 1 | +{ |
| 2 | + "$schema": "../../../codev-skeleton/protocol-schema.json", |
| 3 | + "name": "spir", |
| 4 | + "alias": "spider", |
| 5 | + "version": "2.2.0", |
| 6 | + "description": "SPIR: Specify → Plan → Implement → Review with build-verify cycles (Codev monorepo override)", |
| 7 | + "input": { |
| 8 | + "type": "spec", |
| 9 | + "required": false, |
| 10 | + "default_for": ["--project", "-p"] |
| 11 | + }, |
| 12 | + "phases": [ |
| 13 | + { |
| 14 | + "id": "specify", |
| 15 | + "name": "Specify", |
| 16 | + "description": "Write specification with 3-way review", |
| 17 | + "type": "build_verify", |
| 18 | + "build": { |
| 19 | + "prompt": "specify.md", |
| 20 | + "artifact": "codev/specs/${PROJECT_ID}-*.md" |
| 21 | + }, |
| 22 | + "verify": { |
| 23 | + "type": "spec-review", |
| 24 | + "models": ["gemini", "codex", "claude"], |
| 25 | + "parallel": true |
| 26 | + }, |
| 27 | + "max_iterations": 7, |
| 28 | + "on_complete": { |
| 29 | + "commit": true, |
| 30 | + "push": true |
| 31 | + }, |
| 32 | + "gate": "spec-approval", |
| 33 | + "next": "plan" |
| 34 | + }, |
| 35 | + { |
| 36 | + "id": "plan", |
| 37 | + "name": "Plan", |
| 38 | + "description": "Write implementation plan with 3-way review", |
| 39 | + "type": "build_verify", |
| 40 | + "build": { |
| 41 | + "prompt": "plan.md", |
| 42 | + "artifact": "codev/plans/${PROJECT_ID}-*.md" |
| 43 | + }, |
| 44 | + "verify": { |
| 45 | + "type": "plan-review", |
| 46 | + "models": ["gemini", "codex", "claude"], |
| 47 | + "parallel": true |
| 48 | + }, |
| 49 | + "max_iterations": 7, |
| 50 | + "on_complete": { |
| 51 | + "commit": true, |
| 52 | + "push": true |
| 53 | + }, |
| 54 | + "checks": { |
| 55 | + "plan_exists": "test -f codev/plans/${PROJECT_ID}-*.md", |
| 56 | + "has_phases_json": "grep -q '\"phases\":' codev/plans/${PROJECT_ID}-*.md", |
| 57 | + "min_two_phases": "grep -o '\"id\": *\"[^\"]*\"' codev/plans/${PROJECT_ID}-*.md | wc -l | awk '$1 >= 2 {exit 0} {exit 1}'" |
| 58 | + }, |
| 59 | + "gate": "plan-approval", |
| 60 | + "next": "implement" |
| 61 | + }, |
| 62 | + { |
| 63 | + "id": "implement", |
| 64 | + "name": "Implement", |
| 65 | + "description": "Implement code with 3-way review per plan phase", |
| 66 | + "type": "per_plan_phase", |
| 67 | + "build": { |
| 68 | + "prompt": "implement.md", |
| 69 | + "artifact": "src/**/*.{ts,tsx,js,jsx}" |
| 70 | + }, |
| 71 | + "verify": { |
| 72 | + "type": "impl-review", |
| 73 | + "models": ["gemini", "codex", "claude"], |
| 74 | + "parallel": true |
| 75 | + }, |
| 76 | + "max_iterations": 7, |
| 77 | + "on_complete": { |
| 78 | + "commit": true, |
| 79 | + "push": true |
| 80 | + }, |
| 81 | + "checks": { |
| 82 | + "build": { |
| 83 | + "command": "npm run build", |
| 84 | + "cwd": "packages/codev", |
| 85 | + "on_fail": "retry", |
| 86 | + "max_retries": 2 |
| 87 | + }, |
| 88 | + "tests": { |
| 89 | + "command": "npm test -- --exclude='**/e2e/**'", |
| 90 | + "cwd": "packages/codev", |
| 91 | + "description": "Unit tests only - e2e tests run in review phase", |
| 92 | + "on_fail": "retry", |
| 93 | + "max_retries": 2 |
| 94 | + } |
| 95 | + }, |
| 96 | + "transition": { |
| 97 | + "on_complete": "implement", |
| 98 | + "on_all_phases_complete": "review" |
| 99 | + } |
| 100 | + }, |
| 101 | + { |
| 102 | + "id": "review", |
| 103 | + "name": "Review", |
| 104 | + "description": "Final review and PR with 3-way review", |
| 105 | + "type": "build_verify", |
| 106 | + "build": { |
| 107 | + "prompt": "review.md", |
| 108 | + "artifact": "codev/reviews/${PROJECT_ID}-*.md" |
| 109 | + }, |
| 110 | + "verify": { |
| 111 | + "type": "pr-ready", |
| 112 | + "models": ["gemini", "codex", "claude"], |
| 113 | + "parallel": true |
| 114 | + }, |
| 115 | + "max_iterations": 7, |
| 116 | + "on_complete": { |
| 117 | + "commit": true, |
| 118 | + "push": true |
| 119 | + }, |
| 120 | + "checks": { |
| 121 | + "e2e_tests": { |
| 122 | + "command": "npm run test:e2e 2>&1 || echo 'e2e tests skipped (not configured)'", |
| 123 | + "cwd": "packages/codev", |
| 124 | + "description": "Full e2e test suite - only runs in review phase", |
| 125 | + "optional": true |
| 126 | + } |
| 127 | + }, |
| 128 | + "gate": "pr-ready", |
| 129 | + "next": null |
| 130 | + } |
| 131 | + ], |
| 132 | + "signals": { |
| 133 | + "PHASE_COMPLETE": { |
| 134 | + "description": "Signal current build phase is complete", |
| 135 | + "transitions_to": "verify" |
| 136 | + }, |
| 137 | + "BLOCKED": { |
| 138 | + "description": "Signal implementation is blocked", |
| 139 | + "requires": "reason" |
| 140 | + } |
| 141 | + }, |
| 142 | + "phase_completion": { |
| 143 | + "build_succeeds": "cd packages/codev && npm run build 2>&1", |
| 144 | + "tests_pass": "cd packages/codev && npm test 2>&1", |
| 145 | + "commit_has_code": "git log -1 --name-only --pretty=format: | grep -qE '\\.(ts|tsx|js|jsx|py|go|rs)$'" |
| 146 | + }, |
| 147 | + "defaults": { |
| 148 | + "mode": "strict", |
| 149 | + "max_iterations": 7, |
| 150 | + "verify": { |
| 151 | + "models": ["gemini", "codex", "claude"], |
| 152 | + "parallel": true |
| 153 | + }, |
| 154 | + "checks": { |
| 155 | + "build": { "command": "npm run build", "cwd": "packages/codev" }, |
| 156 | + "test": { "command": "npm test", "cwd": "packages/codev" } |
| 157 | + } |
| 158 | + } |
| 159 | +} |
0 commit comments