claude-code-session-manager 0.97.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/bin/cli.cjs +16 -4
- package/bin/node-floor.cjs +41 -0
- package/dist/assets/{DataModel-D93FoaOm.js → DataModel-HdR0AxFq.js} +1 -1
- package/dist/assets/{History-CXxxqNP1.js → History-Dr4Jr_5z.js} +2 -2
- package/dist/assets/{Hooks-CzeYFQjq.js → Hooks-NhrvH3JP.js} +3 -3
- package/dist/assets/{Library-D2zPkwOC.js → Library-Dv_EtIMr.js} +1 -1
- package/dist/assets/{MarkdownEditor-DbinP78A.js → MarkdownEditor-DTKDWV_n.js} +1 -1
- package/dist/assets/{McpServers-Bu_sVGLr.js → McpServers-M034G9B3.js} +2 -2
- package/dist/assets/{Memory-BgiI6LZ_.js → Memory-DzF1B4gx.js} +6 -6
- package/dist/assets/{Permissions-C1MMzZRm.js → Permissions-DrgbSGWl.js} +3 -3
- package/dist/assets/{Plugins-Dhu6wAZi.js → Plugins-Bd3ef35w.js} +2 -2
- package/dist/assets/{ProvenanceBadge-C3AcWKMG.js → ProvenanceBadge-DcBHT1Iy.js} +1 -1
- package/dist/assets/{SaveBar-plwYm0iO.js → SaveBar-rimJem-Y.js} +1 -1
- package/dist/assets/Scheduler-DjgFJl2w.js +16 -0
- package/dist/assets/{ScopeSwitcher-DFy0vv_o.js → ScopeSwitcher-CnAzTBrl.js} +1 -1
- package/dist/assets/Settings-Dc1F_sSg.js +3 -0
- package/dist/assets/{SkillReferenceGraph-DsI7hRPB.js → SkillReferenceGraph-B9aZDecM.js} +1 -1
- package/dist/assets/{Skills-3E748UfB.js → Skills-DRXd18gu.js} +2 -2
- package/dist/assets/{SystemPrompt-BqmfUJOd.js → SystemPrompt-ahy5-Fwe.js} +1 -1
- package/dist/assets/{TagLibrary-CPz6fO8Q.js → TagLibrary-C_tToDeL.js} +1 -1
- package/dist/assets/{TiptapBody-D9EoBQ1P.js → TiptapBody-DvdefS6K.js} +1 -1
- package/dist/assets/{Toggle-BHAmZNDn.js → Toggle-6Jl5Njc6.js} +1 -1
- package/dist/assets/{index-CKH5Uxik.css → index-Bta-hwud.css} +1 -1
- package/dist/assets/{index-tn5JIVPj.js → index-vx8O73l8.js} +497 -502
- package/dist/assets/{settingsSchema-Crqy_aNz.js → settingsSchema-D6iRguNV.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +26 -29
- package/plugins/CLAUDE.md +6 -6
- package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +23 -19
- package/plugins/session-manager-dev/skills/builder/SKILL.md +3 -3
- package/plugins/session-manager-dev/skills/develop/SKILL.md +254 -510
- package/plugins/session-manager-dev/skills/develop/standards.md +17 -22
- package/scripts/README.md +3 -11
- package/scripts/audit-ops-hygiene.cjs +3 -3
- package/scripts/hooks/lib/guard-prd-writes-policy.cjs +1 -1
- package/scripts/hooks/lib/guard-self-schedule-policy.cjs +1 -1
- package/scripts/mint-epic.cjs +2 -3
- package/scripts/scheduler-mcp-server.cjs +36 -7
- package/src/main/agentLibrary.cjs +22 -2
- package/src/main/build-info.json +4 -4
- package/src/main/config.cjs +41 -38
- package/src/main/docEdit.cjs +4 -1
- package/src/main/files.cjs +2 -5
- package/src/main/health.cjs +1 -1
- package/src/main/index.cjs +23 -10
- package/src/main/ipcSchemas.cjs +28 -35
- package/src/main/lib/agentPersonaSchema.cjs +13 -2
- package/src/main/lib/atomicFs.cjs +116 -0
- package/src/main/lib/branchSweep.cjs +13 -12
- package/src/main/lib/buildTarget.cjs +3 -3
- package/src/main/lib/claudeCliCaps.cjs +129 -0
- package/src/main/lib/credentials.cjs +2 -4
- package/src/main/lib/crossProjectFeedback.cjs +3 -3
- package/src/main/lib/cwdClassify.cjs +15 -3
- package/src/main/lib/definitionOfDone.cjs +207 -125
- package/src/main/lib/dodDrainHook.cjs +11 -5
- package/src/main/lib/epicMint.cjs +2 -4
- package/src/main/lib/epicStatusMirror.cjs +8 -10
- package/src/main/lib/epicWorktreeProjectConfig.cjs +2 -4
- package/src/main/lib/gateAuthority.cjs +96 -0
- package/src/main/lib/gitExec.cjs +69 -0
- package/src/main/lib/gitWorktree.cjs +656 -92
- package/src/main/lib/instanceLock.cjs +5 -8
- package/src/main/lib/launchFailure.cjs +2 -3
- package/src/main/lib/macroLibrary.cjs +386 -0
- package/src/main/lib/mcpToolCatalog.cjs +26 -17
- package/src/main/lib/needsReviewLedger.cjs +1 -1
- package/src/main/lib/opsErrorLog.cjs +11 -1
- package/src/main/lib/opsOwnership.cjs +0 -5
- package/src/main/lib/pidAlive.cjs +32 -0
- package/src/main/lib/prdCreate.cjs +153 -19
- package/src/main/lib/prdDisposition.cjs +2 -2
- package/src/main/lib/prdGateFiles.cjs +284 -0
- package/src/main/lib/prdLocations.cjs +61 -0
- package/src/main/lib/prdMigration.cjs +2 -3
- package/src/main/lib/prdSizing.cjs +2 -1
- package/src/main/lib/promptSessionSchema.cjs +10 -2
- package/src/main/lib/rcaReport.cjs +4 -6
- package/src/main/lib/reaperHelpers.cjs +8 -1
- package/src/main/lib/reservationExpiry.cjs +6 -1
- package/src/main/lib/reviewNotice.cjs +263 -0
- package/src/main/lib/runClaudeP.cjs +4 -1
- package/src/main/lib/schedulerPaths.cjs +22 -2
- package/src/main/lib/sessionSlots.cjs +2 -4
- package/src/main/lib/shippedPersonaSeeds.cjs +179 -0
- package/src/main/lib/timeoutShim.cjs +123 -0
- package/src/main/lib/timeoutShimScript.cjs +275 -0
- package/src/main/lib/upgradeDrain.cjs +4 -10
- package/src/main/lib/watchdogHelpers.cjs +33 -30
- package/src/main/lib/workTypeLibrary.cjs +7 -1
- package/src/main/promptSessionEvents.cjs +37 -13
- package/src/main/queueOps.cjs +17 -6
- package/src/main/scheduler.cjs +975 -203
- package/src/main/seedAgentPersonas.cjs +278 -23
- package/src/main/supervisor.cjs +4 -1
- package/src/main/templates/PRD_AUTHORING.md +126 -406
- package/src/preload/__tests__/preload-surface.test.cjs +68 -0
- package/src/preload/api.d.ts +41 -94
- package/src/preload/index.cjs +14 -9
- package/src/seed/agents/architect.md +1 -0
- package/src/seed/agents/dev-lead.md +17 -18
- package/src/seed/agents/project-home-builder.md +1 -0
- package/src/seed/agents/validator.md +10 -4
- package/dist/assets/HostBilko-nESrTRIg.js +0 -1
- package/dist/assets/Scheduler-BVYTeh39.js +0 -16
- package/dist/assets/Settings-DIhGgdfs.js +0 -3
- package/src/main/__tests__/activeIndexMerge.test.cjs +0 -235
- package/src/main/__tests__/agentEffortResolve.test.cjs +0 -117
- package/src/main/__tests__/agentLibrary.test.cjs +0 -276
- package/src/main/__tests__/agentModelResolve.test.cjs +0 -311
- package/src/main/__tests__/agentOverlayWrite.test.cjs +0 -95
- package/src/main/__tests__/bilkoHost-deriveSlug.test.cjs +0 -26
- package/src/main/__tests__/bilkoHost-integration.test.cjs +0 -118
- package/src/main/__tests__/bilkoHostCore.test.cjs +0 -72
- package/src/main/__tests__/broadcastCoalescer.test.cjs +0 -122
- package/src/main/__tests__/chat-cancel-terminal.test.cjs +0 -120
- package/src/main/__tests__/chat-dead-channels.test.cjs +0 -63
- package/src/main/__tests__/chat-exit-close-race.test.cjs +0 -146
- package/src/main/__tests__/chat-mcp-consent-notice.test.cjs +0 -139
- package/src/main/__tests__/chat-preamble-anchors.test.cjs +0 -100
- package/src/main/__tests__/chat-queue.test.cjs +0 -97
- package/src/main/__tests__/chat-stop-signal.test.cjs +0 -89
- package/src/main/__tests__/chatRunner-epic-worktree-execcwd.test.cjs +0 -125
- package/src/main/__tests__/chatRunner-session-flag-retry.test.cjs +0 -252
- package/src/main/__tests__/classifyPromptTicket.test.cjs +0 -101
- package/src/main/__tests__/classifyTranscriptLine.test.cjs +0 -201
- package/src/main/__tests__/computeDepHistorySatisfaction.test.cjs +0 -66
- package/src/main/__tests__/config-readText-bounded.test.cjs +0 -84
- package/src/main/__tests__/configWriteBoundaryOwners.test.cjs +0 -59
- package/src/main/__tests__/crossProjectFeedback.test.cjs +0 -334
- package/src/main/__tests__/crossProjectFeedbackRoutes.test.cjs +0 -161
- package/src/main/__tests__/dep-orphan-archive-health.test.cjs +0 -77
- package/src/main/__tests__/develop-skill-failure-modes.test.cjs +0 -70
- package/src/main/__tests__/docEdit.test.cjs +0 -244
- package/src/main/__tests__/dod-batchkey.test.cjs +0 -183
- package/src/main/__tests__/dod-drain-hook.test.cjs +0 -302
- package/src/main/__tests__/dod-report.test.cjs +0 -304
- package/src/main/__tests__/dod-reverify.test.cjs +0 -285
- package/src/main/__tests__/epicContextDigest.test.cjs +0 -174
- package/src/main/__tests__/epicMint.test.cjs +0 -332
- package/src/main/__tests__/epicMintTelemetryTap.test.cjs +0 -64
- package/src/main/__tests__/epicStatusMirror.test.cjs +0 -110
- package/src/main/__tests__/epicValidationHook.test.cjs +0 -291
- package/src/main/__tests__/exchanges.test.cjs +0 -122
- package/src/main/__tests__/exchangesPromptId.test.cjs +0 -61
- package/src/main/__tests__/extractJson.test.cjs +0 -51
- package/src/main/__tests__/files-reject-credentials.test.cjs +0 -40
- package/src/main/__tests__/fixtures/1218-fo-01-move-scripts-lib-into-src-main-lib.log +0 -556
- package/src/main/__tests__/flatPrdTickSweep.test.cjs +0 -110
- package/src/main/__tests__/health-build-freshness.test.cjs +0 -39
- package/src/main/__tests__/health-claude-md-budget.test.cjs +0 -57
- package/src/main/__tests__/health-credentials.test.cjs +0 -81
- package/src/main/__tests__/health-delegation-chain.test.cjs +0 -124
- package/src/main/__tests__/health-per-project-stall.test.cjs +0 -84
- package/src/main/__tests__/health-prd-migration.test.cjs +0 -37
- package/src/main/__tests__/health-queue-dispatch.test.cjs +0 -135
- package/src/main/__tests__/health-starve-escalation.test.cjs +0 -94
- package/src/main/__tests__/health-tick-liveness.test.cjs +0 -179
- package/src/main/__tests__/health-usage-poller.test.cjs +0 -144
- package/src/main/__tests__/health-worktree-cap-blocked.test.cjs +0 -65
- package/src/main/__tests__/heapSnapshot.test.cjs +0 -121
- package/src/main/__tests__/historyAggregatorIntraday.test.cjs +0 -313
- package/src/main/__tests__/historyDashboard.test.cjs +0 -163
- package/src/main/__tests__/historyRollup.test.cjs +0 -333
- package/src/main/__tests__/intradayRefresh.test.cjs +0 -39
- package/src/main/__tests__/ipcSchemas-dependsOn.test.cjs +0 -39
- package/src/main/__tests__/kg-augment.test.cjs +0 -195
- package/src/main/__tests__/loadGateDetailTick.test.cjs +0 -31
- package/src/main/__tests__/machineProfile.test.cjs +0 -152
- package/src/main/__tests__/mcpStatus.test.cjs +0 -61
- package/src/main/__tests__/memoryAggregate.test.cjs +0 -109
- package/src/main/__tests__/memoryStale.test.cjs +0 -88
- package/src/main/__tests__/needsReviewLedger.test.cjs +0 -162
- package/src/main/__tests__/openExternalApp-spawn-error.test.cjs +0 -25
- package/src/main/__tests__/opsErrorLog.test.cjs +0 -109
- package/src/main/__tests__/opsErrorLogTelemetryTap.test.cjs +0 -173
- package/src/main/__tests__/personaMerge.test.cjs +0 -169
- package/src/main/__tests__/planValidator.test.cjs +0 -125
- package/src/main/__tests__/pollLoop-dispatch-on-failure.test.cjs +0 -176
- package/src/main/__tests__/prd-group-allocator.test.cjs +0 -119
- package/src/main/__tests__/prdAdminRouteParity.test.cjs +0 -70
- package/src/main/__tests__/prdAdminRoutes.test.cjs +0 -718
- package/src/main/__tests__/prdAgentType.test.cjs +0 -103
- package/src/main/__tests__/prdAuthoringSeed.test.cjs +0 -39
- package/src/main/__tests__/prdCreate.test.cjs +0 -979
- package/src/main/__tests__/prdCreateDisposition.test.cjs +0 -201
- package/src/main/__tests__/prdCreatePlanId.test.cjs +0 -132
- package/src/main/__tests__/prdFrontmatterAgentType.test.cjs +0 -117
- package/src/main/__tests__/prdFrontmatterDependsOn.test.cjs +0 -136
- package/src/main/__tests__/prdFrontmatterDisposition.test.cjs +0 -125
- package/src/main/__tests__/prdFrontmatterQuietMachine.test.cjs +0 -108
- package/src/main/__tests__/prdLocations.test.cjs +0 -195
- package/src/main/__tests__/prdLocationsArchived.test.cjs +0 -201
- package/src/main/__tests__/prdMigration.test.cjs +0 -349
- package/src/main/__tests__/prdMigrationLegacyAdopt.test.cjs +0 -91
- package/src/main/__tests__/prdParserHighWater.test.cjs +0 -74
- package/src/main/__tests__/prdParserSourcePromptId.test.cjs +0 -65
- package/src/main/__tests__/prdSetDisposition.test.cjs +0 -222
- package/src/main/__tests__/prdSizing.test.cjs +0 -106
- package/src/main/__tests__/prdSourcePromptIdBackfill.test.cjs +0 -118
- package/src/main/__tests__/prdUpdateDependsOn.test.cjs +0 -160
- package/src/main/__tests__/proc-role-env.test.cjs +0 -125
- package/src/main/__tests__/procname-claude-spawn-sites.test.cjs +0 -304
- package/src/main/__tests__/procname-sm-processes.test.cjs +0 -127
- package/src/main/__tests__/projectHomeAdminRoutes.test.cjs +0 -177
- package/src/main/__tests__/projectPages.test.cjs +0 -137
- package/src/main/__tests__/promptSessionEvents.test.cjs +0 -234
- package/src/main/__tests__/promptSessionSchema.test.cjs +0 -101
- package/src/main/__tests__/promptSessionTranscript.test.cjs +0 -0
- package/src/main/__tests__/promptSessionsCreateEpicHandler.test.cjs +0 -159
- package/src/main/__tests__/pty-epic-worktree-spawn-cwd.test.cjs +0 -282
- package/src/main/__tests__/pty-session-open-telemetry.test.cjs +0 -96
- package/src/main/__tests__/pty-write-result.test.cjs +0 -46
- package/src/main/__tests__/queue-health-verdict.test.cjs +0 -170
- package/src/main/__tests__/queue-starvation-dispatch-driver.test.cjs +0 -286
- package/src/main/__tests__/queue-starvation-per-project.test.cjs +0 -147
- package/src/main/__tests__/queueHistory.test.cjs +0 -355
- package/src/main/__tests__/queueOps-interactive-ac-lint.test.cjs +0 -65
- package/src/main/__tests__/queueOpsArchiveDestination.test.cjs +0 -65
- package/src/main/__tests__/queueOpsAutoArchive.test.cjs +0 -154
- package/src/main/__tests__/rateLimitPollerStreak.test.cjs +0 -128
- package/src/main/__tests__/rcaReport.test.cjs +0 -266
- package/src/main/__tests__/reconcileFlatPrdSweep.test.cjs +0 -119
- package/src/main/__tests__/reconcileTiming.test.cjs +0 -135
- package/src/main/__tests__/runLogRetention.test.cjs +0 -489
- package/src/main/__tests__/runVerify-atomic-verdicts.test.cjs +0 -26
- package/src/main/__tests__/runVerify-blocked-by-foreign-wip.test.cjs +0 -58
- package/src/main/__tests__/runVerify-landed-commit-outranks.test.cjs +0 -191
- package/src/main/__tests__/runVerify-policy-denial.test.cjs +0 -89
- package/src/main/__tests__/runVerify-transcript-commit-evidence.test.cjs +0 -225
- package/src/main/__tests__/runVerify.test.cjs +0 -1784
- package/src/main/__tests__/scheduleJobSchema.test.cjs +0 -127
- package/src/main/__tests__/scheduleJobStatusDrift.test.cjs +0 -65
- package/src/main/__tests__/scheduleJobTransitions.test.cjs +0 -277
- package/src/main/__tests__/scheduleJobTransitionsGrep.test.cjs +0 -59
- package/src/main/__tests__/scheduleJobTransitionsTelemetryTap.test.cjs +0 -72
- package/src/main/__tests__/scheduler-admin-routes.test.cjs +0 -199
- package/src/main/__tests__/scheduler-adopted-run-supervision.test.cjs +0 -143
- package/src/main/__tests__/scheduler-already-satisfied-on-main.test.cjs +0 -105
- package/src/main/__tests__/scheduler-archive-completed-prd.test.cjs +0 -102
- package/src/main/__tests__/scheduler-archived-twin-guard.test.cjs +0 -155
- package/src/main/__tests__/scheduler-autofix-outcome.test.cjs +0 -188
- package/src/main/__tests__/scheduler-autofix-select.test.cjs +0 -439
- package/src/main/__tests__/scheduler-autopromote.test.cjs +0 -51
- package/src/main/__tests__/scheduler-bash-timeout-env.test.cjs +0 -101
- package/src/main/__tests__/scheduler-blocked-by-foreign-wip.test.cjs +0 -107
- package/src/main/__tests__/scheduler-boot-orphans.test.cjs +0 -153
- package/src/main/__tests__/scheduler-broadcast-reconcile.test.cjs +0 -121
- package/src/main/__tests__/scheduler-clear-queue-history.test.cjs +0 -134
- package/src/main/__tests__/scheduler-commit-guard-noop.test.cjs +0 -244
- package/src/main/__tests__/scheduler-committed-in-window.test.cjs +0 -182
- package/src/main/__tests__/scheduler-cross-project-batch.test.cjs +0 -43
- package/src/main/__tests__/scheduler-default-eligible-heal.test.cjs +0 -168
- package/src/main/__tests__/scheduler-dispatch-loop.test.cjs +0 -58
- package/src/main/__tests__/scheduler-effective-concurrency.test.cjs +0 -81
- package/src/main/__tests__/scheduler-epic-digest.test.cjs +0 -227
- package/src/main/__tests__/scheduler-failed-autoreset.test.cjs +0 -121
- package/src/main/__tests__/scheduler-finalize-dispatch-guards.test.cjs +0 -229
- package/src/main/__tests__/scheduler-find-prd-dir.test.cjs +0 -75
- package/src/main/__tests__/scheduler-fix-plan-path.test.cjs +0 -119
- package/src/main/__tests__/scheduler-force-tick-outcome.test.cjs +0 -46
- package/src/main/__tests__/scheduler-foreign-wip-manifest.test.cjs +0 -78
- package/src/main/__tests__/scheduler-gate-shadow.test.cjs +0 -119
- package/src/main/__tests__/scheduler-guard-verdict-autoresolve.test.cjs +0 -390
- package/src/main/__tests__/scheduler-heal-refusal.test.cjs +0 -61
- package/src/main/__tests__/scheduler-heartbeat-payload.test.cjs +0 -80
- package/src/main/__tests__/scheduler-inplace-salvage.test.cjs +0 -323
- package/src/main/__tests__/scheduler-integration-failure-stamp.test.cjs +0 -41
- package/src/main/__tests__/scheduler-investigation-clean-skip.test.cjs +0 -63
- package/src/main/__tests__/scheduler-investigation-prompt.test.cjs +0 -123
- package/src/main/__tests__/scheduler-job-budget.test.cjs +0 -172
- package/src/main/__tests__/scheduler-job-overrun.test.cjs +0 -175
- package/src/main/__tests__/scheduler-launch-failure.test.cjs +0 -199
- package/src/main/__tests__/scheduler-leftover-fields.test.cjs +0 -52
- package/src/main/__tests__/scheduler-leftover-quarantine.test.cjs +0 -199
- package/src/main/__tests__/scheduler-looks-done.test.cjs +0 -537
- package/src/main/__tests__/scheduler-manual-pause.test.cjs +0 -118
- package/src/main/__tests__/scheduler-mechanical-recovery.test.cjs +0 -245
- package/src/main/__tests__/scheduler-meta-code-sha.test.cjs +0 -46
- package/src/main/__tests__/scheduler-needs-review-autoresolve.test.cjs +0 -197
- package/src/main/__tests__/scheduler-never-stop.test.cjs +0 -157
- package/src/main/__tests__/scheduler-no-dead-end-status.test.cjs +0 -152
- package/src/main/__tests__/scheduler-no-orphan-run-dir.test.cjs +0 -81
- package/src/main/__tests__/scheduler-notify-originating-tab-transcript.test.cjs +0 -87
- package/src/main/__tests__/scheduler-notify-originating-tab.test.cjs +0 -343
- package/src/main/__tests__/scheduler-periodic-reverify-guard.test.cjs +0 -217
- package/src/main/__tests__/scheduler-porcelain-rename.test.cjs +0 -164
- package/src/main/__tests__/scheduler-prd-missing-skip.test.cjs +0 -161
- package/src/main/__tests__/scheduler-prd-persona-spawn.test.cjs +0 -178
- package/src/main/__tests__/scheduler-quarantine-autoresolve.test.cjs +0 -165
- package/src/main/__tests__/scheduler-quiet-machine-lease.test.cjs +0 -257
- package/src/main/__tests__/scheduler-rate-limit-cooldown-freshness.test.cjs +0 -123
- package/src/main/__tests__/scheduler-rate-limit-pause.test.cjs +0 -152
- package/src/main/__tests__/scheduler-rate-limit-spin-guard.test.cjs +0 -156
- package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +0 -754
- package/src/main/__tests__/scheduler-reaper-helpers-basics.test.cjs +0 -87
- package/src/main/__tests__/scheduler-reconcile-cwd-preserve.test.cjs +0 -100
- package/src/main/__tests__/scheduler-reconcile-history-backfill.test.cjs +0 -105
- package/src/main/__tests__/scheduler-reconcile-invalid-repair.test.cjs +0 -203
- package/src/main/__tests__/scheduler-reconcile-quarantine.test.cjs +0 -247
- package/src/main/__tests__/scheduler-reset-job-fields-guard.test.cjs +0 -77
- package/src/main/__tests__/scheduler-resume-recovery.test.cjs +0 -254
- package/src/main/__tests__/scheduler-shard-quarantine.test.cjs +0 -115
- package/src/main/__tests__/scheduler-shared-tree-guard.test.cjs +0 -380
- package/src/main/__tests__/scheduler-sigterm-commit.test.cjs +0 -43
- package/src/main/__tests__/scheduler-stall-per-project.test.cjs +0 -126
- package/src/main/__tests__/scheduler-starve-escalation.test.cjs +0 -154
- package/src/main/__tests__/scheduler-stranded-autofix-park.test.cjs +0 -252
- package/src/main/__tests__/scheduler-stranded-investigation.test.cjs +0 -185
- package/src/main/__tests__/scheduler-stuck-failed-escalation.test.cjs +0 -136
- package/src/main/__tests__/scheduler-supervisor-record.test.cjs +0 -81
- package/src/main/__tests__/scheduler-tick-cancel-token.test.cjs +0 -54
- package/src/main/__tests__/scheduler-tick-wedge.test.cjs +0 -172
- package/src/main/__tests__/scheduler-transient-failure.test.cjs +0 -141
- package/src/main/__tests__/scheduler-unreadable-queue-guard.test.cjs +0 -62
- package/src/main/__tests__/scheduler-utilization-hold.test.cjs +0 -89
- package/src/main/__tests__/scheduler-verify-prd-path.test.cjs +0 -109
- package/src/main/__tests__/scheduler-worktree-cap-defer.test.cjs +0 -234
- package/src/main/__tests__/scheduler-worktree-exec-cwd.test.cjs +0 -120
- package/src/main/__tests__/scheduler-writeprd-epic-rollback.test.cjs +0 -105
- package/src/main/__tests__/schedulerBatchRootBlocker.test.cjs +0 -117
- package/src/main/__tests__/schedulerStateSidecarRestore.test.cjs +0 -110
- package/src/main/__tests__/seedAgentPersonas.test.cjs +0 -184
- package/src/main/__tests__/seedSchedulerMcp.test.cjs +0 -211
- package/src/main/__tests__/seedStatus.test.cjs +0 -100
- package/src/main/__tests__/seedValidatorPersona.test.cjs +0 -116
- package/src/main/__tests__/stop-signal-anchor.test.cjs +0 -75
- package/src/main/__tests__/telemetryClient.test.cjs +0 -1055
- package/src/main/__tests__/telemetryContract.test.cjs +0 -930
- package/src/main/__tests__/telemetrySettings.test.cjs +0 -210
- package/src/main/__tests__/transcripts-batch-flush.test.cjs +0 -249
- package/src/main/__tests__/transcripts-doFlush-array.test.cjs +0 -124
- package/src/main/__tests__/transcripts-paged-reads.test.cjs +0 -241
- package/src/main/__tests__/transcripts-worktree-epic-path.test.cjs +0 -154
- package/src/main/__tests__/transcriptsUsageFor.test.cjs +0 -206
- package/src/main/__tests__/uniquePrdNumbers.test.cjs +0 -153
- package/src/main/__tests__/usageSingleFlight.test.cjs +0 -169
- package/src/main/__tests__/validationSentinels.test.cjs +0 -84
- package/src/main/__tests__/workTypeLibrary.test.cjs +0 -89
- package/src/main/bilkoHost.cjs +0 -314
- package/src/main/bilkoHostCore.cjs +0 -89
- package/src/main/lib/__tests__/active-sessions.test.cjs +0 -251
- package/src/main/lib/__tests__/activeIndexRebuild.test.cjs +0 -179
- package/src/main/lib/__tests__/agentPersonaSchema.test.cjs +0 -67
- package/src/main/lib/__tests__/auditLog.test.cjs +0 -38
- package/src/main/lib/__tests__/bootSelfHeal.test.cjs +0 -107
- package/src/main/lib/__tests__/branchSweep.test.cjs +0 -164
- package/src/main/lib/__tests__/buildIdentity.test.cjs +0 -121
- package/src/main/lib/__tests__/buildTarget.test.cjs +0 -52
- package/src/main/lib/__tests__/childWithLog.test.cjs +0 -321
- package/src/main/lib/__tests__/coldBootPromptSessionsWrite.test.cjs +0 -87
- package/src/main/lib/__tests__/crashTelemetry.test.cjs +0 -103
- package/src/main/lib/__tests__/credentials-futile-refresh.test.cjs +0 -115
- package/src/main/lib/__tests__/cwdClassify.test.cjs +0 -111
- package/src/main/lib/__tests__/definitionOfDoneSequence.test.cjs +0 -95
- package/src/main/lib/__tests__/delegationReadiness.test.cjs +0 -1175
- package/src/main/lib/__tests__/dispatchLoop.test.cjs +0 -63
- package/src/main/lib/__tests__/effectiveModelInfo.test.cjs +0 -244
- package/src/main/lib/__tests__/ephemeralCwd.test.cjs +0 -91
- package/src/main/lib/__tests__/epicDelegationStats.test.cjs +0 -137
- package/src/main/lib/__tests__/epicSpawnCwd.test.cjs +0 -283
- package/src/main/lib/__tests__/epicSpawnPlan.test.cjs +0 -196
- package/src/main/lib/__tests__/epicTranscriptPath.test.cjs +0 -163
- package/src/main/lib/__tests__/epicWorktreeBoot.test.cjs +0 -136
- package/src/main/lib/__tests__/epicWorktreeMerge.test.cjs +0 -130
- package/src/main/lib/__tests__/epicWorktreeMint.test.cjs +0 -117
- package/src/main/lib/__tests__/epicWorktreeProjectConfig.test.cjs +0 -137
- package/src/main/lib/__tests__/fixChainDepth.test.cjs +0 -40
- package/src/main/lib/__tests__/fixtures/204-mercury-steam-horse.log.txt +0 -13
- package/src/main/lib/__tests__/fixtures/scheduler-machine.json.corrupt-1789147548 +0 -34
- package/src/main/lib/__tests__/gateFixtures.json +0 -20
- package/src/main/lib/__tests__/gitCacheBound.test.cjs +0 -69
- package/src/main/lib/__tests__/gitWorktree.test.cjs +0 -1478
- package/src/main/lib/__tests__/gitWorktreeSalvage.test.cjs +0 -107
- package/src/main/lib/__tests__/gitWorktreeSalvageDelta.test.cjs +0 -153
- package/src/main/lib/__tests__/guardShims.test.cjs +0 -158
- package/src/main/lib/__tests__/importReferences.spec.cjs +0 -56
- package/src/main/lib/__tests__/instanceLock.test.cjs +0 -173
- package/src/main/lib/__tests__/jobSupervisorRecord.test.cjs +0 -78
- package/src/main/lib/__tests__/jobWorktree.test.cjs +0 -199
- package/src/main/lib/__tests__/jobWorktreeBootLive.test.cjs +0 -82
- package/src/main/lib/__tests__/landedSinceRun.test.cjs +0 -133
- package/src/main/lib/__tests__/launchFailure.test.cjs +0 -220
- package/src/main/lib/__tests__/loadGate.test.cjs +0 -303
- package/src/main/lib/__tests__/localAdminHttp.test.cjs +0 -214
- package/src/main/lib/__tests__/loopDelay.test.cjs +0 -68
- package/src/main/lib/__tests__/mcpToolCatalog.test.cjs +0 -107
- package/src/main/lib/__tests__/modelCatalog.test.cjs +0 -202
- package/src/main/lib/__tests__/opsOwnership.test.cjs +0 -113
- package/src/main/lib/__tests__/opsRootAbsoluteCwd.test.cjs +0 -328
- package/src/main/lib/__tests__/opsRootNestedWrite.test.cjs +0 -51
- package/src/main/lib/__tests__/opsRootResolve.test.cjs +0 -149
- package/src/main/lib/__tests__/prdDeclaredPaths.test.cjs +0 -82
- package/src/main/lib/__tests__/prdDisposition.test.cjs +0 -224
- package/src/main/lib/__tests__/procIdentity.test.cjs +0 -119
- package/src/main/lib/__tests__/procName.test.cjs +0 -92
- package/src/main/lib/__tests__/projectBriefCore.test.cjs +0 -216
- package/src/main/lib/__tests__/projectRootResolve.test.cjs +0 -148
- package/src/main/lib/__tests__/queueHealth.test.cjs +0 -58
- package/src/main/lib/__tests__/queueStoreAtomicWrite.test.cjs +0 -88
- package/src/main/lib/__tests__/queueStoreMachineStateRecovery.test.cjs +0 -190
- package/src/main/lib/__tests__/quietMachineLease.test.cjs +0 -39
- package/src/main/lib/__tests__/rateLimitWindow.test.cjs +0 -88
- package/src/main/lib/__tests__/reaperHelpers.test.cjs +0 -577
- package/src/main/lib/__tests__/schedulerBatchDepends.test.cjs +0 -312
- package/src/main/lib/__tests__/schedulerBatchFairness.test.cjs +0 -213
- package/src/main/lib/__tests__/schedulerBatchLaunchHold.test.cjs +0 -125
- package/src/main/lib/__tests__/schedulerBatchProjectCap.test.cjs +0 -127
- package/src/main/lib/__tests__/schedulerBatchQuietMachine.test.cjs +0 -109
- package/src/main/lib/__tests__/schedulerMcpServerHeadlessRefusal.test.cjs +0 -71
- package/src/main/lib/__tests__/schedulerMcpServerHelp.test.cjs +0 -216
- package/src/main/lib/__tests__/schedulerMcpServerProjectHome.test.cjs +0 -183
- package/src/main/lib/__tests__/schedulerPaths.test.cjs +0 -226
- package/src/main/lib/__tests__/schedulerPathsWorktree.test.cjs +0 -133
- package/src/main/lib/__tests__/schedulerRuntimeState.test.cjs +0 -56
- package/src/main/lib/__tests__/sessionSlots.test.cjs +0 -144
- package/src/main/lib/__tests__/telemetryBacklog.test.cjs +0 -626
- package/src/main/lib/__tests__/telemetryBoot.test.cjs +0 -134
- package/src/main/lib/__tests__/telemetryConsent.test.cjs +0 -136
- package/src/main/lib/__tests__/telemetryCounters.test.cjs +0 -57
- package/src/main/lib/__tests__/telemetryCountersMetadataColumn.test.cjs +0 -98
- package/src/main/lib/__tests__/terminalRunOutcome.test.cjs +0 -200
- package/src/main/lib/__tests__/toolUseClassify.test.cjs +0 -53
- package/src/main/lib/__tests__/updateCheck.test.cjs +0 -63
- package/src/main/lib/__tests__/upgradeDrain.test.cjs +0 -130
- package/src/main/lib/__tests__/usageCircuit.test.cjs +0 -354
- package/src/main/lib/__tests__/watchdog-helpers.test.cjs +0 -375
- package/src/main/lib/__tests__/watchdog-relaunch.test.cjs +0 -266
- package/src/main/lib/kgExchangePairing.cjs +0 -75
|
@@ -1,516 +1,260 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: develop
|
|
3
3
|
description: >-
|
|
4
|
-
Lead a software-development task
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
inline now. This skill is the home for the developer-only guidance (performance, debugging,
|
|
14
|
-
API-reuse, TDD) that was removed from the always-on global CLAUDE.md. Keywords: develop,
|
|
15
|
-
build, implement, code, feature, refactor, bugfix, queue dev work, PRDs, PRD chain, multi-angle
|
|
16
|
-
analysis.
|
|
4
|
+
Lead a software-development task: analyze it from five angles, split it into small
|
|
5
|
+
self-contained PRDs (an independent set, or a 3-5 PRD chain), queue them for the
|
|
6
|
+
session-manager scheduler with the required gate and files, each pointing the headless
|
|
7
|
+
executor at the engineering standards file, then track them to a validated finish and report
|
|
8
|
+
back. Use whenever the user says "/develop", "develop X", "build me X", "implement X", "let's
|
|
9
|
+
code X", or otherwise starts dev work that should run as scheduled PRDs rather than inline
|
|
10
|
+
now. Home of the developer-only guidance (performance, debugging, API reuse, TDD). Keywords:
|
|
11
|
+
develop, build, implement, code, feature, refactor, bugfix, queue dev work, PRDs, PRD chain,
|
|
12
|
+
multi-angle analysis.
|
|
17
13
|
---
|
|
18
14
|
|
|
19
|
-
# /develop —
|
|
20
|
-
|
|
21
|
-
**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
the
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
`# Implementation notes` states in one line what the *previous* link actually delivered
|
|
198
|
-
(file paths/functions it added, referencing its real landed state — not the plan for it,
|
|
199
|
-
since PRDs 1..k-1 may have adjusted scope during execution) and what this link is expected
|
|
200
|
-
to build on top of. Do not chain more than 5 deep — beyond that, re-run step 3's
|
|
201
|
-
completeness pass instead of extending the chain further; a chain that long is a sign the
|
|
202
|
-
original decomposition was wrong, not that it needs one more link. A chain does not relax
|
|
203
|
-
the ~15-min/30-min-ceiling sizing below — each link is still individually small.
|
|
204
|
-
|
|
205
|
-
**Every plan ends with one `validate` PRD.** After the work-item PRDs are written, author
|
|
206
|
-
exactly one more through `scheduler_create_prd`: `agentType: "validator"`, `tag: "build"`,
|
|
207
|
-
`estimateMinutes: 10`, `dependsOn` = every other slug in this plan (`dependsOn` is capped at
|
|
208
|
-
100 entries; for a plan bigger than that, list only the plan's sink PRDs — those nothing else
|
|
209
|
-
in the plan depends on — since `hasDownstreamValidator` walks `dependsOn` transitively, so a
|
|
210
|
-
validator anchored on the sinks alone still covers every upstream PRD), slug
|
|
211
|
-
`validate-<short-plan-name>`. Its Goal lists the plan's PRD slugs and titles; its Acceptance
|
|
212
|
-
criteria give, per PRD, where its file lives
|
|
213
|
-
(`<cwd>/session-manager-operations/scheduler/epics/<epic-id>/prds/<NN>-<slug>.md` while queued,
|
|
214
|
-
the sibling `prds-archived/` once terminal — locate by slug in either) and end with the
|
|
215
|
-
review-record path to write and commit:
|
|
15
|
+
# /develop — plan, queue, track to done
|
|
16
|
+
|
|
17
|
+
Terms: **plan** = the PRDs one pass queues, ending in a validate PRD. **gate** = commands that
|
|
18
|
+
prove a PRD done. **files** = paths a PRD may change. **verdict line** = a run's last line
|
|
19
|
+
(`SCHEDULER_VERDICT: PASS`). **needs_review** = a parked PRD: a question for this Epic, never
|
|
20
|
+
new work. **report** = your final message to the human.
|
|
21
|
+
|
|
22
|
+
## Rules that always apply
|
|
23
|
+
|
|
24
|
+
1. **Epic gate. Run it first.**
|
|
25
|
+
1. Your session id is `$SM_CHAT_SESSION_ID`.
|
|
26
|
+
2. Read `session-manager-operations/prompt-sessions/active-index.json` in the main checkout
|
|
27
|
+
(`$SM_PROJECT_ROOT`, or the first `git worktree list` path). Why: a worktree copy is
|
|
28
|
+
frozen at branch time and often lacks this Epic.
|
|
29
|
+
3. The `sessions` entry whose `claudeSessionId` matches is this Epic: its `id` is
|
|
30
|
+
`<epic-id>`, its `tag` drives rule 2.
|
|
31
|
+
4. No match: stop and say so. Tell the human to open an Epic with the New Epic card and run
|
|
32
|
+
/develop there. Never mint an Epic or write a PRD without one. Why: only a human creates
|
|
33
|
+
an Epic.
|
|
34
|
+
2. **Tag-aware default.** On a `feature` or `bug` Epic, PRDs are the expected path once scope
|
|
35
|
+
is clear; start unasked. On a `discussion` Epic it stays available, but wait until the
|
|
36
|
+
human settles that code is wanted.
|
|
37
|
+
3. **Never hand-implement in this session**, even when the plan is agreed. Why: this session
|
|
38
|
+
runs an expensive planner model; a cheaper executor runs each PRD as a headless `claude -p`
|
|
39
|
+
job.
|
|
40
|
+
4. **Never delegate PRD authoring.** You write scope, title, goal, criteria and notes. Calling
|
|
41
|
+
`scheduler_create_prd` with your own text is not delegation.
|
|
42
|
+
5. **Never restate the engineering rules.** They live in `standards.md` beside this file, with
|
|
43
|
+
the reasons behind the run rules. Interactive work uses the `test-driven-development`,
|
|
44
|
+
`systematic-debugging` and `requesting-code-review` skills. Why: one copy never goes stale.
|
|
45
|
+
|
|
46
|
+
## Phase 1 — plan and queue
|
|
47
|
+
|
|
48
|
+
Read `~/.claude/session-manager/scheduled-plans/PRD_AUTHORING.md` before writing PRDs.
|
|
49
|
+
|
|
50
|
+
### Preflight — confirm the tool is even in your tool list
|
|
51
|
+
|
|
52
|
+
Before drafting, check that `mcp__session-manager-scheduler__scheduler_create_prd` is in your
|
|
53
|
+
tools. Why: drafts made first are wasted. It is the only sanctioned way to write a PRD. Its two
|
|
54
|
+
failure modes have different fixes:
|
|
55
|
+
|
|
56
|
+
- **(a) Tool PRESENT but ERRORS** because the session-manager app is not running. A validation
|
|
57
|
+
error is not this case: fix the input and retry. **STOP. Do not write any PRD file.** Tell the
|
|
58
|
+
human to start the app, then retry the same call. Why: a PRD file the API did not write is
|
|
59
|
+
quarantined and never runs.
|
|
60
|
+
- **(b) Tool ABSENT from your tool list.** The `session-manager-scheduler` MCP server is not
|
|
61
|
+
registered: a **misconfiguration**, not an offline app.
|
|
62
|
+
**STOP. Do not write any PRD file.** Tell the human. The app registers the server at user
|
|
63
|
+
scope the first time it starts. If it is still missing, the human deletes
|
|
64
|
+
`~/.claude/session-manager/.scheduler-mcp-seeded`, restarts the app, and opens a new session.
|
|
65
|
+
Never add a project `.mcp.json` entry yourself. Why: it brings back per-repo drift.
|
|
66
|
+
|
|
67
|
+
### Steps
|
|
68
|
+
|
|
69
|
+
1. **Clarify only what a wrong guess would cost rework on.** Ask 2–4 plain-text questions in
|
|
70
|
+
one message, once, and wait. Never use AskUserQuestion. Why: Chat view turns run headless.
|
|
71
|
+
2. **Explore broadly.** Find the absolute path, helpers and patterns to reuse, the test
|
|
72
|
+
command, constraints, and exact paths and signatures. Read look-alike siblings to confirm
|
|
73
|
+
the shape. Check existing tests, and `scheduler_list_prds` for an open PRD on the same
|
|
74
|
+
area. Why: a duplicate or contradicting PRD is a real failure.
|
|
75
|
+
3. **Use five lenses**, a sentence each, none skipped silently: positive path; edge cases
|
|
76
|
+
(empty, max, concurrent, malformed, permission, failure); interaction effects (what depends
|
|
77
|
+
on your change); integration (reuse the existing schema, store, API, primitives);
|
|
78
|
+
validation (for UI: which screenshot, light and dark, proves which criterion).
|
|
79
|
+
4. **Run a completeness pass** if the ask exceeds one or two PRDs or spans subsystems: give one
|
|
80
|
+
Explore or general-purpose sub-agent the ask verbatim, your draft list and the lenses; ask
|
|
81
|
+
what is missing. Fold in real gaps, drop vague ones. Repeat at most once. It reviews; you
|
|
82
|
+
author.
|
|
83
|
+
5. **Tests and security go inside the feature's own PRD** as criteria (security when it
|
|
84
|
+
touches input, auth or data), never as follow-ups. Why: TDD needs the test with the code;
|
|
85
|
+
security is decided while writing it. Also check quality (performance, error handling).
|
|
86
|
+
Deeper edge cases, hardening and docs may be sibling PRDs.
|
|
87
|
+
6. **Pick a shape.** Most asks are an independent set. Chain 3–5 PRDs only for truly
|
|
88
|
+
sequential work: each link `dependsOn` the previous one; its notes name what that link
|
|
89
|
+
delivers and say to read the landed code first. Never chain past 5; redo the completeness
|
|
90
|
+
pass. Each goal's first sentence names its type, in chain order: `primitive` (new helper
|
|
91
|
+
and its test), `wire` (adopt it at named call sites), `behavior` (one function's logic and
|
|
92
|
+
its test), `migration` (mechanical change), `doc`, `validate`.
|
|
93
|
+
7. **Keep each PRD small**: at most 3 edited files, 1 new file, 6 criteria. The validate PRD is
|
|
94
|
+
exempt: it has one criterion per PRD, plus the record. A new helper and its first caller are
|
|
95
|
+
two PRDs. Most PRDs take 5–10 executor minutes; past estimates were 3–5×
|
|
96
|
+
too high. Never estimate over 15; split. Why: the kill budget floors at 45 minutes, so a low
|
|
97
|
+
estimate never starves a run.
|
|
98
|
+
8. **Make each PRD self-contained.** The executor sees only the PRD and the project. Notes are
|
|
99
|
+
a recipe: `Read first:` (at most 4 files, with line ranges), `Steps:` (numbered, each naming
|
|
100
|
+
file and function), `Do not touch:` (files a sibling owns). Quote signatures. Say when a PRD
|
|
101
|
+
needs another PRD's output.
|
|
102
|
+
9. **Write plain, checkable criteria.** Each names a file, a symbol and the result; one names
|
|
103
|
+
the test file and tests. Commands go in `gate`. No open-ended "grep X and update" lines.
|
|
104
|
+
10. **Show the plan once**, as a table (#, PRD, files, gate, dependsOn, estimate), not PRD
|
|
105
|
+
drafts. Queue at once when the Epic is `feature` or `bug` and scope is clear; otherwise ask
|
|
106
|
+
one approval question, once.
|
|
107
|
+
11. Before the first `scheduler_create_prd` call, run `git -C "$SM_PROJECT_ROOT" rev-parse HEAD`
|
|
108
|
+
and keep the SHA. **Walk the pre-queue checklist** (last section of PRD_AUTHORING.md), then
|
|
109
|
+
queue each PRD with `scheduler_create_prd`, the validate PRD last.
|
|
110
|
+
12. **Read the warnings each call returns before the next call.** Warnings do not block. If a
|
|
111
|
+
gate or files warning shows a real mistake, archive that PRD with `scheduler_archive_prd` and
|
|
112
|
+
queue it again under a new slug, before you queue the PRDs that depend on it. Why: a new
|
|
113
|
+
call checks the gate and files again; `scheduler_update_prd` does not check them. Never
|
|
114
|
+
change a PRD only to silence a warning. The validate PRD's none-gate warning and its size
|
|
115
|
+
warning (8 or more criteria) are expected. Then post one short message: each PRD's number and slug, the validate slug, the
|
|
116
|
+
warnings you kept, and that no per-PRD check will come from this session.
|
|
117
|
+
13. **Never stop for review after queueing.** Why: the validator is the review.
|
|
118
|
+
|
|
119
|
+
### PRD fields
|
|
120
|
+
|
|
121
|
+
| Field | Rule |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| `title`, `goal`, `acceptanceCriteria`, `implementationNotes`, `outOfScope` | Steps 6–9. Goal: 2–4 sentences. |
|
|
124
|
+
| `gate`, `files` | **REQUIRED.** Rules below. The tool refuses a call without them. |
|
|
125
|
+
| `estimateMinutes` | Honest: 5–10, never over 15. |
|
|
126
|
+
| `sourcePromptId` | Always `<epic-id>`. Never rely on the server's fallback. |
|
|
127
|
+
| `cwd` | The Epic's project root, as an absolute path or `~/…`. The API always uses the Epic's project, whatever you pass. To work in another project, open an Epic there. |
|
|
128
|
+
| `dependsOn` | Slugs that must finish first. The only ordering tool. |
|
|
129
|
+
| `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. |
|
|
130
|
+
| `slug` | Optional kebab-case without an `NN-` prefix. The API picks the number. |
|
|
131
|
+
| `tag`, `agentType` | Omit (`dev-lead` default), except on the validate PRD. |
|
|
132
|
+
| `quietMachine` | Only for timing measurements. |
|
|
133
|
+
|
|
134
|
+
Never pass `parallelGroup`; it is ignored. The API writes the frontmatter, the `# Files` and
|
|
135
|
+
`# Gate` sections and the standards pointer. Do not write them yourself. Do not put a gate
|
|
136
|
+
fence (three backticks + `gate`), a `# Gate` heading or a `# Files` heading in any text field —
|
|
137
|
+
the API rejects that.
|
|
138
|
+
|
|
139
|
+
### gate rules
|
|
140
|
+
|
|
141
|
+
1. 1–10 commands. The scheduler re-runs them, in order. Each must exit 0.
|
|
142
|
+
2. Start each `&&` step with `timeout <seconds>`, for example `timeout 300 npm test &&
|
|
143
|
+
timeout 120 npm run lint`. Why: a command without a timeout can hang the run.
|
|
144
|
+
3. Join steps inside one entry with `&&`.
|
|
145
|
+
4. The scheduler runs gate commands without a shell, so shell syntax is refused. Outside single
|
|
146
|
+
quotes, do not use `|` `<` `>` `;` `&` (only `&&` between steps), backticks, `$`, `\`, `*`,
|
|
147
|
+
`?`, `[`, `]`, `(`, `)`, `{`, `}` or `!`. Inside double quotes, `$`, backticks and `\` are
|
|
148
|
+
refused too.
|
|
149
|
+
5. Do not start a word with `#` or `~`, and do not put `~` right after `=` or `:`. `HEAD~1` is
|
|
150
|
+
fine.
|
|
151
|
+
6. Put text with these characters inside single quotes, for example `rg -n 'a|b' src/`. A check
|
|
152
|
+
that needs a shell belongs in a test file that the gate runs.
|
|
153
|
+
7. Keep each entry on one line, at most 500 chars, with plain spaces between words.
|
|
154
|
+
8. Use `["none"]` only for docs or config with no runnable check. Write exactly `none`. Never
|
|
155
|
+
mix `none` with commands.
|
|
156
|
+
9. Put `NAME=value` words before `timeout`, never after it, for example
|
|
157
|
+
`CI=1 timeout 300 npm test`. A leading `TMPDIR=$(mktemp -d) ` is allowed but not needed: the
|
|
158
|
+
scheduler gives each gate its own TMPDIR.
|
|
159
|
+
|
|
160
|
+
### files rules
|
|
161
|
+
|
|
162
|
+
1. 1–50 repo-relative paths. A folder ends with `/`.
|
|
163
|
+
2. No absolute paths, no `~` at the start, no `..` or `.` segments, no `*` or `?`, no `\` or
|
|
164
|
+
backticks, no leading `-`. Use `/` between folders.
|
|
165
|
+
3. PRDs that can run at the same time must not share a file. If two PRDs touch the same file,
|
|
166
|
+
chain them with `dependsOn`.
|
|
167
|
+
|
|
168
|
+
### What a headless run cannot do
|
|
169
|
+
|
|
170
|
+
The scheduler blocks ScheduleWakeup, Cron tools, Monitor, AskUserQuestion, plan mode, worktree
|
|
171
|
+
tools and background tasks. A `timeout` command is always on PATH (a shim on macOS). The run
|
|
172
|
+
never stops to ask; it makes the safest reasonable choice and reports it. So write PRDs that
|
|
173
|
+
need none of this and leave no decision open.
|
|
174
|
+
|
|
175
|
+
### How a PRD runs
|
|
176
|
+
|
|
177
|
+
The dev-lead persona runs orient (read `# Files`) → red (a failing test) → build → finish
|
|
178
|
+
protocol, which the scheduler appends: review → verify the `# Gate` commands → commit exact
|
|
179
|
+
paths → verdict line.
|
|
180
|
+
|
|
181
|
+
### The validate PRD
|
|
182
|
+
|
|
183
|
+
End every plan with exactly one validate PRD:
|
|
184
|
+
|
|
185
|
+
1. `agentType: "validator"`, `tag: "build"`, `estimateMinutes: 10`, slug
|
|
186
|
+
`validate-<short-plan-name>`.
|
|
187
|
+
2. `dependsOn`: every other slug in the plan. Past the cap of 100, only the sinks (PRDs nothing
|
|
188
|
+
depends on). Why: `dependsOn` is walked transitively.
|
|
189
|
+
3. Goal: the plan's slugs and titles.
|
|
190
|
+
4. Criteria: one per PRD, naming its file
|
|
191
|
+
(`session-manager-operations/scheduler/epics/<epic-id>/prds/<NN>-<slug>.md` while queued,
|
|
192
|
+
`prds-archived/` beside it once done; find it by slug). The last: write and commit
|
|
216
193
|
`session-manager-operations/reviews/validation/<epic-id>/<validate-slug>.md`.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
**Fallback for case (a) only.** This is a deliberate bypass of the service boundary, not a
|
|
286
|
-
shortcut: using it means the frontmatter validation, atomic `NN` allocation, standards-pointer
|
|
287
|
-
insertion, and Epic-existence check that `scheduler_create_prd` normally performs did not
|
|
288
|
-
run. **You MUST call this out, visibly, in your report** — state plainly that the app wasn't
|
|
289
|
-
running, that you hand-authored the PRD file directly instead of using the tool, name the
|
|
290
|
-
exact file, and flag it for human verification (this bypass is also what
|
|
291
|
-
`scripts/audit-ops-hygiene.cjs` and the `ops-sweep` skill look for and report as a hygiene
|
|
292
|
-
finding, independent of your own report).
|
|
293
|
-
When you do use it: compute the highest in-use number deterministically yourself — never
|
|
294
|
-
eyeball or narrow-grep the `ls` (a narrowed pattern like `'^10[0-9]'` silently misses `110+`
|
|
295
|
-
and collides). PRDs are stored per-project, so `NN` allocation for a given PRD only needs
|
|
296
|
-
*that project's own* prds directory scanned — not every project's:
|
|
297
|
-
```bash
|
|
298
|
-
ls <cwd>/session-manager-operations/scheduler/epics/*/prds/ <cwd>/session-manager-operations/scheduler/prds-archived/ 2>/dev/null | grep -oE '^[0-9]+' | sort -n | uniq | tail -5
|
|
299
|
-
```
|
|
300
|
-
(`<cwd>` is the target repo's absolute path — the same one this PRD's `cwd` field will use.)
|
|
301
|
-
The last line is the current max within that project. Then: **always next free `NN` =
|
|
302
|
-
max+1** — never reuse a sibling's number (unique-per-project rule, PRD 832); express
|
|
303
|
-
ordering with `dependsOn: [<slug>]` frontmatter instead. This manual path has a
|
|
304
|
-
small, accepted race (two concurrent authors could compute the same "next free" `NN`) —
|
|
305
|
-
cosmetic (two unrelated groups end up sharing a number) rather than destructive, and only
|
|
306
|
-
reachable when the atomic tool path above isn't available. Record each cross-PRD dependency
|
|
307
|
-
in the dependent PRD's notes either way.
|
|
308
|
-
|
|
309
|
-
### PRD structure and location
|
|
310
|
-
|
|
311
|
-
Each individual PRD must follow this structure — this is `/develop`'s single authority on
|
|
312
|
-
one PRD's structure, location, and scope sizing (the engineering rules stay separate, in
|
|
313
|
-
`standards.md`).
|
|
314
|
-
|
|
315
|
-
You are writing a PRD that will be executed by the user's session-manager scheduler — a
|
|
316
|
-
system that runs `claude -p <prd-body> --dangerously-skip-permissions` jobs around 5-hour
|
|
317
|
-
token-window resets, with auto-pause on rate-limit and auto-resume.
|
|
318
|
-
|
|
319
|
-
**Canonical location — non-negotiable.** Every PRD belongs to an **Epic** (the TAB → EPIC →
|
|
320
|
-
PRD domain model in the project CLAUDE.md) — specifically the `<epic-id>` resolved in the
|
|
321
|
-
Epic-gated step above. PRDs MUST be written to, inside the target repo:
|
|
322
|
-
```
|
|
323
|
-
<cwd>/session-manager-operations/scheduler/epics/<epic-id>/prds/<NN>-<kebab-slug>.md
|
|
324
|
-
```
|
|
325
|
-
Always pass that `<epic-id>` as `sourcePromptId` when creating each PRD — via the MCP
|
|
326
|
-
`scheduler_create_prd` tool's `sourcePromptId` input, or, for the manual-write fallback, by
|
|
327
|
-
resolving the directory with:
|
|
328
|
-
```bash
|
|
329
|
-
node <session-manager-repo>/scripts/mint-epic.cjs <cwd> <epic-id>
|
|
330
|
-
```
|
|
331
|
-
This only JOINS an existing Epic and prints its prds/ directory on the last stdout line — it
|
|
332
|
-
never creates one. If `<epic-id>` doesn't exist yet, that means the Epic-gated step above
|
|
333
|
-
wasn't satisfied; go back and get a human to create/approve the Epic first, don't work around
|
|
334
|
-
this by minting one.
|
|
335
|
-
|
|
336
|
-
**Anywhere else doesn't get scheduled or gets retired.** `data/prds/`, `docs/prds/`, and the
|
|
337
|
-
old global `prds/` dir under `~/.claude/session-manager/scheduled-plans/` are invisible to
|
|
338
|
-
the scheduler; the legacy flat `session-manager-operations/scheduler/prds/` dir is RETIRED —
|
|
339
|
-
anything written there is auto-consolidated into `prds-archived/` and never executed. This
|
|
340
|
-
consolidation runs at the top of every `reconcile()` call (`consolidateAllFlatPrds`, called
|
|
341
|
-
from inside `reconcile()` itself in `src/main/scheduler.cjs`, before `reconcile` scans that
|
|
342
|
-
dir for PRD sources) — not only at app boot, and not just from the tick-queue poll:
|
|
343
|
-
`reconcile()` also runs from job completion, the `schedule:state`/`schedule:rescan` IPC
|
|
344
|
-
handlers, and `rescheduleTimer()`, so the sweep is guaranteed regardless of which of those
|
|
345
|
-
triggers the next pass. A file landing in the flat dir while the app is already running is
|
|
346
|
-
swept out before it could ever be turned into a job, closing the window a boot-only pass left
|
|
347
|
-
open. PRD *source* files are per-project and per-Epic, resolved at runtime via
|
|
348
|
-
`src/main/lib/prdLocations.cjs`.
|
|
349
|
-
|
|
350
|
-
**Filename rules.** `NN` is the PRD's unique per-project number (always next free =
|
|
351
|
-
max+1 per the `ls` command above; ordering via `dependsOn` frontmatter, never via shared
|
|
352
|
-
numbers). `<kebab-slug>` is a short, descriptive kebab-case identifier
|
|
353
|
-
(e.g. `voice-commands-send-cancel`, `ticker-velocity-mcp`), kept under 60 chars. Verify your
|
|
354
|
-
chosen filename doesn't already exist before writing.
|
|
355
|
-
|
|
356
|
-
**Required frontmatter:**
|
|
357
|
-
```yaml
|
|
358
|
-
---
|
|
359
|
-
title: <one-line human-readable title>
|
|
360
|
-
cwd: <path to target project — where claude -p will run>
|
|
361
|
-
estimateMinutes: <integer wall-clock estimate>
|
|
362
|
-
---
|
|
363
|
-
```
|
|
364
|
-
`cwd` is critical — without it the job runs in the scheduler's default cwd (session-manager).
|
|
365
|
-
Always set it to the path of the project the work targets, written as `~/Projects/<repo>`
|
|
366
|
-
(the parser expands `~` to `os.homedir()` at ingest, so the same PRD works on any machine).
|
|
367
|
-
Avoid hardcoding an absolute home path (`/home/<you>/Projects/<repo>`); it breaks on any
|
|
368
|
-
machine with a different home directory.
|
|
369
|
-
|
|
370
|
-
**Required body sections, in this order:**
|
|
371
|
-
```markdown
|
|
372
|
-
# Goal
|
|
373
|
-
|
|
374
|
-
<2-4 sentences. What the executor will build and why it matters. NO "as a user I want to"
|
|
375
|
-
framing. Concrete: name the function, the file, the user-visible change.>
|
|
376
|
-
|
|
377
|
-
# Acceptance criteria
|
|
378
|
-
|
|
379
|
-
- [ ] <each line is a verifiable check the executor can run after building>
|
|
380
|
-
- [ ] <include explicit file paths, function names, expected behavior>
|
|
381
|
-
- [ ] exactly one gate line — a bounded command or an `&&` chain of at most two, e.g.
|
|
382
|
-
`timeout 300 npm run typecheck && timeout 300 npx vitest run <file>` (the run-before-done
|
|
383
|
-
rule lives in standards.md; the AC just names the command).
|
|
384
|
-
|
|
385
|
-
# Implementation notes
|
|
386
|
-
|
|
387
|
-
<file paths the executor will need to read first; the architectural pattern to follow; any
|
|
388
|
-
non-obvious constraints. Be specific. Quote function signatures if it saves the executor a
|
|
389
|
-
Read call.>
|
|
390
|
-
|
|
391
|
-
# Out of scope
|
|
392
|
-
|
|
393
|
-
<short bulleted list of what NOT to build, to prevent scope creep>
|
|
394
|
-
```
|
|
395
|
-
(When a PRD spans multiple step-3 concern dimensions, replace the flat `# Acceptance criteria`
|
|
396
|
-
list above with sub-headings — `## Core functionality`, `## Edge cases`,
|
|
397
|
-
`## Interaction / integration`, `## Tests` — each still a checklist of verifiable lines. See
|
|
398
|
-
step 4's "Sub-tasked Acceptance Criteria" note. This is the only body section that may gain
|
|
399
|
-
sub-headings; Goal, Implementation notes, and Out of scope stay flat.)
|
|
400
|
-
|
|
401
|
-
**Self-containment is load-bearing.** The executor (`claude -p`) starts with NO conversation
|
|
402
|
-
context — only the PRD body and the project files. So: include exact file paths (e.g.
|
|
403
|
-
`src/main/index.cjs:142`); quote function signatures or relevant code blocks if the executor
|
|
404
|
-
would have to grep for them; name the libraries/patterns to use (e.g. "use the existing
|
|
405
|
-
`validatePath` helper in `config.cjs`"); don't reference "the conversation we just had" or
|
|
406
|
-
"the design we discussed"; if a PRD depends on another PRD's output, say so in
|
|
407
|
-
`# Implementation notes` AND give it a higher `NN` so it queues after.
|
|
408
|
-
|
|
409
|
-
**Work-item shape — every PRD must be executable by a Sonnet-class executor in under 10
|
|
410
|
-
minutes (2026-09 calibration: wall p50 7.8 min, 60% of runs ≤ 10 min; authored estimates ran
|
|
411
|
-
4× high).**
|
|
412
|
-
- **One change-set per PRD**: ≤ 3 files edited, ≤ 1 new file, exactly ONE gate line (a
|
|
413
|
-
bounded command or an `&&` chain of at most two). If a PRD needs a new shared helper AND
|
|
414
|
-
its first consumer, that is two PRDs (`primitive` → `wire`).
|
|
415
|
-
- **≤ 6 AC lines**: each behavior line names file + symbol + the observable result; exactly
|
|
416
|
-
one tests line naming the test file and the test names; exactly one gate line. No
|
|
417
|
-
open-ended lines ("grep X and update whatever depends on it") — resolve the list yourself
|
|
418
|
-
while authoring and name the files.
|
|
419
|
-
- **Implementation notes are a recipe, not prose**: `Read first:` (≤ 4 files, with line
|
|
420
|
-
ranges), `Steps:` (numbered, each naming the file and the function/signature), `Do not
|
|
421
|
-
touch:` (files a sibling PRD owns). Quote a signature rather than describing it.
|
|
422
|
-
- **`estimateMinutes` ≤ 10 target, 15 ceiling** — project more, split. (The scheduler's kill
|
|
423
|
-
budget floors at 45 min regardless, so a low estimate never starves a run.)
|
|
424
|
-
- **Decomposition types** — name one per PRD in its first Goal sentence, and chain in this
|
|
425
|
-
order when several apply:
|
|
426
|
-
- `primitive` — one new helper/module + its unit test, no call sites.
|
|
427
|
-
- `wire` — adopt an existing primitive at named call sites, no logic change.
|
|
428
|
-
- `behavior` — one function's logic change + the test that pins it.
|
|
429
|
-
- `migration` — mechanical rename/move/config change, no logic; gate is typecheck/lint.
|
|
430
|
-
- `doc` — text only; gate is `lint:docs` or the doc's own test.
|
|
431
|
-
- `validate` — the plan's trailing validation PRD (see Phase 2).
|
|
432
|
-
- `scheduler_create_prd` returns `warnings[]` when a PRD exceeds these limits — fix the PRD
|
|
433
|
-
before confirming it to the user; never queue a warned PRD silently.
|
|
434
|
-
|
|
435
|
-
5. **Emit each PRD.** If you used `scheduler_create_prd`, this step is already done — the tool
|
|
436
|
-
wrote the file to the canonical path with the standards pointer included; skip to step 5.
|
|
437
|
-
**Fallback path only:** write to the canonical path and structure above, then **append `##
|
|
438
|
-
Engineering standards` with a one-line pointer**, not the file's contents:
|
|
439
|
-
```markdown
|
|
440
|
-
## Engineering standards
|
|
441
|
-
|
|
442
|
-
Before writing any code, read `<absolute path to standards.md, resolved above>` — it has the
|
|
443
|
-
Performance, Debugging, API-reuse, TDD, and Execution-discipline rules that apply to this PRD.
|
|
444
|
-
Every rule in it is mandatory, especially Execution discipline (bounded commands, verify
|
|
445
|
-
before done, the finish-protocol sentinel).
|
|
446
|
-
```
|
|
447
|
-
This is the load-bearing step — it's the only way the standards (incl. Execution discipline)
|
|
448
|
-
reach the headless run, and it now stays current automatically since the executor reads the
|
|
449
|
-
live file rather than a snapshot taken at authoring time. Honor the `PRD_AUTHORING.md` §10
|
|
450
|
-
pre-queue checklist.
|
|
451
|
-
|
|
452
|
-
6. **Confirm to the user**, per emitted PRD: filename, chosen `NN` + rationale
|
|
453
|
-
(parallel-with-X / serial-after-Y), `cwd`, and an ETA + token-cost ballpark. Note they can
|
|
454
|
-
"Run now" in the SchedulePanel or wait for `when-available` polling. Name the plan's validate
|
|
455
|
-
PRD and state that no per-PRD validation will be requested from this session.
|
|
456
|
-
|
|
457
|
-
## Phase 2 — Validation runs as its own job; this session only decides
|
|
458
|
-
|
|
459
|
-
Every plan queued in Phase 1 ends with a `validate` PRD (agentType `validator`) whose
|
|
460
|
-
`dependsOn` lists every other slug in the plan — or, for a plan over the 100-entry cap, just the
|
|
461
|
-
plan's sink PRDs, since `hasDownstreamValidator` walks `dependsOn` transitively and still credits
|
|
462
|
-
every upstream PRD — so the scheduler runs it exactly once, after the last work-item lands.
|
|
463
|
-
That job — not this session — re-runs each PRD's gate, checks every
|
|
464
|
-
acceptance criterion against the tree, reviews the plan's combined diff (`/code-review`,
|
|
465
|
-
`/security-review`), commits a review record, and ends with `VALIDATION: <slug>
|
|
466
|
-
VERIFIED|REFUTED` per PRD. The scheduler appends one verdict event per PRD to this Epic (the
|
|
467
|
-
traffic light reads them) plus one check-in for the validator itself.
|
|
468
|
-
|
|
469
|
-
7. **Do not poll and do not re-verify per PRD.** Completed work-items arrive here as check-in
|
|
470
|
-
events only; leave them alone. There is no 30-minute loop to start and no `ScheduleWakeup` to
|
|
471
|
-
arm. Act on exactly three signals:
|
|
472
|
-
- **A work-item parks `needs_review` / `failed`** — read the scheduler's auto-filed RCA
|
|
473
|
-
(`<date>-rca-<slug>-<runId>.md` in the project's feedback inbox) and decide: fix the PRD
|
|
474
|
-
(`scheduler_update_prd`) and `scheduler_reset_job`, or `scheduler_archive_prd` it. The
|
|
475
|
-
plan's validator waits behind it. A `rateLimited` exit is the scheduler's benign auto-pause
|
|
476
|
-
— not a signal.
|
|
477
|
-
- **The validator's check-in arrives** — read its review record. Every PRD VERIFIED and no
|
|
478
|
-
Critical/Important finding → the plan is done; report what landed (slugs, commits, record
|
|
479
|
-
path). Any REFUTED PRD or Critical/Important finding → queue a fix wave: one `behavior`/
|
|
480
|
-
`wire` PRD per finding (recipe format, ≤ 10 min each), no `dependsOn`, plus a new trailing
|
|
481
|
-
`validate` PRD for the wave. Do not fix inline.
|
|
482
|
-
- **The validator itself parks** — treat it like any parked job; its RCA says why the
|
|
483
|
-
procedure could not run.
|
|
484
|
-
|
|
485
|
-
8. **Definition of done** = the plan's latest validator reported every PRD VERIFIED with no open
|
|
486
|
-
Critical/Important finding, and its review record is committed. Report: what landed (PRD
|
|
487
|
-
slugs, commits), the record path, findings deferred as Minor, anything left open. A plan with
|
|
488
|
-
a REFUTED PRD is never "done with caveats" — it gets a fix wave or an explicit human decision
|
|
489
|
-
to stop.
|
|
490
|
-
|
|
491
|
-
## References (reuse, don't duplicate)
|
|
492
|
-
|
|
493
|
-
- `~/.claude/session-manager/scheduled-plans/PRD_AUTHORING.md` — the §1–§10 safety rules.
|
|
494
|
-
- `standards.md` beside this file — the engineering + execution-discipline rules. Every PRD points the executor at its absolute path (see "Standards" above) rather than embedding a copy.
|
|
495
|
-
- `test-driven-development`, `systematic-debugging` — interactive dev sessions.
|
|
496
|
-
- `validator` persona (src/seed/agents/validator.md) — the plan-level review point for scheduled
|
|
497
|
-
work; `requesting-code-review` — interactive sessions reviewing their own inline work only.
|
|
498
|
-
|
|
499
|
-
## Notes
|
|
500
|
-
|
|
501
|
-
- Submit each PRD through `scheduler_create_prd`, then confirm — don't draft them inline in chat
|
|
502
|
-
for review first. Only hand-write the file when the tool is PRESENT but ERRORS as unreachable
|
|
503
|
-
(app not running) — see the "Two failure modes" note above, including its mandatory bypass
|
|
504
|
-
warning. If the tool is ABSENT from your tool list, that's a misconfiguration, not an offline
|
|
505
|
-
app: stop and tell the human, never hand-write the file.
|
|
506
|
-
- Don't combine unrelated features into one PRD. One focused, completable unit each.
|
|
507
|
-
- Don't add a `parallelGroup` frontmatter key — the filename `NN-` prefix drives grouping.
|
|
508
|
-
- Don't write a PRD to `data/prds/`, `docs/prds/`, the project's own folder, or anywhere outside
|
|
509
|
-
the canonical path — and don't reach for a hand-written file at the canonical path either, when
|
|
510
|
-
`scheduler_create_prd` is reachable. The user has explicitly flagged this as a recurring
|
|
511
|
-
problem.
|
|
512
|
-
- Don't leave `cwd` unset hoping for the default. Be explicit.
|
|
513
|
-
- Don't skip a step-3 lens silently and don't force every request into a chain — most asks are
|
|
514
|
-
still an independent set of small PRDs; reach for the 3-5-PRD evolving chain only when the
|
|
515
|
-
work is genuinely sequential (each link depends on the previous one's landed state), and never
|
|
516
|
-
chain past 5 links.
|
|
194
|
+
5. Notes: "Work as the validator persona — the procedure is your system prompt." and a line
|
|
195
|
+
`Base: <sha>`, the SHA from step 11.
|
|
196
|
+
6. `gate: ["none"]`; `files`: the record path. Why: the validator re-runs each PRD's gate
|
|
197
|
+
itself, and a REFUTED PRD is still a successful validation.
|
|
198
|
+
|
|
199
|
+
The validator prints `VALIDATION: <slug> VERIFIED` or `VALIDATION: <slug> REFUTED — <reason>`
|
|
200
|
+
per PRD. While it is pending, the scheduler skips per-PRD validation prompts and in-run review.
|
|
201
|
+
|
|
202
|
+
If the API rejects `agentType: "validator"`, the persona is not installed: keep the plan
|
|
203
|
+
queued, say so, ask the human to restart the app, and answer each VALIDATION REQUEST the
|
|
204
|
+
scheduler sends here. Never write the record yourself.
|
|
205
|
+
|
|
206
|
+
## Phase 2 — track to done
|
|
207
|
+
|
|
208
|
+
The scheduler heals most parks itself:
|
|
209
|
+
|
|
210
|
+
1. Transcript-noise parks (verdicts transcript_errors, no_verdict_sentinel,
|
|
211
|
+
abandoned_background_task) complete when the gate re-run is green, the landed commit is on
|
|
212
|
+
HEAD and the tracked tree is clean.
|
|
213
|
+
2. Stray-checkout parks (the main checkout was on another branch) are re-landed onto the base
|
|
214
|
+
branch ref without touching the checkout.
|
|
215
|
+
3. needs_review notices are held and grouped per Epic and cause. One notice is sent only when
|
|
216
|
+
the ladder gives up or the hold time ends (default 4 hours, `SM_REVIEW_NOTICE_HOLD_MINUTES`).
|
|
217
|
+
|
|
218
|
+
Rules:
|
|
219
|
+
|
|
220
|
+
1. Do not poll, re-verify each PRD, or arm ScheduleWakeup or a loop. Finished PRDs arrive as
|
|
221
|
+
check-in events; leave them alone.
|
|
222
|
+
2. Do not re-queue or reset on a single park or a rate-limit pause. Why: the scheduler may
|
|
223
|
+
still heal it; a duplicate races the healed run.
|
|
224
|
+
3. Act only on these signals:
|
|
225
|
+
1. **A grouped scheduler notice** (needs_review). Read each file on its `Reports:` line. For
|
|
226
|
+
each PRD on its `PRDs:` line, take the first case that fits:
|
|
227
|
+
1. It is skipped and the plan's validate PRD has not run yet: do nothing. The validator
|
|
228
|
+
reports it, and the fix wave covers it.
|
|
229
|
+
2. Its spec is wrong: fix it with `scheduler_update_prd`, then call `scheduler_reset_job`
|
|
230
|
+
(add `force: true` if it is skipped). Always edit first. Why: a reset job can start on
|
|
231
|
+
the next tick. The tool does not check the new body, so copy the `# Gate` and
|
|
232
|
+
`# Files` sections unchanged unless they are what is wrong.
|
|
233
|
+
3. Its spec is right: call `scheduler_reset_job` (add `force: true` if it is skipped).
|
|
234
|
+
4. Another PRD or a human already did the work: confirm it in the tree, then call
|
|
235
|
+
`scheduler_archive_prd`. Archiving marks it completed and frees the PRDs that depend on
|
|
236
|
+
it.
|
|
237
|
+
A parked validator arrives this way too.
|
|
238
|
+
2. **A validator verdict.** Read its record. A `REFUTED` PRD, or a Critical or Important
|
|
239
|
+
finding, means a fix wave: one `behavior` or `wire` PRD per finding plus a new validate
|
|
240
|
+
PRD. Never fix inline.
|
|
241
|
+
3. **A VALIDATION REQUEST**, only when the plan has no validate PRD. Follow the steps in the
|
|
242
|
+
request.
|
|
243
|
+
4. **Done** = the latest validator marked every PRD `VERIFIED`, no Critical or Important
|
|
244
|
+
finding is open, and its record is committed. Never "done with caveats": a REFUTED PRD gets
|
|
245
|
+
a fix wave or an explicit human decision to stop.
|
|
246
|
+
|
|
247
|
+
### Final report
|
|
248
|
+
|
|
249
|
+
1. What landed: each PRD slug and its commit.
|
|
250
|
+
2. The validation record path.
|
|
251
|
+
3. Minor findings deferred.
|
|
252
|
+
4. Anything still open.
|
|
253
|
+
5. Any warning kept or validator skipped.
|
|
254
|
+
|
|
255
|
+
## Never
|
|
256
|
+
|
|
257
|
+
- Write a PRD by hand, or anywhere the API does not. `data/prds/`, `docs/prds/`,
|
|
258
|
+
`~/.claude/session-manager/scheduled-plans/prds/` and the retired flat
|
|
259
|
+
`session-manager-operations/scheduler/prds/` never run.
|
|
260
|
+
- Combine unrelated features in one PRD.
|