Quick Ref / Command

Marketing Kit

/ak:folder-context

Subfolder CLAUDE.md files

Creates compact local CLAUDE.md and linked AGENTS.md files only when a subfolder has durable conventions future agents cannot infer.

01

Confirm target

02

Inspect local evidence

03

Run sanity gate

04

Propose outline

Rule 01

Local context must be compact, specific, and durable.

Rule 02

Create context only when future agents cannot infer it from nearby files.

Rule 03

User-confirmed decisions and folder evidence are the only valid sources.

Rule 04

Root instructions and project docs belong to other skills.

Execution Map

Core lanes from input to output, aligned with the command's real execution path.

01

Start

Input, scope, route

  1. 1 Confirm target Ensure the argument is a real subfolder, not the repository root or a general docs request.
  2. 2 Inspect local evidence Review key source, configuration, Markdown, and existing local context files inside the target.
02

Work

Agent / skill execution

  1. 3 Run sanity gate Reject static reference folders or folders whose context can be discovered on demand.
  2. 4 Propose outline Group purpose, essential files, constraints, conventions, locked decisions, and cross-session context.
03

Verify

Gate, review, validation

  1. 5 Wait confirmation Do not write until the user confirms the grouped outline.
  2. 6 Write compact context Create target-folder CLAUDE.md from folder evidence and explicit user decisions, omitting empty sections.
04

Close

Report, handoff, artifact

  1. 7 Link agents file Create AGENTS.md as a symlink to CLAUDE.md or a one-line pointer if symlinks are unavailable.
  2. 8 Respect edits If the user edits the context file, re-read it, flag contradictions, and never revert without instruction.

Don't skip the required step

Each item contrasts a tempting shortcut with the required approach.

Tempting shortcut

Every folder benefits from instructions.

Do this instead

Static or self-explanatory folders should not get new context files.

Tempting shortcut

Copy the root rules for safety.

Do this instead

Duplicating root instructions creates drift. Keep only local, durable differences.

Sample Prompt

Concrete invocations for each flag, subcommand, mode, or route available in the live workflow.

Create folder context Recommended
/ak:folder-context src/components/forms
Use when:
A subfolder has form-specific conventions future agents should preserve.
Expected:
Inspects the folder, proposes an outline, then writes compact local context after confirmation.
Component area
/ak:folder-context src/features/checkout
Use when:
A feature folder has local constraints, naming, and decisions not obvious from code.
Expected:
Creates CLAUDE.md and AGENTS.md only if the sanity gate passes for that folder scope.
i18n conventions
/ak:folder-context src/i18n
Use when:
Locale files have local naming and translation rules agents should not invent.
Expected:
Writes compact subfolder CLAUDE.md/AGENTS.md only after the sanity gate for that folder.

Handled Scope

  • Confirm target
  • Inspect local evidence
  • Run sanity gate
  • Propose outline
  • Wait confirmation
  • Write compact context

Next