Skip to content

Commit 9753fcb

Browse files
arul28claude
andauthored
Migrate dev loop to agent-folder skills + harden brain self-shutdown guard (#553)
* Migrate dev loop to agent-folder skills (context → quality → test → ship) Replace the .claude/commands slash commands with agent-folder skills under .agents/skills, ported from Versic's dev-loop pattern and re-grounded in ADE: - context (new): branch-area primer that folds in untracked files and lazy-loads only the matching docs + perf skill via references/doc-map.md - quality (new): thermo dual-review (correctness/security + maintainability / code-judo) with ADE-specific review rules — runtime-backed null services, daemon action-domain wiring, cr-sqlite CRR, IPC contract drift, fast-tier - test: automate reformatted 1:1; now consumes the /quality gate as regression targets and runs CI-mirrored shards - ship: shipLane's loop de-bundled — pure poll → fix → rebase → merge, no automate/finalize; preserves @copilot/@codex pings, conflict-only rebase, admin merge - audit / finalize / optimize / release kept as reformatted utility skills Delete the migrated commands and the source-command-audit wrapper; symlink .claude/skills -> .agents/skills for native Claude discovery; de-bundle the ship-lane playbook Phase 0; repoint the Path-to-Merge orchestrator source-of-truth refs from the deleted command to docs/playbooks/ship-lane.md; add a Dev loop section to AGENTS.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Harden brain self-shutdown guard: typed flag, not message match The brain-restart path detected a blocked uninstall by substring-matching the human-readable refusal message ("running inside that brain" + "ADE_ALLOW_RUNTIME_SERVICE_SELF_MUTATION=1") that installLaunchd.ts produces independently. Rewording either string would silently let `brain restart` re-install after a blocked stop, defeating the #549 guard. Add a typed `selfMutationBlocked` flag to ServiceManagerResult, set it where the block is produced, and branch on the flag in cli.ts instead of the message text. Behavior-preserving; serviceManager/common.test.ts (46) green, ade-cli typecheck clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b28735f commit 9753fcb

24 files changed

Lines changed: 1011 additions & 310 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
name: audit
23
description: Audit recent work — trace error paths, probe edge cases, fix any bugs or gaps found
34
---
45

.agents/skills/context/SKILL.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
name: context
3+
description: >-
4+
Session primer for ADE work: what ADE is, the dev loop, the tooling you can
5+
reach (the `ade` CLI control plane, app/browser/iOS-sim control, Linear,
6+
computer-use), and what's in flight on this branch. Auto-detects the active
7+
feature area from branch changes (or explicit keywords) and loads only the
8+
relevant docs + the matching perf skill — never a broad dump.
9+
---
10+
11+
# Context Skill
12+
13+
Session primer. Run once at the start of a session to learn what ADE is, how we
14+
work, the tooling you can reach, and what (if anything) is in flight on this
15+
lane. Feature-aware — load only the docs relevant to the work, never a broad
16+
dump.
17+
18+
**Invocation:** `/context` or `/context <keywords>`
19+
**Arguments:** optional feature/domain keywords (e.g., `prs`, `lanes rebase`, `tui`).
20+
21+
---
22+
23+
## Step 1 — Determine scope
24+
25+
**Args given:** parse the feature/domain keywords; pick the product area; build
26+
the doc + perf-skill set from `references/doc-map.md`.
27+
28+
**No args:** auto-detect from the lane.
29+
30+
```bash
31+
git diff main --name-only # tracked changes vs main
32+
git status --short # NEW (untracked) files git diff misses
33+
git log main..HEAD --oneline # commits unique to this lane
34+
```
35+
36+
`git diff main` does **not** list untracked files — on a lane whose whole point
37+
is new files (a new service, a new skill), the changes are invisible without
38+
`git status`. Always fold both in. Then infer the area from the changed paths and
39+
resolve docs + the matching `ade-perf-*` skill via `references/doc-map.md`.
40+
41+
---
42+
43+
## Step 2 — Baseline (always read)
44+
45+
- `AGENTS.md` — how to run/build/test, working norms, gotchas, the dev loop.
46+
- `docs/README.md` — the internal-docs navigation map.
47+
- `docs/PRD.md` — what ADE is, who it's for, the feature index.
48+
- `docs/ARCHITECTURE.md` — read the **section** relevant to the touched area
49+
(IPC, data plane, build/test/deploy), not the whole file. It's large.
50+
51+
---
52+
53+
## Step 3 — Feature docs + perf skill
54+
55+
Match changed paths / keywords against `references/doc-map.md` and load that doc
56+
set only. Each `docs/features/<area>/README.md` opens with a **Source file map**
57+
and a **gotchas / fragile areas** section — read those first; a flagged
58+
invariant usually deserves care (and a test later in `/test`).
59+
60+
If the area maps to a performance skill (`ade-perf-boot`, `ade-perf-lanes`,
61+
`ade-perf-prs`, `ade-perf-work`, or `ade-tui-web-preview`), open that skill too
62+
**before editing** — it records measured patterns you must preserve.
63+
64+
---
65+
66+
## Step 4 — Ongoing work (the *why*, not just filenames)
67+
68+
```bash
69+
git log main..HEAD --stat # what the lane's commits changed
70+
git diff main # committed + uncommitted tracked work
71+
git status --short # new/untracked work the diff omits
72+
```
73+
74+
- Read the diff to understand the purpose of the in-flight work.
75+
- If a commit or branch name carries a Linear ID (e.g. `ADE-123`), read the
76+
issue for intent (`ade linear` — see the `ade-linear` skill).
77+
- Cross-check the feature doc's task tracking (`[ ]` / `[x]`).
78+
- **No lane commits and no diff → say "Fresh lane — no in-flight work."**
79+
Don't invent context.
80+
81+
---
82+
83+
## Step 5 — Summarize
84+
85+
Emit this and nothing more (keep it scannable):
86+
87+
```markdown
88+
## Context Loaded
89+
90+
**Project:** ADE — local-first desktop env for orchestrating coding agents,
91+
lanes, PRs, and proof/artifacts (Electron + React + TS; CLI in `apps/ade-cli`).
92+
**Branch:** [name] · [N changed files | fresh lane]
93+
**Area:** [feature][desktop / cli / tui / ios / cross-cutting]
94+
**Docs:** [loaded list] **Perf skill:** [ade-perf-* loaded | none for this area]
95+
96+
**In flight:** [what the work does + why, or "Fresh lane — no in-flight work"]
97+
**Tracking:** [open N / done N · Linear: IDs or none · gaps if any]
98+
99+
**Tools (configured — use them for live state, don't ask):** `ade` CLI control
100+
plane · app/browser/iOS-sim/macOS-VM control · Linear (via `ade`) · computer-use
101+
+ proof drawer. Depth → the matching `ade-*` skill.
102+
**Dev loop:** /context → work → /quality → /test → /ship. Utilities: /audit,
103+
/finalize, /optimize, /release. Open each skill when you reach it.
104+
**Tests:** [commands for this area — see AGENTS.md "Validation"]
105+
106+
Ready to assist with [feature].
107+
```
108+
109+
---
110+
111+
## Tooling you have
112+
113+
ADE ships its capabilities as Agent Skills. State them briefly in the summary;
114+
open the relevant one only when a task needs it.
115+
116+
- **`ade` CLI** — the control plane for ADE state (lanes, chats, actions, PRs,
117+
proof, runtime/socket). Ground truth is `ade help <command>` and
118+
`ade actions list --text`, not memory. → `ade-cli-control-plane`.
119+
- **Lanes & git**`ade-lanes-git`. **PR workflows**`ade-pr-workflows`.
120+
- **App / browser / iOS-sim / macOS-VM control**`ade-app-control`,
121+
`ade-browser`, `ade-ios-simulator`, `ade-macos-vm`.
122+
- **Linear** (no API key needed; routed through ADE) → `ade-linear`.
123+
- **Proof & computer-use** (screenshots, video, traces → proof drawer) →
124+
`ade-proof-artifacts`. **Deeplinks**`ade-deeplinks`.
125+
126+
**Worktree note:** ADE runs this session inside a lane worktree
127+
(`.ade/worktrees/<lane>/`). Every edit must target a path under that worktree,
128+
never the project-root checkout.
129+
130+
---
131+
132+
## Optional deepening (load only when architecture detail is needed)
133+
134+
`docs/ARCHITECTURE.md` covers IPC, the data plane, and build/test/deploy in full
135+
— read the specific section when touching `preload/`, `shared/ipc.ts`,
136+
`registerIpc`, or a cross-app/service boundary.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Feature Path → Doc + Perf-Skill Mapping
2+
3+
Resolve changed file paths (or keyword arguments) to the canonical internal docs
4+
under `docs/` and, where one exists, the performance skill that records measured
5+
patterns for that surface. Load the doc set **and** open the perf skill before
6+
editing that surface.
7+
8+
Internal docs live under `docs/` (rebuilt tree). The public Mintlify site
9+
(`docs.json` + root-level `*.mdx`) is **out of scope** for context loading.
10+
11+
---
12+
13+
## Desktop — main-process services
14+
15+
| Path pattern | Feature docs | Perf skill |
16+
|---|---|---|
17+
| `apps/desktop/src/main/services/projects/` | `docs/features/project-home/` | `ade-perf-boot` |
18+
| `apps/desktop/src/main/services/lanes/` | `docs/features/lanes/` | `ade-perf-lanes` |
19+
| `apps/desktop/src/main/services/prs/`, `services/review/` | `docs/features/pull-requests/` | `ade-perf-prs` |
20+
| `apps/desktop/src/main/services/proof/` | `docs/features/proof.md` ||
21+
| `apps/desktop/src/main/services/remoteRuntime/`, `services/localRuntime/`, `services/runtime/` | `docs/features/remote-runtime/` | `ade-perf-boot` |
22+
| `apps/desktop/src/main/services/cto/` | `docs/features/cto/` + `linear-integration/` ||
23+
| `apps/desktop/src/main/services/ai/` | `docs/features/chat/` + `features/agents/` | `ade-perf-work` |
24+
| `apps/desktop/src/main/services/chat/` | `docs/features/chat/` | `ade-perf-work` |
25+
| `apps/desktop/src/main/services/automations/` | `docs/features/automations/` ||
26+
| `apps/desktop/src/main/services/computerUse/` | `docs/features/computer-use/` ||
27+
| `apps/desktop/src/main/services/deeplinks/` | `docs/features/deeplinks/` ||
28+
| `apps/desktop/src/main/services/orchestration/` | `docs/features/agents/` (orchestrator) ||
29+
| `apps/desktop/src/main/services/conflicts/` | `docs/features/conflicts/` ||
30+
| `apps/desktop/src/main/services/files/` | `docs/features/files-and-editor/` | `ade-perf-work` |
31+
| `apps/desktop/src/main/services/history/` | `docs/features/history/` ||
32+
| `apps/desktop/src/main/services/onboarding/`, `services/config/` | `docs/features/onboarding-and-settings/` | `ade-perf-boot` |
33+
| `apps/desktop/src/main/services/pty/`, `sessions/`, `processes/` | `docs/features/terminals-and-sessions/` | `ade-perf-work` |
34+
| `apps/desktop/src/main/services/sync/` | `docs/features/sync-and-multi-device/` ||
35+
| `apps/desktop/src/main/services/git/` | `docs/ARCHITECTURE.md` (Git engine) + `lanes/` | `ade-perf-lanes` |
36+
| `apps/desktop/src/main/services/ipc/`, `src/preload/` | `docs/ARCHITECTURE.md` (IPC contract) ||
37+
| `apps/desktop/src/main/main.ts`, app bootstrap | `docs/ARCHITECTURE.md` (Apps & Processes) | `ade-perf-boot` |
38+
39+
## Desktop — renderer
40+
41+
| Path pattern | Feature docs | Perf skill |
42+
|---|---|---|
43+
| `apps/desktop/src/renderer/components/lanes/**` | `docs/features/lanes/` | `ade-perf-lanes` |
44+
| `apps/desktop/src/renderer/components/prs/**` | `docs/features/pull-requests/` | `ade-perf-prs` |
45+
| `apps/desktop/src/renderer/components/chat/**`, Work tab panes (Tools, Git, Files, iOS, App Control, Browser, Mac VM) | `docs/features/chat/` + relevant feature | `ade-perf-work` |
46+
| `apps/desktop/src/renderer/components/app/**` (App shell) | `docs/ARCHITECTURE.md` (UI framework) | `ade-perf-boot` |
47+
| `apps/desktop/src/renderer/components/graph/**` | `docs/features/workspace-graph/` ||
48+
| `apps/desktop/src/renderer/components/<area>/**` | `docs/features/<same-area>/` (note: renderer dir names don't always equal feature dir names — e.g. `graph/``workspace-graph/`, `vm/`→no doc) | match by area above |
49+
| `apps/desktop/src/renderer/state/` (incl. `appStore.ts`) | `docs/ARCHITECTURE.md` (UI framework) | `ade-perf-lanes` |
50+
| `apps/desktop/src/shared/**` | `docs/ARCHITECTURE.md` + the touching feature's doc ||
51+
52+
## ADE CLI & TUI
53+
54+
| Path pattern | Feature docs | Perf skill |
55+
|---|---|---|
56+
| `apps/ade-cli/src/tuiClient/**` | `docs/features/ade-code/README.md` + `ARCHITECTURE.md` (ADE CLI) | `ade-tui-web-preview` |
57+
| `apps/ade-cli/**` (non-TUI) | `docs/ARCHITECTURE.md` (ADE CLI / Build/Test/Deploy) + `features/agents/` ||
58+
59+
## iOS, web, CI
60+
61+
| Path pattern | Feature docs | Perf skill |
62+
|---|---|---|
63+
| `apps/ios/**` | `docs/features/sync-and-multi-device/ios-companion.md` + `features/ios-simulator/` ||
64+
| `apps/web/**` | `docs/ARCHITECTURE.md` (Apps & Processes) ||
65+
| `.github/workflows/**` | `docs/ARCHITECTURE.md` (Build/Test/Deploy) ||
66+
67+
---
68+
69+
**Cross-cutting:** any change to `preload/`, `shared/ipc.ts`, or `registerIpc`
70+
also loads `docs/ARCHITECTURE.md` (IPC + data plane sections). Keep IPC
71+
contracts, preload types, shared types, and renderer usage in sync — see the
72+
`runtime-backed null services` rule in the `/quality` skill's
73+
`references/ade-review-rules.md` for the bug class this guards against.
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ name: finalize
33
description: 'Final gate: simplify code, validate docs, and run local CI checks before pushing'
44
---
55

6-
# Finalize Command
6+
# /finalize — Pre-push Local-CI Gate
77

8-
This command is the final gate before pushing and opening a PR.
8+
This skill is the final local gate before pushing and opening a PR.
9+
10+
> In the dev loop, deep bug-finding and code cleanup are `/quality`'s job (the
11+
> loop default) and test-suite work is `/test`'s. `/finalize` is **optional**:
12+
> run it when you want a full **local** CI gate before `/ship` pushes — a final
13+
> simplification sweep plus typecheck/lint/sharded-tests/build/doc-validation.
914
1015
It guarantees three outcomes:
11-
1. Code quality cleanup is complete
12-
2. Docs changed by `/automate` are still valid
16+
1. A final code-simplification sweep is complete (`/quality` already did the heavy lifting)
17+
2. Docs changed by `/test` are still valid
1318
3. Local CI checks pass
1419

1520
It does **not** guarantee that remote PR review is complete after a push. GitHub's
1621
first visible check list can look quiet before delayed checks, bot reviews, and
1722
inline comments arrive. After pushing a finalized branch, hand off to
18-
`/shipLane` or an equivalent PR poll loop. Use the ship-lane cadence: poll
23+
`/ship` or an equivalent PR poll loop. Use the ship-lane cadence: poll
1924
immediately after a push, wait 270s if CI has not registered, wait 720s while CI
2025
is running, and wait 1800s only when CI is done and the PR is just waiting on
2126
review.
@@ -112,7 +117,7 @@ Prompt each with:
112117

113118
Wait for all simplifier agents to complete before moving to Phase 3.
114119

115-
Docs, mobile, CLI, and TUI parity reviewers have moved to `/automate` — they should run before `/finalize`. Do not re-spawn them here.
120+
Docs, mobile, CLI, and TUI parity reviewers have moved to `/test` — they should run before `/finalize`. Do not re-spawn them here.
116121

117122
---
118123

@@ -282,7 +287,7 @@ surface looks complete. In particular:
282287
Handoff rule:
283288

284289
```bash
285-
# After the branch is pushed, continue with /shipLane or equivalent:
290+
# After the branch is pushed, continue with /ship or equivalent:
286291
# - poll PR checks, status rollup, review comments, issue comments, and reviews
287292
# - poll immediately after a push so early CI registration/failures are visible
288293
# - if CI has not started yet, wait 270s
@@ -291,7 +296,7 @@ Handoff rule:
291296
# - poll again before declaring the PR clean or ready for human merge
292297
```
293298

294-
If `/finalize` is running as a sub-step inside `/shipLane`, return a summary that
299+
If `/finalize` is running as a sub-step inside `/ship`, return a summary that
295300
explicitly says remote checks/comments still require the ship-lane poll loop.
296301
Do not report "PR clean" from `/finalize` alone.
297302

@@ -322,7 +327,7 @@ Do not report "PR clean" from `/finalize` alone.
322327
323328
### Remote PR Handoff:
324329
- Post-push polling required: YES
325-
- Poll loop: `/shipLane` branch-specific cadence
330+
- Poll loop: `/ship` branch-specific cadence
326331
- Reason: delayed checks and bot comments may arrive after first visible green state
327332
328333
### Status: Ready to push / Issues found
@@ -332,4 +337,4 @@ Do not report "PR clean" from `/finalize` alone.
332337

333338
## Completion Checklist
334339

335-
Before marking complete: every Phase 3 step (3a–3j) must report PASS in the Phase 4 summary, and Phase 2 simplifier agents must have reported back. Remote PR review is **not** declared clean by `/finalize` — handoff to `/shipLane` (Phase 3j) is mandatory after push.
340+
Before marking complete: every Phase 3 step (3a–3j) must report PASS in the Phase 4 summary, and Phase 2 simplifier agents must have reported back. Remote PR review is **not** declared clean by `/finalize` — handoff to `/ship` (Phase 3j) is mandatory after push.
File renamed without changes.

0 commit comments

Comments
 (0)