$npx -y skills add gtrabanco/agentic-workflow --skill execute-phaseImplement one phase of a feature (default), or a small feature / a fix (--fix) by its SPEC's ## Phases ledger — one phase per invocation, the final phase is always Hardening & PR (the close-out); legacy SPECs without ## Phases run end-to-end in a single pass. Enforces branch safe
| 1 | # Execute Phase |
| 2 | |
| 3 | Three modes: |
| 4 | |
| 5 | - **feature phase** (default) — implement one phase of `docs/features/<NN>-<slug>/` using its `TASKS.md`. |
| 6 | - **single-pass unit** — a small feature (SPEC `Size: XS/S`; only a `SPEC.md`, no planning artifacts): execute its SPEC's `## Phases` **one phase per invocation**; a SPEC without `## Phases` runs end-to-end in one pass (legacy fallback — see *Workflows*). |
| 7 | - **`--fix`** — implement a fix from `docs/fix/<n>-<topic>/`: same phased consumption and legacy fallback. |
| 8 | |
| 9 | ## Turn contract — every invocation, verify before ending the turn |
| 10 | |
| 11 | ``` |
| 12 | ✓ 1. Branch verified FIRST: `git branch --show-current` was RUN and its output |
| 13 | pasted. Output = the default branch → `git switch -c <branch>` was RUN |
| 14 | before any edit. NEVER work on main/master. |
| 15 | ✓ 2. Phase-lint pre-flight guard RUN against the target phase (after the |
| 16 | dependency/own-status gates, before any edit) — its 8 boxes were checked, |
| 17 | not assumed. Any FAIL without `--force` → STOP with the fixed block; no |
| 18 | edit happens on a non-atomic phase. |
| 19 | ✓ 3. The gate was RUN (not assumed): commands + exit codes pasted. |
| 20 | ✓ 4. `git add <files>` and `git commit -m "<type>(<scope>): <summary>"` were |
| 21 | EXECUTED and the resulting sha is pasted. Describing a commit you did not |
| 22 | run counts as NOT committed. |
| 23 | ✓ 5. Unit finished (single-pass, --fix, or final phase)? Then `git push` and |
| 24 | `gh pr create` were EXECUTED and **the PR URL is printed in the chat** |
| 25 | (not every agent shows open PRs — the link in the chat is the contract). |
| 26 | The PR body is NEVER empty: what it does, why, evidence, and |
| 27 | `Closes #<n>` when issue-born. The body is passed with `--body-file` |
| 28 | (real Markdown, NO `\`-escaped backticks — see Issue policy). AND the roadmap row (or fix-index entry) |
| 29 | was updated to `done · [#<pr>](<pr-url>)` in a follow-up |
| 30 | `docs: link PR #<n>` commit, pushed to the same branch. A `done` row |
| 31 | without its PR link is an UNFINISHED unit. Unit not finished? Then |
| 32 | NOTHING was pushed. |
| 33 | ✓ 6. Clean-tree check LAST: `git status --porcelain` was RUN and its output |
| 34 | pasted immediately before ending the turn. Any tracked modification — |
| 35 | CODE OR DOCS (`docs/**` counts; doc updates left uncommitted are the #1 |
| 36 | close-out failure) — was committed before the turn ended. AND if the |
| 37 | branch has an open PR: `git status -sb` shows the branch is NOT ahead of |
| 38 | its remote (every commit pushed). A dirty tree or an unpushed commit on a |
| 39 | PR-backed branch = the turn is NOT done. |
| 40 | ✓ 7. Artifact language: explicit user instruction > the project's declared |
| 41 | docs language > English. The CONVERSATION language never decides — a |
| 42 | Spanish prompt still produces English commits/PRs/issues unless one of |
| 43 | the first two says otherwise. |
| 44 | ✓ 8. Descope guard applied to every issue created this turn (see *Descope |
| 45 | guard* under *Issue policy*): each classified discovered vs. descope; any |
| 46 | descope has a user-approved, dated `## Amendments` entry in the governing |
| 47 | SPEC created BEFORE the issue, and the issue links it. No issue created |
| 48 | this turn is the first record of a descope. No issues created this turn? |
| 49 | Box passes trivially — state so. |
| 50 | ✓ 9. The closing `→ Next:` block is printed as the ABSOLUTE last output. |
| 51 | ``` |
| 52 | |
| 53 | **Push policy — two regimes, by whether the PR exists yet.** Before the PR: |
| 54 | push happens exactly once, at the PR step — never mid-phase, never unasked, |
| 55 | never to the default branch. **After the PR exists:** every subsequent commit |
| 56 | on that branch (folded review findings, audit-blocker fixes, doc updates, the |
| 57 | `docs: link PR` commit) is pushed **immediately after committing** — an open |
| 58 | PR must always show the branch's latest state; CI and the merge gate judge |
| 59 | the remote, not your working copy. If, about to end the turn, any box is |
| 60 | unchecked: STOP and complete it now — a turn that ends with work implemented |
| 61 | but uncommitted, committed but unpushed |