diff --git a/gsd-core/workflows/onboard.md b/gsd-core/workflows/onboard.md index 7166317f5..5d6d83187 100644 --- a/gsd-core/workflows/onboard.md +++ b/gsd-core/workflows/onboard.md @@ -74,6 +74,21 @@ Then rerun /gsd:onboard from the same worktree root. Exit. If the user skips mapping: +- If `planning_exists && (!project_exists || !requirements_exists || !roadmap_exists || !state_exists)`, route the skip to the partial planning guard instead: + +```text +Skipping codebase mapping may give downstream steps weaker context, but project planning exists and is incomplete. + +PROJECT.md: {project_exists ? "present" : "missing"} +REQUIREMENTS.md: {requirements_exists ? "present" : "missing"} +ROADMAP.md: {roadmap_exists ? "present" : "missing"} +STATE.md: {state_exists ? "present" : "missing"} + +Run the appropriate lower-level command to fill the missing planning artifact(s), then rerun /gsd:onboard. +``` + +Exit. + - If `has_docs_candidates && !project_exists`, route the skip to docs ingest instead: ```text diff --git a/tests/onboard-command.test.cjs b/tests/onboard-command.test.cjs index 4904e18c2..b3ab7a64b 100644 --- a/tests/onboard-command.test.cjs +++ b/tests/onboard-command.test.cjs @@ -375,10 +375,22 @@ describe('/gsd:onboard command contract', () => { content.includes('Exit. If the user skips mapping:'), 'skip mapping must hand off explicitly instead of falling through to summary creation', ); + const partialPlanningSkipGuard = + 'If `planning_exists && (!project_exists || !requirements_exists || !roadmap_exists || !state_exists)`, route the skip to the partial planning guard instead:'; + const docsIngestSkipGuard = + 'If `has_docs_candidates && !project_exists`, route the skip to docs ingest instead:'; assert.ok( - content.includes('If `has_docs_candidates && !project_exists`, route the skip to docs ingest instead:'), + content.includes(partialPlanningSkipGuard), + 'skip mapping must preserve the partial-planning guard when incomplete planning artifacts are present', + ); + assert.ok( + content.includes(docsIngestSkipGuard), 'skip mapping must preserve the docs-ingest gate when planning docs are present', ); + assert.ok( + content.indexOf(partialPlanningSkipGuard) < content.indexOf(docsIngestSkipGuard), + 'skip mapping must check partial planning before docs ingest', + ); assert.ok( content.includes('/gsd:ingest-docs'), 'skip mapping docs-preserving handoff must name the docs ingest command',