/ai_dev:guardrailfrom ai_dev
Hub for repo-root guardrail documents (CHARTER.md, ARCHITECTURE.md, TESTING.md, SECURITY.md) that anchor AI agents to human intent. Explains the doc set, authority hierarchy, shared format, and how skills consult them. Suggests which guardrails fit a repo and drafts one on request.
Ships in ai_dev. 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.
<guardrail_skill>
The guardrail skill is the hub and source of truth of the `guardrail_*` family: it defines what guardrail documents are, which ones can exist, how they rank, what shape they share, and how other skills consume them. A guardrail document is a standing, human-owned markdown file at the project root that carries one domain of durable project truth an AI agent must respect or consult while working. Guardrail docs exist because unattended agents drift: a task to do X quietly becomes Y, and Y becomes Z, with no human in the loop. The guardrail layer is the human's standing voice at the moment of work: direction the agent reads and respects in every session, long after the conversation that set the direction is gone. Humans set direction through these docs; agents execute within the boundaries the docs declare and surface every conflict they meet. A guardrail bounds work; it never freezes it: the project adapts, grows, and is deliberately steered within its declared boundaries, and the docs themselves evolve with the project through their human-owned change path.A guardrail doc carries rules, and a rule holds whether or not the code satisfies it yet. The doc states what must be true of this project, written as a general rule rather than a report on the current tree. Code that falls short of a rule is unmet work, never evidence that the rule is wrong, and softening a rule to match the code is the move the doc exists to prevent: the misreading an agent that treats a doc as a description of the present will make the moment the code disagrees with it. A rule becomes true along three paths: work filed and done to close the gap deliberately; new code written to the rule from the start; and touch-it-and-fix-it, existing code brought to the rule whenever ordinary work touches or rewrites it. The third path carries most of the distance, which is why a rule needs no migration plan attached to be worth stating.
The system is universal. It serves a single software system, a knowledge or content repository, a meta-repository whose product is components or documents, and a mixed multi-project layout alike, in any language and any stack. This skill carries only the general knowledge, the what and the how that hold everywhere; every actual guardrail doc is tailored to its repository, and a doc type that fits one repo nature can be a bad fit for another.
<when_to_activate> Activate this skill when the user:
CHARTER.md, ARCHITECTURE.md, TESTING.md, SECURITY.md, or a guardrail layer as a whole.CLAUDE.md / AGENTS.md / GEMINI.md and equivalents).Route to guardrail_audit when the user wants the repo's existing guardrail docs audited for contradictions and doc-vs-code divergence. Route to the task family for backlog work; the task skills consume guardrail docs but are not the place that defines them.
</when_to_activate>
<doc_set>
Four core guardrail types are recognized. Each has a bundled reference (sibling of this SKILL.md) carrying its general template, its universally valid rules, and its tailoring guidance. Read the reference before explaining, suggesting, drafting, or assessing a doc of that type:
CHARTER.md is the falsifiable project-identity contract: core purpose, DOES / DOES NOT domain boundaries, key invariants, intentional constraints. The one doc that stops work rather than informing it. Reference: references/charter.md.ARCHITECTURE.md is the descriptive account of how the project is structured and where its structure is deliberately headed: goals, stack, components and their responsibilities, load-bearing design decisions, declared direction. Reference: references/architecture.md.TESTING.md is the project's verification methodology: what counts as tested, the discipline verification follows, and how the suite runs. Reference: references/testing.md.SECURITY.md states the security constraints that must hold: secrets, trust boundaries, data handling, dependencies, attack surface. Reference: references/security.md.The set is open on two sides. Sideways, a repository may carry further domain guardrails as peers, following the same format contract and consumption convention; FEATURES.md as a behaviour ledger is an established example. Below, the harness rule files (CLAUDE.md / AGENTS.md / GEMINI.md and equivalents) are the project's standing-instruction baseline: they are owned by the harness convention rather than created through this family, and they enter the guardrail system only through the hierarchy, where they rank at the bottom. Whether a rule file loads is the harness's own behaviour and varies by product through activation mode, glob match, or manual mention, so this family rests on none of it: every guardrail doc reaches a workflow because a consuming skill looked it up at the stage that needed it, per <consumption>.
This family supplies the mechanism and never the content. Each doc carries the direction its own repository chose; a repository may adopt none of these docs and guard its work another way. </doc_set>
Guardrail docs rank on one authority rule: **statements of what the project is outrank statements of how it is built and verified, which outrank instructions for how the agent operates.**CHARTER.md. The falsifiable boundary every other doc and every piece of work stays inside. A conflict between the charter and anything softer resolves in the charter's favor and is reported for human review; a softer doc never overrides the charter and never supplies the authority for work the charter would not bless.ARCHITECTURE.md, TESTING.md, SECURITY.md, and peers such as FEATURES.md: design-and-verification statements about the project.Orthogonal to authority runs the enforcement spectrum, how strongly each doc guards:
guardrail/charter-*), so an agent can never rewrite the contract to license its own drift.TESTING.md and SECURITY.md: consulted whenever work enters their domain; a divergence between the work and the doc is a finding the agent surfaces before claiming done, reported for the user to weigh and never silently passed, while the doc itself never halts the run.ARCHITECTURE.md and FEATURES.md: they inform work and are refreshed as the project evolves; their guard value is truthfulness. That measure applies to present-tense description: a passage saying what stands that no longer matches the project, or that presents intention as fact, misleads every future agent. Two neighbouring kinds of claim are measured differently. A guarding statement states what must hold, so code that has not yet met it is unmet work rather than a descriptive falsehood. A declared target belongs to the register below, so an unreached target is read there as drive-toward work rather than here as a stale description.## Direction section of ARCHITECTURE.md: a target shape the project is deliberately steered toward. The target holds as a standing commitment whether or not the code has reached it, so code short of the target is unmet work the next change drives toward, exactly as a guarding rule's shortfall is unmet work, and never a truthfulness defect that softening or deleting the target would repair. A target differs from a rule in what it asks: a rule states what must hold of every change, while a target names where the design is headed, so the section carries the target itself and no ledger of how much of it has shipped.The hierarchy names the default authority direction; a human makes the actual call. Only the charter's hard fence stops work on its own. Every other conflict is surfaced with the authoritative doc named and the resolution left to the user.
<format_contract> Every guardrail doc, of every type, honours the same format contract:
UPPERCASE.md, one domain per doc. Project-wide standing material lives at the repository root as an UPPERCASE.md file; work-system material (for example the task backlog) lives in its own tree. The filename is the interface: consumers discover a doc by its presence, so no registry, index, or manifest is needed.The touchpoint rule (read-side): a workflow consults the doc whose domain its work enters, at the moment it enters it. Work about to write project content validates against CHARTER.md and stops on a violation. Work that writes or audits tests reads TESTING.md first. Work that touches a surface SECURITY.md names checks the change against the constraints that must hold. Work that needs design context reads ARCHITECTURE.md; work that ships behaviour refreshes the descriptive docs it invalidated. The task-management family is the established consuming instance: task creation reads FEATURES.md and ARCHITECTURE.md for prior art, the readiness gate and every autonomous writer validate against CHARTER.md, implementation and audit read TESTING.md, and close-out refreshes ARCHITECTURE.md when finished work extended the design.
The placement rule (write-side): a rule is stated once, in the doc that owns its general form, and a narrower doc carries what the rule means for its own surface. A rule discovered while working on one surface tends to get written into that surface's doc, which leaves every other surface it governs unguided. State the general form in the owning doc; let the narrower doc reference rather than restate; keep a rule that is not project identity out of the charter per the <hierarchy> authority rule.
Five guard behaviours hold at every touchpoint:
<hierarchy>); the human reconciles. On a guarding statement, name the code as the side to move and offer no softening of the rule, because code short of a rule is unmet work. On a declared direction target the code has not reached, report drive-toward work: name how the code moves toward the target, or how the target itself is revised deliberately, and offer no bringing the doc back to the repository to soften or delete the target. Keep both reconcile directions only for a present-tense descriptive conflict, where bringing the doc back to the repository is a legitimate fix.CHARTER.md, switch to a guardrail/charter-* branch: where the protect hook is deployed the edit is blocked anywhere else, and where it is not, the branch still preserves the human-review path the charter contract expects.[UNDERSPECIFIED] and ask one focused round of questions per doc rather than guessing. A doc is useful and consistent before it is complete.[UNDERSPECIFIED] marker, and every surfaced divergence. The user reviews and commits; consumers pick the doc up by presence, so no wiring or registration step exists.
<output_contract>
A suggest run reports: the repo nature read in <orient>, the inventory of existing docs, each suggested doc with its grounding evidence and what it would capture, each type left out with the reason, and a closing question asking which the user wants, with no file created. A create run reports each drafted doc with its open markers and surfaced divergences, and leaves review and commit to the user. An explain run answers in compact prose and names the reference it drew from.
</output_contract>
guardrail, the hub: explain, assess, suggest, and draft on request (this skill)guardrail_audit, read-only audit of a repo's existing guardrail docs: doc-vs-doc contradictions, doc-vs-code divergence, and grounded missing-doc proposals, ranked by the hierarchyThese ship together; a sibling may be absent if a deployment excluded it. The family is a sibling of the task family, not a member: task skills consume guardrail docs through <consumption>, while defining and maintaining the docs belongs here.
</guardrail_skill>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub theafh/ai-modules --plugin ai_dev27 skills in this plugin
/agent_spinnerRun helper agents from an orchestrating agent under one quality contract, whatever the host offers. Establishes the capability tier, declares a phase plan, picks an orchestration shape and width, contains each helper to one path, checks work refute-by-default, and merges cited findings into one verdict-first report. Use when deciding how to run helper agents, sub-agents, or subagents: sizing a fan-out over files, spawning parallel helpers, splitting a review into lenses, running a judge or verifier pass, cross-checking agents' work, containing concurrent writers, aggregating helper reports, recovering failed helpers, or running a serial implement-then-audit loop until the task is stamped audited, in sub-agents. Use it for a multi-agent run plan. Route a backlog-only request to task_* and a wiki request to wiki_fix unless the user names agent_spinner or asks for helpers; those families keep their own contracts. Per-harness facts stay with harness_portability.
/ai_instruction_formattingOrganize AI-consumed content (prompts, rules, skills, commands, agents, system instructions) into pseudo-XML by wrapping each semantic concern in a dedicated tag for role, policy, inputs, and output contract. Use when structuring or reorganizing the body of a SKILL.md, agent or sub-agent definition, command file, rules document (.mdc), CLAUDE.md, AGENTS.md, or GEMINI.md configuration, prompt template, or system prompt into semantic tags, when choosing tag boundaries, or when checking whether an instruction file follows the pseudo-XML convention. This is the structure-and-tags skill; its sibling ai_instruction_writing governs the wording./ai_instruction_writingWrite AI-consumed content using positive, action-oriented language as the primary carrier of every instruction. Use when creating or editing any artifact an AI reads at inference time. Those artifacts include SKILL.md files, .mdc rule files, CLAUDE.md/AGENTS.md/GEMINI.md configuration, prompt templates, system prompts, commands, agent and sub-agent definitions, instruction sets, and persona definitions./format_markdownApply markdown linting compliance and best practices when creating or editing markdown files (.md, .mdc). Covers blank-line rules around block elements, consistent bullet style, fenced code blocks with language identifiers, table alignment syntax, header level progression, list indentation and spacing, and link/image conventions./format_pythonApply formatting standards, code quality rules, structure conventions, linting prevention, and best practices when generating or editing Python code (.py). Covers indentation, quoting, imports, naming, line length, type hints, error handling, logging, data structures, testing, and security practices aligned with common linters (flake8, ruff, pylint)./format_rustApply clippy-aligned Rust practices when writing or editing Rust code (.rs). Covers procedural flow, clippy-driven clarity improvements, minimal imports, Result/Option idioms, the error-versus-invariant model with panic discipline and clippy unwrap_used enforcement, fallible builders following the error idiom by consumer, string prefix/suffix handling, borrowing clarity, iteration style, string building, and function signature grouping.Other plugins' skills for the same job