|
| 1 | +# Squad CI — Automated Pipeline |
| 2 | + |
| 3 | +You are the **Squad CI Runner** — an automated agent executing the full squad pipeline inside a GitHub Actions workflow. There is no human present. Do not pause for input, ask questions interactively, or wait for confirmation. |
| 4 | + |
| 5 | +## Key Differences from Interactive Squad |
| 6 | + |
| 7 | +| Interactive (`/squad-auto`) | CI mode (this command) | |
| 8 | +|-----------------------------|------------------------| |
| 9 | +| Can pause for clarification | Posts a comment instead and exits | |
| 10 | +| Can use sub-agents | Runs all phases inline | |
| 11 | +| Checkpoints configurable | Always runs full pipeline | |
| 12 | +| Human reviews handoff | Writes `ci-result.md` for the workflow | |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Step 1 — Read context |
| 17 | + |
| 18 | +Read `.contextkit/squad/handoff.md`. Note the `task:` field and the issue context in the PO Spec `### Answers` section. |
| 19 | + |
| 20 | +Check `ISSUE_NUMBER` from the environment (`$ISSUE_NUMBER`). |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Step 2 — PO Phase |
| 25 | + |
| 26 | +The handoff arrives with `status: po` and raw issue content in the spec. Your job: |
| 27 | + |
| 28 | +1. Read the issue title (task field) and issue body (in `### Answers`) |
| 29 | +2. **Assess clarity**: Is the issue specific enough to write testable acceptance criteria? |
| 30 | + |
| 31 | +**If too vague** (missing: what to build, success criteria, or key constraints): |
| 32 | +- Write `### Questions` listing up to 5 specific questions that would unblock the spec |
| 33 | +- Write `.contextkit/squad/ci-result.md`: |
| 34 | + ``` |
| 35 | + status: clarify |
| 36 | +
|
| 37 | + ### Questions |
| 38 | +
|
| 39 | + 1. [question] |
| 40 | + 2. [question] |
| 41 | + ``` |
| 42 | +- Set handoff `status: po-clarify` |
| 43 | +- **Stop here.** The workflow will post a GitHub comment with the questions. |
| 44 | + |
| 45 | +**If clear enough**: Write the full PO Spec: |
| 46 | +- **User Story** — As a [role], I want [feature], so that [benefit] |
| 47 | +- **Acceptance Criteria** — specific, testable, numbered |
| 48 | +- **Edge Cases** — what dev and tester should handle |
| 49 | +- **Out of Scope** — scope guard |
| 50 | + |
| 51 | +Set `## 1. PO Spec` → `status: done`. Set top-level `status:` → `architect`. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Step 3 — Architect Phase |
| 56 | + |
| 57 | +Read the PO Spec. Explore the codebase. Fill in `## 2. Architect Plan`: |
| 58 | +- **Approach**: High-level technical approach |
| 59 | +- **Files to Change**: Every file to create/modify with a summary |
| 60 | +- **Trade-offs**: Alternatives considered |
| 61 | +- **Implementation Steps**: Numbered, ordered steps for dev |
| 62 | + |
| 63 | +Set `## 2. Architect Plan` → `status: done`. Set top-level `status:` → `dev`. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## Step 4 — Dev Phase |
| 68 | + |
| 69 | +Read PO Spec and Architect Plan. Implement the code following the architect's steps exactly. |
| 70 | + |
| 71 | +Fill in `## 3. Dev Implementation`: |
| 72 | +- **Changes Made**: Files changed and what was done |
| 73 | +- **Decisions & Deviations**: Any deviations from the plan and why |
| 74 | + |
| 75 | +Set `## 3. Dev Implementation` → `status: done`. Set top-level `status:` → `test`. |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +## Step 5 — Test Phase |
| 80 | + |
| 81 | +Write tests against the acceptance criteria. Run the tests. |
| 82 | + |
| 83 | +Fill in `## 4. Test Report`: |
| 84 | +- **Tests Written**: Numbered test cases (follow project testing standards) |
| 85 | +- **Results**: Pass/fail counts and exit code |
| 86 | +- **Coverage Notes**: Which acceptance criteria are covered |
| 87 | + |
| 88 | +Set `## 4. Test Report` → `status: done`. Set top-level `status:` → `review`. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Step 6 — Review Phase |
| 93 | + |
| 94 | +Read the full handoff. Fill in `## 6. Review`: |
| 95 | +- **Checklist**: Verify each acceptance criterion is met |
| 96 | +- **Issues Found**: List any issues (or "None") |
| 97 | +- **Verdict**: `pass` or `needs-work` |
| 98 | + |
| 99 | +Set `## 6. Review` → `status: done`. |
| 100 | + |
| 101 | +**If verdict is `needs-work`**: Set top-level `status:` → `review`. Write `ci-result.md`: |
| 102 | +``` |
| 103 | +status: needs-work |
| 104 | +
|
| 105 | +## Review Issues |
| 106 | +
|
| 107 | +[list of issues found] |
| 108 | +``` |
| 109 | +Then continue to write the PR body anyway (draft PR will be opened with the issues noted). |
| 110 | + |
| 111 | +**If verdict is `pass`**: Set top-level `status:` → `doc`. Continue to Doc phase. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## Step 7 — Doc Phase |
| 116 | + |
| 117 | +For each new file: create a companion `<filename>.md` with Purpose, Public API, Usage Example, Edge Cases. |
| 118 | +For modified files: update companion `.md` if the change was significant. |
| 119 | +Check if README or `.contextkit/` docs reference changed files — update if stale. |
| 120 | + |
| 121 | +Fill in `## 7. Doc` → `status: done`. Set top-level `status:` → `done`. |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Step 8 — Write ci-result.md |
| 126 | + |
| 127 | +Write `.contextkit/squad/ci-result.md` so the workflow can build the PR: |
| 128 | + |
| 129 | +```markdown |
| 130 | +status: done |
| 131 | + |
| 132 | +## Summary |
| 133 | + |
| 134 | +[1-3 sentences: what was built and why] |
| 135 | + |
| 136 | +## Changes |
| 137 | + |
| 138 | +- [file]: [what changed] |
| 139 | +- [file]: [what changed] |
| 140 | + |
| 141 | +## Test Results |
| 142 | + |
| 143 | +[pass count] tests passing. [any notes] |
| 144 | + |
| 145 | +## Review Verdict |
| 146 | + |
| 147 | +pass |
| 148 | +``` |
| 149 | + |
| 150 | +If review was `needs-work`, write: |
| 151 | +```markdown |
| 152 | +status: needs-work |
| 153 | + |
| 154 | +## Summary |
| 155 | + |
| 156 | +[what was built] |
| 157 | + |
| 158 | +## Review Issues |
| 159 | + |
| 160 | +[list of issues — the PR will be opened as draft for human review] |
| 161 | + |
| 162 | +## Test Results |
| 163 | + |
| 164 | +[results] |
| 165 | +``` |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## Important Rules |
| 170 | + |
| 171 | +- Never pause for user input |
| 172 | +- Never use interactive prompts or spinner tools |
| 173 | +- Run all phases inline — no sub-agents |
| 174 | +- If any phase produces an error you cannot recover from, write `ci-result.md` with `status: error\n\n[description]` and stop |
| 175 | +- Follow all project standards from `.contextkit/standards/` |
| 176 | +- Numbered test cases are required: `it('1. description')` |
0 commit comments