vinta-ai-workflows 0.2.0-alpha2 → 0.2.0-alpha4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +199 -0
- package/README.md +5 -2
- package/package.json +7 -1
- package/schemas/README.md +1 -0
- package/schemas/ai-models.v1.schema.json +87 -0
- package/schemas/vinta-ai-workflows-config.v1.schema.json +20 -1
- package/skills/vinta-analyze-codebase/SKILL.md +1 -1
- package/skills/vinta-bootstrap-ai-tools/SKILL.md +19 -9
- package/skills/vinta-derive-skills/SKILL.md +98 -47
- package/skills/vinta-derive-skills/resources/foundation-skills/deslop-comments/SKILL.md +148 -0
- package/skills/vinta-derive-skills/resources/foundation-skills/plan-feature/SKILL.md +24 -27
- package/skills/vinta-derive-skills/resources/foundation-skills/plan-feature/resources/ai-models.yaml +98 -0
- package/skills/vinta-derive-skills/resources/foundation-skills/prepare-worktree/SKILL.md +89 -0
- package/skills/vinta-derive-skills/resources/foundation-skills/prepare-worktree/scripts/claude-worktree-write-guard.py +118 -0
- package/skills/vinta-derive-skills/resources/foundation-skills/prepare-worktree/scripts/gen-claude-sandbox-settings.sh +167 -0
- package/skills/vinta-derive-skills/resources/foundation-skills/prepare-worktree/scripts/sandbox-run.sh +106 -0
- package/skills/vinta-derive-skills/resources/foundation-skills/thermo-nuclear-code-quality-review/SKILL.md +129 -0
- package/skills/vinta-derive-skills/resources/plan-execution/README.md +42 -0
- package/skills/vinta-derive-skills/resources/{implement-plan-template-modular-substitutions.md → plan-execution/partials/commit-strategy/modular.md} +38 -70
- package/skills/vinta-derive-skills/resources/plan-execution/partials/commit-strategy/stacked.md +46 -0
- package/skills/vinta-derive-skills/resources/plan-execution/partials/implementer-prompt.md +78 -0
- package/skills/vinta-derive-skills/resources/plan-execution/partials/model-pick.md +19 -0
- package/skills/vinta-derive-skills/resources/plan-execution/partials/pr-context.md +61 -0
- package/skills/vinta-derive-skills/resources/plan-execution/partials/review-layers.md +50 -0
- package/skills/vinta-derive-skills/resources/plan-execution/partials/worktree-seam.md +68 -0
- package/skills/vinta-derive-skills/resources/{amend-plan-template.md → plan-execution/shell/amend-plan-template.md} +48 -42
- package/skills/vinta-derive-skills/resources/plan-execution/shell/implement-phase-template.md +47 -0
- package/skills/vinta-derive-skills/resources/plan-execution/shell/implement-plan-template.md +186 -0
- package/skills/vinta-derive-skills/resources/plan-execution/shell/integrate-phase-template.md +30 -0
- package/skills/vinta-derive-skills/resources/plan-execution/shell/review-phase-template.md +25 -0
- package/skills/vinta-derive-skills/resources/systematic-debugging-template.md +7 -3
- package/skills/vinta-update-project-skills/SKILL.md +1 -1
- package/skills/vinta-derive-skills/resources/implement-plan-template.md +0 -416
|
@@ -125,8 +125,9 @@ Goal: ship the fix at the right level of abstraction with the right safety net.
|
|
|
125
125
|
- `{{BUILD_CMD}}`
|
|
126
126
|
- `{{TEST_CMD}}`{{SCOPED_TEST_NOTE}}
|
|
127
127
|
{{E2E_OUTER_GATE_LINE}}
|
|
128
|
-
4. **
|
|
129
|
-
5. **
|
|
128
|
+
4. **Route the fix diff through the shared review gate.** Invoke [review-phase](../review-phase/SKILL.md) — the same three-layer review (mechanical checks, plan/intent-compliance walkthrough, independent reviewer subagent) + fix loop that [implement-plan](../implement-plan/SKILL.md) and [amend-plan](../amend-plan/SKILL.md) use — passing the fix diff, the one-sentence root cause + the new failing-then-passing test as the "body" to walk against, and `WORKROOT` = the current checkout. A bug fix is not done until review-phase returns clean. (When this skill runs *inside* implement-plan's inner/outer loop, the enclosing phase's review-phase already covers this — don't double-review; the standalone invocation is for bugs debugged outside a plan.)
|
|
129
|
+
5. **Verify on the observability side after deploy.** The error fingerprint from Phase 0 should stop firing. If the platform supports it, mark the issue resolved in the source MCP tool so a regression re-opens it instead of creating a duplicate.
|
|
130
|
+
6. **Document if the fix is non-obvious.** A comment is justified only when the *why* would surprise the next reader — a hidden invariant, a workaround for a known upstream bug, a constraint not visible from the call site. Don't narrate the change.
|
|
130
131
|
|
|
131
132
|
## Stop conditions — count your attempts
|
|
132
133
|
|
|
@@ -156,6 +157,8 @@ These are not debugging — they are guessing with extra steps. Stop and re-ente
|
|
|
156
157
|
|
|
157
158
|
When this skill runs inside [implement-plan](../implement-plan/SKILL.md) (the inner / outer test loop), the implementer agent invokes systematic-debugging on every red gate and reports the Phase-1 cause in its report. The orchestrator never overrides the Iron Law — a phase that can't name the cause is not allowed to land.
|
|
158
159
|
|
|
160
|
+
For the review gate in Phase 4, this skill shares [review-phase](../review-phase/SKILL.md) with implement-plan and amend-plan — one review implementation across all three, so a bug fix meets the same three-layer bar as any planned phase.
|
|
161
|
+
|
|
159
162
|
For new test scaffolding, defer to the project's test conventions captured in [AGENTS.md](../../AGENTS.md). For env / config issues uncovered in Phase 0, route to the project's `add-env-var` skill if shipped (`{{PROJECT_SKILLS_LIST}}`).
|
|
160
163
|
|
|
161
164
|
## Verification checklist (apply before claiming a bug fixed)
|
|
@@ -164,4 +167,5 @@ For new test scaffolding, defer to the project's test conventions captured in [A
|
|
|
164
167
|
2. Root cause stated in one sentence in the PR description.
|
|
165
168
|
3. New failing-then-passing test cited by file:line.
|
|
166
169
|
4. Full local gate green: `{{LINT_CMD}}` + `{{BUILD_CMD}}` + `{{TEST_CMD}}`{{E2E_OUTER_GATE_CHECKLIST}}.
|
|
167
|
-
5.
|
|
170
|
+
5. [review-phase](../review-phase/SKILL.md) run on the fix diff and returned clean (unless the fix landed inside an implement-plan phase already covered by its review-phase).
|
|
171
|
+
6. Observability source updated post-deploy (issue resolved / alert acknowledged) so a recurrence pages instead of silently re-opening.
|
|
@@ -8,7 +8,7 @@ description: Refresh the user's project skills under `ai-tools/skills/` against
|
|
|
8
8
|
[vinta-bootstrap-ai-tools](../vinta-bootstrap-ai-tools/SKILL.md) (specifically [vinta-derive-skills](../vinta-derive-skills/SKILL.md)) seeds a project's `ai-tools/skills/` directory from sources that live in this repo:
|
|
9
9
|
|
|
10
10
|
- **Verbatim foundation skills** — copied as-is from `vinta-derive-skills/resources/foundation-skills/<name>/SKILL.md`.
|
|
11
|
-
- **Templated skills** — `implement-plan
|
|
11
|
+
- **Templated skills** — the plan-execution unit (`implement-plan` + `implement-phase` + `review-phase` + `integrate-phase` + `amend-plan`) is rendered from the shells under `vinta-derive-skills/resources/plan-execution/shell/` (which `<!-- include -->` shared `partials/`) with project-specific values interpolated; `systematic-debugging` from `vinta-derive-skills/resources/systematic-debugging-template.md`.
|
|
12
12
|
- **Stack-derived skills** — drafted from prompts under `vinta-bootstrap-ai-tools/resources/stacks/<stack>/notes.md`.
|
|
13
13
|
- **User-authored skills** — anything else the team added later. **Never overwritten.**
|
|
14
14
|
|
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: implement-plan
|
|
3
|
-
description: Execute a phased implementation plan from `{{PLAN_DIR}}/` in {{PROJECT_NAME}} by orchestrating one subagent per phase (using whatever model the plan suggests and the runtime supports), pushing one stacked branch per phase to {{CODE_HOST}}, and tracking progress. Use when the user says "implement the plan", "execute plan X", "start implementation", "run phase N of plan Y", "implement {feature} plan", or asks to drive a `*_IMPLEMENTATION_PLAN.md` file phase-by-phase. NOT for one-off changes, single-file edits, or work that doesn't have an existing plan. {{PR_POLICY_DESCRIPTION}}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Implement Plan
|
|
7
|
-
|
|
8
|
-
Drive a phased plan in [`{{PLAN_DIR}}/`]({{PLAN_DIR}}/) to completion: spawn one subagent per phase (whichever model plan recommends + runtime can run), run lint / typecheck / unit / e2e (where applicable), push one stacked {{CODE_HOST}} branch per phase, keep a progress tracking file as context handoff between phases. Harness-agnostic — claude-code, OpenAI Codex, Google's runtime, or any framework with a "spawn subagent with model + prompt" primitive.
|
|
9
|
-
|
|
10
|
-
Execution counterpart to [plan-feature](../plan-feature/SKILL.md). Plan = contract; this skill = build pipeline.
|
|
11
|
-
|
|
12
|
-
## Working assumptions
|
|
13
|
-
|
|
14
|
-
- Repo: {{PROJECT_NAME}} ({{STACK_SUMMARY}}). Conventions: [AGENTS.md](AGENTS.md).
|
|
15
|
-
- Plan files: [`{{PLAN_DIR}}/YYYY-MM-DD-FEATURE_NAME_IMPLEMENTATION_PLAN.md`]({{PLAN_DIR}}/).
|
|
16
|
-
- Lint: `{{LINT_CMD}}`. Format: `{{FORMAT_CMD}}`.
|
|
17
|
-
- Type / build gate: `{{BUILD_CMD}}`{{TYPECHECK_NOTE}}.
|
|
18
|
-
- Unit / integration tests: `{{TEST_CMD}}` (everything){{SCOPED_TEST_NOTE}}.
|
|
19
|
-
{{E2E_BLOCK}}
|
|
20
|
-
{{STACK_SPECIFIC_DEPLOY_BLOCK}}
|
|
21
|
-
- Code host: **{{CODE_HOST}}**. {{PR_POLICY_BLOCK}}
|
|
22
|
-
- {{COAUTHOR_POLICY_BLOCK}}
|
|
23
|
-
|
|
24
|
-
## Step 0 — Locate + parse plan
|
|
25
|
-
|
|
26
|
-
Parse once, reuse for every phase:
|
|
27
|
-
|
|
28
|
-
1. **Identify plan file.** Ask user which plan (path or feature name). Feature name: `ls {{PLAN_DIR}}/` + grep; confirm before proceeding.
|
|
29
|
-
2. **Extract structured fields**, in order:
|
|
30
|
-
- **Feature name** + **plan id** — derived from filename's `FEATURE_NAME` portion only: strip `YYYY-MM-DD-` prefix + `_IMPLEMENTATION_PLAN.md` suffix. Kebab variant for branch names.
|
|
31
|
-
- **Goals + Non-goals** section — verbatim, used in every phase prompt.
|
|
32
|
-
- **Guiding Decisions** section — verbatim. Pay attention to: feature flag (key, scope, default, flip-on criterion), storage shape, tenant scoping, API contract decisions.
|
|
33
|
-
- **Data Model Changes** section — keep full body; later phases reference earlier subsections.
|
|
34
|
-
- **Phased Rollout** section — parse into phase records: `{ id, title, goal, body, spec_use_case, suggested_model_tier, reusable_skills, has_e2e, acceptance, is_cross_repo, is_flag_removal }`.
|
|
35
|
-
- **Risk & Rollout Notes**, **Open Questions**, **Touch List** sections — keep available; include in phase prompts only when relevant.
|
|
36
|
-
3. **Classify each phase**: `is_cross_repo`, `is_flag_removal` — orchestrator does NOT auto-execute these.
|
|
37
|
-
4. **Ask the user three opt-in questions** via `AskUserQuestion`. Defaults are project-specific (see below); record every answer in tracking under `run_options`:
|
|
38
|
-
|
|
39
|
-
a. **Pause between phases?** *"Do you want me to pause and wait for confirmation after each phase, before starting the next one? Lets you review the diff / branch / PR / tracking summary before moving on."* Options: `Auto-flow (default) — keep going phase to phase`, `Pause between phases — wait for go after each one`.
|
|
40
|
-
|
|
41
|
-
b. **Draft inline review comments per phase?** *"On top of the standard PR description, do you want me to scan each phase's diff and add 3–10 inline comments calling out non-obvious decisions (subtle invariants, feature-flag short-circuits, cross-phase coupling, upstream-contract naming)? Off by default — say yes when reviewers will appreciate annotated diffs."* Options: `Yes — include inline comments`, `No — PR description only`.
|
|
42
|
-
|
|
43
|
-
c. **Run phases in a worktree?** *"Do you want every phase's subagent to work inside an isolated git worktree (its own runnable copy of the app with its own dev + test DB, env files, docker-compose project name) instead of sharing your main checkout? Lets you keep using `{{DEFAULT_BRANCH}}` for unrelated work while this plan runs; survives parallel plans on the same repo without DB / port / docker collisions. Costs one extra checkout's worth of disk + the time it takes [prepare-worktree](../prepare-worktree/SKILL.md) to provision it."* Options: `No — run in current checkout`, `Yes — provision one shared worktree for the whole plan`. Default = value of `run_options.implement-plan.use_worktree` in `.vinta-ai-workflows.yaml` (`No` when unset).
|
|
44
|
-
|
|
45
|
-
When `Yes`: **the same worktree is used for every executable phase** — all phase branches stack inside it. The skill never provisions a second worktree mid-plan. If the user wants per-phase worktrees, that's a different workflow (split the plan into independent plans).
|
|
46
|
-
|
|
47
|
-
Skip this question entirely when `foundation_skills.prepare-worktree` is `disabled` in `.vinta-ai-workflows.yaml`: record `run_options.use_worktree = false`; surface a one-line note that worktree isolation is available if the team opts in via [vinta-sync-ai-tools](../../skills/vinta-sync-ai-tools/SKILL.md).
|
|
48
|
-
|
|
49
|
-
PR opening itself is **not** asked here — it's governed by the project's PR creation policy captured at bootstrap (see `{{PR_POLICY_BLOCK}}` above). When that policy = "agents create PRs", the [Open PR via context file](#1f-open-pr-via-context-file) step always opens the PR via [open-pr.sh](../foundation-skills/open-pr-from-context/scripts/open-pr.sh) regardless of the comment opt-in.{{COMMIT_STRATEGY_STEP0_QUESTION}}
|
|
50
|
-
|
|
51
|
-
5. **Confirm with user before starting.** Show plan path, phase list (id + title + tier + cross-repo/flag-removal flags + e2e flag), phases this skill will execute vs defer, {{BRANCH_NAMING_PATTERN_SUMMARY}}, captured `run_options.pause_between_phases` + `run_options.generate_inline_comments` + `run_options.use_worktree`{{COMMIT_STRATEGY_CONFIRM_NOTE}}{{PR_REMINDER_LINE}}.
|
|
52
|
-
|
|
53
|
-
Wait for "go". After that, the per-phase pause behavior follows `run_options.pause_between_phases`. Inline-comment drafting follows `run_options.generate_inline_comments`. Worktree isolation follows `run_options.use_worktree`.{{COMMIT_STRATEGY_STEP0_TRAILER}}
|
|
54
|
-
|
|
55
|
-
## Step 0.5 — Provision worktree (when `run_options.use_worktree = true`)
|
|
56
|
-
|
|
57
|
-
Skip when `run_options.use_worktree = false`; jump to Step 1.
|
|
58
|
-
|
|
59
|
-
When true, invoke [prepare-worktree](../prepare-worktree/SKILL.md) **once**, before any phase runs:
|
|
60
|
-
|
|
61
|
-
1. **Inputs.** Plan path (so prepare-worktree can read it for deps / migrations / env / compose churn — see prepare-worktree's **Plan inspection** step), suggested worktree name = `plan-{plan-id-kebab}`, plan-driven mode.
|
|
62
|
-
2. **Pre-run sanity.** Confirm no existing worktree at the target path (`git worktree list | grep <name>` — refuse if collision). Confirm `git -C <main> status` of the main checkout (warn if dirty; defer to prepare-worktree's **Sanity checks** step for the call).
|
|
63
|
-
3. **Run prepare-worktree.** Pass the plan file + worktree name. The skill returns:
|
|
64
|
-
- `worktree_path` — absolute path the phase subagents will `cd` into.
|
|
65
|
-
- `worktree_branch` — the base branch prepare-worktree created; phase branches stack off this.
|
|
66
|
-
- `worktree_summary` — `.vinta-ai-workflows/worktrees/<name>.yaml` (read by teardown).
|
|
67
|
-
4. **Persist to tracking.** Write `run_options.worktree_path`, `run_options.worktree_branch`, `run_options.worktree_summary` into `{{PLAN_DIR}}/TRACKING_{plan-id}.md` (Step 1g schema gains these three fields). All later phases read them — never re-provision mid-plan.
|
|
68
|
-
5. **Report to user.** Quote the prepare-worktree summary back: which dirs symlinked vs copied vs forked; which DB(s) forked + their names; compose project name; teardown command. Hold here until the user confirms (`AskUserQuestion`: `Looks good — start phase 1`, `Stop — let me adjust`).
|
|
69
|
-
|
|
70
|
-
**Worktree topology rule.** When `use_worktree = true`, every phase branches off the previous phase **inside the worktree**, not off `{{DEFAULT_BRANCH}}` in the main checkout. The first phase branches off `<worktree_branch>` (which prepare-worktree based on `origin/{{DEFAULT_BRANCH}}`); subsequent phases stack as usual. All `git` calls in the **{{BRANCH_PUSH_HEADING}}** step use `git -C <worktree_path>` (or `cd` into the worktree first). All inner / outer test commands in the [Prepare agent prompt](#1a-prepare-agent-prompt-token-efficient) step's working-instructions block run inside the worktree so they hit the forked DB / env / compose stack.
|
|
71
|
-
|
|
72
|
-
Failure modes:
|
|
73
|
-
- **prepare-worktree returns an error** (disk full, branch exists, DB clone failed) → surface to the user; do NOT fall back to "just run in the main checkout" silently — that defeats the opt-in. Ask: `Retry`, `Run in main checkout instead (flip use_worktree to false)`, `Stop`.
|
|
74
|
-
- **User cancels at the confirmation gate** → tear the worktree down (run the teardown command from prepare-worktree's report) before exiting, so the next run starts clean.
|
|
75
|
-
|
|
76
|
-
## Step 1 — Per-phase loop
|
|
77
|
-
|
|
78
|
-
For each phase that's `not is_cross_repo and not is_flag_removal`, in plan order:
|
|
79
|
-
|
|
80
|
-
### 1a. Prepare agent prompt (token-efficient)
|
|
81
|
-
|
|
82
|
-
Compose with **only what the agent needs**:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
You are implementing {phase.id}: {phase.title} of plan {plan.id}.
|
|
86
|
-
|
|
87
|
-
## Repo
|
|
88
|
-
{{PROJECT_NAME}} ({{STACK_SUMMARY}}).
|
|
89
|
-
|
|
90
|
-
{If run_options.use_worktree = true:}
|
|
91
|
-
## Worktree
|
|
92
|
-
Work entirely inside this worktree: `<run_options.worktree_path>`.
|
|
93
|
-
`cd` into it before any command. Every `git`, every lint / test / build / migrate
|
|
94
|
-
call runs there. Do NOT touch the main checkout — its DB, env, and compose stack
|
|
95
|
-
are intentionally separated. See `<run_options.worktree_path>/WORKTREE.md` for
|
|
96
|
-
what's forked vs shared (deps, dev DB, test DB, compose project name, env file).
|
|
97
|
-
Branch base for this phase: `<phase-specific base>` — orchestrator already
|
|
98
|
-
created your phase branch there; commit straight to it.
|
|
99
|
-
|
|
100
|
-
## Read first
|
|
101
|
-
1. AGENTS.md — repo conventions.
|
|
102
|
-
2. {{PLAN_DIR}}/{plan-filename}, the **Goals + Non-goals**, **Guiding Decisions**, **Data Model Changes** sections and YOUR phase body inside **Phased Rollout**.
|
|
103
|
-
{If run_options.use_worktree = true:} 3. `WORKTREE.md` at the worktree root — fork map (which dirs symlink to main vs are independent copies).
|
|
104
|
-
|
|
105
|
-
## Plan-level decisions (from Goals + Non-goals + Guiding Decisions)
|
|
106
|
-
{Goals + Non-goals verbatim}
|
|
107
|
-
{Guiding Decisions table verbatim}
|
|
108
|
-
{If feature flag declared:}
|
|
109
|
-
Feature flag: `{flag-key}` — scope `{per-tenant|per-request}`, default `{false|true}`.
|
|
110
|
-
Wire reads + writes per the plan's **Guiding Decisions** entry. Off-flag path = byte-for-byte pre-feature behavior.
|
|
111
|
-
|
|
112
|
-
## What was already implemented in prior phases
|
|
113
|
-
{Tracking file "Completed Phases" section. First executed phase: "Nothing yet — this is the first phase."}
|
|
114
|
-
|
|
115
|
-
## Your tasks (Phase {id} only)
|
|
116
|
-
{phase.body verbatim, including Goal / Spec use-case / Feature flag / Changes / Tests / Acceptance lines}
|
|
117
|
-
|
|
118
|
-
## Reusable skills you SHOULD invoke
|
|
119
|
-
{phase.reusable_skills — for each, instruct the agent to first read ai-tools/skills/{name}/SKILL.md, then follow that pattern.}
|
|
120
|
-
|
|
121
|
-
Project skills available: {{PROJECT_SKILLS_LIST}}
|
|
122
|
-
|
|
123
|
-
{{DEPENDENCY_LICENSE_BLOCK}}
|
|
124
|
-
|
|
125
|
-
## Working instructions
|
|
126
|
-
1. Read existing code paths your changes touch — do not write before reading.
|
|
127
|
-
2. Implement using Read/Edit/Write. Match existing patterns.
|
|
128
|
-
3. **Inner loop — fast iteration.** Scoped to files/apps you touched:
|
|
129
|
-
a. `{{LINT_CMD}}` until clean.
|
|
130
|
-
b. {{NEW_TEST_CMD_PATTERN}} for new tests individually.
|
|
131
|
-
c. Scoped suite: {{SCOPED_TEST_PATTERN}}.
|
|
132
|
-
4. Iterate 2–3 until **new tests pass individually** and the scoped suite is green. Do **not** advance to step 5 with red scoped tests.
|
|
133
|
-
5. **Outer gate — full local verification, only after step 4 is green.** All MUST pass before staging:
|
|
134
|
-
a. **Type / build:** `{{BUILD_CMD}}`.
|
|
135
|
-
b. **Full test suite:** `{{TEST_CMD}}`.
|
|
136
|
-
{{E2E_OUTER_GATE_LINE}}
|
|
137
|
-
6. Outer gate fails → return step 2 (fix regression), re-run inner loop, then 5a/5b/5c. **Never** commit, push, or proceed while any gate is red.
|
|
138
|
-
{{PER_PHASE_COMMIT_BLOCK}}
|
|
139
|
-
|
|
140
|
-
## Required output (single final report)
|
|
141
|
-
- Status: SUCCESS or FAILURE (and why).
|
|
142
|
-
- Files created/modified (paths only).
|
|
143
|
-
- 5–15 line summary of what you implemented and key decisions.
|
|
144
|
-
{{E2E_REPORT_FIELD}}
|
|
145
|
-
- Deviations from the plan body and reasoning.
|
|
146
|
-
- Anything you couldn't do (with explanation).
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**Don't** dump the full plan into every prompt. Tracking summaries replace prior phases as context. Always include the **Goals + Non-goals** and **Guiding Decisions** sections plus the relevant **Data Model Changes** subsection — load-bearing decisions; phases reach back frequently.
|
|
150
|
-
|
|
151
|
-
### 1b. Pick model from plan's per-phase suggestion
|
|
152
|
-
|
|
153
|
-
**Plan owns model selection — this skill does not re-derive tiers, doesn't assume vendor.** Each phase carries `**Suggested AI model**:` listing one model per vendor.
|
|
154
|
-
|
|
155
|
-
Pick:
|
|
156
|
-
|
|
157
|
-
1. Read line, parse out **all** vendor suggestions.
|
|
158
|
-
2. **Filter to what's actually available in the runtime.** Different harnesses expose different sets.
|
|
159
|
-
3. From surviving suggestions, **pick the cheapest / fastest** the runner can use.
|
|
160
|
-
4. Translate the chosen model to whatever form the runner's spawning tool expects.
|
|
161
|
-
5. Phase suggestion straddles tiers → pick the higher-tier suggestion.
|
|
162
|
-
6. Line missing / malformed → **ask the user**. Don't silently re-derive tier.
|
|
163
|
-
|
|
164
|
-
**Retry escalation (no user prompt):** picked model fails on a clear capability gap → step **one tier up** + retry once. After Tier 4 fails, STOP. Update tracking with `❌`, post the agent's report to the user, ask how to proceed.
|
|
165
|
-
|
|
166
|
-
Record the **model actually used** + the **plan's suggested tier** in tracking.
|
|
167
|
-
|
|
168
|
-
### 1c. Spawn subagent
|
|
169
|
-
|
|
170
|
-
Use whatever agent-spawning primitive the runtime exposes. Pass:
|
|
171
|
-
|
|
172
|
-
- Descriptive label (e.g. `"{plan.id} {phase.id}: {phase.title}"`).
|
|
173
|
-
- Model from the [Pick model from plan's per-phase suggestion](#1b-pick-model-from-plans-per-phase-suggestion) step, translated.
|
|
174
|
-
- Phase prompt from the [Prepare agent prompt](#1a-prepare-agent-prompt-token-efficient) step.
|
|
175
|
-
- The right **agent type**.
|
|
176
|
-
|
|
177
|
-
**Agent type per phase.** Project agents in [`ai-tools/agents/`](ai-tools/agents/) (exposed to claude-code via `.claude/agents` symlink):
|
|
178
|
-
|
|
179
|
-
{{AGENT_DISPATCH_TABLE}}
|
|
180
|
-
|
|
181
|
-
Phase combines shapes → agent type stays `implementer`, prompt lists every relevant SKILL.md. Agent type changes only when a stack-specialist's risk is the primary one.
|
|
182
|
-
|
|
183
|
-
**Avoid bouncing the same phase between multiple agents.** Wanting to "hand off" mid-phase → the plan should have split into sub-phases instead.
|
|
184
|
-
|
|
185
|
-
### 1d. Thorough review
|
|
186
|
-
|
|
187
|
-
Three layers, all required, in order. The orchestrator never edits — every issue surfaces as a fix-up subagent task.
|
|
188
|
-
|
|
189
|
-
#### Layer 1 — Mechanical checks
|
|
190
|
-
|
|
191
|
-
1. `git status` + `git diff --stat`: confirm file list matches the agent's report.
|
|
192
|
-
2. **Read the full diff** for every changed file using `git diff`. Spot-checking is not enough.
|
|
193
|
-
3. **Verify the outer gate** ran + green. Look in the report for explicit confirmation that `{{BUILD_CMD}}` AND `{{TEST_CMD}}` were executed + passed{{E2E_LAYER1_NOTE}}. Vague confirmation → **re-run yourself**.
|
|
194
|
-
4. **Scope creep**: file touched outside expected surface area? Unrelated formatting churn? Surface it.
|
|
195
|
-
5. **No-secrets scan**: `git diff` for `password|secret|token|api_key|AKIA|BEGIN [A-Z]+ KEY`.
|
|
196
|
-
6. **Stray main-checkout writes (only when `run_options.use_worktree = true`)**: a subagent is told to work inside the worktree, but a buggy agent (often a smaller model) can resolve an absolute path back to the **main checkout** and silently edit files there (worktrees have independent working trees, so those edits never reach the phase commit — they sit as uncommitted thrash in the main checkout, and the "missing" edits read as a silent fixer/implementer failure). After **every** implementer **and** fixer subagent returns, run `git -C <main-checkout-path> status --short | grep -vE '^\?\?'` (tracked modifications only). Any output is a BLOCKER for this phase:
|
|
197
|
-
- Diff the stray files (`git -C <main-checkout-path> diff -- <path>`) to recover intent.
|
|
198
|
-
- If the edit belongs in the worktree, re-dispatch the fixer/implementer with an explicit instruction to write to the worktree path (the change is missing from the phase commit until it does).
|
|
199
|
-
- Once recovered (or confirmed superseded by the correctly-committed worktree version), discard the stray edits with `git -C <main-checkout-path> restore -- <path>` so the main checkout returns clean. Never leave the main checkout dirty between phases — a later phase's Layer 1 can't tell new thrash from old.
|
|
200
|
-
`<main-checkout-path>` is the repo root the skill was invoked from (NOT `run_options.worktree_path`). Skip this check entirely when `run_options.use_worktree = false`.
|
|
201
|
-
{{DEPENDENCY_LICENSE_LAYER1_CHECK}}
|
|
202
|
-
{{COAUTHOR_LAYER1_CHECK}}
|
|
203
|
-
|
|
204
|
-
#### Layer 2 — Plan compliance walkthrough
|
|
205
|
-
|
|
206
|
-
Open phase body alongside diff and walk:
|
|
207
|
-
|
|
208
|
-
1. **Every numbered "Changes" item implemented.**
|
|
209
|
-
2. **Every "Tests" entry materialized**, with assertions actually exercising the called-out behavior.
|
|
210
|
-
3. **Acceptance line satisfiable** by the diff.
|
|
211
|
-
4. **Repo conventions** from AGENTS.md.
|
|
212
|
-
5. **Reusable-skill compliance.**
|
|
213
|
-
{{E2E_LAYER2_CHECK}}
|
|
214
|
-
6. **Feature-flag wiring** if the plan's **Guiding Decisions** declared a flag — flag-OFF byte-for-byte pre-feature behavior, ≥1 test asserts.
|
|
215
|
-
7. **Cross-phase consistency** with prior tracking summaries.
|
|
216
|
-
|
|
217
|
-
#### Layer 3 — Independent reviewer subagent
|
|
218
|
-
|
|
219
|
-
After Layers 1–2 pass, spawn a **separate** subagent (different session, no implementation context) using the project's `reviewer` agent type ([ai-tools/agents/reviewer.md](ai-tools/agents/reviewer.md)). Read-only by design.
|
|
220
|
-
|
|
221
|
-
Reviewer prompt template — see the reviewer agent's body for the standard form. Triage findings:
|
|
222
|
-
- **BLOCKER**: must fix before the **{{BRANCH_PUSH_HEADING}}** step below.
|
|
223
|
-
- **SHOULD-FIX**: fix in-phase if cheap; else follow-up issue + tracking note.
|
|
224
|
-
- **NIT**: ignore unless trivially cheap.
|
|
225
|
-
|
|
226
|
-
Reviewer finds nothing on a >300-LoC multi-file phase → suspicious. Read once more.
|
|
227
|
-
|
|
228
|
-
#### Fix loop
|
|
229
|
-
|
|
230
|
-
1. Spawn a **new** subagent — project's `fixer` agent type ([ai-tools/agents/fixer.md](ai-tools/agents/fixer.md)). Fix prompt quotes the finding verbatim.
|
|
231
|
-
2. The `fixer`'s system prompt mandates re-running the inner loop + outer gate.
|
|
232
|
-
3. After fixer returns, redo Layer 1 in full + the affected portion of Layer 2.
|
|
233
|
-
4. Loop until Layers 1, 2, 3 are clean.
|
|
234
|
-
|
|
235
|
-
### 1e. {{BRANCH_PUSH_HEADING}}
|
|
236
|
-
|
|
237
|
-
**Worktree path rule (applies to whichever commit strategy `{{BRANCH_NAMING_BLOCK}}` renders below).** When `run_options.use_worktree = false`, every `git` command runs in the main checkout exactly as written. When `true`, run every `git` command below inside the worktree — prefix with `git -C <run_options.worktree_path>` (or `cd` into it first), and the first executed phase branches off `<run_options.worktree_branch>` instead of `{{DEFAULT_BRANCH}}`. Branches / commits stack inside the worktree; nothing touches the main checkout's working tree.
|
|
238
|
-
|
|
239
|
-
{{BRANCH_NAMING_BLOCK}}
|
|
240
|
-
|
|
241
|
-
PR opening lives in the [Open PR via context file](#1f-open-pr-via-context-file) step below (single flow — context file + `open-pr.sh`). Subagents never open PRs themselves; the orchestrator does, after review passes.
|
|
242
|
-
|
|
243
|
-
### 1f. Open PR via context file
|
|
244
|
-
|
|
245
|
-
This is the **only** PR-creation path. PRs always go through {{PRS_CONTEXT_FILE_PATH_DESCRIPTION}} + the bundled [open-pr.sh](../foundation-skills/open-pr-from-context/scripts/open-pr.sh) script — even when inline comments are not requested. The file is the durable record; the script is the publisher.
|
|
246
|
-
|
|
247
|
-
{{PR_OPEN_TIMING_BLOCK}}
|
|
248
|
-
|
|
249
|
-
Two project-level signals decide the actual behavior:
|
|
250
|
-
|
|
251
|
-
| `{{PR_POLICY_BLOCK}}` policy | `run_options.generate_inline_comments` | What this **Open PR via context file** step does |
|
|
252
|
-
|---|---|---|
|
|
253
|
-
| agents create PRs | false | Write minimal context file (`# Title`, `# Description`, empty `# Comments`). Run `open-pr.sh` → PR opened, no inline comments. |
|
|
254
|
-
| agents create PRs | true | Write full context file (title + description + 3–10 inline comments). Run `open-pr.sh` → PR opened, all comments posted. |
|
|
255
|
-
| branches only | false | **Skip this step entirely.** Human will open PR manually from the pushed branch. |
|
|
256
|
-
| branches only | true | Write full context file (durable record). **Don't run `open-pr.sh`.** Human can publish later from a CLI-equipped session via [open-pr-from-context](../foundation-skills/open-pr-from-context/SKILL.md). Surface this in the [Send brief update](#1h-send-brief-update-to-user) step. |
|
|
257
|
-
|
|
258
|
-
#### Steps
|
|
259
|
-
|
|
260
|
-
1. **Skip if neither column applies** (policy = branches only AND `generate_inline_comments = false`). Jump to the [Update tracking file](#1g-update-tracking-file) step.
|
|
261
|
-
|
|
262
|
-
2. **Honor existing PR / MR templates.** Read `project.pr_template_paths` from `.vinta-ai-workflows.yaml`. For each entry:
|
|
263
|
-
- **One template** → load it; the prs-context `# Description` body must follow that template's section structure verbatim. Fill each section with phase-specific content drawn from the plan's **Goals + Non-goals**, **Guiding Decisions**, and the phase body. Preserve any `<!-- HTML comments -->` placeholders; do not strip the template's checklists. Sections you can't fill from phase data → leave the template's placeholder/prompt untouched (don't fabricate).
|
|
264
|
-
- **Multiple templates** (`PULL_REQUEST_TEMPLATE/` directory) → ask once via `AskUserQuestion`: list each template + its filename, ask which to use for this run. Cache the choice in tracking under `run_options.pr_template_used` so subsequent phases of the same plan use the same one without re-asking.
|
|
265
|
-
- **Empty array** → free-form description. Default sections: `## Summary` (1–3 sentences), `## Plan reference` (link / phase id), `## Test plan` (commands the reviewer can run).
|
|
266
|
-
|
|
267
|
-
When the project's PR template includes a checkbox checklist (e.g. `- [ ] Tests added`, `- [ ] Docs updated`), tick the boxes the phase's diff actually satisfies and leave unsatisfied ones unticked — never auto-tick everything.
|
|
268
|
-
|
|
269
|
-
GitHub also honors `?template=<name>` in the PR-create URL when the project has a multi-template directory. `gh pr create --body-file` writes the body directly so the URL trick isn't needed; the body must match the chosen template's structure regardless.
|
|
270
|
-
|
|
271
|
-
3. **Pick comment targets** (only when `generate_inline_comments = true`). Read the phase diff via `git diff {{DEFAULT_BRANCH}}...HEAD` (or the previous phase branch for stacked phases). Select 3–10 spots that benefit from a one-paragraph context note — typically:
|
|
272
|
-
- A subtle invariant the diff relies on (cite the plan's **Goals + Non-goals** / **Guiding Decisions** entries — by name, never use `§` shorthand).
|
|
273
|
-
- A workaround for a known framework / library limitation.
|
|
274
|
-
- A naming choice driven by an upstream contract.
|
|
275
|
-
- The off-flag short-circuit when a feature flag is in **Guiding Decisions**.
|
|
276
|
-
- Why a seemingly-cleaner refactor wasn't made (out of scope per **Goals + Non-goals**).
|
|
277
|
-
- Cross-phase coupling (this hook is consumed by phase N+k).
|
|
278
|
-
|
|
279
|
-
Skip lint/format churn, boilerplate matching nearby files, standard patterns from AGENTS.md, and self-explanatory test names. **A clean phase produces few comments — that's fine. Don't pad.**
|
|
280
|
-
|
|
281
|
-
When `generate_inline_comments = false`: skip this step. The file's `# Comments` block stays empty.
|
|
282
|
-
|
|
283
|
-
4. **Write `.vinta-ai-workflows/prs-context/{feature-kebab}/phase-{phase.id}.md`** following [resources/prs-context-template.md](../prs-context-template.md). Frontmatter: `plan_id`, `feature_name`, `phase_id`, `phase_title`, `branch`, `base`, `created_at`, `status: pending`, empty `pr_url`. Body sections: `# Title` (single-line PR title), `# Description` (Markdown body — uses the project's PR template structure from step 2 when one exists), `# Comments` (YAML list of `{file, start_line, end_line?, side, body}` — empty list when comments are off).
|
|
284
|
-
|
|
285
|
-
5. **Confirm `.vinta-ai-workflows/prs-context/` is in `.gitignore`.** [vinta-install-ai-tools-setup](../../../vinta-install-ai-tools-setup/SKILL.md) runs the multi-vendor setup script which appends `.vinta-ai-workflows/prs-context/` on its first invocation. If an older bootstrap missed it, append it now.
|
|
286
|
-
|
|
287
|
-
6. **Run `open-pr.sh`** (only when policy = agents create PRs). Detect a usable CLI (`gh` for GitHub, `glab` for GitLab) plus the script's other deps (`yq`, `jq`):
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
bash ai-tools/skills/open-pr-from-context/scripts/open-pr.sh .vinta-ai-workflows/prs-context/{feature-kebab}/phase-{phase.id}.md
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
Script opens the PR (or detects an existing one), posts each inline comment, rewrites the file's frontmatter to `status: published` + populated `pr_url`, appends a publish log. Exit codes:
|
|
294
|
-
|
|
295
|
-
- `0` — PR up, all comments (if any) posted. Capture `pr_url` for the [Send brief update](#1h-send-brief-update-to-user) step.
|
|
296
|
-
- `1` — PR up, ≥1 comment failed. Surface the failed `(file:line)` list to the user; continue to the [Update tracking file](#1g-update-tracking-file) step.
|
|
297
|
-
- `2` — Hard failure (deps missing, branch not pushed, CLI unauthed, file invalid). Surface the script's stderr; treat the phase as having no PR. The file stays `status: pending` so the user can re-run after fixing the gap.
|
|
298
|
-
|
|
299
|
-
When policy = "branches only": **don't run the script.** File stays `status: pending`.
|
|
300
|
-
|
|
301
|
-
7. **Skill wrapper** — [open-pr-from-context](../foundation-skills/open-pr-from-context/SKILL.md) is available for ad-hoc invocation (after the run, on a different machine, etc.). The orchestrator can call the script directly here; the skill is for humans.
|
|
302
|
-
|
|
303
|
-
### 1g. Update tracking file
|
|
304
|
-
|
|
305
|
-
Tracking lives at `{{PLAN_DIR}}/TRACKING_{plan-id}.md`. Commit on the **current** phase's branch — deletion in Step 3.
|
|
306
|
-
|
|
307
|
-
Schema: feature-name, plan path, started/last-updated dates, optional feature-flag info, **run options** (`pause_between_phases`, `generate_inline_comments`, `use_worktree`, `worktree_path`, `worktree_branch`, `worktree_summary` — last three only when `use_worktree = true`), {{TRACKING_BRANCH_FIELD}}, completed-phases (with status, model{{TRACKING_PHASE_BRANCH_FIELD}}, e2e+screenshots if any, 5–15 line summary), current phase, remaining phases, deferred phases.
|
|
308
|
-
|
|
309
|
-
The orchestrator writes this from the git diff + the agent's summary — not from the agent's narration.
|
|
310
|
-
|
|
311
|
-
### 1h. Send brief update to user
|
|
312
|
-
|
|
313
|
-
One short paragraph: phase N done, branch pushed{{PR_LINK_NOTE}}, what got built, and — when the [Open PR via context file](#1f-open-pr-via-context-file) step ran — the PR-context file path with its `status` (`published` + URL when `open-pr.sh` opened the PR; `pending` when the script wasn't run because PR policy = branches only or deps were missing). When `status: pending`, mention how to publish later (`bash ai-tools/skills/open-pr-from-context/scripts/open-pr.sh <path>`). Moving to phase N+1. No long retrospective — tracking file is the durable record.
|
|
314
|
-
|
|
315
|
-
### 1i. Per-phase pause gate (opt-in)
|
|
316
|
-
|
|
317
|
-
`run_options.pause_between_phases = false` (default) → **immediately spawn the next phase**. Do not wait.
|
|
318
|
-
|
|
319
|
-
`run_options.pause_between_phases = true` → ask the user via `AskUserQuestion`:
|
|
320
|
-
|
|
321
|
-
- `Continue — start phase N+1`
|
|
322
|
-
- `Pause — stop here, I'll resume later by re-invoking the skill` (orchestrator exits cleanly; tracking file already records progress so the next invocation resumes mid-plan per the "Re-running mid-plan" section).
|
|
323
|
-
- `Stop — abort the plan run` (orchestrator stops; user decides next steps manually).
|
|
324
|
-
|
|
325
|
-
Wait for the answer. Don't spawn anything in the meantime. The pause is the user's review window — they may inspect the diff, the branch, the PR-context file, or the tracking file before agreeing to continue.
|
|
326
|
-
|
|
327
|
-
## Cross-repo phases
|
|
328
|
-
|
|
329
|
-
Phase in another repo:
|
|
330
|
-
1. **Do not implement.**
|
|
331
|
-
2. Mark in tracking under "Deferred Phases".
|
|
332
|
-
3. Continue to the next in-repo phase. Don't block on cross-repo work.
|
|
333
|
-
|
|
334
|
-
## Flag-removal phase (always out of scope)
|
|
335
|
-
|
|
336
|
-
Plan declared a flag → last phase is `Phase N — Remove the {flag-key} feature flag`. This skill **never** executes that phase. Flag removal is gated on real-world soak signal + is the exclusive responsibility of a dedicated flag-removal skill (separate skill).
|
|
337
|
-
|
|
338
|
-
What this skill does instead:
|
|
339
|
-
1. Identify the phase during Step 0; always exclude.
|
|
340
|
-
2. Mark in tracking as deferred.
|
|
341
|
-
3. End the run with a `/schedule` offer pointing at the dedicated flag-removal skill.
|
|
342
|
-
4. Refuse + redirect if user asks this skill to remove the flag.
|
|
343
|
-
|
|
344
|
-
## Re-running mid-plan
|
|
345
|
-
|
|
346
|
-
User invokes the skill against a partially-done plan:
|
|
347
|
-
|
|
348
|
-
1. Read `{{PLAN_DIR}}/TRACKING_{plan-id}.md` if present. Extract `run_options.*` — including `worktree_path` / `worktree_branch` / `worktree_summary` when set. Never re-prompt the Step 0 opt-in questions on resume; the original answers stick.
|
|
349
|
-
2. **Worktree resume.** When `run_options.use_worktree = true`:
|
|
350
|
-
- Confirm the worktree still exists (`git worktree list | grep <worktree_path>`). Missing → ask user: `Reprovision (run prepare-worktree again with the same name)`, `Switch to main checkout (flip use_worktree to false for the rest of the run)`, `Stop`.
|
|
351
|
-
- Confirm the worktree summary file still parses; if not, regenerate from the existing worktree state.
|
|
352
|
-
- All resumed phases use the existing worktree — do not provision a second one.
|
|
353
|
-
3. `git -C <path> branch -a | grep plan/{plan-id-kebab}` to detect already-pushed phase branches (`<path>` = main checkout or worktree per `run_options.use_worktree`).
|
|
354
|
-
4. Cross-reference with the plan's phase list.
|
|
355
|
-
5. Confirm resumption point with the user.
|
|
356
|
-
|
|
357
|
-
## Step 2 — Final report
|
|
358
|
-
|
|
359
|
-
After all executable phases complete:
|
|
360
|
-
|
|
361
|
-
1. **Delete `TRACKING_{plan-id}.md`** on the last phase's branch. Commit. The plan file stays.
|
|
362
|
-
2. Send the user a final summary: {{FINAL_REPORT_BRANCH_SUMMARY}}; for UI-flow phases — list of `pr-screenshots/` files (if applicable); deferred phases (cross-repo + flag-removal); next steps for the human. When `run_options.use_worktree = true`: include the worktree path + branch + summary file path + the teardown command (`git worktree remove <path>` + the per-engine drop-db / `docker compose -p <project> down -v` lines from `<worktree_summary>`). Do NOT auto-run teardown — the user may still want the worktree to debug review feedback or land follow-ups.
|
|
363
|
-
{{FINAL_REPORT_PR_NOTE}}
|
|
364
|
-
3. Flag-removal phase deferred → end with `/schedule` offer for the dedicated flag-removal skill.
|
|
365
|
-
|
|
366
|
-
## Important rules
|
|
367
|
-
|
|
368
|
-
- **Read AGENTS.md** in every phase prompt.
|
|
369
|
-
- **Stage explicitly.** No `git add -A`.
|
|
370
|
-
- **Subagents work in fresh sessions.** Each phase = a new subagent. Tracking + plan files = the context handoff.
|
|
371
|
-
- **Orchestrator owns git topology.** Subagents commit but never branch, push, {{PR_RULE_TAIL}}.
|
|
372
|
-
{{COAUTHOR_RULE_LINE}}
|
|
373
|
-
- **Trust the plan's per-phase model suggestion.**
|
|
374
|
-
- **Don't re-implement what a project skill encodes.**
|
|
375
|
-
{{UI_E2E_RULE_LINE}}
|
|
376
|
-
- **Two-tier verification, in order, every phase.** Inner scoped, outer full repo.
|
|
377
|
-
- **Three-layer review, every phase, no exceptions.**
|
|
378
|
-
- **Orchestrator never edits code.**
|
|
379
|
-
- **Feature flags = gates, not toggles for tests.**
|
|
380
|
-
- **Never remove a feature flag from this skill.**
|
|
381
|
-
- **Stop on Tier-4 failure.**
|
|
382
|
-
- **Honor opt-in flags.** `run_options.pause_between_phases` controls the [Per-phase pause gate](#1i-per-phase-pause-gate-opt-in); `run_options.generate_inline_comments` controls whether the [Open PR via context file](#1f-open-pr-via-context-file) step drafts inline comments (always writes the file when that step runs at all — empty comments when off); `run_options.use_worktree` controls whether the [Provision worktree](#step-05--provision-worktree-when-run_optionsuse_worktree--true) step runs and whether every later `git` / lint / test / build / migrate call uses the worktree path.
|
|
383
|
-
- **One worktree per plan run.** When `use_worktree = true`, provision once in the [Provision worktree](#step-05--provision-worktree-when-run_optionsuse_worktree--true) step and reuse for every phase. Never spawn a second worktree mid-plan; never silently fall back to the main checkout on prepare-worktree failure (ask the user).
|
|
384
|
-
- **Don't auto-tear-down the worktree.** Step 2 surfaces the teardown command; the user runs it when they're ready (after reviewer feedback is addressed, after the PR merges, etc.).
|
|
385
|
-
- **Catch stray main-checkout writes when `use_worktree = true`.** A subagent can resolve a path back to the main checkout and silently edit there, leaving the change out of the phase commit. Layer 1 runs `git -C <main-checkout-path> status --short` after every implementer and fixer; any tracked modification is a BLOCKER — recover the intent, re-dispatch to the worktree, then restore the main checkout clean. `<main-checkout-path>` is the repo root the skill was invoked from, never `run_options.worktree_path`.
|
|
386
|
-
- **PR-context file + `open-pr.sh` is the only PR-creation path.** No raw `gh pr create` / `glab mr create` calls outside the bundled script. The file is durable; the script is the publisher.
|
|
387
|
-
{{DEPENDENCY_LICENSE_RULE_LINE}}
|
|
388
|
-
- **[Open PR via context file](#1f-open-pr-via-context-file) gating** = combination of project PR policy ({{PR_POLICY_BLOCK}}) and `generate_inline_comments`. See the matrix in that step. Skip it entirely only when policy = branches only AND comments = off.
|
|
389
|
-
- **Never use `§N` shorthand to point at sections** — neither in this skill body nor in any rendered file (tracking, prs-context, branch description). Always use the section's full name with a markdown link when possible. `§N` references are hard to read for humans and brittle when section numbering shifts.
|
|
390
|
-
|
|
391
|
-
## Quick checklist (orchestrator, per phase)
|
|
392
|
-
|
|
393
|
-
- [ ] Plan parsed; structured fields cached.
|
|
394
|
-
- [ ] Cross-repo + flag-removal phases identified + deferred.
|
|
395
|
-
- [ ] `run_options.use_worktree` resolved; [Provision worktree](#step-05--provision-worktree-when-run_optionsuse_worktree--true) ran when `true` (worktree provisioned + summary captured + user confirmed); skipped when `false`.
|
|
396
|
-
- [ ] Current phase: prompt composed with **Goals + Non-goals** + **Guiding Decisions** + relevant **Data Model Changes** subsection + tracking summaries + this phase's body (plus the worktree block when `use_worktree = true`).
|
|
397
|
-
- [ ] Model picked from `**Suggested AI model**:` line (cheapest available); plan tier recorded.
|
|
398
|
-
- [ ] Subagent spawned, report received.
|
|
399
|
-
- [ ] Inner loop green: scoped lint + new tests individually + scoped suite.
|
|
400
|
-
- [ ] **Outer gate green:** `{{BUILD_CMD}}` AND `{{TEST_CMD}}`{{E2E_OUTER_GATE_CHECKLIST}} both passed.
|
|
401
|
-
- [ ] Layer 1 review: full diff read; no scope creep; no secrets; outer gate confirmed{{COAUTHOR_CHECKLIST_NOTE}}; when `use_worktree = true`, `git -C <main-checkout-path> status --short` clean (no stray main-checkout writes) after the implementer and after every fixer.
|
|
402
|
-
- [ ] Layer 2 review: every "Changes" ticked; every "Tests" materialized; acceptance line satisfiable; conventions, reusable skills, e2e + screenshot compliance (if applicable), flag wiring all checked.
|
|
403
|
-
- [ ] Layer 3 review: adversarial review run; BLOCKERs fixed; SHOULD-FIX either fixed or noted.
|
|
404
|
-
- [ ] After any fix-up: Layers 1 + 2 + outer gate re-run.
|
|
405
|
-
- [ ] {{BRANCH_CHECKLIST_LINE}}{{PR_CHECKLIST_NOTE}}
|
|
406
|
-
{{COMMIT_STRATEGY_CHECKLIST_BLOCK}}
|
|
407
|
-
- [ ] **Open PR via context file** decision applied per matrix (PR policy + `generate_inline_comments`):
|
|
408
|
-
- [ ] PR-context file written when at least one of policy=create / comments=true holds.
|
|
409
|
-
- [ ] `open-pr.sh` run when policy=create AND deps available; PR URL captured.
|
|
410
|
-
- [ ] Per-comment failures (exit 1) surfaced with `(file:line)` list.
|
|
411
|
-
- [ ] Hard failure (exit 2) surfaced; file left `status: pending`.
|
|
412
|
-
- [ ] `TRACKING_{plan-id}.md` updated.
|
|
413
|
-
- [ ] One-paragraph user update sent (PR URL or pending-file path included).
|
|
414
|
-
- [ ] If `run_options.pause_between_phases = true`: prompted user (`Continue` / `Pause` / `Stop`); honored answer.
|
|
415
|
-
- [ ] If `run_options.pause_between_phases = false`: next phase started immediately.
|
|
416
|
-
- [ ] On final phase: tracking file deleted; final summary lists branches{{FINAL_CHECKLIST_PR_NOTE}}; any `status: pending` PR-context files listed with publish command; `/schedule` offer for flag-removal if applicable.
|