gsd-pi 2.29.0-dev.49d972f → 2.29.0-dev.4c155ee
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/headless.js +4 -0
- 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 +32 -3
- package/dist/resources/extensions/gsd/auto-post-unit.ts +44 -12
- package/dist/resources/extensions/gsd/auto-prompts.ts +40 -17
- package/dist/resources/extensions/gsd/auto-recovery.ts +2 -1
- package/dist/resources/extensions/gsd/auto-start.ts +18 -32
- package/dist/resources/extensions/gsd/auto-worktree.ts +21 -182
- package/dist/resources/extensions/gsd/auto.ts +2 -9
- package/dist/resources/extensions/gsd/captures.ts +4 -10
- package/dist/resources/extensions/gsd/commands-handlers.ts +2 -1
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +44 -14
- package/dist/resources/extensions/gsd/commands-workflow-templates.ts +544 -0
- package/dist/resources/extensions/gsd/commands.ts +55 -2
- package/dist/resources/extensions/gsd/detection.ts +2 -1
- package/dist/resources/extensions/gsd/doctor-checks.ts +49 -1
- package/dist/resources/extensions/gsd/doctor-types.ts +3 -1
- package/dist/resources/extensions/gsd/forensics.ts +2 -2
- package/dist/resources/extensions/gsd/git-service.ts +3 -2
- package/dist/resources/extensions/gsd/gitignore.ts +9 -63
- package/dist/resources/extensions/gsd/gsd-db.ts +1 -165
- package/dist/resources/extensions/gsd/guided-flow.ts +8 -5
- package/dist/resources/extensions/gsd/index.ts +3 -3
- package/dist/resources/extensions/gsd/md-importer.ts +3 -2
- package/dist/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/dist/resources/extensions/gsd/migrate/command.ts +3 -2
- package/dist/resources/extensions/gsd/migrate/writer.ts +2 -1
- package/dist/resources/extensions/gsd/migrate-external.ts +123 -0
- package/dist/resources/extensions/gsd/paths.ts +24 -2
- package/dist/resources/extensions/gsd/post-unit-hooks.ts +6 -5
- 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/preferences.ts +10 -5
- 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/repo-identity.ts +148 -0
- package/dist/resources/extensions/gsd/resource-version.ts +99 -0
- package/dist/resources/extensions/gsd/session-forensics.ts +4 -3
- package/dist/resources/extensions/gsd/tests/activity-log.test.ts +2 -2
- package/dist/resources/extensions/gsd/tests/auto-recovery.test.ts +3 -3
- package/dist/resources/extensions/gsd/tests/auto-worktree.test.ts +0 -58
- package/dist/resources/extensions/gsd/tests/doctor-runtime.test.ts +3 -4
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +60 -38
- package/dist/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +5 -18
- package/dist/resources/extensions/gsd/tests/git-service.test.ts +10 -37
- package/dist/resources/extensions/gsd/tests/knowledge.test.ts +4 -4
- package/dist/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/dist/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +1 -0
- package/dist/resources/extensions/gsd/tests/token-profile.test.ts +14 -16
- package/dist/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/dist/resources/extensions/gsd/triage-resolution.ts +2 -1
- package/dist/resources/extensions/gsd/types.ts +2 -0
- 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/gsd/worktree-command.ts +1 -11
- package/dist/resources/extensions/gsd/worktree-manager.ts +3 -2
- package/dist/resources/extensions/gsd/worktree.ts +42 -5
- package/dist/resources/extensions/mcp-client/index.ts +459 -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/dist/resources/skills/react-best-practices/SKILL.md +1 -1
- package/package.json +1 -1
- 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/src/core/extensions/loader.ts +13 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +3 -0
- 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 +32 -3
- package/src/resources/extensions/gsd/auto-post-unit.ts +44 -12
- package/src/resources/extensions/gsd/auto-prompts.ts +40 -17
- package/src/resources/extensions/gsd/auto-recovery.ts +2 -1
- package/src/resources/extensions/gsd/auto-start.ts +18 -32
- package/src/resources/extensions/gsd/auto-worktree.ts +21 -182
- package/src/resources/extensions/gsd/auto.ts +2 -9
- package/src/resources/extensions/gsd/captures.ts +4 -10
- package/src/resources/extensions/gsd/commands-handlers.ts +2 -1
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +44 -14
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +544 -0
- package/src/resources/extensions/gsd/commands.ts +55 -2
- package/src/resources/extensions/gsd/detection.ts +2 -1
- package/src/resources/extensions/gsd/doctor-checks.ts +49 -1
- package/src/resources/extensions/gsd/doctor-types.ts +3 -1
- package/src/resources/extensions/gsd/forensics.ts +2 -2
- package/src/resources/extensions/gsd/git-service.ts +3 -2
- package/src/resources/extensions/gsd/gitignore.ts +9 -63
- package/src/resources/extensions/gsd/gsd-db.ts +1 -165
- package/src/resources/extensions/gsd/guided-flow.ts +8 -5
- package/src/resources/extensions/gsd/index.ts +3 -3
- package/src/resources/extensions/gsd/md-importer.ts +3 -2
- package/src/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/src/resources/extensions/gsd/migrate/command.ts +3 -2
- package/src/resources/extensions/gsd/migrate/writer.ts +2 -1
- package/src/resources/extensions/gsd/migrate-external.ts +123 -0
- package/src/resources/extensions/gsd/paths.ts +24 -2
- package/src/resources/extensions/gsd/post-unit-hooks.ts +6 -5
- 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/preferences.ts +10 -5
- 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/repo-identity.ts +148 -0
- package/src/resources/extensions/gsd/resource-version.ts +99 -0
- package/src/resources/extensions/gsd/session-forensics.ts +4 -3
- package/src/resources/extensions/gsd/tests/activity-log.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/auto-worktree.test.ts +0 -58
- package/src/resources/extensions/gsd/tests/doctor-runtime.test.ts +3 -4
- package/src/resources/extensions/gsd/tests/extension-selector-separator.test.ts +60 -38
- package/src/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +5 -18
- package/src/resources/extensions/gsd/tests/git-service.test.ts +10 -37
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +14 -16
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/src/resources/extensions/gsd/triage-resolution.ts +2 -1
- package/src/resources/extensions/gsd/types.ts +2 -0
- 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/gsd/worktree-command.ts +1 -11
- package/src/resources/extensions/gsd/worktree-manager.ts +3 -2
- package/src/resources/extensions/gsd/worktree.ts +42 -5
- package/src/resources/extensions/mcp-client/index.ts +459 -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/src/resources/skills/react-best-practices/SKILL.md +1 -1
- package/dist/resources/extensions/gsd/auto-worktree-sync.ts +0 -199
- package/dist/resources/extensions/gsd/tests/worktree-db-integration.test.ts +0 -205
- package/dist/resources/extensions/gsd/tests/worktree-db.test.ts +0 -442
- package/dist/resources/extensions/mcporter/index.ts +0 -525
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +0 -199
- package/src/resources/extensions/gsd/tests/worktree-db-integration.test.ts +0 -205
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +0 -442
- package/src/resources/extensions/mcporter/index.ts +0 -525
|
@@ -53,6 +53,7 @@ test("types: PhaseSkipPreferences interface exported", () => {
|
|
|
53
53
|
assert.ok(typesSrc.includes("skip_research"), "should include skip_research");
|
|
54
54
|
assert.ok(typesSrc.includes("skip_reassess"), "should include skip_reassess");
|
|
55
55
|
assert.ok(typesSrc.includes("skip_slice_research"), "should include skip_slice_research");
|
|
56
|
+
assert.ok(typesSrc.includes("reassess_after_slice"), "should include reassess_after_slice");
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -113,24 +114,21 @@ test("profile: budget profile sets phase skips to true", () => {
|
|
|
113
114
|
assert.ok(budgetBlock.includes("skip_slice_research: true"), "budget should skip slice research");
|
|
114
115
|
});
|
|
115
116
|
|
|
116
|
-
test("profile: balanced profile skips
|
|
117
|
+
test("profile: balanced profile skips research, reassess, and slice research (ADR-003)", () => {
|
|
117
118
|
const balancedIdx = preferencesSrc.indexOf('case "balanced":');
|
|
118
119
|
const qualityIdx = preferencesSrc.indexOf('case "quality":');
|
|
119
120
|
const balancedBlock = preferencesSrc.slice(balancedIdx, qualityIdx);
|
|
120
121
|
assert.ok(balancedBlock.includes("skip_slice_research: true"), "balanced should skip slice research");
|
|
121
|
-
assert.ok(
|
|
122
|
-
assert.ok(
|
|
122
|
+
assert.ok(balancedBlock.includes("skip_research: true"), "balanced should skip milestone research");
|
|
123
|
+
assert.ok(balancedBlock.includes("skip_reassess: true"), "balanced should skip reassess");
|
|
123
124
|
});
|
|
124
125
|
|
|
125
|
-
test("profile: quality profile
|
|
126
|
+
test("profile: quality profile skips research, slice research, and reassess (ADR-003)", () => {
|
|
126
127
|
const qualityIdx = preferencesSrc.indexOf('case "quality":');
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
assert.ok(
|
|
131
|
-
qualityReturn.includes("phases: {}"),
|
|
132
|
-
"quality should have empty phases object (no skips)",
|
|
133
|
-
);
|
|
128
|
+
const qualityBlock = preferencesSrc.slice(qualityIdx, qualityIdx + 300);
|
|
129
|
+
assert.ok(qualityBlock.includes("skip_research: true"), "quality should skip research");
|
|
130
|
+
assert.ok(qualityBlock.includes("skip_slice_research: true"), "quality should skip slice research");
|
|
131
|
+
assert.ok(qualityBlock.includes("skip_reassess: true"), "quality should skip reassess");
|
|
134
132
|
});
|
|
135
133
|
|
|
136
134
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -253,10 +251,10 @@ test("dispatch: research-slice rule has skip guards", () => {
|
|
|
253
251
|
);
|
|
254
252
|
});
|
|
255
253
|
|
|
256
|
-
test("dispatch: reassess-roadmap rule has
|
|
254
|
+
test("dispatch: reassess-roadmap rule has reassess_after_slice opt-in guard (ADR-003)", () => {
|
|
257
255
|
assert.ok(
|
|
258
|
-
dispatchSrc.includes("
|
|
259
|
-
"reassess-roadmap dispatch rule should check phases.
|
|
256
|
+
dispatchSrc.includes("reassess_after_slice") && dispatchSrc.includes("reassess-roadmap"),
|
|
257
|
+
"reassess-roadmap dispatch rule should check phases.reassess_after_slice",
|
|
260
258
|
);
|
|
261
259
|
});
|
|
262
260
|
|
|
@@ -265,6 +263,6 @@ test("dispatch: phase skip guards return null (not stop)", () => {
|
|
|
265
263
|
const researchGuard = dispatchSrc.match(/skip_research\).*?return null/s);
|
|
266
264
|
assert.ok(researchGuard, "skip_research guard should return null (fall-through)");
|
|
267
265
|
|
|
268
|
-
const reassessGuard = dispatchSrc.match(/
|
|
269
|
-
assert.ok(reassessGuard, "
|
|
266
|
+
const reassessGuard = dispatchSrc.match(/reassess_after_slice\).*?return null/s);
|
|
267
|
+
assert.ok(reassessGuard, "reassess_after_slice guard should return null (fall-through)");
|
|
270
268
|
});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// GSD Workflow Templates — Unit Tests
|
|
2
|
+
//
|
|
3
|
+
// Tests registry loading, template resolution, auto-detection, and listing.
|
|
4
|
+
|
|
5
|
+
import { createTestContext } from './test-helpers.ts';
|
|
6
|
+
import {
|
|
7
|
+
loadRegistry,
|
|
8
|
+
resolveByName,
|
|
9
|
+
autoDetect,
|
|
10
|
+
listTemplates,
|
|
11
|
+
getTemplateInfo,
|
|
12
|
+
loadWorkflowTemplate,
|
|
13
|
+
} from '../workflow-templates.ts';
|
|
14
|
+
|
|
15
|
+
const { assertEq, assertTrue, assertMatch, report } = createTestContext();
|
|
16
|
+
|
|
17
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
18
|
+
// Registry Loading
|
|
19
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
20
|
+
|
|
21
|
+
console.log('\n── Registry Loading ──');
|
|
22
|
+
|
|
23
|
+
{
|
|
24
|
+
const registry = loadRegistry();
|
|
25
|
+
assertTrue(registry !== null, 'Registry should load');
|
|
26
|
+
assertEq(registry.version, 1, 'Registry version should be 1');
|
|
27
|
+
assertTrue(Object.keys(registry.templates).length >= 8, 'Should have at least 8 templates');
|
|
28
|
+
|
|
29
|
+
// Verify required template keys exist
|
|
30
|
+
const expectedIds = ['full-project', 'bugfix', 'small-feature', 'refactor', 'spike', 'hotfix', 'security-audit', 'dep-upgrade'];
|
|
31
|
+
for (const id of expectedIds) {
|
|
32
|
+
assertTrue(id in registry.templates, `Template "${id}" should exist in registry`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Verify each template has required fields
|
|
36
|
+
for (const [id, entry] of Object.entries(registry.templates)) {
|
|
37
|
+
assertTrue(typeof entry.name === 'string' && entry.name.length > 0, `${id}: name should be non-empty string`);
|
|
38
|
+
assertTrue(typeof entry.description === 'string' && entry.description.length > 0, `${id}: description should be non-empty`);
|
|
39
|
+
assertTrue(typeof entry.file === 'string' && entry.file.endsWith('.md'), `${id}: file should be a .md path`);
|
|
40
|
+
assertTrue(Array.isArray(entry.phases) && entry.phases.length > 0, `${id}: phases should be non-empty array`);
|
|
41
|
+
assertTrue(Array.isArray(entry.triggers) && entry.triggers.length > 0, `${id}: triggers should be non-empty array`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
46
|
+
// Resolve by Name
|
|
47
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
48
|
+
|
|
49
|
+
console.log('\n── Resolve by Name ──');
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
// Exact match
|
|
53
|
+
const bugfix = resolveByName('bugfix');
|
|
54
|
+
assertTrue(bugfix !== null, 'Should resolve "bugfix"');
|
|
55
|
+
assertEq(bugfix!.id, 'bugfix', 'ID should be "bugfix"');
|
|
56
|
+
assertEq(bugfix!.confidence, 'exact', 'Exact name should have exact confidence');
|
|
57
|
+
|
|
58
|
+
// Case-insensitive name match
|
|
59
|
+
const spike = resolveByName('Research Spike');
|
|
60
|
+
assertTrue(spike !== null, 'Should resolve "Research Spike" by name');
|
|
61
|
+
assertEq(spike!.id, 'spike', 'Should resolve to spike');
|
|
62
|
+
|
|
63
|
+
// Alias match
|
|
64
|
+
const bug = resolveByName('bug');
|
|
65
|
+
assertTrue(bug !== null, 'Should resolve "bug" alias');
|
|
66
|
+
assertEq(bug!.id, 'bugfix', 'Alias "bug" should map to bugfix');
|
|
67
|
+
|
|
68
|
+
const feat = resolveByName('feat');
|
|
69
|
+
assertTrue(feat !== null, 'Should resolve "feat" alias');
|
|
70
|
+
assertEq(feat!.id, 'small-feature', 'Alias "feat" should map to small-feature');
|
|
71
|
+
|
|
72
|
+
const deps = resolveByName('deps');
|
|
73
|
+
assertTrue(deps !== null, 'Should resolve "deps" alias');
|
|
74
|
+
assertEq(deps!.id, 'dep-upgrade', 'Alias "deps" should map to dep-upgrade');
|
|
75
|
+
|
|
76
|
+
// No match
|
|
77
|
+
const missing = resolveByName('nonexistent-template');
|
|
78
|
+
assertTrue(missing === null, 'Should return null for unknown template');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
82
|
+
// Auto-Detection
|
|
83
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
84
|
+
|
|
85
|
+
console.log('\n── Auto-Detection ──');
|
|
86
|
+
|
|
87
|
+
{
|
|
88
|
+
// Should detect bugfix from "fix" keyword
|
|
89
|
+
const fixMatches = autoDetect('fix the login button');
|
|
90
|
+
assertTrue(fixMatches.length > 0, 'Should detect matches for "fix the login button"');
|
|
91
|
+
assertTrue(fixMatches.some(m => m.id === 'bugfix'), 'Should include bugfix in matches');
|
|
92
|
+
|
|
93
|
+
// Should detect spike from "research" keyword
|
|
94
|
+
const researchMatches = autoDetect('research authentication libraries');
|
|
95
|
+
assertTrue(researchMatches.length > 0, 'Should detect matches for "research"');
|
|
96
|
+
assertTrue(researchMatches.some(m => m.id === 'spike'), 'Should include spike in matches');
|
|
97
|
+
|
|
98
|
+
// Should detect hotfix from "urgent" keyword
|
|
99
|
+
const urgentMatches = autoDetect('urgent production is down');
|
|
100
|
+
assertTrue(urgentMatches.length > 0, 'Should detect matches for "urgent"');
|
|
101
|
+
assertTrue(urgentMatches.some(m => m.id === 'hotfix'), 'Should include hotfix in matches');
|
|
102
|
+
|
|
103
|
+
// Should detect dep-upgrade from "upgrade" keyword
|
|
104
|
+
const upgradeMatches = autoDetect('upgrade react to v19');
|
|
105
|
+
assertTrue(upgradeMatches.length > 0, 'Should detect matches for "upgrade"');
|
|
106
|
+
assertTrue(upgradeMatches.some(m => m.id === 'dep-upgrade'), 'Should include dep-upgrade in matches');
|
|
107
|
+
|
|
108
|
+
// Multi-word triggers should score higher
|
|
109
|
+
const projectMatches = autoDetect('create a new project from scratch');
|
|
110
|
+
const projectMatch = projectMatches.find(m => m.id === 'full-project');
|
|
111
|
+
assertTrue(projectMatch !== undefined, 'Should detect full-project for "from scratch"');
|
|
112
|
+
|
|
113
|
+
// Empty input should return no matches
|
|
114
|
+
const emptyMatches = autoDetect('');
|
|
115
|
+
assertEq(emptyMatches.length, 0, 'Empty input should return no matches');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
119
|
+
// List Templates
|
|
120
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
121
|
+
|
|
122
|
+
console.log('\n── List Templates ──');
|
|
123
|
+
|
|
124
|
+
{
|
|
125
|
+
const output = listTemplates();
|
|
126
|
+
assertTrue(output.includes('Workflow Templates'), 'Should have header');
|
|
127
|
+
assertTrue(output.includes('bugfix'), 'Should list bugfix');
|
|
128
|
+
assertTrue(output.includes('spike'), 'Should list spike');
|
|
129
|
+
assertTrue(output.includes('hotfix'), 'Should list hotfix');
|
|
130
|
+
assertTrue(output.includes('/gsd start'), 'Should include usage hint');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
134
|
+
// Template Info
|
|
135
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
136
|
+
|
|
137
|
+
console.log('\n── Template Info ──');
|
|
138
|
+
|
|
139
|
+
{
|
|
140
|
+
const info = getTemplateInfo('bugfix');
|
|
141
|
+
assertTrue(info !== null, 'Should return info for bugfix');
|
|
142
|
+
assertTrue(info!.includes('Bug Fix'), 'Should include template name');
|
|
143
|
+
assertTrue(info!.includes('triage'), 'Should include phase names');
|
|
144
|
+
assertTrue(info!.includes('Triggers'), 'Should include triggers section');
|
|
145
|
+
|
|
146
|
+
const missing = getTemplateInfo('nonexistent');
|
|
147
|
+
assertTrue(missing === null, 'Should return null for unknown template');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
151
|
+
// Load Workflow Template Content
|
|
152
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
153
|
+
|
|
154
|
+
console.log('\n── Load Workflow Template ──');
|
|
155
|
+
|
|
156
|
+
{
|
|
157
|
+
const content = loadWorkflowTemplate('bugfix');
|
|
158
|
+
assertTrue(content !== null, 'Should load bugfix template');
|
|
159
|
+
assertTrue(content!.includes('Bugfix Workflow'), 'Should contain workflow title');
|
|
160
|
+
assertTrue(content!.includes('Phase 1: Triage'), 'Should contain triage phase');
|
|
161
|
+
assertTrue(content!.includes('Phase 4: Ship'), 'Should contain ship phase');
|
|
162
|
+
|
|
163
|
+
const hotfixContent = loadWorkflowTemplate('hotfix');
|
|
164
|
+
assertTrue(hotfixContent !== null, 'Should load hotfix template');
|
|
165
|
+
assertTrue(hotfixContent!.includes('Hotfix Workflow'), 'Should contain hotfix title');
|
|
166
|
+
|
|
167
|
+
const missingContent = loadWorkflowTemplate('nonexistent');
|
|
168
|
+
assertTrue(missingContent === null, 'Should return null for unknown template');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
172
|
+
|
|
173
|
+
report();
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { join } from "node:path";
|
|
15
|
+
import { gsdRoot } from "./paths.js";
|
|
15
16
|
import type { Classification, CaptureEntry } from "./captures.js";
|
|
16
17
|
import {
|
|
17
18
|
loadPendingCaptures,
|
|
@@ -36,7 +37,7 @@ export function executeInject(
|
|
|
36
37
|
): string | null {
|
|
37
38
|
try {
|
|
38
39
|
// Resolve the plan file path
|
|
39
|
-
const planPath = join(basePath, "
|
|
40
|
+
const planPath = join(gsdRoot(basePath), "milestones", mid, "slices", sid, `${sid}-PLAN.md`);
|
|
40
41
|
if (!existsSync(planPath)) return null;
|
|
41
42
|
|
|
42
43
|
const content = readFileSync(planPath, "utf-8");
|
|
@@ -304,6 +304,8 @@ export interface PhaseSkipPreferences {
|
|
|
304
304
|
skip_reassess?: boolean;
|
|
305
305
|
skip_slice_research?: boolean;
|
|
306
306
|
skip_milestone_validation?: boolean;
|
|
307
|
+
/** When true, reassess-roadmap fires after each slice completion. Opt-in. */
|
|
308
|
+
reassess_after_slice?: boolean;
|
|
307
309
|
/** When true, auto-mode pauses before each slice for discussion (#789). */
|
|
308
310
|
require_slice_discussion?: boolean;
|
|
309
311
|
}
|
|
@@ -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>
|