/xlfg-engineering:xlfg [feature, bugfix, investigation, or delivery request]from xlfg-engineering
Autonomous proof-first SDLC run. Dispatches 4 phase skills (intent, plan, implement, compound) and 4 phase agents (recall, context, verify, review) in order.
Ships in xlfg-engineering. Installing the plugin adds it to Claude Code.
Use this when the user wants a serious engineering run with PM, UX, engineering, QA, and release discipline all in one pass.
INPUT: $ARGUMENTS
Treat this invocation as one autonomous run split across 8 phases. You are the conductor. The pipeline mixes two dispatch mechanisms:
Skill tool and run in your own context. They drive decisions; you need their full reasoning to brief the next step.Agent tool and run in their own sub-contexts. They explore heavily and return a distilled synthesis via a mandatory ## Return format section. You receive the conclusion, not the tool-call log.Do not try to hold every phase body in context simultaneously — that's exactly what this split is designed to prevent.
xlfg v6.5 is a conductor-plus-phase-skills-and-agents architecture. The 4 decision-driving phases are skills under plugins/xlfg-engineering/skills/xlfg-*-phase/; the 4 exploration-heavy phases are agents under plugins/xlfg-engineering/agents/. This conductor dispatches both in one canonical pipeline order. There is no v5 coordination layer — no spec.md, workboard.md, phase-state.json, verification.md, or test-contract.md files. The run lives in your context plus the 4 agent sub-contexts, and in the real repo.
The durable archive convention stays:
docs/xlfg/current-state.md — optional, tracked, one-page living summary of the project's load-bearing truths. Read by the recall phase-agent. Updated sparingly by the compound skill when a run earns promotion.docs/xlfg/runs/<RUN_ID>/run-summary.md — written by the compound skill at the end of every run. One file per run. Grep-able months later..xlfg/ does not exist in v6. Everything durable lives under docs/xlfg/ and is committed.
Before dispatching phase 1, establish the run identity and wire the task-pane bridge:
RUN_ID = <YYYYMMDD>-<HHMMSS>-<kebab-slug>. Get the real timestamp from the system clock — do not invent it from memory or infer it from context. Run this once via Bash:
date +%Y%m%d-%H%M%S
Take the exact output (e.g. 20260417-163000), append - and a short (<=40 char) kebab-case summary of $ARGUMENTS, and that's your RUN_ID. Example: if date returns 20260417-163000 and the ask is "add a retry policy to the webhook consumer", RUN_ID = 20260417-163000-webhook-retry. Compute once, reuse throughout the run — do not re-invoke date mid-run (the timestamp should represent when the run started, not when each phase began).
Harness task bridge (optional but recommended). Emit one TaskCreate per phase so the Claude Code task pane mirrors the pipeline. Use these exact subjects: xlfg: recall, xlfg: intent, xlfg: context, xlfg: plan, xlfg: implement, xlfg: verify, xlfg: review, xlfg: compound. As each phase returns successfully, call TaskUpdate to mark the matching task completed.
The run directory is created lazily. The compound skill will mkdir -p docs/xlfg/runs/<RUN_ID>/ before writing run-summary.md. Do not preseed it.
Dispatch these 8 phases in this exact order. The mechanism differs per phase:
xlfg-recall — dispatch via the Agent tool with subagent_type: "xlfg-recall".xlfg-engineering:xlfg-intent-phase — load via the Skill tool.xlfg-context — dispatch via the Agent tool with subagent_type: "xlfg-context".xlfg-engineering:xlfg-plan-phase — load via the Skill tool.xlfg-engineering:xlfg-implement-phase — load via the Skill tool.xlfg-verify — dispatch via the Agent tool with subagent_type: "xlfg-verify".xlfg-review — dispatch via the Agent tool with subagent_type: "xlfg-review".xlfg-engineering:xlfg-compound-phase — load via the Skill tool.Skill phases load just-in-time from their SKILL.md body — do NOT inline skill instructions from memory. Agent phases run in their own sub-contexts; you cannot load their bodies into your own context. Brief each agent with a self-contained prompt (see §Briefing agents) and read only its ## Return format block from the returned message.
Each of the 4 agent dispatches needs a hand-written brief. Do not paste $ARGUMENTS raw — synthesize from what you already know. A good brief includes:
RUN_IDExample for xlfg-context dispatch (schematic — adapt to the real run):
Agent(
subagent_type: "xlfg-context",
description: "Context phase",
prompt: "RUN_ID: <id>\nUser ask (resolved): <intent synthesis>\nRecall synthesis: <recall result>\n\nGather the context needed to plan a change that satisfies the above. Focus surfaces on what the plan will need to touch, not the whole repo.\n\nReturn in the CONTEXT MAP format declared in your agent body."
)
You read the agent's final message, which must match its declared Return format. Summarize into your own working notes and dispatch the next phase.
After any phase (skill or agent) returns, your very next tool call is the dispatch for the next phase in the pipeline. Not a progress note, not a user-facing confirmation, not a pause for review — the next Skill or Agent call, in the same turn.
A phase's ## Done signal (skills) or ## Return format (agents) means that phase finished its work and handed you its conclusion. It does not mean the run ended. The run ends only after phase 8 (compound) returns and you've executed the end-of-run commit step and written the completion summary.
The only valid mid-run turn boundaries are:
needs-user-answer → ask at most three numbered blocking questions and stop.Anti-pattern to avoid: outputting a natural-sounding transition like "Plan is READY. Proceeding to implement.", "Context gathered, moving to plan.", "Verify GREEN, moving to review.", or "Review APPROVE, moving to compound." and then ending the turn. "Proceeding", "moving", "next up", "handing off" all describe your next action — that action must be the tool call you just described, not an end-of-turn. If you wrote a transition sentence, the very next thing you emit must be the dispatch. Better still: dispatch without the transition sentence.
Do not wait for the user to say "continue", "ok", or anything else to resume between phases. The user invoked /xlfg once; that is your authorization for the whole run.
needs-user-answer, stop the pipeline and ask at most three numbered blocking questions.If a downstream phase rejects its predecessor, loop back explicitly:
Loopbacks that do not count:
APPROVE-WITH-NOTES from the review agent (inline tiny fixes + fast_check re-run).Cap: 2 loopbacks. After the second loopback, stop and escalate to the user with a summary of what failed and why. Do not hand the loop back to the user before the cap is hit.
Track loopback count in your own working notes — there is no .xlfg/phase-state.json in v6. If you're using the harness task bridge, a TaskCreate with subject xlfg: loopback N/2 is a reasonable way to surface it.
After the compound skill returns and before you write the user-facing summary, close the run with a commit. A run that edited product code and didn't land a commit isn't done — it's dangling in the working tree.
git status --porcelain once via Bash. Read the output yourself; don't assume.docs/xlfg/runs/ / .xlfg/ / other gitignored paths), skip the commit. Note "no product changes to commit — investigation-only run" in the completion summary and stop.git add -A or git add .. Those would sweep in files you don't own.docs/xlfg/runs/** or .xlfg/**. They're gitignored already, but an explicit git add on them would override the ignore. Run artifacts are per-run scratch, not product — confirmed by the user on 2026-04-13.feat(scope): ..., fix(scope): ..., test(scope): ..., docs(scope): ..., refactor(scope): ..., chore(scope): ...). Subject ≤72 chars, written in the imperative. If the body adds value, keep it short and focused on the why, not a diff recap.git push. Do not --amend a prior commit. Do not --no-verify. If a pre-commit hook fails, fix the underlying issue and make a new commit; never skip the hook.git rev-parse --short HEAD) so you can cite it in the summary.This step is the v6.3.2 repair for a regression where v6 runs finished with edits unstaged. Do not skip it, do not turn it into an ask-the-user gate, and do not collapse it into the compound skill — compound writes the archive, the conductor owns the commit.
Once the commit is done (or correctly skipped), emit the run summary as labeled bullet sections. Full record lives in run-summary.md; chat output is the pointer.
Mandatory sections: Shipped:, Proof:, Commit:, Archive:. Optional section (include only when there is something concrete to say): Risk:. Do not write Risk: none — omit the section instead. No other sections: if you found something actionable that fits the ask, do it in this run rather than deferring as a chat suggestion; residual concerns the user owns go under Risk:; future-work musings go in ## Residual risk of run-summary.md, not in chat.
Each section: label on its own line, then - <bullet> lines (≤80 chars, one clause each), with a blank line before the next section. One clause per bullet — no compound sentences, semicolons, em-dash splits, or nested parentheticals. If detail does not fit, the bullet says - see archive and the user opens run-summary.md.
No Files section (git already lists files). No durable-lesson section (it lives in run-summary.md). No closing prose.
Variants (single line, replaces the whole block):
No product changes. <one clause>. Archive: docs/xlfg/runs/<RUN_ID>/run-summary.mdStopped after 2 loopbacks. <command> failed: <one clause>. Archive: docs/xlfg/runs/<RUN_ID>/run-summary.mdWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub flrngel/xlfg --plugin xlfg-engineering3 commands in this plugin
/xlfg-debugAutonomous diagnosis run. Dispatches 2 phase skills (intent, debug) and 2 phase agents (recall, context) to find the deep root without editing source./xlfg-initOne-shot scaffold for a project adopting xlfg. Idempotently patches the CWD's .gitignore and creates docs/xlfg/runs/ with .gitkeep and README.