/lagune:lagune-charter Optionally describe your project, or leave empty to let Lagune proposefrom lagune
Creates or updates a project's security charter with safe-by-default principles. Reads project files to infer purpose and stack, then generates a tailored charter template.
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 creating or updating the project's security charter at .lagune/memory/charter.md: the set of safe-by-default principles that every later phase (detect, plan, harden, verify) must respect. This file is a TEMPLATE of placeholder tokens in square brackets (for example [PROJECT_NAME], [PRINCIPLE_1_NAME]). Fill it with concrete values and write it back.
This phase reads the project to decide which principles it needs, never to map what the code does with evidence. That mapping is the detect phase. The boundary is purpose, not depth: even when you read code here, you read it to derive a rule, not to record a finding.
Load the charter at .lagune/memory/charter.md. If it does not exist, initialize it from template.md, next to this file, first, and identify every placeholder token of the form [ALL_CAPS_IDENTIFIER].
The User Input selects one of two modes. The mode sets where the direction comes from, not how deep the reading goes (Step 2 governs that):
Read in escalating tiers, stopping as soon as the project's purpose and stack are clear:
Either tier reads to decide which principles the project needs, never to record findings or code locations. A payment dependency means payments are in scope and a principle is owed, without mapping where the payment code lives.
The description and the project are two sources that add up, not two claims to judge between. The description carries the user's intent, and Step 2's reading reveals what else the project holds beyond what they named. Both feed the charter. Charter records the policy the project should hold to, never the state of its code, so it does not rule on whether a described feature is built yet.
Work out what each source implies for security, including the parts no one named. A tool that remembers things between runs implies stored data. Users who see only their own data imply login or access control. Anything that takes input from outside implies untrusted input to validate, and anything that handles money or personal details implies sensitive data. Derive principles from those implications, not only from what was said literally.
After reading, ask only when a gap actually changes the charter: you still cannot tell what the project fundamentally is or does, the description and the project point at genuinely different systems and you cannot tell which principles apply, or a security-deciding fact is absent (whether there are users, whether money is handled, where data lives). Asking and the deeper read of Step 2 are complements, not alternatives: a bare project may need both. Do not ask to offload work you can resolve by reading, and phrase every question in plain language a non-developer understands.
This charter is reconciled, never append-only. If it was empty or freshly initialized, skip this step. Otherwise re-check each existing principle against what Steps 2 to 4 now show:
Why: line to match.This reconcile is for the project's own principles under ## Principles. The ## Baseline discipline section is universal, not a project principle: keep it verbatim, and if an existing charter predates it, add it from the template.
The charter has no tracking map and is not part of the finding chain, so reconcile it here in prose only. Do not run repair and do not touch .lagune/tracking.json.
Why: line that states the risk it prevents. Explain the risk, not just the fix.## Baseline discipline section carries no placeholders, so fill nothing into it. It does not affect the version, which tracks only the project principles and Governance.Version to 1.0.0. For an update, increment it: MAJOR for removing or redefining a principle, MINOR for adding a principle or materially expanding one, PATCH for wording and clarity fixes.Ratified to today's date in ISO format YYYY-MM-DD. Keep the original ratification date on later updates.Validate before writing:
Why: line.YYYY-MM-DD and the version line is present.## Baseline discipline section is present and verbatim, with its three blocks intact: only the controls the project needs, prefer the simplest vetted control, and when a control seems skippable.Always validate all input before use is a principle. The config value is read without validation is a finding, so drop it or rewrite it as a rule. Likewise, Always validate data against its schema before persisting it is a principle, while Unstructured data is written straight to the database is a finding.Then write the completed charter to .lagune/memory/charter.md.
Call lagune_read with command set to validate and arguments set to ["charter"]. If it reports problems, follow its output and rerun it until it passes.
Specializations, the security knowledge the later phases load on demand, join the project's catalog by category. List every category, with whether the project uses it: call lagune_read with command set to list and arguments set to ["--categories"].
No category is recorded yet (the listing says so): record, in one call, each category the listing describes that your reading in Step 2 supports, such as the project's language, calls to an LLM, or containers. Record only what the reading supports, never a category for completeness: call lagune_write with command set to add and arguments set to ["--categories", "<category>", "<category>"].
Categories are already recorded: leave them as they are, since they are the project's choice. Name in the summary each category your reading supports that the project does not use yet.
List by number, from the project root, committeds folders your reading in Step 2 shows are not code the project ships or runs, such as test, fixtures, and docs that neither Git nor the checkers block of .lagune/configs.json already leaves out. Ask the user to reply with the numbers of any to leave out, without waiting for an answer.
Never choose for the user, since a hostile repository can make its own code look like fixtures. Record only the numbers the user gives, in one call: call lagune_write with command set to add and arguments set to ["--ignore", "<path>", "<path>"]. Anything else records nothing and ends the offer.
Output a short summary:
The principles now in the charter, each with its one-line risk.
The version and, for an update, why it changed and what reconciled (kept, rewritten, removed).
The categories this run recorded, or each category the reading supports that the project does not use yet.
Anything you had to assume, or any question still open.
A suggested commit message, for example docs: establish security charter v1.0.0.
Unless the instructions file the project keeps for its agent, such as AGENTS.md or CLAUDE.md, already carries it, suggest adding this line to it as one of its first instructions:
- Whenever you build or change code, use the `/lagune` skill ([**lagune.ai**](https://lagune.ai/llms.txt)), named `/lagune:lagune` when installed as a plugin, to improve safety by default.
Next step: point the user to /lagune-detect, the phase that reads the code to map what the system actually does, so the later phases work from real context, or to /lagune <prompt> for real-time development. Note they can rerun /lagune-charter any time the principles need to change.
Last, the offer from Step 10, when it found any folder.
Keep the charter in plain language throughout. A non-developer should be able to read it and understand both the rule and the risk it prevents.
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
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-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-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