Claude Code
The slash commands, skills, rules and hooks in .claude/ that guide Claude Code.
On this page
- Slash commands start a workflow:
/start,/init,/tour,/foundations,/import-tokens,/roast-foundations,/kits,/add,/check,/explain,/sync,/swap. They live in.claude/commands/. - Skills hold the procedure for one kind of task, in
.claude/skills/<skill>/. - Briefs are role descriptions for subagents, inside their skill in
.claude/skills/<skill>/agents/. There is no.claude/agents/. - Rules in
.claude/rules/state what must always hold, such as spec-is-source, planning-gate and test-first. Task-specific rules load bypaths:. - Hooks in
.claude/settings.jsonrun scripts on events. Two guards block Claude's edits to generated outputs and to accepted decision records. The hammock hooks inject the decision ladder once per session, track the mode, and audit component edits; they advise and never block an edit (see Hooks and modes). Each hook is TypeScript compiled to.mjsand runs through.claude/hooks/run.mjs; in a fresh clone of Sketchbook the first hook builds them once. If a guard's script is missing, the guard blocks the edit and names the fix.
Skills
onboarding: choose a starting pointfoundations: create, change, import or roast foundationscontract-author: draft a component contractcomponent-builder: build from a contract, test-firstkits: add template kitsdesign-figma: sync to the Figma filea11y-checker: check WCAG 2.2 AAplaywright-worker: test in a real browserreview-rangers: multi-perspective reviewweb-components-best-practices: write native Web Componentshammock: think before coding, review for extra complexitysecurity-guardian: advisory checks for secrets,npm audit, lockfile integrity and sensitive files; reports GO or REVIEW NEEDED and never blocksforge-me-a-skill: write a skill that follows the repo standard. Optional:sketchbook init --with forge
Hooks and modes
| Event | Hook | Effect |
|---|---|---|
| SessionStart, UserPromptSubmit, SubagentStart | hammock | Injects the ladder card once, tracks the mode, briefs subagents |
| PreToolUse (Edit, Write, MultiEdit) | guard-generated, guard-decisions |
Block edits to generated files and accepted decisions, and name the source to change |
| PreToolUse (Edit, Write, MultiEdit) | hammock gate | Marks a component edit as owing an audit; never blocks |
| PostToolUse | hammock audit | Runs the audit right after the edit |
| PostToolUse (Edit, Write, MultiEdit) | page-outline |
A written .html page that uses sb-* elements needs an <h1> and a <main>; on a miss it tells the agent the fix (SB-0117). A static check, not axe |
| Stop | hammock stop gate | Safety net if an audit is still owed |
Hammock mode is lite, full (default), ultra or off. Switch it with /hammock <mode>; off skips the ladder, and non-negotiables such as accessibility and the contract still apply.
Install it
Run sketchbook init --agent claude when creating a project or from an existing Sketchbook project. The command stages the layer in move-to-.claude/ for activation. Open Claude Code in the design-system folder and ask it to install the staged files.
Install the Claude layer from move-to-.claude/ (follow move-to-.claude/INSTALL.md).
Claude copies the files, merges the hook settings, runs check --only H1 and doctor, then deletes move-to-.claude/. Check H1 verifies that every skill, brief and command loads, and that what the layer puts in context in every session stays within its byte budget (harness.config.json contextBudget, SB-0114).
Warning
Claude Code reads settings and hooks only from the folder where a session starts. If the design system is a folder inside an app, start Claude Code in that folder.