init-ai-docs
Skill0 starsChanged 10 months agoMITView on GitHub
Bootstrap ai_docs/ directory structure for decision records. Creates plans/, research/, handoffs/, and templates/ directories with index.md. Idempotent - safe to run multiple times. Use before creating plans, research, or handoffs.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- argocd-opsSkill
- codexSkill
- convergent-reviewSkill
- create-handoffSkill
- create-planSkill
- create-researchSkill
- init-central-docsSkill
- jiraSkill
- loki-debugSkill
- pr-statusSkill
- resume-handoffSkill
- tatari-turboliftSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 14 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Before creating your first plan, research note, or handoff
- Very specific: line 21
When /create-plan, /create-research, or /create-handoff is invoked (they call this automatically)
- Distinctive: line 37
Read the project's AGENTS.md (or CLAUDE.md) to determine the mode:
- Very specific: line 39
Read $REPO_ROOT/AGENTS.md (or CLAUDE.md)
- Distinctive: line 41
If it references a central repo for plans/research → central mode
- Very specific: line 42
If it references local ai_docs/ or explicitly describes local mode → local mode
- Distinctive: line 43
If no "Decision Records" section exists → ask the user:
- Distinctive: line 48
Use the answer for this run's directory creation.
- Distinctive: line 66
After creating the local handoffs directory, verify the central repo:
- Distinctive: line 69
Check if the path exists
- Very specific: line 70
If it exists, check for expected structure: plans/, research/, templates/, index.md
- Distinctive: line 71
If the path is missing or the structure is incomplete:
- Very specific: line 78
Check if ai_docs/handoffs/ is already gitignored.
- Distinctive: line 89
Only create if it doesn't exist.
- Distinctive: line 143
Only create templates that don't already exist.
- Distinctive: line 386
After creating the structure, offer to write the Decision Records section into the project's AGENTS.md.
- Distinctive: line 427
Only creates files if they don't exist (check with Read first)
- Distinctive: line 428
Never overwrites existing content
- Distinctive: line 432
After completion, inform the user:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Initialize AI Docs Directory
Bootstrap the ai_docs/ directory structure for decision records following the Decision Records with AI Assistance convention.
When to Use
- Starting a new project that will use decision records
- Before creating your first plan, research note, or handoff
- When
/create-plan,/create-research, or/create-handoffis invoked (they call this automatically)
Process
Step 1: Detect Repository Root
# Always use current repo root (works in both worktree and main repo)
REPO_ROOT=$(git rev-parse --show-toplevel)
AI_DOCS="$REPO_ROOT/ai_docs"Note: In worktrees, ai_docs/ is created in the worktree directory. Documents committed there will merge to main with your branch.
Step 2: Detect Mode and Create Directory Structure
Read the project's AGENTS.md (or CLAUDE.md) to determine the mode:
- Read
$REPO_ROOT/AGENTS.md(orCLAUDE.md) - Find the "Decision Records" section
- If it references a central repo for plans/research → central mode
- If it references local
ai_docs/or explicitly describes local mode → local mode - If no "Decision Records" section exists → ask the user:
"No Decision Records configuration found in AGENTS.md. Which mode should we use?"
- Local: Plans and research stored in this repo under
ai_docs/ - Central: Plans and research stored in a separate shared repo Use the answer for this run's directory creation.
- Local: Plans and research stored in this repo under
Local mode (plans/research stored in this repo):
mkdir -p "$AI_DOCS/plans"
mkdir -p "$AI_DOCS/research"
mkdir -p "$AI_DOCS/handoffs"
mkdir -p "$AI_DOCS/templates"Central mode (plans/research in a separate repo):
# Only create handoffs locally — plans/research live in the central repo
mkdir -p "$AI_DOCS/handoffs"After creating the local handoffs directory, verify the central repo:
- Extract the central repo path from AGENTS.md (e.g.,
../<ai-docs-repo>/) - Check if the path exists
- If it exists, check for expected structure:
plans/,research/,templates/,index.md - If the path is missing or the structure is incomplete:
- Warn user: "Central repo at
<path>appears uninitialized or incomplete" - Suggest: "Run
/init-central-docsin that repo to set it up"
- Warn user: "Central repo at
- Proceed with local setup regardless (handoffs are always local)
Step 3: Suggest .gitignore for Handoffs
Check if ai_docs/handoffs/ is already gitignored. If not, suggest adding:
# AI session handoffs — ephemeral by default
ai_docs/handoffs/This keeps handoffs local by default. Users can force-add specific handoffs with git add -f when they want to preserve them.
Step 4: Create index.md (if missing)
Only create if it doesn't exist. Ask the user for the project name first.
Template for index.md:
---
schema_version: 1
date: [YYYY-MM-DD]
type: index
status: active
topic: "[Project Name] Decision Records Index"
author: [git-user] # Human owner (run: git config user.name)
ai_assisted: true
ai_model: # optional: which model
---
# Project: [Project Name]
## Overview
[2-3 sentence project description. What problem does it solve? Who uses it?]
## Key Terminology
| Term | Definition |
|------|------------|
| [Domain term] | [Clear definition] |
## Architecture
[Brief description of system structure]
## Active Decisions
<!-- Add links to active research/ADRs here -->
<!-- Example: @ai_docs/research/YYYY-MM-DD-decision-name.md - One-line summary -->
## Current Plans
<!-- Add links to active plans here -->
<!-- Example: @ai_docs/plans/YYYY-MM-DD-feature-name.md - Status: planning|in-progress|blocked -->
## Conventions
- [Key coding convention or pattern]
- [Testing approach]
## Out of Scope
- [What this project explicitly doesn't handle]Step 5: Create Template Files (if missing)
Only create templates that don't already exist.
<!-- Keep in sync: templates also appear in init-ai-docs, init-central-docs, and create-*/SKILL.md -->templates/plan.md:
---
schema_version: 1
date: [YYYY-MM-DD]
type: plan
status: draft
topic: "[Feature Name] Implementation Plan"
# Accountability
author: [git-user] # Human owner (run: git config user.name)
ai_assisted: true
ai_model: # optional: which model
# Linking
related_prs: []
related_issue:
superseded_by: # Link to replacement doc if superseded
# Project
project: # Logical project/service name
repo: # GitHub org/repo
# repos: [] # Uncomment for cross-repo docs
# Git Context
git_commit: [short-sha]
branch: [branch name]
repository: [repo name]
# Classification
tags: []
data_sensitivity: internal
---
# Plan: [Feature Name]
## Overview
[1-2 paragraph summary of what this plan achieves]
## Assumptions
- [Assumption 1]
- [Assumption 2]
## Constraints
- [Constraint 1]
- [Constraint 2]
## Alternatives Considered
### Option A: [Name]
**Pros:** [benefits]
**Cons:** [drawbacks]
### Option B: [Name]
**Pros:** [benefits]
**Cons:** [drawbacks]
**Decision:** [Which option and why]
## Implementation Phases
### Phase 1: [Name]
**Goal:** [What this phase achieves]
**Tasks:**
- [ ] Task 1
- [ ] Task 2
**Success Criteria:**
- [Automated] `command to verify`
- [Manual] Description of manual check
### Phase 2: [Name]
...
## Verification
**Automated checks:**
```bash
# Commands to verify implementation
```
**Manual verification:**
- [ ] Check 1
- [ ] Check 2<!-- Keep in sync: templates also appear in init-ai-docs, init-central-docs, and create-*/SKILL.md -->templates/research.md:
---
schema_version: 1
date: [YYYY-MM-DD]
type: research
status: draft
topic: "[Topic] Research"
# Accountability
author: [git-user] # Human owner (run: git config user.name)
ai_assisted: true
ai_model: # optional: which model
# Linking
related_prs: []
related_issue:
superseded_by: # Link to replacement doc if superseded
# Project
project: # Logical project/service name
repo: # GitHub org/repo
# repos: [] # Uncomment for cross-repo docs
# Git Context
git_commit: [short-sha]
branch: [branch name]
repository: [repo name]
# Classification
tags: []
data_sensitivity: internal
---
# Research: [Topic]
## Context
[What prompted this research? What question are we trying to answer?]
## Findings
### [Finding 1]
[Details with links to sources]
### [Finding 2]
[Details with links to sources]
## Alternatives Considered
| Option | Pros | Cons |
|--------|------|------|
| [Option A] | [benefits] | [drawbacks] |
| [Option B] | [benefits] | [drawbacks] |
## Decision
[If this is an ADR: What was decided and why?]
[If exploratory: What are the key takeaways?]
## Consequences
[What are the implications of this decision/finding?]
## Open Questions
- [Question 1]
- [Question 2]
## Sources
- [Link to source 1]
- [Link to source 2]<!-- Keep in sync: templates also appear in init-ai-docs, init-central-docs, and create-*/SKILL.md -->templates/handoff.md:
---
schema_version: 1
date: [ISO datetime with timezone]
type: handoff
status: active
topic: "[Feature/Task Name] Implementation"
# Accountability
author: [git-user] # Human owner (run: git config user.name)
ai_assisted: true
ai_model: # optional: which model
# Git context
git_commit: [short hash]
branch: [branch name]
repository: [repo name]
# Classification
tags: []
---
# Handoff: [Brief Description]
## Task(s)
[Task descriptions with status: completed, in progress, planned.
If working from a plan, call out current phase.
Reference plan/research docs with @ai_docs/ prefix.]
## Critical References
[2-3 most important file paths - specs, designs, decisions.
Leave blank if none.]
## Recent Changes
[Recent codebase changes in file:line syntax]
## Learnings
[Important discoveries - patterns, bug root causes, key info.
Include explicit file paths.]
## Artifacts
[Exhaustive list of files produced/updated as paths or file:line refs]
## Action Items & Next Steps
[Prioritized list for next session to accomplish]
## Other Notes
[Additional context - relevant codebase sections, docs, etc.]Step 6: Write AGENTS.md Integration
After creating the structure, offer to write the Decision Records section into the project's AGENTS.md.
Based on the mode detected (or chosen) in Step 2, present the appropriate section and ask the user: "Would you like me to add the Decision Records section to AGENTS.md?"
If user accepts, use Edit to append the appropriate section to AGENTS.md:
Option A — Central repo (when plans/research are centralized):
## Decision Records
Plans and research for this project are centralized at:
**Repository:** ../<ai-docs-repo>/
Find this project's docs:
rg -l "repo: org/<this-repo>" ../<ai-docs-repo>/plans/
### Handoffs (Local)
Session handoffs live in `ai_docs/handoffs/` (gitignored by default).Option B — Local (when plans/research are in this repo):
## Decision Records
Before implementing significant changes, check `ai_docs/` for existing context:
- **Plans** (`ai_docs/plans/`): Active implementation plans
- **Research** (`ai_docs/research/`): Technical investigations and ADRs
- **Handoffs** (`ai_docs/handoffs/`): Session continuity notes (gitignored by default)
Start at `ai_docs/index.md` for project overview.If user declines, print the section as a suggestion they can add manually later.
Idempotency
This skill is safe to run multiple times:
- Uses
mkdir -pwhich succeeds if directory exists - Only creates files if they don't exist (check with Read first)
- Never overwrites existing content
Response
After completion, inform the user:
Local mode:
ai_docs/ structure initialized at: $AI_DOCS
Created:
- ai_docs/index.md (edit to add project details)
- ai_docs/plans/
- ai_docs/research/
- ai_docs/handoffs/ (gitignored by default)
- ai_docs/templates/{plan,research,handoff}.md
Consider adding the Decision Records snippet to your AGENTS.md.Central mode:
ai_docs/ structure initialized at: $AI_DOCS
Created:
- ai_docs/handoffs/ (gitignored by default)
Plans and research are managed in the central repo.
Consider adding the Decision Records snippet to your AGENTS.md.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

