claude-code-session-manager 0.139.0 → 0.141.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 +20 -4
- package/dist/assets/AppSettings-DExeJhqQ.js +2 -0
- package/dist/assets/History-DJMiuXyK.js +2 -0
- package/dist/assets/{HomeClaudeConfig-CGD2Onjv.js → HomeClaudeConfig-CTp2tkZ4.js} +2 -2
- package/dist/assets/{Panel-Csyd9HbD.js → Panel-Bf1Cf8UL.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-C-jlYpC_.js → ProjectClaudeConfig-BWPpypf9.js} +1 -1
- package/dist/assets/Scheduler-cyr61UAC.js +16 -0
- package/dist/assets/{SkillReferenceGraph-DcscPXAG.js → SkillReferenceGraph-Ba4TkX2C.js} +1 -1
- package/dist/assets/{Skills-BpGRKOcY.js → Skills-C1v91GEO.js} +26 -26
- package/dist/assets/{TiptapBody-DSU3769X.js → TiptapBody-BrcWVpiW.js} +1 -1
- package/dist/assets/{ViewTabs-C0PRZx4_.js → ViewTabs-DXhOWFG0.js} +1 -1
- package/dist/assets/{VoiceButton-D2rMurNg.js → VoiceButton-qivnDV6K.js} +1 -1
- package/dist/assets/{historyTotals-TcIQs2sh.js → historyTotals-CMCPTKqC.js} +1 -1
- package/dist/assets/index-B2TQz3nd.js +3121 -0
- package/dist/assets/{index-BCySPdtU.css → index-DKXdXfka.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +423 -426
- package/package.json +5 -2
- package/plugins/AGENTS.md +60 -0
- package/plugins/CLAUDE.md +1 -60
- package/plugins/session-manager-dev/skills/builder/SKILL.md +4 -2
- package/plugins/session-manager-dev/skills/develop/SKILL.md +29 -19
- package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +5 -4
- package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +4 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +16 -12
- package/plugins/session-manager-dev/skills/maintaining-md-network/migrate-to-agents-md.md +15 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +50 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +10 -10
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +117 -112
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdDuplicates.cjs +182 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs +340 -0
- package/scripts/README.md +1 -0
- package/scripts/hooks/guard-tool-risk.cjs +91 -0
- package/scripts/hooks/lib/guard-tool-risk-policy.cjs +217 -0
- package/scripts/ops-sweep.cjs +53 -23
- package/scripts/scheduler-mcp-server.cjs +205 -18
- package/src/main/build-info.json +4 -4
- package/src/main/config.cjs +112 -8
- package/src/main/docEdit.cjs +6 -1
- package/src/main/files.cjs +7 -27
- package/src/main/health.cjs +48 -15
- package/src/main/historyAggregator.cjs +88 -5
- package/src/main/historyDashboard.cjs +69 -4
- package/src/main/index.cjs +56 -2
- package/src/main/ipcSchemas.cjs +122 -16
- package/src/main/lib/AGENTS.md +54 -0
- package/src/main/lib/CLAUDE.md +1 -54
- package/src/main/lib/agent-cli/adapters/codex.cjs +5 -2
- package/src/main/lib/agent-cli/agentCliIpc.cjs +18 -2
- package/src/main/lib/agent-cli/agentCliSessionStore.cjs +1 -0
- package/src/main/lib/agent-cli/agentCliTurn.cjs +20 -2
- package/src/main/lib/agent-cli/geminiContextDefaults.cjs +94 -0
- package/src/main/lib/claude/effectiveModelInfo.cjs +90 -20
- package/src/main/lib/claude/jobSandboxPolicy.cjs +202 -0
- package/src/main/lib/claude/personaToolScope.cjs +12 -6
- package/src/main/lib/claude/rateLimitDetect.cjs +13 -2
- package/src/main/lib/claude/runClaudeP.cjs +6 -1
- package/src/main/lib/claude/toolRiskIpc.cjs +177 -0
- package/src/main/lib/claude/toolRiskMarks.cjs +373 -0
- package/src/main/lib/demo-video-kit/seedKit.cjs +27 -6
- package/src/main/lib/ephemeralCwd.cjs +37 -2
- package/src/main/lib/epic/delegationReadiness.cjs +42 -9
- package/src/main/lib/epic/epicAdminRoutes.cjs +25 -5
- package/src/main/lib/epic/epicOutsideRead.cjs +118 -1
- package/src/main/lib/epic/epicOutsideState.cjs +2 -2
- package/src/main/lib/epic/epicSweepValidator.cjs +7 -2
- package/src/main/lib/epic/epicValidationHook.cjs +24 -4
- package/src/main/lib/epic/guardSpawnSettings.cjs +57 -1
- package/src/main/lib/externalContract.cjs +31 -5
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +55 -1
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +106 -11
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +47 -19
- package/src/main/lib/feedback-remote/needsYouStore.cjs +6 -2
- package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +98 -1
- package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +5 -0
- package/src/main/lib/git/branchSweep.cjs +209 -4
- package/src/main/lib/git/gitWorktree.cjs +41 -5
- package/src/main/lib/guardShims.cjs +1 -1
- package/src/main/lib/historyRollup.cjs +26 -0
- package/src/main/lib/insideHome.cjs +27 -1
- package/src/main/lib/mcpToolCatalog.cjs +132 -13
- package/src/main/lib/mdDocCensus.cjs +59 -78
- package/src/main/lib/mdDocRefs.cjs +71 -93
- package/src/main/lib/mdNetworkScan.cjs +245 -250
- package/src/main/lib/mdReviewRecord.cjs +22 -9
- package/src/main/lib/memoryMdNetwork.cjs +5 -12
- package/src/main/lib/opsOwnership.cjs +18 -2
- package/src/main/lib/opsRetentionSettings.cjs +28 -4
- package/src/main/lib/persona-macro/macroJobDispatch.cjs +90 -20
- package/src/main/lib/persona-macro/macroJobIpc.cjs +144 -46
- package/src/main/lib/persona-macro/macroJobStatus.cjs +87 -9
- package/src/main/lib/persona-macro/macroLibrary.cjs +95 -5
- package/src/main/lib/persona-macro/personaImportHealth.cjs +78 -17
- package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +96 -0
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +11 -0
- package/src/main/lib/prd/depSlugResolve.cjs +104 -4
- package/src/main/lib/prd/prdAdminRoutes.cjs +35 -2
- package/src/main/lib/prd/prdCreate.cjs +377 -23
- package/src/main/lib/prd/prdDisposition.cjs +11 -2
- package/src/main/lib/prd/prdFrontmatter.cjs +121 -3
- package/src/main/lib/process/loginItem.cjs +171 -0
- package/src/main/lib/process/loginItemPlan.cjs +193 -0
- package/src/main/lib/project-pages/playerBridge.cjs +4 -0
- package/src/main/lib/project-pages/videoReview.cjs +268 -0
- package/src/main/lib/project-pages/videoReviewIpc.cjs +229 -0
- package/src/main/lib/scheduler/cpuSample.cjs +131 -4
- package/src/main/lib/scheduler/fixPlanSlug.cjs +4 -3
- package/src/main/lib/scheduler/loadGate.cjs +24 -6
- package/src/main/lib/scheduler/planRecordHarvest.cjs +108 -0
- package/src/main/lib/scheduler/planRecordRetention.cjs +144 -0
- package/src/main/lib/scheduler/preflightCheck.cjs +97 -0
- package/src/main/lib/scheduler/queueStore.cjs +7 -0
- package/src/main/lib/scheduler/rcaReport.cjs +21 -1
- package/src/main/lib/scheduler/reaperHelpers.cjs +35 -5
- package/src/main/lib/scheduler/reviewNotice.cjs +39 -0
- package/src/main/lib/scheduler/runLogRetention.cjs +104 -3
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
- package/src/main/lib/scheduler/schedulerBatch.cjs +25 -48
- package/src/main/lib/scheduler/schedulerPaths.cjs +3 -0
- package/src/main/lib/scheduler/sessionSlots.cjs +176 -21
- package/src/main/lib/scheduler/validationQuality.cjs +282 -0
- package/src/main/lib/scheduler/validatorVerdictSchema.cjs +254 -0
- package/src/main/lib/tasks/taskAdminRoutes.cjs +641 -0
- package/src/main/lib/tasks/taskIpc.cjs +80 -0
- package/src/main/lib/tasks/taskLedger.cjs +502 -0
- package/src/main/lib/tasks/taskRun.cjs +313 -0
- package/src/main/lib/tasks/taskSwitch.cjs +120 -0
- package/src/main/loginItemIpc.cjs +35 -0
- package/src/main/loopEfficiencyHandlers.cjs +10 -1
- package/src/main/projectPages.cjs +6 -15
- package/src/main/promptSessionEvents.cjs +9 -1
- package/src/main/queueOps.cjs +260 -3
- package/src/main/runVerify.cjs +53 -25
- package/src/main/scheduler/AGENTS.md +26 -0
- package/src/main/scheduler/CLAUDE.md +1 -26
- package/src/main/scheduler/budget.cjs +239 -9
- package/src/main/scheduler/cancelDependents.cjs +154 -0
- package/src/main/scheduler/prdParser.cjs +19 -1
- package/src/main/scheduler/reviewLadder.cjs +36 -3
- package/src/main/scheduler/starvation.cjs +89 -18
- package/src/main/scheduler.cjs +1080 -89
- package/src/main/supervisor.cjs +5 -1
- package/src/main/templates/PRD_AUTHORING.md +14 -1
- package/src/main/validationQualityHandlers.cjs +199 -0
- package/src/main/webRemote.cjs +10 -2
- package/src/preload/api.d.ts +364 -21
- package/src/preload/apiSurface.json +89 -10
- package/src/preload/index.cjs +23 -2
- package/src/seed/agents/validator.md +19 -8
- package/dist/assets/AppSettings-CUfWY9vN.js +0 -2
- package/dist/assets/History-DDnqaLyw.js +0 -2
- package/dist/assets/Scheduler-NLs08fx7.js +0 -16
- package/dist/assets/index-C-d0DCre.js +0 -3124
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-session-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.141.0",
|
|
4
4
|
"description": "Free desktop app for Claude Code: run many sessions, each in its own git worktree; queue work that runs headless within your usage limits; agents drive it through an MCP server and skills.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main/index.cjs",
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
"scripts/hooks/guard-destructive-git.cjs",
|
|
20
20
|
"scripts/hooks/guard-inline-implementation.cjs",
|
|
21
21
|
"scripts/hooks/guard-self-schedule.cjs",
|
|
22
|
+
"scripts/hooks/guard-tool-risk.cjs",
|
|
22
23
|
"scripts/hooks/lib/guard-destructive-git-policy.cjs",
|
|
23
24
|
"scripts/hooks/lib/guard-self-schedule-policy.cjs",
|
|
24
25
|
"scripts/hooks/lib/guard-prd-writes-policy.cjs",
|
|
25
26
|
"scripts/hooks/lib/guard-inline-implementation-policy.cjs",
|
|
27
|
+
"scripts/hooks/lib/guard-tool-risk-policy.cjs",
|
|
26
28
|
"src/main/",
|
|
27
29
|
"src/preload/",
|
|
28
30
|
"src/seed/",
|
|
@@ -51,6 +53,7 @@
|
|
|
51
53
|
"test:unit": "vitest run",
|
|
52
54
|
"test:unit:stability": "bash scripts/test-unit-stability.sh",
|
|
53
55
|
"bench": "node scripts/bench/main-bench.cjs",
|
|
56
|
+
"probe:job-sandbox": "node scripts/job-sandbox-probe.cjs",
|
|
54
57
|
"bench:renderer": "vitest run --config vitest.bench.config.ts",
|
|
55
58
|
"preview:memory": "node scripts/memory-explorer-shots.mjs",
|
|
56
59
|
"test:e2e": "xvfb-run -a playwright test",
|
|
@@ -150,6 +153,7 @@
|
|
|
150
153
|
"chokidar": "^4.0.1",
|
|
151
154
|
"electron": "42.11.18",
|
|
152
155
|
"electron-updater": "^6.8.9",
|
|
156
|
+
"marked": "^14.0.0",
|
|
153
157
|
"node-pty": "^1.2.0-beta.12",
|
|
154
158
|
"ws": "^8.18.0",
|
|
155
159
|
"zod": "^4.6.7"
|
|
@@ -177,7 +181,6 @@
|
|
|
177
181
|
"electron-builder": "^26.15.3",
|
|
178
182
|
"esbuild": "^0.25.12",
|
|
179
183
|
"jsdom": "^29.1.1",
|
|
180
|
-
"marked": "^14.0.0",
|
|
181
184
|
"monaco-editor": "0.55.1",
|
|
182
185
|
"onnxruntime-web": "^1.24.3",
|
|
183
186
|
"postcss": "^8.4.49",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# plugins/ — scoped context
|
|
2
|
+
|
|
3
|
+
Part of the **AGENT LAYER** partition — see
|
|
4
|
+
[`project-partition.md`](../session-manager-operations/architecture/project-partition.md).
|
|
5
|
+
|
|
6
|
+
## What's here
|
|
7
|
+
|
|
8
|
+
`session-manager-dev/skills/` — 4 skills (`builder`, `develop`, `maintaining-md-network`, `send-feedback`); keep in sync with `project-partition.md` and
|
|
9
|
+
`seedDevPlugin.cjs`'s header count.
|
|
10
|
+
|
|
11
|
+
`packs/<id>/` — context packs (plugin + `sm-pack.json` + optional `laws.md`), loaded per session by `--plugin-dir`, not the marketplace; read by `src/main/lib/packs/packCatalog.cjs`.
|
|
12
|
+
|
|
13
|
+
Two manifests: root [`.claude-plugin/marketplace.json`](../.claude-plugin/marketplace.json)
|
|
14
|
+
declares the one plugin (`source: "./plugins/session-manager-dev"`); the plugin's own
|
|
15
|
+
[`session-manager-dev/.claude-plugin/plugin.json`](session-manager-dev/.claude-plugin/plugin.json)
|
|
16
|
+
carries the `description` shown in the marketplace UI — list only shipped skills.
|
|
17
|
+
Bumping a plugin's `plugin.json` version requires bumping its entry in `.claude-plugin/marketplace.json` in the same PRD.
|
|
18
|
+
|
|
19
|
+
`src/main/seedDevPlugin.cjs` is the first-boot offline installer — installs this plugin from its
|
|
20
|
+
bundled marketplace (no network) on a fresh machine, then marks
|
|
21
|
+
`~/.claude/session-manager/.dev-plugin-seeded`.
|
|
22
|
+
Claude Code loads it in place from the registered marketplace's source folder (the app's package root), never the `~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/` snapshots: skill edits ship with app updates; a `plugin.json` bump only refreshes the shown version.
|
|
23
|
+
|
|
24
|
+
**`skills/develop/standards.md` is a frozen absolute-path contract.** Every scheduler PRD in
|
|
25
|
+
every consuming repo points its headless executor at it by resolved absolute path, baked
|
|
26
|
+
in at authoring time — including PRDs already archived in OTHER repos. Renaming or moving it
|
|
27
|
+
breaks them all, undetectably from here.
|
|
28
|
+
|
|
29
|
+
**Path literals inside shipped skills.** A skill runs in OTHER repos, so a
|
|
30
|
+
session-manager-internal path (`src/main/...`, `src/renderer/...`, bare `scripts/...`) inside one
|
|
31
|
+
is a portability defect unless `$SM_ROOT`-qualified (`$SM_ROOT` = installed
|
|
32
|
+
package root, e.g. `node "$SM_ROOT/scripts/<x>.cjs"`) or removed. `builder/manual.md` is session-manager-specific on
|
|
33
|
+
purpose and runs only when `session-manager-operations/manual/manual.json` exists.
|
|
34
|
+
|
|
35
|
+
## Who consumes this
|
|
36
|
+
|
|
37
|
+
**Other repos**, not (only) this one. A project installs `claude-code-session-manager` from npm,
|
|
38
|
+
or references its skills/hooks directly.
|
|
39
|
+
Editing a skill here changes every consuming repo. See
|
|
40
|
+
[`../session-manager-operations/reviews/2026-09-12-agent-layer-consumers.md`](../session-manager-operations/reviews/2026-09-12-agent-layer-consumers.md)
|
|
41
|
+
for live consumers.
|
|
42
|
+
|
|
43
|
+
## What must NOT be assumed
|
|
44
|
+
|
|
45
|
+
- Treat every skill edit here as a cross-repo API change.
|
|
46
|
+
- Do not vendor `scripts/hooks/guard-*.cjs` into a skill/repo — adopt **by reference** via the
|
|
47
|
+
stable shim (`src/main/lib/guardShims.cjs`) at `~/.claude/session-manager/hooks/guard-*.cjs`,
|
|
48
|
+
never this repo's own absolute path or a copy.
|
|
49
|
+
- Do not confuse this with `.claude/` at the repo root — this repo's own unshipped local dev
|
|
50
|
+
config. `.claude/agents/*.md` are per-project OVERLAYS that win over
|
|
51
|
+
`~/.claude/agents/*.md` (Claude Code's own precedence, per `src/main/agentLibrary.cjs`);
|
|
52
|
+
`src/seed/agents/` is the shipped source for the personas
|
|
53
|
+
`src/main/seedAgentPersonas.cjs` copies into `~/.claude/agents/` (its `PERSONAS` list);
|
|
54
|
+
`builder` has no seed source — the generic `~/.claude/agents/builder.md` is machine-local
|
|
55
|
+
and this repo's `.claude/agents/builder.md` overlays it. Tracked under `.claude/`:
|
|
56
|
+
`settings.json` (guard hooks), `agents/builder.md`, and the `agents/page-*.md` stewards.
|
|
57
|
+
- The scheduler MCP server (`session-manager-scheduler`) is registered at USER scope in
|
|
58
|
+
`~/.claude.json`, not in this repo.
|
|
59
|
+
- A skill may run headless via a scheduled PRD in another project — don't rely on
|
|
60
|
+
interactive-session-only features; check `/develop`'s scheduler flow first.
|
package/plugins/CLAUDE.md
CHANGED
|
@@ -1,60 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Part of the **AGENT LAYER** partition — see
|
|
4
|
-
[`project-partition.md`](../session-manager-operations/architecture/project-partition.md).
|
|
5
|
-
|
|
6
|
-
## What's here
|
|
7
|
-
|
|
8
|
-
`session-manager-dev/skills/` — 4 skills (`builder`, `develop`, `maintaining-md-network`, `send-feedback`) — verified against `ls
|
|
9
|
-
plugins/session-manager-dev/skills` 2026-11-06; keep in sync with `project-partition.md` and
|
|
10
|
-
`seedDevPlugin.cjs`'s header count.
|
|
11
|
-
|
|
12
|
-
`packs/<id>/` — context packs (plugin + `sm-pack.json` + optional `laws.md`), loaded per session by `--plugin-dir`, not the marketplace; read by `src/main/lib/packs/packCatalog.cjs`.
|
|
13
|
-
|
|
14
|
-
Two manifests: root [`.claude-plugin/marketplace.json`](../.claude-plugin/marketplace.json)
|
|
15
|
-
declares the one plugin (`source: "./plugins/session-manager-dev"`); the plugin's own
|
|
16
|
-
[`session-manager-dev/.claude-plugin/plugin.json`](session-manager-dev/.claude-plugin/plugin.json)
|
|
17
|
-
carries the `description` shown in the marketplace UI — list only shipped skills.
|
|
18
|
-
Bumping a plugin's `plugin.json` version requires bumping its entry in `.claude-plugin/marketplace.json` in the same PRD (PRD 3140 was refuted for missing it).
|
|
19
|
-
|
|
20
|
-
`src/main/seedDevPlugin.cjs` is the first-boot offline installer — installs this plugin from its
|
|
21
|
-
bundled marketplace (no GitHub/registry call) as a default on a fresh machine, then marks
|
|
22
|
-
`~/.claude/session-manager/.dev-plugin-seeded`.
|
|
23
|
-
|
|
24
|
-
**`skills/develop/standards.md` is a frozen absolute-path contract.** Every scheduler PRD, in
|
|
25
|
-
every consuming repo, points its headless executor at it by resolved absolute path, baked
|
|
26
|
-
in at authoring time — including PRDs already archived in OTHER repos. Renaming or moving it
|
|
27
|
-
breaks them all, undetectably from here.
|
|
28
|
-
|
|
29
|
-
**Path literals inside shipped skills.** A skill runs in OTHER repos, so a
|
|
30
|
-
session-manager-internal path (`src/main/...`, `src/renderer/...`, bare `scripts/...`) inside one
|
|
31
|
-
is a portability defect unless `$SM_ROOT`-qualified (e.g. `node "$SM_ROOT/scripts/<x>.cjs"`, with `$SM_ROOT` resolved
|
|
32
|
-
to the installed package root) or removed. `builder/manual.md` is session-manager-specific on
|
|
33
|
-
purpose and runs only when `session-manager-operations/manual/manual.json` exists.
|
|
34
|
-
|
|
35
|
-
## Who consumes this
|
|
36
|
-
|
|
37
|
-
**Other repos**, not (only) this one. A project installs `claude-code-session-manager` from npm,
|
|
38
|
-
or references its skills/hooks directly, for the same dev workflow session-manager uses on itself.
|
|
39
|
-
Editing a skill here changes behavior in every consuming repo. See
|
|
40
|
-
[`../session-manager-operations/reviews/2026-09-12-agent-layer-consumers.md`](../session-manager-operations/reviews/2026-09-12-agent-layer-consumers.md)
|
|
41
|
-
for live sibling consumers.
|
|
42
|
-
|
|
43
|
-
## What must NOT be assumed
|
|
44
|
-
|
|
45
|
-
- Treat every skill edit here as a cross-repo API change, not a local-only one.
|
|
46
|
-
- Do not vendor `scripts/hooks/guard-*.cjs` into a skill/repo — adopt **by reference** via the
|
|
47
|
-
stable shim (`src/main/lib/guardShims.cjs`) at `~/.claude/session-manager/hooks/guard-*.cjs`,
|
|
48
|
-
never this repo's own absolute path or a copy.
|
|
49
|
-
- Do not confuse this with `.claude/` at the repo root — this repo's own unshipped local dev
|
|
50
|
-
config. `.claude/agents/*.md` are per-project OVERLAYS that win over
|
|
51
|
-
`~/.claude/agents/*.md` (Claude Code's own precedence, per `src/main/agentLibrary.cjs`);
|
|
52
|
-
`src/seed/agents/` is the shipped source for the personas
|
|
53
|
-
`src/main/seedAgentPersonas.cjs` copies into `~/.claude/agents/` (its `PERSONAS` list);
|
|
54
|
-
`builder` has no seed source — the generic `~/.claude/agents/builder.md` is machine-local
|
|
55
|
-
and this repo's `.claude/agents/builder.md` overlays it. Tracked under `.claude/`:
|
|
56
|
-
`settings.json` (guard hooks), `agents/builder.md`, and the `agents/page-*.md` stewards.
|
|
57
|
-
- The scheduler MCP server (`session-manager-scheduler`) is registered at USER scope in
|
|
58
|
-
`~/.claude.json`, not in this repo.
|
|
59
|
-
- A skill may run headless via a scheduled PRD in another project — don't rely on
|
|
60
|
-
interactive-session-only features; check `/develop`'s scheduler flow first.
|
|
1
|
+
@AGENTS.md
|
|
@@ -39,7 +39,8 @@ to walk back once published.
|
|
|
39
39
|
|
|
40
40
|
## 3. Gate and publish preflight
|
|
41
41
|
|
|
42
|
-
Run each name in `build-target.json`'s `gates` as `timeout 300 npm run <gate
|
|
42
|
+
Run each name in `build-target.json`'s `gates` as `timeout <gateTimeoutSeconds[gate] or 300> npm run <gate>`
|
|
43
|
+
(default 300 when `gateTimeoutSeconds` has no entry for that gate), in order,
|
|
43
44
|
against `HEAD`, with no `--skip` flags. With no `gates` entry, run the pre-commit checks the
|
|
44
45
|
project's `CLAUDE.md` or README requires; with none documented, say so in the report. Any
|
|
45
46
|
failure → stop: report the command and its real output, and that no bump, tag or publish
|
|
@@ -94,7 +95,8 @@ have no `release.yml`) always use steps 5-11:
|
|
|
94
95
|
5. `mkdir -p "$HOME/.cache/sm-publish" && git worktree add "$HOME/.cache/sm-publish/v<version>" v<version>`
|
|
95
96
|
— never under `/tmp` or `os.tmpdir()`: some test suites (this repo's included) treat those
|
|
96
97
|
paths as fixtures and fail there.
|
|
97
|
-
6. In the worktree: `npm ci`, then the gates again (step 3
|
|
98
|
+
6. In the worktree: `npm ci`, then the gates again (step 3: `timeout <gateTimeoutSeconds[gate] or 300>
|
|
99
|
+
npm run <gate>`, default 300 when a gate has no entry), then the project's build. Check
|
|
98
100
|
every `files` entry in `package.json` exists before publishing; stop on any failure.
|
|
99
101
|
A cold `test:unit` in a fresh publish worktree can time out under load; rerun the failed files, then the full suite, before calling the gate red — never publish on the partial rerun.
|
|
100
102
|
7. `npm publish` from inside the worktree, so `prepublishOnly` builds there too.
|
|
@@ -141,17 +141,15 @@ three failure modes have different fixes:
|
|
|
141
141
|
| `gate`, `files` | **REQUIRED.** Rules below. The tool refuses a call without them. |
|
|
142
142
|
| `estimateMinutes` | Omit (a persona's `defaultEstimateMinutes` applies). Pass one only for a run needing more than the 45-minute floor. |
|
|
143
143
|
| `sourcePromptId` | Always `<epic-id>`. Never rely on the server's fallback. |
|
|
144
|
-
| `cwd` | The Epic's project root
|
|
144
|
+
| `cwd` | The Epic's project root; see PRD_AUTHORING.md §5. |
|
|
145
145
|
| `dependsOn` | Slugs that must finish first. The only ordering tool. |
|
|
146
146
|
| `disposition` | Only when the API asks. `append` waits behind the Epic's unfinished PRDs; `new-head` may run now, so only when no files are shared. |
|
|
147
147
|
| `slug` | Optional kebab-case without an `NN-` prefix. The API picks the number. |
|
|
148
148
|
| `tag`, `agentType` | Omit (`dev-lead` default), except on the validate PRD. |
|
|
149
149
|
| `quietMachine` | Only for timing measurements. |
|
|
150
150
|
|
|
151
|
-
Never pass `parallelGroup`; it is ignored. The API writes the frontmatter,
|
|
152
|
-
`# Gate`
|
|
153
|
-
fence (three backticks + `gate`), a `# Gate` heading or a `# Files` heading in any text field —
|
|
154
|
-
the API rejects that.
|
|
151
|
+
Never pass `parallelGroup`; it is ignored. The API writes the frontmatter, `# Files` and
|
|
152
|
+
`# Gate` (PRD_AUTHORING.md §6, What the API writes).
|
|
155
153
|
|
|
156
154
|
### gate and files rules
|
|
157
155
|
|
|
@@ -165,9 +163,7 @@ can apply, because they depend on the repo at authoring time:
|
|
|
165
163
|
on the base parks the job as `sentinel_fail` whatever the executor does.
|
|
166
164
|
2. Never put a step only a human or the passage of time can complete (host cron install,
|
|
167
165
|
waiting for a live post, a live payment, an account dashboard action) in a gate or
|
|
168
|
-
criterion; keep them out of PRDs at authoring time.
|
|
169
|
-
`SCHEDULER_VERDICT: FAIL` naming what is missing. Why: no executor can pass such a gate,
|
|
170
|
-
and queued work runs with no questions asked.
|
|
166
|
+
criterion; keep them out of PRDs at authoring time (PRD_AUTHORING.md §14, No human-only gates).
|
|
171
167
|
Live-run steps that need gitignored state follow PRD_AUTHORING.md §7 (absolute main-checkout
|
|
172
168
|
paths, artifact-only).
|
|
173
169
|
|
|
@@ -197,16 +193,23 @@ End every plan with exactly one validate PRD:
|
|
|
197
193
|
4. Criteria: one per PRD, citing it by slug
|
|
198
194
|
(under `$SM_PROJECT_ROOT/session-manager-operations/scheduler/epics/<epic-id>/`; find it by
|
|
199
195
|
slug under prds/ or prds-archived/, possibly a timestamped subfolder. Why: runtime namespaces such as `session-manager-operations/scheduler/` carry their own `.gitignore`
|
|
200
|
-
(runtime-ops-namespaces-self-ignore), so they are never in the validator's job worktree. The last: write
|
|
201
|
-
`session-manager-operations/
|
|
202
|
-
(`git rev-parse --show-toplevel`), not to any subdirectory you `cd`'d into to run a gate.
|
|
196
|
+
(runtime-ops-namespaces-self-ignore), so they are never in the validator's job worktree. The last: write
|
|
197
|
+
`session-manager-operations/plan-records/<epic-id>/<validate-slug>.md`, relative to the repository root
|
|
198
|
+
(`git rev-parse --show-toplevel`), not to any subdirectory you `cd`'d into to run a gate. Never
|
|
199
|
+
commit it; the scheduler copies it to the main checkout.
|
|
203
200
|
5. Notes: "Work as the validator persona — the procedure is your system prompt." and a line
|
|
204
201
|
`Base: <sha>`, the SHA from step 11.
|
|
205
|
-
6. `gate: ["none"]`; `files`: the record path
|
|
202
|
+
6. `gate: ["none"]`; `files`: the record path
|
|
203
|
+
`session-manager-operations/plan-records/<epic-id>/<validate-slug>.md`. It is never committed:
|
|
204
|
+
the API declares the PRD artifact-only. Why: the validator re-runs each PRD's gate
|
|
206
205
|
itself, and a REFUTED PRD is still a successful validation.
|
|
207
206
|
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
A per-run record from any other PRD (ship, deploy, audit) also goes under
|
|
208
|
+
`session-manager-operations/plan-records/<epic-id>/`; never name a git-ignored ops path in `files` to get it force-added.
|
|
209
|
+
|
|
210
|
+
The validator returns a checked JSON verdict (`VERIFIED` or `REFUTED` with a reason, per PRD). The
|
|
211
|
+
scheduler saves it as `session-manager-operations/plan-records/<epic-id>/<validate-slug>.verdicts.json`, and
|
|
212
|
+
`GET /admin/epic` serves it as `verdicts`. Queue the validate PRD in the same `scheduler_create_prds` call as the plan (its `dependsOn` may name that call's entries); with single creates it goes last: in a single `scheduler_create_prd`, `dependsOn` accepts only slugs that already exist. The
|
|
210
213
|
scheduler sends no per-PRD validation prompt. When the Epic has no pending or running PRD for
|
|
211
214
|
`SM_EPIC_SETTLE_SECONDS` (default 120), it queues one `validate-sweep-*` validator for completed
|
|
212
215
|
PRDs no validator checked (a large sweep becomes several sweeps in turn), then sends one PLAN SETTLED digest. Several validators in one Epic
|
|
@@ -221,8 +224,8 @@ here. Never write the record yourself.
|
|
|
221
224
|
The scheduler heals most parks itself:
|
|
222
225
|
|
|
223
226
|
1. Verdict-line parks (verdicts no_verdict_sentinel,
|
|
224
|
-
abandoned_background_task) complete
|
|
225
|
-
|
|
227
|
+
abandoned_background_task) complete on their own once the conditions in PRD_AUTHORING.md
|
|
228
|
+
§13 hold.
|
|
226
229
|
2. Stray-checkout parks (the main checkout was on another branch) are re-landed onto the base
|
|
227
230
|
branch ref without touching the checkout.
|
|
228
231
|
3. needs_review notices are held and grouped per Epic and cause. One notice is sent only when
|
|
@@ -252,7 +255,9 @@ Rules:
|
|
|
252
255
|
safest reasonable choice, and report it. Why: queued work runs with no questions asked.
|
|
253
256
|
2. **A PLAN SETTLED digest.** Read the validator records it names. A `REFUTED` PRD, or a
|
|
254
257
|
Critical or Important finding, means a fix wave: one `behavior` or `wire` PRD per finding
|
|
255
|
-
plus a new validate PRD. Never fix inline.
|
|
258
|
+
plus a new validate PRD. Never fix inline. Every fix PRD sets `fixes: [{ prd, missKind, reason }]`,
|
|
259
|
+
one entry per PRD it repairs, including a PRD a validator `VERIFIED` whose bug was found later
|
|
260
|
+
(an escape). Why: escapes are counted from `fixes`. The new validate PRD has one criterion per fix
|
|
256
261
|
PRD and one per PRD the earlier validator marked `REFUTED`, each cited by slug. Why: a
|
|
257
262
|
refuted PRD keeps its Epic blocked until a validator verifies that same PRD. A PRD marked
|
|
258
263
|
`REFUTED` again after its fix wave, on the same criterion, gets no third fix wave: list it
|
|
@@ -260,15 +265,20 @@ Rules:
|
|
|
260
265
|
to decide. Why: a second miss on the same criterion means the plan is wrong, and another
|
|
261
266
|
wave would repeat it. A Not validated list means validate exactly those PRDs here. All
|
|
262
267
|
`VERIFIED` with nothing open means Done: write the final report.
|
|
268
|
+
3. **A `PRECONDITION HOLD` notice** is not a park and not a fix-wave trigger. Do nothing — no
|
|
269
|
+
reset, no edit, no fix PRD; the scheduler re-checks the preflight on its own. State the
|
|
270
|
+
missing precondition in the report. Why: only a person can supply it.
|
|
263
271
|
4. **Done** = the latest validator marked every PRD `VERIFIED`, including each PRD an earlier
|
|
264
|
-
validator refuted, no Critical or Important finding is open, and its record
|
|
272
|
+
validator refuted, no Critical or Important finding is open, and its record exists in the main checkout's
|
|
273
|
+
`session-manager-operations/plan-records/<epic-id>/`.
|
|
265
274
|
Never "done with caveats": a REFUTED PRD gets a fix wave, or after its second refutation an
|
|
266
275
|
open entry in the final report for the human to decide.
|
|
267
276
|
|
|
268
277
|
### Final report
|
|
269
278
|
|
|
270
279
|
1. What landed: each PRD slug and its commit.
|
|
271
|
-
2. The validation record path
|
|
280
|
+
2. The validation record path; the record exists in the main checkout's
|
|
281
|
+
`session-manager-operations/plan-records/<epic-id>/`.
|
|
272
282
|
3. Minor findings deferred.
|
|
273
283
|
4. Anything still open.
|
|
274
284
|
5. Any warning kept or validator skipped.
|
|
@@ -12,7 +12,7 @@ description: >-
|
|
|
12
12
|
|
|
13
13
|
# maintaining-md-network
|
|
14
14
|
|
|
15
|
-
**Goal:** every agent that works on or with this project starts from one short entry map, follows links to a few
|
|
15
|
+
**Goal:** every agent that works on or with this project starts from one short entry map, follows links to a few topic docs, and finds each fact in exactly one place, with nothing stale.
|
|
16
16
|
|
|
17
17
|
## Inputs
|
|
18
18
|
|
|
@@ -34,12 +34,13 @@ All three count for reachability in Project Home's link map and in drift-check's
|
|
|
34
34
|
|
|
35
35
|
## References
|
|
36
36
|
|
|
37
|
-
Each is one level deep; none links another.
|
|
37
|
+
Each is one level deep; none links another, except audit.md's census step, which links placement.md's pair rule.
|
|
38
38
|
|
|
39
39
|
- [placement.md](placement.md): read when deciding where a kind of instruction belongs, or what moves into a skill, rule, hook or subagent.
|
|
40
40
|
- [audit.md](audit.md): read for steps 1-4 (census, audiences, links, truth check), the time box and the subagent brief.
|
|
41
|
-
- [plan.md](plan.md): read for the report contents, verdicts,
|
|
41
|
+
- [plan.md](plan.md): read for the report contents, verdicts, history and runtime state, the `/develop` order and cross-repo routing.
|
|
42
42
|
- [drift-check.md](drift-check.md): read for Drift check mode, running the script and the review record.
|
|
43
|
+
- [migrate-to-agents-md.md](migrate-to-agents-md.md): read when moving a project's CLAUDE.md text into AGENTS.md.
|
|
43
44
|
|
|
44
45
|
The script is `<skill base dir>/scripts/drift-check.cjs`.
|
|
45
46
|
|
|
@@ -53,7 +54,7 @@ Full review
|
|
|
53
54
|
- [ ] 2. Audiences and entry points (audit.md)
|
|
54
55
|
- [ ] 3. Links and consumers (audit.md)
|
|
55
56
|
- [ ] 4. Truth check against code and config (audit.md)
|
|
56
|
-
- [ ] 5. Report: proposed network, one-
|
|
57
|
+
- [ ] 5. Report: proposed network, one-home table, verdicts, placement, maintenance plan (plan.md, placement.md)
|
|
57
58
|
- [ ] 6. After approval, plan with /develop in the order plan.md gives; commit the review record (plan.md, drift-check.md)
|
|
58
59
|
- [ ] 7. Route cross-repo findings (plan.md)
|
|
59
60
|
```
|
|
@@ -59,14 +59,16 @@ Record these fields for each file:
|
|
|
59
59
|
|
|
60
60
|
Do the lines and dates in one pass over the file list, not one command per file by hand. Find the writer of a suspect file with `git grep -n "<file name>" -- '*.js' '*.cjs' '*.ts' '*.py' '*.sh'`.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
Check each CLAUDE.md and AGENTS.md pair, at the root and in every folder, against the pair rule in [placement.md](placement.md#agentsmd-and-claudemd). Report each pair that breaks it.
|
|
63
|
+
|
|
64
|
+
Then report the share of markdown that is machine-written history or runtime state: files and lines of that kind, divided by all markdown files and lines. The drift-check script does not compute this share. Compute it by hand, per top-level folder:
|
|
63
65
|
|
|
64
66
|
```
|
|
65
67
|
git ls-files -- '*.md' | cut -d/ -f1 | sort | uniq -c
|
|
66
68
|
git ls-files -z -- '*.md' | xargs -0 wc -l | sort -n
|
|
67
69
|
```
|
|
68
70
|
|
|
69
|
-
The first command counts tracked markdown files per top-level folder (files in the repo root show as their own name). In the second, sum the lines per folder and read the last `total` line for all markdown. Mark each folder as docs,
|
|
71
|
+
The first command counts tracked markdown files per top-level folder (files in the repo root show as their own name). In the second, sum the lines per folder and read the last `total` line for all markdown. Mark each folder as docs, history or state by the writer check above, then divide. Run the same two commands with `--others --exclude-standard` for untracked files. History and state are not docs. Keep them out of the topic-doc plan, and never propose deleting state that a program reads.
|
|
70
72
|
|
|
71
73
|
## 2. Audiences and entry points
|
|
72
74
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- [Running the script](#running-the-script)
|
|
6
6
|
- [Path conventions](#path-conventions)
|
|
7
|
-
- [First run: exclude
|
|
7
|
+
- [First run: exclude history](#first-run-exclude-history)
|
|
8
8
|
- [Drift check mode](#drift-check-mode)
|
|
9
9
|
- [Review record](#review-record)
|
|
10
10
|
- [The map's maintainer comment](#the-maps-maintainer-comment)
|
|
@@ -22,10 +22,10 @@ node <skill base dir>/scripts/drift-check.cjs --root <repo>
|
|
|
22
22
|
| Flag | Meaning |
|
|
23
23
|
| --- | --- |
|
|
24
24
|
| `--root <dir>` | Repo to check. Defaults to the current directory. Must be a directory. |
|
|
25
|
-
| `--map <path>` | The entry map. Default: the first file that holds the maintainer comment, searched in this order: the root CLAUDE.md, the root AGENTS.md, then the `.md` files those two import directly with at-sign imports (see below). |
|
|
25
|
+
| `--map <path>` | The entry map. Default: the first file that holds the maintainer comment, searched in this order: the root CLAUDE.md, the root AGENTS.md, then the `.md` files those two import directly with at-sign imports (see below). When the root CLAUDE.md is a stub (its first non-blank line is `@AGENTS.md`), the root AGENTS.md is searched first, and it is the map if no file holds the comment. |
|
|
26
26
|
| `--file <path>` | Check only this file. Repeat for each file. Default: every tracked `.md` file (all `.md` files outside `.git` and `node_modules` when the repo is not git). |
|
|
27
27
|
| `--exclude <prefix>` | Skip files whose repo-relative path starts with the prefix. Repeat as needed. |
|
|
28
|
-
| `--checks <list>` | Comma list from `links`, `paths`, `limits`, `contents`, `orphans`. Default: the first
|
|
28
|
+
| `--checks <list>` | Comma list from `links`, `paths`, `limits`, `contents`, `pairs`, `orphans`, `duplicates`. Default: the first five. `pairs` checks the AGENTS.md pair layout (a CLAUDE.md stub that imports the AGENTS.md beside it). `orphans` is opt-in: it reports docs the root CLAUDE.md never reaches, by the [link convention](SKILL.md#what-counts-as-a-link) in SKILL.md. `duplicates` is opt-in: it reports pairs of checked docs that share the same text. |
|
|
29
29
|
| `--strict-paths` | Report `unanchored-path` findings, and treat a link starting with `/` that matches no file as broken. Off by default. |
|
|
30
30
|
|
|
31
31
|
A flag that needs a value fails if the value is missing or starts with `--`.
|
|
@@ -52,7 +52,11 @@ One JSON object on stdout, with its keys in this order:
|
|
|
52
52
|
| `unanchored-path` | file, line, target, matches | Only with `--strict-paths`. The span does not resolve from the root or the doc, but tracked files match it as a path suffix or folder. The doc names the path without its full prefix. |
|
|
53
53
|
| `over-line-limit` | file, lines, expandedLines, limit | A CLAUDE.md, AGENTS.md or unscoped `.claude/rules` file has more than 200 lines, or the map has more than 70. `expandedLines` counts the file plus every `.md` it pulls in with an at-sign import (up to 4 hops, each file once); the limit applies to `expandedLines`. |
|
|
54
54
|
| `no-contents-list` | file, lines | A doc over 100 lines has no Contents heading and no list of anchor links near the top. |
|
|
55
|
-
| `
|
|
55
|
+
| `claude-md-stub-missing-import` | file | Check `pairs`. A CLAUDE.md has an AGENTS.md in the same folder, but its first non-blank line is not `@AGENTS.md`. Claude Code then never loads that AGENTS.md. |
|
|
56
|
+
| `agents-md-not-loaded` | file | Check `pairs`. An AGENTS.md has no CLAUDE.md in its folder while the repo root has a CLAUDE.md. Claude Code never auto-loads it; add a CLAUDE.md stub whose first line is `@AGENTS.md`. |
|
|
57
|
+
| `fact-in-both` | file, claudeFile, agentsFile, line, agentsLine, text | Check `pairs`. A non-blank, non-heading line outside code fences is in both files of a CLAUDE.md / AGENTS.md pair after the duplicate check's normalization (`mdDuplicates.cjs` `normalize`). `file` = `claudeFile`; `line` is its line in CLAUDE.md, `agentsLine` its line in AGENTS.md. Keep it in AGENTS.md only. |
|
|
58
|
+
| `orphan` | file | Only with `--checks orphans` (opt-in). No chain of references from the root CLAUDE.md reaches this checked doc, by SKILL.md's [link convention](SKILL.md#what-counts-as-a-link): markdown links and `<x.md>` autolinks, backticked `.md` paths (repo-root form first, then doc-relative) and at-sign imports, outside fences and HTML comments. All tracked docs carry reachability; `--exclude` and `--file` only limit what is reported. No root CLAUDE.md adds a note instead. Keep history collections out with `--exclude`. |
|
|
59
|
+
| `duplicate` | file, other, sharedRuns, detail (also `type: 'duplicate'`) | Only with `--checks duplicates` (opt-in). Two checked docs share at least 10 distinct runs of 8 consecutive words (`scripts/mdDuplicates.cjs` `findDuplicates`, the same function the app's scan runs); `file` is the first doc in path order, `other` the second. Code fences and link targets are ignored; text found in more than 6 docs is boilerplate and skipped. Keep history collections out with `--exclude`. |
|
|
56
60
|
|
|
57
61
|
Links and code spans inside fenced code blocks and HTML comments are ignored.
|
|
58
62
|
|
|
@@ -62,7 +66,7 @@ Rules the script applies:
|
|
|
62
66
|
- Site route: a link starting with a single slash that does not exist under the repo root is treated as a website route and skipped. `--strict-paths` turns that skip off.
|
|
63
67
|
- Ignore marker: a line that contains the marker `<!-- drift-check-ignore -->` is skipped by the link and path checks.
|
|
64
68
|
- Ellipsis rule: a span with a `...` segment, such as src/.../x.ts, is a placeholder and is skipped.
|
|
65
|
-
- Map detection: without `--map`, the script looks for the maintainer comment in the root CLAUDE.md and AGENTS.md, then in the `.md` files inside the repo that they import directly with at-sign imports. Only those direct imports (one hop) are searched, not the files they import in turn. The first file with the comment is the map.
|
|
69
|
+
- Map detection: without `--map`, the script looks for the maintainer comment in the root CLAUDE.md and AGENTS.md, then in the `.md` files inside the repo that they import directly with at-sign imports. Only those direct imports (one hop) are searched, not the files they import in turn. The first file with the comment is the map. When the root CLAUDE.md's first non-blank line is `@AGENTS.md` and the root AGENTS.md exists, AGENTS.md is searched first, and with no comment anywhere it is the map.
|
|
66
70
|
|
|
67
71
|
## Path conventions
|
|
68
72
|
|
|
@@ -78,11 +82,11 @@ Template placeholders: the links check skips a link target that contains double
|
|
|
78
82
|
|
|
79
83
|
Template folders: a folder of templates, such as docs/templates, holds relative links that only resolve once the template is rendered somewhere else. Pass each such folder as its own `--exclude` prefix, and record the flag in the review record's Drift-check command line.
|
|
80
84
|
|
|
81
|
-
## First run: exclude
|
|
85
|
+
## First run: exclude history
|
|
82
86
|
|
|
83
|
-
Machine-written
|
|
87
|
+
Machine-written history and runtime folders (job logs, archived PRDs, review records, generated reports) hold thousands of stale path mentions and drown real findings. On the first Full review:
|
|
84
88
|
|
|
85
|
-
1. From the census, list every
|
|
89
|
+
1. From the census, list every history and runtime folder.
|
|
86
90
|
2. Pass each one as its own `--exclude` prefix, for example `--exclude <folder>/`.
|
|
87
91
|
3. Run the script. If findings still come mostly from one folder, exclude it too.
|
|
88
92
|
4. Write the exact flags into the review record's Drift-check command line.
|
|
@@ -132,7 +136,7 @@ Drift check mode reviews only what changed since the last review.
|
|
|
132
136
|
|
|
133
137
|
Every review, Full or Drift check, ends with one dated record, committed with the work. It is the next drift check's baseline.
|
|
134
138
|
|
|
135
|
-
Path: session-manager-operations/reviews/docs/<YYYY-MM-DD>-md-network.md (or the project's own reviews folder). Use one record per day; a second record on the same date takes a -2 suffix (and -3, and so on). Commit it last, so Base commit is the commit just before it.
|
|
139
|
+
Path: session-manager-operations/reviews/docs/<YYYY-MM-DD>-md-network.md (or the project's own reviews folder). Use one record per day; a second record on the same date takes a -2 suffix (and -3, and so on). Commit it last, so Base commit is the commit just before it. When `git check-ignore -q <record path>` exits 0, git ignores the path: do not commit or force-add the record, and set Base commit to HEAD.
|
|
136
140
|
|
|
137
141
|
Template:
|
|
138
142
|
|
|
@@ -152,9 +156,9 @@ Template:
|
|
|
152
156
|
|
|
153
157
|
## Verdicts
|
|
154
158
|
|
|
155
|
-
| Doc | Verdict |
|
|
159
|
+
| Doc | Verdict | Topic doc |
|
|
156
160
|
| --- | --- | --- |
|
|
157
|
-
| <path> | KEEP-
|
|
161
|
+
| <path> | KEEP-TOPIC / MERGE-INTO / SHRINK-TO-POINTER / MOVE-TO-OWNING-REPO / DELETE | <doc that owns the facts> |
|
|
158
162
|
|
|
159
163
|
## Decisions
|
|
160
164
|
|
|
@@ -187,7 +191,7 @@ The map carries one HTML comment, so the script and the next reviewer can find i
|
|
|
187
191
|
|
|
188
192
|
Put the comment in the map file itself. The map may be an imported file: when the root CLAUDE.md pulls in docs/map.md with an at-sign import, the comment goes in docs/map.md.
|
|
189
193
|
|
|
190
|
-
Without `--map`, the script searches the root CLAUDE.md, then the root AGENTS.md, then the `.md` files those two import directly with at-sign imports. The first file that has the comment is the map, and it gets the 70-line limit.
|
|
194
|
+
Without `--map`, the script searches the root CLAUDE.md, then the root AGENTS.md, then the `.md` files those two import directly with at-sign imports. The first file that has the comment is the map, and it gets the 70-line limit. A root CLAUDE.md stub (first non-blank line `@AGENTS.md`) puts the root AGENTS.md first, and makes it the map when no file has the comment.
|
|
191
195
|
|
|
192
196
|
Do not put the comment in a CLAUDE.md that only imports the map. That makes CLAUDE.md the map, so CLAUDE.md plus everything it imports is held to the 70-line limit, and the real map gets no limit of its own. On the Bilko repo, moving the comment from docs/map.md to CLAUDE.md gave a false over-line-limit finding: CLAUDE.md had 45 lines, 93 with its imports, against a limit of 70.
|
|
193
197
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Migrate to AGENTS.md
|
|
2
|
+
|
|
3
|
+
Move a project's instruction text from CLAUDE.md into AGENTS.md, and leave CLAUDE.md as a thin stub.
|
|
4
|
+
|
|
5
|
+
Each project migrates in its own Epic (Self, Burrow, Bilko and the rest). Never move another project's files from here.
|
|
6
|
+
|
|
7
|
+
Steps:
|
|
8
|
+
|
|
9
|
+
1. Run `git mv CLAUDE.md AGENTS.md`.
|
|
10
|
+
2. Write a new CLAUDE.md that contains the line `@AGENTS.md`.
|
|
11
|
+
3. Move any line that is true for Claude Code alone out of AGENTS.md and into CLAUDE.md, below the import.
|
|
12
|
+
4. Turn every `@`-import inside AGENTS.md into a markdown link. Other tools do not follow `@`-imports.
|
|
13
|
+
5. Repeat steps 1-4 in every scoped folder that has its own CLAUDE.md.
|
|
14
|
+
6. Count both files of each pair in any size budget.
|
|
15
|
+
7. Run the drift-check script: `node <skill base dir>/scripts/drift-check.cjs --root <repo>`.
|
|
@@ -2,12 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Use this to decide where each kind of instruction belongs, and cite the source for every move a review proposes.
|
|
4
4
|
|
|
5
|
+
## Doc kinds
|
|
6
|
+
|
|
7
|
+
Every doc is one of five kinds. A kind says how a doc is used, never who owns it.
|
|
8
|
+
|
|
9
|
+
- **Map.** The root CLAUDE.md or AGENTS.md. It holds one-line rules and links, and it loads every session.
|
|
10
|
+
- **Folder notes.** A CLAUDE.md inside a folder. It holds only that folder's facts. It never restates a root rule.
|
|
11
|
+
- **Topic docs.** The one doc per topic that holds its full text. Everything else links to it.
|
|
12
|
+
- **Agent files.** Personas (subagent definitions), skills, plugin packs (a plugin plus its always-on rules), commands. They load by name. They link to topic docs instead of copying them.
|
|
13
|
+
- **History.** Dated reports and logs. They are never edited, and they are never the current answer. A finding that still matters moves into its topic doc.
|
|
14
|
+
|
|
15
|
+
Rules:
|
|
16
|
+
|
|
17
|
+
- One topic, one topic doc.
|
|
18
|
+
- Code owns every list. A doc names the file or command that holds the list; it does not copy it.
|
|
19
|
+
- A rule a check enforces gets one line that names the check.
|
|
20
|
+
- Every doc belongs to the project, whoever wrote it. It must read sensibly to the project's owner.
|
|
21
|
+
|
|
5
22
|
## Where each kind belongs
|
|
6
23
|
|
|
7
24
|
| Kind of instruction | Put it in | Rule and source |
|
|
8
25
|
| --- | --- | --- |
|
|
9
26
|
| Map, commands Claude must run, critical gotchas | Root CLAUDE.md or AGENTS.md | Loaded every session, so keep it under 200 lines. Hold only pointers, the commands Claude must run and critical gotchas: only what an agent can't find in the code. Sources: memory, large-codebases blog. |
|
|
10
|
-
| Both CLAUDE.md and AGENTS.md exist
|
|
27
|
+
| Both CLAUDE.md and AGENTS.md exist, at the root or in any folder | AGENTS.md holds the text; CLAUDE.md is a stub that starts with `@AGENTS.md` | The pair rule. Full text: [AGENTS.md and CLAUDE.md](#agentsmd-and-claudemd). Sources: Claude CLI 2.1.325, Codex AGENTS.md guide. |
|
|
11
28
|
| Project structure, file listings and feature tours | A directory pointer, or a command that prints the listing | The code is the source of truth, and a hand-kept tour in CLAUDE.md drifts. Replace the tour with one line naming the directory, or with a command such as `git ls-files <dir>`. This applies to small apps too. Sources: best-practices, large-codebases blog. |
|
|
12
29
|
| Conventions for one folder | That folder's CLAUDE.md, or a `.claude/rules` file with `paths:` frontmatter | Folder files load when Claude works there; path-scoped rules load only when matching files are touched. Sources: memory, steering article. |
|
|
13
30
|
| Procedures: releases, deploys, review checklists | A skill | A skill loads on demand, so its steps cost nothing until used. Sources: skills best practices, steering article. |
|
|
@@ -15,7 +32,36 @@ Use this to decide where each kind of instruction belongs, and cite the source f
|
|
|
15
32
|
| Noisy side research | A subagent that returns a short summary | The subagent reads in its own context and hands back only the conclusion. Sources: best-practices, context-engineering article. |
|
|
16
33
|
| Notes for human maintainers | An HTML block comment (`<!-- ... -->`) | Block comments are stripped before the file loads, so they cost no context. Source: memory. |
|
|
17
34
|
| Progress records and history | Progress files and git history | Let the next session read them to pick up where the last stopped. Source: long-running harnesses article. |
|
|
18
|
-
|
|
|
35
|
+
| Maintainer of a doc | One named maintainer per doc, reviewed every 3-6 months | Assign an owner so the doc is not left to drift. Source: large-codebases blog. |
|
|
36
|
+
|
|
37
|
+
## AGENTS.md and CLAUDE.md
|
|
38
|
+
|
|
39
|
+
The pair rule:
|
|
40
|
+
|
|
41
|
+
- AGENTS.md holds every instruction line of its folder. The root AGENTS.md is the entry map.
|
|
42
|
+
- A CLAUDE.md beside it starts with the line `@AGENTS.md`.
|
|
43
|
+
- Below that line, CLAUDE.md may add only lines true for Claude Code alone. It never repeats a line AGENTS.md already states.
|
|
44
|
+
- The same pair rule applies in every scoped folder.
|
|
45
|
+
- Size budgets count the pair together: AGENTS.md plus its CLAUDE.md.
|
|
46
|
+
- AGENTS.md links with markdown links, not `@`-imports. Codex and other tools do not follow `@`-imports.
|
|
47
|
+
|
|
48
|
+
Why the stub: verified facts, Claude CLI 2.1.325 (binary and live `claude -p` runs):
|
|
49
|
+
|
|
50
|
+
- Option `instructionFiles`: `claude-md`, `claude-md-or-agents-md` (default), `claude-md-and-agents-md`, `managed-only`.
|
|
51
|
+
- Default mode: a project with only AGENTS.md gets it loaded.
|
|
52
|
+
- Default mode: if the project's CLAUDE.md does not import AGENTS.md, AGENTS.md is never seen.
|
|
53
|
+
- Default mode: a CLAUDE.md that is just `@AGENTS.md` loads it.
|
|
54
|
+
- Nested: in a project with any CLAUDE.md, a nested AGENTS.md alone is never auto-loaded.
|
|
55
|
+
- Nested: a nested CLAUDE.md stub (`@AGENTS.md`) beside it loads it when Claude reads that folder.
|
|
56
|
+
- CLAUDE.md, `.claude/CLAUDE.md` and CLAUDE.local.md at or above the root all count as "has a CLAUDE.md". A stray CLAUDE.local.md silently turns the AGENTS.md fallback off.
|
|
57
|
+
- So the stub makes the pair load in every mode except `managed-only`, and also on older CLIs and in `claude-md` mode.
|
|
58
|
+
- In `claude-md-and-agents-md` mode, an imported AGENTS.md is not loaded twice.
|
|
59
|
+
|
|
60
|
+
Codex facts (developers.openai.com/codex/guides/agents-md):
|
|
61
|
+
|
|
62
|
+
- Codex reads AGENTS.md, then any `project_doc_fallback_filenames`, once per folder from the git root down to the cwd.
|
|
63
|
+
- It reads them at start only, up to `project_doc_max_bytes` (32 KiB by default).
|
|
64
|
+
- It does not follow `@`-imports.
|
|
19
65
|
|
|
20
66
|
## Size and load rules
|
|
21
67
|
|
|
@@ -37,3 +83,5 @@ Use this to decide where each kind of instruction belongs, and cite the source f
|
|
|
37
83
|
- https://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start: root file holds pointers only, assign an owner, review every 3-6 months.
|
|
38
84
|
- https://claude.com/resources/articles/steering-claude-code-skills-hooks-rules-subagents-and-more: which mechanism fits which kind of instruction (rules, skills, hooks, subagents).
|
|
39
85
|
- https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents: progress records and git history serve as memory across sessions.
|
|
86
|
+
- https://developers.openai.com/codex/guides/agents-md: how Codex finds and reads AGENTS.md.
|
|
87
|
+
- Claude CLI 2.1.325 binary and live `claude -p` runs: the `instructionFiles` modes and the AGENTS.md load behaviour above.
|
|
@@ -6,7 +6,7 @@ Use this after the audit steps. It sets what the review report must contain, how
|
|
|
6
6
|
|
|
7
7
|
- [Report](#report)
|
|
8
8
|
- [Verdicts](#verdicts)
|
|
9
|
-
- [
|
|
9
|
+
- [History and runtime state](#history-and-runtime-state)
|
|
10
10
|
- [After approval](#after-approval)
|
|
11
11
|
- [Other repos](#other-repos)
|
|
12
12
|
|
|
@@ -17,10 +17,10 @@ Write one report. Include every item below.
|
|
|
17
17
|
1. **The proposed network.**
|
|
18
18
|
- One map of at most 70 lines.
|
|
19
19
|
- One entry point per audience.
|
|
20
|
-
- The fewest
|
|
20
|
+
- The fewest topic docs that cover the rest.
|
|
21
21
|
- A contents list on every reference doc over 100 lines.
|
|
22
|
-
- Links one level deep from the map: the map links to
|
|
23
|
-
2. **A one-
|
|
22
|
+
- Links one level deep from the map: the map links to a topic doc, and the topic doc does not need another hop to answer the question.
|
|
23
|
+
2. **A one-home table.** Add a row for every fact that appears in more than one doc. Give the owning doc, the docs that must lose the fact, and the single term used for the concept. Use one term per concept across the whole network.
|
|
24
24
|
3. **What moves out of the always-loaded files.** Name each item and its destination: a skill, a path-scoped rule, a hook, a permission rule or a subagent.
|
|
25
25
|
4. **Wrong claims and bugs.** List each claim that would mislead an agent, with the evidence as `file:line`. List bugs found in code, config or scripts while checking.
|
|
26
26
|
5. **A maintenance plan.**
|
|
@@ -35,8 +35,8 @@ Give every doc exactly one verdict.
|
|
|
35
35
|
|
|
36
36
|
| Verdict | Meaning |
|
|
37
37
|
| --- | --- |
|
|
38
|
-
| KEEP-
|
|
39
|
-
| MERGE-INTO `<doc>` | The doc's facts belong in another
|
|
38
|
+
| KEEP-TOPIC | The doc is the single owner of its facts. Keep it and trim copies of other docs' facts out of it. |
|
|
39
|
+
| MERGE-INTO `<doc>` | The doc's facts belong in another topic doc. Move them there, then remove the doc and repoint every link. |
|
|
40
40
|
| SHRINK-TO-POINTER | Reduce the doc to a few lines that point to the owner. Use this when a link, a heading cited by name or a program still needs the path. |
|
|
41
41
|
| MOVE-TO-OWNING-REPO | The facts belong to another repo. Hand them over as described in Other repos. |
|
|
42
42
|
| DELETE | Remove the doc. Allowed only under the rule below. |
|
|
@@ -49,23 +49,23 @@ DELETE is allowed only when all three hold:
|
|
|
49
49
|
|
|
50
50
|
Git history keeps everything else. When any one of the three fails, choose SHRINK-TO-POINTER or MERGE-INTO instead.
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## History and runtime state
|
|
53
53
|
|
|
54
54
|
Some markdown is written by a program: logs, queue records, generated reports, state files. Count it in the census, and report its share of all markdown.
|
|
55
55
|
|
|
56
56
|
- Never delete state a program reads.
|
|
57
57
|
- Leave untracking to the tool that owns it. Do not run `git rm --cached` or edit ignore rules for files another tool writes. Name the owner and the finding in the report.
|
|
58
|
-
- Keep machine-written files out of the map and out of the
|
|
58
|
+
- Keep machine-written files out of the map and out of the topic docs.
|
|
59
59
|
|
|
60
60
|
## After approval
|
|
61
61
|
|
|
62
62
|
Plan the work with `/develop`, in this order:
|
|
63
63
|
|
|
64
64
|
1. **Delete obsolete docs.** Only docs with the DELETE verdict.
|
|
65
|
-
2. **One PRD per
|
|
65
|
+
2. **One PRD per topic doc.** Each PRD moves that doc's facts into it and removes the same facts from the entry files in the same commit.
|
|
66
66
|
3. **Rewrite the map and entry files.** This PRD depends on all of step 2.
|
|
67
67
|
4. **Change any tool that serves docs.** Add the drift-check script as a gate or CI step.
|
|
68
|
-
5. **Validate.** Re-run the drift-check script and record the flags you used in the review record. Run `git grep -n -F -e "<old name>" -e "<old path>"` with no file-type filter for every deleted or renamed doc, so code strings, scripts and tool descriptions are covered, not only markdown links. Open each audience's entry point to confirm it reaches its
|
|
68
|
+
5. **Validate.** Re-run the drift-check script and record the flags you used in the review record. Run `git grep -n -F -e "<old name>" -e "<old path>"` with no file-type filter for every deleted or renamed doc, so code strings, scripts and tool descriptions are covered, not only markdown links. Open each audience's entry point to confirm it reaches its topic docs.
|
|
69
69
|
|
|
70
70
|
Links must resolve for every audience. Tools that return text verbatim need repo-root paths. Commit a dated review record in the format drift-check.md defines, as the next drift check's baseline.
|
|
71
71
|
|