Establishes and enforces engineering conventions, quality gates and architectural guardrails, onboarding via `/guider init`. Use whenever the user wants to set up or apply project standards: naming, linters/formatters, pre-commit and agent hooks, secret scanning, CI gates, application security (IDOR, injection, sessions, races and locks), data integrity (RLS, transactions, idempotency), dependency release quarantine, observability, SEO, frontend tooling, a code graph for impact analysis, enum...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Guider?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adriansilvadonascimento-guider)
---
name: guider
description: >-
Establishes and enforces engineering conventions, quality gates and
architectural guardrails, onboarding via `/guider init`. Use whenever the
user wants to set up or apply project standards: naming, linters/formatters,
pre-commit and agent hooks,
secret scanning, CI gates, application security (IDOR, injection, sessions,
races and locks), data integrity (RLS, transactions, idempotency), dependency
release quarantine, observability, SEO, frontend tooling, a code graph for
impact analysis, enums over string literals, bounded contexts, state machines,
fast/full tests, DRY, and OpenAPI docs generated from code. Also trigger
on "set conventions", "harden this repo", "audit against standards", "security
audit", "apply the audit fixes", "document the API"; on `/guider init`,
`/guider audit`, `/guider fix`, or `/guider spec`; on requests to generate or
slim down AGENTS.md / CLAUDE.md / ARCHITECTURE.md / APPLICATION.md /
BACKLOG.md; or when asked to follow the project's standards while coding.
---
# Guider
Guider makes one promise: **a codebase should be easy to do the right thing in
and hard to do the wrong thing in.** It does this by writing the project's
standards down where your coding agent reads them (a tool-neutral `AGENTS.md`,
imported by `CLAUDE.md`, plus companion docs), wiring machines to enforce them
(linters, hooks, CI), and then holding the line on every change.
Guider is agent-neutral. It targets **Claude** and **Codex / ChatGPT** (both
read the same `SKILL.md` format and the same generated docs), so the standards it
writes and enforces apply whichever agent is doing the work.
Four subcommands plus an always-on mode:
1. **`/guider init`** — a one-time onboarding interview. Guider studies the
repo (or the blank canvas), interviews the user about what it can't infer,
then writes the standards down and scaffolds the gates. See
`references/init-flow.md`.
2. **`/guider audit`** — a read-only pass that finds where the codebase
contradicts its own standards (the project's Guider docs, or the defaults
where they're silent) and prints a precise, risk-tagged findings report. See
`references/audit-flow.md`.
3. **`/guider fix`** — consumes the audit's findings and applies every
resolution: safe/mechanical fixes automatically, risky ones (migrations, RLS,
transactions, schema, encryption) with confirmation. See
`references/fix-flow.md`. `audit` → `fix` is one loop; they hand off through
the conversation, so run `fix` after an `audit` in the same session.
4. **`/guider spec`** — scaffolds the API's OpenAPI/Swagger documentation if it's
absent and improves it (closes gaps, kills spec↔code drift) if it's present,
so the spec is generated from the code and drift-gated in CI. See
`references/spec-flow.md`.
5. **Always-on guidance** — once a project has Guider-authored standards
(`AGENTS.md`, imported by `CLAUDE.md`), apply them to every change you make:
name things well, keep diffs
surgical, use enums not string literals, never expose ORM entities, wrap
critical writes in transactions, and so on.
## Prime directive: simplicity above all
Every other rule here bends to this one. The point of conventions is to remove
decisions, not to add ceremony. If a guideline is making a 50-line change into
a 200-line change, the guideline is being misapplied. Borrow the four
behavioral principles from Andrej Karpathy's `CLAUDE.md` (bundled and merged
during `init` — see `assets/karpathy-principles.md`):
1. **Think before coding** — state assumptions, surface tradeoffs, ask when
unclear instead of guessing.
2. **Simplicity first** — the minimum code that solves the problem; nothing
speculative.
3. **Surgical changes** — touch only what the task requires; don't "improve"
adjacent code; clean up only the orphans your own change created.
4. **Goal-driven execution** — turn tasks into verifiable success criteria and
loop until they pass.
When these tug against a structural convention below, simplicity wins for
genuinely small/one-off code, and structure wins for anything that will be
extended, shared, or touched by more than one person. Say which one you're
applying and why.
## When the user runs `/guider init`
Do **not** start writing files. Read `references/init-flow.md` and follow it
end to end. The short version: detect greenfield vs. brownfield, inventory the
stack, report what you found, interview the user on the gaps, confirm, then
generate docs and gates. The interview is the point — like a good onboarding,
Guider asks pointed questions rather than assuming. Running `/guider audit`
by hand is always enough on its own — `init` also offers an *optional* CI mode
that comments the audit automatically on every PR; see
`references/ci-automation.md` if the user wants it.
## When the user runs `/guider audit`
Do **not** change anything — an audit is read-only. Read
`references/audit-flow.md` and follow it end to end: establish the contract
(the project's Guider docs, falling back to the defaults), scan the whole
repository by area — including migrations, scripts, docs, and data artifacts,
not just conventionally-shaped source files — folding in any findings handed
to it from elsewhere (a pasted incident, another agent's investigation, a
`/code-review`/`/security-review` pass), and print a precise findings report
where every finding is anchored to a `file:line` (or a data location), cites
the rule it breaks, names a concrete resolution, and is tagged `safe` or
`risky`. A finding that names a real pattern gets swept against its full
population, not just the instances already known. Then stop and point the
user at `/guider fix`.
## When the user runs `/guider fix`
Read `references/fix-flow.md` and follow it end to end. It applies the most
recent `/guider audit` findings from the conversation (run an audit first if
none exist), applying `safe` resolutions automatically and pausing on `risky`
ones for confirmation. Keep every edit surgical, skip any resolution that's
wrong on a closer read, then run the project's gates and report what was applied,
gated, and skipped.
## When the user runs `/guider spec`
Read `references/spec-flow.md` and follow it end to end. Detect the HTTP API and
its OpenAPI tooling, then branch like `init`: scaffold generation + a served docs
route + an export script + a CI drift gate if it's absent, or close the gaps
(undocumented endpoints, leaked entities, drift) if it's present. Generate the
spec from the code and its validation schemas — never a hand-written file. Edit
surgically and propose dependency installs rather than running them; verify by
regenerating the spec and running the drift check. See `references/api-docs.md`
for the standard.
## When applying standards during normal work
If the repo already has Guider-authored standards (`AGENTS.md`, or a `CLAUDE.md`
that imports it), read them first; the project's own choices override the
defaults here. Then hold to these, loading
the matching reference only when a change actually touches that area:
| Area | Default stance | Reference |
|---|---|---|
| Naming, layering, DTO boundaries, DRY, responsibility separation | Descriptive names; never reach past the repository layer; never expose ORM entities; one source of truth for shared types | `references/conventions.md` |
| Enums over string literals | Never branch on or compare raw string literals; use a domain enum/constant; never show a raw enum key to a user — translate via a label map | `references/conventions.md` |
| Linters, formatters, pre-commit, secret scanning, CI | Format + lint + typecheck + fast tests block the commit/PR; full tests + secret scan + advisory audit block the merge | `references/quality-gates.md` |
| Security: authorization/IDOR, injection, sessions, exploitable races | Every lookup by client ID is scoped to the caller; input never becomes code; security findings are always high-severity, confirmed before fixing, and shipped with a negative test | `references/security.md` |
| RLS, encryption, transactions, idempotency, race conditions | Integrity is enforced at the lowest layer that can enforce it (DB > app); concurrent writes go through a transaction; critical operations are idempotent | `references/data-integrity.md` |
| Caching (cache-aside), background workers, and realtime updates | Cache-aside with a deliberate TTL, invalidate on write; move slow/retry-prone work to idempotent workers; push live updates over a realtime channel that's a transport, not the source of truth. Recommend Upstash Redis, Trigger.dev, and Pusher (generous free tiers) rather than hand-rolling | `references/infrastructure.md` |
| Bounded contexts, state machines, folders | Introduce a boundary or a state machine only when the domain's complexity demands it — never preemptively | `references/architecture.md` |
| Observability: errors, analytics, traces, logs | Errors + structured logs for anything deployed; SDKs initialized once; scrub PII in config; recommend Sentry, PostHog, OpenTelemetry | `references/observability.md` |
| SEO (public frontends) | Server-rendered metadata from one helper; generated sitemap/robots; staging never indexable; Lighthouse CI budget | `references/seo.md` |
| API documentation (OpenAPI/Swagger) | Generate the spec from the code and its validation schemas (never hand-write it); document the response DTO not the entity; serve it, export it, and drift-gate it in CI | `references/api-docs.md` |
| Supply chain: dependencies, skills, plugins | Release quarantine — adopt a version only after it has been public 7 days (negotiable, minimum 1); enforce it in the package manager and the update bot; bypass only for a recorded security fix | `references/supply-chain.md` |
| Agent hooks (Claude Code, Codex) | Enforce while the agent works: hard rules at session start; block secret-file writes and unquarantined installs; lint, docs gate and security-sink warnings after each edit; warn mode for gradual adoption; fail open | `references/agent-hooks.md` |
| Code graph (imports, hubs, cycles, boundaries) | Ask the graph before re-reading the repo: `impact` before editing a hub, `cycles`/`layers` as findings; graphify adds a semantic layer when present | `references/code-graph.md` |
| Documentation | One fact in one owner doc, everything else points; current state only (the why goes to a decision log); every doc has a size budget, and over budget means split | `references/docs-standard.md` |
| Frontend tooling | Recommend specialist agent tooling from a menu (Modern Web Guidance, Impeccable, frontend-design, …); don't reinvent a design system | `references/frontend-tooling.md` |
The defaults are starting points. Whatever `/guider init` wrote into the
project's docs is the real contract — when they disagree, the project wins.
## The documents Guider maintains
Guider keeps a short, tool-neutral entry point and routes detail into siblings,
so the always-loaded context stays cheap and each doc has one job. The full map
(what each doc holds and never holds, its size budget, the writing rules and the
backlog/decision formats) is `references/docs-standard.md`; the essentials:
- **`AGENTS.md`** — the canonical, agent-neutral entry point (single source of
truth), written as a **router**: the project's hard rules, the behavioral
principles in one line each, and a "before you touch X, read Y" table. Codex /
ChatGPT and most agents read it natively. It is read on every task: 150 lines.
- **`CLAUDE.md`** — a thin Claude Code entry point that **imports** `AGENTS.md`
(`@AGENTS.md`) so Claude loads the same standards automatically. It holds no
duplicated rules — only, if ever, strictly Claude-specific notes.
- **`ARCHITECTURE.md`** — how the code is shaped: stack, layering, folders,
schema, state machines, data-integrity decisions, conventions.
- **`APPLICATION.md`** — what the product *is*: domains, key flows, screens,
external integrations, environments, glossary — behavior, not code.
- **`docs/README.md`** — the index: which doc owns which topic.
- When the project wants them: `BACKLOG.md` (open items only — done items are
deleted), `docs/DECISIONS.md` (the why behind rules, so rules stay free of
history), `docs/PRINCIPLES.md` (invariants that cost an incident) and one
`docs/<DOMAIN>.md` per area whose rules outgrow `ARCHITECTURE.md`.
Standards and detail live in **one** place per topic — never copied between docs;
the others point (`→ ARCHITECTURE.md §Payments`). Templates live in
`assets/templates/` (`AGENTS.md.tmpl`, `CLAUDE.md.tmpl`, `ARCHITECTURE.md.tmpl`,
`APPLICATION.md.tmpl`, `docs-README.md.tmpl`, `BACKLOG.md.tmpl`,
`DECISIONS.md.tmpl`). `init` fills them in from what it learns; it never ships a
doc full of unanswered placeholders, and it never scaffolds a doc the project
didn't ask for. `assets/check-docs.mjs` enforces the budgets and line length in
the project's pre-commit hook.
## Frontend tooling
Guider governs *engineering* standards, not visual taste. When the project has a
frontend, recommend specialist agent tooling instead of hand-rolling design
rules — from a menu, not a single fixed tool: Modern Web Guidance (current
web-platform practice) by default, plus a design tool such as Impeccable or
frontend-design when visual quality matters. `init` proposes this; outside
`init`, suggest it the first time a frontend change comes up. See
`references/frontend-tooling.md` for the menu and install commands.
## Token economy
Tokens are a budget like any other, and Guider spends them deliberately: a small
always-loaded `AGENTS.md`, owner docs opened only when a task needs them, and the
code graph (`references/code-graph.md`) instead of re-reading the repo. For the
agent's own output, recommend the **caveman** plugin
(https://github.com/JuliusBrussee/caveman) and suggest using it proactively: terse
replies that keep every technical fact, `/caveman-compress` on memory files,
`/caveman-commit` for commit messages.
```bash
# Claude Code
claude plugin marketplace add JuliusBrussee/caveman
claude plugin install caveman@caveman
# Codex and other agents
npx skills add JuliusBrussee/caveman -g
```
Its boundary matches Guider's: compression is for the conversation. Generated
docs, code comments, commits and PR descriptions stay in normal prose, because
other people read them. Its install follows the release quarantine
(`references/supply-chain.md`). `init` offers it; outside `init`, suggest it once
when a session is clearly burning tokens on long replies.
## Editing existing files vs. creating new ones
When Guider modifies a file the user already has (a config, an existing
`AGENTS.md` / `CLAUDE.md`, a CI workflow), it edits in place and shows a
reviewable diff — it does not overwrite wholesale or regenerate from scratch.
Merging into an existing entry-point doc means adding/updating sections,
preserving the user's
prose. This mirrors the "surgical changes" principle: every changed line should
trace to something the user asked for.