/lagune:lagune-plan Optionally name files/dirs or a concern, or leave empty to plan every findingfrom lagune
Creates a prioritized defense plan from detect findings, rating each fix by CVSS v4.0 and linking to charter principles. Supports planning all findings, specific paths, or a described concern.
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 producing a defense plan at .lagune/memory/plan.md: a prioritized set of fixes for what detect found, each one pointing at a detect finding, rated with a category and a CVSS v4.0 score, paired with the charter principle it upholds, and the control to apply. This phase continues from detect. Detect already detected what the system does and recorded the risk each thing carries, so the plan does not restate the risk: it rates how serious it is and decides what to do about it. Every fix must point at something detect actually detected, never a generic checklist. The fixes are the WHAT to do. Applying them is the next phase, harden, not this one.
The detect map is the primary input: the fixes follow from what detect found. The charter is the governing context: it tells you which fixes matter most for this project, gives each fix a principle to uphold, and supplies the exposure and stakes that adjust each rating. The rating follows the CVSS v4.0 Base-and-Environmental method, scored by the cvss hook, so a finding earns a realistic, reproducible band with a named category, reasoned from the detect map and the charter alone.
This phase is built entirely on the detect map. It never reads the code directly: it only knows the system through what detect already detected. Every fix it plans must point at a finding that is really in the detect map. The User Input selects one of three modes, and each one is answered from the detect map, never from the code:
.lagune/tracking.json), which records each finding's paths, do not open the files yourself. Leave the rest of the plan untouched.If the input is ambiguous between a path and a described concern, prefer the most literal reading (an existing path is a path), and state which mode you chose before continuing.
When the scope points somewhere detect has not mapped, follow the coverage rules in Step 2 rather than reading the code to fill the gap.
.lagune/memory/detect.md. This is the required primary input.
/lagune-detect first. The defense plan is built from detected findings, so there is nothing to plan without it. Do not invent findings to work around a missing detect map./lagune-detect on that scope first, then run the plan phase again. Do not read the code to fill the gap..lagune/memory/plan.md.
template.md, next to this file, first, and identify every placeholder token of the form [ALL_CAPS_IDENTIFIER]..lagune/memory/charter.md for the governing principles, if it exists. Use it to judge which fixes matter most for this project, to give each fix the principle it upholds, and to supply the stakes side of the Environmental adjustment. The charter guides priority, it does not box you in: plan a real fix even if no principle names it, and let the user rescope. If the charter does not exist, plan the fixes from the findings alone and set each Upholds to None directly. The rating still stands: rate each finding on its CVSS Base score with only the exposure detect gives, since the charter's absence removes the stakes input to the Environmental adjustment, not the rating itself.This plan is reconciled, never append-only. If the plan was empty or freshly initialized, skip this step. Otherwise, before planning anything new, re-check each existing fix against the current detect map:
Depends on.A fix whose finding verify already proved closed was stood down out of the whole chain, so it is simply absent here. That absence is expected, not a broken chain, and is no reason to run repair.
If reconciling reveals the chain is inconsistent (for example the tracking map points a finding 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 plan in prose, repair owns the tracking.
For each in-scope detect finding, read the risk detect already recorded for it (do not restate that risk in the plan), then rate it and decide the fix that answers it. Reason the rating from the detect finding and the charter alone, and when a fact it needs is in neither, name the assumption rather than open the source. For each finding you plan:
template.md: build the CVSS:4.0 vector from what detect and the charter recorded, score it with the cvss hook, write it on CVSS followed by the score and band printed, and set Priority to that band, not a free choice.None directly and keep the fix.Depends on line only when this fix cannot hold until another finding's fix lands first, for example validating an input before encoding its output. Name that other finding verbatim, and omit the line otherwise. It sets the order to apply in, not the priority: the depended-on fix is applied first even when its priority is lower.[label](url) markdown (not bare URLs), comma-separated. Omit them when there is nothing to cite beyond the class named, and never invent one.Run the cvss hook: call lagune_read with command set to cvss and arguments set to ["--vector", "<VECTOR>", "--vector", "<VECTOR>"], a --vector before each vector.
One finding is one item, with one rating. When a finding needs more than one fix, write them as more than one paragraph under the block's Fix, never a second block. Plan what the findings support, nothing speculative.
Scope to reflect the mode you ran: all findings, the named files or directories, or the described concern.Critical, High, Medium, or Low: the band the cvss hook printed, not a free choice.None directly and keep the fix.[label](url) markdown, comma-separated. Omit when there is nothing to cite beyond the class named, and never invent one.Planned to today's date in ISO format YYYY-MM-DD.CVSS carries the score and band the cvss hook printed for its vector, its Priority is that band, and the vector carries no Threat metric.Why this priority line that gives the Environmental metrics (exposure and stakes) in plain words and does not restate the risk.Priority is one of Critical, High, Medium, or Low.References, where present, cites a real CWE or OWASP source, none invented.Depends on, where present, names a finding that really exists in this plan or the detect map.Scope line matches the mode you actually ran.YYYY-MM-DD..lagune/memory/plan.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 detect 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 fix touches. 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 planned. Repairing the map across the conveyor stays with /lagune-repair.
Call lagune_read with command set to validate and arguments set to ["plan"]. If it reports problems, follow its output and rerun it until it passes.
Output a short summary to the user:
docs: update defense plan./lagune-harden, the phase that applies these fixes to the code, safely and one at a time, highest priority first. Frame it as the recommended next step. If anything is left under Open questions, point them instead to /lagune-detect on that uncovered scope first, so the plan can cover it before harden runs.Keep the plan in plain language throughout. A non-developer should understand what each fix does and why it is prioritized: the CVSS vector and category are the precise, reproducible anchor, and the Priority band with its Why this priority line is that rating in words anyone can follow. The finding name in each title stays precise enough for harden to act on.
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
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-hardenApply the defense plan's fixes to the code, safely and one at a time, then record what was applied and what is left. Reads the plan and the charter, then hardens every fix, the fixes, files, or directories you name, or a priority you choose./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