dot_claude/skills/setup-ai/SKILL.md
Use when initializing or migrating AI agent context management (AGENTS.md, ai/ structure) for a project. Run on new repos to scaffold, and on existing repos to audit, consolidate, and migrate to current conventions.
npx skillsauth add nijaru/dotfiles setup-aiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Initialize a new project's AI context, or audit and migrate an existing one to current conventions. This is the canonical definition of the ai/ structure — run it on any repo that needs setup or cleanup.
Read in parallel:
git remote -v, README.md (first paragraph)package.json, Cargo.toml, pyproject.toml, go.modls -la ai/ if it exists, AGENTS.md, CLAUDE.mdMakefile, justfile, .claude/settings.jsonDetermine mode: Init (no ai/ exists) or Audit (ai/ exists).
| Scenario | Action |
| :----------------------- | :------------------------------------------------------------------------------------ |
| Neither file exists | Create AGENTS.md, symlink ./CLAUDE.md → AGENTS.md (ln -s AGENTS.md CLAUDE.md) |
| Only CLAUDE.md at root | Rename to AGENTS.md, create symlink (leave as-is for OSS repos) |
| Both exist | Merge to AGENTS.md, remove old CLAUDE.md, create symlink |
All files in research/, design/, review/ must start with:
---
date: YYYY-MM-DD
summary: one-line description
status: active | resolved | stale
---
mkdir -p ai/research ai/design ai/review ai/sprints ai/tmp
echo '*' > ai/tmp/.gitignore
tk init
Keep ai/ local (not committed):
echo 'ai/' >> .git/info/exclude
echo '.tasks/' >> .git/info/exclude
ai/README.md — index only, pointers, no content:
# AI Context Index
- [STATUS.md](STATUS.md) — current phase and active focus
- [DESIGN.md](DESIGN.md) — system architecture
- [DECISIONS.md](DECISIONS.md) — architectural decisions and rationale
- [PLAN.md](PLAN.md) — current active plan
ai/STATUS.md:
# Status
**Phase:** initial setup
**Focus:** [current task]
**Blockers:** none
ai/DESIGN.md:
# Design
## Architecture
[System overview]
## Components
[Component map]
ai/DECISIONS.md:
# Decisions
## Principles
_Distilled from resolved decisions. Stable, load-bearing context._
## Log
_Recent decisions, ~20 entries max. Format: `[date] Context → Decision → Rationale`_
ai/PLAN.md:
# Plan
[Current sprint/plan. One plan at a time — replace when complete. Extract outcomes to DECISIONS.md/DESIGN.md first.]
Run when ai/ is out of sync, overlapping, or bloated. Work through these steps in order.
find ai/ -name "*.md" | sort
Read all root files. Note which topic files have frontmatter and their status.
Ensure current conventions are in place:
ai/README.md exists and is index-only (pointers, ~150 chars/entry, no content)ai/STATUS.md has Phase / Focus / Blockers formatai/PLAN.md exists — if ai/SPRINTS.md is present, rename it and migrate contentai/DECISIONS.md has Principles + Log sectionsFor each topic file in research/, design/, review/:
status: resolved or status: stale → candidate for deletionIf Log section exceeds ~20 entries:
Rewrite ai/README.md from scratch based on what actually exists after consolidation:
# AI Context Index
- [Title](path) — one-line hook (~150 chars max)
Every file in ai/ root should have an entry. Topic files in subdirs get entries only if actively referenced.
ls -la AGENTS.md CLAUDE.md # verify symlink
tk ready # verify task tracking
ls -R ai/ # verify structure
Check: README.md has no content (pointers only), DECISIONS.md has both sections, PLAN.md exists.
| Excuse | Reality | | :--------------------------------- | :-------------------------------------------------------------- | | "It's a small project" | Inconsistent structure causes context drift in 3 sessions | | "I'll update README.md later" | Stale index = agent loads wrong files = hallucinations | | "I'll keep old files just in case" | Dead files pollute context. Delete resolved work. | | "I'll mark this decision as done" | Append Log + periodic distillation into Principles is correct | | "STATUS.md can hold the index too" | Index belongs in README.md. STATUS.md is operational state only |
development
Use after completing a bug fix, feature, refactor, or tk task when the first implementation taught enough context to replace it with a simpler, cleaner, or more coherent version before finalizing.
development
Use when writing, migrating, or reviewing Zig code across recent stable versions (0.14-0.16), especially to correct stale syntax or stdlib, build.zig, allocator, formatting, or runtime API knowledge.
documentation
Use when reviewing or revising text (prose, docs, commits) to remove AI patterns and improve voice/clarity.
content-media
Use when fetching X/Twitter post content by URL, or searching for recent X posts.