@aperant/framework 0.6.4 → 0.6.6
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 +38 -0
- package/README.md +54 -234
- package/agents/apt-improver.md +99 -0
- package/agents/apt-planner.md +115 -10
- package/dist/__test-helpers/run-cmd.d.mts +4 -2
- package/dist/__test-helpers/run-cmd.d.mts.map +1 -1
- package/dist/__test-helpers/run-cmd.mjs +56 -15
- package/dist/__test-helpers/run-cmd.mjs.map +1 -1
- package/dist/cli/ci-watch/lock.d.mts +53 -0
- package/dist/cli/ci-watch/lock.d.mts.map +1 -0
- package/dist/cli/ci-watch/lock.mjs +172 -0
- package/dist/cli/ci-watch/lock.mjs.map +1 -0
- package/dist/cli/ci-watch/state.d.mts +36 -0
- package/dist/cli/ci-watch/state.d.mts.map +1 -0
- package/dist/cli/ci-watch/state.mjs +103 -0
- package/dist/cli/ci-watch/state.mjs.map +1 -0
- package/dist/cli/ci-watch/stop-matrix.d.mts +58 -0
- package/dist/cli/ci-watch/stop-matrix.d.mts.map +1 -0
- package/dist/cli/ci-watch/stop-matrix.mjs +164 -0
- package/dist/cli/ci-watch/stop-matrix.mjs.map +1 -0
- package/dist/cli/cli-wrappers/ci-watch.d.mts +2 -0
- package/dist/cli/cli-wrappers/ci-watch.d.mts.map +1 -0
- package/dist/cli/cli-wrappers/ci-watch.mjs +9 -0
- package/dist/cli/cli-wrappers/ci-watch.mjs.map +1 -0
- package/dist/cli/commands/adr.d.mts +5 -0
- package/dist/cli/commands/adr.d.mts.map +1 -0
- package/dist/cli/commands/adr.mjs +228 -0
- package/dist/cli/commands/adr.mjs.map +1 -0
- package/dist/cli/commands/ci-watch.d.mts +7 -0
- package/dist/cli/commands/ci-watch.d.mts.map +1 -0
- package/dist/cli/commands/ci-watch.mjs +465 -0
- package/dist/cli/commands/ci-watch.mjs.map +1 -0
- package/dist/cli/commands/commit.d.mts.map +1 -1
- package/dist/cli/commands/commit.mjs +25 -8
- package/dist/cli/commands/commit.mjs.map +1 -1
- package/dist/cli/commands/context.d.mts +7 -0
- package/dist/cli/commands/context.d.mts.map +1 -0
- package/dist/cli/commands/context.mjs +224 -0
- package/dist/cli/commands/context.mjs.map +1 -0
- package/dist/cli/commands/event.d.mts.map +1 -1
- package/dist/cli/commands/event.mjs +125 -24
- package/dist/cli/commands/event.mjs.map +1 -1
- package/dist/cli/commands/host-detect.d.mts +1 -1
- package/dist/cli/commands/host-detect.d.mts.map +1 -1
- package/dist/cli/commands/host-detect.mjs +30 -3
- package/dist/cli/commands/host-detect.mjs.map +1 -1
- package/dist/cli/commands/modes.d.mts +13 -0
- package/dist/cli/commands/modes.d.mts.map +1 -0
- package/dist/cli/commands/modes.mjs +221 -0
- package/dist/cli/commands/modes.mjs.map +1 -0
- package/dist/cli/commands/route.mjs +1 -1
- package/dist/cli/commands/route.mjs.map +1 -1
- package/dist/cli/commands/task.d.mts.map +1 -1
- package/dist/cli/commands/task.mjs +393 -145
- package/dist/cli/commands/task.mjs.map +1 -1
- package/dist/cli/commands/tokens.d.mts.map +1 -1
- package/dist/cli/commands/tokens.mjs +150 -6
- package/dist/cli/commands/tokens.mjs.map +1 -1
- package/dist/cli/commands/triage.d.mts +8 -0
- package/dist/cli/commands/triage.d.mts.map +1 -0
- package/dist/cli/commands/triage.mjs +263 -0
- package/dist/cli/commands/triage.mjs.map +1 -0
- package/dist/cli/config/post-merge-sweep.d.mts +18 -0
- package/dist/cli/config/post-merge-sweep.d.mts.map +1 -1
- package/dist/cli/config/post-merge-sweep.mjs +48 -3
- package/dist/cli/config/post-merge-sweep.mjs.map +1 -1
- package/dist/cli/consistency/registry.d.mts +11 -0
- package/dist/cli/consistency/registry.d.mts.map +1 -1
- package/dist/cli/consistency/registry.mjs +13 -0
- package/dist/cli/consistency/registry.mjs.map +1 -1
- package/dist/cli/coordination/agent-identity.d.mts +9 -0
- package/dist/cli/coordination/agent-identity.d.mts.map +1 -1
- package/dist/cli/coordination/agent-identity.mjs +11 -0
- package/dist/cli/coordination/agent-identity.mjs.map +1 -1
- package/dist/cli/coordination/auto-emit-artifact-ready.d.mts +16 -0
- package/dist/cli/coordination/auto-emit-artifact-ready.d.mts.map +1 -0
- package/dist/cli/coordination/auto-emit-artifact-ready.mjs +88 -0
- package/dist/cli/coordination/auto-emit-artifact-ready.mjs.map +1 -0
- package/dist/cli/coordination/event-log.d.mts +27 -0
- package/dist/cli/coordination/event-log.d.mts.map +1 -1
- package/dist/cli/coordination/event-log.mjs +72 -2
- package/dist/cli/coordination/event-log.mjs.map +1 -1
- package/dist/cli/coordination/event-schema.d.mts +16 -0
- package/dist/cli/coordination/event-schema.d.mts.map +1 -0
- package/dist/cli/coordination/event-schema.mjs +161 -0
- package/dist/cli/coordination/event-schema.mjs.map +1 -0
- package/dist/cli/coordination/store.d.mts +6 -0
- package/dist/cli/coordination/store.d.mts.map +1 -1
- package/dist/cli/coordination/store.mjs +14 -0
- package/dist/cli/coordination/store.mjs.map +1 -1
- package/dist/cli/dispatch.d.mts.map +1 -1
- package/dist/cli/dispatch.mjs +14 -1
- package/dist/cli/dispatch.mjs.map +1 -1
- package/dist/cli/gate/registry.d.mts +11 -0
- package/dist/cli/gate/registry.d.mts.map +1 -1
- package/dist/cli/gate/registry.mjs +13 -0
- package/dist/cli/gate/registry.mjs.map +1 -1
- package/dist/cli/help.d.mts.map +1 -1
- package/dist/cli/help.mjs +3 -2
- package/dist/cli/help.mjs.map +1 -1
- package/dist/cli/host/detect.d.mts +1 -0
- package/dist/cli/host/detect.d.mts.map +1 -1
- package/dist/cli/host/detect.mjs +5 -0
- package/dist/cli/host/detect.mjs.map +1 -1
- package/dist/cli/roadmap/conductor-view.d.mts +13 -0
- package/dist/cli/roadmap/conductor-view.d.mts.map +1 -0
- package/dist/cli/roadmap/conductor-view.mjs +31 -0
- package/dist/cli/roadmap/conductor-view.mjs.map +1 -0
- package/dist/cli/route/envelope.d.mts +68 -4
- package/dist/cli/route/envelope.d.mts.map +1 -1
- package/dist/cli/route/envelope.mjs +140 -103
- package/dist/cli/route/envelope.mjs.map +1 -1
- package/dist/cli/route/skill-discover.d.mts +9 -0
- package/dist/cli/route/skill-discover.d.mts.map +1 -1
- package/dist/cli/route/skill-discover.mjs +13 -1
- package/dist/cli/route/skill-discover.mjs.map +1 -1
- package/dist/cli/skill-author/contract.d.mts +1 -0
- package/dist/cli/skill-author/contract.d.mts.map +1 -1
- package/dist/cli/skill-author/contract.mjs +7 -0
- package/dist/cli/skill-author/contract.mjs.map +1 -1
- package/dist/cli/task/ids.d.mts +7 -4
- package/dist/cli/task/ids.d.mts.map +1 -1
- package/dist/cli/task/ids.mjs +11 -10
- package/dist/cli/task/ids.mjs.map +1 -1
- package/dist/cli/task/worktree-cleanup.d.mts +9 -1
- package/dist/cli/task/worktree-cleanup.d.mts.map +1 -1
- package/dist/cli/task/worktree-cleanup.mjs +190 -9
- package/dist/cli/task/worktree-cleanup.mjs.map +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/agents/apt-planner.md +1 -1
- package/dist/plugin/skills/apt/SKILL.md +111 -5
- package/dist/plugin/skills/apt-author-skill/SKILL.md +11 -0
- package/dist/plugin/skills/apt-bootstrap/SKILL.md +1 -0
- package/dist/plugin/skills/apt-classify/SKILL.md +1 -0
- package/dist/plugin/skills/apt-close-task/SKILL.md +1 -0
- package/dist/plugin/skills/apt-create-docs/SKILL.md +1 -0
- package/dist/plugin/skills/apt-debug/SKILL.md +2 -0
- package/dist/plugin/skills/apt-design/SKILL.md +2 -0
- package/dist/plugin/skills/apt-discuss/SKILL.md +2 -0
- package/dist/plugin/skills/apt-docs/SKILL.md +2 -0
- package/dist/plugin/skills/apt-execute/SKILL.md +1 -0
- package/dist/plugin/skills/apt-mockup/SKILL.md +2 -0
- package/dist/plugin/skills/apt-pause/SKILL.md +1 -0
- package/dist/plugin/skills/apt-personas/SKILL.md +1 -0
- package/dist/plugin/skills/apt-plan/SKILL.md +2 -0
- package/dist/plugin/skills/apt-pr-review/SKILL.md +1 -0
- package/dist/plugin/skills/apt-quick/SKILL.md +2 -0
- package/dist/plugin/skills/apt-resume/SKILL.md +1 -0
- package/dist/plugin/skills/apt-review/SKILL.md +1 -0
- package/dist/plugin/skills/apt-roadmap/SKILL.md +1 -0
- package/dist/plugin/skills/apt-roundtable/SKILL.md +2 -0
- package/dist/plugin/skills/apt-run/SKILL.md +1 -0
- package/dist/plugin/skills/apt-scan/SKILL.md +1 -0
- package/dist/plugin/skills/apt-setup/SKILL.md +1 -0
- package/dist/plugin/skills/apt-ship/SKILL.md +6 -5
- package/dist/plugin/skills/apt-stress-test/SKILL.md +1 -0
- package/dist/plugin/skills/apt-terminal/SKILL.md +1 -0
- package/dist/plugin/skills/apt-update/SKILL.md +5 -0
- package/dist/plugin/skills/apt-verify/SKILL.md +1 -0
- package/dist/plugin/skills/apt-verify-proof/SKILL.md +1 -0
- package/dist/types/config.d.ts +85 -0
- package/dist/types/config.d.ts.map +1 -1
- package/package.json +9 -1
- package/prompts/coder.md +2 -0
- package/prompts/conductor-status-check.md +23 -0
- package/prompts/conductor-sub-agent.md +57 -0
- package/prompts/conductor-system.md +172 -0
- package/prompts/planner.md +12 -0
- package/prompts/spec_writer.md +9 -0
- package/skills/apt/SKILL.md +1 -0
- package/skills/apt-close-task/SKILL.md +32 -1
- package/skills/apt-debug/SKILL.md +39 -6
- package/skills/apt-debug/appendices/diagnose-discipline.md +119 -0
- package/skills/apt-diagram/SKILL.md +342 -0
- package/skills/apt-diagram/appendices/design-discipline.md +97 -0
- package/skills/apt-discuss/SKILL.md +25 -0
- package/skills/apt-discuss/appendices/grill-discipline.md +104 -0
- package/skills/apt-discuss/appendices/zoom-out-helper.md +79 -0
- package/skills/apt-execute/SKILL.md +48 -5
- package/skills/apt-execute/appendices/tdd-mode.md +107 -0
- package/skills/apt-improve/DEEPENING.md +84 -0
- package/skills/apt-improve/INTERFACE-DESIGN.md +97 -0
- package/skills/apt-improve/LANGUAGE.md +104 -0
- package/skills/apt-improve/SKILL.md +141 -0
- package/skills/apt-plan/SKILL.md +159 -4
- package/skills/apt-plan/adapters/conductor.md +98 -0
- package/skills/apt-planner.md +42 -1
- package/skills/apt-pr-review/SKILL.md +46 -16
- package/skills/apt-prototype/LOGIC.md +109 -0
- package/skills/apt-prototype/SKILL.md +143 -0
- package/skills/apt-prototype/UI.md +90 -0
- package/skills/apt-quick/SKILL.md +30 -0
- package/skills/apt-review/SKILL.md +2 -0
- package/skills/apt-run/SKILL.md +32 -4
- package/skills/apt-setup/SKILL.md +130 -2
- package/skills/apt-ship/SKILL.md +63 -1
- package/skills/apt-spar/SKILL.md +290 -0
- package/skills/apt-triage/AGENT-BRIEF.md +84 -0
- package/skills/apt-triage/OUT-OF-SCOPE.md +75 -0
- package/skills/apt-triage/SKILL.md +169 -0
- package/skills/apt-verify/SKILL.md +3 -0
- package/skills/apt-verify-proof/SKILL.md +3 -0
- package/skills/apt-watch-ci/SKILL.md +163 -0
- package/skills/apt-zoom-out/SKILL.md +130 -0
- package/src/cli/ci-watch/lock.mjs +178 -0
- package/src/cli/ci-watch/state.mjs +103 -0
- package/src/cli/ci-watch/stop-matrix.mjs +181 -0
- package/src/cli/cli-wrappers/ci-watch.mjs +9 -0
- package/src/cli/commands/adr.mjs +243 -0
- package/src/cli/commands/ci-watch.mjs +503 -0
- package/src/cli/commands/commit.mjs +27 -8
- package/src/cli/commands/context.mjs +244 -0
- package/src/cli/commands/event.mjs +131 -24
- package/src/cli/commands/host-detect.mjs +33 -7
- package/src/cli/commands/modes.mjs +216 -0
- package/src/cli/commands/route.mjs +1 -1
- package/src/cli/commands/task.mjs +430 -170
- package/src/cli/commands/tokens.mjs +157 -6
- package/src/cli/commands/triage.mjs +286 -0
- package/src/cli/config/post-merge-sweep.mjs +49 -3
- package/src/cli/consistency/registry.mjs +14 -0
- package/src/cli/coordination/agent-identity.mjs +12 -0
- package/src/cli/coordination/auto-emit-artifact-ready.mjs +96 -0
- package/src/cli/coordination/event-log.mjs +73 -2
- package/src/cli/coordination/event-schema.d.ts +13 -0
- package/src/cli/coordination/event-schema.mjs +174 -0
- package/src/cli/coordination/store.mjs +14 -0
- package/src/cli/dispatch.mjs +15 -1
- package/src/cli/gate/registry.mjs +14 -0
- package/src/cli/help.mjs +3 -2
- package/src/cli/host/detect.mjs +5 -0
- package/src/cli/roadmap/conductor-view.d.ts +10 -0
- package/src/cli/roadmap/conductor-view.mjs +31 -0
- package/src/cli/route/envelope.mjs +140 -106
- package/src/cli/route/skill-discover.mjs +14 -1
- package/src/cli/skill-author/contract.mjs +7 -0
- package/src/cli/task/ids.mjs +15 -13
- package/src/cli/task/worktree-cleanup.mjs +191 -9
- package/templates/adr-format.md +56 -0
- package/templates/config.json +4 -0
- package/templates/context-format.md +34 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to `@aperant/framework` are documented here. See
|
|
4
4
|
[`VERSIONING.md`](VERSIONING.md) for the per-tier contract.
|
|
5
5
|
|
|
6
|
+
## 0.6.5 — 2026-05-14 — Drop aggregate envelope cap
|
|
7
|
+
|
|
8
|
+
Replaces the aggregate `ENVELOPE_MAX_BYTES` cap in
|
|
9
|
+
`src/cli/route/envelope.mjs` with a per-skill description budget. The
|
|
10
|
+
aggregate cap was bumped 9 times in 3 weeks (8192 → 11264) and was
|
|
11
|
+
theater on 1M-token hosts (30 skills × 256 bytes = 0.28 % of context).
|
|
12
|
+
It was a proxy for two unrelated constraints — classifier precision
|
|
13
|
+
(already measured by route-eval) and per-skill description quality
|
|
14
|
+
(never actually enforced) — and shouted at the wrong author each time
|
|
15
|
+
a new skill landed.
|
|
16
|
+
|
|
17
|
+
- **New constant.** `MAX_DESCRIPTION_BYTES = 256` is exported from
|
|
18
|
+
`envelope.mjs`. The budget binds visible AND internal skills, so an
|
|
19
|
+
internal SKILL.md cannot ship a 4 KB description through the
|
|
20
|
+
side-channel.
|
|
21
|
+
- **New helper.** `enforceDescriptionBudget(skills, budgetBytes)`
|
|
22
|
+
replaces `truncateLongestFirst`. It walks each skill once: passes
|
|
23
|
+
through if the wrapped description fits the budget; else tries
|
|
24
|
+
`truncateDescriptionToFirstSentence`; if the trim succeeds and now
|
|
25
|
+
fits, marks `truncated:true` and increments `truncated_count`; if the
|
|
26
|
+
trim still doesn't fit (or trim was a no-op), records the offender
|
|
27
|
+
(`{ name, bytes, description }`) and stops. The builder throws with
|
|
28
|
+
the offender named so the next fix lands on the right author the
|
|
29
|
+
first time.
|
|
30
|
+
- **Error code rename.** The `cmdRoute` catch branch now emits
|
|
31
|
+
`error_code: 'skill_description_too_long'` (was `'envelope_overflow'`).
|
|
32
|
+
- **Decision source.** Codex spar 2026-05-14.
|
|
33
|
+
- **Tests.** `envelope-budget.test.ts`, `envelope-truncation.test.ts`,
|
|
34
|
+
and `route-envelope-builder.test.ts` rewritten for the per-skill
|
|
35
|
+
pathway. Aggregate-cap pins and the 400-byte headroom invariant are
|
|
36
|
+
gone.
|
|
37
|
+
|
|
38
|
+
Schema unchanged (still v4). The router envelope JSON shape is
|
|
39
|
+
unchanged for consumers — the only externally observable difference is
|
|
40
|
+
the renamed error_code in the over-budget path.
|
|
41
|
+
|
|
42
|
+
`task: 14-05-26_drop-aggregate-envelope-max-bytes-cap-fr-03rb`
|
|
43
|
+
|
|
6
44
|
## 0.6.4 — 2026-05-13 — Upgrade `--yes` infers visibility from git tracking
|
|
7
45
|
|
|
8
46
|
Patch on top of 0.6.3 closing the last surface of the 0.6.0/0.6.1
|
package/README.md
CHANGED
|
@@ -3,246 +3,66 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@aperant/framework)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
> **Work in progress.** This is the foundation that will run the Aperant ecosystem — an agentic IDE covering the full software lifecycle. Join the waitlist at [aperant.com](https://aperant.com).
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## What It Does
|
|
11
|
-
|
|
12
|
-
Five composable skills that cover the full implementation lifecycle:
|
|
13
|
-
|
|
14
|
-
| Skill | Command | Description |
|
|
15
|
-
| ------- | -------------- | ----------------------------------------------------------------------------------- |
|
|
16
|
-
| Plan | `/apt:plan` | Analyze a task, assess complexity, investigate codebase, produce spec + implementation plan |
|
|
17
|
-
| Execute | `/apt:execute` | Implement subtasks from a plan with atomic commits and progress tracking |
|
|
18
|
-
| Verify | `/apt:verify` | Score implementation against spec on 4 dimensions (correctness, completeness, quality, coverage) |
|
|
19
|
-
| Review | `/apt:review` | Multi-pass AI code review with findings tree and severity classification |
|
|
20
|
-
| Run | `/apt:run` | Full pipeline: plan -> execute -> verify -> review in one command |
|
|
21
|
-
|
|
22
|
-
Each skill is self-contained. Use `/apt:plan` alone for planning, `/apt:verify` alone for QA, or `/apt:run` for the full pipeline.
|
|
23
|
-
|
|
24
|
-
### Declarative YAML Workflows (C17)
|
|
25
|
-
|
|
26
|
-
In addition to the imperative skill chains above, the framework ships a
|
|
27
|
-
**declarative** runner: author a YAML DAG of skill/agent/tool nodes and
|
|
28
|
-
execute or emit it via `apt-tools wfrun {validate|plan|run}`. Example
|
|
29
|
-
workflows live under `workflows/examples/`.
|
|
30
|
-
|
|
31
|
-
## Quickstart
|
|
32
|
-
|
|
33
|
-
### Step 1: Install
|
|
8
|
+
## Install
|
|
34
9
|
|
|
35
10
|
```bash
|
|
36
11
|
npx @aperant/framework init .
|
|
37
12
|
```
|
|
38
13
|
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### Step 4: Full pipeline
|
|
93
|
-
|
|
94
|
-
For the complete experience -- plan, execute, verify, and review in one command:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
/apt:run "Add user authentication with JWT"
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
This creates a feature branch, plans the work, implements each subtask with atomic commits, verifies the result against the spec, and runs a multi-pass code review. From task description to reviewed code.
|
|
101
|
-
|
|
102
|
-
## Host Support
|
|
103
|
-
|
|
104
|
-
The framework supports Claude Code and Codex as native repo-local hosts.
|
|
105
|
-
|
|
106
|
-
- Claude Code gets the full `.claude/skills` + `.claude/agents` payload, worktree support, structured prompt dialogs, and the optional PreCompact hook.
|
|
107
|
-
- Codex gets native repo-skill discovery through `.agents/skills` and can run the framework's sub-agent flows, but it does not have the Claude-only worktree and PreCompact surfaces.
|
|
108
|
-
- `/apt` track classification (QUICK/STANDARD/DEEP/DEBUG) is delegated to the host model inline via SKILL.md rather than a subprocess LLM call — no recursive `codex exec` from inside a Codex session.
|
|
109
|
-
|
|
110
|
-
## How It Works
|
|
111
|
-
|
|
112
|
-
The framework follows a 5-stage lifecycle (review is the terminal stage of the STANDARD/DEEP auto pipelines as of C32):
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
Context -> Plan -> Execute -> Verify -> Review
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
1. **Context** -- Read the project constitution (`AGENTS.md`), assess task complexity, investigate the codebase.
|
|
119
|
-
2. **Plan** -- Write a specification and decompose into subtasks with dependencies and verification criteria.
|
|
120
|
-
3. **Execute** -- Implement each subtask in dependency order. Atomic commits. Progress tracked in `build-progress.json`.
|
|
121
|
-
4. **Verify** -- Score the implementation on 4 dimensions (correctness, completeness, quality, coverage). Write `qa_signoff.json`.
|
|
122
|
-
5. **Review** -- Inline 6-pass review (logic / security / quality / architecture / performance / docs-coherence) with fix-all pipeline. `docs-drift` `auto-update` findings patched inline via `apt-tools docs-audit` / `apt-tools features-audit`; `flag-drift` findings surfaced to `review_findings.md`. Configure per-surface policy at `/apt:setup` Batch 7 (writes `.aperant/config.json.docs_policy`). Write `review.json`. Skip with `--skip-review` only if intentional.
|
|
123
|
-
|
|
124
|
-
Each stage produces artifacts. The `apt-tools` CLI kernel handles state management -- file I/O, git commits, progress tracking -- so the LLM focuses on reasoning and code, never on plumbing.
|
|
125
|
-
|
|
126
|
-
### Task-Level Worktree Isolation
|
|
127
|
-
|
|
128
|
-
When multiple agents run tasks in parallel on the same repo, opt-in worktree isolation gives each task its own git branch and working directory. Enable it in `.aperant/config.json` with `"task_isolation": { "worktree_per_task": true }`. Each `task create` forks a branch, adds a worktree at `.aperant/worktrees/{scope}/{task-id}/`, and records the paths on the task record. Pipeline skills edit inside the worktree while `apt-tools` commands continue to target the main repo for shared state coordination.
|
|
129
|
-
|
|
130
|
-
### Artifacts
|
|
131
|
-
|
|
132
|
-
| Stage | Artifact | Format |
|
|
133
|
-
| ------- | --------------------------- | -------- |
|
|
134
|
-
| Plan | `spec.md` | Markdown |
|
|
135
|
-
| Plan | `implementation_plan.json` | JSON |
|
|
136
|
-
| Execute | `build-progress.json` | JSON |
|
|
137
|
-
| Verify | `qa_signoff.json` | JSON |
|
|
138
|
-
| Review | `review.json` | JSON |
|
|
139
|
-
|
|
140
|
-
## Plugin System
|
|
141
|
-
|
|
142
|
-
The framework uses a **manifest + mapper** architecture for extensibility.
|
|
143
|
-
|
|
144
|
-
A plugin declares what artifacts each stage produces (the **manifest**) and provides JavaScript modules that translate those artifacts into standard UI shapes (the **mappers**). The Aperant app renders any framework's output through these normalized views -- a Kanban board for plans, a progress bar for execution, a verification dashboard for QA.
|
|
145
|
-
|
|
146
|
-
This means you can build your own framework (or wrap an existing one like BMAD, SpecKit, etc.) and have it render natively in the Aperant UI.
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
import type { FrameworkManifest } from "@aperant/framework/types";
|
|
150
|
-
|
|
151
|
-
const manifest: FrameworkManifest = {
|
|
152
|
-
id: "my-framework",
|
|
153
|
-
name: "My Framework",
|
|
154
|
-
version: "1.0.0",
|
|
155
|
-
stages: [
|
|
156
|
-
{
|
|
157
|
-
stage: "plan",
|
|
158
|
-
artifacts: [
|
|
159
|
-
{ nativeName: "plan.md", role: "plan", format: "markdown" }
|
|
160
|
-
],
|
|
161
|
-
mapper: "./mappers/plan-mapper.js"
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
};
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## Project Structure
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
packages/framework/
|
|
171
|
-
bin/apt-tools.mjs # Deterministic CLI kernel
|
|
172
|
-
commands/ # Slash command definitions
|
|
173
|
-
plan.md # /apt:plan
|
|
174
|
-
execute.md # /apt:execute
|
|
175
|
-
verify.md # /apt:verify
|
|
176
|
-
review.md # /apt:review
|
|
177
|
-
run.md # /apt:run
|
|
178
|
-
prompts/ # Agent prompt templates
|
|
179
|
-
src/ # TypeScript types + mappers
|
|
180
|
-
types/ # FrameworkManifest, UI shapes, ProviderCapabilities
|
|
181
|
-
mappers/ # Reference mapper implementation
|
|
182
|
-
dist/ # Built output (published to npm)
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## Provider Independence
|
|
186
|
-
|
|
187
|
-
The framework is provider-agnostic. It works with Claude, GPT-4o, o3, Codex, or any model that supports tool calling. The `ProviderCapabilities` type lets skills adapt prompting strategy per provider -- preferred structured format (XML for Claude, JSON for GPT), whether to use system prompts, context window limits -- without provider-specific code branches in the orchestration logic.
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
import type { ProviderCapabilities } from "@aperant/framework/types";
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## apt-tools CLI
|
|
194
|
-
|
|
195
|
-
The `apt-tools` binary is the deterministic kernel. It handles operations that the LLM should never do itself:
|
|
196
|
-
|
|
197
|
-
| Command | Description |
|
|
198
|
-
| ------------------------------------ | ------------------------------------------------ |
|
|
199
|
-
| `apt-tools init <dir>` | Install command files into a project |
|
|
200
|
-
| `apt-tools state <dir>` | Read framework state |
|
|
201
|
-
| `apt-tools constitution <dir>` | Read project constitution (AGENTS.md / CLAUDE.md) |
|
|
202
|
-
| `apt-tools cost <dir> [flags]` | Cost tracking (per-task, trending, comparison) |
|
|
203
|
-
| `apt-tools tokens <record\|tally\|compare\|list> <dir>` | C11: per-task token telemetry — record actuals from a Claude Code transcript or manual `--input/--output`, tally a `TaskCostSummary`, compare against an optional baseline, and list across tasks |
|
|
204
|
-
| `apt-tools commit <msg> --files ...` | Commit files with message |
|
|
205
|
-
| `apt-tools task complete-subtask <dir>` | C33: atomic plan ↔ build-progress sync. Flips `implementation_plan.json.subtasks[].status` AND appends `build-progress.json.completed_subtasks` under one lock; supports consolidated ids like `E1+E2`. Used by `/apt:execute` §3e. |
|
|
206
|
-
| `apt-tools docs-audit <dir>` | C33: docs-coherence audit. External prose (CLAUDE.md / AGENTS.md / READMEs / docs/**) + internal state. Findings bucketed by policy from `.aperant/config.json.docs_policy`. |
|
|
207
|
-
| `apt-tools features-audit <dir> [--apply-stubs]` | C33: features-registry audit. Detects new UI/core-service/hook/IPC files in a diff; `--apply-stubs` auto-registers them in `.aperant/features/<area>.json`. |
|
|
208
|
-
| `apt-tools roadmap rollup <dir> --scope <s> --milestone <id>` | C33: recompute a single milestone's status from its phases. Idempotent. |
|
|
209
|
-
| `apt-tools audit privacy <dir>` | Diff tracked `.aperant/*` vs share policy (exit 2 on violations; `--scrub` emits `git filter-repo` commands + checklist, never executes) |
|
|
210
|
-
| `apt-tools audit visibility-signals <dir>` | Structured JSON signals for `/apt:setup`'s visibility mini-flow (public-remote host, gitignore allow rules, current policy) |
|
|
211
|
-
|
|
212
|
-
All output is JSON. No external dependencies -- pure Node.js.
|
|
213
|
-
|
|
214
|
-
## Artifact Sharing Policy (C35)
|
|
215
|
-
|
|
216
|
-
`.aperant/config.json` includes a `share` block that controls which framework
|
|
217
|
-
artifacts are committed to git and which stay local. The resolved policy drives
|
|
218
|
-
both the `.aperant/.gitignore` template and `apt-tools audit privacy`.
|
|
219
|
-
|
|
220
|
-
```jsonc
|
|
221
|
-
{
|
|
222
|
-
"share": {
|
|
223
|
-
"visibility": "solo", // "solo" | "team" | "oss"
|
|
224
|
-
"roadmap": false, // commit .aperant/roadmap/
|
|
225
|
-
"tasks": false, // commit .aperant/tasks/*/ artifacts
|
|
226
|
-
"team": { "roster": false }, // commit .aperant/team.json
|
|
227
|
-
"decisions": false, // commit .aperant/decisions/
|
|
228
|
-
"digests": null // null = follow digests.enabled; or true/false
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Presets:
|
|
234
|
-
|
|
235
|
-
- **`solo`** (default) — nothing shared. Byte-identical to the pre-C35 template.
|
|
236
|
-
- **`team`** — roadmap + tasks + team.roster + decisions + digests shared with teammates.
|
|
237
|
-
- **`oss`** — identical shape to `team` today; reserved for future divergence.
|
|
238
|
-
|
|
239
|
-
`apt-tools init` resolves the effective policy, renders the `.aperant/.gitignore`
|
|
240
|
-
from it, and warns when a public remote (github.com / gitlab.com / bitbucket.org)
|
|
241
|
-
is combined with any sharing toggle.
|
|
242
|
-
|
|
243
|
-
## Part of Aperant
|
|
244
|
-
|
|
245
|
-
This framework powers the [Aperant IDE](https://github.com/Mikalsen-AI/aperant-cloud-desktop) -- an AI platform covering the full software lifecycle from idea to production and everything after. The same prompts and methodology used in the CLI are used inside the Aperant app. The framework is open source; the IDE adds a visual layer, collaboration features, and managed infrastructure on top.
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Just type `/apt` and describe what you want in natural language. The router classifies your input and dispatches to the right skill.
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/apt add OAuth login with Google
|
|
20
|
+
/apt the chat scroll is jittery — debug it
|
|
21
|
+
/apt help me think through the new pricing model
|
|
22
|
+
/apt typo in the footer — wrong year
|
|
23
|
+
/apt review my PR
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
You can also call any skill directly (e.g. `/apt:plan ...`, `/apt:debug ...`).
|
|
27
|
+
|
|
28
|
+
## Available commands
|
|
29
|
+
|
|
30
|
+
| Stage | Command | Purpose |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| **Route** | `/apt` | Smart router — natural-language dispatch to any skill |
|
|
33
|
+
| **Discovery** | `/apt:scan` | Build/refresh `.aperant/features/` registry |
|
|
34
|
+
| **Discovery** | `/apt:zoom-out` | One-page architectural orientation for an unfamiliar area |
|
|
35
|
+
| **Discovery** | `/apt:improve` | 3-lens scan for refactor opportunities (DEEPENING / INTERFACE-DESIGN / LANGUAGE) |
|
|
36
|
+
| **Discovery** | `/apt:debug` | Systematic debugging with persistent state across context resets |
|
|
37
|
+
| **Planning** | `/apt:discuss` | Brainstorm a vision or lock ambiguous decisions before planning |
|
|
38
|
+
| **Planning** | `/apt:design` | Pre-coding wireframe → critique → handoff to `/apt:plan` |
|
|
39
|
+
| **Planning** | `/apt:mockup` | Visual HTML+Tailwind mockup loop with parallel variants |
|
|
40
|
+
| **Planning** | `/apt:plan` | Investigate codebase, produce `spec.md` + `implementation_plan.json` |
|
|
41
|
+
| **Planning** | `/apt:roundtable` | 10-agent structured debate with supermajority voting |
|
|
42
|
+
| **Planning** | `/apt:spar` | Bidirectional adversarial sparring with a second CLI provider |
|
|
43
|
+
| **Planning** | `/apt:stress-test` | Scenario simulation to catch operational gaps before execution |
|
|
44
|
+
| **Planning** | `/apt:prototype` | Question-driven throwaway prototyping (LOGIC + UI branches) |
|
|
45
|
+
| **Build** | `/apt:quick` | Fast single-shot task — skip planning, go straight to implementation |
|
|
46
|
+
| **Build** | `/apt:execute` | Build code from a plan with atomic commits and progress tracking |
|
|
47
|
+
| **Build** | `/apt:run` | Full pipeline: plan → execute → verify → review in one command |
|
|
48
|
+
| **Verify** | `/apt:verify` | 4-dimension QA scoring (correctness / completeness / quality / coverage) |
|
|
49
|
+
| **Verify** | `/apt:verify-proof` | Visual proof verification — screenshots, video, HTML report |
|
|
50
|
+
| **Verify** | `/apt:review` | 6-pass inline code review with fix-all pipeline |
|
|
51
|
+
| **Verify** | `/apt:pr-review` | Multi-agent PR review — 6 parallel specialists + validator + fixer + self-reviewer |
|
|
52
|
+
| **Ship** | `/apt:ship` | Create PR with QA scores, decision traceability, commit-to-subtask mapping |
|
|
53
|
+
| **Ship** | `/apt:watch-ci` | Post-ship CI watcher — polls PR checks, auto-fixes red, pushes, reschedules |
|
|
54
|
+
| **Ship** | `/apt:close-task` | Post-merge closer — confirm merged, flip phase, GC state |
|
|
55
|
+
| **Session** | `/apt:pause` | Human-initiated handoff — save CONTINUE artifacts when you need to stop |
|
|
56
|
+
| **Session** | `/apt:resume` | Restore context from paused session and route to next action |
|
|
57
|
+
| **Docs** | `/apt:docs` | Generate/update documentation verified against the actual codebase |
|
|
58
|
+
| **Docs** | `/apt:create-docs` | Persona-first product docs from PROJECT.md + personas.json + features registry |
|
|
59
|
+
| **Docs** | `/apt:diagram` | Render a DiagramScene to `.excalidraw` file or live Excalidraw MCP canvas |
|
|
60
|
+
| **Project** | `/apt:bootstrap` | Generate/refresh PROJECT.md (product-context source of truth) |
|
|
61
|
+
| **Project** | `/apt:personas` | Discover 3–5 product personas grounded in code + PROJECT.md |
|
|
62
|
+
| **Project** | `/apt:roadmap` | Manage per-scope milestones, phases, owners, ROADMAP.md rendering |
|
|
63
|
+
| **Project** | `/apt:triage` | Move a task through the 5-state machine |
|
|
64
|
+
| **Framework** | `/apt:setup` | Change preferences (verification style, multi-model, parallelization, branching) |
|
|
65
|
+
| **Framework** | `/apt:update` | Refresh installed skills / agents / hooks across every runtime |
|
|
246
66
|
|
|
247
67
|
## License
|
|
248
68
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apt-improver
|
|
3
|
+
description: Proactive refactor discovery agent — runs apt:improve Phase 1 (explore a named area through DEEPENING / INTERFACE-DESIGN / LANGUAGE lenses) and outputs a candidate refactor inventory. Read-only, no code changes.
|
|
4
|
+
apt-skill-version: {{APT_VERSION}}
|
|
5
|
+
tools: Read, Bash, Grep, Glob
|
|
6
|
+
color: orange
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<role>
|
|
10
|
+
You are an Aperant Framework proactive-refactor agent. You scan a named
|
|
11
|
+
area of the codebase through three lenses (DEEPENING, INTERFACE-DESIGN,
|
|
12
|
+
LANGUAGE) and produce a candidate refactor inventory.
|
|
13
|
+
|
|
14
|
+
Spawned by `/apt:improve` for Phase 1 (Explore). Phases 2 (Present
|
|
15
|
+
candidates) and 3 (Deepen via grill loop) run in the parent agent
|
|
16
|
+
context because they require user interaction.
|
|
17
|
+
|
|
18
|
+
Your job: read the area, apply the three lenses, output a candidate
|
|
19
|
+
inventory. You are READ-ONLY — no code changes, no decisions locked.
|
|
20
|
+
|
|
21
|
+
**CRITICAL: Mandatory Initial Read**
|
|
22
|
+
If the prompt contains a `<files_to_read>` block, you MUST use the `Read`
|
|
23
|
+
tool to load every file listed there before performing any other actions.
|
|
24
|
+
</role>
|
|
25
|
+
|
|
26
|
+
<project_context>
|
|
27
|
+
**Project instructions:** Read `./CLAUDE.md` if it exists for project structure and conventions.
|
|
28
|
+
**Constitution:** Read `AGENTS.md` if it exists for architecture overview.
|
|
29
|
+
**Glossary:** Read `CONTEXT.md` if it exists — its term-blocks (especially `Aliases to avoid` fields) are direct inputs to the LANGUAGE lens.
|
|
30
|
+
|
|
31
|
+
**Rationalizations (R4):** Read `.aperant/rationalizations/claude-opus-4-6.md` once at session start. Pay particular attention to R-2 (skipping pre-read investigation) and R-5 ("I already verified this implicitly"). As an improver, you only have value if your candidate inventory is grounded in actually-read code — drift here ships hallucinated refactor candidates.
|
|
32
|
+
</project_context>
|
|
33
|
+
|
|
34
|
+
<environment>
|
|
35
|
+
- **Working directory:** The project root
|
|
36
|
+
- **Note:** You have NO write/edit tools. You investigate and report findings only. Phase 2 (filter + present) and Phase 3 (deepen + lock) run in the parent agent's context.
|
|
37
|
+
</environment>
|
|
38
|
+
|
|
39
|
+
<process>
|
|
40
|
+
|
|
41
|
+
## 1. Parse the area name
|
|
42
|
+
|
|
43
|
+
Extract the area from the spawn prompt. Areas are noun phrases ("sparring engine", "feature registry", "auth flow") — not file paths.
|
|
44
|
+
|
|
45
|
+
If the area is ambiguous, ask the parent ONE clarifying question via your report — do NOT enter a multi-turn interview.
|
|
46
|
+
|
|
47
|
+
## 2. Load CONTEXT.md (if present)
|
|
48
|
+
|
|
49
|
+
If `CONTEXT.md` exists at the project root, read it and extract:
|
|
50
|
+
|
|
51
|
+
- Term-blocks whose canonical term, definition, or aliases-to-avoid match keywords in the area
|
|
52
|
+
- The full alias list (LANGUAGE lens grep source)
|
|
53
|
+
|
|
54
|
+
If CONTEXT.md does not exist, skip silently — the LANGUAGE lens runs without the alias grep but still catches in-file conflations.
|
|
55
|
+
|
|
56
|
+
## 3. Apply the three lenses
|
|
57
|
+
|
|
58
|
+
Read the lens descriptions (the parent has them in context; if you don't, read them from disk).
|
|
59
|
+
Paths below are relative to the project root (monorepo: `<repo>/packages/framework/` is the
|
|
60
|
+
framework root; standalone install: the project root IS the framework root, so use
|
|
61
|
+
`skills/apt-improve/` directly):
|
|
62
|
+
|
|
63
|
+
- `packages/framework/skills/apt-improve/DEEPENING.md` (monorepo) or `skills/apt-improve/DEEPENING.md` (standalone)
|
|
64
|
+
- `packages/framework/skills/apt-improve/INTERFACE-DESIGN.md` (monorepo) or `skills/apt-improve/INTERFACE-DESIGN.md` (standalone)
|
|
65
|
+
- `packages/framework/skills/apt-improve/LANGUAGE.md` (monorepo) or `skills/apt-improve/LANGUAGE.md` (standalone)
|
|
66
|
+
|
|
67
|
+
For each lens, walk the area's files and flag candidates per the lens's red-flag list.
|
|
68
|
+
|
|
69
|
+
## 4. Output the candidate inventory
|
|
70
|
+
|
|
71
|
+
Produce a structured report:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
# apt:improve Phase-1 inventory — {area}
|
|
75
|
+
|
|
76
|
+
## DEEPENING candidates
|
|
77
|
+
- `{File}:{Symbol}` — shallow ({reason}); deletion-test target.
|
|
78
|
+
- ...
|
|
79
|
+
|
|
80
|
+
## INTERFACE-DESIGN candidates
|
|
81
|
+
- `{Module A}` ↔ `{Module B}` — {red-flag name} ({one-line evidence}).
|
|
82
|
+
- ...
|
|
83
|
+
|
|
84
|
+
## LANGUAGE candidates
|
|
85
|
+
- `{File}:{Line}` — uses `{wrong-term}` for `{canonical}` ({CONTEXT.md reference if applicable}).
|
|
86
|
+
- ...
|
|
87
|
+
|
|
88
|
+
## Files read
|
|
89
|
+
- {file1}
|
|
90
|
+
- ...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Keep the inventory grounded — every candidate must cite a file + symbol the user can grep for. No speculation; no candidates inferred from filenames alone.
|
|
94
|
+
|
|
95
|
+
## 5. Hand back to parent for Phase 2/3
|
|
96
|
+
|
|
97
|
+
Your output is the input to Phase 2 (the parent agent's filter step). Do NOT enter Phase 2 yourself — your role ends here.
|
|
98
|
+
|
|
99
|
+
</process>
|
package/agents/apt-planner.md
CHANGED
|
@@ -199,7 +199,13 @@ If unable to enumerate (network unavailable, action docs unclear), flag it expli
|
|
|
199
199
|
|
|
200
200
|
## 4. Write Specification
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
The spec.md content format **branches on track** (Pocock adoption ID-05,
|
|
203
|
+
Fast Path Guarantee). QUICK-routed tasks keep the existing 4-section
|
|
204
|
+
shape; STANDARD/DEEP/COMPLEX tasks get a PRD-shaped artifact that
|
|
205
|
+
survives the task as a second-consumer document.
|
|
206
|
+
|
|
207
|
+
### 4.A. QUICK track / SIMPLE complexity — legacy 4-section spec
|
|
208
|
+
|
|
203
209
|
```markdown
|
|
204
210
|
# Task: {task description}
|
|
205
211
|
|
|
@@ -219,6 +225,57 @@ Create `{task_dir}/spec.md`:
|
|
|
219
225
|
{What this task explicitly does NOT cover}
|
|
220
226
|
```
|
|
221
227
|
|
|
228
|
+
### 4.B. STANDARD / DEEP / COMPLEX — PRD-shaped spec.md
|
|
229
|
+
|
|
230
|
+
```markdown
|
|
231
|
+
# Spec: {task title}
|
|
232
|
+
|
|
233
|
+
**Task ID:** {task-id}
|
|
234
|
+
**Track:** {STANDARD | DEEP}
|
|
235
|
+
**Scope:** {framework | desktop | web | core | ui | backend | docs}
|
|
236
|
+
|
|
237
|
+
## Problem Statement
|
|
238
|
+
{What pain are we solving? Cite empirical evidence where possible.}
|
|
239
|
+
|
|
240
|
+
## Solution
|
|
241
|
+
{Chosen approach + bulleted net delta of files / flags / config / skills.}
|
|
242
|
+
|
|
243
|
+
## User Stories
|
|
244
|
+
{One **US-NN (persona).** story per user-value slice. Stories map 1:1
|
|
245
|
+
onto subtasks in implementation_plan.json.}
|
|
246
|
+
|
|
247
|
+
## Implementation Decisions
|
|
248
|
+
{Load-bearing principles carried into every subtask. Format:
|
|
249
|
+
"### ID-NN: {title}" + rationale + practical consequence.}
|
|
250
|
+
|
|
251
|
+
## Testing Decisions
|
|
252
|
+
{One block per test family: "### TD-NN: {family}" + what's covered +
|
|
253
|
+
which subtask owns the test file. Fast Path regression tests MUST be
|
|
254
|
+
enumerated here.}
|
|
255
|
+
|
|
256
|
+
## Out of Scope
|
|
257
|
+
{Non-goals. Each bullet names what is deferred + where it belongs.}
|
|
258
|
+
|
|
259
|
+
## Further Notes
|
|
260
|
+
{Sequencing rationale, risk surface, dependencies, files-affected
|
|
261
|
+
preview, and any other executor-load-bearing context.}
|
|
262
|
+
|
|
263
|
+
### Acceptance Criteria
|
|
264
|
+
{Cross-cutting **AC1..ACN** list — each AC gets a stable ID. Subtasks
|
|
265
|
+
reference these IDs via the per-subtask `acceptance_criteria` field.}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**PRD section ordering is load-bearing.** `apt-tools coverage-check
|
|
269
|
+
validate` greps `## Acceptance Criteria`; `apt-tools consistency check`
|
|
270
|
+
greps `## Solution` and `## User Stories`. Renaming or reordering these
|
|
271
|
+
sections breaks downstream tooling and the C15 consistency rules.
|
|
272
|
+
|
|
273
|
+
**Do NOT interview the user.** The PRD is synthesized from the task
|
|
274
|
+
description + codebase investigation + AGENTS.md, not from a clarifying
|
|
275
|
+
back-and-forth. If a section truly cannot be filled, write
|
|
276
|
+
`{TBD — needs user input}`; do NOT pause for clarification (that is
|
|
277
|
+
`apt:discuss`'s surface, not the planner's).
|
|
278
|
+
|
|
222
279
|
### 4.05. Design Reference section (C24 — when design.md exists)
|
|
223
280
|
|
|
224
281
|
When `{task_dir}/design.md` exists, `spec.md` MUST include a `## Design Reference` section directly below `## Requirements`. Shape:
|
|
@@ -275,12 +332,41 @@ fix it now, not later.
|
|
|
275
332
|
|
|
276
333
|
## 5. Create Implementation Plan
|
|
277
334
|
|
|
278
|
-
|
|
335
|
+
Subtask schema branches on track (Pocock adoption ID-05 — Fast Path Guarantee).
|
|
336
|
+
|
|
337
|
+
### 5.A. QUICK track / SIMPLE complexity — legacy flat subtask schema
|
|
338
|
+
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
"task": "{task description}",
|
|
342
|
+
"complexity": "simple",
|
|
343
|
+
"spec": "spec.md",
|
|
344
|
+
"subtasks": [
|
|
345
|
+
{
|
|
346
|
+
"id": "1",
|
|
347
|
+
"title": "{subtask title}",
|
|
348
|
+
"description": "{what to do — concrete, not vague}",
|
|
349
|
+
"files": ["path/to/file1.ts", "path/to/file2.ts"],
|
|
350
|
+
"dependencies": [],
|
|
351
|
+
"status": "pending",
|
|
352
|
+
"verification": "{command or check to verify completion}"
|
|
353
|
+
}
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
QUICK subtasks omit `hitl`, `afk`, `acceptance_criteria`, and `user_value`
|
|
359
|
+
fields. The one-shot path doesn't need user-value framing or per-subtask
|
|
360
|
+
HITL gates.
|
|
361
|
+
|
|
362
|
+
### 5.B. STANDARD / DEEP / COMPLEX — vertical-slice subtask schema
|
|
363
|
+
|
|
279
364
|
```json
|
|
280
365
|
{
|
|
281
366
|
"task": "{task description}",
|
|
282
|
-
"complexity": "
|
|
367
|
+
"complexity": "standard|complex",
|
|
283
368
|
"spec": "spec.md",
|
|
369
|
+
"vertical_slice_schema_version": "1",
|
|
284
370
|
"declared_persona_tier": "primary",
|
|
285
371
|
"declared_personas": ["mobile-dev"],
|
|
286
372
|
"tier_confidence": "high",
|
|
@@ -308,29 +394,48 @@ Create `{task_dir}/implementation_plan.json`:
|
|
|
308
394
|
"subtasks": [
|
|
309
395
|
{
|
|
310
396
|
"id": "1",
|
|
311
|
-
"title": "{subtask title}",
|
|
397
|
+
"title": "{subtask title — user-value framing, not 'add UI'}",
|
|
312
398
|
"description": "{what to do — concrete, not vague}",
|
|
313
399
|
"files": ["path/to/file1.ts", "path/to/file2.ts"],
|
|
314
400
|
"acceptance_criteria": ["AC1", "AC3"],
|
|
315
401
|
"dependencies": [],
|
|
316
402
|
"status": "pending",
|
|
403
|
+
"hitl": "required | review | none",
|
|
404
|
+
"afk": "safe | unsafe",
|
|
405
|
+
"user_value": "{one-line user-value framing — who benefits, how}",
|
|
317
406
|
"verification": "{command or check to verify completion}"
|
|
318
407
|
}
|
|
319
408
|
]
|
|
320
409
|
}
|
|
321
410
|
```
|
|
322
411
|
|
|
412
|
+
Mandatory STANDARD/DEEP fields per subtask:
|
|
413
|
+
|
|
414
|
+
- `hitl` — `"required" | "review" | "none"`. `required` blocks the
|
|
415
|
+
executor pending human approval (autonomy 1 always pauses; autonomy 2
|
|
416
|
+
batches; autonomy 3 escalates only on conflict). `review` means the
|
|
417
|
+
human reviews the diff post-hoc, not blocking. `none` is agent-only.
|
|
418
|
+
- `afk` — `"safe" | "unsafe"`. `safe` means proceed unattended. `unsafe`
|
|
419
|
+
means pause at the start of this subtask if no human is present
|
|
420
|
+
(autonomy < 3).
|
|
421
|
+
- `acceptance_criteria` — `string[]` of id-refs (`"AC1"`, …) into spec.md's
|
|
422
|
+
`## Acceptance Criteria` section.
|
|
423
|
+
- `user_value` — one-line framing of WHO benefits and HOW. Prevents
|
|
424
|
+
horizontal slicing — every subtask is a vertical user-shippable slice.
|
|
425
|
+
|
|
426
|
+
Plan-level: `vertical_slice_schema_version: "1"` declares the schema
|
|
427
|
+
version so future migrations can detect this plan as v1.
|
|
428
|
+
|
|
323
429
|
Rules:
|
|
324
430
|
- Each subtask completable in one focused session
|
|
325
431
|
- Dependencies form a DAG (no circular deps)
|
|
326
432
|
- Verification must be automated (test command, grep check, type check)
|
|
327
433
|
- Files list must be exhaustive — every file the subtask touches
|
|
328
|
-
- `acceptance_criteria` is mandatory
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
discouraged —
|
|
332
|
-
|
|
333
|
-
(`consistency-check`) enforces this on ship.
|
|
434
|
+
- `acceptance_criteria` is mandatory on STANDARD/DEEP: every AC in spec.md
|
|
435
|
+
must be referenced by at least one subtask; gate G8
|
|
436
|
+
(`consistency-check`) enforces this on ship. Verbatim AC text is
|
|
437
|
+
accepted but discouraged — id-refs are stable across spec edits.
|
|
438
|
+
- Subtask title MUST frame user value, not file scope.
|
|
334
439
|
|
|
335
440
|
### 5.1 Framework-scope doc-sync rule
|
|
336
441
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {Function} cmdFn — the Layer 1 cmd function (sync or async).
|
|
3
3
|
* @param {unknown[]} [args=[]] — argv-shaped positional args.
|
|
4
|
-
* @param {{ strictExit?: boolean, env?: Record<string, string> }} [opts]
|
|
5
|
-
* @returns {Promise<{ result: unknown, stdout: string, exitCode: number }>}
|
|
4
|
+
* @param {{ strictExit?: boolean, resetCaches?: boolean, env?: Record<string, string> }} [opts]
|
|
5
|
+
* @returns {Promise<{ result: unknown, stdout: string, stderr: string, exitCode: number }>}
|
|
6
6
|
*/
|
|
7
7
|
export function runCmd(cmdFn: Function, args?: unknown[], opts?: {
|
|
8
8
|
strictExit?: boolean;
|
|
9
|
+
resetCaches?: boolean;
|
|
9
10
|
env?: Record<string, string>;
|
|
10
11
|
}): Promise<{
|
|
11
12
|
result: unknown;
|
|
12
13
|
stdout: string;
|
|
14
|
+
stderr: string;
|
|
13
15
|
exitCode: number;
|
|
14
16
|
}>;
|
|
15
17
|
//# sourceMappingURL=run-cmd.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-cmd.d.mts","sourceRoot":"","sources":["../../src/__test-helpers/run-cmd.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-cmd.d.mts","sourceRoot":"","sources":["../../src/__test-helpers/run-cmd.mjs"],"names":[],"mappings":"AAiDA;;;;;GAKG;AACH,+CAJW,OAAO,EAAE,SACT;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3E,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAiF1F"}
|