feat(unic-spec-review): Figma + live sources via MCP, fail loud if absent#240
Conversation
…sent (#209) Wire the two non-Confluence input sources into /review-spec so the Spec-versus-Design and Spec-versus-Live dimensions compare against real material instead of inferring from the spec text alone. Changes: - Add figma-gatherer and live-gatherer pure helpers (+ node:test units) that shape Figma Dev Mode MCP and Playwright MCP output into agent context - /review-spec Step 1.5 classifies all pasted URLs; Step 1.6 fails loud with remediation when a required MCP is absent; Steps 3.5/3.6 gather Figma designs/annotations and live observations (read-only) - spec-versus-design-agent accepts optional figmaContext; spec-versus-live -agent accepts optional liveContext; both fall back when null - Drop deferred-slice language from AGENTS.md and CONTEXT.md status lines Fixes #209 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Promote [Unreleased] Figma + live-source bullets into the 0.1.8 section and sync the version into marketplace.json and package.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 Comprehensive PR ReviewPR: #240 — feat(unic-spec-review): Figma + live sources via MCP, fail loud if absent SummaryFinal S9 slice delivering Figma Dev Mode MCP and Playwright MCP gathering. Implementation is well-structured: zero external deps, pure-helper extraction, full injected-dep unit tests, cross-platform, all 9 CI matrix jobs green. The sole CLAUDE.md violation is three Verdict: ✅ APPROVE
(7 unique findings after deduplication across 5 agents) 🟡 Medium Issues
|
| Issue Title | Priority |
|---|---|
| "Add try-catch to gatherer CLI entries for parse/read errors" | P3 |
| "Update ADR README to reflect all ADRs implemented in S8+S9" | P3 |
Reviewed by Archon comprehensive-pr-review workflow · 5 agents · 2026-06-09
Full artifact: artifacts/runs/2115326f5f4944acce94f48608056e69/review/consolidated-review.md
- Replace 3x `/** @type {any} */` casts with `Record<string, unknown>` pattern in formatFigmaNodeSummary (MEDIUM, CLAUDE.md violation) - Wrap unguarded JSON.parse/readFileSync in try-catch with friendly stderr message in both figma-gatherer.mjs and live-gatherer.mjs CLI entries (LOW) - Add test for data.document name fallback in formatFigmaNodeSummary (LOW) - Add tests for empty-string title and content guards in formatLivePageSummary (LOW) - Add main() --comments dispatch integration test in atlassian-fetch.test.mjs (LOW) - Update formatFigmaNodeSummary JSDoc to document node/document fallback chain (LOW) - Fix stale ADR README status note (all ADRs implemented as of 0.1.8) (LOW) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
⚡ Self-Fix Report (Aggressive)Status: COMPLETE Fixes Applied (7 total)
View all fixes
Tests Added
Skipped (0)(none — all findings addressed) Suggested Follow-up Issues(none) Validation✅ Type check | ✅ Lint | ✅ Tests (349/349 passed, +4 new) Self-fix by Archon · aggressive mode · fixes pushed to |
…n atlassian-fetch Deduplicate the 14-line HTTP-status-classification + JSON-parse tail that was copy-pasted verbatim in both fetchJson and postJson. Extracted into a single parseJsonResponse(url, res) helper called by both. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…of coercing to empty A parseable-but-non-array MCP payload (e.g. an error object) was silently coerced to an empty result and exited 0, laundering an MCP error into "no data" and bypassing the orchestrator's non-zero-exit warning branch. Add pure asResultsArray/asObservationsArray validators that throw a descriptive TypeError, folded into each CLI entry's existing try/catch so malformed input now trips the loud failure path. Required by #209's never-silently-degrade invariant. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Independent review (post Archon self-fix)Re-reviewed PR #240 independently against issue #209's acceptance criteria and the locked ADRs (fail-loud MCP, read-only inputs, vendoring, no-em-dash). Verified Archon's 7 self-fixes actually landed in the source (not just self-reported), and ran two fresh scoped agents (correctness/style + silent-failure-hunter). Verdict: solid. No CRITICAL/HIGH. The fail-loud invariant is correctly enforced at the right layer (Step 1.6, pre-gather), the read-only invariant holds, and the One additional fix applied (
|
What
Wires the two non-Confluence input sources into
/review-spec(issue #209, epic #200), completing the Spec-versus-Design and Spec-versus-Live dimensions that previously ran in degraded text-only mode.spec-versus-design-agent.spec-versus-live-agent./spec-doctorcheck.Why
spec-versus-design-agentandspec-versus-live-agentalready existed (S4) but reasoned from spec text alone, with inline notes acknowledging no real Figma/live access. The classifier (S1) already identifiedfigma-page/figma-frame/livelink kinds, so pasted Figma/live URLs were recognised but silently ignored — a user could believe the design/live system was checked when it was not. This slice closes that gap with real MCP gathering and a loud failure when the MCP is missing.How
node:testunit tests (injected data, no live MCPs):figma-gatherer.mjs—extractAnnotations(defensive recursive annotation pull from anunknownFigma node tree),formatFigmaNodeSummary,buildFigmaContext.live-gatherer.mjs—formatLivePageSummary(content capped at 2000 chars),buildLiveContext.commands/review-spec.md: Step 1.5 classifies all pasted URLs; Step 1.6 fails loud on absent MCPs; Steps 3.5/3.6 gather via the discovered MCPs and format via the helpers; Step 5 injectsfigmaContext/liveContextinto the two agents.null.AGENTS.mdandCONTEXT.mdno longer list Figma/live-system as deferred.The MCP-driven gathering orchestration and agent prompts are deliberately not unit-tested (exercised via manual runs), per the issue's scope; only the pure shaping helpers are.
Validation
pnpm --filter unic-spec-review typecheck— ✅pnpm --filter unic-spec-review test— ✅ 345 pass, 0 fail (37 new)pnpm --filter unic-spec-review verify:changelog— ✅ → 0.1.8pnpm check— ✅ (2 pre-existing infos, none in new files)🤖 Generated with Claude Code