skills/c3/SKILL.md
This skill should be used when the user invokes /c3 or asks architecture questions about a project with a .c3/ directory. Trigger phrases: "adopt C3", "onboard this project", "where is X", "audit the architecture", "check docs", "add a component", "implement feature", "what breaks if I change X", "add a ref", "add a coding rule", "coding standard". Handles operations: onboard, query, audit, change, migrate, ref, rule, sweep. Classifies intent, loads ref, executes.
npx skillsauth add lagz0ne/c3-skill c3Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CLI: C3X_MODE=agent bash <skill-dir>/bin/c3x.sh <command> [args]
Agent output mode: With C3X_MODE=agent, c3x outputs TOON (Token-Optimized Object Notation) by default — ~40% fewer tokens than JSON. All commands append help[] contextual hints suggesting next steps.
Content-first: Running c3x with no arguments outputs a project dashboard (entity counts, coverage, pending ADRs) — not help text. Use --help for help.
| Command | Purpose |
|---------|---------|
| (no args) / status | Project dashboard: entity counts, coverage %, pending ADRs, warnings |
| init | Scaffold .c3/ |
| list | Topology with files (--flat, --compact) |
| check | Structural validation (--fix) |
| add <type> <slug> | Create entity with body via stdin (--container, --feature) |
| set <id> <field> <val> | Update frontmatter field |
| set <id> --section <name> | Update section content (text or JSON table) |
| wire <src> <tgt> | Link component to ref (--remove to unlink) |
| schema <type> | Section definitions for entity type |
| codemap | Scaffold code-map entries for all components, refs + rules |
| read <id> | Full entity content; agent mode truncates body to 1500 chars (--full to bypass) |
| lookup <file-or-glob> | File or glob → component + refs |
| coverage | Code-map coverage stats |
| delete <id> | Remove entity + clean all references (--dry-run) |
| query <terms> | Full-text search across all entities (--type, --limit) |
| impact <id> | Transitive impact analysis — who depends on this? (--depth) |
| diff | Show uncommitted entity changes (--mark <hash>) |
| export [dir] | Render canonical markdown from local cache (advanced escape hatch) |
| migrate | Populate content node tree (v7→v8, requires DB) |
| migrate-legacy | Import legacy unsealed .c3/ markdown into local cache, then reseal |
| marketplace add <url> | Register marketplace rule source (shallow clone) |
| marketplace list | Browse available rules (--source, --tag) |
| marketplace show <rule-id> | Preview marketplace rule content |
| marketplace update | Pull latest from registered sources |
| marketplace remove <name> | Unregister source + delete cache |
Types for add: container, component, ref, rule, adr, recipe
| Keywords | Op | Reference |
|----------|----|-----------|
| adopt, init, scaffold, bootstrap, onboard, "create .c3", "set up architecture" | onboard | references/onboard.md |
| where, explain, how, diagram, trace, "show me", "what is", "list components" | query | references/query.md |
| audit, validate, "check docs", drift, "docs up to date", "verify docs" | audit | references/audit.md |
| add, change, fix, implement, refactor, remove, provision, design | change | references/change.md |
| "upgrade c3", "repair cache", "rebuild cache", "migrate .c3" | migrate | references/migrate.md |
| pattern, convention, "create ref", "update ref", "list refs", standardize | ref | references/ref.md |
| "add/create a coding rule", "document a rule", "coding standard", "coding convention", "migrate refs to rules", "split ref into rule" | rule | references/rule.md |
| marketplace, "browse rules", "adopt rule", "install rule from", "available rules" | rule (Adopt mode) | references/rule.md |
| impact, "what breaks", assess, sweep, "is this safe" | sweep | references/sweep.md |
| recipe, "trace end-to-end", "cross-cutting flow", "how does X flow" | query (read) / change (create) | references/query.md / references/change.md |
AskUserQuestion with supported operation options)references/<op>.mdBefore every op except onboard and migrate:
bash <skill-dir>/bin/c3x.sh
Returns project dashboard (TOON). If error about missing .c3/ → route to onboard. If verification complains about broken seals or unrecoverable cache rebuild, route to migrate or repair as appropriate. Read-only commands should stay gated on broken canonical state; repair mutations such as write --section, set --section, and add adr are allowed to reach their own validation/export path. Otherwise, dashboard gives immediate orientation: entity counts, coverage, pending ADRs. Follow the help[] hints for next steps.
C3 context is already loaded. Every file, every directory has a place in the topology. Before touching anything, let C3 tell you what it knows — then follow its lead.
c3x lookup <file-or-glob> → component docs, refs, constraints. Read them. They supersede assumptions.
When context shifts to a new component mid-task, look it up again. The topology is the source of truth — just follow it.
First AskUserQuestion denial → ASSUMPTION_MODE = true for session.
AskUserQuestion again[ASSUMED]HARD RULE — .c3/ is CLI-only. NEVER use Read, Glob, Edit, or Write tools on .c3/ files.
Architecture data is shared through sealed canonical .c3/ markdown. .c3/c3.db is disposable local cache only and must never be treated as submitted state. Raw file access bypasses the CLI contract and returns stale or misleading state. ALL access goes through c3x:
c3x add, c3x init, c3x codemapc3x read <id>, c3x list, c3x query, c3x lookup, c3x graph, c3x impactc3x write <id>, c3x set, c3x wire (--remove to unwire)c3x deletec3x check, c3x coverage, c3x schema, c3x verifyIf c3x lacks a needed operation, STOP and tell the user — do not work around it with file tools.
HARD RULE — Canonical .c3/ files are sealed.
.c3/ only after c3x verify passesc3x repairverify blocks read-only commands while a focused canonical repair is needed, use the narrow mutation that repairs the content (write --section, set --section, or add adr), then run c3x check --include-adr and c3x verify.Never claim .c3/ state is authoritative if verify fails.
Run c3x check frequently — after any mutation (add, write, set, wire, delete). It catches missing required sections, bad entity references, and codemap issues. Treat errors as blockers.
HARD RULE — ADR is the unit of change:
Every change operation MUST start with c3x add adr <slug> as its FIRST action.
No code reads, no file edits, no exploration before the ADR exists.
(Exception: ref-add creates its adoption ADR at completion — see references/ref.md.)
The ADR is an ephemeral work order — it drives what to update, then gets hidden.
c3x list and c3x check exclude ADRs by default; use --include-adr to see them.
Stop immediately if:
c3x add adr <slug> NOWAskUserQuestion (skip if ASSUMPTION_MODE)File Context — MANDATORY before reading or altering any file:
Step 1 — Lookup:
bash <skill-dir>/bin/c3x.sh lookup <file-path>
bash <skill-dir>/bin/c3x.sh lookup 'src/auth/**' # glob for directory-level context
Run the moment any file path surfaces. Use glob when working across a directory. No match = uncharted, proceed with caution.
Step 2 — Load rules: For every rule-* returned by lookup:
bash <skill-dir>/bin/c3x.sh read <rule-id>
Extract ## Rule, ## Golden Example, and ## Not This. These are hard constraints — code MUST match the golden pattern. Deviations require an Override section in the rule or a new ADR.
Step 3 — Top-down parent context: For every matched component, read upward before reasoning about the component detail:
bash <skill-dir>/bin/c3x.sh read <parent-container-id>
bash <skill-dir>/bin/c3x.sh read <component-id>
Parent container responsibilities and component membership are the integration contract.
Step 4 — Graph context: For the parent container first, then the component if needed:
bash <skill-dir>/bin/c3x.sh graph <parent-container-id> --depth 1
bash <skill-dir>/bin/c3x.sh graph <component-id> --depth 1
Shows providers (what this component depends on) and consumers (what depends on it). If your change affects the component's interface, check consumers before proceeding.
Result: Returned refs + loaded rule content + parent container + graph = the full constraint set. All MUST be honored.
New component rule: reason top-down. Update/read container Components + Responsibilities first, then write the component detail. A new component is not done until the parent container has an explicit Parent Delta decision.
Layer Navigation: Context → Container → Component
Graph Output — Include mermaid graph in responses when relationships matter:
bash <skill-dir>/bin/c3x.sh graph <entity-id> --format mermaid
Include the output as a mermaid code block. Root selection matters more than depth:
--depth 1 is default. Use --depth 2 only for cross-container tracing.--direction forward for impact. --direction reverse for "what depends on this".c3-0 — it's always exactly one node, adds no signal.File Structure:
.c3/
├── README.md # Context (c3-0)
├── adr/adr-YYYYMMDD-slug.md
├── refs/ref-slug.md
├── rules/rule-slug.md
├── recipes/recipe-slug.md
└── c3-N-name/
├── README.md # Container
└── c3-NNN-component.md
No .c3/ or re-onboard. c3x init → discovery → inject CLAUDE.md → show capabilities.
Details: references/onboard.md
c3x query "<terms>" for search, c3x list for topology, c3x impact <id> for dependencies.
Details: references/query.md
c3x check → c3x list → semantic phases. Output: PASS/WARN/FAIL table.
Details: references/audit.md
ADR first (c3x add adr) → c3x list → identify affected entities (refs, affects in frontmatter) → c3x lookup each file → fill ADR → approve → execute → c3x check.
Provision gate: implement now or status: provisioned.
Details: references/change.md
Modes: Add / Update / List / Usage.
Details: references/ref.md
Modes: Add / Update / List / Usage.
Details: references/rule.md
c3x impact <id> → transitive dependency analysis → parallel assessment → synthesize. Advisory only.
Details: references/sweep.md
Use only for version upgrades or break-glass cache rebuilds. In v9, submitted truth is sealed .c3/ files; the cache can be discarded and rebuilt. Prefer c3x verify or c3x repair for normal workflows. Use migrate-legacy only when adopting old unsealed markdown, and migrate only for node-tree upgrades.
Details: references/migrate.md
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).