feat: add /bug-analysis workflow with static and semantic analysis#226
Conversation
New devflow-bug-analysis plugin providing proactive bug finding before merge: - BugAnalyzer agent (Opus) with 5-step methodology: read diff, load plan context, focus-specific analysis, self-verify every finding, classify and report - Four focus areas: security (+ static findings integration), functional, integration (conditional), usability (conditional) - bug-analysis mode added to Synthesizer for cross-agent deduplication and confidence boosting - /bug-analysis command: incremental analysis, tiered static tools (semgrep -> snyk -> codeql), plan-based acceptance criteria coverage - /resolve extended to fall back to bug-analysis reports when no code review exists - Plugin registered in DEVFLOW_PLUGINS (21 plugins total) Co-Authored-By: Claude <noreply@anthropic.com>
- Add bug-analyzer.md to .gitignore (distributed agent copy should not be tracked) - Remove tracked distributed copy from git index - Update CLAUDE.md: shared agents count 14->15, plugin count 20->21 in project structure, add /bug-analysis to command roster, add bug-analysis directory to docs artifacts tree, add BugAnalyzer to persisting agents, add bug-analyzer to model strategy - Fix plugin.json version 1.0.0 -> 1.8.3 to match monorepo convention
…ch and review documentation for the /bug-analysis feature implementation on feat/bug-analysis branch.
🔴 CRITICAL SECURITY: Symlink attack vulnerability via predictable /tmp pathsFile: The CodeQL step uses hardcoded Fix: CODEQL_TMP=$(mktemp -d) && \
codeql database create "${CODEQL_TMP}/codeql-db" --language={detected-language} --source-root=. 2>/dev/null && \
codeql database analyze "${CODEQL_TMP}/codeql-db" --format=sarif-latest --output="${CODEQL_TMP}/codeql-results.sarif" 2>/dev/null
# Clean up after parsing: rm -rf "${CODEQL_TMP}"Review by Claude Code / devflow:security |
🔴 CRITICAL SECURITY: Shell injection via unquoted filename expansionFile: The CHANGED_FILES variable is built by space-joining filenames, then expanded unquoted into the semgrep command: CHANGED_FILES=$(git diff --name-only {DIFF_RANGE} | tr '\n' ' ')
semgrep scan --config auto --sarif --quiet {CHANGED_FILES} 2>/dev/nullIf a tracked file has shell metacharacters (spaces, semicolons, backticks, $()) in its name, the expansion could split incorrectly or execute injected commands. Fix: git diff --name-only {DIFF_RANGE} | xargs -d '\n' semgrep scan --config auto --sarif --quiet 2>/dev/nullReview by Claude Code / devflow:security |
🟠 SECURITY: Incomplete exclusion list in resolve fallbackFiles: When
Without these, Resolver agents will attempt to process synthesizer meta-commentary and raw static tool output as actionable issues. Fix: Update the exclusion list in both files: Review by Claude Code / devflow:security |
🔴 CRITICAL RELIABILITY: No execution timeout on static analysis toolsFile: The three static analysis invocations have no maximum execution time:
On large codebases, these tools can run for minutes to hours. A single Fix: Add explicit timeouts to each invocation: timeout 120 semgrep scan --config auto --sarif --quiet {CHANGED_FILES} 2>/dev/null
timeout 180 snyk code test --sarif . 2>/dev/null
timeout 300 codeql database create ... 2>/dev/null
timeout 300 codeql database analyze ... 2>/dev/nullDocument the timeout budget in the Edge Cases table. Review by Claude Code / devflow:reliability |
🟠 RELIABILITY: Unbounded character size for STATIC_FINDINGSFile: The STATIC_FINDINGS table is capped at 50 rows by severity, but each finding's Description column has no length limit. A noisy project could pass a very large table that consumes significant context in the BugAnalyzer agents. Fix: Add a token/character budget: Review by Claude Code / devflow:reliability |
🟡 RELIABILITY: Unbounded directory scan in resolve fallbackFile: The bug-analysis fallback lists all directories under Fix: Add a scan limit to Step 5b: Review by Claude Code / devflow:reliability |
🟠 ARCHITECTURE: Resolve fallback creates implicit couplingFiles: The resolve command now contains hardcoded knowledge of bug-analysis internals:
This creates tight coupling — if bug-analysis adds a new focus area, resolve must be updated in lockstep. File names are duplicated across three locations: bug-analysis command, resolve command, and resolve:orch skill. Fix: Replace hardcoded focus names with glob pattern detection: This matches the pattern already used for review directories. Review by Claude Code / devflow:architecture |
🟠 ARCHITECTURE: BugAnalyzer missing pattern skill declarationsFiles: The BugAnalyzer agent declares skills in frontmatter but the plugin.json manifest is incomplete: Agent frontmatter declares:
plugin.json skills array only has:
Missing from plugin.json:
Also note: The agent has 4 focus areas (security, functional, integration, usability) but only loads pattern skills for security/reliability. The functional, integration, and usability focuses lack specialized pattern skill support (vs. how Reviewer loads specific pattern skills per focus). Fix: Add missing declarations to plugin.json: "skills": [
"agent-teams",
"worktree-support",
"apply-feature-knowledge",
"apply-decisions",
"security",
"reliability"
]Review by Claude Code / devflow:architecture |
Code Review SummaryPR: #226 — Add /bug-analysis workflow with static and semantic analysis Findings Summary
🔴 Blocking Issues (≥80% confidence)Eight high-confidence blocking issues have been posted as detailed comments above:
🟡 Lower-Confidence Suggestions (60-79%)These findings were below the 80% threshold but are worth noting: Ambiguous/Deferred Issues
📋 Pre-existing IssuesOne pre-existing concern was flagged:
✅ Well-Executed AreasThe new plugin demonstrates strong architecture in several ways:
🎯 Recommended Next Steps
Review by Claude Code / devflow |
…ssues - sec-1: Replace hardcoded /tmp/codeql-db and /tmp/codeql-results.sarif with mktemp -d unique temp directory to prevent symlink attacks and concurrent process clobbering; add rm -rf cleanup in always-runs position - sec-2: Replace unquoted CHANGED_FILES expansion into semgrep with xargs -d newline to prevent shell injection from filenames with metacharacters - perf-1: Scope snyk code test to changed files via xargs instead of scanning entire project directory - rel-1: Wrap semgrep, snyk, and codeql with timeout command to prevent multi-hour hangs (300s fast tools, 600s CodeQL) - rel-2: Add 200-character truncation to Description column entries to bound serialized size of STATIC_FINDINGS passed to BugAnalyzer agents Co-Authored-By: Claude <noreply@anthropic.com>
…roduced when the /bug-analysis plugin was added: - Directory tree omitted resolution-summary.md from the bug-analysis path - Persisting agents line listed only the reviews-mode Resolver output path - Incremental Reviews paragraph made no mention of /bug-analysis and its analogous .last-analysis-head tracking mechanism
…solve:orch - Extend exclusion list in both resolve.md and resolve:orch/SKILL.md to exclude bug-analysis-summary.md and static-findings.md, preventing parse failures when /resolve targets a bug-analysis directory - Update Step 0b blocked error message to suggest /bug-analysis alongside /code-review - Add explicit 10-directory scan bound to bug-analysis fallback search in both files Co-Authored-By: Claude <noreply@anthropic.com>
…patibility - Change Bugs Found section (CRITICAL/HIGH/MEDIUM/LOW headers) to the 3-category structure (BLOCKING / Should Fix / Pre-existing) that resolve:orch and /resolve use when parsing per-focus .md reports. CRITICAL/HIGH map to Blocking, MEDIUM to Should Fix, LOW to Pre-existing. - Add devflow:regression, devflow:consistency, devflow:complexity skills to BugAnalyzer frontmatter so functional/integration/usability focuses have pattern skills (mirrors how Reviewer loads focus-specific skills). - Remove agent-teams from devflow-bug-analysis plugin.json skills array since no -teams.md command variant exists for V1. Co-Authored-By: Claude <noreply@anthropic.com>
…ve fallback - Add devflow-bug-analysis plugin registration test in tests/plugins.test.ts, covering agents (git, bug-analyzer, synthesizer), skills (agent-teams, worktree-support, apply-feature-knowledge), command, and non-optional flag - Create tests/bug-analysis/structural.test.ts (36 tests) covering all 7 phases with Produces/Requires annotations, incremental .last-analysis-head semantics, static tool safety patterns (xargs, mktemp, timeout bounds, 200-char truncation), BugAnalyzer parallel spawning, Synthesizer mode, and resolve compatibility - Add tests/resolve/bug-analysis-fallback.test.ts (13 tests) covering priority invariant (reviews before bug-analysis), Step 0c-5b fallback path, 10-directory scan limit, exclusion list (bug-analysis-summary.md, static-findings.md), and error message guidance for both /code-review and /bug-analysis - Fix plugin.json skills[] to include agent-teams, matching plugins.ts registry (resolves pre-existing skill-references.test.ts failure) Co-Authored-By: Claude <noreply@anthropic.com>
…solve:orch Align resolve.md documentation with resolve:orch skill Phase Protocol, correct FIXMEs, and consolidate documentation to the skill source. Update bug-analyzer agent output format and resolve:orch Phase completion to account for bug-analysis workflow mode. Co-Authored-By: Claude <noreply@anthropic.com>
…eview cycle Update decisions.md, pitfalls.md, and feature knowledge bases with learnings from the bug-analysis implementation review. Co-Authored-By: Claude <noreply@anthropic.com>
…Resolution summary documenting the fixes and improvements made to bug-analysis implementation during the 2026-05-23 review cycle. Co-Authored-By: Claude <noreply@anthropic.com>
|
PR Comment: bug-analysis.md line 99 xargs portability issue (reliability + security) The Impact: Static analysis silently never runs on macOS, undermining the hybrid static+semantic architecture. Fix: Use git diff --name-only {DIFF_RANGE} | tr '\n' '\0' | xargs -0 timeout 300 semgrep scan --config auto --sarif --quiet 2>/dev/nullAlso update line 98 comment to say 'NUL-delimited' to match the actual implementation. Confidence: 92% (reliability) + 82% (security: flag injection at line 106 uses same pattern). Flagged by: reliability, security, performance reviewers. |
|
PR Comment: bug-analysis.md line 106 Snyk per-file O(n) performance + flag injection vulnerability Two issues compound here:
Fix: Run Snyk Code once with project-level scan, then filter results to changed files: timeout 300 snyk code test --sarif 2>/dev/nullFilter SARIF output to only include findings in files from Confidence: 85% (performance, HIGH) + 82% (security, MEDIUM). Flagged by: performance, security, reliability, architecture reviewers. |
|
PR Comment: bug-analysis.md line 119 CodeQL SARIF ordering ambiguity (reliability) The bash code (lines 117-119) runs Fix: Restructure to make read-before-delete unambiguous: CODEQL_TMP=$(mktemp -d)
timeout 600 codeql database create "${CODEQL_TMP}/db" --language={detected-language} --source-root=. 2>/dev/null && \
timeout 600 codeql database analyze "${CODEQL_TMP}/db" --format=sarif-latest --output="${CODEQL_TMP}/results.sarif" 2>/dev/null
CODEQL_EXIT=$?
# Parse SARIF output HERE — before cleanupThen add cleanup block after parsing. Confidence: 88% (HIGH severity, reliability). Flagged by: reliability reviewer. |
|
PR Comment: bug-analysis.md line 152 Plan artifact scan limit inconsistency (reliability) Step 3 lists Fix: Add 10-directory scan bound to match the pattern: Confidence: 80% (MEDIUM severity, reliability). Flagged by: reliability reviewer. |
|
PR Comment: bug-analysis.md line 66 Redundant git diff invocations across phases (performance)
This also creates consistency risk: if working tree changes between invocations (e.g., parallel process commits), different phases could see different file lists. Fix: Compute once and reuse as variable: # Step 2b: compute once, reuse everywhere
CHANGED_FILES=$(git diff --name-only {DIFF_RANGE})
if [ -z "$CHANGED_FILES" ]; then echo "No changes to analyze."; exit 0; fiThen reference Confidence: 82% (MEDIUM severity, performance). Flagged by: performance reviewer. |
|
PR Comment: shared/agents/bug-analyzer.md line 113 BugAnalyzer severity-to-category mapping conflates code location with severity (architecture) The category mapping uses severity as a proxy for location:
But the Reviewer agent (established pattern) determines categories based on where the issue occurs (in your changes vs same function vs untouched code), not severity. A CRITICAL bug in untouched code should still be 'Pre-existing' per review methodology. While BugAnalyzer focuses on changed code (diff-first principle per line 124), the semantic mapping creates downstream parsing confusion — /resolve may misclassify findings as pre-existing and give lower priority. Fix: Document that all BugAnalyzer findings are in changed code by design, so severity-to-category mapping is reasonable for /resolve compatibility. Add clarifying comment: Confidence: 82% (MEDIUM severity, architectural). Flagged by: architecture, regression reviewers. |
|
PR Comment: shared/agents/bug-analyzer.md line 188 Bug-analyzer summary table format diverges from reviewer pattern (consistency) The output template uses flat /resolve pipeline and Synthesizer parse these reports programmatically — different table shape creates parsing inconsistency between review and bug-analysis reports. Fix: Replace with reviewer's matrix format: ## Summary
| Category | CRITICAL | HIGH | MEDIUM | LOW |
|----------|----------|------|--------|-----|
| Blocking | {n} | {n} | - | - |
| Should Fix | - | - | {n} | - |
| Pre-existing | - | - | - | {n} |
| Suggestions | {n} | - | - | - |
**{Focus} Risk**: {CRITICAL | HIGH | MEDIUM | LOW | CLEAN}Confidence: 85% (HIGH severity, consistency). Flagged by: consistency reviewer. |
|
PR Comment: shared/agents/bug-analyzer.md line 197 Bug-analyzer report omits Recommendation footer present in reviewer reports (consistency) Reviewer agent's template ends with both Bug-analyzer has Fix: Add recommendation line after Risk line: **{Focus} Risk**: {CRITICAL | HIGH | MEDIUM | LOW | CLEAN}
**Recommendation**: {BLOCK | CHANGES_REQUESTED | APPROVED_WITH_CONDITIONS | APPROVED}Confidence: 82% (HIGH severity, consistency). Flagged by: consistency reviewer. |
|
PR Comment: shared/skills/resolve:orch/SKILL.md line 29 + plugins/devflow-resolve/commands/resolve.md line 71 Inconsistent scan limit between resolve.md and resolve:orch for review directory discovery (regression) resolve:orch Phase 1 (line 29) now scans 'the 10 most recent' review directories, but resolve command's Step 0c (line 71) still uses 'select the latest' with no scan limit. Both correctly applied 10-directory limit for bug-analysis fallback, but only resolve:orch applied it to primary review directory scan. This behavioral divergence is a regression risk — two resolve paths should agree on directory scanning behavior. /resolve (command) scans all reviews, while /resolve in ambient mode (via resolve:orch) limits to 10. If user has >10 resolved review directories, 11th-most-recent unresolved review could be missed. Fix: Add 10-directory scan limit to resolve.md Step 0c to match resolve:orch: 3. **Otherwise:** sort directories by name descending (timestamps are naturally sortable), scan the 10 most recent directories only. Select the first that contains `review-summary.md` (complete review)Confidence: 85% (HIGH severity, regression). Flagged by: regression, consistency reviewers. |
|
PR Comment: plugins/devflow-bug-analysis/.claude-plugin/plugin.json line 25 Plugin.json missing skill declarations for agent dependencies (consistency) The While Universal Skill Installation ensures they are present at runtime regardless, manifest gap means plugin's declared dependencies are incomplete — a developer inspecting plugin.json would not see full dependency surface. The devflow-code-review plugin declares all its pattern skills, making bug-analysis plugin inconsistent with established convention. Fix: Add missing skills to "skills": [
"agent-teams",
"worktree-support",
"apply-feature-knowledge",
"apply-decisions",
"security",
"reliability",
"regression",
"consistency",
"complexity"
]Confidence: 85% (MEDIUM severity, consistency/architecture). Flagged by: consistency, architecture reviewers. |
PR Review Summary: /bug-analysis WorkflowOverall Assessment: CHANGES_REQUESTED (7 HIGH-confidence issues block merge; 3 MEDIUM should-fix; architectural design sound) High-Confidence Issues (≥80%, Block Merge)Reliability & Security (PRIMARY BLOCKERS)
Consistency (PARSER COMPATIBILITY) Architecture & Semantics Medium-Priority Issues (60-79% or SHOULD_FIX)
Architecture Notes✓ Design strengths: Parallel BugAnalyzer agents, incremental diffing, static + semantic hybrid, proper separation from Evaluator (applies ADR-004, ADR-006) ✓ Security: Strong injection prevention in PR_DESCRIPTION containment markers, timeouts on all static tools, mktemp for CodeQL isolation ⚠ Pre-existing pattern inconsistency: resolve:orch and resolve.md now diverge on scan limits — this PR surfaces that inconsistency Inline CommentsSee PR comments above for specific fixes and code examples for each issue. All HIGH-confidence findings have suggested remediation with confidence levels and reviewer attribution. Next Steps: Address HIGH-confidence issues (estimated 2-3 hours). Consider opening a separate PR for medium-priority issues (redundant git diff, plan scan bound) which are improvements rather than blockers. Claude Code | Devflow PR Review |
…ng, and redundant git diff Replace xargs -d which is GNU-only and broken on macOS BSD xargs with tr plus xargs -0 for portability. Replace per-file snyk invocations with a single project-level snyk code test scan followed by SARIF filtering. Compute CHANGED_FILES once in Step 2b and reference it throughout to eliminate 3 redundant git diff calls. Capture CODEQL_SARIF before rm -rf to fix the ordering bug that would delete results before parsing. Document Semgrep and Snyk parallelism. Co-Authored-By: Claude <noreply@anthropic.com>
…ummary table with reviewer format - Document severity→category mapping as approximation (all BugAnalyzer findings are in diff-changed code, so location-based categories don't apply literally; LOW is placed in Pre-existing for urgency signaling only) - Replace flat Severity|Count summary table with reviewer's matrix format (Category × CRITICAL/HIGH/MEDIUM/LOW) for downstream parser consistency - Add Recommendation footer line (BLOCK/CHANGES_REQUESTED/APPROVED_WITH_CONDITIONS/APPROVED) to match reviewer agent schema used by Synthesizer and /resolve Co-Authored-By: Claude <noreply@anthropic.com>
…gin manifest - resolve.md Step 0c: add '10 most recent directories only' scan bound to primary reviews path, matching the existing bug-analysis fallback (5b). Previously the reviews path had no limit; the fallback did — creating a behavioral divergence when more than 10 directories exist. - CLAUDE.md: correct misleading claim that both /code-review and /bug-analysis auto-discover worktrees. /bug-analysis is single-worktree only; /code-review does full multi-worktree discovery. - devflow-bug-analysis plugin.json: add the 6 skills that bug-analyzer.md declares in its frontmatter (security, reliability, regression, consistency, complexity, apply-decisions) so the manifest matches the code-review plugin pattern and is complete for discoverability. - resolve:orch SKILL.md: add parenthetical to Phase 5 reference so cross-references to resolve.md Phase 4 are unambiguous. - bug-analysis.md Plan Artifact: add '10 most recent' scan bound to the design listing step, matching the established pattern in resolve.md. Co-Authored-By: Claude <noreply@anthropic.com>
…rage
- Add resolve:orch describe block to bug-analysis-fallback.test.ts asserting
Phase 1 bug-analysis fallback, 10-directory scan limit, exclusion list
(bug-analysis-summary.md, static-findings.md), and error handling mentions
both /code-review and /bug-analysis (resolves resolve-orch:29)
- Add Groups 7-8 to structural.test.ts: output format section headers
(Issues in Your Changes/Code You Touched/Pre-existing), severity-to-category
mapping, summary matrix, Recommendation footer, and frontmatter skill
declarations (regression, consistency, complexity) (resolves bug-analyzer:111,
bug-analyzer:8)
- Replace fragile if/else conditional with unconditional extractSection assert
on ## Edge Cases section in resolve.md (resolves fallback-test:112)
- Remove redundant loadFile call on line 34; reuse existing content variable
(resolves fallback-test:34)
- Fix resolve:orch SKILL.md to use {worktree} placeholder in decisions-index.cjs
invocation (was "." — breaks worktree-aware resolution)
- Align devflow-bug-analysis entry in plugins.ts with plugin.json skills array
(was missing apply-decisions, complexity, consistency, regression, reliability,
security)
Co-Authored-By: Claude <noreply@anthropic.com>
|
tests/resolve/bug-analysis-fallback.test.ts:126 Unsafe |
|
tests/plugins.test.ts:251 Missing plugin skill assertions for newly added skills (85% confidence)\n\nThe test checks for |
|
plugins/devflow-bug-analysis/commands/bug-analysis.md:109 Snyk filtering boundary moved to LLM execution (82% confidence)\n\nThe comment states "filter findings to only those whose file path appears in |
|
plugins/devflow-bug-analysis/commands/bug-analysis.md:116-128 CodeQL cleanup not guaranteed on orchestrator-level interruption (82% confidence) The Fix: Add explicit trap to guarantee cleanup within the bash block: CODEQL_TMP=$(mktemp -d)
trap 'rm -rf "${CODEQL_TMP}"' EXIT
timeout 600 codeql database create "${CODEQL_TMP}/db" ...
# ... rest of blockNote: This approach handles cleanup within a single Bash invocation. Cross-invocation cleanup would require orchestrator support, which is beyond this PR's scope. — Claude Code |
|
shared/agents/bug-analyzer.md:113-118 Severity-to-category mapping conflates location-based and severity-based classification (82% confidence) The mapping (CRITICAL/HIGH → Blocking, MEDIUM → Should Fix, LOW → Pre-existing) uses severity, not location. A LOW-severity bug in newly-added code gets classified as "Pre-existing (Not Blocking)" despite the developer writing it. This breaks the location-based Iron Law: "If you didn't add it, you don't own it." Fix: Add a note clarifying the approximation in the agent documentation that all BugAnalyzer findings are developer-owned regardless of severity classification since they appear in changed code. Alternatively, document in resolve:orch that BugAnalyzer findings bypass location-based category semantics. — Claude Code |
|
plugins/devflow-bug-analysis/commands/bug-analysis.md (missing section) Missing Phase Completion Checklist (82% confidence) The Fix: Add a — Claude Code |
|
tests/bug-analysis/structural.test.ts:298-312 Frontmatter skill assertions incomplete (82% confidence) Group 8 tests 3 of 8 declared skills: Fix (option 1 — expand coverage): Add assertions for the missing 5 skills. Or (option 2 — rename to set accurate expectations): Change describe block title to "frontmatter declares batch-2 skill additions" to document that this group only covers the batch-2 additions. — Claude Code |
|
tests/resolve/bug-analysis-fallback.test.ts:114-148 Repeated extractSection calls (pattern regression) (80% confidence) Group 5 (resolve:orch tests) calls Fix: Hoist the repeated extractions to describe scope (matching the deduplication pattern in Groups 1-4) to reduce redundant parsing. — Claude Code |
Summary: Review FindingsBlocking Issues Fixed: 1 ✅ Inline Comments Posted (≥80% Confidence)
💡 Lower-Confidence Suggestions (60-79%)These are documented in the review reports but fall below the 80% threshold for blocking inline comments:
See review reports in — Claude Code |
…in Phase 2 Phase 2 decisions-index.cjs call used {worktree} as a literal placeholder with no substitution, causing decisions-index.cjs to fail on every resolve:orch invocation. resolve:orch explicitly excludes multi-worktree flow (line 11), so the correct argument is "." (cwd). Aligns with the adjacent feature-knowledge stale check on line 61 which already used ".". Co-Authored-By: Claude <noreply@anthropic.com>
The test at line 251 only asserted the original 3 skills; after batch-2 added apply-decisions, security, reliability, regression, consistency, and complexity to the plugin manifest, no test caught those additions. Add explicit assertions for all 6 so a future manifest change is caught immediately. Co-Authored-By: Claude <noreply@anthropic.com>
… 5 section extractions - Add explicit expect(idx).not.toBe(-1) guards before .slice() at lines 42 and 126 so that missing sub-anchors produce a clear assertion failure rather than silently operating on the last character of the parent string. - Hoist phase1 and phase3 extractSection calls to describe scope in Group 5 (resolve:orch SKILL.md), matching the deduplication pattern established in Groups 1-4 per commit eb12a02. Co-Authored-By: Claude <noreply@anthropic.com>
…phase checklist
- snyk-filtering-boundary: Add jq-based programmatic SARIF filter on Snyk output
to restrict findings to CHANGED_FILES before LLM processing. Implements defense-in-
depth per ADR-006 (hybrid static + LLM): filtering boundary is now programmatic
(data layer) + LLM (BugAnalyzer Step 4), not LLM alone. Falls back to raw SARIF
if jq is unavailable.
- codeql-cleanup-trap: Register `trap 'rm -rf "${CODEQL_TMP}"' EXIT INT TERM`
immediately after mktemp so orphaned temp directories cannot accumulate on
SIGTERM/SIGINT or session crash. Explicit rm -rf is retained as belt-and-suspenders;
trap is cleared afterward.
- missing-phase-checklist: Add ## Phase Completion Checklist section after Principles,
listing all 7 phases with verification criteria. Follows the resolve:orch pattern
(SKILL.md lines 161-174) so agents cannot silently skip phases.
Co-Authored-By: Claude <noreply@anthropic.com>
…nd fix adoption test
… Add devflow-bug-analysis (plus explore, research, release) to marketplace.json. Update plugin tables, command references, CLI docs, file-organization, release-process, and docs-framework skill to reflect the bug-analysis workflow. Bump shared skill count from 58 to 66.
Summary
devflow-bug-analysisplugin with a/bug-analysiscommand for proactive bug finding before merge/resolveto fall back to bug-analysis reports when no code review existsChanges
New files:
shared/agents/bug-analyzer.md— Opus-powered BugAnalyzer agent with 5-step methodology (read diff → load plan → focus-specific analysis → self-verify → classify). Iron Law: every finding verified against actual code before reportingplugins/devflow-bug-analysis/.claude-plugin/plugin.json— Plugin manifestplugins/devflow-bug-analysis/commands/bug-analysis.md— 7-phase orchestration command (pre-flight, static analysis, context loading, file analysis, parallel bug analysis, synthesis, finalize)Modified files:
shared/agents/synthesizer.md— Addedbug-analysismode: reads focus reports, cross-tracks confidence with static findings, deduplicates same file:line across analyzers, merges acceptance criteria coverageshared/skills/resolve:orch/SKILL.md— Phase 1 extended to fall back to.devflow/docs/bug-analysis/when no unresolved review foundplugins/devflow-resolve/commands/resolve.md— Step 0c extended with bug-analysis fallback (reviews take priority)src/cli/plugins.ts—devflow-bug-analysisregistered inDEVFLOW_PLUGINS(now 21 plugins)CLAUDE.md— Plugin table updated (21 plugins, row added for devflow-bug-analysis)Breaking Changes
None. All changes are additive.
/resolvebehavior is unchanged when a code review report exists.Reviewer Focus Areas
shared/agents/bug-analyzer.md): confidence scale matches reviewer.md pattern; plan-context modifier (+10% for acceptance rule citations, -15% ceiling without plan) is new — verify it is calibrated correctlybug-analysis.md): Step 2 sub-steps all have Produces/Requires annotations (required by ambient test); verify static tool invocations are correct CLI usage