@gtrabanco/pi-agentic-workflow 0.13.2 → 0.14.0
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/README.md +3 -9
- package/dist/routing/catalogue.d.ts +1 -1
- package/dist/routing/catalogue.js +1 -1
- package/dist/runtime.d.ts +45 -0
- package/dist/runtime.js +62 -0
- package/package.json +10 -8
- package/skills/audit-docs/SKILL.md +6 -5
- package/skills/audit-pr/SKILL.md +1 -1
- package/skills/audit-pr/references/PORTABILITY.md +1 -1
- package/skills/execute-phase/SKILL.md +207 -116
- package/skills/execute-phase/references/DESCOPE.md +22 -18
- package/skills/execute-phase/references/EXECUTION_CONTRACT.md +69 -77
- package/skills/execute-phase/references/FOLDING.md +34 -47
- package/skills/execute-phase/references/PREFLIGHT.md +103 -114
- package/skills/execute-phase/references/PRE_EXECUTION_GATE.md +53 -60
- package/skills/init-workspace/SKILL.md +52 -16
- package/skills/init-workspace/references/BOOTSTRAP_DISCOVERY.md +6 -6
- package/skills/init-workspace/references/BOOTSTRAP_WRITE.md +17 -10
- package/skills/init-workspace/references/PORTABILITY.md +1 -1
- package/skills/init-workspace/references/UPGRADE.md +50 -15
- package/skills/log-session/SKILL.md +4 -3
- package/skills/orchestration-envelope/references/TURN_CONTRACT.md +1 -1
- package/skills/pre-execution-review/references/LEDGERS.md +39 -39
- package/skills/pre-execution-review/references/POLICY.md +1 -0
- package/skills/product-audit/SKILL.md +4 -4
- package/skills/product-audit/references/AUDIT_PROCESS.md +3 -3
- package/skills/review-change/SKILL.md +1 -1
- package/skills/review-change/references/PORTABILITY.md +1 -1
- package/skills/unit-lane/SKILL.md +154 -0
- package/skills/unit-lane/references/DESIGN.md +35 -0
- package/skills/unit-lane/references/DOCS.md +36 -0
- package/skills/unit-lane/references/EVIDENCE.md +34 -0
- package/skills/unit-lane/references/IMPLEMENT.md +45 -0
- package/skills/unit-lane/references/PLAN.md +38 -0
- package/skills/unit-lane/references/RELEASE.md +45 -0
- package/skills/unit-lane/references/RESEARCH.md +37 -0
- package/skills/unit-lane/references/REVIEW.md +45 -0
- package/skills/unit-lane/references/STEPS.md +23 -0
- package/skills/unit-lane/references/TESTS.md +32 -0
- package/skills/workflow-status/references/ENVELOPE_FIELDS.md +5 -6
- package/skills/workflow-status/references/SENSOR_CORE.md +16 -20
- package/skills/workflow-status/references/SENSOR_SIGNALS.md +5 -7
- package/skills/design-feature/SKILL.md +0 -231
- package/skills/design-feature/references/INTERVIEW.md +0 -74
- package/skills/design-feature/references/PORTABILITY.md +0 -15
- package/skills/design-feature/references/REPAIR.md +0 -88
- package/skills/design-feature/references/UPSERT_EXAMPLE.md +0 -8
- package/skills/design-feature/references/WRITE_AND_UPSERT.md +0 -115
- package/skills/evidence-grounding/SKILL.md +0 -174
- package/skills/evidence-grounding/references/DELEGATION.md +0 -131
- package/skills/evidence-grounding/references/READINESS.md +0 -130
- package/skills/evidence-grounding/references/ROWS.md +0 -93
- package/skills/execute-phase/references/BATCH_AND_PORTABILITY.md +0 -57
- package/skills/execute-phase/references/CLOSEOUT.md +0 -77
- package/skills/execute-phase/references/HANDOFF.md +0 -21
- package/skills/execute-phase/references/OPPORTUNISTIC_FINDING.md +0 -45
- package/skills/execute-phase/references/UNIT_LOOP.md +0 -88
- package/skills/execute-phase/references/WORKFLOWS_FEATURE.md +0 -37
- package/skills/execute-phase/references/WORKFLOWS_FIX.md +0 -43
- package/skills/execute-phase/references/WORKFLOWS_LEGACY.md +0 -26
- package/skills/execute-phase/references/WORKFLOWS_SMALL_PHASED.md +0 -38
- package/skills/generate-docs/SKILL.md +0 -145
- package/skills/generate-docs/references/ADAPTERS.md +0 -15
- package/skills/generate-docs/references/ADAPTER_DISCOVERY.md +0 -33
- package/skills/generate-docs/references/GENERATION_PROCESS.md +0 -90
- package/skills/implementation-discovery/SKILL.md +0 -209
- package/skills/plan-feature/SKILL.md +0 -208
- package/skills/plan-feature/references/ROUTING.md +0 -155
- package/skills/plan-feature-from-issue/SKILL.md +0 -162
- package/skills/plan-feature-scaffold/SKILL.md +0 -112
- package/skills/plan-feature-scaffold/references/SCAFFOLD_PROCESS.md +0 -122
- package/skills/plan-fix/SKILL.md +0 -161
- package/skills/plan-fix/references/PLANNING_PROCESS.md +0 -148
- package/skills/plan-fix/references/SPEC_CONTRACT.md +0 -22
- package/skills/planning-preflight/SKILL.md +0 -130
- package/skills/replan-findings/SKILL.md +0 -131
- package/skills/replan-findings/references/PHASE_APPEND.md +0 -89
- package/skills/review-plan/SKILL.md +0 -154
- package/skills/review-plan/references/CHECKS.md +0 -111
- package/skills/review-plan/references/ENG-CHECKS.md +0 -30
- package/skills/review-plan/references/OUTPUT.md +0 -166
- package/skills/review-spec/SKILL.md +0 -145
- package/skills/review-spec/references/CHECKS.md +0 -108
- package/skills/review-spec/references/OUTPUT.md +0 -160
- package/skills/ship-roadmap/SKILL.md +0 -120
- package/skills/ship-roadmap/references/ADVANCE.md +0 -117
- package/skills/ship-roadmap/references/AUDIT_AND_MERGE.md +0 -64
- package/skills/ship-roadmap/references/CLOSEOUT_AND_LOG.md +0 -27
- package/skills/ship-roadmap/references/FOUNDING.md +0 -101
- package/skills/ship-roadmap/references/GUARDRAILS.md +0 -56
- package/skills/ship-roadmap/references/MODEL_ROUTING.md +0 -16
- package/skills/ship-roadmap/references/PORTABILITY.md +0 -34
- package/skills/ship-roadmap/references/RECOVERY_AND_SELECTION.md +0 -94
- package/skills/ship-roadmap/references/STOP_CONDITIONS.md +0 -9
- package/skills/ship-roadmap/references/TERMINAL_REPORT.md +0 -34
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@ that gives your session back afterwards.
|
|
|
7
7
|
|
|
8
8
|
- **Canonical skills, unchanged.** The package ships the same `SKILL.md` files as
|
|
9
9
|
this repository, byte for byte — no Pi-specific fork to drift.
|
|
10
|
-
- **Friendly commands.** Type `/
|
|
11
|
-
`/skill:
|
|
10
|
+
- **Friendly commands.** Type `/unit-lane <slug>`, not
|
|
11
|
+
`/skill:unit-lane <slug>`.
|
|
12
12
|
- **Routing you can forget about.** Nothing is configured by default: every
|
|
13
13
|
command runs on the model you already have.
|
|
14
14
|
|
|
@@ -36,21 +36,15 @@ their own — they are composed by the ones above:
|
|
|
36
36
|
| --- | --- |
|
|
37
37
|
| `/audit-docs` | Check that docs, roadmap, code and the fix index agree. |
|
|
38
38
|
| `/audit-pr` | The merge gate: is this PR ready? |
|
|
39
|
-
| `/design-feature` | Turn a raw idea into a designed SPEC. |
|
|
40
39
|
| `/discover-repository-state` | Freeze verified repository facts. |
|
|
41
40
|
| `/execute-phase` | Implement the remaining phases of a planned unit. |
|
|
42
41
|
| `/fold-findings` | Repair persisted fix-now findings. |
|
|
43
|
-
| `/generate-docs` | Generate incremental, diff-driven developer guides. |
|
|
44
42
|
| `/init-workspace` | Adapt the workflow scaffold to a repository. |
|
|
45
43
|
| `/log-session` | Append a structured session entry to `docs/LOGS.md`. |
|
|
46
|
-
| `/plan-feature` | Route designed work into planning and the roadmap. |
|
|
47
|
-
| `/plan-fix` | Draft a phased fix SPEC from one or more issues. |
|
|
48
44
|
| `/product-audit` | Audit the product surface, not just the diff. |
|
|
49
45
|
| `/resolve-repository-state` | Resolve a contradiction in frozen facts. |
|
|
50
46
|
| `/review-change` | Review a change with the applicable axes. |
|
|
51
|
-
| `/
|
|
52
|
-
| `/review-spec` | Review a designed SPEC in a clean context. |
|
|
53
|
-
| `/ship-roadmap` | Find or continue a roadmap, one stage per run. |
|
|
47
|
+
| `/unit-lane` | Run the adaptive lane on a unit: triage, steps, evidence, release. |
|
|
54
48
|
| `/triage-issue` | Verify an issue or finding against current code. |
|
|
55
49
|
| `/workflow-status` | Read-only state of the repository and roadmap. |
|
|
56
50
|
|
|
@@ -10,7 +10,7 @@ export interface SkillMeta {
|
|
|
10
10
|
* Minimal frontmatter reader: `name`, `description`, `user-invocable` only.
|
|
11
11
|
*
|
|
12
12
|
* `user-invocable` must say `true` to count: this repository's own rule
|
|
13
|
-
* (
|
|
13
|
+
* (AGENTS.md — the key "REQUIRED for it to appear in the agent's /command menu")
|
|
14
14
|
* makes absence mean internal, and `scripts/bundle-skills.mjs` reads it the same
|
|
15
15
|
* way. The two scanners agree because the rule is stated once per scanner and
|
|
16
16
|
* pinned by `test/alias-coverage.test.mjs`, not because either default is safe.
|
|
@@ -16,7 +16,7 @@ const SKILL_FILE = "SKILL.md";
|
|
|
16
16
|
* Minimal frontmatter reader: `name`, `description`, `user-invocable` only.
|
|
17
17
|
*
|
|
18
18
|
* `user-invocable` must say `true` to count: this repository's own rule
|
|
19
|
-
* (
|
|
19
|
+
* (AGENTS.md — the key "REQUIRED for it to appear in the agent's /command menu")
|
|
20
20
|
* makes absence mean internal, and `scripts/bundle-skills.mjs` reads it the same
|
|
21
21
|
* way. The two scanners agree because the rule is stated once per scanner and
|
|
22
22
|
* pinned by `test/alias-coverage.test.mjs`, not because either default is safe.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime resolver — determines what runtime pi itself runs under so
|
|
3
|
+
* spawned children inherit the same choice.
|
|
4
|
+
*
|
|
5
|
+
* The current process is always pi (this module lives inside the package
|
|
6
|
+
* that ships with pi). Whichever runtime launched pi decides what
|
|
7
|
+
* children get:
|
|
8
|
+
* - pi installed via `bun add -g` → bun
|
|
9
|
+
* - pi installed via `npm install -g` → node
|
|
10
|
+
*
|
|
11
|
+
* `AGENTIC_WORKFLOW_RUNTIME` env override is the highest priority: it
|
|
12
|
+
* always wins, letting the operator force a specific runtime regardless
|
|
13
|
+
* of how pi was installed.
|
|
14
|
+
*
|
|
15
|
+
* Exported from the package's public entry (compiled from src/ → dist/).
|
|
16
|
+
* Intended call site: wherever the extension spawns a `.mjs` script,
|
|
17
|
+
* use `runtimeBin()` + `runtimeEnv()` instead of a hardcoded `"node"`
|
|
18
|
+
* or `"bun"`.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Detect the runtime of the *current process* (which is pi).
|
|
22
|
+
* Returns `"bun"` when `globalThis.Bun` exists, or when
|
|
23
|
+
* `process.execPath` contains the substring `"bun"`; otherwise `"node"`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function detectRuntime(): "bun" | "node";
|
|
26
|
+
/**
|
|
27
|
+
* Return an environment object for spawned children that ensures
|
|
28
|
+
* `AGENTIC_WORKFLOW_RUNTIME` is set.
|
|
29
|
+
*
|
|
30
|
+
* Priority:
|
|
31
|
+
* 1. If the caller passes an explicit value, use it (user override).
|
|
32
|
+
* 2. If `AGENTIC_WORKFLOW_RUNTIME` is already in `process.env`, use it.
|
|
33
|
+
* 3. Fall back to the detected runtime.
|
|
34
|
+
*
|
|
35
|
+
* Returns `{ AGENTIC_WORKFLOW_RUNTIME: "bun" | "node" }`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function runtimeEnv(overrides?: {
|
|
38
|
+
AGENTIC_WORKFLOW_RUNTIME?: "bun" | "node";
|
|
39
|
+
}): Record<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Return the executable name to spawn for running a script.
|
|
42
|
+
* Returns `"bun"` or `"node"` based on the detected runtime,
|
|
43
|
+
* respecting the `AGENTIC_WORKFLOW_RUNTIME` env override.
|
|
44
|
+
*/
|
|
45
|
+
export declare function runtimeBin(): "bun" | "node";
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime resolver — determines what runtime pi itself runs under so
|
|
3
|
+
* spawned children inherit the same choice.
|
|
4
|
+
*
|
|
5
|
+
* The current process is always pi (this module lives inside the package
|
|
6
|
+
* that ships with pi). Whichever runtime launched pi decides what
|
|
7
|
+
* children get:
|
|
8
|
+
* - pi installed via `bun add -g` → bun
|
|
9
|
+
* - pi installed via `npm install -g` → node
|
|
10
|
+
*
|
|
11
|
+
* `AGENTIC_WORKFLOW_RUNTIME` env override is the highest priority: it
|
|
12
|
+
* always wins, letting the operator force a specific runtime regardless
|
|
13
|
+
* of how pi was installed.
|
|
14
|
+
*
|
|
15
|
+
* Exported from the package's public entry (compiled from src/ → dist/).
|
|
16
|
+
* Intended call site: wherever the extension spawns a `.mjs` script,
|
|
17
|
+
* use `runtimeBin()` + `runtimeEnv()` instead of a hardcoded `"node"`
|
|
18
|
+
* or `"bun"`.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Detect the runtime of the *current process* (which is pi).
|
|
22
|
+
* Returns `"bun"` when `globalThis.Bun` exists, or when
|
|
23
|
+
* `process.execPath` contains the substring `"bun"`; otherwise `"node"`.
|
|
24
|
+
*/
|
|
25
|
+
export function detectRuntime() {
|
|
26
|
+
if (globalThis.Bun !== undefined) {
|
|
27
|
+
return "bun";
|
|
28
|
+
}
|
|
29
|
+
const execPath = process.execPath ?? "";
|
|
30
|
+
if (execPath.includes("bun")) {
|
|
31
|
+
return "bun";
|
|
32
|
+
}
|
|
33
|
+
return "node";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Return an environment object for spawned children that ensures
|
|
37
|
+
* `AGENTIC_WORKFLOW_RUNTIME` is set.
|
|
38
|
+
*
|
|
39
|
+
* Priority:
|
|
40
|
+
* 1. If the caller passes an explicit value, use it (user override).
|
|
41
|
+
* 2. If `AGENTIC_WORKFLOW_RUNTIME` is already in `process.env`, use it.
|
|
42
|
+
* 3. Fall back to the detected runtime.
|
|
43
|
+
*
|
|
44
|
+
* Returns `{ AGENTIC_WORKFLOW_RUNTIME: "bun" | "node" }`.
|
|
45
|
+
*/
|
|
46
|
+
export function runtimeEnv(overrides) {
|
|
47
|
+
const value = overrides?.AGENTIC_WORKFLOW_RUNTIME ??
|
|
48
|
+
process.env.AGENTIC_WORKFLOW_RUNTIME ??
|
|
49
|
+
detectRuntime();
|
|
50
|
+
return { AGENTIC_WORKFLOW_RUNTIME: value };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Return the executable name to spawn for running a script.
|
|
54
|
+
* Returns `"bun"` or `"node"` based on the detected runtime,
|
|
55
|
+
* respecting the `AGENTIC_WORKFLOW_RUNTIME` env override.
|
|
56
|
+
*/
|
|
57
|
+
export function runtimeBin() {
|
|
58
|
+
const env = process.env.AGENTIC_WORKFLOW_RUNTIME;
|
|
59
|
+
if (env === "bun" || env === "node")
|
|
60
|
+
return env;
|
|
61
|
+
return detectRuntime();
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtrabanco/pi-agentic-workflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Pi package: canonical agentic-workflow skills, friendly slash commands, and per-command model routing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -44,18 +44,20 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc",
|
|
46
46
|
"bundle:skills": "bun scripts/bundle-skills.mjs",
|
|
47
|
-
"
|
|
48
|
-
"test": "tsc && bun test test/*.test.mjs",
|
|
49
|
-
"test:node": "tsc && node --test test/*.test.mjs",
|
|
50
|
-
"prepublishOnly": "bun run build && bun run test",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
47
|
+
"clean:skills": "bun scripts/bundle-skills.mjs --clean",
|
|
48
|
+
"test": "bun run bundle:skills && tsc && bun test test/*.test.mjs",
|
|
49
|
+
"test:node": "bun run bundle:skills && tsc && node --test test/*.test.mjs",
|
|
50
|
+
"prepublishOnly": "bun run build && bun run bundle:skills && bun run test",
|
|
51
|
+
"postpack": "bun run clean:skills",
|
|
52
|
+
"mutation": "bun run bundle:skills && bun scripts/mutation-check.mjs",
|
|
53
|
+
"prepare": "bun run build && bun run bundle:skills"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"@earendil-works/pi-coding-agent": ">=0.87.0"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
|
-
"@earendil-works/pi-tui": "0.87.0"
|
|
59
|
+
"@earendil-works/pi-tui": "0.87.0",
|
|
60
|
+
"@gtrabanco/agentic-workflow": "0.1.1"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@types/node": "24.13.3",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: audit-docs
|
|
3
3
|
user-invocable: true
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.1
|
|
5
5
|
argument-hint: "[--fix]"
|
|
6
6
|
author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
|
|
7
7
|
license: MIT
|
|
@@ -11,7 +11,8 @@ description: >
|
|
|
11
11
|
entries already merged/closed, broken documentation-map links, dependency
|
|
12
12
|
cycles, artifacts in the wrong language, naming-convention violations — and
|
|
13
13
|
reports them ranked by severity, fixing only low-risk items on request.
|
|
14
|
-
|
|
14
|
+
Model-agnostic: the skill inherits whatever model and effort your agent
|
|
15
|
+
session is already using.
|
|
15
16
|
Triggers: "check doc consistency", "are the docs in sync", "audit the docs",
|
|
16
17
|
"doc coherence review", "did the docs drift", "validate the roadmap".
|
|
17
18
|
---
|
|
@@ -93,12 +94,12 @@ run the command shown, don't infer.
|
|
|
93
94
|
feature/fix-scoped changes committed directly without a PR: HIGH.
|
|
94
95
|
13. **Generated-docs provenance (only when the documentation map declares a
|
|
95
96
|
`Docs site` block; otherwise state n/a).** Scan the declared content dir
|
|
96
|
-
for pages
|
|
97
|
+
for orphan pages
|
|
97
98
|
each: (a) its `source-unit` exists in the roadmap or fix index — no match
|
|
98
99
|
is an **orphan** (low: propose deletion or re-attribution); (b) the
|
|
99
100
|
unit's PR merged **after** the page's `updated` date with commits touching
|
|
100
101
|
the page's subject paths — that page is **stale** (LOW: propose
|
|
101
|
-
|
|
102
|
+
). Cite page path + unit per finding.
|
|
102
103
|
14. **Commit format & dependency discipline.** Sample the unit branches'
|
|
103
104
|
commits: `<type>(<scope>): <summary>` conventional format (violations:
|
|
104
105
|
LOW). Every `in-progress`/`done` row's `Depends on:` closure was merged —
|
|
@@ -149,7 +150,7 @@ enables:
|
|
|
149
150
|
- **No slash-command menu** — where this skill says `/<skill>`, open that
|
|
150
151
|
skill's `SKILL.md` (wherever your agent installed the skills) and follow it
|
|
151
152
|
literally, in a fresh conversation: hand-offs assume a clean context.
|
|
152
|
-
- **No per-skill `model:`/`effort:`** —
|
|
153
|
+
- **No per-skill `model:`/`effort:`** — no skill pins a tier; pick tiers yourself:
|
|
153
154
|
these are mostly mechanical cross-document checks — a mid-tier model is
|
|
154
155
|
enough; escalate to your strongest only for a deep audit.
|
|
155
156
|
|
package/skills/audit-pr/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ enables:
|
|
|
7
7
|
- **No slash-command menu** — where this skill says `/<skill>`, open that
|
|
8
8
|
skill's `SKILL.md` (wherever your agent installed the skills) and follow it
|
|
9
9
|
literally, in a fresh conversation: hand-offs assume a clean context.
|
|
10
|
-
- **No per-skill `model:`/`effort:`** —
|
|
10
|
+
- **No per-skill `model:`/`effort:`** — no skill pins a tier; pick tiers yourself:
|
|
11
11
|
the merge gate is the highest-stakes automated verdict — run it on your
|
|
12
12
|
**strongest** model, never on the cheap tier that wrote the code.
|
|
13
13
|
- **Receipt consumption is comment-based, not forge-branded.** The
|
|
@@ -1,138 +1,229 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: execute-phase
|
|
3
3
|
user-invocable: true
|
|
4
|
-
version:
|
|
5
|
-
argument-hint: <NN> [P<k
|
|
4
|
+
version: 5.0.0
|
|
5
|
+
argument-hint: <NN-slug> [P<k>|step] [--max-attempts N] [--force]
|
|
6
6
|
allowed-tools: [Bash, Read, Edit, Write, MultiEdit]
|
|
7
7
|
author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
|
|
8
8
|
license: MIT
|
|
9
9
|
description: >
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Step executor for units whose triage (unit-lane) decided which steps the unit
|
|
11
|
+
needs. Implements one triaged step (or all remaining steps), with frozen
|
|
12
|
+
acceptance, step-local gates, commits, red-gate repair, and diff-size guard.
|
|
13
|
+
BREAKING: replaced PLAN.md/TASKS.md/progress.md/ACCEPTANCE.md with the unit
|
|
14
|
+
doc's Tasks section, Evidence rows, and Progress log; ACCEPTANCE.md is gone —
|
|
15
|
+
acceptance criteria live in the unit doc and Evidence rows are the receipts.
|
|
13
16
|
---
|
|
14
17
|
|
|
15
18
|
# Execute Phase
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
Step executor for units. The unit doc (created by `unit-lane`) owns `Tasks` P1…Pn,
|
|
21
|
+
`Evidence` rows, and a `Progress` log — these replace PLAN.md, TASKS.md,
|
|
22
|
+
progress.md, and ACCEPTANCE.md. Each step runs as an atomic gate/commit.
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
**Argument resolution (first match):**
|
|
25
|
+
- `<NN-slug> P<k>` — exactly the step named by the triage order (P1, P2, …)
|
|
26
|
+
- `<NN-slug>` (no step) — all remaining steps, one commit each
|
|
27
|
+
- `P<k>` alone — the step by position in the current unit (last-known NN-slug)
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|---|---|
|
|
25
|
-
| target + explicit `P<n>` | only the literal `P<n>` argument; ignore other unfinished phases |
|
|
26
|
-
| target, no phase | only the literal unfinished phase IDs found in the ledger, in order |
|
|
27
|
-
| legacy SPEC without phases | one legacy pass |
|
|
28
|
-
|
|
29
|
-
Never infer a phase ID absent from the invocation/ledger.
|
|
29
|
+
Never infer a step ID absent from the triage block in the unit doc.
|
|
30
30
|
|
|
31
31
|
## Turn contract
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
1.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
33
|
+
Tick every box before ending the turn; an unchecked box means the turn is not
|
|
34
|
+
done:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
✓ Triage verified — unit doc Evidence section header matches
|
|
38
|
+
`bun scripts/unit-route.mjs --triage <slug>` output block (PREFLIGHT.md)
|
|
39
|
+
✓ Unit doc read and step selected (explicit P<k> or first unfinished)
|
|
40
|
+
✓ Step executed and committed (one commit per step, conventional format)
|
|
41
|
+
✓ Evidence rows updated (command → exit/digest → output → verified-by)
|
|
42
|
+
✓ Progress log updated with a dated `YYYY-MM-DD HH:MM` entry (what, commit, next)
|
|
43
|
+
✓ Diff guard passed (on implement steps) — see `diff-guard` in PREFLIGHT.md
|
|
44
|
+
✓ → Next: block printed as the absolute last output
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## When to use
|
|
48
|
+
|
|
49
|
+
- A triaged unit from `unit-lane`: steps include `implement`/`tests`/`evidence`
|
|
50
|
+
→ invoke with `<NN-slug>` or `<NN-slug> P<k>`.
|
|
51
|
+
- Docs-only units (triage returns only `[docs, evidence]`) do **not** load this
|
|
52
|
+
skill — they are executed in-place by the unit-lane conductor.
|
|
53
|
+
- To execute all remaining steps: `<NN-slug>` with no step argument.
|
|
54
|
+
- To repair a failed step: `<NN-slug> P<k>` (retry the same step).
|
|
55
|
+
|
|
56
|
+
## Step 0 — Discover the project
|
|
57
|
+
|
|
58
|
+
Per the agent guide's **Workflow conventions** + **documentation map**, read the
|
|
59
|
+
unit doc at `docs/features/<NN-slug>/SPEC.md`. Verify it carries `## Tasks` (P1…Pn),
|
|
60
|
+
`## Evidence`, and `## Progress` sections. If absent, the unit is not ready —
|
|
61
|
+
stop and suggest `unit-lane` triage first.
|
|
62
|
+
|
|
63
|
+
## Process
|
|
64
|
+
|
|
65
|
+
### 1. Verify triage currency
|
|
66
|
+
|
|
67
|
+
Run `bun scripts/unit-route.mjs --triage <slug>` and compare its block to the
|
|
68
|
+
Evidence section header in the unit doc. **Mismatch → STOP and re-triage first.**
|
|
69
|
+
This is the gate that ensures the executor and unit-lane agree on steps.
|
|
70
|
+
|
|
71
|
+
### 2. Select the step
|
|
72
|
+
|
|
73
|
+
If a step argument is given (e.g. `P2`), use that step. Otherwise, the **first
|
|
74
|
+
unfinished step** — the first P<k> in `Tasks` whose checkbox is unticked.
|
|
75
|
+
Never execute a step the triage skipped.
|
|
76
|
+
|
|
77
|
+
### 3. Pre-step gates
|
|
78
|
+
|
|
79
|
+
Run gates in order; any fails → STOP (see [PREFLIGHT.md](references/PREFLIGHT.md)):
|
|
80
|
+
|
|
81
|
+
1. **Path-protection checkpoint** — read the committed range against protected
|
|
82
|
+
paths (e.g. `tests/`, `fixtures/`). Exit 1 → STOP with the gate rejection
|
|
83
|
+
block. No `--force` bypass (no flag can override).
|
|
84
|
+
2. **Phase-lint** — run `bun scripts/phase-lint.mjs <unit-doc>` **only** when the
|
|
85
|
+
step is `implement` and the unit has `Tasks` P1…Pn. Parse the `Tasks` section
|
|
86
|
+
(not PLAN.md/TASKS.md). Exit 1 → STOP. If the script is absent, apply the
|
|
87
|
+
eight `phase-contract` rules by hand, label weaker, and disclose.
|
|
88
|
+
3. **Pre-write mapper** — for `implement` steps, settle the pre-write mapper
|
|
89
|
+
contract before branch creation, planning commit, or source/test edit:
|
|
90
|
+
([implementation-discovery](../implementation-discovery/SKILL.md)): it closes
|
|
91
|
+
the seven evidence questions and routes `READY | REPLAN | NEEDS-DESIGN |
|
|
92
|
+
BLOCKED`; only `READY` authorizes the first write.
|
|
93
|
+
4. **Dependency/invariant checks** — per unit-lane's triage catalog rules:
|
|
94
|
+
ensure required dependencies are merged; architectural invariants preserved
|
|
95
|
+
or backed by an explicit recorded decision (block `violates`/`introduces`/
|
|
96
|
+
`changes` before edits).
|
|
97
|
+
|
|
98
|
+
### 4. Execute the step
|
|
99
|
+
|
|
100
|
+
Follow the unit-lane reference for this step (`references/STEPS.md` catalog):
|
|
101
|
+
one line — read the step's reference file, perform its checklist, commit the
|
|
102
|
+
work. For `implement` steps: write tests-first where they pay (core/domain,
|
|
103
|
+
orchestration — record the failing red run's command, exit, and failing test
|
|
104
|
+
names before implementation), then green. UI/adapter glue may test after.
|
|
105
|
+
|
|
106
|
+
### 5. Post-step
|
|
107
|
+
|
|
108
|
+
1. **Diff guard** (implement steps only): run `bun scripts/diff-guard.mjs --base
|
|
109
|
+
<last-step-commit> --unit <unit>` — paste the block verbatim. **BREACH → STOP**
|
|
110
|
+
(re-triage or record exception). Anti-gaming: **NEVER shrink a diff by deleting
|
|
111
|
+
comments, blank lines, docs or tests.**
|
|
112
|
+
2. **Evidence rows**: one row per AC satisfied — `| AC | command | exit/digest |
|
|
113
|
+
output (≤2 lines) | verified-by |`. Append to the Evidence section.
|
|
114
|
+
3. **Progress log**: append a dated entry —
|
|
115
|
+
`YYYY-MM-DD HH:MM — <what was done> → <commit sha> — next: <what is next>`.
|
|
116
|
+
4. **Commit**: `git add <changed files>` then `git commit -m "<type>(<scope>):
|
|
117
|
+
<step-summary>"` — run it, paste the SHA.
|
|
118
|
+
|
|
119
|
+
### 6. Red gate (repair loop)
|
|
120
|
+
|
|
121
|
+
After each step: run the project's verification gate (type-check + tests + build).
|
|
122
|
+
|
|
123
|
+
- **Gate green** → proceed.
|
|
124
|
+
- **Gate red** → record exit code + failing test names in the Progress log, repair
|
|
125
|
+
the same step, retry. Default `--max-attempts 3` (user value overrides).
|
|
126
|
+
- **Exhausted** → STOP with:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
UNIT LOOP — <unit> BLOCKED at <P<k>>
|
|
130
|
+
Reason: <NO-PROGRESS|ATTEMPT-BUDGET> · Attempts: <n>
|
|
131
|
+
Last validator: <command> → <exit/status + compact failure>
|
|
132
|
+
Preserved: no red commit; acceptance blob <sha> unchanged
|
|
133
|
+
|
|
134
|
+
→ Next: inspect the named blocker, then re-run /execute-phase <unit> <P<k>>
|
|
135
|
+
· architecture/product decision required → resolve it before resuming
|
|
136
|
+
· continue atomically → /execute-phase <unit> <P<k>>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 7. Whole-unit mode
|
|
140
|
+
|
|
141
|
+
When invoked as `<NN-slug>` with no step: loop all remaining steps, one commit
|
|
142
|
+
each. After each step: gates, execute, diff guard (if implement), evidence/
|
|
143
|
+
progress update, commit. Skip intermediate review checkpoints; the mandatory end
|
|
144
|
+
review covers the full accumulated diff. On gate red at any step: repair that
|
|
145
|
+
step (up to `--max-attempts`), then continue the loop. Terminal:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
UNIT LOOP — <unit> COMPLETE
|
|
149
|
+
Steps: <n> · Commits: <sha list> · Gate: PASS
|
|
150
|
+
PR: <url>
|
|
151
|
+
|
|
152
|
+
→ Next: /review-change on the changed HEAD — the mandatory end review
|
|
153
|
+
· findings (REVIEW-FAIL) → /fold-findings repairs them; a fresh /review-change follows the fold
|
|
154
|
+
· merge gate after REVIEW-PASS → /audit-pr
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 8. Descope guard
|
|
158
|
+
|
|
159
|
+
Before creating **any** issue while executing: classify with the descope test.
|
|
160
|
+
A descope (moving an acceptance criterion or task out of scope) requires
|
|
161
|
+
**explicit user approval first**, then record in the unit doc's
|
|
162
|
+
`## References` section (not a follow-up issue) as:
|
|
163
|
+
`- <YYYY-MM-DD> — descoped: "<criterion>" — approved by user`.
|
|
164
|
+
An issue may never be the first record of a descope.
|
|
165
|
+
|
|
166
|
+
## Required references
|
|
167
|
+
|
|
168
|
+
These files must be loaded when their topic is active:
|
|
169
|
+
- [PREFLIGHT.md](references/PREFLIGHT.md) — all gate blocks (dependency, status, pre-exec, evidence, lint, path-protection)
|
|
170
|
+
- [EXECUTION_CONTRACT.md](references/EXECUTION_CONTRACT.md) — step completion gate, architectural invariants
|
|
171
|
+
- [PRE_EXECUTION_GATE.md](references/PRE_EXECUTION_GATE.md) — pre-execution review gate, normalizer order
|
|
172
|
+
- [FOLDING.md](references/FOLDING.md) — review finding fold cycle
|
|
173
|
+
- [DESCOPE.md](references/DESCOPE.md) — descope test and amendment rule
|
|
174
|
+
- [FORGE_BODY.md](references/FORGE_BODY.md) — forge operations (gh body-file rule)
|
|
175
|
+
|
|
176
|
+
## Guardrails
|
|
177
|
+
|
|
178
|
+
**Allowed:**
|
|
179
|
+
- Only the triaged steps listed by the unit doc's Evidence header
|
|
180
|
+
- Changes scoped to the acceptance criteria and step tasks
|
|
181
|
+
- Documentation updates in the unit doc (Evidence, Progress, References)
|
|
182
|
+
- Conventional commit messages per the project's Workflow conventions
|
|
183
|
+
- The step's own reference file (read one-hop from the unit doc catalog)
|
|
184
|
+
|
|
185
|
+
**Forbidden:**
|
|
186
|
+
- Never commit red (test failure) — fix within the step's scope, or record the
|
|
187
|
+
blocker and stop.
|
|
188
|
+
- Never weaken a validator (loosen assertions, reduce coverage) — a repair must
|
|
189
|
+
keep assertions at least as strong.
|
|
190
|
+
- Never execute a step the triage skipped — the catalog is authoritative.
|
|
191
|
+
- Never edit the unit doc's Acceptance criteria (that is re-triage with user consent).
|
|
192
|
+
- Never expand scope beyond what Non-goals define — findings discovered during
|
|
193
|
+
implementation never widen the unit.
|
|
194
|
+
- Never invent an acceptance criterion — ask the user with concrete options.
|
|
117
195
|
|
|
118
196
|
## Relationship to other skills
|
|
119
197
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
198
|
+
`unit-lane` conducts (triage → steps → doc updates); this executes (one step at a
|
|
199
|
+
time or all remaining). `fold-findings` handles review finding repairs. The review
|
|
200
|
+
pack axes (`review-implementation`, `review-code`, `review-security`, `review-perf`,
|
|
201
|
+
`review-a11y`, `review-debt`) compose the review step; `workflow-status` routes
|
|
202
|
+
here. `triage-issue` feeds issues into the lane. This skill is the **step executor**
|
|
203
|
+
a turn invokes to perform one triaged step of a unit under the full gate machinery.
|
|
204
|
+
|
|
205
|
+
## Portability (agents other than Claude Code)
|
|
206
|
+
|
|
207
|
+
- **No slash menu** — open this `SKILL.md` and follow it literally in a fresh
|
|
208
|
+
conversation. Where it says `run`, execute the shell command directly.
|
|
209
|
+
- **No model tiers** — triage and review use the strongest model; execution
|
|
210
|
+
steps may use cheaper. Never review with a weaker model than the author.
|
|
211
|
+
- **No `/loop`/subagents** — invoke `<NN-slug>` for all remaining steps (the
|
|
212
|
+
built-in loop), or `<NN-slug> P<k>` for individual steps.
|
|
213
|
+
- **No fresh workers** — execute inline and reduce state to the unit doc after
|
|
214
|
+
each commit; never re-read prior files.
|
|
128
215
|
|
|
129
216
|
## Done when
|
|
130
217
|
|
|
131
|
-
- Requested scope is implemented (all remaining
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
218
|
+
- Requested scope is implemented (all remaining steps, one explicit step), gate
|
|
219
|
+
is green, unit doc Evidence/Progress are current, and the work is committed.
|
|
220
|
+
- **The closing `→ Next:` block is printed.**
|
|
221
|
+
|
|
222
|
+
## Closing recommendation
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
→ Next: /unit-lane <NN-slug> — the conductor continues with the next triaged step
|
|
226
|
+
· all steps done → /review-change — the mandatory end review
|
|
227
|
+
· findings (REVIEW-FAIL) → /fold-findings repairs them; a fresh /review-change follows the fold
|
|
228
|
+
· merge gate after REVIEW-PASS → /audit-pr — the merge gate
|
|
229
|
+
```
|