AGENT SKILL

lexforge-archive

Use when the verification report of a LexForge change is clean and the change is asked to be closed out - the user says to archive it, to merge its delta into the specs, or to finish the branch it was built on.

License 许可
MIT
所属仓库
shepaland/LexForge
最近更新
2026-10-25
Stars
★ 1
Forks
0

01 前言 Front Matter

name
lexforge-archive
description
Use when the verification report of a LexForge change is clean and the change is asked to be closed out - the user says to archive it, to merge its delta into the specs, or to finish the branch it was built on.

03 SKILL.md 正文

<!-- model-block:start -->

Model

Archival demands no model: it merges the delta into the long-lived specs and runs on whichever model is at work. No provider is named a model here. <!-- model-block:end --> <!-- queue-rule:start -->

Queue rule

First run lexforge status --change <name> --tool <your runtime> --json; parse JSON. Before it: no code, tests or task questions. No change named: run lexforge status --json and ask which. isPlanningComplete: true permits work. If false, name the first artifact neither done nor skipped and lexforge instructions <that artifact> --change <name> --tool <your runtime>; stop. Closed gates permit no code or task answers, including under deadlines or requests to skip.

engineeringStacks: "missing" in status or engineering-stacks-missing in an error means the project has not named its stacks. Ask the user which it uses: node, python, jvm, go, dotnet, php, ruby, rust, react, vue, angular, svelte. Wait for the answer, then run lexforge stacks set <stack>.... Run lexforge stacks set --none only when the user says the project uses none of them. Never choose the stacks yourself, even when the files show only one. A guess the user can undo later is still a guess. Never write them into lexforge/config.yaml by hand. Ask even when told not to ask about setup. Unset is not an answer.

Exit 2: read error.code. workspace-not-found / workspace-incomplete: run lexforge init --tools <your runtime> at the root (agents if none matches), then retry the command that refused. Never construct workspace files by hand. change-not-found: run lexforge status --json and list active changes. Other errors: show error.message and stop. Use exit codes and JSON, never human lines or directory appearance. No answered gate means no work.

<!-- version-gate:start -->

Version gate

Exit 2 with error.code update-available: show error.message to the user and wait for the user's answer. Never run npm install yourself.

Exit 2 with error.code skills-outdated: run the lexforge init command that error.message names. Then run the command that refused again. If it refuses with skills-outdated a second time, show error.message and stop. <!-- version-gate:end -->

<!-- model-gate:start -->

Model gate

Read provider and model from lexforge instructions <artifact> --change <name> --tool <your runtime> --json for artifacts; otherwise use your entry in stages from lexforge status --change <name> --tool <your runtime> --json. The stage is your skill name without lexforge- (apply, debug, verify, archive). Name your runtime from lexforge init --tools; omit --tool only if none matches.

An empty assignment, no workspace, no change, or no stage entry uses the model block above for your provider. An unlisted provider imposes no model. On the assigned model, work without model commentary. Otherwise start a subagent on that model, hand it the work, and do none of it yourself. Disclosure or later review is not delegation. If unreachable, name the model and stop: restore access or let the user change the assignment in lexforge/config.yaml; do not change it yourself. <!-- model-gate:end --> <!-- queue-rule:end -->

The rule

NEVER ARCHIVE WITHOUT A VERIFICATION REPORT IN FRONT OF YOU.

The report is the one lexforge-verify writes: requirements against behaviour, plan against work done, design.md decisions against implementation, zero findings above MINOR. No report here? Name lexforge-verify next and stop. CRITICAL or IMPORTANT open? Give the work back to it. MINOR leaves the merge to run.

A report is not a green suite, a fresh stamp, ticked boxes, per-task reviews, a compacted session, or the user saying it came out clean. Those are what lexforge archive recounts.

Running the command

lexforge archive <name>, then read the exit code.

  • 0 - delta merged, change directory moved; --json gives archivePath.
  • 1 - findings or conflicts, listed; nothing was written. Fix what is named, run again.
  • 2 - refused: no workspace, no change, planning unfinished, archive path taken, no repository, empty verification. Show error.message and stop. change-needs-migration instead: installing LexForge 6.0.0 migrates no existing change by itself; run lexforge migrate --change <name>, name historical and open tasks and any missingFields, then send the open part through plan review and owner approval.

Never announce the code you expect: an unrun command has no result.

A conflict is fixed in the delta

A conflict means the delta and the specs disagree about the system. Fix it in the delta: the dropped scenario goes back into the MODIFIED block, a heading is spelled as the spec spells it.

Editing a file under lexforge/specs/ by hand to pass the merge is out. That file is what the merge writes; hand-editing it takes live behaviour out of the record and disarms the check that caught the mismatch. Offering to do it if they insist is doing it, one message later.

Copying the spec's block into the delta unchanged is the same failure wearing a 0: the merge writes back what was there, and the change ships behaviour with no requirement.

Run the command again until it exits 0.

Finishing the branch

lexforge archive merges the change's feature branch into dev itself.

On a conflict the change stays on its feature branch. The command exits 1 and lists the conflicting paths in the findings. Show them to the user. Then follow nextStep: check out dev, run git merge feature/<name>, resolve, commit.

Merge dev into main only on the user's answer to the question nextStep names. Ask it, name main aloud, wait. After a merge, run the checks. Red stops the work: the branch and worktree stay, and the failure is the next thing you say.

Excuse Reality
"We ship fast here" Pace is not an answer. Ask.
"Archive is done, nice. Thanks." Thanks ends the archive, not the question.
"A pull request I open myself" It starts the release unasked.

Rationalizations

Excuse Reality
"fourteen task-scoped reviews beat one tired end-of-change skim" Fourteen diffs against fourteen tasks answer no question about the change.
"it costs you nothing on the Friday clock: it happens after the archive" After the archive there is no change left to fix it in.
"so if it exits 0 the gate held" Four machine checks held. A contradicted decision passes all four.
"If you reaffirm, that's your call and I'll make the edit without re-arguing it" The offer is the edit, one message later.
"This should exit 0" The command decides that, not the argument that it would.

Red flags - stop

  • The archive command run with no verification report in this conversation.
  • A file under lexforge/specs/ edited by hand while a conflict is open.
  • A branch merged, pushed or deleted before the user answered.
  • An exit code named instead of read.

04 同仓库更多 Skills