/la:prfrom la
Orchestrates a spec-driven change flow across four stages (plan, tests, implement, review). Rehydrates context from the tracker issue tied to the current git branch and dispatches to stage-specific skills.
Ships in la. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Preflight: run la-doctor --plugin <this skill's base directory> --require-config --require-plan-store once per session before using any la-* or dr-* command; it also covers the stage skill this session dispatches. If it reports the missing-config finding (the one naming /la:init), run the fast path of the la:init skill; if it reports a format finding naming la-arch-migrate (a missing or older format): when git status --porcelain prints anything, stop and show the user those paths; otherwise run la-arch-migrate without asking and commit the paths it prints at once, without a push of their own. Then re-run this preflight; stop and show the user its output on anything it still reports, or on any other failure.
I want a detailed spec-driven flow. The brief is the union of:
The flow runs as four stage skills in this fixed order, and I reset the
session (/clear) between stages. Each stage ends at a hard stop; everything
a fresh session needs is on disk or in the tracker, so any stage can resume from
just the branch name:
pr-plan — interview me, Codex-review the plan (when
reviewers.codex is on), emit the
OpenSpec change (OpenSpec repos only), make the plan durable.
Ends at 🛑 reset point 1 (before tests).pr-tests — write the full failing test suite for the plan,
Codex-review the tests against the plan (when reviewers.codex is on).
Ends at 🛑 reset point 2 (before implementation).pr-implement — implement until every test passes, then commit and
push, and (with my go-ahead) open the PR.
Ends at 🛑 reset point 3 (just after the PR is created).pr-review — run /la:process-reviews until converged, then
archive the OpenSpec change (OpenSpec repos only), then keep sweeping the
gates on the archived HEAD until they converge again, so I can merge.This skill does NO stage work itself. It only: rehydrates context (below),
detects which stage we're at, and invokes that stage's skill (la:<stage>) via
the Skill tool. Run exactly ONE stage per session — when its hard stop is reached, STOP;
never chain into the next stage, even if it looks quick.
Each stage skill ends with its own hard stop so I can reset your context.
At a hard stop: say which reset point we're at, then STOP and wait — do not
start the next stage. I'll /clear and re-invoke /la:pr (possibly with
"continue on branch <BRANCH>"); rehydration + stage detection below take it
from there.
Within a stage, run autonomously — do NOT stop or ask permission to proceed. The only other permitted pauses are:
pr-plan interview (its whole point is questioning me);pr-plan, offering only genuine options as its "Genuine options
only" rule defines them). A choice with an obvious default is NOT this:
take the default and move on;pr-implement): never
open a PR without my explicit go-ahead; pushing this change's own branch needs none;Never stop just to report progress, to confirm an obvious next step, or to ask something you can determine yourself.
Ask every question before acting on any answer, one question per message. Every pause above is a question: a design choice, an approval to align a test, an approval of a plan, spec, harness or skill edit. When questions are pending — including ones that surface mid-stage — stop working, queue them all, and ask them back to back, exactly ONE per message, each self-contained. An answer is NEVER a go signal while another question is still queued: reply to it with the next question and nothing else. Act on the answers only after the LAST one; if acting raises new questions, stop and queue them the same way.
The plan — the OpenSpec change folder (proposal, design, tasks, delta specs) or,
without OpenSpec, the finalized-plan comment on the tracker issue — is MINE once
pr-plan reaches its hard stop. In EVERY later stage, NEVER change it without
my explicit confirmation of the exact edit: no added or amended decisions, no
rewritten or added scenarios, no "corrections" after a probe, no re-scoping, no
notes folded into tasks. If a stage finds the plan wrong, incomplete, or
contradicted by an axiom or a probe, STOP, present the exact proposed diff with
the reason, and wait. The one self-serve edit is flipping a task's [ ] to [x]
when it was completed exactly as written.
Sessions /clear between stages, so the stop message reaches no future stage.
Anything the next stage must know therefore has to be persisted where that
stage will discover it naturally during its own rehydration and work — NEVER a
turn-final "heads-up", "note for next time", "FYI for pr-implement", or a
caveat tacked onto the stop message. Such text is gone the instant I /clear, so
it only masquerades as a hand-off. If you catch yourself about to write one,
STOP and put it in one of these instead:
A hard stop then states only which reset point we're at: everything the next stage needs is already on disk or in the tracker, by construction.
At each stage's hard stop — after the stage's work is done, just before you STOP — commit the files that stage created or changed, without asking. This overrides any standing "don't commit, I'll commit" / "ask me each time" preference, and it supersedes any "do NOT commit" wording in the stage skills. What still holds:
git add <path1> <path2> ...), not one command per
file. NEVER use git add -A, git add ., a glob, or a whole directory.pr-implement Step 3 / the stopping policy above)Locally, run only the tests this change can affect; the full suite is CI's job. The scope is:
la-affected-tests --base <base-branch> prints (the PR's base
branch once a PR exists, else the default branch): the tests this change
added or changed, and every test whose imports reach a changed file;Run them with the repo's test runner (the one behind la-config get commands.test, keeping its usual options) narrowed to those files or test
ids, leaving out printed files the runner does not collect as tests (helpers,
fixtures). Never run the whole suite locally "to be safe"; a test missed here
is caught by CI.
In a repo whose living-architecture.yaml sets architecture: true, load the
la:living-architecture skill at EVERY stage of the flow and follow its
"Working under the architecture" rules; "the user" there is me. One addition
for this flow: wording quoted verbatim in the plan's decisions log as
(user, approved wording) is the per-change OK for that edit. Apply it
verbatim, and ask again only if it has to change.
Read the repo's decisions from its config: TRACKER=$(la-config get tracker)
(linear, github or none) and la-config get openspec. Capture
BRANCH=$(git rev-parse --abbrev-ref HEAD).
TRACKER=linear. Look up the Linear issue whose gitBranchName equals
BRANCH exactly. I create branches by clicking "Copy git branch name" in
the Linear issue UI and git checkout -b-ing them, so the local branch name is
byte-equal to the issue's gitBranchName. That equality is the join key.
<user>/<lowercased-key>-<title-slug> (e.g.
alice/abc-123-add-storage-layer). Pull out the <key> chunk
(abc-123), uppercase it (ABC-123), and call
mcp__linear__get_issue(id="ABC-123").gitBranchName
equals BRANCH exactly, use it. Otherwise fall back to
mcp__linear__list_issues(team="<KEY-PREFIX>", query="<key-or-slug>", includeArchived=false) (<KEY-PREFIX> = the key's team part, e.g. ABC)
and walk the results, comparing each issue's
gitBranchName to BRANCH. Pick the unique exact match.mcp__linear__get_issue already returns it) plus any comments via
mcp__linear__list_comments.TRACKER=github. GitHub's "Create a branch" names the branch
<N>-<title-slug>, so take the leading <N>- of BRANCH (after any
<user>/ segment). The issue is #<N> iff gh issue develop --list <N> lists
BRANCH among its linked branches; GitHub has no reverse lookup, so this is
the only join. Read the issue with gh issue view <N> --comments.
TRACKER=none. There is no issue: the brief is my typed input alone.
If no issue maps to the branch (Linear: 0 exact matches; GitHub: no leading number, or the branch is not linked to that issue), tell me so and ask whether to proceed with only my typed input as the brief. If Linear gives >1 exact matches, list them and ask which one.
Set the change-id and OpenSpec. CHANGE_ID = $BRANCH with any leading
<user>/ segment stripped (alice/abc-123-add-storage-layer gives
CHANGE_ID=abc-123-add-storage-layer; OpenSpec change ids forbid underscores,
so replace any with -). This keeps issue ↔ git branch ↔ OpenSpec change
1:1:1. OPENSPEC=1 iff la-config get openspec prints true (the preflight
already checked that openspec/ agrees); otherwise OPENSPEC=0, and skip
everything marked "OpenSpec repos only" in the stage skills.
Work out which stage this session should run — first match wins:
BRANCH? Check with gh pr view --json state,url.
If an open PR exists → pr-review.OPENSPEC=1: openspec/changes/<CHANGE_ID>/ exists and
openspec validate <CHANGE_ID> --strict passes; orOPENSPEC=0: the tracker issue has a comment containing the finalized
plan (Linear: mcp__linear__list_comments; GitHub: gh issue view <N> --comments).
If not durable → pr-plan.git status) plus commits since the
merge-base with the default branch
(git diff --name-only $(git merge-base HEAD <default-branch>)..HEAD).
If none → pr-tests.pr-implement (plan and tests exist, no PR yet;
this stage also covers the "all tests already pass, awaiting my
PR go-ahead" case).If the evidence is ambiguous (e.g. test files changed but they don't obviously belong to this change), say what you found and ask me which stage to run.
Tell me in one line which stage was detected and why, then invoke that stage's
skill (la:pr-plan / la:pr-tests / la:pr-implement / la:pr-review)
via the Skill tool and follow it to its hard stop. If I explicitly named a stage
when invoking /la:pr, that overrides detection.
What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/arch-cleanupUse to carve or tighten ONE architecture boundary in a repo with the living-architecture setup — take a coherent batch of grandfathered `#legacy` arrows (or extract a new node), refactor them away with verified moves (deterministic-refactor), and shrink the legacy-arrow baseline monotonically. Behaviour-preserving by definition; one slice = one branch/PR./arch-initBuild a repo's first living-architecture model — write the language sections of architecture/index.yaml, scaffold the as-is model from the measured imports (la-arch-scaffold), choose the wedge with the user, draft the principles from the repo's own instructions, map the specs, and get la-arch-check green. Syntax and maintenance are in the la:living-architecture reference./codex-reviewnpx claudepluginhub motleyai/living-architecture --plugin laOther plugins' skills for the same job