fix(sdk): use installed agent/workflow prompts instead of stripped-down bundled copies
The SDK bundled its own agents and workflows at ~17% the size of the real ones, missing critical instructions like file naming conventions, scope reduction rules, discovery protocols, and TDD integration. This caused the planner to create a single PLAN.md instead of properly named per-plan files (01-01-PLAN.md, 01-02-PLAN.md), breaking wave-based parallel execution. - Invert load priority: installed GSD agents/workflows first, SDK bundled as last-resort fallback - Replace @-reference stripping with resolution (read + inline content) - Use full agent definitions instead of extracting only the <role> block - Delete sdk/prompts/agents/ and sdk/prompts/workflows/ (13 files) - Delete headless-prompts.test.ts (validated deleted files) - Thread projectDir through sanitizePrompt for @-reference resolution Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -399,7 +399,7 @@ export class InitRunner {
|
||||
'',
|
||||
'Write the file to .planning/PROJECT.md. Follow the template structure but fill in with real content derived from the user input.',
|
||||
'Be specific and opinionated — make decisions, don\'t list options.',
|
||||
].join('\n'));
|
||||
].join('\n'), this.projectDir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -447,7 +447,7 @@ export class InitRunner {
|
||||
'',
|
||||
`Write .planning/research/${researchType}.md following the template structure.`,
|
||||
'Be comprehensive but opinionated. "Use X because Y" not "Options are X, Y, Z."',
|
||||
].join('\n'));
|
||||
].join('\n'), this.projectDir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -492,7 +492,7 @@ export class InitRunner {
|
||||
'',
|
||||
'Write .planning/research/SUMMARY.md synthesizing all research findings.',
|
||||
'Also commit all research files: git add .planning/research/ && git commit.',
|
||||
].join('\n'));
|
||||
].join('\n'), this.projectDir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -540,7 +540,7 @@ export class InitRunner {
|
||||
'',
|
||||
'Write .planning/REQUIREMENTS.md following the template structure.',
|
||||
'Every requirement must be testable and specific. No vague aspirations.',
|
||||
].join('\n'));
|
||||
].join('\n'), this.projectDir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -591,7 +591,7 @@ export class InitRunner {
|
||||
'Create .planning/ROADMAP.md and .planning/STATE.md.',
|
||||
'ROADMAP.md: Transform requirements into phases. Every v1 requirement maps to exactly one phase.',
|
||||
'STATE.md: Initialize project state tracking.',
|
||||
].join('\n'));
|
||||
].join('\n'), this.projectDir);
|
||||
}
|
||||
|
||||
// ─── Session execution ─────────────────────────────────────────────────────
|
||||
@@ -625,42 +625,41 @@ export class InitRunner {
|
||||
* falls back to GSD-1 originals (~/.claude/get-shit-done/).
|
||||
*/
|
||||
private async readGSDFile(relativePath: string): Promise<string> {
|
||||
// Try SDK prompts dir first (headless versions)
|
||||
const sdkPath = join(this.sdkPromptsDir, relativePath);
|
||||
try {
|
||||
return await readFile(sdkPath, 'utf-8');
|
||||
} catch {
|
||||
// Not in sdk/prompts/, fall through to GSD-1 originals
|
||||
}
|
||||
|
||||
// Fall back to GSD-1 originals
|
||||
// Try installed GSD first (complete, up-to-date versions)
|
||||
const fullPath = join(GSD_TEMPLATES_DIR, '..', relativePath);
|
||||
try {
|
||||
return await readFile(fullPath, 'utf-8');
|
||||
} catch {
|
||||
// If the template doesn't exist, return a placeholder
|
||||
// Not installed, fall through to SDK bundled copies
|
||||
}
|
||||
|
||||
// Fall back to SDK bundled copies
|
||||
const sdkPath = join(this.sdkPromptsDir, relativePath);
|
||||
try {
|
||||
return await readFile(sdkPath, 'utf-8');
|
||||
} catch {
|
||||
return `(Template not found: ${relativePath})`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read an agent definition.
|
||||
* Tries sdk/prompts/agents/{filename} first (headless versions), then
|
||||
* falls back to GSD-1 originals (~/.claude/agents/).
|
||||
* Tries installed agents first (complete, up-to-date versions), then
|
||||
* falls back to SDK bundled copies.
|
||||
*/
|
||||
private async readAgentFile(filename: string): Promise<string> {
|
||||
// Try SDK prompts dir first (headless versions)
|
||||
const sdkPath = join(this.sdkPromptsDir, 'agents', filename);
|
||||
try {
|
||||
return await readFile(sdkPath, 'utf-8');
|
||||
} catch {
|
||||
// Not in sdk/prompts/, fall through to GSD-1 originals
|
||||
}
|
||||
|
||||
// Fall back to GSD-1 originals
|
||||
// Try installed agents first (complete, up-to-date versions)
|
||||
const fullPath = join(GSD_AGENTS_DIR, filename);
|
||||
try {
|
||||
return await readFile(fullPath, 'utf-8');
|
||||
} catch {
|
||||
// Not installed, fall through to SDK bundled copies
|
||||
}
|
||||
|
||||
// Fall back to SDK bundled copies
|
||||
const sdkPath = join(this.sdkPromptsDir, 'agents', filename);
|
||||
try {
|
||||
return await readFile(sdkPath, 'utf-8');
|
||||
} catch {
|
||||
return `(Agent definition not found: ${filename})`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user