Quick Ref / Command

Engineer Kit

/ak:folder-context

Subfolder CLAUDE.md files

Create compact subfolder CLAUDE.md and linked AGENTS.md files for durable local conventions that root docs cannot safely carry.

01

Confirm Target

02

Inspect Local Evidence

03

Apply Sanity Gate

04

Propose Outline

Rule 01

Subfolder context is for local conventions future agents cannot reliably infer.

Rule 02

Root agent instructions belong to /ak:docs agent-context, not this skill.

Rule 03

Compact bullets beat file trees and generic project documentation.

Rule 04

Evidence or explicit user decision is required for every local instruction.

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 subfolder target, not the project root or a general docs request.
  2. 2 Inspect Local Evidence Read key source, configuration, Markdown, and existing local context files inside that folder.
02

Work

Agent / skill execution

  1. 3 Apply Sanity Gate Skip folders whose context is static reference material or discoverable on demand without durable conventions.
  2. 4 Propose Outline Group the future context by purpose, essential files, constraints, conventions, locked decisions, and session-spanning context.
03

Verify

Gate, review, validation

  1. 5 Wait Confirmation Get user confirmation before writing local agent instructions to the target folder.
  2. 6 Write CLAUDE.md Create compact, specific, local bullets using only folder evidence or explicit user decisions; omit empty sections.
04

Close

Report, handoff, artifact

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

Syntax, arguments, subcommands

How to invoke the skill: syntax, positional arguments, shared options, then each subcommand with its own syntax and outcome.

Syntax

/ak:folder-context <target-folder>

Arguments

<target-folder> Required

Target subfolder

Existing subfolder that should receive local agent context. It cannot be the project root or a general docs request; extra evidence may guide the proposed outline but does not change the positional folder target.

/ak:folder-context packages/payments

Sample Prompt

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

Create local context Recommended
/ak:folder-context packages/payments
Use when:
A subfolder has durable naming, architecture, workflow, or safety rules that differ from the project root.
Expected:
Validates that the target is a subfolder, inspects source, configuration, Markdown, and existing local instructions, proposes an outline, waits for approval, then writes a compact CLAUDE.md and linked AGENTS.md.
Preserve explicit decisions
/ak:folder-context src/payments "capture provider naming rules and the decision to store currency as integer minor units"
Use when:
You can name durable local decisions that future agents should keep across sessions.
Expected:
Uses folder evidence plus the supplied decisions, omits empty or generic sections, and keeps the resulting bullets specific to the target folder rather than duplicating root guidance.
Apply the sanity gate
/ak:folder-context reference/archive
Use when:
A folder may only contain static reference material or context that is easy to rediscover on demand.
Expected:
Checks whether durable local instructions are justified and skips creating CLAUDE.md or AGENTS.md when the folder is static or discoverable on demand.
Respect existing context
/ak:folder-context apps/admin
Use when:
The target already has local instructions or user edits that must stay authoritative.
Expected:
Reads the current local context before proposing changes, preserves unrelated user edits, flags contradictions, and never reverts existing instructions without permission.

Handled Scope

  • Subfolder-scoped CLAUDE.md creation
  • AGENTS.md symlink or pointer fallback
  • Local convention discovery and pruning
  • Locked decisions and cross-session context capture
  • Contradiction detection after user edits

Next