Skip to content

feat(dynamic)!: dynamic-build streamlining — delta reviews, honest findings/coverage, wave hardening, skill re-entrancy fixes#252

Merged
dean0x merged 16 commits into
mainfrom
feat/dynamic-build-streamlining
Jul 8, 2026
Merged

feat(dynamic)!: dynamic-build streamlining — delta reviews, honest findings/coverage, wave hardening, skill re-entrancy fixes#252
dean0x merged 16 commits into
mainfrom
feat/dynamic-build-streamlining

Conversation

@dean0x

@dean0x dean0x commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Six forensic defects in the dynamic-build engine were identified and fixed:

  • C1 (delta review): Cycles 2+ were re-reviewing unchanged code. Now track reviewBaseSha and scope to DELTA REVIEW: fix commits only on every cycle after the first.
  • C2 (reviewer result contract): No structured return requirement meant dead reviewers silently passed as clean. Now every reviewer must return reviewed: true + filesExamined + findings; a result missing reviewed: true is DEAD and retried once, then recorded as a coverageGaps entry (which blocks PASS).
  • C3 (findings disposition): The old synthesizer prompt dumped raw JSON.stringify(survivingFindings) with no grouping or cap. Replaced with a structured two-bucket "Findings disposition" section and a max 5 findings per batch batching rule.
  • C4 (FAIL-FIXED verdict): fix-and-continue paths previously had no distinct verdict. Introduced FAIL-FIXED so the run report is honest about which gates found issues that were fixed vs truly passed.
  • C5 (wave hardening): Added cascade-quarantine rule, never-kills-the-wave try/catch doctrine, vacuous-truth ALWAYS-ready rule, and Designer reader agent.
  • C6 (build doctrine): Added Cheapest-sufficient validation, One-build-gate-per-phase, NEVER-wrapped-in-sh-c, and bounded re-arm (≤2×) to coder.md and the engine.
  • C7 (--dry-run removal): Removed --dry-run from dynamic-build/plan/tickets/wave argument-hint and detect steps; retained in dynamic-profile (it controls profile generation, not dry runs).
  • C8 (run-unique scratch path): Old fixed /tmp/df-wf-check.js reused the same filename across runs, tripping write guards. Replaced with /tmp/df-wf-check-<name>-<epoch>.js — unique every run.
  • C9 (no unauthorized side-effects): Added explicit doctrine prohibiting sub-agents from creating GitHub issues/PRs or pushing to unauthorized branches.
  • C10 (skill re-entrancy): All 16 shared agents were invoking skills already listed in their frontmatter, causing guard-string returns ('already running'). Added the guard line to all 16 agents and removed the two preloaded skills from coder.md's domain-skill invocation list.

Breaking Changes

  • --dry-run removed from /dynamic-build, /dynamic-plan, /dynamic-tickets, /dynamic-wave (was non-functional per forensics — the flag was listed in argument-hint but no code path read it).
  • FAIL-FIXED verdict label: reviewers and downstream consumers that matched against "PASS" | "FAIL" must now handle the third value.
  • Reviewer result contract: reviewers spawned by dynamic-build must return { focus, reviewed: true, filesExamined, findings } — a result without reviewed: true is now treated as DEAD (was silently accepted before).

Test Plan

  • §12 (new): 8 toContain / not.toContain greps on compiled dynamic-build.md pinning C1–C9 exact prose.
  • §13 (new): --dry-run absence in 4 dynamic hosts, presence in dynamic-profile.md.
  • Structural invariant (new): for every shared/agents/*.md, zero Skill(skill="devflow:NAME") where NAME is in the agent's frontmatter skills — permanent regression guard for PF-002.
  • All 82 targeted tests green (npx vitest run tests/build-mds.test.ts tests/skill-references.test.ts tests/build.test.ts).
  • Full suite: 1901 tests, 62 files — all pass.

Out of Scope

Per user direction, the following are deliberately excluded from this PR:

  • Agent-count caps on fan-out
  • Gate-2 re-evaluation after fix loops
  • Re-verify panel
  • Parallel ticket scheduling
  • Cost projection / token-burn reporting

dean0x and others added 7 commits July 7, 2026 14:18
…run removal

Implements all 9 changes to the dynamic-build MDS command sources:

C1: Delta-scoped review cycles — cycle 1 = full branch diff; cycles 2+ = DELTA REVIEW
    of fix commits only (reviewBaseSha..HEAD). preFixSha recorded before fixes.

C2: Review-failure honesty — structured reviewer result contract (reviewed: true);
    dead reviewer → retry once → coverageGaps; staggered spawning in chunks of 5;
    early-exit only when allFindings.length === 0 && coverageGaps.length === 0;
    engine_output_schema gains reviewCoverage + extended escalation type enum.

C3: Batched fix Coders — same-file batches, max 5 findings per batch, independent
    batches in parallel; findings disposition two-bucket (FIXED / SURVIVING);
    fixedFindings[] added to schema; Synthesizer prompt uses "Findings disposition" heading.

C4: Gate-2 fix-and-continue — evalVerdict/testerVerdict set to "FAIL-FIXED" after fix,
    no re-evaluation by design; removes the doctrine-vs-cadence contradiction.

C5: Wave hardening — reader tier upgraded to agentType "Designer" (opus); vacuous-truth
    rule (ALWAYS ready); empty-ready-set guard re-asks once; cascade quarantine doctrine;
    per-ticket try/catch wave sketch in dynamic-build.mds ("never kills the wave").

C6: Build-cost doctrine — step 0 pre-load Monitor; exit-code honesty; bounded polling
    with re-arm; NEVER wrapped in sh -c/bash -c; Cheapest-sufficient validation;
    One build gate per phase.

C7: Remove --dry-run from dynamic-build/plan/tickets/wave (argument-hints + detect steps);
    retained in dynamic-profile; applies ADR-003 (leave-the-end-state).

C8: Run-unique node --check scratch path — /tmp/df-wf-check-<meta.name>-<epoch-seconds>.js
    instead of fixed /tmp/df-wf-check.js.

C9: Engine invariant 6 — No unauthorized GitHub side-effects.

All 29 build-mds tests pass. Simplifier/Scrutinizer exactly 2× each in compiled output.
C10: Add guard line to all 16 shared agents stating that frontmatter
skills are already active and the Skill tool must never be re-invoked
for them. Observed failure mode (PF-002): an agent that gets the
're-entrancy guard string' back treats it as a terminal instruction and
returns with 0 tool uses while the workflow reports success.

Substantive edits:
- reviewer.md: change Skill() invocation to Read file instruction
  (`~/.claude/skills/devflow:{FOCUS}/SKILL.md`); rephrase Apply
  Decisions from "Follow the skill" to "Apply the algorithm (already
  loaded)"; update focus-table header and frontmatter description.
- bug-analyzer.md: rephrase two preloaded-skill body references from
  "Follow the ... skill" to "Apply the ... algorithm (already loaded)".
- designer.md: update frontmatter description ("preloaded mode skills");
  rephrase boundary item to "Applying the preloaded mode skill".
- coder.md: remove devflow:boundary-validation and devflow:testing from
  domain Skill() invocation lists (both are frontmatter-preloaded);
  extend graceful-skip wording with "or returns 'already running'".

C6 mirror: update coder.md "Long-running commands" section to match
_engine.mds build_execution_doctrine() — adds step 0 (pre-load Monitor),
direct-invocation rule (NEVER wrap in sh -c/bash -c), exit-code honesty
note, bounded polling (ONE Monitor, re-arm ≤2×, then escalate), and
"one build gate per phase" doctrine.

code-review.mds: update Reviewer prompt to "Read the pattern skill file
~/.claude/skills/devflow:{focus}/SKILL.md — do not use the Skill tool".

Docs: add mutually-exclusive rule + guard-string failure signature to
skills-architecture.md; add anti-pattern #7 to agent-design.md.

Structural invariant verified: no agent Skill-invokes a frontmatter skill.
All tests pass: 27/27 skill-references + 29/29 build-mds.
…al guard

Regression tests pinning the Phase 1–2 prose changes:

build-mds.test.ts §12 — greps on compiled dynamic-build.md:
- C1: DELTA REVIEW + reviewBaseSha delta-scope tracking
- C2: reviewer result contract (reviewed: true, coverageGaps, chunk/stagger)
- C3: Findings disposition replaces old survivingFindings raw dump
- C4: FAIL-FIXED verdict label
- C5: wave hardening (ALWAYS ready, cascade, never kills the wave, Designer reader)
- C6: build doctrine (Cheapest-sufficient, One build gate per phase, NEVER wrapped, re-arm)
- C8: run-unique scratch path (/tmp/df-wf-check.js fixed name gone)
- C9: No unauthorized GitHub side-effects

build-mds.test.ts §13 — --dry-run removal (C7):
- dynamic-build/plan/tickets/wave must NOT contain --dry-run
- dynamic-profile still contains --dry-run (untouched per plan)

skill-references.test.ts:
- Structural invariant (PF-002 guard): for every shared/agents/*.md, no
  Skill(skill="devflow:NAME") where NAME is in the agent's own frontmatter
  skills — frontmatter skills are pre-activated, re-invocation is a bug
- Updated stale comment at Format 3 to reflect Phase 2 read-the-file design

Co-Authored-By: Claude <noreply@anthropic.com>
…ents

Remove `// C1:`–`// C4:` transition markers from dynamic-build.mds workflow
script — these encoded which forensic change added a line, not what the code
does. The descriptive text after the prefix is preserved and capitalised.
Matches the project principle "leave the end-state, not the transition."

Also remove "After Phase 2 redesign:" from the skill-references test comment
for the same reason, and correct "§10's beforeAll" to "Earlier describe blocks"
in build-mds.test.ts (§11 also compiles the file, making §10-only attribution
inaccurate).

Tests: 67 pass, 0 fail.
The fix phase overwrote survivingFindings each cycle
(survivingFindings = notAddressed), but the delta-review model only
re-reviews fix commits — an unaddressed finding from an earlier cycle
can never re-surface, so overwriting silently dropped it and let
overallVerdict falsely read PASS. Accumulate instead, matching the
doctrine definition 'survivingFindings = only findings NOT addressed'.
…ew base

_engine.mds review_loop(): add one sentence stating that when the
pre-fix SHA from a prior cycle is missing/unrecorded, the review scope
falls back to the wider full-branch base rather than a narrower delta.

dynamic-build.mds: harden reviewScope construction — guard !reviewBaseSha
so a falsy base never interpolates the string "null" into a delta prompt;
falls back to full-branch scope instead (matches the doctrine).
Comment thread commands/dynamic-build.mds Outdated
Comment thread tests/build-mds.test.ts
Comment thread tests/build-mds.test.ts
Comment thread tests/skill-references.test.ts Outdated
Comment thread commands/dynamic-build.mds
Comment thread shared/agents/reviewer.md Outdated
@dean0x

dean0x commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

Summary: PR #252 Code Review

Status: CHANGES_REQUESTED — 1 blocking issue, 4 should-fix items, several informational findings.


Inline Comments Summary

Posted 6 consolidated inline comments for high-confidence findings (≥80%):

  1. C3 fix-batching concurrency hazard (BLOCKING, 4 reviewers at 80-88%) → commands/dynamic-build.mds:318
  2. Test C8 absence-only (MEDIUM, 88%) → tests/build-mds.test.ts:663
  3. §12/§13 build ordering dependency (MEDIUM, 85-90%) → tests/build-mds.test.ts:614
  4. PF-002 structural guard scope (MEDIUM, 82%) → tests/skill-references.test.ts:1017
  5. WAVE skeleton missing MAX_ROUNDS (MEDIUM, 80%) → commands/dynamic-build.mds:446
  6. Skill-loading divergence (MEDIUM, 80%) → shared/agents/reviewer.md:67

Should-Fix Items (60-79% confidence)

Fix-batch failure detection reads .failed field never returned (Architecture 75%)

  • Location: commands/dynamic-build.mds:333
  • Problem: Disposition is decided by if (fixResults[batchIdx]?.failed), but the fix-Coder is never asked to return a failed field. The Coder's documented output is a markdown status report, not JSON.
  • Impact: A Coder returning a failure-report (not null) has .failed === undefined → counted as FIXED, findings silently dropped. Soft-failures leak through.
  • Fix: Add an explicit return contract to the fix-Coder prompt matching the reviewer pattern: Return: {"failed": <boolean>, "commitShas": [...], "unfixed": [...]}. Then key disposition off explicit fields.

Delta-review silently re-inflates on unpinned Git-agent SHA (Performance 74%)

  • Location: commands/dynamic-build.mds:213, 227-229, 296-297, 327
  • Problem: preFixSha = preFixAgent?.sha || reviewBaseSha — the Git agent's return shape is not pinned (unlike the reviewer prompt's explicit {"focus":..., "reviewed": true, ...} contract).
  • Impact: If the Git agent returns a differently-named field or prose, preFixSha falls back to reviewBaseSha, and cycle 2+ re-reviews the full branch, negating the C1 delta optimization.
  • Fix: Pin the Git agent's return contract: Return exactly {"sha": "<40-hex>"} and validate the format before accepting; only then fall back to widen.

Reviewer roster hardcoded to 8 focuses — doctrine says use budget-scaled sizing (Performance 80%)

  • Location: commands/dynamic-build.mds:220
  • Problem: The roster is a fixed 8-element array; the doctrine (_engine.mds) says budget global should govern roster size, never hardcode.
  • Impact: From a performance standpoint this is positive (hard-caps fan-out), but it contradicts the stated doctrine. Consistency issue only; no cost regression.
  • Fix: Either make roster size budget-governed, or update the doctrine to acknowledge the hardcoded size as intentional.

Review-loop closure does ~8 things in ~140 lines (Complexity 80% MEDIUM)

  • Location: commands/dynamic-build.mds:208-350
  • Problem: The single phase closure bundles: delta-scope ternary, chunked reviewer spawn, dead-reviewer retry, adversarial panel, survival filter, preFixSha capture, file-group batching, and disposition tracking. Cyclomatic complexity >10; nesting reaches 4.
  • Impact: Borderline for "explain in 5 minutes"; each added mechanism makes the next reader's job harder. Much of the length is prompt strings (lower cognitive load per line), but the control flow is dense.
  • Fix: Extract named helpers: buildReviewScope(), spawnReviewersChunked(), retryDeadReviewers(), batchByFile(), splitFixedVsSurviving(). Even pulling the survival predicate into a survives() function would restore readability.

Build-execution doctrine duplicated across _engine.mds and coder.md (Complexity 78%)

  • Location: commands/_partials/_engine.mds:139-176, shared/agents/coder.md:94-109
  • Problem: The fine-grained procedural details (Pre-load Monitor, sh -c ban, exit-code honesty, bounded polling ≤3, heartbeat interval) must stay byte-for-byte compatible in spirit between two files. Only one copy was edited when policies change.
  • Impact: Future tweaks (e.g., re-arm cap, heartbeat interval) silently diverge if only one copy is updated.
  • Fix: Promote the long-running-command procedure to a shared skill that both reference, OR add a sync-pointer at the top of the coder.md section.

Informational / Pre-Existing Issues

Untrusted GitHub issue bodies flow into Designer reader (Security MEDIUM, Pre-existing)

  • Location: commands/_partials/_wave.mds:8-9, downstream at commands/dynamic-build.mds:452-455
  • Background: Not introduced by this PR — the issue-body ingestion existed before. Already counter-mitigated by the reinforced "NEVER merge to main/master" invariant.
  • Suggested follow-up: Reuse the existing <...> containment-marker pattern (used by reviewer.md / coder.md) to wrap untrusted issue bodies in a separate hardening PR.

/tmp scratch file predictability (Security 65%, optional dev-machine hardening)

  • Suggested follow-up: Use mktemp or write under a per-run mkdir -m700 directory. Current form (/tmp/df-wf-check-<name>-<epoch>.js) is run-unique (improving over the prior fixed name) and parse-only (no execution), so the risk is low.

Reviewer.md hardcoded to user-scope skill path (Regression MEDIUM, Intentional trade-off)

  • Location: shared/agents/reviewer.md:67 uses ~/.claude/skills/devflow:{FOCUS}/SKILL.md
  • Background: Project/local-scope installs have .claude/skills/ instead of ~/.claude/skills/, so the hardcoded path won't resolve for non-default scopes.
  • Impact: Graceful degradation (reviewer falls back to general principles). Conscious trade-off against PF-002. User-scope is the default install.
  • Suggested note in PR body: "Project-scope installs get reduced reviewer depth due to hardcoded user-scope skill path."

Prose pins ≠ behavior tests (Testing LOW, informational)

  • Location: tests/build-mds.test.ts §12 pins C1-C9 exact literal strings
  • Background: Correct mechanism for LLM-instruction files (runtime behavior can't be unit-tested). Honest limitation: a pin verifies presence, not correctness of the logic it describes.
  • Note: The C3 batching bugs reviewers found demonstrate exactly this — the literal presence of "max 5 findings per batch" is pinned, but the embedded loop logic containing the off-by-one is untested.
  • Follow-up: Where doctrine embeds genuinely executable logic with correctness risk (C3 batching), consider whether that logic belongs in a testable helper rather than inside prose only.

Verified Sound (No Action)

These were deep-checked and hold up:

  • Delta-review scoping model (C1) — coherent. Cycle N+1 reviews cycle N's fixes. Widen-fallback never narrows.
  • Gate cadence — Gate 1 exactly twice/ticket, Gate 2 once. FAIL-FIXED change removed the old "→ re-evaluate" loop (tightens rather than loosens).
  • survivingFindings accumulate — architecturally sound. Concat (not overwrite) prevents silent drops.
  • C10 re-entrancy guard — sound; no capability lost. Blocked skills are preloaded. Avoids PF-002.
  • FAIL-FIXED threading — clean. Does NOT feed overallVerdict or wave merge gate (fix-and-continue design).
  • C7 --dry-run removal — clean end-state. Removed from build/plan/tickets/wave, retained only in profile (legitimate separate feature). Applies ADR-003.
  • Wave hardening (C5) — try/catch, quarantine, vacuous-truth, Designer reader form coherent failure-isolation model.
  • C9 "NEVER unauthorized side-effects" doctrine — present, unambiguous, reinforced by agent-level hard-list in coder.md.
  • C8 run-unique scratch path — improves over prior fixed name; parse-only so execution risk is nil.
  • Breaking changes--dry-run removal, FAIL-FIXED verdict, reviewed: true contract — all complete, residue-free, consistently propagated.
  • PF-002 structural guard — catches real re-entrance (tested via mutation; one violation detected). Scope gap noted (see inline comment).
  • Cross-cutting shared agents — changes consistent across dynamic-build, code-review, and other pipelines.
  • All 67 pinned tests pass — doctrine pins verified against compiled artifact; 18/18 assertions match reality.

Scores by Reviewer

Reviewer Category Score Recommendation
Architecture Blocking: 1 HIGH; Should-fix: 1 MEDIUM 7/10 CHANGES_REQUESTED
Complexity Blocking: 1 HIGH; Should-fix: 2 MEDIUM 6/10 CHANGES_REQUESTED
Performance Blocking: 2 HIGH; Should-fix: 2 MEDIUM 7/10 CHANGES_REQUESTED
Testing Blocking: 0; Should-fix: 3 MEDIUM 7/10 APPROVED_WITH_CONDITIONS
Reliability Blocking: 0; Should-fix: 1 MEDIUM 8.5/10 APPROVED_WITH_CONDITIONS
TypeScript Blocking: 0; Should-fix: 1 MEDIUM 8/10 APPROVED_WITH_CONDITIONS
Consistency Blocking: 0; Should-fix: 1 MEDIUM 8/10 APPROVED_WITH_CONDITIONS
Documentation Blocking: 1 HIGH; Should-fix: 0 7/10 CHANGES_REQUESTED
Regression Blocking: 0; Should-fix: 0 9/10 APPROVED
Security Blocking: 0; Should-fix: 0 9/10 APPROVED

Recommendation: CHANGES_REQUESTED

Before Merge:

  1. BLOCKING (HIGH): Fix C3 fix-batching concurrency hazard

    • Chunk within file groups; run same-file batches sequentially; only different-file batches in parallel
    • Update _engine.mds:120 doctrine to match
    • Update .devflow/features/dynamic-workflow-engine/KNOWLEDGE.md:106 which repeats the over-claim
    • Post-fix, the C3 batching block becomes one of the PR's genuine cost wins (verified by performance reviewer once fixed)
  2. BLOCKING (HIGH): Fix C3 batching prose at 3 locations (lines 299, 318, _engine.mds:120)

    • Either correct the prose to describe what the code actually does, OR make the code honor the doctrine
  3. SHOULD-FIX (6 items): The 6 inline-commented medium-confidence findings (C8 test, §12/§13 build ordering, PF-002 guard scope, WAVE skeleton, skill-loading divergence, fix-batch failure detection, delta-review contract, review-loop complexity, build-doctrine duplication, hardcoded roster)

    • None are merge-blockers on their own, but all strengthen the PR's guarantees
  4. INFORMATIONAL: Note in PR body that project-scope devflow installs get reduced reviewer depth (hardcoded user-scope path in reviewer.md:67)


Strengths

The C10 re-entrancy guard, wave hardening, FAIL-FIXED verdict, and the overall streamlining design are well-reasoned and thoroughly verified. The test suite (67/67 pass) is solid. The breaking changes (--dry-run removal, reviewed: true contract, FAIL-FIXED enum) are complete and residue-free. Once the C3 concurrency issue is fixed, this PR delivers genuine cost reduction (delta-review, dead-reviewer gating, findings disposition batching) without regression.


Posted by: Claude Code Review Agent (devflow:git)
Timestamp: 2026-07-07_1400 UTC
Review Date: 2026-07-07_1622 UTC
PR URL: #252

dean0x and others added 4 commits July 7, 2026 20:14
…den wave skeleton

F1: Rewrite fix-batching to strictly group one file per set of sub-batches,
    chunked at MAX_BATCH=5 within that file. Sub-batches for the SAME file
    run sequentially (never two Coders editing the same file concurrently);
    sub-batches for DISTINCT files run in parallel(). Findings with no file
    field each get a singleton group. Adds 'file' field to reviewer result
    contract and engine_output_schema survivingFindings/fixedFindings.
    Deletes the false "(same-file batches already grouped)" comment.
    Updates _engine.mds:review_loop doctrine and KNOWLEDGE.md:106 to match.

F2: Fix disposition check from '!result?.failed' (field Coder never returns)
    to 'result?.status === "fixed"'. Pin the fix-Coder return contract to
    {"status":"fixed"|"blocked","commitShas":[...],"unresolved":[...]} so
    soft-failure can never be counted as FIXED and silently drop findings.

F3: Pin Git agent return to 'Return exactly: {"sha":"<40-hex>"}' and add a
    40-hex regex validation before accepting preFixSha; fall back to the
    wider prior base on invalid shape, never narrow the review window.
    Soften _engine.mds:85 from "full-branch base" to "wider prior base"
    (the un-advanced scope from the previous cycle — more accurate).

F4: Assign MAX_ROUNDS = Math.max(10, remainingTickets.length * 2 + 5) in
    the wave skeleton (was referenced but never assigned — ReferenceError
    on first run). Inline the empty-ready-set re-ask guard: re-ask once
    with vacuous-truth rule on an empty ready set, break on second empty
    read (deadlock). Tolerate both engineResult.verdict and .overallVerdict
    in the merge gate check (SINGLE skeleton exposes overallVerdict).

F7: Wrap ticket data flowing into the wave Designer reader prompt inside
    <untrusted-issue-body> containment markers with a one-line data-only
    note. Add matching instruction to _wave.mds Step 1 documenting when
    and how to apply the markers for issue bodies.

applies ADR-005 applies ADR-003 avoids PF-002

Co-Authored-By: Claude <noreply@anthropic.com>
…onsistency + install-scope safety

PR #252 changed reviewer.md from Skill(skill="devflow:{FOCUS}") to Read
~/.claude/skills/devflow:{FOCUS}/SKILL.md. This was an over-correction:
{FOCUS} resolves to runtime-selected non-frontmatter skills (security,
architecture, etc.), which are PF-002-safe for Skill-tool invocation.
The Read-by-path approach also hardcodes ~/.claude which breaks
project/local-scope installs where skills live elsewhere.

Reverts the four focus-skill-loading lines to use the Skill tool — matching
coder.md and researcher.md which kept Skill() for their runtime-selected
domain skills. The PF-002 re-entrancy guard line (C10) is preserved intact.

avoids PF-002 (Skill tool on {FOCUS} is safe — {FOCUS} is never a
frontmatter skill)
applies ADR-003 (clean end-state: no contradictory "do NOT use the Skill
tool" instruction alongside the restored Skill() call)

Structural guard: npx vitest run tests/skill-references.test.ts — 28/28 pass
…den PF-002 guard to plugin agents

F6a: add positive presence guards to C8 test — toContain('df-wf-check-') and
toContain('run-unique scratch file') — so the test fails on deletion or rename
of the scratch-path mechanism, not just on reintroduction of the old fixed name.

F6b: give §12 (doctrine C1–C9) and §13 (--dry-run removal) their own beforeAll
that spawns build-mds.ts, mirroring §10/§11. Eliminates intra-file ordering
dependency: isolated/filtered vitest runs now self-build instead of ENOENT.

F6c: extend the PF-002 structural re-entrancy guard from shared/agents/*.md to
also cover tracked plugin agents (git ls-files 'plugins/*/agents/*.md'). Catches
re-entrant Skill() reintroductions in plugins/devflow-plan/agents/designer.md
which is hand-maintained and was modified in lockstep with shared/agents/designer.md
by this PR. Avoids PF-002.
Remove unnecessary `rawSha` intermediate variable (used once, immediately
after assignment) and the redundant `typeof rawSha === "string"` guard
(the 40-hex regex already rejects non-strings via ToString coercion).
Behavior is identical — invalid shapes still fall back to reviewBaseSha.
Comment thread commands/code-review.mds Outdated
```
Agent(subagent_type="Reviewer", run_in_background=false):
"Review focusing on {focus}. Load the pattern skill for your focus from the Focus Areas table.
"Review focusing on {focus}. Read the pattern skill file ~/.claude/skills/devflow:{focus}/SKILL.md — do not use the Skill tool.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we not instructing to load using the skill tool? why read... we need to use the skill tool. all over to be honest.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — fixed in 6991302, and this thread is the right place for the full context. The Read was a workaround for PF-002, a real observed failure: an agent that both preloads a skill via frontmatter skills: and invokes it via the Skill tool gets the re-entrancy guard string (devflow:X already running), treats it as a terminal instruction, and silently returns zero work while the workflow counts it as success. The earlier fix kept the preloads and prose-banned re-invocation — hence all the 'already active / do not re-invoke' notes, and this one spot that swapped the Skill call for a file Read.

6991302 resolves PF-002 the other way, structurally: no agent declares skills: frontmatter anymore; the Skill tool is the single loading mechanism, invoked at runtime at the point of need. Nothing is preloaded, so the guard can never fire, and every prohibition note is gone. This prompt now instructs Skill(skill="devflow:{focus}"), and the ~/.claude/skills/... availability Read-probe above it is deleted (skills install universally, and the hardcoded path broke project-scope installs). The PF-002 structural guard in tests/skill-references.test.ts now also fails CI if any agent reintroduces a skills: frontmatter block.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: 6991302 over-interpreted these comments as a mandate to drop frontmatter skills: entirely — it has been reverted in ad9f38b. Frontmatter preloading stays. Re-opening these threads; the actual fix (removing the prohibition-note noise, not the mechanism) will follow after discussion.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 80c68b0 — the reviewer prompt now instructs Skill(skill="devflow:{focus}"), matching reviewer.md, and the ~/.claude/skills Read-probe availability check is removed (skills install universally; that path also assumed user-scope installs). Frontmatter preloading is unchanged; the agent-note cleanup landed separately in 1506669.

Comment thread plugins/devflow-plan/agents/designer.md Outdated

**Handle autonomously:**
- Loading assigned skill file
- Applying the preloaded mode skill (do NOT re-invoke via Skill tool)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this do not re-invoke? what if preload fails?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly the right question — under preload-plus-prohibition there was no answer to 'what if preload fails'. Fixed in 6991302: nothing is preloaded; the Designer explicitly loads its mode skill via the Skill tool (devflow:gap-analysis or devflow:design-review per MODE). A failed load is now a visible failed tool call in the transcript instead of a silent gap.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1506669 — the parenthetical is deleted; the bullet now just reads 'Applying the preloaded mode skill'. On 'what if preload fails': frontmatter skills are injected by the Claude Code runtime at agent spawn; if one isn't installed the runtime skips it and the agent runs without that content — nothing hangs. And invoking a skill that isn't loaded simply loads it; the re-entrancy guard string only appears when it already is active. So no prohibition or fallback prose is needed in either direction.

Comment thread shared/agents/bug-analyzer.md Outdated

You are a proactive bug finding agent. Your focus area is specified in the prompt. You hunt for real bugs — not style issues — using a 5-step methodology that combines static analysis findings with semantic code understanding.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again.. why do we need this note?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/bug-analyzer.md Outdated
- **STATIC_FINDINGS** (optional): Pre-computed static analysis output (Semgrep/Snyk/CodeQL results). Only provided to security analyzer. `(none)` for other focus types.
- **DECISIONS_CONTEXT** (optional): Compact index of active ADR/PF entries. `(none)` when absent. Use `devflow:apply-decisions` to Read full bodies on demand.
- **FEATURE_KNOWLEDGE** (optional): Pre-computed feature area context. Follow `devflow:apply-feature-knowledge`.
- **FEATURE_KNOWLEDGE** (optional): Pre-computed feature area context. Apply the `devflow:apply-feature-knowledge` algorithm (already loaded).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again... how do we know its already loaded, what if it isn't why are these notes "already loaded" needed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6991302 — the '(already loaded)' assumption is gone. The instruction is now load-then-apply: invoke Skill(skill="devflow:apply-decisions") (or apply-feature-knowledge) and apply its algorithm. Nothing is assumed to be pre-active.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1506669 — the '(already loaded)' asides are deleted; the sentences now just say to apply the algorithm. The skills are injected at spawn via frontmatter; if one were ever missing, a Skill call would simply load it, so the aside carried no information.

Comment thread shared/agents/bug-analyzer.md Outdated
## Apply Decisions

Follow the `devflow:apply-decisions` skill to scan the `DECISIONS_CONTEXT` index, Read full ADR/PF bodies on demand, and cite `applies ADR-NNN` / `avoids PF-NNN` inline in findings. Skip when `DECISIONS_CONTEXT` is `(none)`.
Apply the `devflow:apply-decisions` algorithm (already loaded) — scan the `DECISIONS_CONTEXT` index, Read full ADR/PF bodies on demand, and cite `applies ADR-NNN` / `avoids PF-NNN` inline in findings. Skip when `DECISIONS_CONTEXT` is `(none)`.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6991302 — the '(already loaded)' assumption is gone. The instruction is now load-then-apply: invoke Skill(skill="devflow:apply-decisions") (or apply-feature-knowledge) and apply its algorithm. Nothing is assumed to be pre-active.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1506669 — '(already loaded)' aside deleted.

Comment thread shared/agents/coder.md Outdated

You are an autonomous implementation specialist working on a feature branch. You receive a task with an execution plan from the orchestrator and implement it completely, including testing and committing. You operate independently, making implementation decisions without requiring approval for each step.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we add these type of instructions all over...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/coder.md Outdated

2. **Load domain skills**: Before any analysis, invoke the Skill tool for each domain skill matching DOMAIN hint. If a Skill invocation fails, skip that skill and continue — domain skills are optional enhancements, not required for task completion.
- `backend` (TypeScript): `Skill(skill="devflow:typescript")`, `Skill(skill="devflow:boundary-validation")`
2. **Load domain skills**: Before any analysis, invoke the Skill tool for each domain skill matching DOMAIN hint. If a Skill invocation fails or returns 'already running', skip that skill and continue — domain skills are optional enhancements, not required for task completion.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who said domain skills are optional enhancement? why do we need to give this way out. we can't just say nothing, to either direction. just instruct the model to load whats relevant to the task..

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302 — no more 'optional enhancements' escape hatch and no more fail-and-skip clause. Step 2 is now a plain directive: load the skills matching the language and stack of the code being touched, with the available inventory listed as guidance.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 80c68b0 — the 'optional enhancements / skip and continue' hedge is gone. Step 2 is now a plain directive: load the domain skills matching the language and stack of the code being touched.

Comment thread shared/agents/coder.md Outdated
- `backend` (Rust): `Skill(skill="devflow:rust")`
- `frontend`: `Skill(skill="devflow:react")`, `Skill(skill="devflow:typescript")`, `Skill(skill="devflow:accessibility")`, `Skill(skill="devflow:ui-design")`
- `tests`: `Skill(skill="devflow:testing")`, `Skill(skill="devflow:typescript")`
- `tests`: `Skill(skill="devflow:typescript")`

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what? why for tests we load devflow typescript?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gone in 6991302 — the rigid DOMAIN→skill mapping table (including the nonsensical tests→typescript row) is removed. The instruction is now to match skills to the language/stack of the code actually being touched.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 80c68b0 — the tests→typescript mapping row is gone.

Comment thread shared/agents/designer.md Outdated

**Handle autonomously:**
- Loading assigned skill file
- Applying the preloaded mode skill (do NOT re-invoke via Skill tool)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1506669 — '(do NOT re-invoke via Skill tool)' deleted from the Boundaries bullet in both designer copies. Frontmatter preloading unchanged.

Comment thread shared/agents/dream.md Outdated
validates, or applies anything on your behalf. The only executables you call are the three
ledger ops below.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. Dream's case was the degenerate one: its only frontmatter skill (apply-decisions) was never used by its body — it curates the ledger directly — so the entry was deleted outright. No note, no load instruction needed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/evaluator.md Outdated

You are an alignment validation specialist. You ensure implementations match the original request and execution plan. You catch missed requirements, scope creep, and intent drift. You report misalignments with structured details for the Coder agent to fix - you never fix code yourself.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/git.md Outdated

You are a Git/GitHub operations specialist. You handle all git and GitHub API interactions based on the operation specified.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/knowledge.md Outdated

# Knowledge Agent

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. This agent's restricted tools: list didn't even include the Skill tool — the preload was the only mechanism, which is exactly the fragility you flagged. Skill is now in its tools list, skills: frontmatter is gone, and it loads what it needs explicitly at runtime.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/researcher.md Outdated

You are a multi-type research agent. You receive a research type, dynamically load the domain-specific research skill, execute the research methodology from that skill, and produce structured findings.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/resolver.md Outdated

You are an issue resolution specialist. You validate review issues and implement fixes with risk-proportional care. You fix everything that can be fixed safely. Tech debt is the absolute last resort — only for issues requiring complete architectural redesign.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/reviewer.md Outdated

You are a universal code review agent. Your focus area is specified in the prompt. You dynamically load the pattern skill for your focus area, then apply the 6-step review process from `devflow:review-methodology`.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/reviewer.md Outdated
## Apply Decisions

Follow the `devflow:apply-decisions` skill to scan the `DECISIONS_CONTEXT` index, Read full ADR/PF bodies on demand, and cite `applies ADR-NNN` / `avoids PF-NNN` inline in findings. Skip when `DECISIONS_CONTEXT` is empty or `(none)`.
Apply the `devflow:apply-decisions` algorithm (already loaded) — scan the `DECISIONS_CONTEXT` index, Read full ADR/PF bodies on demand, and cite `applies ADR-NNN` / `avoids PF-NNN` inline in findings. Skip when `DECISIONS_CONTEXT` is empty or `(none)`.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1506669 — '(already loaded)' aside deleted.

Comment thread shared/agents/scrutinizer.md Outdated

You are a meticulous self-review specialist. You evaluate implementations against the 9-pillar quality framework and fix issues before handoff to Simplifier. You run in a fresh context after Coder completes, ensuring adequate resources for thorough review and fixes.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/simplifier.md Outdated

You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result of your years as an expert software engineer.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/skimmer.md Outdated

You are a codebase orientation specialist. You use `npx rskim` exclusively for code exploration — never Grep, Glob, or manual file searches. Your output gives implementation agents a clear map of relevant files, functions, and integration points.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. This agent's restricted tools: list didn't even include the Skill tool — the preload was the only mechanism, which is exactly the fragility you flagged. Skill is now in its tools list, skills: frontmatter is gone, and it loads what it needs explicitly at runtime.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/synthesizer.md Outdated

You are a synthesis specialist. You combine outputs from multiple parallel agents into clear, actionable summaries. You operate in six modes: exploration, planning, review, bug-analysis, design, and research.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/tester.md Outdated

You are a scenario-based QA specialist. You design and execute acceptance tests that verify implementation behavior from the user's perspective. You test what was asked for, not implementation details. You report results with evidence — you never fix code yourself.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. This agent's restricted tools: list didn't even include the Skill tool — the preload was the only mechanism, which is exactly the fragility you flagged. Skill is now in its tools list, skills: frontmatter is gone, and it loads what it needs explicitly at runtime.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread shared/agents/validator.md Outdated

You are a validation specialist that runs build and test commands to verify code correctness. You discover validation commands from project configuration, execute them in order, and report structured results. You never fix issues - you only report them for other agents to fix.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

Comment thread plugins/devflow-plan/agents/designer.md Outdated
You are a design analysis specialist. You detect gaps and anti-patterns in design documents, specifications, and implementation plans before implementation begins. Your mode and focus determine which skill you load and which analysis you perform.
You are a design analysis specialist. You detect gaps and anti-patterns in design documents, specifications, and implementation plans before implementation begins. Your mode and focus determine which preloaded skill applies and which analysis you perform.

The skills listed in your frontmatter are already active — never invoke the Skill tool for any of them; if a Skill call returns a guard string like 'already running', ignore it and proceed with your work.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.... why is this important...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 6991302. These notes were the mitigation for PF-002 (preloaded skill + Skill-tool invocation → re-entrancy guard string → silent zero-work bail). That's now resolved structurally instead: skills: frontmatter is gone from every agent and all skill loading is explicit runtime Skill-tool invocation, so the guard can never fire. Full context on the commands/code-review.mds thread.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted in 1506669. The note was belt-and-braces over PF-002, which is already handled structurally: no agent body instructs invoking a frontmatter-preloaded skill, and a structural test fails CI if that combination is reintroduced. Frontmatter skills: preloading is unchanged.

dean0x added 4 commits July 7, 2026 23:39
…ads, Skill tool everywhere

Resolve PF-002 structurally instead of by prohibition prose. Agents no
longer declare skills: frontmatter; every skill is loaded at runtime via
the Skill tool at the point of need. With nothing preloaded, the skill
re-entrancy guard can never fire.

- shared/agents (16) + plugins/devflow-plan/agents/designer.md: remove
  skills: frontmatter and the "already active — never invoke the Skill
  tool" notes; add per-agent Skill-tool load instructions with
  when-conditions; fix "(already loaded)" asides to load-then-apply
- coder.md: drop the "optional enhancements" hedge and the DOMAIN
  mapping table (incl. tests->typescript); plain directive to load the
  skills matching the language/stack of the code being touched
- designer.md (both copies): mode skill loaded via Skill tool per MODE;
  scrub all "preloaded" language
- knowledge/skimmer/tester: add Skill to restricted tools lists
- code-review.mds: reviewer prompt loads pattern skill via Skill tool;
  remove the skill-availability Read-probe (skills install universally);
  worktree-support pointer -> Skill tool (also resolve.mds)
- tests: PF-002 guard now also forbids any skills: frontmatter in
  agents; command files pinned to zero skill install-path references
- docs: CLAUDE.md, agent-design, skills-architecture, and
  dynamic-workflow-engine KNOWLEDGE.md updated to the invoke-only rule

Addresses PR #252 skill-loading review threads.
…er preloads, Skill tool everywhere"

This reverts commit 6991302.
- code-review.mds reviewer prompt: load pattern skill via
  Skill(skill="devflow:{focus}") instead of Read-by-install-path,
  matching reviewer.md (24e26a3)
- code-review.mds: remove the skill-availability Read-probe — skills
  install universally, and the ~/.claude path assumed user-scope;
  conditional reviewers spawn from the file-type table alone
- coder.md step 2: plain directive to load domain skills matching the
  language/stack of the code being touched (drops the "optional
  enhancements, skip and continue" hedge); remove the tests→typescript
  mapping row

Addresses PR #252 threads on code-review.mds:200, coder.md:63, coder.md:70.
Remove the identical "already active — never invoke the Skill tool"
note from all 17 agent files, plus the "(already loaded)" asides
(bug-analyzer, reviewer) and designer's "(do NOT re-invoke via Skill
tool)" parenthetical. Frontmatter skills: preloading is unchanged.

PF-002 protection is structural and sufficient without the prose: no
agent body instructs invoking a frontmatter-preloaded skill, and the
skill-references structural test fails CI if that combination is ever
reintroduced.

Addresses the remaining PR #252 skill-note review threads.
Comment thread commands/_partials/_wave.mds Outdated

This is LLM judgment — the agent reads like a person would, not a graph algorithm.

**Rationale for Designer tier:** a haiku-tier reader once quarantined 10 independent tickets as "blocked" because nothing had merged yet. Dependency reasoning requires the judgment of a senior reviewer, not a fast-read pass.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a weird comment, why not just instruct to use opus because dependency reasoning requires the high level judgment - why do we need this weird haiku example...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 834fea5 — the line now just states the rule: 'use opus — dependency reasoning requires high-level judgment, not a fast-read pass.' Anecdote gone.

Comment thread shared/agents/coder.md
- `backend` (Python): `Skill(skill="devflow:python")`
- `backend` (Rust): `Skill(skill="devflow:rust")`
- `frontend`: `Skill(skill="devflow:react")`, `Skill(skill="devflow:typescript")`, `Skill(skill="devflow:accessibility")`, `Skill(skill="devflow:ui-design")`
- `tests`: `Skill(skill="devflow:testing")`, `Skill(skill="devflow:typescript")`

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the tests removed? the testing skill should stay..

  • tests: Skill(skill="devflow:testing")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The testing skill was never removed — devflow:testing is in coder's frontmatter skills: and is preloaded on every run (the Coder writes tests in every task, so it's always in context). What 80c68b0 removed was the tests→typescript row. Re-adding the row as Skill(skill="devflow:testing") would invoke an already-preloaded skill — the PF-002 re-entrancy combination the structural test blocks. Per discussion: leaving it as is; step 2's directive already covers loading the language skill of the code under test.

@dean0x dean0x merged commit dfb0e34 into main Jul 8, 2026
2 checks passed
@dean0x dean0x deleted the feat/dynamic-build-streamlining branch July 8, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant