AgentKit
DocsKitsCLI ReferenceDesktop App
BetaYou are reading docs for the beta channel (2.13.0-beta.20). Features may change before the next stable release.Switch to stable →

Skills

Preserve local conventions with ak:folder-context

Create a compact subfolder CLAUDE.md and linked AGENTS.md without changing root project instructions.

Use ak:folder-context when one project subfolder carries durable conventions or decisions that future agent sessions cannot reliably infer. The Skill inspects the folder, proposes a compact outline, waits for confirmation, then creates local CLAUDE.md and AGENTS.md context without editing their root counterparts.

Choose ak:folder-context for local context

Use ak:folder-context when

  • A campaign, content, asset, or analysis subfolder has local naming, validation, approval, or handling rules.
  • The folder contains ongoing work whose locked decisions must survive across sessions.
  • Root instructions are intentionally general and should not absorb details that apply to only one subtree.
  • You want a short evidence-backed context file, not general documentation.

Choose another workflow when

  • You need root project instructions. Use ak:docs agent-context for Claude Code CLAUDE.md or Codex AGENTS.md at the repository root.
  • The folder is static reference material or its context is easy to discover from current files. Do not add another authority surface.
  • You need marketing project onboarding. Use ak:init.
  • You need general project documentation under docs. Use the project’s documentation workflow.

Prepare a confirmed target

Before starting:

  • Complete Onboarding and install Marketing Kit for the active runtime and scope.
  • Supply one existing subfolder, not the repository root.
  • Read the root and inherited instructions that already govern that folder.
  • Decide which local facts are durable enough to persist.
  • Remove credentials, customer data, private URLs, personal data, and temporary task notes from the proposed context.

The Skill reads relevant source, configuration, Markdown, and local context files inside the confirmed scope. It should not scan unrelated project areas or invent constraints from filenames alone.

Invoke the Skill

RuntimeInvocationAvailability boundary
Claude Code/ak:folder-context <target-folder>The Skill can create Claude-local context and a linked AGENTS.md after outline approval.
Cursor/ak:folder-context <target-folder>Slash invocation is user-verified for installed AgentKit Skills; file and symlink behavior still depends on the environment.
Codex$ak:folder-context <target-folder>Codex discovers the Skill natively. The resulting files remain repository artifacts, independent of Hook parity.
/ak:folder-context ./campaigns/product-launch "Capture only local naming, review gates, approved asset sources, and MUST NOT rules. Do not include customer records or edit root instructions"

Use Runtime adapters for general discovery and projection differences. The core file contract of this Skill is the same in the current packages.

Understand the stages

  1. Confirm the boundary. The Skill verifies that the target is a subfolder and reads inherited project instructions.
  2. Inspect local evidence. It examines only the key files needed to identify purpose, essential paths, constraints, conventions, and locked decisions.
  3. Apply the sanity gate. It stops when the folder is static reference material or on-demand discovery is sufficient.
  4. Propose an outline. It groups the facts and waits for your confirmation before any write.
  5. Write local context. It creates or updates the target folder’s CLAUDE.md, omitting empty or generic sections.
  6. Link the alternate runtime surface. It creates target-folder AGENTS.md as a symlink to CLAUDE.md. If symlinks are unavailable, it writes a one-line pointer and reports the fallback.
  7. Reconcile user edits. If you edit the context during the run, the Skill re-reads it and reports contradictions instead of reverting your work.

Useful content includes the folder purpose, essential files with one-line roles, explicit MUST NOT constraints, naming conventions, dated locked decisions, and context needed across sessions. Keep it compact and local.

Keep file and privacy boundaries explicit

Local context becomes durable repository content

Review every line before writing. A subfolder instruction file can be read by future agents and may enter repository history if committed. Do not persist secrets, customer data, private URLs, personal data, or unsupported claims.

  • The approved mutation is limited to the confirmed subfolder’s CLAUDE.md and AGENTS.md.
  • The Skill never edits root CLAUDE.md or root AGENTS.md.
  • A symlink is a filesystem mutation and can behave differently on Windows, restricted filesystems, archives, or provider-managed workspaces. The pointer fallback must be reported.
  • Existing instructions remain authoritative. Do not duplicate them or create a contradictory local override.
  • The Skill does not authorize Git staging, commit, push, publication, deployment, outreach, account changes, spend, or network access.

Verify the output

A complete run should provide:

  • A compact <target-folder>/CLAUDE.md based only on inspected evidence and explicit user decisions.
  • <target-folder>/AGENTS.md as a symlink to CLAUDE.md, or a disclosed one-line pointer fallback.
  • No change to root instruction files or unrelated folders.
  • A short report naming the target, files read, files changed, fallback used, contradictions found, and unresolved questions.

Inspect the diff and, when a symlink was requested, verify the link target. Read the folder as a future session would: local context should add necessary facts without replacing project-wide authority.

Troubleshoot safely

SymptomSafe next step
The runtime does not recognize ak:folder-contextConfirm target and scope, restart the runtime, then follow Runtime cannot find a Skill or Agent.
The target resolves to the repository rootStop and use ak:docs agent-context; this Skill remains subfolder-only.
The proposed file repeats root guidanceRemove repeated content and keep only folder-specific facts.
Symlink creation failsUse the one-line AGENTS.md pointer fallback and record that it is not a symlink.
Existing local instructions conflictDo not overwrite them. Show the exact conflict and ask which authority should change.
Sensitive content appears in the outlineRemove it before writing and retain only a safe reference to its approved location when necessary.

Continue with the Marketing Kit overview or Projects, artifacts, and checkpoints for wider ownership and recovery guidance.

Know the current limits

  • The Skill creates agent context, not a full folder inventory, README, strategy, brand guide, or source of current campaign truth.
  • It relies on the current filesystem’s symlink support and the runtime’s ability to create or inspect links.
  • It cannot prove that every future runtime will load both filenames in the same way; the files preserve content, while runtime discovery remains capability-specific.