/lagune:lagune-harden Optionally name fixes, files/dirs, or priorities, or leave empty to apply every fixfrom lagune
Applies fixes from a defense plan to code one at a time, recording changes and remaining work. Reads the plan and charter, then hardens fixes by name, file/directory, priority, or all.
Ships in lagune. 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.
Read when SKILL.md points to them.
The User Input above decides how this command runs. Read it before proceeding. A placeholder left unfilled above is not the input: the User Input is then the words that came with this command, or empty when there are none.
You are applying the defense plan to the code and producing a hardening record at .lagune/memory/harden.md: a record of which plan fixes were applied, what changed in the code, and what is still left. This phase continues from plan. Plan already decided the fix for each finding and its priority, so this phase does not re-decide the fix: it applies it. Every change you make must come from a fix that is really in the defense plan, never a fix you invent here. This is the one phase that changes the user's code, so it is the one that must be the most careful.
The defense plan is the primary input: the changes follow from the fixes it lists. The charter is the governing context: its principles still bind what you do, and a fix must never be applied in a way that breaks one.
This phase is built entirely on the defense plan. It applies fixes the plan already decided. The User Input selects one of three modes:
.lagune/tracking.json), which records the paths each fix points at. Leave the rest of the plan untouched.High, or High and Medium): apply only the fixes the plan gave any of those priorities. The pass covers those priority bands, not the whole plan.If the input is ambiguous, prefer the most literal reading (an existing path is a path, a known fix name is a fix), and state which mode you chose before continuing.
.lagune/memory/plan.md. This is the required primary input.
/lagune-plan first. There is nothing to apply without it. Do not invent fixes to work around a missing plan.Depends on it carries, and the finding it points at is what you apply. Apply only fixes that are really in the plan./lagune-plan on that scope first, then run the harden phase again. Do not apply a change the plan did not call for..lagune/memory/harden.md.
template.md, next to this file, first, and identify every placeholder token of the form [ALL_CAPS_IDENTIFIER].Verdict and Reason that verify wrote: a ❌ Reproved or ❓ Inconclusive verdict means verify judged the control did not close the risk, and its Reason is what you re-apply against..lagune/memory/charter.md for the governing principles, if it exists. The principles still bind here: never apply a fix in a way that breaks one. If the charter does not exist, apply the fixes from the plan alone..lagune/memory/detect.md names them as the catalog lists them. Read each one by calling lagune_read with command set to catalog and arguments set to ["<name>"], not just the list: each carries the defense knowledge for its class of finding (uploads, shell, network, and so on), which Step 4 uses to apply the matching fix. If a listed specialization no longer resolves, note it and apply the fix from the plan and charter alone.This record is reconciled, never append-only. If the record was empty or freshly initialized, skip this step. Otherwise, before applying anything new, re-check each existing applied block against the current code:
Verdict: ❌ Reproved is reopened work, and the verdict overrides your own reading. Even when it reads Applied and the control looks present, verify proved the risk still open: read its Reason and re-apply in Step 4 to close that gap. A ❓ Inconclusive is weaker: re-apply only when its Reason names a real gap.A finding the plan carries but no block here names was stood down out of the chain: expected, and no reason to run repair.
If reconciling reveals the chain is inconsistent (for example the tracking map points a control at a file that was renamed or moved, so the path on record no longer exists), run /lagune-repair and then continue. Repair fixes Lagune's internal tracking across every phase at once, so the chain stays coherent. Do not try to repair the tracking yourself: this phase reconciles its own record in prose, repair owns the tracking.
This is the one place Lagune changes the user's code. Do not ask for a confirmation of your own before you start: whether an edit needs the user's approval belongs to the agent and the permission mode it runs under, not to Lagune. Apply the planned fixes carefully:
Depends on, apply the fix it depends on before it, even when that one's priority is lower. Among the fixes free to apply, follow priority order (Critical, then High, then Medium, then Low). Apply each fix on its own so each change stays small, reviewable, and easy to undo.Partial with what is left, or Blocked with the reason, and leave the plan fix open. Do not force a change you are unsure of.Verdict no longer reflects the code, so set it back to Pending and remove the Reason. Pending is the only Verdict you ever write: judging the control is verify's job.Scope to reflect the mode you ran: all fixes, the named fixes or paths, or the chosen priorities.Applied, Partial, or Blocked.
Pending on any block you write or re-apply (see Step 4).Pending block.Applied.Hardened to today's date in ISO format YYYY-MM-DD.Status is one of Applied, Partial, or Blocked, and every Partial or Blocked fix has a matching entry under Remaining.Verdict: Pending with no Reason, and you wrote no other verdict value.Scope line matches the mode you actually ran.YYYY-MM-DD..lagune/memory/harden.md, re-reading it first to keep any change made since you loaded it.entries list of {name, paths}, named by the finding's name (your section title, the same name the plan used). The hook finds that same item by name and updates its paths. It does not create a second entry: one finding is one item. name is the finding's name, and paths holds the file paths the change landed in. The path lives here, in tracking, never in the prose. Call lagune_write with command set to track and this payload as the single item of arguments:{ "entries": [{ "name": "<FINDING NAME>", "paths": ["<PATH>"] }] }
Do not edit .lagune/tracking.json yourself, and do not reconcile here. Track only advances what this phase hardened. Repairing the map across the conveyor stays with /lagune-repair.
Call lagune_read with command set to validate and arguments set to ["harden"]. If it reports problems, follow its output and rerun it until it passes.
Output a short summary to the user:
fix: apply security hardening from the defense plan./lagune-verify, the phase that proves each applied control actually holds. Make clear the applied controls are not yet proven until verify confirms them. Frame it as the recommended next step. If anything is left under Remaining (a Blocked fix, or a part the plan did not cover), name what is still open so the user can decide whether to revisit /lagune-plan or rerun /lagune-harden before verifying.Keep the record in plain language throughout. A non-developer should understand what was changed and what is still open, while the Where note stays precise enough that, with the path from the tracking map, /lagune-verify can act on it.
Run every lagune <subcommand> call from the project root through the lagune_read and lagune_write MCP tools and, only if those tools are not available, run it in the shell as npx --yes [email protected] read <command> <arguments> and npx --yes [email protected] write <command> <arguments> as a fallback.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
defense-plan, hardening, fix-application, security-remediation
npx skills add wellwelwel/lagune --skill '*' --agent claude-code -y9 skills in this plugin
/laguneUse this skill whenever you are about to build or change code. It builds safe-by-default from the project's charter and the defensive security knowledge the work touches, then checks the result./lagune-charterEstablish 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./lagune-detectDetect what the system actually does by reading the code, and map the security-relevant findings (login, uploads, payments, data exposure, and so on) with the evidence later phases need. Scans the whole project, named files, or a focused scope./lagune-planTurn what detect found into the defense plan, one fix per finding, each rated by CVSS v4.0 (category, CVSS, priority) and tied to a charter principle. Reads the detect map and the charter, then plans every finding, named paths, or a concern you describe./lagune-proveProve detected findings with runnable, defense-only evidence. For each finding the detect map carries, it writes a safe-path JavaScript test and a self-contained advisory under `.lagune/proofs/`. The test asserts secure behavior, never an exploit./lagune-repairRepair 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.Other plugins' skills for the same job