Layer New logo

Layer New

Community
AnastasiyaW
layer-new

Scaffold a new layer in a project's docs/layers/ tree following the feature-layer architecture (principle 28). A layer is a bounded concern (security, data, ui, infrastructure, domain) with its own invariants, decisions, gotchas, patterns, and feature narratives. Use when: "create a new layer", "add security layer", "scaffold layer", "start tracking <concern> separately", "/layer-new", "add bounded concern". Operates on the kb-skeleton structure; idempotent -- will not overwrite existing layers. Do NOT use to scaffold an individual feature narrative inside an existing layer; use /feature-new for that (a layer is the container, not the per-feature doc).

Overview

PublisherAnastasiyaW
Repositorycodex-claude-code-config
Skill namelayer-new
Stars
212
Forks
32
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by AnastasiyaW on GitHub. Read the source before you install it.

Installation

Install the Layer New AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AnastasiyaW/codex-claude-code-config/tree/main/skills/architecture/layer-new
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnastasiyaW/codex-claude-code-config.git /tmp/codex-claude-code-config
mkdir -p .claude/skills
cp -r /tmp/codex-claude-code-config/skills/architecture/layer-new .claude/skills/layer-new
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Layer New in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Layer New on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Layer New is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

/layer-new -- scaffold a project layer

Creates docs/layers/<layer-name>/ with the full template structure defined by principle 28.

When to use

  • Starting to track a new bounded concern in a long-running project
  • Refactoring sprawling cross-cutting code into a documented layer
  • Onboarding a new team member who needs the layer map

When NOT to use

  • One-off scripts or pet projects with <5 features (overhead not justified)
  • Layer name describes a directory (src is not a layer)
  • The "layer" is actually one feature in disguise -- use /feature-new inside an existing layer instead

Arguments

/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.

Direction (what to do, in order)

Step 1 -- Verify environment

Check the current working directory:

  1. Is it a git repository? Run git rev-parse --show-toplevel. If not, ask the user whether to initialize one (offer git init + private GitHub repo per global rule).
  2. Does docs/ exist? If not, create it.
  3. Does docs/layers/README.md exist? If not, copy from <claude-code-skills-checkout>/templates/kb-skeleton/docs/layers/README.md.
  4. Check if docs/layers/<layer-name>/ already exists. If yes, stop with a message -- do not overwrite. Suggest /feature-new <layer> <slug> instead.

Step 2 -- Validate layer name

  • Must be lowercase kebab-case ([a-z][a-z0-9-]*).
  • Must not start with _ (reserved for templates).
  • Must not be a generic file-system name (src, tests, docs, build).
  • If invalid, refuse with a clear message and a suggested fix.

Step 3 -- Copy the template

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

Step 4 -- Fill placeholders

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 fill

In history.md:

  • Insert a "Layer created" entry at the top with today's date (YYYY-MM-DD) and the originating reason. Prompt the user for the reason if not provided.

Step 5 -- Register the layer

Update docs/layers/README.md:

  • Add a row to the ## Layer index table: | <layer-name> | <purpose> | active |
  • If a cross-layer Mermaid graph exists, add a node for the new layer with no edges (user will add edges as dependencies form).

Step 6 -- Wire to project state

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.

Step 7 -- Confirm and suggest next step

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

Blueprints (files this skill writes from)

  • templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE/ -- the source tree to copy
  • templates/kb-skeleton/docs/layers/README.md -- the layers index template (used only if missing)

Gotchas

  • Renaming a layer is not idempotent. If the user runs /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.
  • Layer name collision with existing directories. If 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.
  • Templates may have moved. If the template path <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.
  • Encoding boundary. When writing files with Cyrillic content, follow the global rule from ~/.claude/rules/api-utf8-posting.md -- always specify encoding="utf-8" explicitly.

Troubleshooting

SymptomCauseFix
"Layer already exists"Directory docs/layers/<name>/ presentUse /feature-new to add to it, or pick a different name
Template files missingPath moved or different machinePull templates from public repo via gh api repos/AnastasiyaW/claude-code-config/contents/templates/kb-skeleton/docs/layers/_LAYER-TEMPLATE
Layers README not updateddocs/layers/README.md had no ## Layer index tableOpen file manually, add table per the kb-skeleton template
Validator warns about layervalidate_kb_links.py flagged broken linkLayer 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.

Implementation note

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).

Frequently asked questions

What does the Layer New AI skill do?

Scaffold a new layer in a project's docs/layers/ tree following the feature-layer architecture (principle 28). A layer is a bounded concern (security, data, ui, infrastructure, domain) with its own invariants, decisions, gotchas, patterns, and feature narratives. Use when: "create a new layer", "add security layer", "scaffold layer", "start tracking <concern> separately", "/layer-new", "add bounded concern". Operates on the kb-skeleton structure; idempotent -- will not overwrite existing layers. Do NOT use to scaffold an individual feature narrative inside an existing layer; use /feature-ne...

Why use Layer New on TypingMind?

Because you install it once and use it with any model. Layer New is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Layer New in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AnastasiyaW/codex-claude-code-config/tree/main/skills/architecture/layer-new. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Layer New?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Layer New?

As many as you like. As long as a model supports skills, you can use Layer New with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Layer New AI skill free?

Yes. It is published on GitHub by AnastasiyaW under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇