跳到正文
cccskills
免费在 GitHub 公开

lagune.repair

Repair Lagune's internal tracking so each item stays whole when files are renamed or moved, and check every memory artifact against its template. A maintenance pass, not a security phase, rewriting the tracking map across all phases in one pass.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune星标 173(GitHub 173 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md6.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

User Input

$ARGUMENTS

The User Input above decides how this command runs. Read it before proceeding.

Outline

You are reconciling Lagune's internal tracking map at .lagune/tracking.json: the side index that holds one entry per tracked item (a detect finding the later phases carry forward as the same item) so the item survives a rename or a moved file. Each item is one entry, identified by its name. The file paths live only in this map, never in the prose artifacts. So when a refactor renames or moves a file, the map is the one place that points at a path that no longer exists. Reconcile is the one act that corrects it.

Reconcile is whole, never partial. It reads every artifact under .lagune/memory/ and the project's current code, works out where each item lives, and rewrites the tracking map in one pass. It never reconciles one phase in isolation, because a file renamed mid-flow touches every phase that referenced it, and updating only some of them is exactly the inconsistency this command exists to remove. The same whole-chain seat makes this the one command that checks every memory artifact against its template, reporting what drifted without touching it.

This is plumbing, not a security phase. It does not edit any .lagune/memory/*.md artifact and does not create a .lagune/memory/repair.md. The only file it changes is .lagune/tracking.json. The repair is internal.

Step 1: Read the whole chain

Read every artifact that exists under .lagune/memory/: detect.md, plan.md, harden.md. Charter has no tracked items, so it is never reconciled. From each artifact, collect every section's title (the finding's name). The title is the same across phases, so a finding present in detect.md and again in plan.md is the one item: collect it once. Then read the current tracking map at .lagune/tracking.json for the paths each item holds: the artifacts hold no paths, the map does.

If no artifact exists yet, there is nothing to reconcile. Tell the user the chain has not been started and stop.

Step 2: Confront the tracked paths with the current code

For each item, check the paths the tracking map holds for it against the project as it is now. When a path still exists, keep it. When it does not (the file was renamed or moved), read the code to find where that same item now lives, and use the current path. This is the one place reconcile reads the user's source: to learn the truth a renamed file hides. Build the corrected { name, paths } for each item: the name is the finding's title unchanged, the paths set to the current locations. Do not change the name when you are only correcting paths, the name is its identity through the rename.

Where you genuinely cannot tell whether an item was resolved or merely renamed, do not guess. Leave its paths as you found them in the map and let the hook surface it as unresolved in the next step.

Step 3: Rewrite the tracking map with the hook

Hand the hook one item per finding the artifacts still name, using the corrected paths from Step 2. The payload is { entries: [...] }, the same shape as tracking.json: each entry is { name, paths }, where name is the finding's title and paths holds its current file paths. List each item once, no matter how many phases name it. Run the repair hook from the project root, passing the payload as the single argument (a name with quotes or backticks stays intact) and reading the JSON result from standard output:

npx --yes lagune repair '{"entries":[{"name":"<NAME>","paths":["<PATH>"]}]}'

The hook compares every entry against the map and rewrites it: an item still named keeps its identity, an item whose paths moved gets the new paths, a name the map does not hold is registered, and an item you did not report is kept rather than deleted. It returns a classification per item and a list of unresolved items it could not decide alone. It never guesses the one call it cannot make: whether an item that disappeared was fixed or merely renamed.

Step 4: Resolve what the hook could not decide

The hook returns unresolved for each item that was in the map but not named in any artifact you reported. Each carries its name, paths, and a reason:

  • renamed-candidate: an item observed under a different name shares this one's tracked paths. Likely a rename, but the hook must not decide it alone. Confirm with the user, and if they confirm, run the hook again with the item under its current name so its identity carries over.
  • orphan: the item is in the map but no artifact names it anymore. It may have been genuinely resolved (the logic deleted), or dropped by mistake. Ask the user before treating it as gone. If confirmed gone, delete that one entry from the map and remove the same-titled section from each .md that still carries it. Prefer to ask than to guess: a wrongly dropped item is how the chain breaks.

Step 5: Check the whole memory

Run npx --yes lagune validate from the project root with no argument, which checks every memory artifact present against its template. Fix nothing: each artifact's shape belongs to the phase that writes it, so carry what the hook reports into the summary, each drifted artifact pointed at its own command (/lagune.charter, /lagune.detect, /lagune.plan, or /lagune.harden).

Step 6: Summarize

  • Write nothing to the artifacts. The hook already wrote .lagune/tracking.json.
  • Output a short summary to the user, in plain language, leading with the items' names, never an internal id:
    • What was reconciled: items whose path was corrected after a rename or move, items newly registered, and any rename you confirmed.
    • Anything still unresolved and what would settle it.
    • What the memory check reported: each drifted artifact with the phase command that fixes it, and any warning worth attention. Nothing reported means the memory kept its shape, so say so.
    • A suggested commit message, for example chore: repair the Lagune tracking map.
    • Next step: if anything is still unresolved, name it so the user can settle it and rerun. Otherwise tell the user the tracking is coherent again. Say it as a suggestion, not a mandate.

Keep the summary in plain language. The tracking map is invisible plumbing, so tell the user what changed for each item, not how the map stores it.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Authoritative architecture reference for Lagune, covering repository layout, the three owners, the published skills, the catalog, the engine command and its fallback, and the tracking-map model. Use when a decision depends on repo shape.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune1732026年10月26日 更新

cdp

免费

Visual verification of a running page through Chrome's DevTools Protocol, capturing screenshots and measuring the rendered DOM. Use when a frontend change can only be confirmed once rendered, for layout, spacing, alignment, overflow, or theme tokens.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune1732026年10月26日 更新

dashboard

免费

Authoritative reference for the Lagune dashboard, a live view of a project's .lagune/ chain with a locked-down local action surface. Use before changing anything under src/dashboard/ or src/types/dashboard/.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune1732026年10月26日 更新

Authoritative engineering reference covering code conventions, comments, TypeScript type rules, testing, and commit messages. Use before writing or changing any source file, and when suggesting a commit message.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune1732026年10月26日 更新

lagune

免费

Do the work the prompt asks for, with security guarding the build as it happens. Loads the charter, matches the security knowledge the work touches, builds safe-by-default, then checks its own result against what it used.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune1732026年10月26日 更新

Establish or update the project's security charter, the safe-by-default principles every later phase must respect. Reads the project's files to learn what it is and uses, weighs any description you give against them, and asks when something is unclear.

中文简介正在准备中。当前显示原文说明。

wellwelwel/lagune1732026年10月26日 更新

查看 wellwelwel 的全部技能

报告此技能的问题