forge-workflow 0.0.9 → 0.1.0-beta.2
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/.claude/rules/{greptile-review-process.md → review-process.md} +56 -41
- package/.claude/scripts/{greptile-resolve.sh → review-resolve.sh} +13 -3
- package/.cursor/rules/permissions-guidance.mdc +2 -2
- package/.forge/hooks/check-tdd.js +3 -0
- package/.forge/hooks/forge-native-hook.js +245 -0
- package/.forge/protected-paths.yaml +157 -0
- package/AGENTS.md +151 -61
- package/CHANGELOG.md +681 -0
- package/CLAUDE.md +9 -106
- package/QUICKSTART.md +171 -0
- package/README.md +271 -363
- package/bin/forge-cmd.js +120 -9
- package/bin/forge-preflight.js +26 -5
- package/bin/forge.js +466 -489
- package/docs/INDEX.md +93 -0
- package/docs/PROJECT_DESIGN.md +685 -0
- package/docs/architecture/index.md +66 -0
- package/docs/architecture/notes/README.md +35 -0
- package/docs/architecture/subsystems/README.md +46 -0
- package/docs/{TOOLCHAIN.md → forge/TOOLCHAIN.md} +56 -47
- package/docs/forge/VALIDATION.md +82 -0
- package/docs/{AGENT_INSTALL_PROMPT.md → guides/AGENT_INSTALL_PROMPT.md} +3 -3
- package/docs/guides/BEADS_GITHUB_SYNC.md +32 -0
- package/docs/{ENHANCED_ONBOARDING.md → guides/ENHANCED_ONBOARDING.md} +16 -12
- package/docs/guides/GREPTILE_SETUP.md +46 -0
- package/docs/guides/MANUAL_REVIEW_GUIDE.md +58 -0
- package/docs/guides/MIGRATION.md +56 -0
- package/docs/guides/SETUP.md +118 -0
- package/docs/guides/SUPPORT.md +185 -0
- package/docs/guides/WORKFLOW_TEMPLATES.md +74 -0
- package/docs/guides/memory-backends.md +183 -0
- package/docs/reference/ADAPTERS.md +128 -0
- package/docs/reference/AGENT_SKILL_PARITY.md +175 -0
- package/docs/reference/COMMANDS.md +205 -0
- package/docs/reference/DECISION_DRIFT_GUARDS.md +97 -0
- package/docs/{EXAMPLES.md → reference/EXAMPLES.md} +7 -5
- package/docs/reference/FORGE_KERNEL_STORAGE_MODEL.md +135 -0
- package/docs/reference/HERMES_INTEGRATION.md +118 -0
- package/docs/reference/INSIGHTS_RECAP.md +63 -0
- package/docs/reference/INSTALL.md +164 -0
- package/docs/reference/KERNEL_TAXONOMY_VALIDATION.md +161 -0
- package/docs/reference/PROTECTED_PATH_MANIFEST.md +25 -0
- package/docs/reference/RELEASE.md +68 -0
- package/docs/reference/RESEARCH_TEMPLATE.md +292 -0
- package/docs/{ROADMAP.md → reference/ROADMAP.md} +12 -9
- package/docs/reference/SKILLS.md +35 -0
- package/docs/reference/STATUS_BOARD.md +80 -0
- package/docs/reference/TEMPLATES.md +106 -0
- package/docs/reference/TOOLCHAIN.md +658 -0
- package/docs/reference/VALIDATION.md +82 -0
- package/docs/reference/agent-permissions.md +169 -0
- package/docs/reference/beads-to-kernel-migration-ux.md +61 -0
- package/docs/reference/control-plane-guarantees.md +125 -0
- package/docs/reference/dependency-chain.md +331 -0
- package/docs/reference/forge-kernel-issue-command-contract.md +161 -0
- package/docs/reference/forge-kernel-schema.md +72 -0
- package/docs/reference/kernel-conflict-evaluators.md +27 -0
- package/docs/reference/patch-md-format.md +77 -0
- package/docs/reference/protected-state-surfaces.md +59 -0
- package/docs/reference/shepherd.md +115 -0
- package/docs/reference/superpowers-analysis.md +320 -0
- package/docs/reference/superpowers-integration-options.md +404 -0
- package/docs/reference/test-environment.md +519 -0
- package/docs/reference/upgrade-safety.md +59 -0
- package/lefthook.yml +18 -0
- package/lib/adapter-cli.js +307 -0
- package/lib/adapters/beads-issue-adapter.js +127 -0
- package/lib/adapters/beads-kernel-compat.js +1042 -0
- package/lib/adapters/greptile-review-adapter.js +141 -0
- package/lib/adapters/kernel-issue-adapter.js +101 -0
- package/lib/adapters/pr-state-adapter.js +484 -0
- package/lib/adoption-profiles.js +126 -0
- package/lib/agents/README.md +2 -6
- package/lib/agents/claude.plugin.json +3 -8
- package/lib/agents/codex.plugin.json +9 -1
- package/lib/agents/cursor.plugin.json +2 -6
- package/lib/agents/hermes.plugin.json +22 -0
- package/lib/agents-config.js +39 -1236
- package/lib/audit-evidence.js +282 -0
- package/lib/beads-setup.js +225 -28
- package/lib/beads-sync-scaffold.js +36 -107
- package/lib/codex-skills.js +51 -1
- package/lib/commands/_issue.js +744 -70
- package/lib/commands/_manifest.js +91 -0
- package/lib/commands/_registry.js +85 -34
- package/lib/commands/_resolve-command-opts.js +261 -0
- package/lib/commands/_serve-security.js +270 -0
- package/lib/commands/adapter.js +12 -0
- package/lib/commands/add.js +118 -0
- package/lib/commands/audit.js +70 -0
- package/lib/commands/blocked.js +5 -0
- package/lib/commands/board.js +64 -0
- package/lib/commands/claim.js +21 -2
- package/lib/commands/claims.js +7 -0
- package/lib/commands/clean.js +485 -75
- package/lib/commands/close.js +2 -2
- package/lib/commands/comment.js +5 -0
- package/lib/commands/control.js +148 -0
- package/lib/commands/create.js +2 -2
- package/lib/commands/dev.js +185 -7
- package/lib/commands/doc-gate.js +336 -0
- package/lib/commands/doctor.js +156 -0
- package/lib/commands/explain.js +15 -0
- package/lib/commands/export.js +237 -0
- package/lib/commands/gate.js +192 -0
- package/lib/commands/hooks.js +242 -0
- package/lib/commands/inbox.js +118 -0
- package/lib/commands/init.js +598 -0
- package/lib/commands/insights.js +79 -0
- package/lib/commands/issue.js +12 -1
- package/lib/commands/issues.js +66 -0
- package/lib/commands/lint.js +5 -0
- package/lib/commands/list.js +2 -2
- package/lib/commands/merge.js +312 -0
- package/lib/commands/migrate.js +523 -0
- package/lib/commands/new.js +12 -0
- package/lib/commands/options.js +241 -0
- package/lib/commands/orient.js +13 -0
- package/lib/commands/orphans.js +5 -0
- package/lib/commands/patch.js +67 -0
- package/lib/commands/plan.js +436 -24
- package/lib/commands/preflight.js +211 -0
- package/lib/commands/prime.js +13 -0
- package/lib/commands/push.js +69 -2
- package/lib/commands/ready.js +2 -2
- package/lib/commands/recall.js +116 -0
- package/lib/commands/recap.js +61 -0
- package/lib/commands/recommend.js +22 -2
- package/lib/commands/release.js +91 -0
- package/lib/commands/remember.js +74 -0
- package/lib/commands/role.js +99 -0
- package/lib/commands/serve.js +581 -0
- package/lib/commands/setup.js +851 -979
- package/lib/commands/shepherd.js +436 -0
- package/lib/commands/ship.js +23 -1
- package/lib/commands/show.js +2 -2
- package/lib/commands/stage.js +192 -0
- package/lib/commands/stale.js +5 -0
- package/lib/commands/status.js +329 -11
- package/lib/commands/sync.js +34 -46
- package/lib/commands/team.js +15 -2
- package/lib/commands/test.js +58 -7
- package/lib/commands/update.js +2 -2
- package/lib/commands/upgrade.js +47 -0
- package/lib/commands/validate.js +56 -25
- package/lib/commands/worktree.js +308 -128
- package/lib/config-writer.js +202 -0
- package/lib/control-plane.js +236 -0
- package/lib/core/runtime-graph.js +946 -0
- package/lib/dep-guard/keyword-ripple.js +184 -0
- package/lib/deprecated-sync-cleanup.js +362 -0
- package/lib/detect-agent.js +2 -28
- package/lib/detect-worktree.js +42 -17
- package/lib/doc-gate/declaration.js +177 -0
- package/lib/doc-gate/detect.js +289 -0
- package/lib/doc-gate/gate.js +375 -0
- package/lib/doc-gate/okf-config.js +128 -0
- package/lib/doc-gate/okf.js +429 -0
- package/lib/docs-command.js +1161 -6
- package/lib/forge-issues.js +697 -0
- package/lib/forge-lock.js +262 -0
- package/lib/gate-events.js +193 -0
- package/lib/global-flags.js +74 -0
- package/lib/greptile-match.js +7 -63
- package/lib/harness-capability-matrix.js +380 -0
- package/lib/hook-global-installer.js +347 -0
- package/lib/hook-renderer.js +451 -0
- package/lib/inbox.js +391 -0
- package/lib/insights.js +397 -0
- package/lib/issue-adapter.js +156 -0
- package/lib/issue-backend.js +145 -0
- package/lib/issue-render.js +220 -0
- package/lib/issue-sync/authority.js +100 -0
- package/lib/issue-sync/github-pull.js +184 -0
- package/lib/issue-sync/import-primitives.js +98 -0
- package/lib/issue-sync/legacy-link-bridge.js +436 -0
- package/lib/issue-sync/link-store.js +292 -0
- package/lib/issue-sync/project-github.js +123 -0
- package/lib/issue-sync/reconcile.js +195 -0
- package/lib/issue-sync/schema.js +126 -0
- package/lib/kernel/backing-issue.js +305 -0
- package/lib/kernel/broker.js +1218 -0
- package/lib/kernel/cli-broker-factory.js +130 -0
- package/lib/kernel/conflict-signal.js +82 -0
- package/lib/kernel/evaluators.js +195 -0
- package/lib/kernel/fs-class.js +495 -0
- package/lib/kernel/issue-command-contract.js +559 -0
- package/lib/kernel/issue-id-resolver.js +186 -0
- package/lib/kernel/lease-enforcer.js +158 -0
- package/lib/kernel/migrations.js +333 -0
- package/lib/kernel/planning-buckets-schema.js +109 -0
- package/lib/kernel/projection-jsonl-writer.js +450 -0
- package/lib/kernel/readiness-model.js +329 -0
- package/lib/kernel/schema.js +356 -0
- package/lib/kernel/sqlite-driver.js +2504 -0
- package/lib/kernel/taxonomy-validator.js +394 -0
- package/lib/lefthook-check.js +8 -4
- package/lib/lefthook-wiring.js +413 -0
- package/lib/mcp-config-renderer.js +288 -0
- package/lib/memory/graphiti-mcp.js +106 -0
- package/lib/memory/router.js +387 -0
- package/lib/memory/typed-api.js +102 -0
- package/lib/memory-digest.js +195 -0
- package/lib/merge-rules.js +395 -0
- package/lib/migrate-dry-run.js +466 -0
- package/lib/orientation.js +863 -0
- package/lib/package-manager-remediation.js +103 -0
- package/lib/package-root.js +381 -0
- package/lib/patch-intent.js +890 -0
- package/lib/plugin-catalog.js +3 -4
- package/lib/plugin-manager.js +0 -5
- package/lib/pr-bundle.js +186 -0
- package/lib/pr-monitor/differ.js +195 -0
- package/lib/pr-monitor/events.js +0 -0
- package/lib/pr-monitor/gather.js +124 -0
- package/lib/pr-monitor/journal.js +299 -0
- package/lib/pr-monitor/monitor.js +146 -0
- package/lib/pr-monitor/render-sticky.js +157 -0
- package/lib/pr-monitor/watch-lifecycle.js +95 -0
- package/lib/pr-monitor/watch.js +247 -0
- package/lib/pr-pull.js +1273 -0
- package/lib/pr-shepherd.js +494 -0
- package/lib/pr-state-validator.js +59 -0
- package/lib/preflight/gates.js +237 -0
- package/lib/preflight/runner.js +116 -0
- package/lib/project-discovery.js +0 -53
- package/lib/project-memory.js +166 -0
- package/lib/protected-path-manifest.js +281 -0
- package/lib/protected-state-surfaces.js +387 -0
- package/lib/release-readiness.js +2089 -0
- package/lib/reset.js +59 -45
- package/lib/review-adapter.js +68 -0
- package/lib/rules-sync.js +260 -0
- package/lib/runtime-health.js +332 -23
- package/lib/safety-config-renderer.js +268 -0
- package/lib/setup-action-log.js +1 -7
- package/lib/setup.js +27 -65
- package/lib/shell-utils.js +76 -6
- package/lib/skills-sync.js +330 -0
- package/lib/smart-status/conflicts.js +205 -0
- package/lib/smart-status/scoring.js +191 -0
- package/lib/status/beads-snapshot.js +145 -0
- package/lib/status/presenter.js +216 -0
- package/lib/status/snapshot.js +186 -0
- package/lib/sync-backend.js +202 -0
- package/lib/untrusted-content.js +52 -0
- package/lib/upgrade-safety.js +199 -0
- package/lib/workflow/enforce-stage.js +298 -47
- package/lib/workflow/stage-transition.js +115 -0
- package/lib/workflow/stages.js +30 -6
- package/lib/workflow/state-manager.js +159 -14
- package/lib/workflow/state.js +23 -1
- package/lib/workflow-profiles.js +17 -5
- package/package.json +46 -36
- package/rules/documentation.md +19 -0
- package/rules/kernel-tracking.md +26 -0
- package/rules/security.md +22 -0
- package/rules/tdd.md +20 -0
- package/rules/workflow.md +27 -0
- package/scripts/auto-backing-issue.js +47 -0
- package/scripts/beads-context.sh +165 -22
- package/scripts/beads-migrate-to-dolt.sh +7 -0
- package/scripts/beads-upgrade-smoke.sh +284 -0
- package/scripts/behavioral-judge.sh +115 -11
- package/scripts/benchmark.js +349 -63
- package/scripts/bootstrap-windows-tools.sh +78 -0
- package/scripts/branch-protection.js +2 -3
- package/scripts/check-agents.js +34 -137
- package/scripts/commitlint.js +3 -1
- package/scripts/conflict-detect.sh +3 -0
- package/scripts/dep-guard-analyze.js +52 -17
- package/scripts/dep-guard-keyword-ripple.js +29 -0
- package/scripts/dep-guard-render-review.js +86 -0
- package/scripts/dep-guard.sh +64 -232
- package/scripts/file-index.sh +3 -0
- package/scripts/forge-team/lib/claim.sh +34 -18
- package/scripts/forge-team/lib/dashboard.sh +61 -86
- package/scripts/forge-team/lib/epic.sh +99 -263
- package/scripts/forge-team/lib/hooks.sh +26 -28
- package/scripts/forge-team/lib/identity.sh +4 -4
- package/scripts/forge-team/lib/sync-github.sh +144 -47
- package/scripts/forge-team/lib/verify.sh +93 -83
- package/scripts/forge-team/lib/workload.sh +41 -65
- package/scripts/forge-team/tests/claim.test.sh +25 -19
- package/scripts/forge-team/tests/dashboard.test.sh +31 -46
- package/scripts/forge-team/tests/epic.test.sh +52 -71
- package/scripts/forge-team/tests/hooks.test.sh +38 -50
- package/scripts/forge-team/tests/identity.test.sh +3 -3
- package/scripts/forge-team/tests/integration.test.sh +44 -66
- package/scripts/forge-team/tests/sync-github.test.sh +183 -79
- package/scripts/forge-team/tests/verify.test.sh +37 -46
- package/scripts/forge-team/tests/workflow-integration.test.sh +4 -4
- package/scripts/forge-team/tests/workload.test.sh +32 -66
- package/scripts/gen-command-manifest.js +153 -0
- package/scripts/gen-embedded-assets.mjs +129 -0
- package/scripts/install.ps1 +139 -0
- package/scripts/install.sh +268 -0
- package/scripts/lib/beads-migrate-to-dolt.mjs +503 -0
- package/scripts/lib/release-asset.mjs +84 -0
- package/scripts/parity-check.mjs +145 -0
- package/scripts/parity-check.test.mjs +58 -0
- package/scripts/pin-agentic-workflow-images.js +112 -0
- package/scripts/pr-coordinator.sh +3 -0
- package/scripts/preflight-sonar.eslint.config.mjs +44 -0
- package/scripts/preflight.sh +108 -0
- package/scripts/protected-state-check.js +104 -0
- package/scripts/smart-status-score.js +31 -0
- package/scripts/smart-status-sessions.js +51 -0
- package/scripts/smart-status.sh +117 -369
- package/scripts/spikes/config-race-bench.js +111 -0
- package/scripts/spikes/harness-capability-matrix.js +13 -0
- package/scripts/spikes/patch-anchor-stability-bench.js +125 -0
- package/scripts/spikes/protected-path-manifest.js +20 -0
- package/scripts/spikes/skill-auto-invoke-parity.js +292 -0
- package/scripts/sync-agent-skills.js +62 -0
- package/scripts/sync-agentic-workflow.js +48 -0
- package/scripts/sync-utils.sh +3 -0
- package/scripts/test-ci-shard.js +251 -0
- package/scripts/test-dashboard.js +188 -52
- package/scripts/test-full-suite.js +186 -0
- package/scripts/test-profile.js +278 -0
- package/scripts/test.js +302 -28
- package/scripts/validate.js +143 -0
- package/scripts/validate.sh +18 -1
- package/skills/claim-safety/SKILL.md +102 -0
- package/skills/claim-safety/evals/evals.json +46 -0
- package/{.github/prompts/dev.prompt.md → skills/dev/SKILL.md} +46 -52
- package/skills/dev/evals/evals.json +50 -0
- package/skills/hermes-forge/SKILL.md +185 -0
- package/skills/hermes-forge/evals/evals.json +46 -0
- package/skills/issue-basics/SKILL.md +111 -0
- package/skills/issue-basics/evals/evals.json +46 -0
- package/skills/kernel/SKILL.md +166 -0
- package/skills/kernel/evals/evals.json +50 -0
- package/skills/memory/SKILL.md +102 -0
- package/skills/parallel-deep-research/SKILL.md +14 -11
- package/skills/parallel-deep-research/evals/evals.json +11 -27
- package/{.github/prompts/plan.prompt.md → skills/plan/SKILL.md} +134 -159
- package/skills/plan/evals/evals.json +42 -0
- package/skills/research/SKILL.md +195 -0
- package/skills/research/evals/evals.json +42 -0
- package/{.github/prompts/review.prompt.md → skills/review/SKILL.md} +98 -62
- package/skills/review/evals/evals.json +42 -0
- package/skills/rollback/SKILL.md +110 -0
- package/skills/rollback/evals/evals.json +46 -0
- package/skills/rollback/references/methods.md +204 -0
- package/{.cursor/commands/rollback.md → skills/rollback/references/workflow-integration.md} +10 -284
- package/skills/shepherd/SKILL.md +66 -0
- package/skills/shepherd/evals/evals.json +42 -0
- package/skills/ship/SKILL.md +251 -0
- package/skills/ship/evals/evals.json +42 -0
- package/skills/smith/SKILL.md +142 -0
- package/skills/smith/evals/evals.json +46 -0
- package/skills/smith/references/autonomy-and-gates.md +94 -0
- package/{.github/prompts/sonarcloud.prompt.md → skills/sonarcloud/SKILL.md} +14 -3
- package/skills/sonarcloud/evals/evals.json +46 -0
- package/skills/sonarcloud-analysis/SKILL.md +18 -13
- package/skills/sonarcloud-analysis/evals/evals.json +11 -15
- package/skills/status/SKILL.md +102 -0
- package/skills/status/evals/evals.json +50 -0
- package/skills/triage-ready/SKILL.md +121 -0
- package/skills/triage-ready/evals/evals.json +42 -0
- package/{.github/prompts/validate.prompt.md → skills/validate/SKILL.md} +52 -29
- package/skills/validate/evals/evals.json +42 -0
- package/skills/verify/SKILL.md +299 -0
- package/skills/verify/evals/evals.json +50 -0
- package/.claude/commands/dev.md +0 -345
- package/.claude/commands/plan.md +0 -566
- package/.claude/commands/premerge.md +0 -186
- package/.claude/commands/research.md +0 -42
- package/.claude/commands/review.md +0 -451
- package/.claude/commands/rollback.md +0 -721
- package/.claude/commands/ship.md +0 -213
- package/.claude/commands/sonarcloud.md +0 -152
- package/.claude/commands/status.md +0 -90
- package/.claude/commands/validate.md +0 -288
- package/.claude/commands/verify.md +0 -269
- package/.claude/rules/workflow.md +0 -121
- package/.cline/workflows/dev.md +0 -342
- package/.cline/workflows/plan.md +0 -563
- package/.cline/workflows/premerge.md +0 -183
- package/.cline/workflows/research.md +0 -39
- package/.cline/workflows/review.md +0 -448
- package/.cline/workflows/rollback.md +0 -718
- package/.cline/workflows/ship.md +0 -210
- package/.cline/workflows/sonarcloud.md +0 -146
- package/.cline/workflows/status.md +0 -87
- package/.cline/workflows/validate.md +0 -285
- package/.cline/workflows/verify.md +0 -266
- package/.codex/config.toml +0 -11
- package/.codex/skills/dev/SKILL.md +0 -345
- package/.codex/skills/plan/SKILL.md +0 -566
- package/.codex/skills/premerge/SKILL.md +0 -186
- package/.codex/skills/research/SKILL.md +0 -42
- package/.codex/skills/review/SKILL.md +0 -451
- package/.codex/skills/rollback/SKILL.md +0 -721
- package/.codex/skills/ship/SKILL.md +0 -213
- package/.codex/skills/sonarcloud/SKILL.md +0 -149
- package/.codex/skills/status/SKILL.md +0 -90
- package/.codex/skills/validate/SKILL.md +0 -288
- package/.codex/skills/verify/SKILL.md +0 -269
- package/.cursor/commands/dev.md +0 -342
- package/.cursor/commands/plan.md +0 -563
- package/.cursor/commands/premerge.md +0 -183
- package/.cursor/commands/research.md +0 -39
- package/.cursor/commands/review.md +0 -448
- package/.cursor/commands/ship.md +0 -210
- package/.cursor/commands/sonarcloud.md +0 -146
- package/.cursor/commands/status.md +0 -87
- package/.cursor/commands/validate.md +0 -285
- package/.cursor/commands/verify.md +0 -266
- package/.cursorrules +0 -149
- package/.github/prompts/premerge.prompt.md +0 -188
- package/.github/prompts/research.prompt.md +0 -44
- package/.github/prompts/rollback.prompt.md +0 -723
- package/.github/prompts/ship.prompt.md +0 -215
- package/.github/prompts/status.prompt.md +0 -92
- package/.github/prompts/verify.prompt.md +0 -271
- package/.github/workflows/beads-to-github.yml +0 -56
- package/.github/workflows/github-to-beads.yml +0 -97
- package/.kilocode/workflows/dev.md +0 -346
- package/.kilocode/workflows/plan.md +0 -567
- package/.kilocode/workflows/premerge.md +0 -187
- package/.kilocode/workflows/research.md +0 -43
- package/.kilocode/workflows/review.md +0 -452
- package/.kilocode/workflows/rollback.md +0 -722
- package/.kilocode/workflows/ship.md +0 -214
- package/.kilocode/workflows/sonarcloud.md +0 -150
- package/.kilocode/workflows/status.md +0 -91
- package/.kilocode/workflows/validate.md +0 -289
- package/.kilocode/workflows/verify.md +0 -270
- package/.opencode/commands/dev.md +0 -345
- package/.opencode/commands/plan.md +0 -566
- package/.opencode/commands/premerge.md +0 -186
- package/.opencode/commands/research.md +0 -42
- package/.opencode/commands/review.md +0 -451
- package/.opencode/commands/rollback.md +0 -721
- package/.opencode/commands/ship.md +0 -213
- package/.opencode/commands/sonarcloud.md +0 -149
- package/.opencode/commands/status.md +0 -90
- package/.opencode/commands/validate.md +0 -288
- package/.opencode/commands/verify.md +0 -269
- package/.roo/commands/dev.md +0 -346
- package/.roo/commands/plan.md +0 -567
- package/.roo/commands/premerge.md +0 -187
- package/.roo/commands/research.md +0 -43
- package/.roo/commands/review.md +0 -452
- package/.roo/commands/rollback.md +0 -722
- package/.roo/commands/ship.md +0 -214
- package/.roo/commands/sonarcloud.md +0 -150
- package/.roo/commands/status.md +0 -91
- package/.roo/commands/validate.md +0 -289
- package/.roo/commands/verify.md +0 -270
- package/docs/BEADS_GITHUB_SYNC.md +0 -255
- package/docs/GREPTILE_SETUP.md +0 -400
- package/docs/MANUAL_REVIEW_GUIDE.md +0 -106
- package/docs/SETUP.md +0 -663
- package/docs/VALIDATION.md +0 -363
- package/lib/agents/cline.plugin.json +0 -29
- package/lib/agents/copilot.plugin.json +0 -24
- package/lib/agents/kilocode.plugin.json +0 -22
- package/lib/agents/opencode.plugin.json +0 -23
- package/lib/agents/roo.plugin.json +0 -30
- package/lib/beads-health-check.js +0 -143
- package/lib/commands/commands-reset.js +0 -147
- package/opencode.json +0 -67
- package/scripts/beads-context.test.js +0 -567
- package/scripts/github-beads-sync/comment.mjs +0 -64
- package/scripts/github-beads-sync/config.mjs +0 -148
- package/scripts/github-beads-sync/github-api.mjs +0 -131
- package/scripts/github-beads-sync/index.mjs +0 -332
- package/scripts/github-beads-sync/label-mapper.mjs +0 -54
- package/scripts/github-beads-sync/mapping.mjs +0 -78
- package/scripts/github-beads-sync/reverse-sync-cli.mjs +0 -31
- package/scripts/github-beads-sync/reverse-sync.mjs +0 -138
- package/scripts/github-beads-sync/run-bd.mjs +0 -161
- package/scripts/github-beads-sync/sanitize.mjs +0 -121
- package/scripts/github-beads-sync.config.json +0 -26
- package/scripts/sync-commands.js +0 -600
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shepherd
|
|
3
|
+
description: >
|
|
4
|
+
Monitor an already-reviewed OPEN pull request toward merge: read the CI/check rollup and the
|
|
5
|
+
branch-protection required-check set, take at most one idempotent action (re-run a flaky
|
|
6
|
+
required check, or post a status reply to a thread), then declare MERGE_READY, PENDING, or
|
|
7
|
+
escalate. Use when the user says "is PR #123 ready to merge yet?", "poll/watch the checks on
|
|
8
|
+
my PR", "the required CI job is flaky — kick off a re-run", "keep an eye on this PR until
|
|
9
|
+
it's green", "babysit the checks after /review", "shepherd PR 45", or "monitor the PR toward
|
|
10
|
+
merge (rebase if behind, --auto-rebase)". NEVER merges (the human merges in the GitHub UI),
|
|
11
|
+
edits code, or resolves review threads. Do NOT use to fix or reply-and-resolve PR feedback
|
|
12
|
+
from Greptile/CodeRabbit/SonarCloud — that is `review`; nor to open/push the PR — that is
|
|
13
|
+
`ship`; nor for the post-merge "CI green on master + close issues" check — that is `verify`;
|
|
14
|
+
nor for a general "where am I / what's in flight" report — that is `status`.
|
|
15
|
+
allowed-tools: Bash, Read, Grep, Glob
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Run one bounded monitor pass over a pull request: read CI and check state, take at most one idempotent action, then hand off. Never merges and never resolves review threads.
|
|
19
|
+
|
|
20
|
+
# Shepherd
|
|
21
|
+
|
|
22
|
+
`shepherd` is a **utility command, not a workflow stage.** It automates the polling / rerun / escalation loop that today is done by hand after `/review`. It does **not** replace `/review` (which still owns semantic review and its stage transition) and does **not** perform the pre-merge doc gate (embedded in `/ship` and `/review`).
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
forge shepherd <pr-number>
|
|
28
|
+
forge shepherd <pr-number> --auto-rebase # opt-in, default OFF
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Bounded-pass model (one pass = one invocation)
|
|
32
|
+
|
|
33
|
+
Each `forge shepherd <pr>` invocation is **ONE discrete bounded pass**: it reads PR state, takes at most the allowed Tier-A action, then **exits**. It never sits in-process polling "until merge-ready."
|
|
34
|
+
|
|
35
|
+
This mirrors the project's documented ergonomic from `/review`, the pre-merge gate, and the Greptile process: **poll briefly, then stop and hand off.** Any pass that finds checks still pending exits as `PENDING`, and the next scheduled pass picks up where it left off.
|
|
36
|
+
|
|
37
|
+
A `--watch` affordance, if you want one, lives in an **external scheduler** (e.g. cron or a `/loop`) that re-invokes the bounded pass on an interval with debounce (>= 60s between passes, cancel-in-progress). There is no in-process infinite loop.
|
|
38
|
+
|
|
39
|
+
## What it never does
|
|
40
|
+
|
|
41
|
+
- **Never merges.** There is no merge action and no server-side auto-merge latch. The shepherd terminates at `MERGE_READY` and hands off to the human, who merges in the GitHub UI (mirroring the pre-merge gate's merge handoff).
|
|
42
|
+
- **Never resolves review threads.** It may post a status **reply** to a thread (via the existing `.claude/scripts/review-resolve.sh reply` helper), but thread **resolution** is semantic and stays with `/review`.
|
|
43
|
+
|
|
44
|
+
## Action ladder
|
|
45
|
+
|
|
46
|
+
- **Tier-A (autonomous, idempotent, reversible):** re-run a flaky **required** check via `gh run rerun --failed` (capped by a rerun budget). Post status replies to threads (reply only).
|
|
47
|
+
- **Tier-B (opt-in per-flag, default OFF):** `--auto-rebase` rebases onto the base and force-pushes with lease. Preconditions: clean working tree, HEAD unchanged during the pass. A lease rejection is a **hard-stop + escalate** — the shepherd never re-arms the lease, because doing so would clobber the concurrent human push the lease exists to protect.
|
|
48
|
+
- **Tier-C (human escalation):** merge conflicts, required-check failures a rerun did not fix, an unreadable required-check set, unknown mergeability, auth/scope failures, oscillation, and budget exhaustion all stop and escalate with context posted to the PR.
|
|
49
|
+
|
|
50
|
+
## Merge-readiness gate
|
|
51
|
+
|
|
52
|
+
Merge-ready is declared **only** when the branch-protection required-check set is **known** AND all of it is green AND the branch is not behind base. The required set is read from `gh api repos/{owner}/{repo}/branches/{base}/protection/required_status_checks`. If branch protection is unreadable (insufficient token scope, or the branch is not protected), the shepherd does **not** guess — it escalates with the readable rollup attached.
|
|
53
|
+
|
|
54
|
+
## Concurrency & safety
|
|
55
|
+
|
|
56
|
+
- The advisory `shepherd:active` marker is **not** mutual exclusion. The real guard is a per-action HEAD-SHA re-read: before any mutating action the shepherd re-reads the head SHA, and if HEAD moved since the pass started it **aborts** the action.
|
|
57
|
+
- Auth taxonomy: token expiry (401) pauses and surfaces; insufficient scope (403) is a permanent **hard-stop**; a secondary rate limit (403 + `Retry-After`) honors the delay and resumes on the next pass.
|
|
58
|
+
|
|
59
|
+
## Per-harness behavior
|
|
60
|
+
|
|
61
|
+
- **Claude Code / Codex:** invoke `forge shepherd <pr>` directly; an external scheduler may drive repeated bounded passes.
|
|
62
|
+
- **Cursor:** manually-invoked only. Run `forge shepherd <pr>` from a terminal — there is no polling-loop affordance and no hook reliance on this surface.
|
|
63
|
+
|
|
64
|
+
## State
|
|
65
|
+
|
|
66
|
+
Progress is durable in GitHub: PR **comments** and **labels** plus `git`. There is no separate local state store.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"query": "Is PR #212 ready to merge yet?",
|
|
4
|
+
"should_trigger": true
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"query": "The lint check on my PR keeps failing intermittently — kick off a re-run of the failed jobs.",
|
|
8
|
+
"should_trigger": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"query": "Keep an eye on pull request 88 and tell me when all the required checks pass.",
|
|
12
|
+
"should_trigger": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"query": "I just wrapped up /review on this PR — babysit the checks and escalate if it isn't mergeable.",
|
|
16
|
+
"should_trigger": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"query": "Shepherd PR 300 and rebase it onto master if it's behind.",
|
|
20
|
+
"should_trigger": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"query": "Fix all the CodeRabbit and Greptile comments on my PR and resolve each review thread.",
|
|
24
|
+
"should_trigger": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"query": "The PR just merged to master — confirm CI is green there and close the linked issue.",
|
|
28
|
+
"should_trigger": false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"query": "Push my validated feature branch and open a pull request from the template.",
|
|
32
|
+
"should_trigger": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"query": "Where am I in the workflow and what work is still in flight right now?",
|
|
36
|
+
"should_trigger": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"query": "Show me the SonarCloud issues flagged on this PR.",
|
|
40
|
+
"should_trigger": false
|
|
41
|
+
}
|
|
42
|
+
]
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ship
|
|
3
|
+
description: >
|
|
4
|
+
Forge SHIP stage: push the validated feature branch and open a PR populated from the
|
|
5
|
+
project's OWN PR template (design-doc link, Forge issue IDs, real test/commit data), then
|
|
6
|
+
hand off for MANUAL merge; never merges or auto-merges. Use once /validate passes and you
|
|
7
|
+
want a PR on the board. Triggers: "ship it", "ship this branch", "open the PR", "push and
|
|
8
|
+
open a PR", "gh pr create", "checks passed, now cut the PR". Runs branch-freshness +
|
|
9
|
+
parallel-PR merge-sim checks, force-with-lease push, records the ship->review handoff, then
|
|
10
|
+
stops. One stage only; not for: the whole plan->dev->validate->ship->review pipeline or
|
|
11
|
+
drive-to-done (smith); type-check/lint/tests/security first (validate); addressing PR
|
|
12
|
+
comments or resolving Greptile/SonarCloud/CodeRabbit threads on an existing PR (review);
|
|
13
|
+
babysitting an open PR toward merge (shepherd); post-merge CI health check + closing issues
|
|
14
|
+
(verify); reverting an already-shipped change (rollback). If the PR already exists, this is
|
|
15
|
+
not the skill.
|
|
16
|
+
allowed-tools: Bash, Read, Edit, Grep, Glob
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
Push code and create a pull request with full context and documentation links.
|
|
20
|
+
|
|
21
|
+
# Ship
|
|
22
|
+
|
|
23
|
+
This skill creates a PR after validation passes.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
/ship
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
<HARD-GATE: /ship entry>
|
|
33
|
+
Do NOT create PR until:
|
|
34
|
+
1. /validate was run in this session with all four outputs shown (type, lint, tests, security)
|
|
35
|
+
2. All checks confirmed passing — not assumed, not "was passing earlier"
|
|
36
|
+
3. Forge issue is in_progress (`forge issue show <id>` confirms status)
|
|
37
|
+
4. git branch --show-current output is NOT main or master
|
|
38
|
+
</HARD-GATE>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## What This Skill Does
|
|
42
|
+
|
|
43
|
+
### Step 1: Verify /validate Passed
|
|
44
|
+
Ensure all four validation checks completed successfully with fresh output in this session.
|
|
45
|
+
|
|
46
|
+
### Step 2: Freshness Check — Is Branch Still Current?
|
|
47
|
+
|
|
48
|
+
Even though /validate rebased onto the base branch, time may have passed since then (user reviewed design doc, took a break, etc.). This lightweight check catches staleness before pushing.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
BASE=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}')
|
|
52
|
+
if [ -z "$BASE" ] || [ "$BASE" = "(unknown)" ]; then BASE="master"; fi
|
|
53
|
+
git fetch origin "$BASE" || { echo "✗ Fetch failed — cannot verify freshness"; exit 1; }
|
|
54
|
+
BEHIND=$(git rev-list --count HEAD..origin/"$BASE")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- If `BEHIND > 0`: **STOP**. Print: "$BASE has advanced since /validate ($BEHIND new commits). Run /validate again to rebase and re-check."
|
|
58
|
+
- If `BEHIND = 0`: Continue to push.
|
|
59
|
+
- If fetch fails: the `|| { ...; exit 1; }` guard catches this — **STOP**. Do NOT push without confirming freshness.
|
|
60
|
+
|
|
61
|
+
This is NOT a full rebase — just a check. The rebase happens in /validate where the full test suite runs afterward.
|
|
62
|
+
|
|
63
|
+
### Parallel PR coordination (soft block)
|
|
64
|
+
|
|
65
|
+
Before creating the PR, check merge readiness:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Run merge simulation against base branch
|
|
69
|
+
bash scripts/pr-coordinator.sh merge-sim "$(git branch --show-current)" 2>&1
|
|
70
|
+
|
|
71
|
+
# Show recommended merge order
|
|
72
|
+
bash scripts/pr-coordinator.sh merge-order 2>&1 || true
|
|
73
|
+
|
|
74
|
+
# Auto-label the PR after creation (called after gh pr create below)
|
|
75
|
+
# bash scripts/pr-coordinator.sh auto-label <issue-id>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If merge simulation finds conflicts:
|
|
79
|
+
- Display conflicted files
|
|
80
|
+
- Ask: "Merge conflicts detected with base branch. These PRs should merge first: [list]. Proceed with PR creation anyway? (y/n)"
|
|
81
|
+
- If `n`: exit cleanly
|
|
82
|
+
- If `y`: log override via `forge comment <id> "Ship override: creating PR despite merge conflicts"`, then continue
|
|
83
|
+
|
|
84
|
+
After PR creation completes:
|
|
85
|
+
```bash
|
|
86
|
+
# Auto-label the newly created PR
|
|
87
|
+
bash scripts/pr-coordinator.sh auto-label <issue-id>
|
|
88
|
+
|
|
89
|
+
# Check for stale worktrees (informational)
|
|
90
|
+
bash scripts/pr-coordinator.sh stale-worktrees 2>&1 || true
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Step 3: Record PR Handoff
|
|
94
|
+
```bash
|
|
95
|
+
forge comment <id> "PR created: <pr-url>. Awaiting review and merge verification."
|
|
96
|
+
forge sync
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Do not mark the Forge issue done during `/ship`. Completion happens only after merge and post-merge verification.
|
|
100
|
+
|
|
101
|
+
### Step 4: Push Branch
|
|
102
|
+
|
|
103
|
+
Use `--force-with-lease` because `/validate` may have rebased the branch, rewriting history. This is safe: it only forces the push if the remote branch hasn't been updated by someone else since the last fetch.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git push --force-with-lease -u origin <branch-name>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 5: Create PR Using Project's PR Template
|
|
110
|
+
|
|
111
|
+
**CRITICAL**: Always use the project's own PR template. Never use a hardcoded body.
|
|
112
|
+
|
|
113
|
+
**Step 5a: Locate the PR template**
|
|
114
|
+
|
|
115
|
+
Check for a PR template in the project (in order of precedence):
|
|
116
|
+
```bash
|
|
117
|
+
# Check standard locations
|
|
118
|
+
PR_TEMPLATE=""
|
|
119
|
+
for path in .github/pull_request_template.md .github/PULL_REQUEST_TEMPLATE.md docs/pull_request_template.md pull_request_template.md; do
|
|
120
|
+
if [ -f "$path" ]; then
|
|
121
|
+
PR_TEMPLATE="$path"
|
|
122
|
+
break
|
|
123
|
+
fi
|
|
124
|
+
done
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Step 5b: Read and populate the template**
|
|
128
|
+
|
|
129
|
+
If a PR template exists:
|
|
130
|
+
1. **Read the template file** using the Read tool
|
|
131
|
+
2. **Fill in every section** with actual data from the current PR context:
|
|
132
|
+
- Replace HTML comments (`<!-- ... -->`) with real content
|
|
133
|
+
- Check applicable checkboxes (`- [x]`)
|
|
134
|
+
- Fill in Forge issue IDs (replace `forge-xxx` with actual ID)
|
|
135
|
+
- Fill in test results, validation status, and other concrete data
|
|
136
|
+
- Reference the design doc: `docs/work/YYYY-MM-DD-<slug>/plan.md`
|
|
137
|
+
3. **Do NOT remove any sections** — fill them all, even if "N/A"
|
|
138
|
+
4. **Do NOT restructure the template** — keep the project's chosen format
|
|
139
|
+
|
|
140
|
+
If no PR template exists, use this minimal fallback:
|
|
141
|
+
```
|
|
142
|
+
## Summary
|
|
143
|
+
[1-3 sentences: what this PR does and why]
|
|
144
|
+
|
|
145
|
+
## Changes
|
|
146
|
+
[Bulleted list of key changes]
|
|
147
|
+
|
|
148
|
+
## Testing
|
|
149
|
+
[How it was tested, test results]
|
|
150
|
+
|
|
151
|
+
## Issue
|
|
152
|
+
Closes forge-xxx
|
|
153
|
+
|
|
154
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Step 5c: Create the PR**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
gh pr create --title "<type>: <concise description>" --body "<populated-template-content>"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Rules for the PR body:
|
|
164
|
+
- **Use the project's template structure** — never substitute your own format
|
|
165
|
+
- **Fill in concrete data** — commit counts, test results, actual file paths, real Forge IDs
|
|
166
|
+
- **Check applicable checkboxes** — `[x]` for items that apply, `[ ]` for items that don't
|
|
167
|
+
- **Include "Closes forge-xxx"** in the Issue section (required for auto-close in /verify)
|
|
168
|
+
|
|
169
|
+
### Step 6: Confirm Context and Record Stage Transition
|
|
170
|
+
```bash
|
|
171
|
+
# Confirm the issue carries design + acceptance context (helper when present; otherwise inspect the issue).
|
|
172
|
+
# Only falls back to `forge issue show` when the helper is absent — a real validate failure stays visible.
|
|
173
|
+
if [ -f scripts/beads-context.sh ]; then
|
|
174
|
+
bash scripts/beads-context.sh validate <id>
|
|
175
|
+
else
|
|
176
|
+
forge issue show <id>
|
|
177
|
+
fi
|
|
178
|
+
|
|
179
|
+
# Record the ship→review transition (structured helper when present; kernel-native comment otherwise).
|
|
180
|
+
# The fallback comment mirrors the same envelope the helper emits (Stage:/Summary:/Decisions:/Artifacts:/Next:).
|
|
181
|
+
if [ -f scripts/beads-context.sh ]; then
|
|
182
|
+
bash scripts/beads-context.sh stage-transition <id> ship review \
|
|
183
|
+
--summary "<PR created, checks pending>" \
|
|
184
|
+
--decisions "<template sections filled, issue linked>" \
|
|
185
|
+
--artifacts "<PR URL, branch name>" \
|
|
186
|
+
--next "<review focus areas>"
|
|
187
|
+
else
|
|
188
|
+
forge comment <id> "Stage: ship complete → ready for review
|
|
189
|
+
Summary: <PR created, checks pending>
|
|
190
|
+
Decisions: <template sections filled, issue linked>
|
|
191
|
+
Artifacts: <PR URL, branch name>
|
|
192
|
+
Next: <review focus areas>"
|
|
193
|
+
fi
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Team sync after PR
|
|
197
|
+
|
|
198
|
+
After PR is created, sync issue state to GitHub and verify 1:1 mapping:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# Sync issue state to GitHub
|
|
202
|
+
forge team sync 2>&1 || true
|
|
203
|
+
|
|
204
|
+
# Verify 1:1 mapping
|
|
205
|
+
forge team verify 2>&1 || true
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Output
|
|
209
|
+
|
|
210
|
+
`/ship` reports live validation status, branch freshness, Forge issue PR handoff state, push status, PR URL, template sections, linked issue IDs, and CI polling state. Values come from the current branch, issue tracker, and GitHub response; do not copy static IDs, URLs, or branch names into this skill file.
|
|
211
|
+
|
|
212
|
+
When checks are still pending after the polling window, stop after reporting the PR number and direct the next session to `/review <pr-number>` once automated checks complete or new feedback appears.
|
|
213
|
+
|
|
214
|
+
## Pre-merge gate (before merge)
|
|
215
|
+
|
|
216
|
+
Pre-merge is a doc-update **gate/checkpoint**, not a separate stage — run it here, before the PR is handed off for merge, whenever the change touches anything documented:
|
|
217
|
+
|
|
218
|
+
1. **Finish the docs on the feature branch** (update only what genuinely changed):
|
|
219
|
+
- `CHANGELOG.md` (always) — entry under `## [Unreleased]` using Keep a Changelog categories, with PR number + issue ID.
|
|
220
|
+
- `README.md` (user-facing), `docs/reference/API_REFERENCE.md` (API), architecture docs (structural).
|
|
221
|
+
- `CLAUDE.md` — **USER section only** (between the USER markers); never touch other managed blocks.
|
|
222
|
+
- `AGENTS.md` (agent config, skills, or cross-agent workflow changes).
|
|
223
|
+
Commit the doc updates to the feature branch and push.
|
|
224
|
+
2. **Confirm CI is green** — doc commits re-trigger CI; poll briefly (~60s), then hand off if still pending. New review feedback → run `/review` again.
|
|
225
|
+
3. **Sync the issue store** — `forge sync`.
|
|
226
|
+
4. **Hand off for MANUAL merge** — present the PR and stop. **Never run `gh pr merge`; never auto-merge.** The user merges in the GitHub UI, then runs `/verify`.
|
|
227
|
+
|
|
228
|
+
## Integration with Workflow
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
Utility: /status -> Understand current context before starting
|
|
232
|
+
|
|
233
|
+
Default template:
|
|
234
|
+
/plan -> Optional default planner; external planners may satisfy /dev entry
|
|
235
|
+
/dev -> Implement each task with subagent-driven TDD
|
|
236
|
+
/validate -> Type check, lint, tests, security
|
|
237
|
+
/ship -> Push + create PR
|
|
238
|
+
/review -> Address PR feedback
|
|
239
|
+
/verify -> Post-merge health check
|
|
240
|
+
|
|
241
|
+
Pre-merge gate: doc updates + CI-green checkpoint embedded in /ship and /review (not a separate stage).
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Tips
|
|
245
|
+
|
|
246
|
+
- **Use the project's PR template**: Always read `.github/pull_request_template.md` (or equivalent) and populate it — never substitute your own format
|
|
247
|
+
- **Fill every section**: Even if "N/A" — empty/missing sections cause review friction
|
|
248
|
+
- **Include "Closes forge-xxx"**: Required for auto-close in /verify
|
|
249
|
+
- **Concrete data only**: Test counts, file paths, commit SHAs — not placeholder text
|
|
250
|
+
- **Poll briefly, then stop**: Check PR status for up to 60 seconds, then hand off if checks are still pending
|
|
251
|
+
- **NO auto-merge**: Always wait for /review phase
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"query": "Validation came back clean — go ahead and open the pull request for this branch.",
|
|
4
|
+
"should_trigger": true
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"query": "Push my feature branch and raise a PR, and fill in our PR template with the issue and design-doc links.",
|
|
8
|
+
"should_trigger": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"query": "Dev's done and all the checks passed, cut me a PR.",
|
|
12
|
+
"should_trigger": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"query": "Do a gh pr create for feat/rate-limit using the repo's template, not a hand-written body.",
|
|
16
|
+
"should_trigger": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"query": "Everything's green after validate — ship it, but hand it off for me to merge, don't merge it yourself.",
|
|
20
|
+
"should_trigger": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"query": "Take forge-42 from planning all the way to a merge-ready PR — plan it, build it TDD, validate, then ship, checking with me at the gates.",
|
|
24
|
+
"should_trigger": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"query": "The PR's picked up Greptile and CodeRabbit comments — fix them and resolve the threads.",
|
|
28
|
+
"should_trigger": false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"query": "Run the type-check, lint, tests and security scan before I push anything.",
|
|
32
|
+
"should_trigger": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"query": "Keep watching PR #128 and ping me the moment its checks go green so I can merge.",
|
|
36
|
+
"should_trigger": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"query": "The PR merged to master — confirm CI is green there and close the linked issue.",
|
|
40
|
+
"should_trigger": false
|
|
41
|
+
}
|
|
42
|
+
]
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: smith
|
|
3
|
+
description: >
|
|
4
|
+
The flagship Forge orchestrator: given a goal or a ready issue, it composes the
|
|
5
|
+
stage skills (triage-ready · claim-safety · plan · dev · validate · ship · review
|
|
6
|
+
· verify) into the right path for the work, running autonomously between human
|
|
7
|
+
gates and pausing at them. Use this whenever the user wants to work the next ready
|
|
8
|
+
issue, drive a feature or fix end-to-end, "take this through to a PR", orchestrate
|
|
9
|
+
the whole workflow with human checkpoints, or asks some form of "what should I
|
|
10
|
+
work on and get it done" — even if they never say "smith" or "orchestrate". Reach
|
|
11
|
+
for it especially when the request spans multiple stages (plan → build → ship) or
|
|
12
|
+
asks to keep a human in the loop at intent, plan, or merge. Prefer a single stage
|
|
13
|
+
skill only when the user explicitly wants just that one step (e.g. "just open the
|
|
14
|
+
PR").
|
|
15
|
+
allowed-tools: Read, Bash(forge:*)
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Smith — the orchestrator super-skill
|
|
19
|
+
|
|
20
|
+
Smith is a thin orchestrator. It adds no stage behaviour of its own; every step
|
|
21
|
+
below is an existing skill or `forge` verb. What smith contributes is *judgement*:
|
|
22
|
+
which path to take for this piece of work, and how densely to involve the human.
|
|
23
|
+
It is maximally driving between gates and deliberately stops at them — the goal is
|
|
24
|
+
conversational autonomy, not unattended autonomy.
|
|
25
|
+
|
|
26
|
+
Keep the word "kernel" internal — it is the event store under the hood, not a
|
|
27
|
+
term users should see.
|
|
28
|
+
|
|
29
|
+
Deeper lookup tables live in
|
|
30
|
+
[references/autonomy-and-gates.md](references/autonomy-and-gates.md): read that
|
|
31
|
+
when you calibrate a specific issue or need the exact gate IDs and commands.
|
|
32
|
+
|
|
33
|
+
## The orchestration procedure
|
|
34
|
+
|
|
35
|
+
1. **Pick the work with `triage-ready`.** Rank the ready queue
|
|
36
|
+
(`forge issue ready --json`) and explain why the top pick is genuinely
|
|
37
|
+
workable. Readiness is a *derived* model, so recompute it each time rather than
|
|
38
|
+
trusting a remembered "ready" — you want the item that is actually unblocked
|
|
39
|
+
now, not a stale guess. Hand off one issue.
|
|
40
|
+
|
|
41
|
+
2. **Claim it, then prove you own it, with `claim-safety`.**
|
|
42
|
+
`FORGE_ACTOR=<actor> forge claim <id>`, then `forge issue owns <id>` (exit 0 =
|
|
43
|
+
owned). A claim returning `ok:true` is not proof — a duplicate replay returns
|
|
44
|
+
`ok:true` too, and a live lease can be reclaimed once it expires. Proving
|
|
45
|
+
ownership is what stops two agents from quietly working the same issue. If you
|
|
46
|
+
are not the owner, don't work it; reselect via `triage-ready`.
|
|
47
|
+
|
|
48
|
+
3. **Calibrate autonomy during planning.** Read the issue's size × importance ×
|
|
49
|
+
complexity, map it to a tier (lean / standard / high), and *propose that tier
|
|
50
|
+
directly to the human* — a short "here's how much oversight I think this needs."
|
|
51
|
+
This proposal is a plain conversational checkpoint at the start of planning; it
|
|
52
|
+
is deliberately **not** itself one of the enforcement gates, so it stays reachable
|
|
53
|
+
even for the Lean tier (which may require no intent gate at all). The human
|
|
54
|
+
confirms or overrides, and the chosen tier decides **which enforcement gates you
|
|
55
|
+
require approval for on this issue** (step 5). Keep the two mechanisms distinct:
|
|
56
|
+
`forge gate enable|disable <gate>` is the **repo-wide default** (a gate the user
|
|
57
|
+
turned off is always skipped), whereas the per-issue tier is *your* runtime
|
|
58
|
+
decision about which of the still-enabled gates to actually require for this one
|
|
59
|
+
issue. Matching checkpoint density to stakes is the whole point: a docs typo
|
|
60
|
+
should not drag through a full brainstorm, and a risky refactor should not run
|
|
61
|
+
unattended. When your read is uncertain, lean toward *more* gates — an extra
|
|
62
|
+
approval costs seconds, a missing one can cost a lot of rework. See the
|
|
63
|
+
reference for the tier → gate mapping.
|
|
64
|
+
|
|
65
|
+
4. **Drive the stages along the path that fits.** Sequence
|
|
66
|
+
`plan → dev → validate → ship → review → verify`, invoking each stage skill as
|
|
67
|
+
its step arrives. The stage skills already encode the TDD, validation, and
|
|
68
|
+
review discipline, so smith's job is only to pick the path by change
|
|
69
|
+
classification (critical / standard / simple / hotfix / docs / refactor): a docs
|
|
70
|
+
typo skips brainstorming and most of the ladder; a critical feature runs the
|
|
71
|
+
full ladder.
|
|
72
|
+
|
|
73
|
+
5. **Stop at every enabled human gate.** Before advancing past a gate, run:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
forge gate check <issue> <gate> # exit 0 iff the gate is disabled or approved
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
On exit 0, proceed. On non-zero, stop and ask the human to
|
|
80
|
+
`forge gate approve <issue> <gate> [--reason "…"]` (or
|
|
81
|
+
`forge gate reject <issue> <gate> --reason "…"` to send it back); inspect
|
|
82
|
+
history any time with `forge gate status <issue>`. Approvals are recorded as
|
|
83
|
+
durable events, which is what lets smith re-check and continue after a crash or
|
|
84
|
+
compaction instead of re-asking. The three human gates are `gate.intent`,
|
|
85
|
+
`gate.plan-approval`, and `gate.merge` (details in the reference).
|
|
86
|
+
|
|
87
|
+
6. **Re-prove ownership and check readiness before closing.** A lease can expire
|
|
88
|
+
and be reclaimed while you work, so run `forge issue owns <id>` again before you
|
|
89
|
+
close — you don't want to close someone else's issue. Then confirm the tree is
|
|
90
|
+
actually shippable:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
forge release check --target <version> --json # success:true ⇒ healthy
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Close only when ownership holds and readiness is healthy
|
|
97
|
+
(`forge close <id> --reason "…"`), then `forge sync`.
|
|
98
|
+
|
|
99
|
+
## Autonomy tiers at a glance
|
|
100
|
+
|
|
101
|
+
Full table and the reasoning are in the reference; the short version:
|
|
102
|
+
|
|
103
|
+
- **Lean** — small · simple · low-importance work: enforce just `gate.merge`, or
|
|
104
|
+
run under CI with the human gates disabled.
|
|
105
|
+
- **Standard** (default) — an ordinary feature/bug: enforce `gate.intent`,
|
|
106
|
+
`gate.plan-approval`, and `gate.merge`.
|
|
107
|
+
- **High** — large · important · or complex work: enforce all three, plus
|
|
108
|
+
per-milestone check-ins and a pre-ship pass.
|
|
109
|
+
|
|
110
|
+
The tier is a **per-issue** decision: smith requires `check`/approval only for the
|
|
111
|
+
gates its tier calls for on *this* issue and simply skips the rest — it does not
|
|
112
|
+
toggle repo config per issue. Separately, `forge gate disable <gate-id>` is the
|
|
113
|
+
**repo-wide** off switch (a disabled gate makes `check` fall through for *every*
|
|
114
|
+
issue) — use it when the user never wants that checkpoint at all. So a lean run
|
|
115
|
+
skips a checkpoint by not requiring it for this issue; disabling a gate removes it
|
|
116
|
+
everywhere.
|
|
117
|
+
|
|
118
|
+
## Reliability
|
|
119
|
+
|
|
120
|
+
- **The human always wins, and uncertainty adds oversight.** Smith proposes a
|
|
121
|
+
tier; it never lowers the human-loop density on its own, and a rejected gate
|
|
122
|
+
sends the work back rather than proceeding.
|
|
123
|
+
- **Re-check gates on resume.** After any interruption, trust the recorded events
|
|
124
|
+
(`check` / `status`), not your memory of what was approved.
|
|
125
|
+
- **Prove ownership twice** — after claiming and again before close/release.
|
|
126
|
+
- **Never bypass a gate or a hook.** A failed gate or failing hook is a stop to
|
|
127
|
+
resolve, not an obstacle to route around (no `LEFTHOOK=0`, no `--no-verify`).
|
|
128
|
+
|
|
129
|
+
## Fork points
|
|
130
|
+
|
|
131
|
+
Smith is a default assembly, not a fixed ladder — re-carve it:
|
|
132
|
+
|
|
133
|
+
| Knob | Default | How to change |
|
|
134
|
+
|------|---------|---------------|
|
|
135
|
+
| **Stakes heuristic** | size × importance × complexity → tier | Re-weight it (e.g. weight blast-radius or reversibility higher), or map your own change-classes to tiers. |
|
|
136
|
+
| **Tier → gate set** | lean / standard / high (see reference) | Change which human gates each tier enforces; enact per repo with `forge gate enable\|disable <gate-id>`. |
|
|
137
|
+
| **Gate density** | intent · plan-approval · merge | Add a checkpoint (enable a gate or add a per-milestone pause) or drop one (disable it); the human overrides smith's proposal at `gate.intent`. |
|
|
138
|
+
| **Composed flow** | triage → claim → plan → dev → validate → ship → review → verify | Skip stages by change class (docs typo → doc-only path), reorder, or swap in your own `plan`/`dev`/`review` adapter. |
|
|
139
|
+
| **Release target** | `forge release check` default | Pass `--target <version>` for the release you are certifying. |
|
|
140
|
+
|
|
141
|
+
Smith is the assembled hammer; the sub-skills are the head and handle; the gates
|
|
142
|
+
are the grip adjustments. Ship a good default, then let users re-carve it.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"query": "Grab the next ready issue off the board and take it all the way through to a PR for me — plan it, build it TDD, validate, and open the PR, but stop and check with me before it actually merges.",
|
|
4
|
+
"should_trigger": true
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"query": "I want you to orchestrate the whole workflow for the payments-webhook feature end to end: design the plan, do the dev, run validation, ship it, handle the review comments — just keep me in the loop at the plan-approval and merge points.",
|
|
8
|
+
"should_trigger": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"query": "What should I pick up next? Whatever's highest-priority and ready, claim it and drive it to done with the usual human checkpoints — I don't want to babysit every step but I do want to approve the design and the merge.",
|
|
12
|
+
"should_trigger": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"query": "Take issue forge-9k2 from planning through a merged PR. It's a big risky refactor so keep me involved — I want to sign off at intent, at the plan, and per milestone before you push.",
|
|
16
|
+
"should_trigger": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"query": "Run the full plan through ship flow on the login-rate-limit bug, but it's a tiny fix so don't over-gate it — just let me approve the merge and go.",
|
|
20
|
+
"should_trigger": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"query": "Autonomously work through the ready queue and get each task to a PR, pausing for my approval before any merge.",
|
|
24
|
+
"should_trigger": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"query": "Just open the PR for my current branch, it's already validated and I've written the description.",
|
|
28
|
+
"should_trigger": false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"query": "What stage am I in and what's my active work right now? Anything gone stale?",
|
|
32
|
+
"should_trigger": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"query": "Go through the CodeRabbit and SonarCloud comments on PR #288 and address them, then re-request review.",
|
|
36
|
+
"should_trigger": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"query": "Create a feature issue for adding dark mode to the settings page, priority 2, and link it under the theming epic.",
|
|
40
|
+
"should_trigger": false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"query": "Just claim forge-abc for me so nobody else picks it up while I look at it.",
|
|
44
|
+
"should_trigger": false
|
|
45
|
+
}
|
|
46
|
+
]
|