From bc1181f5545ae62436a924d73ad37e8ca7231c56 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Fri, 20 Mar 2026 10:52:07 -0400 Subject: [PATCH] enhancement(agents): add stub detection to verifier and executor (#1244) Enhanced gsd-verifier's anti-pattern detection to catch: - Hardcoded empty data props (={[]}, ={{}}, ={null}) - 'not available' and 'not yet implemented' placeholder text - Data stub classification guidance (only flag when value flows to rendering without a data-fetching path) Added stub tracking to gsd-executor's summary creation: - Before writing SUMMARY, scan files for stub patterns - Document stubs in a '## Known Stubs' section - Block plan completion if stubs prevent the plan's goal --- agents/gsd-executor.md | 7 +++++++ agents/gsd-verifier.md | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/agents/gsd-executor.md b/agents/gsd-executor.md index 9b818becd..3a9a41a17 100644 --- a/agents/gsd-executor.md +++ b/agents/gsd-executor.md @@ -384,6 +384,13 @@ After all tasks complete, create `{phase}-{plan}-SUMMARY.md` at `.planning/phase Or: "None - plan executed exactly as written." **Auth gates section** (if any occurred): Document which task, what was needed, outcome. + +**Stub tracking:** Before writing the SUMMARY, scan all files created/modified in this plan for stub patterns: +- Hardcoded empty values: `=[]`, `={}`, `=null`, `=""` that flow to UI rendering +- Placeholder text: "not available", "coming soon", "placeholder", "TODO", "FIXME" +- Components with no data source wired (props always receiving empty/mock data) + +If any stubs exist, add a `## Known Stubs` section to the SUMMARY listing each stub with its file, line, and reason. These are tracked for the verifier to catch. Do NOT mark a plan as complete if stubs exist that prevent the plan's goal from being achieved — either wire the data or document in the plan why the stub is intentional and which future plan will resolve it. diff --git a/agents/gsd-verifier.md b/agents/gsd-verifier.md index 8586213ff..63477f63e 100644 --- a/agents/gsd-verifier.md +++ b/agents/gsd-verifier.md @@ -306,13 +306,19 @@ Run anti-pattern detection on each file: ```bash # TODO/FIXME/placeholder comments grep -n -E "TODO|FIXME|XXX|HACK|PLACEHOLDER" "$file" 2>/dev/null -grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null +grep -n -E "placeholder|coming soon|will be here|not yet implemented|not available" "$file" -i 2>/dev/null # Empty implementations grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null +# Hardcoded empty data (common stub patterns) +grep -n -E "=\s*\[\]|=\s*\{\}|=\s*null|=\s*undefined" "$file" 2>/dev/null | grep -v -E "(test|spec|mock|fixture|\.test\.|\.spec\.)" 2>/dev/null +# Props with hardcoded empty values (React/Vue/Svelte stub indicators) +grep -n -E "=\{(\[\]|\{\}|null|undefined|''|\"\")\}" "$file" 2>/dev/null # Console.log only implementations grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)" ``` +**Stub classification:** A grep match is a STUB only when the value flows to rendering or user-visible output AND no other code path populates it with real data. A test helper, type default, or initial state that gets overwritten by a fetch/store is NOT a stub. Check for data-fetching (useEffect, fetch, query, useSWR, useQuery, subscribe) that writes to the same variable before flagging. + Categorize: 🛑 Blocker (prevents goal) | âš ī¸ Warning (incomplete) | â„šī¸ Info (notable) ## Step 8: Identify Human Verification Needs