feat(writing-plans): conditional Flow Diagrams slot in the plan header template - #2056
Open
bannergz wants to merge 1 commit into
Open
feat(writing-plans): conditional Flow Diagrams slot in the plan header template#2056bannergz wants to merge 1 commit into
bannergz wants to merge 1 commit into
Conversation
Plans spanning several services/async boundaries came out prose-only: in 3/3 baseline runs on a 4-component webhook+redirect spec, no diagram was produced. A structural slot in the header template (conditional on 3+ components or an async boundary) plus a 4th self-review check turned that into 3/3 runs producing a sequenceDiagram + flowchart whose arrow labels match the task interfaces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who is submitting this PR? (required)
What problem are you trying to solve?
Real session, 2026-07-30. I used
writing-plansto plan a feature spanning a Next.js dashboard, a FastAPI service, and a Rust webhook gateway — an onboarding flow where a signed webhook and a browser redirect race toward one idempotent completion. The plan came out structurally complete (header, file structure, per-task TDD steps, interfaces) but prose-only: the multi-actor flow lived in a 3-sentence Architecture paragraph. My human partner had to ask afterwards, explicitly, for a sequence diagram and a dataflow diagram — their words: it's "más entendible a nivel funcional para el developer" (easier to understand functionally for the developer reviewing/implementing the plan).Baseline eval reproduces the failure deterministically: 3/3 fresh single-shot runs (claude-sonnet-5, no tools, condensed skill excerpt as system context, same spec shape) produced zero diagrams — no Mermaid, no ASCII, nothing — despite the spec being an inherently multi-actor async flow.
What does this PR change?
Adds a conditional
## Flow Diagramsslot to the Plan Document Header template, and a 4th Self-Review check that ties diagram arrow labels to the endpoints/events/functions the tasks implement. 12 added lines, one file (skills/writing-plans/SKILL.md).Is this change appropriate for the core library?
Yes. It is domain-agnostic — any plan spanning 3+ components or an async boundary benefits, regardless of stack or project type. It adds no dependency: Mermaid fences render natively on GitHub and degrade to readable text elsewhere. Single-component plans are explicitly told to omit the section (conditional keyed on an observable predicate), so the slot does not bloat trivial plans.
The form follows the project's own doctrine (
writing-skills→ "Match the Form to the Failure"): the baseline failure is an omission of a required element, so the fix is a structural slot in the template the agent already fills in — not a prose reminder, not a prohibition.What alternatives did you consider?
writing-skills).Does this PR contain multiple unrelated changes?
No. One file, one concern: the Flow Diagrams slot and its matching self-review check (the check is the enforcement half of the same slot).
Existing PRs
diagram,mermaid,sequence,writing-plansacross open+closed). Same-shape precedents — template-slot additions to writing-plans: writing-plans: optional Invariants block for spec→test traceability #1831 (Invariants block), feat(writing-plans): add Evaluator section + self-review check #1627 (Evaluator section), feat(writing-plans): Global Constraints + per-task Interfaces as the two narrow exceptions to reference discipline (stacked on #1715) #1746 (Global Constraints + per-task Interfaces).Environment tested
Eval evidence (before/after)
Method per
writing-skillsmicro-testing: identical task + spec in both arms, condensed skill excerpt as the system context, one fresh single-shot subagent per rep, no tools, every output read manually. Spec: a 4-component merchant-onboarding flow (dashboard → API service → provider → webhook gateway) with a webhook/redirect completion race.sequenceDiagramand aflowchart; all three independently modeled the webhook/redirect race withpar/and; arrow labels matched task interfaces (finalize_connection(),POST /webhooks/kapso,verify_signature()); Self-Review check 4 was exercised and cited in all three outputsVariance note: the with-slot arm converged on the same shape across reps (sequence + flowchart pair, labels from task interfaces), which per
writing-skillsis the signal that the wording binds.🤖 Generated with Claude Code