From claude-code-config
Scaffolds a new bounded-concern layer (security, data, ui, etc.) in a project's docs/layers/ tree following feature-layer architecture. Idempotent, uses kb-skeleton template.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-config:layer-newsonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Creates `docs/layers/<layer-name>/` with the full template structure
Creates docs/layers/<layer-name>/ with the full template structure
defined by principle 28.
src is not a layer)/feature-new
inside an existing layer instead/layer-new <layer-name> [--purpose "..."] [--principles P-NN,P-MM]
<layer-name> -- kebab-case, single word preferred. Examples:
security, data, image-processing, observability.--purpose -- one-sentence purpose. If omitted, prompt the user.--principles -- comma-separated Tier 1 principle IDs that govern
this layer (e.g. P-02,P-21). If omitted, leave placeholder in
README.Check the current working directory:
git rev-parse --show-toplevel. If
not, ask the user whether to initialize one (offer git init +
private GitHub repo per global rule).docs/ exist? If not, create it.docs/layers/README.md exist? If not, copy from
<claude-code-skills-checkout>/templates/kb-skeleton/docs/layers/README.md.docs/layers/<layer-name>/ already exists. If yes,
stop with a message -- do not overwrite. Suggest
/feature-new <layer> <slug> instead.[a-z][a-z0-9-]*)._ (reserved for templates).src, tests, docs,
build).Source: <claude-code-skills-checkout>/templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE/
Destination: <repo>/docs/layers/<layer-name>/
Copy the entire directory tree. Preserve subdirectory structure (kb/
and features/). Result:
docs/layers/<layer-name>/
├── README.md
├── history.md
├── kb/
│ ├── invariants.md
│ ├── decisions.md
│ ├── gotchas.md
│ └── patterns.md
└── features/
└── _FEATURE-TEMPLATE.md
In every file under the new layer, replace:
<layer-name> -> the actual layer name<Layer name> -> Title Case of the layer name (e.g. "Security",
"Image Processing")In README.md specifically:
**Purpose:** <one sentence...> -> the --purpose argument value,
or prompt the user## Governing principles list -> populate from --principles arg,
or leave the placeholder bullets in place for the user to fillIn history.md:
Update docs/layers/README.md:
## Layer index table:
| <layer-name> | <purpose> | active |If the project has feature_list.json at repo root, leave it alone --
features get added by /feature-new. Do not edit feature_list.json
from this skill.
If the project has AGENTS.md, suggest (but do not auto-edit) adding
the new layer to the "Source-of-truth docs" table if multiple layers
exist.
Print a summary:
Layer created: docs/layers/<layer-name>/
Files: 1 README, 1 history, 4 kb/, 1 feature template
Suggested next steps:
1. Fill governing principles in docs/layers/<layer-name>/README.md
2. Write the first feature: /feature-new <layer-name> <slug>
3. Add the first invariant when it earns its place
templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE/ -- the source
tree to copytemplates/kb-skeleton/docs/layers/README.md -- the layers index
template (used only if missing)/layer-new wrong-name then realizes they wanted right-name,
manually rename the directory and update references. This skill
does NOT detect or fix duplicates.docs/<layer-name>/ exists at the docs/ root (not under
docs/layers/), refuse and ask the user which they want -- there
is no automatic merge.<claude-code-skills-checkout>/templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE/
does not exist (e.g. user is on a different machine), fall back to
reading from
https://github.com/AnastasiyaW/claude-code-config/tree/main/templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE
via gh api.~/.claude/rules/api-utf8-posting.md --
always specify encoding="utf-8" explicitly.| Symptom | Cause | Fix |
|---|---|---|
| "Layer already exists" | Directory docs/layers/<name>/ present | Use /feature-new to add to it, or pick a different name |
| Template files missing | Path moved or different machine | Pull templates from public repo via gh api repos/AnastasiyaW/claude-code-config/contents/templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE |
| Layers README not updated | docs/layers/README.md had no ## Layer index table | Open file manually, add table per the kb-skeleton template |
| Validator warns about layer | validate_kb_links.py flagged broken link | Layer is fine; broken link is in a feature doc inside it. Run python scripts/build_kb_graph.py from the project root for the full health report. |
The bulk of the work is file copy + placeholder replacement. No dynamic logic is needed; the template files do all the structural heavy lifting. Keep this skill deterministic and idempotent -- it must be safe to invoke twice on the same layer (second call should be a no-op with a clear message).
npx claudepluginhub anastasiyaw/claude-code-configScaffolds a feature narrative document in an existing layer following the ULTRAPACK-style template with Design/Plan/Verify/Conclusion sections. Auto-allocates F-NNN IDs and updates layer README and feature_list.json.
Guides structured conversations to define repository architecture principles in clean (default), hexagonal/ports & adapters, modular monolith, or custom styles. Produces formal architecture.md document for project standards.
Adds new layers, documentation, components, or skills to an existing harness project with constraint validation, dependency wiring, and verification.