<!-- soleur-cloud-mode:start -->
Cloud Mode (Devin): before pipeline work run bash "${CLAUDE_PLUGIN_ROOT}/scripts/cloud-detect.sh". If CLAUDE_PLUGIN_ROOT is unset (cloud exec shells do not export it), resolve the root by IDENTITY, never by script basename: for d in "$HOME/.local/share/devin/cli/plugins/cache" and /opt/.devin/plugins, skip unless [ -d "$d" ], then MANIFEST="$(find "$d" -path '*/.claude-plugin/plugin.json' -exec grep -l '"name"[[:space:]]*:[[:space:]]*"soleur"' {} + 2>/dev/null | head -1)", ROOT="${MANIFEST%/.claude-plugin/plugin.json}" — one resolution, two consumers: $ROOT/scripts/cloud-detect.sh and $ROOT/scripts/precommit-guard.sh. (Shape check, not authentication: a planted {"name":"soleur"} dir passes — ADR-179 A11.) local or not-local:no-devin-env proceeds normally; any other not-local:<reason> applies <plugin-root>/devin/INSTRUCTIONS.md §Cloud Mode: emit the --banner, fan out sequentially with Reviewed-Coverage: sequential-fallback disclosure (never claim an independent review ran), message_user ack before any secrets read or production mutation, and run precommit-guard.sh before any git commit — hooks do not fire in cloud.
<!-- soleur-cloud-mode:end -->
<!-- grok-harness-invoke:start -->
Grok Build (plugins/soleur/lib/harness.ts invokeSkill()): Read this SKILL.md in this process and run it to completion. A one-segment soleur:<name> in this document names a SKILL — on Grok Build, Read plugins/soleur/skills/<name>/SKILL.md in this process; it is not a nested tool_use. A multi-segment id such as soleur:<domain>:<name> names an AGENT: spawn it, never Read it, and on Grok Build spawn_subagent takes the id with its colons replaced by hyphens (agentIdToGrokSubagentType). Claude Code: Skill tool for a skill (soleur:<name>), Task tool with subagent_type for an agent. Forbidden is executing a subset, not the Read.
<!-- grok-harness-invoke:end -->
<!-- plan-anti-bypass-protocol:start -->
Anti-bypass protocol (load-bearing — especially Grok Build)
You are the planning orchestrator. Whether entered from soleur:brainstorm, soleur:one-shot Step 1, or direct soleur:plan:
- FORBIDDEN: Implementing product code (Write/Edit/Shell) before the plan artifact and tasks are written.
- FORBIDDEN: Ending after saving
plans/+tasks.mdwithout invokingsoleur:work— the plan is a checkpoint, not a deliverable. - REQUIRED (Grok Build): Invoke
soleur:work <plan-path>(orsoleur:deepen-planwhen the plan requests it) via slash command — never substitute ad-hoc implementation. - Harness adapter:
plugins/soleur/lib/harness.ts— Grok usessoleur:work,soleur:deepen-plan; Claude uses Skill tool.
See plugins/soleur/lib/workflow-fidelity.ts (HANDOFF_SKILLS, mandatorySuccessors('plan')).
<!-- plan-anti-bypass-protocol:end -->
<!-- operator-typed-render:start -->
Any message this skill PRINTS that tells the operator to run a skill or command renders at emit time. The doc names it canonically (soleur:<name>, ADR-226); before printing, render it as the active harness's operator-typed form per formatSkillInvocation (plugins/soleur/lib/harness.ts), which owns the per-harness slash and sigil forms — the operator types that string into a fresh session where no routing contract is in context, so a bare canonical name is model-discretion there rather than a dispatch. This covers abort messages, AskUserQuestion prompts and options, Display/echo lines and resume prompts alike; an agent-read instruction stays canonical.
<!-- operator-typed-render:end -->
Create a plan for a new feature or bug fix
Introduction
Note: The current year is 2026. Use this when dating plans and searching for recent documentation.
Transform feature descriptions, bug reports, or improvement ideas into well-structured markdown files issues that follow project conventions and best practices. This command provides flexible detail levels to match your needs.
Feature Description
<feature_description> #$ARGUMENTS </feature_description>
If the feature description above is empty, ask the user: "What would you like to plan? Please describe the feature, bug fix, or improvement you have in mind."
Do not proceed until you have a clear feature description from the user.
0. Load Knowledge Base Context (if exists)
Load project conventions:
# Load project conventions
if [[ -f "CLAUDE.md" ]]; then
cat CLAUDE.md
fi
Branch safety check (defense-in-depth): Run git branch --show-current. If the result is main or master, abort immediately with: "Error: plan cannot run on main/master. Checkout a feature branch first." This check fires in all modes as defense-in-depth alongside PreToolUse hooks -- it fires even if hooks are unavailable (e.g., in CI).
If knowledge-base/ exists:
- Read
CLAUDE.mdif it exists - apply project conventions during planning - If
# Project Constitutionheading is NOT already in context, readknowledge-base/project/constitution.md- use principles to guide planning decisions. Skip if already loaded (e.g., from a precedingsoleur:brainstorm). - Detect feature from current branch (
feat-<name>pattern)
Spec-kit intake, before step 4. If the branch spec.md is absent and the argument is an existing specs/<prefix>-<short-name>/ directory, Read ${CLAUDE_PLUGIN_ROOT}/skills/plan/references/spec-kit-intake.md and follow it. If that spec file exists, including zero bytes, do not run the script and do not replace it.
- Read
knowledge-base/project/specs/feat-<name>/spec.mdif it exists - use as planning input - Announce: "Loaded constitution and spec for
feat-<name>"
Vocabulary. Before committing a word that names a concept, check it against knowledge-base/project/glossary.md and use the sense its pointer settles; if the word is materially ambiguous and has no entry, hedge in the artifact and name the ambiguity. The instruction is stated once in glossary-format.md §The consumer pointer and is not restated here.
If knowledge-base/ does NOT exist:
- Continue with standard planning flow
0.5. Idea Refinement
Check for brainstorm output first:
Before asking questions, look for recent brainstorm documents in knowledge-base/project/brainstorms/ that match this feature:
ls -la knowledge-base/project/brainstorms/*.md 2>/dev/null | head -10
Relevance criteria: A brainstorm is relevant if:
- The topic (from filename or YAML frontmatter) semantically matches the feature description
- Created within the last 14 days
- If multiple candidates match, use the most recent one
If a relevant brainstorm exists:
- Read the brainstorm document
- Announce: "Found brainstorm from [date]: [topic]. Using as context for planning."
- Extract key decisions, chosen approach, and open questions
- Skip the idea refinement questions below - the brainstorm already answered WHAT to build
- Proceed to Phase 1 -- all sub-phases still apply (1, 1.5, 1.5b, 1.6). Having a brainstorm skips idea refinement only, not community discovery or research.
If multiple brainstorms could match:
Use AskUserQuestion tool to ask which brainstorm to use, or whether to proceed without one.
If no brainstorm found (or not relevant), run idea refinement:
Refine the idea through collaborative dialogue using the AskUserQuestion tool:
- Ask questions one at a time to understand the idea fully
- Prefer multiple choice questions when natural options exist
- Focus on understanding: purpose, constraints and success criteria
- Directional ambiguity gate: If the task involves merging, moving, or restructuring (A into B vs B into A), explicitly confirm the direction with the user before proceeding -- even in pipeline mode. Code evidence can be wrong (see learning: 2026-03-17-planning-direction-confirmation-required)
- Continue until the idea is clear OR user says "proceed"
Gather signals for research decision. During refinement, note:
- User's familiarity: Do they know the codebase patterns? Are they pointing to examples?
- User's intent: Speed vs thoroughness? Exploration vs execution?
- Topic risk: Security, payments, external APIs warrant more caution
- Uncertainty level: Is the approach clear or open-ended?
Skip option: If the feature description is already detailed, offer:
"Your description is clear. Should I proceed with research, or would you like to refine it further?"
0.6. Pre-Research Premise Validation (Always)
Run BEFORE spawning any research (Phase 1) — a plan atop a stale premise wastes the fan-out. brainstorm Phase 1.1 does this when a brainstorm precedes plan, but plan is frequently entered directly (including the one-shot → plan path that skips brainstorm), so the cheap probe must live here. This is distinct from Phase 1.7 reconciliation (spec claims AFTER research returns) — it fires before research is dispatched.
This also covers your own capability claims — not just cited references. Before asserting that a repo tool/skill/script "only does X" or "can't do Y", grep/read it or ask (hr-verify-repo-capability-claim-before-assert).
For every issue, blocker, dependency, or prior-art artifact the feature description cites by reference, verify it still holds:
- Cited GitHub issues / PRs (
#N,Closes #N, "blocked by #N", "follow-up to #N"): rungh issue view <N> --json state,title,closedByPullRequestsReferencesandgh pr view <N> --json state,mergedwhere applicable. If a blocker is alreadyclosed/merged, or the issue this plan targets is already closed by a merged PR, the premise is stale — surface via AskUserQuestion ("Issue #N appears already resolved by PR #M. Re-scope, or close as done?") rather than planning against it. - Cited file/symbol/migration paths (a function, route, component, or migration the plan assumes exists): confirm with
git show origin/main:<path>orgit grep -n "<symbol>" origin/main. If the artifact is absent onorigin/main, the premise ("fix the bug in X") may really be "X was never built" — flag it; the plan's shape changes from fix to build. - "UI exists but is broken" claims: distinguish broken from never-built — confirm the route/component exists (
git grep) before planning a fix; a silently-absent feature needs a build plan, not a patch. - Proposed mechanism vs. the ADR corpus (the feature names HOW to do it — a frontmatter flip, a new table, a polling cron, a config tier): grep
knowledge-base/engineering/architecture/decisions/for the mechanism's keywords (not the cited issue number — issues don't know what an ADR decided) and read any hit's## Decision+## Alternatives Considered. A mechanism sitting in an ADR's rejected-alternatives table is not an unconsidered idea — it is an explicitly-rejected one; re-scope to "did the ADR leave a gap this still addresses?" rather than planning the rejected approach. Corollary: when the feature pins an absolute value (a fixed model/tier/limit), check its interaction with the most capable end of the range, not just the cheap end (an absoluteopusreviewer pin is a downgrade on a Fable session). Why: #5087 — the issue's frontmatter-tiering approach matched the exact alternative ADR-053 rejected the day before (#5096); caught only at deepen-plan, three phases deep. Seeknowledge-base/project/learnings/2026-06-11-brainstorm-grep-adr-corpus-for-proposed-mechanism-not-just-issue-refs.md.
- The set that must do Y is whoever the Y-enforcing mechanism reaches — grep its call sites, not a nearby inventory; a shape rule over that set is a claim about every member — read each member's prescribed strings before writing it; and before designing a side channel out of a spawned CLI, run it once with
--output-format jsonand read the result event. Why: #8076 — the brainstorm's population (TASK_INVENTORY, five) was the heartbeat's liveness subset; the filing population was the nineresolveOutputAwareOkcallers (the first missed cron fired two days after merge); a[Scheduled]-prefixed title rule would have broken campaign-calendar's[Content] Overdue:filings; a hook-written deny log plus nine caller edits dissolved oncepermission_denials[]was probed. Seeknowledge-base/project/learnings/2026-09-11-a-filer-with-no-honest-exit-takes-the-free-one-at-any-price.md.
- Collision pre-check: run
bash "${CLAUDE_PLUGIN_ROOT}/scripts/collision-precheck.sh" <N>for each cited issue — open PRs naming it (gh pr list --state open --search "<N>" -L 100) plus foreignproc.sh list_runsrows; report every hit before work starts (#10333).
Emit a one-paragraph Premise Validation note (what was checked, what held, what was stale) into the research-insights scratch so Phase 1.7 and the plan's "Research Reconciliation" section can carry it forward. If nothing is cited, state "no external premises to validate" and proceed.
0.6b. Mechanism Minimality Gate (Always)
Runs after premise validation and before the Phase 1 fan-out, for the same reason Phase 0.7 sits there: a mechanism must be cut before anything expensive researches it. Premise validation (0.6) asks whether the plan's cited facts still hold; this asks whether the plan's proposed machinery is needed at all.
1. Restate the ask as discrete properties — the Property List. An issue routinely proposes a mechanism rather than a property — #7418 asked for an HTML-comment in-progress marker, while the properties underneath were "research survives a stall" and "a consumer can distinguish a half-written plan from a finished one". Write each property as one sentence naming an observable outcome. This restatement is what makes step 2 possible at all: two mechanisms cannot be compared until it is clear what they are both for.
2. For every mechanism the FEATURE DESCRIPTION or issue proposes, name (a) the property it buys, and (b) whether a mechanism already on origin/main buys that property. Scope this to the mechanisms named in the ask — the plan file does not exist yet and ## Files to Edit is not written until Step 2, so do not guess at mechanisms the plan has not proposed (the discipline Phase 1.7.5 states for its own file list). Answer (b) by grepping, per hr-verify-repo-capability-claim-before-assert. A repo mechanism that already covers a property is the cheapest possible implementation of it. Grep the AUTHORITY, and say which file you grepped: a negative result against a consumer is indistinguishable from a real gap but carries the authority of a command with an exit code. If the ask itself asserts "the repo does not have X" — briefs written by the session that lived an incident routinely do — that assertion is a claim to verify here, not a premise to build on.
3. Cut before researching. Any mechanism that buys no property in the list, or buys one an existing mechanism already covers, is removed here — not researched, not designed, not reviewed. Record each cut in one line (mechanism → property → what already covers it) as the Cut List. Emit both lists into the research-insights scratch, exactly as Phase 0.6 emits its Premise Validation note; Phase 1.7 persists them into ## Research Insights, which is where plan-review reads them. A mechanism the ask did not name but the plan later invents is caught by Step 2's re-read of this list, not here.
Why: #7418 / ADR-176 — the plan never compared its new mechanism against the one already in the codebase; a twelve-agent review then found twelve blocking defects behind a 285/285 green suite, and nine of them dissolved with the machinery when the redesign landed. See knowledge-base/project/learnings/2026-08-10-i-fixed-the-guard-twice-and-my-test-could-not-see-either-fix.md.
0.6c. Value-Proposition Measurement (Conditional)
Fires when a plan's justification is a cost or performance saving ("saves an expensive fan-out", "avoids re-running X", "cuts N minutes"). Quantify the saving at plan time and name the command that produced the number — the same shape as Phase 1.8's budget check, which records a measured baseline rather than an asserted one.
Measure the thing actually claimed: if the case is "protects an expensive block", identify which block is expensive before designing the protection. If the saving cannot be measured at plan time, say so explicitly and record what would measure it — an unquantified saving is a hypothesis, and it must not be the sole justification for a mechanism that survives 0.6b.
Why: #7418 / ADR-176 — the plan's stated case was "save an expensive research fan-out", and which fan-out was expensive went unmeasured until review, where soleur:engineering:review:performance-oracle established that the checkpoint boundaries subdivide neither expensive block: all five agents under plugins/soleur/agents/engineering/research/ are pinned cheap (grep -l '^model: haiku' plugins/soleur/agents/engineering/research/*.md returns 5), while the un-pinned eleven-agent Phase 2.5 domain fan-out — the real cost — was unprotected either way. The answer was one grep of agent frontmatter, three phases earlier.
0.7. Skeleton Checkpoint (Always)
Phase 1 dispatches the research fan-out — the most expensive stretch of this skill. Write the plan
file before it runs, then persist each phase's findings as they land, so a stall costs one phase
instead of the whole run (#7418, ADR-176).
Everything this phase needs is already in hand: Phase 0.6 ran gh issue view <N> --json state,title
for every cited issue, so the title — and therefore the slug — is free at this point.
1. Resolve the destination from the repo root, not the ambient CWD.
PLANS_DIR="$(git rev-parse --show-toplevel)/knowledge-base/project/plans"
BR=$(git branch --show-current)
A CWD-relative path can land the skeleton in the bare repo root, where the next sync clobbers it
(2026-05-15-one-shot-plan-subagent-cwd-divergence.md). Use $PLANS_DIR everywhere below —
including the selector — not a relative path.
2. Convert title to filename: add today's UTC date prefix, strip the prefix colon, kebab-case,
add a -plan suffix.
- Example:
feat: Add User Authentication→2026-01-21-feat-add-user-authentication-plan.md - Keep it descriptive (3-5 words after the prefix) so plans are findable by context.
- Freeform arm: Phase 0.6 only fires when refs are cited, so an invocation with no
#Nhas no
issue title. Derive the slug from the feature description instead.
- This is the only filename-derivation site in this skill. Step 2 refines the frontmatter
title:; it does not re-derive the path. A git mv is reserved for a genuinely misleading slug,
at finalization only.
3. Select this branch's plan, if one already exists. Match on the frontmatter branch: key —
a run that begins at 23:5x UTC and resumes after midnight derives a different filename at step 2,
so a fresh derivation would write a second file beside its own work.
# Frontmatter-bounded per candidate. A plan that DOCUMENTS this mechanism carries `branch:` in its
# body, so a whole-file `grep -l "^branch: …"` selects on documentation — the #4724 class in the
# sibling key. Bound the read to the leading `---` block, and tolerate a quoted value.
PLAN=""
for f in "$PLANS_DIR"/*.md; do # non-recursive: plans/archive/ excluded
[[ -e "$f" ]] || continue # no-match glob leaves the literal pattern
[[ "$(head -n 1 "$f")" == "---" ]] || continue # no leading frontmatter -> not a plan
v=$(awk 'NR==1{next} /^---[[:space:]]*$/{exit}
/^branch:/{ sub(/^branch:[[:space:]]*/,""); gsub(/^"|"$/,""); print; exit }' "$f")
[[ "$v" == "$BR" ]] || continue
PLAN="$f" # tiebreak: highest date prefix, then newest
done # mtime — the glob is already sorted by name
Duplicate branch: values exist on main, so the loop must keep scanning and apply the tiebreak
rather than stopping at the first hit.
4. Branch on what the selected file contains. ## Acceptance Criteria is the completion
predicate: it is the one heading present in all three detail-level templates, and it lands last,
after every expensive phase. The skeleton writes ## Overview and nothing else, so a stub can never
carry it. (## Overview is not part of the predicate — the MINIMAL template has none.)
| Existing state | Action |
|---|---|
| No file for this branch | Write the skeleton (step 5) |
| File exists, no ## Acceptance Criteria | An interrupted run's checkpoint. Never re-write the skeleton. If it already carries ## Research Insights, skip the Phase 1 fan-out and continue from Phase 1.7's exit; otherwise continue to Phase 1 |
| File exists with ## Acceptance Criteria | A finished plan. Never overwrite. Headless: return the path and let the pipeline advance. Interactive: ask |
| Selector matched nothing | Use the filename derived at step 2 |
5. Write the skeleton. Frontmatter carries only what Phase 0.6 already knows:
title: "<from gh issue view --json title>"
date: <UTC date>
slug: <the kebab title from step 2, without the date prefix or -plan suffix>
branch: <git branch --show-current>
issue: <N> # provisional — planning may re-target
Then ## Overview, and nothing else.
**Deliberately absent: lane:, type:, closes:, priority:, domain:,
brand_survival_threshold: and requires_cpo_signoff:.** Every one is derived after research.
Pre-seeding lane: is actively harmful — it bakes in the fail-closed cross-domain value, which
widens the Phase 2.5 domain fan-out this checkpoint exists to protect. issue:/closes: are
decided by planning, not by the invocation, so the skeleton's issue: is provisional and
finalization rewrites both unconditionally.
No progress key. Completion is asserted from content (## Acceptance Criteria), never from a
dedicated frontmatter cursor. A second progress signal can disagree with the file's own content,
and every such disagreement resolves to a fail-open arm — see ADR-176 §Considered Options 6.
Stub no conditional section. The expected heading set depends on the detail level chosen at
Step 4 — after research — and the conditional sections are gate-triggered. A placeholder for a
section the finished plan legitimately skips trips deepen-plan's halt gates. For the same reason,
placeholder prose must avoid the literal tokens TODO, TBD, N/A and placeholder.
Sanitize the Overview. Write a restatement in this skill's own voice, never a verbatim paste of
the issue body. lint-infra-no-human-steps.py
scans this directory and .claude/hooks/iac-plan-write-guard.sh gates the Write itself; both reject
prose pairing a human-actor token with an infrastructure imperative, and an issue body frequently
contains one.
Write-denial arm. The write guard is a PreToolUse deny hook. On denial, retry once with a
minimal Overview (title only). If still denied, proceed skeleton-less and note the reason in the
Session Summary — degrading to the pre-#7418 behaviour rather than aborting a run the operator is
paying for. Do not reach for the guard's acknowledgement opt-out to force the write: it asserts a
real infrastructure step was reviewed, which would be false here.
Main Tasks
1. Local Research (Always Runs - Parallel)
Run these agents in parallel to gather local context:
- Task soleur:engineering:research:repo-research-analyst(feature_description)
- Task soleur:engineering:research:learnings-researcher(feature_description)
What to look for:
- Repo research: existing patterns, CLAUDE.md guidance, technology familiarity, pattern consistency
- Learnings: documented solutions in
knowledge-base/project/learnings/that might apply (gotchas, patterns, lessons learned)
These findings inform the next step.
1.4. Network-Outage Hypothesis Check (Conditional)
If the feature description matches any of the patterns SSH, connection reset, kex, firewall, unreachable, timeout, 502, 503, 504, handshake, EHOSTUNREACH, ECONNRESET (case-insensitive substring match on the feature description), read plan-network-outage-checklist.md and require its output in the ## Hypotheses section of the final plan.
<!-- lint-infra-ignore start: describes a gate trigger / a past defect; prescribes no operator step (pre-existing on main, surfaced when #8301 staged this file) -->
Also fire this gate when the feature description names terraform apply (with or without -target=) against a resource whose definition contains provisioner "file", provisioner "remote-exec", or a connection { type = "ssh" ... } block. The provisioner block makes SSH a hard apply-time dependency that the prose-only keyword scan won't detect. Why: #3061 — apply on terraform_data.deploy_pipeline_fix hit ssh: handshake failed: connection reset by peer despite zero SSH keywords in the plan, because the firewall allowlist had drifted out from under the operator's egress IP.
<!-- lint-infra-ignore end -->
The checklist enforces an L3->L7 diagnostic order: firewall allow-list and DNS/routing MUST be verified before sshd/fail2ban/service-layer hypotheses. Per AGENTS.md hr-ssh-diagnosis-verify-firewall, this is a hard rule -- plans that propose sshd or fail2ban fixes without first verifying firewall + egress IP are workflow violations.
When a trigger pattern matches, emit rule-application telemetry so the weekly aggregator records this gate fired (see AGENTS.md hr-ssh-diagnosis-verify-firewall):
echo 'SOLEUR_RULE_APPLIED rule=hr-ssh-diagnosis-verify-firewall note=When a plan addresses an SSH/network-connectivity s'
This step is a single file read, not a subagent spawn. If the feature description does not match any trigger pattern, skip this step silently.
1.5. Community Discovery Check (Conditional)
Read plugins/soleur/skills/plan/references/plan-community-discovery.md now for the full community discovery procedure (stack detection, coverage gap check, soleur:engineering:discovery:agent-finder). Skip if no uncovered stacks detected.
1.5b. Functional Overlap Check
Read plugins/soleur/skills/plan/references/plan-functional-overlap.md now for the functional overlap check procedure (always runs, spawns soleur:engineering:discovery:functional-discovery agent).
1.6. Research Decision
Based on signals from Step 0 and findings from Step 1, decide on external research.
High-risk topics → always research. Security, payments, external APIs, data privacy. The cost of missing something is too high. This takes precedence over speed signals.
Strong local context → skip external research. Codebase has good patterns, CLAUDE.md has guidance, user knows what they want. External research adds little value.
Uncertainty or unfamiliar territory → research. User is exploring, codebase has no examples, new technology. External perspective is valuable.
Announce the decision and proceed. Brief explanation, then continue. User can redirect if needed.
Examples:
- "Your codebase has solid patterns for this. Proceeding without external research."
- "This involves payment processing, so I'll research current best practices first."
1.6b. External Research (Conditional)
Only run if Step 1.6 indicates external research is valuable.
Run these agents in parallel:
- Task soleur:engineering:research:best-practices-researcher(feature_description)
- Task soleur:engineering:research:framework-docs-researcher(feature_description)
1.7. Consolidate Research
After all research steps complete, consolidate findings:
- Document relevant file paths from repo research (e.g.,
app/services/example_service.rb:42) - Include relevant institutional learnings from
knowledge-base/project/learnings/(key insights, gotchas to avoid) - Note external documentation URLs and best practices (if external research was done)
- List related issues or PRs discovered
- Capture CLAUDE.md conventions
- Reconcile spec claims against codebase reality. If the soleur:engineering:research:repo-research-analyst returned any "Gap callouts" or equivalent mismatches, the plan MUST include a "Research Reconciliation — Spec vs. Codebase" section (3-column table: spec claim / reality / plan response) placed between "Overview" and "Implementation Phases". This prevents the plan from inheriting spec fiction (e.g., claimed infrastructure that doesn't exist) as phase estimates. See
knowledge-base/project/learnings/best-practices/2026-04-15-plan-skill-reconcile-spec-vs-codebase.md.
**Persist the research to the plan file now — this is the write that makes the Phase 0.7 checkpoint
pay.** Write a ## Research Insights section into the plan holding the consolidated findings above:
the relevant file paths, the applicable institutional learnings, any external documentation and best
practices, the related issues and PRs, the CLAUDE.md conventions, the Premise Validation note
carried forward from Phase 0.6, and the Property List plus Cut List carried forward from
Phase 0.6b. The property list is what plan-review reads to ask "which requirement does this
mechanism satisfy?", so it must reach the file — a consumer pointed at an artifact no producer writes
will silently skip the check.
Everything above this line was bought with the fan-out. A checkpoint that only reserved a filename
would still lose all of it to a stall here. deepen-plan later enriches this section; plan is what
first puts it on disk.
Write it in a SINGLE Edit at the end of consolidation, never incrementally. Phase 0.7 step 4
reads the section's presence as "the fan-out completed" and skips Phase 1 on that basis, so a
half-written section would be read as a whole one.
Optional validation: Briefly summarize findings and ask if anything looks off or missing before proceeding to planning.
1.7.5. Code-Review Overlap Check
After the plan draft has enumerated its ## Files to Edit and ## Files to Create sections (i.e., run this check AFTER Step 2 Issue Planning produces the file list, and BEFORE Step 4 Detail Level selection), verify whether any open code-review issues touch files the plan intends to modify. This prevents two failure modes:
- Rework: a pre-existing scope-out names a file the plan will rewrite — if unnoticed, the plan ships, then the scope-out surfaces and drives a second refactor PR that could have been folded in.
- Double-counting: the review phase files a new scope-out for a concern a still-open issue already tracks.
Procedure:
- Read the plan's
## Files to Editand## Files to Createsections (the plan draft exists by this point). Extract every file path. If the plan is still being drafted and those sections are not yet written, defer this check until they exist rather than guessing from the feature description — guessing produces false negatives.
- Query open code-review issues. Use two-stage piping (
--jsonthen a standalonejq --arg), not single-stagegh --jqwith--arg. TheghCLI does NOT forward--argto its embedded jq; a single-stage form producesunknown argumentsat runtime. See learningknowledge-base/project/learnings/2026-04-15-gh-jq-does-not-forward-arg-to-jq.md.
```bash
ISSUES_JSON=$(mktemp -p "$(mktemp -d -t soleur-run.$$.XXXXXXXX)" open-review-issues.XXXXXXXX.json)
gh issue list --label code-review --state open \
--json number,title,body --limit 200 > "$ISSUES_JSON"
echo "ISSUES_JSON=$ISSUES_JSON"
```
- For each planned file path, search the issue bodies using standalone
jqwith--arg(safe against regex metacharacters in paths):
```bash
jq -r --arg path "<file-path>" '
.[] | select(.body // "" | contains($path))
| "#\(.number): \(.title)"
' "$ISSUES_JSON"
```
A later Bash call does not inherit ISSUES_JSON, so carry the echoed path forward (or
re-derive it in the same call). Do not substitute a fixed name: a concurrent soleur:plan
would overwrite the file between the write and this read. When the last jq read is done,
rm -f "$ISSUES_JSON"; rmdir "$(dirname "$ISSUES_JSON")" 2>/dev/null — it is a snapshot, not an artifact (#10017).
- If any matches are returned, write a
## Open Code-Review Overlapsection to the plan file with a one-line bullet per match and an explicit disposition for each:
> X open scope-outs touch these files: #2466 (Range cache), #2483 (helper extraction). Fold in / acknowledge / defer: …
For each match, the planner MUST explicitly choose one of:
- Fold in: plan extends to close the scope-out in the same PR. Add the scope-out's file paths to
## Files to editand noteCloses #<N>in the PR-body reminder. - Acknowledge: plan deliberately does NOT fix the scope-out (e.g., different concern, needs its own cycle). Record a 1-sentence rationale. The scope-out remains open.
- Defer: plan is not the right place; update the scope-out issue with a re-evaluation note (e.g., "revisit after feat-X lands"). Do NOT silently leave the overlap unaddressed — the reviewer will re-surface it.
- If no matches, still record
## Open Code-Review OverlapwithNoneso the next planner can see the check ran.
Why this matters: In the 2026-04-17 window, PR #2486 closed three scope-outs (#2467 + #2468 + #2469) because the planner noticed the overlap. PRs #2463 and #2477 grew the backlog instead because no overlap check ran. This phase makes the #2486 pattern the default, not the exception. See knowledge-base/project/learnings/best-practices/2026-04-17-review-backlog-net-positive-filing.md.
1.8. Skill Description Budget Check (Conditional)
Phase 1 baseline. If the feature description, research findings (1.1), or repo grep (Phase 1.7 consolidation) surfaces a candidate description: edit to any plugins/soleur/skills/*/SKILL.md, run the budget one-liner now (Node form, see