Skip to content

Commit 6c51012

Browse files
feat: add PRD file existence check to create_documentation workflow step
1 parent 72a9284 commit 6c51012

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/handlers.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,16 @@ async function handleCreateDocumentation(args, workflowState) {
355355
return textResponse("⚠️ Please ensure tests are passing first! Run 'run_tests' with passed=true.");
356356
}
357357

358+
// Check if PRD exists in docs folder
359+
const prdPath = path.join(__dirname, "..", "docs", "product", "PRD.md");
360+
const prdExists = existsSync(prdPath);
361+
362+
if (!prdExists) {
363+
return textResponse(
364+
`⚠️ PRD file not found!\n\nExpected location: docs/product/PRD.md\n\nPlease create or update the PRD before marking documentation as complete.`
365+
);
366+
}
367+
358368
workflowState.state.documentationCreated = true;
359369
workflowState.state.documentationType = args.documentationType;
360370
workflowState.state.documentationSummary = args.summary;
@@ -368,7 +378,7 @@ async function handleCreateDocumentation(args, workflowState) {
368378
await workflowState.save();
369379

370380
return textResponse(
371-
`✅ Documentation created/updated!\n\nType: ${args.documentationType}\nSummary: ${args.summary}\n\n🎉 You're ready to verify your work!\n\nNext Steps:\n1. ✓ Fix/implement feature\n2. ✓ Create tests\n3. ✓ Run tests (GREEN!)\n4. ✓ Create/update documentation\n5. ⏳ Run 'check_ready_to_commit' to verify\n6. ⏳ Run 'commit_and_push'\n7. ⏳ Run 'perform_release'\n8. ⏳ Mark as complete with 'complete_task'`
381+
`✅ Documentation created/updated!\n\nType: ${args.documentationType}\nSummary: ${args.summary}\n✅ PRD verified: docs/product/PRD.md exists\n\n🎉 You're ready to verify your work!\n\nNext Steps:\n1. ✓ Fix/implement feature\n2. ✓ Create tests\n3. ✓ Run tests (GREEN!)\n4. ✓ Create/update documentation\n5. ⏳ Run 'check_ready_to_commit' to verify\n6. ⏳ Run 'commit_and_push'\n7. ⏳ Run 'perform_release'\n8. ⏳ Mark as complete with 'complete_task'`
372382
);
373383
}
374384

0 commit comments

Comments
 (0)