Merge pull request #1154 from gsd-build/Solvely/soft-gsd-workflow-enforcement

feat(new-project): add soft GSD workflow enforcement
This commit is contained in:
Tom Boucher
2026-03-19 12:03:31 -04:00
committed by GitHub
5 changed files with 137 additions and 6 deletions

View File

@@ -179,6 +179,17 @@ const CLAUDE_MD_FALLBACKS = {
architecture: 'Architecture not yet mapped. Follow existing patterns found in the codebase.',
};
const CLAUDE_MD_WORKFLOW_ENFORCEMENT = [
'Before using Edit, Write, or other file-changing tools, start work through a GSD command so planning artifacts and execution context stay in sync.',
'',
'Use these entry points:',
'- `/gsd:quick` for small fixes, doc updates, and ad-hoc tasks',
'- `/gsd:debug` for investigation and bug fixing',
'- `/gsd:execute-phase` for planned phase work',
'',
'Do not make direct repo edits outside a GSD workflow unless the user explicitly asks to bypass it.',
].join('\n');
const CLAUDE_MD_PROFILE_PLACEHOLDER = [
'<!-- GSD:profile-start -->',
'## Developer Profile',
@@ -356,6 +367,14 @@ function generateArchitectureSection(cwd) {
return { content: summary, source: 'ARCHITECTURE.md', hasFallback: false };
}
function generateWorkflowSection() {
return {
content: CLAUDE_MD_WORKFLOW_ENFORCEMENT,
source: 'GSD defaults',
hasFallback: false,
};
}
// ─── Commands ─────────────────────────────────────────────────────────────────
function cmdWriteProfile(cwd, options, raw) {
@@ -796,18 +815,20 @@ function cmdGenerateClaudeProfile(cwd, options, raw) {
}
function cmdGenerateClaudeMd(cwd, options, raw) {
const MANAGED_SECTIONS = ['project', 'stack', 'conventions', 'architecture'];
const MANAGED_SECTIONS = ['project', 'stack', 'conventions', 'architecture', 'workflow'];
const generators = {
project: generateProjectSection,
stack: generateStackSection,
conventions: generateConventionsSection,
architecture: generateArchitectureSection,
workflow: generateWorkflowSection,
};
const sectionHeadings = {
project: '## Project',
stack: '## Technology Stack',
conventions: '## Conventions',
architecture: '## Architecture',
workflow: '## GSD Workflow Enforcement',
};
const generated = {};