gsd-pi 2.28.0-dev.e19bf89 → 2.29.0-dev.23d50d0
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 +24 -17
- package/dist/cli.js +15 -9
- package/dist/headless.js +4 -0
- package/dist/resource-loader.js +80 -8
- package/dist/resources/extensions/bg-shell/process-manager.ts +13 -0
- package/dist/resources/extensions/gsd/auto-dashboard.ts +217 -65
- package/dist/resources/extensions/gsd/auto-dispatch.ts +2 -2
- package/dist/resources/extensions/gsd/auto-post-unit.ts +53 -6
- package/dist/resources/extensions/gsd/auto-prompts.ts +27 -14
- package/dist/resources/extensions/gsd/auto-recovery.ts +33 -23
- package/dist/resources/extensions/gsd/auto-start.ts +25 -10
- package/dist/resources/extensions/gsd/auto-verification.ts +41 -7
- package/dist/resources/extensions/gsd/auto-worktree-sync.ts +21 -6
- package/dist/resources/extensions/gsd/auto-worktree.ts +9 -0
- package/dist/resources/extensions/gsd/auto.ts +67 -22
- package/dist/resources/extensions/gsd/commands-handlers.ts +3 -11
- package/dist/resources/extensions/gsd/commands-logs.ts +536 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +90 -47
- package/dist/resources/extensions/gsd/commands-workflow-templates.ts +544 -0
- package/dist/resources/extensions/gsd/commands.ts +75 -29
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +2 -1
- package/dist/resources/extensions/gsd/doctor-types.ts +13 -0
- package/dist/resources/extensions/gsd/doctor.ts +2 -6
- package/dist/resources/extensions/gsd/export.ts +28 -2
- package/dist/resources/extensions/gsd/gsd-db.ts +19 -0
- package/dist/resources/extensions/gsd/index.ts +2 -1
- package/dist/resources/extensions/gsd/json-persistence.ts +67 -0
- package/dist/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/dist/resources/extensions/gsd/metrics.ts +17 -31
- package/dist/resources/extensions/gsd/paths.ts +17 -8
- package/dist/resources/extensions/gsd/preferences-models.ts +7 -1
- package/dist/resources/extensions/gsd/preferences-validation.ts +2 -1
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +4 -2
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +26 -2
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +15 -1
- package/dist/resources/extensions/gsd/prompts/workflow-start.md +28 -0
- package/dist/resources/extensions/gsd/queue-order.ts +10 -11
- package/dist/resources/extensions/gsd/routing-history.ts +13 -17
- package/dist/resources/extensions/gsd/session-lock.ts +284 -0
- package/dist/resources/extensions/gsd/session-status-io.ts +23 -41
- package/dist/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/auto-skip-loop.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/commands-logs.test.ts +241 -0
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +60 -38
- package/dist/resources/extensions/gsd/tests/gsd-inspect.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/dist/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +1 -0
- package/dist/resources/extensions/gsd/tests/session-lock.test.ts +315 -0
- package/dist/resources/extensions/gsd/tests/token-profile.test.ts +14 -16
- package/dist/resources/extensions/gsd/tests/validate-milestone.test.ts +55 -0
- package/dist/resources/extensions/gsd/tests/verification-evidence.test.ts +26 -24
- package/dist/resources/extensions/gsd/tests/verification-gate.test.ts +136 -7
- package/dist/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/dist/resources/extensions/gsd/types.ts +3 -0
- package/dist/resources/extensions/gsd/unit-runtime.ts +16 -13
- package/dist/resources/extensions/gsd/verification-evidence.ts +2 -0
- package/dist/resources/extensions/gsd/verification-gate.ts +13 -2
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +87 -0
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +74 -0
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +41 -0
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +45 -0
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +83 -0
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +85 -0
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +73 -0
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +81 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +69 -0
- package/dist/resources/extensions/gsd/workflow-templates.ts +241 -0
- package/dist/resources/extensions/mcp-client/index.ts +459 -0
- package/dist/resources/extensions/remote-questions/discord-adapter.ts +9 -20
- package/dist/resources/extensions/remote-questions/http-client.ts +76 -0
- package/dist/resources/extensions/remote-questions/notify.ts +1 -2
- package/dist/resources/extensions/remote-questions/slack-adapter.ts +11 -18
- package/dist/resources/extensions/remote-questions/telegram-adapter.ts +8 -20
- package/dist/resources/extensions/remote-questions/types.ts +3 -0
- package/dist/resources/extensions/shared/mod.ts +3 -0
- package/dist/resources/skills/create-gsd-extension/SKILL.md +87 -0
- package/dist/resources/skills/create-gsd-extension/references/compaction-session-control.md +77 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-commands.md +139 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-rendering.md +108 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-tools.md +183 -0
- package/dist/resources/skills/create-gsd-extension/references/custom-ui.md +490 -0
- package/dist/resources/skills/create-gsd-extension/references/events-reference.md +126 -0
- package/dist/resources/skills/create-gsd-extension/references/extension-lifecycle.md +64 -0
- package/dist/resources/skills/create-gsd-extension/references/extensionapi-reference.md +75 -0
- package/dist/resources/skills/create-gsd-extension/references/extensioncontext-reference.md +53 -0
- package/dist/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +36 -0
- package/dist/resources/skills/create-gsd-extension/references/mode-behavior.md +32 -0
- package/dist/resources/skills/create-gsd-extension/references/model-provider-management.md +89 -0
- package/dist/resources/skills/create-gsd-extension/references/packaging-distribution.md +55 -0
- package/dist/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +90 -0
- package/dist/resources/skills/create-gsd-extension/references/state-management.md +70 -0
- package/dist/resources/skills/create-gsd-extension/references/system-prompt-modification.md +52 -0
- package/dist/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +51 -0
- package/dist/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +143 -0
- package/dist/resources/skills/create-gsd-extension/workflows/add-capability.md +57 -0
- package/dist/resources/skills/create-gsd-extension/workflows/create-extension.md +156 -0
- package/dist/resources/skills/create-gsd-extension/workflows/debug-extension.md +74 -0
- package/dist/resources/skills/create-skill/SKILL.md +184 -0
- package/dist/resources/skills/create-skill/references/api-security.md +226 -0
- package/dist/resources/skills/create-skill/references/be-clear-and-direct.md +531 -0
- package/dist/resources/skills/create-skill/references/common-patterns.md +595 -0
- package/dist/resources/skills/create-skill/references/core-principles.md +437 -0
- package/dist/resources/skills/create-skill/references/executable-code.md +175 -0
- package/dist/resources/skills/create-skill/references/gsd-skill-ecosystem.md +68 -0
- package/dist/resources/skills/create-skill/references/iteration-and-testing.md +474 -0
- package/dist/resources/skills/create-skill/references/recommended-structure.md +168 -0
- package/dist/resources/skills/create-skill/references/skill-structure.md +372 -0
- package/dist/resources/skills/create-skill/references/use-xml-tags.md +466 -0
- package/dist/resources/skills/create-skill/references/using-scripts.md +113 -0
- package/dist/resources/skills/create-skill/references/using-templates.md +112 -0
- package/dist/resources/skills/create-skill/references/workflows-and-validation.md +510 -0
- package/dist/resources/skills/create-skill/templates/router-skill.md +73 -0
- package/dist/resources/skills/create-skill/templates/simple-skill.md +33 -0
- package/dist/resources/skills/create-skill/workflows/add-reference.md +96 -0
- package/dist/resources/skills/create-skill/workflows/add-script.md +93 -0
- package/dist/resources/skills/create-skill/workflows/add-template.md +74 -0
- package/dist/resources/skills/create-skill/workflows/add-workflow.md +120 -0
- package/dist/resources/skills/create-skill/workflows/audit-skill.md +148 -0
- package/dist/resources/skills/create-skill/workflows/create-new-skill.md +196 -0
- package/dist/resources/skills/create-skill/workflows/get-guidance.md +121 -0
- package/dist/resources/skills/create-skill/workflows/upgrade-to-router.md +161 -0
- package/dist/resources/skills/create-skill/workflows/verify-skill.md +204 -0
- package/package.json +6 -3
- package/packages/native/dist/native.d.ts +2 -0
- package/packages/native/dist/native.js +19 -5
- package/packages/native/src/native.ts +23 -9
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +13 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.js +3 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +10 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/scripts/copy-assets.cjs +39 -8
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +13 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +3 -0
- package/packages/pi-coding-agent/src/core/settings-manager.ts +11 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +11 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -1
- package/packages/pi-tui/dist/autocomplete.d.ts +3 -0
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/packages/pi-tui/dist/autocomplete.js +14 -0
- package/packages/pi-tui/dist/autocomplete.js.map +1 -1
- package/packages/pi-tui/src/autocomplete.ts +19 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/bg-shell/process-manager.ts +13 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +217 -65
- package/src/resources/extensions/gsd/auto-dispatch.ts +2 -2
- package/src/resources/extensions/gsd/auto-post-unit.ts +53 -6
- package/src/resources/extensions/gsd/auto-prompts.ts +27 -14
- package/src/resources/extensions/gsd/auto-recovery.ts +33 -23
- package/src/resources/extensions/gsd/auto-start.ts +25 -10
- package/src/resources/extensions/gsd/auto-verification.ts +41 -7
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +21 -6
- package/src/resources/extensions/gsd/auto-worktree.ts +9 -0
- package/src/resources/extensions/gsd/auto.ts +67 -22
- package/src/resources/extensions/gsd/commands-handlers.ts +3 -11
- package/src/resources/extensions/gsd/commands-logs.ts +536 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +90 -47
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +544 -0
- package/src/resources/extensions/gsd/commands.ts +75 -29
- package/src/resources/extensions/gsd/dashboard-overlay.ts +2 -1
- package/src/resources/extensions/gsd/doctor-types.ts +13 -0
- package/src/resources/extensions/gsd/doctor.ts +2 -6
- package/src/resources/extensions/gsd/export.ts +28 -2
- package/src/resources/extensions/gsd/gsd-db.ts +19 -0
- package/src/resources/extensions/gsd/index.ts +2 -1
- package/src/resources/extensions/gsd/json-persistence.ts +67 -0
- package/src/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/src/resources/extensions/gsd/metrics.ts +17 -31
- package/src/resources/extensions/gsd/paths.ts +17 -8
- package/src/resources/extensions/gsd/preferences-models.ts +7 -1
- package/src/resources/extensions/gsd/preferences-validation.ts +2 -1
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +4 -2
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +26 -2
- package/src/resources/extensions/gsd/prompts/plan-slice.md +15 -1
- package/src/resources/extensions/gsd/prompts/workflow-start.md +28 -0
- package/src/resources/extensions/gsd/queue-order.ts +10 -11
- package/src/resources/extensions/gsd/routing-history.ts +13 -17
- package/src/resources/extensions/gsd/session-lock.ts +284 -0
- package/src/resources/extensions/gsd/session-status-io.ts +23 -41
- package/src/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-skip-loop.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/commands-logs.test.ts +241 -0
- package/src/resources/extensions/gsd/tests/extension-selector-separator.test.ts +60 -38
- package/src/resources/extensions/gsd/tests/gsd-inspect.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/src/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/session-lock.test.ts +315 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +14 -16
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/verification-evidence.test.ts +26 -24
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +136 -7
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/src/resources/extensions/gsd/types.ts +3 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +16 -13
- package/src/resources/extensions/gsd/verification-evidence.ts +2 -0
- package/src/resources/extensions/gsd/verification-gate.ts +13 -2
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +87 -0
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +74 -0
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +41 -0
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +45 -0
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +83 -0
- package/src/resources/extensions/gsd/workflow-templates/registry.json +85 -0
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +73 -0
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +81 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +69 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +241 -0
- package/src/resources/extensions/mcp-client/index.ts +459 -0
- package/src/resources/extensions/remote-questions/discord-adapter.ts +9 -20
- package/src/resources/extensions/remote-questions/http-client.ts +76 -0
- package/src/resources/extensions/remote-questions/notify.ts +1 -2
- package/src/resources/extensions/remote-questions/slack-adapter.ts +11 -18
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +8 -20
- package/src/resources/extensions/remote-questions/types.ts +3 -0
- package/src/resources/extensions/shared/mod.ts +3 -0
- package/src/resources/skills/create-gsd-extension/SKILL.md +87 -0
- package/src/resources/skills/create-gsd-extension/references/compaction-session-control.md +77 -0
- package/src/resources/skills/create-gsd-extension/references/custom-commands.md +139 -0
- package/src/resources/skills/create-gsd-extension/references/custom-rendering.md +108 -0
- package/src/resources/skills/create-gsd-extension/references/custom-tools.md +183 -0
- package/src/resources/skills/create-gsd-extension/references/custom-ui.md +490 -0
- package/src/resources/skills/create-gsd-extension/references/events-reference.md +126 -0
- package/src/resources/skills/create-gsd-extension/references/extension-lifecycle.md +64 -0
- package/src/resources/skills/create-gsd-extension/references/extensionapi-reference.md +75 -0
- package/src/resources/skills/create-gsd-extension/references/extensioncontext-reference.md +53 -0
- package/src/resources/skills/create-gsd-extension/references/key-rules-gotchas.md +36 -0
- package/src/resources/skills/create-gsd-extension/references/mode-behavior.md +32 -0
- package/src/resources/skills/create-gsd-extension/references/model-provider-management.md +89 -0
- package/src/resources/skills/create-gsd-extension/references/packaging-distribution.md +55 -0
- package/src/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +90 -0
- package/src/resources/skills/create-gsd-extension/references/state-management.md +70 -0
- package/src/resources/skills/create-gsd-extension/references/system-prompt-modification.md +52 -0
- package/src/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +51 -0
- package/src/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +143 -0
- package/src/resources/skills/create-gsd-extension/workflows/add-capability.md +57 -0
- package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +156 -0
- package/src/resources/skills/create-gsd-extension/workflows/debug-extension.md +74 -0
- package/src/resources/skills/create-skill/SKILL.md +184 -0
- package/src/resources/skills/create-skill/references/api-security.md +226 -0
- package/src/resources/skills/create-skill/references/be-clear-and-direct.md +531 -0
- package/src/resources/skills/create-skill/references/common-patterns.md +595 -0
- package/src/resources/skills/create-skill/references/core-principles.md +437 -0
- package/src/resources/skills/create-skill/references/executable-code.md +175 -0
- package/src/resources/skills/create-skill/references/gsd-skill-ecosystem.md +68 -0
- package/src/resources/skills/create-skill/references/iteration-and-testing.md +474 -0
- package/src/resources/skills/create-skill/references/recommended-structure.md +168 -0
- package/src/resources/skills/create-skill/references/skill-structure.md +372 -0
- package/src/resources/skills/create-skill/references/use-xml-tags.md +466 -0
- package/src/resources/skills/create-skill/references/using-scripts.md +113 -0
- package/src/resources/skills/create-skill/references/using-templates.md +112 -0
- package/src/resources/skills/create-skill/references/workflows-and-validation.md +510 -0
- package/src/resources/skills/create-skill/templates/router-skill.md +73 -0
- package/src/resources/skills/create-skill/templates/simple-skill.md +33 -0
- package/src/resources/skills/create-skill/workflows/add-reference.md +96 -0
- package/src/resources/skills/create-skill/workflows/add-script.md +93 -0
- package/src/resources/skills/create-skill/workflows/add-template.md +74 -0
- package/src/resources/skills/create-skill/workflows/add-workflow.md +120 -0
- package/src/resources/skills/create-skill/workflows/audit-skill.md +148 -0
- package/src/resources/skills/create-skill/workflows/create-new-skill.md +196 -0
- package/src/resources/skills/create-skill/workflows/get-guidance.md +121 -0
- package/src/resources/skills/create-skill/workflows/upgrade-to-router.md +161 -0
- package/src/resources/skills/create-skill/workflows/verify-skill.md +204 -0
- package/dist/resources/extensions/gsd/preferences-hooks.ts +0 -10
- package/dist/resources/extensions/mcporter/index.ts +0 -525
- package/dist/resources/extensions/shared/progress-widget.ts +0 -282
- package/dist/resources/extensions/shared/thinking-widget.ts +0 -107
- package/src/resources/extensions/gsd/preferences-hooks.ts +0 -10
- package/src/resources/extensions/mcporter/index.ts +0 -525
- package/src/resources/extensions/shared/progress-widget.ts +0 -282
- package/src/resources/extensions/shared/thinking-widget.ts +0 -107
|
@@ -55,6 +55,7 @@ export interface VerificationCheck {
|
|
|
55
55
|
stdout: string;
|
|
56
56
|
stderr: string;
|
|
57
57
|
durationMs: number;
|
|
58
|
+
blocking: boolean; // true for preference/task-plan sources, false for package-json (advisory only)
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
/** A runtime error captured from bg-shell processes or browser console */
|
|
@@ -303,6 +304,8 @@ export interface PhaseSkipPreferences {
|
|
|
303
304
|
skip_reassess?: boolean;
|
|
304
305
|
skip_slice_research?: boolean;
|
|
305
306
|
skip_milestone_validation?: boolean;
|
|
307
|
+
/** When true, reassess-roadmap fires after each slice completion. Opt-in. */
|
|
308
|
+
reassess_after_slice?: boolean;
|
|
306
309
|
/** When true, auto-mode pauses before each slice for discussion (#789). */
|
|
307
310
|
require_slice_discussion?: boolean;
|
|
308
311
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync,
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, unlinkSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import {
|
|
4
4
|
gsdRoot,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
resolveTaskFile,
|
|
9
9
|
} from "./paths.js";
|
|
10
10
|
import { loadFile, parseTaskPlanMustHaves, countMustHavesMentionedInSummary } from "./files.js";
|
|
11
|
+
import { loadJsonFileOrNull, saveJsonFile } from "./json-persistence.js";
|
|
11
12
|
|
|
12
13
|
export type UnitRuntimePhase =
|
|
13
14
|
| "dispatched"
|
|
@@ -46,13 +47,23 @@ export interface AutoUnitRuntimeRecord {
|
|
|
46
47
|
lastRecoveryReason?: "idle" | "hard";
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
function isAutoUnitRuntimeRecord(data: unknown): data is AutoUnitRuntimeRecord {
|
|
51
|
+
return (
|
|
52
|
+
typeof data === "object" &&
|
|
53
|
+
data !== null &&
|
|
54
|
+
(data as AutoUnitRuntimeRecord).version === 1 &&
|
|
55
|
+
typeof (data as AutoUnitRuntimeRecord).unitType === "string" &&
|
|
56
|
+
typeof (data as AutoUnitRuntimeRecord).unitId === "string"
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
49
60
|
function runtimeDir(basePath: string): string {
|
|
50
61
|
return join(gsdRoot(basePath), "runtime", "units");
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
function runtimePath(basePath: string, unitType: string, unitId: string): string {
|
|
54
|
-
const sanitizedUnitType = unitType.replace(/[
|
|
55
|
-
const sanitizedUnitId = unitId.replace(/[
|
|
65
|
+
const sanitizedUnitType = unitType.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
66
|
+
const sanitizedUnitId = unitId.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
56
67
|
return join(runtimeDir(basePath), `${sanitizedUnitType}-${sanitizedUnitId}.json`);
|
|
57
68
|
}
|
|
58
69
|
|
|
@@ -63,8 +74,6 @@ export function writeUnitRuntimeRecord(
|
|
|
63
74
|
startedAt: number,
|
|
64
75
|
updates: Partial<AutoUnitRuntimeRecord> = {},
|
|
65
76
|
): AutoUnitRuntimeRecord {
|
|
66
|
-
const dir = runtimeDir(basePath);
|
|
67
|
-
mkdirSync(dir, { recursive: true });
|
|
68
77
|
const path = runtimePath(basePath, unitType, unitId);
|
|
69
78
|
const prev = readUnitRuntimeRecord(basePath, unitType, unitId);
|
|
70
79
|
const next: AutoUnitRuntimeRecord = {
|
|
@@ -84,18 +93,12 @@ export function writeUnitRuntimeRecord(
|
|
|
84
93
|
recoveryAttempts: updates.recoveryAttempts ?? prev?.recoveryAttempts ?? 0,
|
|
85
94
|
lastRecoveryReason: updates.lastRecoveryReason ?? prev?.lastRecoveryReason,
|
|
86
95
|
};
|
|
87
|
-
|
|
96
|
+
saveJsonFile(path, next);
|
|
88
97
|
return next;
|
|
89
98
|
}
|
|
90
99
|
|
|
91
100
|
export function readUnitRuntimeRecord(basePath: string, unitType: string, unitId: string): AutoUnitRuntimeRecord | null {
|
|
92
|
-
|
|
93
|
-
if (!existsSync(path)) return null;
|
|
94
|
-
try {
|
|
95
|
-
return JSON.parse(readFileSync(path, "utf-8")) as AutoUnitRuntimeRecord;
|
|
96
|
-
} catch {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
101
|
+
return loadJsonFileOrNull(runtimePath(basePath, unitType, unitId), isAutoUnitRuntimeRecord);
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
export function clearUnitRuntimeRecord(basePath: string, unitType: string, unitId: string): void {
|
|
@@ -20,6 +20,7 @@ export interface EvidenceCheckJSON {
|
|
|
20
20
|
exitCode: number;
|
|
21
21
|
durationMs: number;
|
|
22
22
|
verdict: "pass" | "fail";
|
|
23
|
+
blocking: boolean;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface RuntimeErrorJSON {
|
|
@@ -80,6 +81,7 @@ export function writeVerificationJSON(
|
|
|
80
81
|
exitCode: check.exitCode,
|
|
81
82
|
durationMs: check.durationMs,
|
|
82
83
|
verdict: check.exitCode === 0 ? "pass" : "fail",
|
|
84
|
+
blocking: check.blocking,
|
|
83
85
|
})),
|
|
84
86
|
...(retryAttempt !== undefined ? { retryAttempt } : {}),
|
|
85
87
|
...(maxRetries !== undefined ? { maxRetries } : {}),
|
|
@@ -112,7 +112,9 @@ const MAX_FAILURE_CONTEXT_CHARS = 10_000;
|
|
|
112
112
|
* Returns an empty string when all checks pass or the checks array is empty.
|
|
113
113
|
*/
|
|
114
114
|
export function formatFailureContext(result: VerificationResult): string {
|
|
115
|
-
|
|
115
|
+
// Only include blocking failures in retry context — non-blocking (advisory) failures
|
|
116
|
+
// should not be injected into retry prompts to avoid noise pollution.
|
|
117
|
+
const failures = result.checks.filter((c) => c.exitCode !== 0 && c.blocking);
|
|
116
118
|
if (failures.length === 0) return "";
|
|
117
119
|
|
|
118
120
|
const blocks: string[] = [];
|
|
@@ -256,6 +258,10 @@ export function runVerificationGate(options: RunVerificationGateOptions): Verifi
|
|
|
256
258
|
};
|
|
257
259
|
}
|
|
258
260
|
|
|
261
|
+
// Commands from preference and task-plan sources are blocking;
|
|
262
|
+
// package-json discovered commands are advisory (non-blocking).
|
|
263
|
+
const blocking = source === "preference" || source === "task-plan";
|
|
264
|
+
|
|
259
265
|
const checks: VerificationCheck[] = [];
|
|
260
266
|
|
|
261
267
|
for (const command of commands) {
|
|
@@ -291,11 +297,16 @@ export function runVerificationGate(options: RunVerificationGateOptions): Verifi
|
|
|
291
297
|
stdout: truncate(result.stdout, MAX_OUTPUT_BYTES),
|
|
292
298
|
stderr,
|
|
293
299
|
durationMs,
|
|
300
|
+
blocking,
|
|
294
301
|
});
|
|
295
302
|
}
|
|
296
303
|
|
|
304
|
+
// Gate passes if all blocking checks pass (non-blocking failures are advisory)
|
|
305
|
+
const blockingChecks = checks.filter(c => c.blocking);
|
|
306
|
+
const passed = blockingChecks.length === 0 || blockingChecks.every(c => c.exitCode === 0);
|
|
307
|
+
|
|
297
308
|
return {
|
|
298
|
-
passed
|
|
309
|
+
passed,
|
|
299
310
|
checks,
|
|
300
311
|
discoverySource: source,
|
|
301
312
|
timestamp,
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Bugfix Workflow
|
|
2
|
+
|
|
3
|
+
<template_meta>
|
|
4
|
+
name: bugfix
|
|
5
|
+
version: 1
|
|
6
|
+
requires_project: false
|
|
7
|
+
artifact_dir: .gsd/workflows/bugfixes/
|
|
8
|
+
</template_meta>
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
Fix a bug from identification through to PR submission. Designed for issues reported
|
|
12
|
+
via GitHub, user reports, or developer discovery. Emphasizes root cause analysis
|
|
13
|
+
before jumping to fixes.
|
|
14
|
+
</purpose>
|
|
15
|
+
|
|
16
|
+
<phases>
|
|
17
|
+
1. triage — Identify root cause, reproduce the bug
|
|
18
|
+
2. fix — Implement the fix with tests
|
|
19
|
+
3. verify — Run full test suite, check for regressions
|
|
20
|
+
4. ship — Create PR with detailed explanation
|
|
21
|
+
</phases>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
|
|
25
|
+
## Phase 1: Triage
|
|
26
|
+
|
|
27
|
+
**Goal:** Understand the bug before touching any code.
|
|
28
|
+
|
|
29
|
+
1. **Gather context:**
|
|
30
|
+
- If a GitHub issue was referenced, read the issue description, labels, and comments
|
|
31
|
+
- Identify the expected behavior vs actual behavior
|
|
32
|
+
- Note any error messages, stack traces, or reproduction steps provided
|
|
33
|
+
|
|
34
|
+
2. **Reproduce:**
|
|
35
|
+
- Find the minimal reproduction path
|
|
36
|
+
- Identify the affected code paths (files, functions, lines)
|
|
37
|
+
- If the bug is intermittent, note the conditions that trigger it
|
|
38
|
+
|
|
39
|
+
3. **Root cause analysis:**
|
|
40
|
+
- Trace the bug to its root cause (not just the symptom)
|
|
41
|
+
- Identify when the bug was introduced if possible (git blame/log)
|
|
42
|
+
- Assess blast radius: what else could be affected?
|
|
43
|
+
|
|
44
|
+
4. **Produce:** Write a brief `TRIAGE.md` in the artifact directory with:
|
|
45
|
+
- Root cause explanation
|
|
46
|
+
- Reproduction steps
|
|
47
|
+
- Affected files/functions
|
|
48
|
+
- Proposed fix approach
|
|
49
|
+
|
|
50
|
+
5. **Gate:** Present the triage findings and proposed fix to the user for confirmation.
|
|
51
|
+
|
|
52
|
+
## Phase 2: Fix
|
|
53
|
+
|
|
54
|
+
**Goal:** Implement a clean, tested fix.
|
|
55
|
+
|
|
56
|
+
1. **Plan the fix:** Write a brief plan (1-3 tasks max)
|
|
57
|
+
2. **Write the fix:** Implement the code change
|
|
58
|
+
3. **Write tests:** Add or update tests that:
|
|
59
|
+
- Reproduce the original bug (test fails without fix)
|
|
60
|
+
- Verify the fix works
|
|
61
|
+
- Cover edge cases
|
|
62
|
+
4. **Commit:** Atomic commit with message: `fix(<scope>): <description>`
|
|
63
|
+
|
|
64
|
+
## Phase 3: Verify
|
|
65
|
+
|
|
66
|
+
**Goal:** Ensure the fix doesn't break anything else.
|
|
67
|
+
|
|
68
|
+
1. Run the project's full test suite
|
|
69
|
+
2. Run the build (if applicable)
|
|
70
|
+
3. Run the linter (if applicable)
|
|
71
|
+
4. Check for regressions in related functionality
|
|
72
|
+
5. If any failures, fix them before proceeding
|
|
73
|
+
|
|
74
|
+
## Phase 4: Ship
|
|
75
|
+
|
|
76
|
+
**Goal:** Create a well-documented PR.
|
|
77
|
+
|
|
78
|
+
1. Ensure all changes are committed on the workflow branch
|
|
79
|
+
2. Build the PR body:
|
|
80
|
+
- Link to the original issue (if applicable)
|
|
81
|
+
- Explain the root cause
|
|
82
|
+
- Describe the fix approach
|
|
83
|
+
- List the test coverage added
|
|
84
|
+
3. Present the PR details to the user for review
|
|
85
|
+
4. Create the PR via `gh pr create` (with user approval)
|
|
86
|
+
|
|
87
|
+
</process>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Dependency Upgrade Workflow
|
|
2
|
+
|
|
3
|
+
<template_meta>
|
|
4
|
+
name: dep-upgrade
|
|
5
|
+
version: 1
|
|
6
|
+
requires_project: false
|
|
7
|
+
artifact_dir: .gsd/workflows/upgrades/
|
|
8
|
+
</template_meta>
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
Upgrade project dependencies safely. Assess breaking changes before upgrading,
|
|
12
|
+
fix issues incrementally, and verify everything works. Handles both single-package
|
|
13
|
+
upgrades and bulk dependency refresh.
|
|
14
|
+
</purpose>
|
|
15
|
+
|
|
16
|
+
<phases>
|
|
17
|
+
1. assess — Analyze what's outdated and what will break
|
|
18
|
+
2. upgrade — Apply upgrades incrementally
|
|
19
|
+
3. fix — Resolve breaking changes
|
|
20
|
+
4. verify — Full test suite and build validation
|
|
21
|
+
</phases>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
|
|
25
|
+
## Phase 1: Assess
|
|
26
|
+
|
|
27
|
+
**Goal:** Know what you're getting into before changing versions.
|
|
28
|
+
|
|
29
|
+
1. **List outdated dependencies:** Run `npm outdated` / equivalent
|
|
30
|
+
2. **For each target upgrade:**
|
|
31
|
+
- Read the changelog / release notes
|
|
32
|
+
- Identify breaking changes
|
|
33
|
+
- Check for known migration guides
|
|
34
|
+
- Assess impact on the codebase (grep for affected APIs)
|
|
35
|
+
3. **Prioritize:** Which upgrades to do now, which to defer
|
|
36
|
+
4. **Produce:** Write `ASSESSMENT.md` with:
|
|
37
|
+
- Dependency list with current → target versions
|
|
38
|
+
- Breaking changes per dependency
|
|
39
|
+
- Upgrade order (dependencies before dependents)
|
|
40
|
+
- Risk assessment
|
|
41
|
+
|
|
42
|
+
5. **Gate:** Review assessment with user. Confirm upgrade scope.
|
|
43
|
+
|
|
44
|
+
## Phase 2: Upgrade
|
|
45
|
+
|
|
46
|
+
**Goal:** Apply version bumps incrementally.
|
|
47
|
+
|
|
48
|
+
1. Upgrade one dependency (or one group of related dependencies) at a time
|
|
49
|
+
2. Run tests after each upgrade
|
|
50
|
+
3. Commit each upgrade: `chore(deps): upgrade <package> to <version>`
|
|
51
|
+
4. If tests fail, move to Phase 3 for that dependency before continuing
|
|
52
|
+
|
|
53
|
+
## Phase 3: Fix
|
|
54
|
+
|
|
55
|
+
**Goal:** Resolve any breaking changes from upgrades.
|
|
56
|
+
|
|
57
|
+
1. Fix API changes, type errors, deprecations
|
|
58
|
+
2. Update configuration if needed
|
|
59
|
+
3. Commit fixes separately from the upgrade: `fix(deps): adapt to <package> v<version> changes`
|
|
60
|
+
|
|
61
|
+
## Phase 4: Verify
|
|
62
|
+
|
|
63
|
+
**Goal:** Ensure everything works together.
|
|
64
|
+
|
|
65
|
+
1. Run the full test suite
|
|
66
|
+
2. Run the build
|
|
67
|
+
3. Run the linter
|
|
68
|
+
4. Check for deprecation warnings in output
|
|
69
|
+
5. **Produce:** Write `SUMMARY.md` with:
|
|
70
|
+
- Dependencies upgraded (from → to)
|
|
71
|
+
- Breaking changes encountered and how they were resolved
|
|
72
|
+
- Any deferred upgrades and why
|
|
73
|
+
|
|
74
|
+
</process>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Full Project Workflow
|
|
2
|
+
|
|
3
|
+
<template_meta>
|
|
4
|
+
name: full-project
|
|
5
|
+
version: 1
|
|
6
|
+
requires_project: true
|
|
7
|
+
artifact_dir: .gsd/
|
|
8
|
+
</template_meta>
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
The complete GSD workflow with full ceremony: roadmap, milestones, slices, tasks,
|
|
12
|
+
research, planning, execution, and verification. Use for greenfield projects or
|
|
13
|
+
major features that need the full planning apparatus.
|
|
14
|
+
|
|
15
|
+
This template wraps the existing GSD workflow for registry completeness.
|
|
16
|
+
When selected, it routes to the standard /gsd init → /gsd auto pipeline.
|
|
17
|
+
</purpose>
|
|
18
|
+
|
|
19
|
+
<phases>
|
|
20
|
+
1. init — Initialize project, detect stack, create .gsd/
|
|
21
|
+
2. discuss — Define requirements, decisions, and architecture
|
|
22
|
+
3. plan — Create roadmap with milestones and slices
|
|
23
|
+
4. execute — Execute slices: research → plan → implement → verify per slice
|
|
24
|
+
5. verify — Milestone-level verification and completion
|
|
25
|
+
</phases>
|
|
26
|
+
|
|
27
|
+
<process>
|
|
28
|
+
|
|
29
|
+
## Routing to Standard GSD
|
|
30
|
+
|
|
31
|
+
This template is a convenience entry point. When selected via `/gsd start full-project`,
|
|
32
|
+
it should route to the standard GSD workflow:
|
|
33
|
+
|
|
34
|
+
1. If `.gsd/` doesn't exist: Run `/gsd init` to bootstrap the project
|
|
35
|
+
2. If `.gsd/` exists but no milestones: Start the discuss phase via `/gsd discuss`
|
|
36
|
+
3. If milestones exist: Resume via `/gsd auto` or `/gsd next`
|
|
37
|
+
|
|
38
|
+
The full GSD workflow protocol is defined in `GSD-WORKFLOW.md` and handles all
|
|
39
|
+
phases, state tracking, and agent orchestration.
|
|
40
|
+
|
|
41
|
+
</process>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Hotfix Workflow
|
|
2
|
+
|
|
3
|
+
<template_meta>
|
|
4
|
+
name: hotfix
|
|
5
|
+
version: 1
|
|
6
|
+
requires_project: false
|
|
7
|
+
artifact_dir: null
|
|
8
|
+
</template_meta>
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
Minimal ceremony for urgent fixes. Fix it, test it, ship it. No planning artifacts,
|
|
12
|
+
no research phase, no lengthy documentation. For when production is broken and
|
|
13
|
+
speed matters.
|
|
14
|
+
</purpose>
|
|
15
|
+
|
|
16
|
+
<phases>
|
|
17
|
+
1. fix — Identify and fix the issue
|
|
18
|
+
2. ship — Test, commit, and create PR
|
|
19
|
+
</phases>
|
|
20
|
+
|
|
21
|
+
<process>
|
|
22
|
+
|
|
23
|
+
## Phase 1: Fix
|
|
24
|
+
|
|
25
|
+
**Goal:** Find and fix the issue as fast as possible.
|
|
26
|
+
|
|
27
|
+
1. Identify the broken behavior
|
|
28
|
+
2. Locate the root cause
|
|
29
|
+
3. Implement the minimal fix
|
|
30
|
+
4. Add a regression test if possible (don't block on this if the fix is urgent)
|
|
31
|
+
5. Commit: `fix(<scope>): <description>`
|
|
32
|
+
|
|
33
|
+
## Phase 2: Ship
|
|
34
|
+
|
|
35
|
+
**Goal:** Get the fix deployed.
|
|
36
|
+
|
|
37
|
+
1. Run tests — fix any failures
|
|
38
|
+
2. Run the build
|
|
39
|
+
3. Push and create PR with:
|
|
40
|
+
- What broke
|
|
41
|
+
- What the fix does
|
|
42
|
+
- How to verify
|
|
43
|
+
4. Present PR to user for approval
|
|
44
|
+
|
|
45
|
+
</process>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Refactor / Migration Workflow
|
|
2
|
+
|
|
3
|
+
<template_meta>
|
|
4
|
+
name: refactor
|
|
5
|
+
version: 1
|
|
6
|
+
requires_project: false
|
|
7
|
+
artifact_dir: .gsd/workflows/refactors/
|
|
8
|
+
</template_meta>
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
Systematic code transformation with inventory-driven planning. Designed for
|
|
12
|
+
renames, restructures, pattern migrations, and API modernization. Executes in
|
|
13
|
+
waves to minimize risk and enable incremental verification.
|
|
14
|
+
</purpose>
|
|
15
|
+
|
|
16
|
+
<phases>
|
|
17
|
+
1. inventory — Catalog everything that needs to change
|
|
18
|
+
2. plan — Group changes into safe waves
|
|
19
|
+
3. migrate — Execute waves with verification between each
|
|
20
|
+
4. verify — Full regression testing and cleanup
|
|
21
|
+
</phases>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
|
|
25
|
+
## Phase 1: Inventory
|
|
26
|
+
|
|
27
|
+
**Goal:** Know the full scope before changing anything.
|
|
28
|
+
|
|
29
|
+
1. **Scan the codebase:** Find all instances of what needs to change
|
|
30
|
+
- Files, functions, types, imports, tests, docs, config
|
|
31
|
+
- Use grep/glob to be exhaustive — don't rely on memory
|
|
32
|
+
2. **Categorize:** Group by type (source, test, config, docs)
|
|
33
|
+
3. **Identify dependencies:** What order must changes happen in?
|
|
34
|
+
4. **Produce:** Write `INVENTORY.md` with:
|
|
35
|
+
- Complete list of files/locations that need changes
|
|
36
|
+
- Dependency relationships
|
|
37
|
+
- Estimated scope (number of files, lines affected)
|
|
38
|
+
|
|
39
|
+
5. **Gate:** Review inventory with user. Confirm nothing is missing.
|
|
40
|
+
|
|
41
|
+
## Phase 2: Plan
|
|
42
|
+
|
|
43
|
+
**Goal:** Break the migration into safe, independently-verifiable waves.
|
|
44
|
+
|
|
45
|
+
1. **Define waves:** Group related changes so each wave:
|
|
46
|
+
- Leaves the codebase in a working state
|
|
47
|
+
- Can be committed and tested independently
|
|
48
|
+
- Handles dependencies (change the definition before the consumers)
|
|
49
|
+
2. **Typical wave structure:**
|
|
50
|
+
- Wave 1: Types/interfaces
|
|
51
|
+
- Wave 2: Core implementation
|
|
52
|
+
- Wave 3: Consumers/callers
|
|
53
|
+
- Wave 4: Tests
|
|
54
|
+
- Wave 5: Documentation and config
|
|
55
|
+
3. **Produce:** Write `PLAN.md` with waves and per-wave file lists
|
|
56
|
+
|
|
57
|
+
4. **Gate:** Confirm plan with user.
|
|
58
|
+
|
|
59
|
+
## Phase 3: Migrate
|
|
60
|
+
|
|
61
|
+
**Goal:** Execute waves one at a time with verification between each.
|
|
62
|
+
|
|
63
|
+
1. For each wave:
|
|
64
|
+
- Make the changes
|
|
65
|
+
- Run tests (at minimum, the build must pass)
|
|
66
|
+
- Commit: `refactor(<scope>): wave N — <description>`
|
|
67
|
+
2. If a wave introduces failures, fix them before moving to the next wave
|
|
68
|
+
3. If unexpected scope is discovered, update the inventory and plan
|
|
69
|
+
|
|
70
|
+
## Phase 4: Verify
|
|
71
|
+
|
|
72
|
+
**Goal:** Ensure the full refactor is complete and clean.
|
|
73
|
+
|
|
74
|
+
1. Run the complete test suite
|
|
75
|
+
2. Run the build
|
|
76
|
+
3. Run the linter — fix any new warnings
|
|
77
|
+
4. Search for any remnants of the old pattern (grep for old names/patterns)
|
|
78
|
+
5. **Produce:** Write `SUMMARY.md` with:
|
|
79
|
+
- What was changed and why
|
|
80
|
+
- Files modified (count and list)
|
|
81
|
+
- Any remaining follow-up items
|
|
82
|
+
|
|
83
|
+
</process>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"templates": {
|
|
4
|
+
"full-project": {
|
|
5
|
+
"name": "Full Project",
|
|
6
|
+
"description": "Complete GSD workflow with roadmap, milestones, slices, and full ceremony",
|
|
7
|
+
"file": "full-project.md",
|
|
8
|
+
"phases": ["init", "discuss", "plan", "execute", "verify"],
|
|
9
|
+
"triggers": ["new project", "greenfield", "from scratch", "build an app", "create a new"],
|
|
10
|
+
"artifact_dir": ".gsd/",
|
|
11
|
+
"estimated_complexity": "high",
|
|
12
|
+
"requires_project": true
|
|
13
|
+
},
|
|
14
|
+
"bugfix": {
|
|
15
|
+
"name": "Bug Fix",
|
|
16
|
+
"description": "Triage, reproduce, fix, test, and ship a bug fix",
|
|
17
|
+
"file": "bugfix.md",
|
|
18
|
+
"phases": ["triage", "fix", "verify", "ship"],
|
|
19
|
+
"triggers": ["bug", "issue", "fix", "broken", "regression", "error", "crash", "failing", "github.com/*/issues/*"],
|
|
20
|
+
"artifact_dir": ".gsd/workflows/bugfixes/",
|
|
21
|
+
"estimated_complexity": "low",
|
|
22
|
+
"requires_project": false
|
|
23
|
+
},
|
|
24
|
+
"small-feature": {
|
|
25
|
+
"name": "Small Feature",
|
|
26
|
+
"description": "Lightweight feature development with optional discussion and research",
|
|
27
|
+
"file": "small-feature.md",
|
|
28
|
+
"phases": ["scope", "plan", "implement", "verify"],
|
|
29
|
+
"triggers": ["add", "feature", "implement", "build", "create", "new command", "new endpoint"],
|
|
30
|
+
"artifact_dir": ".gsd/workflows/features/",
|
|
31
|
+
"estimated_complexity": "medium",
|
|
32
|
+
"requires_project": false
|
|
33
|
+
},
|
|
34
|
+
"refactor": {
|
|
35
|
+
"name": "Refactor / Migration",
|
|
36
|
+
"description": "Systematic code transformation with inventory and wave-based execution",
|
|
37
|
+
"file": "refactor.md",
|
|
38
|
+
"phases": ["inventory", "plan", "migrate", "verify"],
|
|
39
|
+
"triggers": ["refactor", "migrate", "rename", "restructure", "move", "reorganize", "clean up"],
|
|
40
|
+
"artifact_dir": ".gsd/workflows/refactors/",
|
|
41
|
+
"estimated_complexity": "medium",
|
|
42
|
+
"requires_project": false
|
|
43
|
+
},
|
|
44
|
+
"spike": {
|
|
45
|
+
"name": "Research Spike",
|
|
46
|
+
"description": "Investigate a question, prototype, and document findings",
|
|
47
|
+
"file": "spike.md",
|
|
48
|
+
"phases": ["scope", "research", "synthesize"],
|
|
49
|
+
"triggers": ["research", "investigate", "explore", "spike", "compare", "evaluate", "should we", "what if", "how does"],
|
|
50
|
+
"artifact_dir": ".gsd/workflows/spikes/",
|
|
51
|
+
"estimated_complexity": "low",
|
|
52
|
+
"requires_project": false
|
|
53
|
+
},
|
|
54
|
+
"hotfix": {
|
|
55
|
+
"name": "Hotfix",
|
|
56
|
+
"description": "Minimal ceremony: fix the thing, test it, ship it",
|
|
57
|
+
"file": "hotfix.md",
|
|
58
|
+
"phases": ["fix", "ship"],
|
|
59
|
+
"triggers": ["hotfix", "urgent", "critical", "asap", "production down", "p0"],
|
|
60
|
+
"artifact_dir": null,
|
|
61
|
+
"estimated_complexity": "minimal",
|
|
62
|
+
"requires_project": false
|
|
63
|
+
},
|
|
64
|
+
"security-audit": {
|
|
65
|
+
"name": "Security Audit",
|
|
66
|
+
"description": "Scan for vulnerabilities, triage findings, remediate, and verify",
|
|
67
|
+
"file": "security-audit.md",
|
|
68
|
+
"phases": ["scan", "triage", "remediate", "re-scan"],
|
|
69
|
+
"triggers": ["security", "audit", "vulnerability", "owasp", "cve", "penetration", "hardening"],
|
|
70
|
+
"artifact_dir": ".gsd/workflows/audits/",
|
|
71
|
+
"estimated_complexity": "medium",
|
|
72
|
+
"requires_project": false
|
|
73
|
+
},
|
|
74
|
+
"dep-upgrade": {
|
|
75
|
+
"name": "Dependency Upgrade",
|
|
76
|
+
"description": "Assess impact, upgrade dependencies, fix breaking changes",
|
|
77
|
+
"file": "dep-upgrade.md",
|
|
78
|
+
"phases": ["assess", "upgrade", "fix", "verify"],
|
|
79
|
+
"triggers": ["upgrade", "update", "dependency", "deps", "bump", "outdated", "npm update", "renovate"],
|
|
80
|
+
"artifact_dir": ".gsd/workflows/upgrades/",
|
|
81
|
+
"estimated_complexity": "medium",
|
|
82
|
+
"requires_project": false
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Security Audit Workflow
|
|
2
|
+
|
|
3
|
+
<template_meta>
|
|
4
|
+
name: security-audit
|
|
5
|
+
version: 1
|
|
6
|
+
requires_project: false
|
|
7
|
+
artifact_dir: .gsd/workflows/audits/
|
|
8
|
+
</template_meta>
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
Systematic security review of the codebase. Scan for vulnerabilities, triage
|
|
12
|
+
findings by severity, remediate issues, and verify fixes. Covers OWASP Top 10,
|
|
13
|
+
dependency vulnerabilities, and project-specific security concerns.
|
|
14
|
+
</purpose>
|
|
15
|
+
|
|
16
|
+
<phases>
|
|
17
|
+
1. scan — Identify potential vulnerabilities
|
|
18
|
+
2. triage — Prioritize findings by severity and exploitability
|
|
19
|
+
3. remediate — Fix critical and high-severity issues
|
|
20
|
+
4. re-scan — Verify fixes and document remaining items
|
|
21
|
+
</phases>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
|
|
25
|
+
## Phase 1: Scan
|
|
26
|
+
|
|
27
|
+
**Goal:** Identify potential security issues across the codebase.
|
|
28
|
+
|
|
29
|
+
1. **Dependency audit:** Run `npm audit` / `pip audit` / equivalent
|
|
30
|
+
2. **Code review for common vulnerabilities:**
|
|
31
|
+
- Injection (SQL, command, XSS)
|
|
32
|
+
- Authentication/authorization flaws
|
|
33
|
+
- Sensitive data exposure (hardcoded secrets, logs)
|
|
34
|
+
- Insecure configuration
|
|
35
|
+
- Missing input validation at boundaries
|
|
36
|
+
3. **Check security headers and CORS** (if web application)
|
|
37
|
+
4. **Review secrets management:** .env files, config, environment variables
|
|
38
|
+
5. **Produce:** Write `SCAN-RESULTS.md` with all findings
|
|
39
|
+
|
|
40
|
+
## Phase 2: Triage
|
|
41
|
+
|
|
42
|
+
**Goal:** Prioritize what to fix now vs later.
|
|
43
|
+
|
|
44
|
+
1. **Rate each finding:**
|
|
45
|
+
- Critical: exploitable, high impact, fix immediately
|
|
46
|
+
- High: likely exploitable, fix in this workflow
|
|
47
|
+
- Medium: lower risk, fix if time allows
|
|
48
|
+
- Low: informational, document for later
|
|
49
|
+
2. **Assess exploitability:** Is this theoretical or practically exploitable?
|
|
50
|
+
3. **Produce:** Update `SCAN-RESULTS.md` with severity ratings and triage decisions
|
|
51
|
+
|
|
52
|
+
4. **Gate:** Review triage with user. Agree on what to remediate now.
|
|
53
|
+
|
|
54
|
+
## Phase 3: Remediate
|
|
55
|
+
|
|
56
|
+
**Goal:** Fix critical and high-severity issues.
|
|
57
|
+
|
|
58
|
+
1. Fix each issue with proper testing
|
|
59
|
+
2. Commit each fix individually: `fix(security): <description>`
|
|
60
|
+
3. Don't introduce new functionality — security fixes only
|
|
61
|
+
|
|
62
|
+
## Phase 4: Re-scan
|
|
63
|
+
|
|
64
|
+
**Goal:** Verify fixes and document the final state.
|
|
65
|
+
|
|
66
|
+
1. Re-run the scans from Phase 1
|
|
67
|
+
2. Verify all targeted issues are resolved
|
|
68
|
+
3. **Produce:** Write `AUDIT-REPORT.md` with:
|
|
69
|
+
- Summary of findings and fixes
|
|
70
|
+
- Remaining medium/low items for future attention
|
|
71
|
+
- Recommendations for ongoing security practices
|
|
72
|
+
|
|
73
|
+
</process>
|