context
Analyze and optimize Claude Code's context configuration (analyze, optimize, or reset).
Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions while keeping routing always-loaded.
> /plugin marketplace add komluk/scaffolding > /plugin install scaffolding@komluk-scaffolding
How it fires
How this command gets triggered: by you, by Claude, or both.
/init-rulesContext preview
What this command does when you run it.
Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions while keeping routing always-loaded.
name: init-rules description: Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions while keeping routing always-loaded.
Scaffold **path-scoped nested `CLAUDE.md`** files into the current project so that per-area code conventions load **only when Claude works on files under that directory** — trimming always-loaded context without weakening routing.
This is a **generator**: it writes nested `CLAUDE.md` files into the USER project (e.g. `frontend/CLAUDE.md`), not into the plugin. It is **opt-in and reversible** — conventions are *relocated*, never deleted.
/init-rules [subdir ...]
If no subdirs are given, propose candidate areas (e.g. `frontend/`, `backend/`, `app/`, `src/`) detected in the repo and ask which to scaffold.
Claude Code natively auto-loads a `CLAUDE.md` placed in a subdirectory **only** when working on files under that tree. `/init-rules` uses exactly this primitive; it does **not** build a `paths:` glob matcher or a hook injector.
The routing **Protocol + Decision Tree + Agents table** stay in the project-root `CLAUDE.md`, always-loaded. Routing must fire on the first message before any file is edited; a nested file only loads on Edit/Write under its tree — too late to route. This command:
style) are candidates to relocate into nested files.
Follow these steps exactly.
Reuse the same discovery as `/init-scaffolding` (search the marketplace cache paths) to find `PLUGIN_ROOT`. If not found, stop and tell the user to run `/plugin install scaffolding@komluk-scaffolding` first.
Use the args if given. Otherwise detect candidate area directories and confirm with the user before writing anything.
For each chosen `<subdir>`:
if [ -f "<subdir>/CLAUDE.md" ]; then echo "SKIPPED: <subdir>/CLAUDE.md already exists (not overwritten)" else cp "$PLUGIN_ROOT/templates/nested-claude.md" "<subdir>/CLAUDE.md" echo "CREATED: <subdir>/CLAUDE.md (fill in path-specific conventions)" fi
Then help the user fill in the template's `Stack` / `Conventions` / `Local commands` sections with the conventions that apply to that area — moving them out of the root `CLAUDE.md` if they are purely path-specific.
If a critical convention (e.g. type centralization) is relocated, leave a brief one-line pointer in the root `CLAUDE.md` so it is still discoverable when editing via an absolute path outside the nested tree. Do this via the tech-writer/owner of CLAUDE.md — do not silently rewrite routing.
List each target as CREATED or SKIPPED with its path, and remind the user that:
this command.
`skills/context-engineering/SKILL.md` for the always-loaded-vs-lazy split.
Spec-driven multi-agent orchestration for Claude Code — pure markdown, zero backend, runs on the stock runtime. 13 agents, 36 skills, 19 commands, 15 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.
Repo: komluk/scaffolding
Analyze and optimize Claude Code's context configuration (analyze, optimize, or reset).
Scaffold a new scaffolding-compatible skill: an interactive flow that creates `skills/<name>/SKILL.md` from the canonical template, composes a `TRIGGER`/`SKIP`…
Health-check the scaffolding install and report install problems plus exact fixes (diagnose-only, never mutates).
Initialize OpenSpec in a project directory with the scaffolding-workflow schema.
Bootstrap a new project with the scaffolding CLAUDE.md, settings.json, and `.scaffolding/` directory structure.