skills/initialize-repo/SKILL.md
Automates the setup of `.context/` for a new project. Use this skill whenever someone mentions setting up a new repository, onboarding a project to the agent system, bootstrapping context, or when you detect a project has no `.context/` directory. Also use when someone says "initialize", "set up", or "configure" in relation to project context, or when installing the skill kit for the first time. Skip only when `.context/` already exists and is populated — in that case use `context-review` instead.
npx skillsauth add maestria-co/ai-playbook initialize-repoInstall 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.
Set up the .context/ knowledge base for a project so that AI agents and developers
start every task informed. This skill runs once per repository. It detects the project's
characteristics, copies the context template, populates it with inferred details, and
configures AI tool integration files.
If .context/ already exists with content, do not overwrite — use context-review instead.
Check 1 — Verify no existing context
Look for .context/overview.md in the current working directory.
.context/ already exists. Use context-review to update it."[PLACEHOLDER] markers → proceed.Check 2 — Locate the skill kit template
Find the context_template/ directory using the find-context-template skill.
Detection approach (safe pattern):
template_dir=""
if [ -d ~/.copilot/skills/_shared/context_template/ ]; then
template_dir=~/.copilot/skills/_shared/context_template
elif [ -d ~/.claude/skills/_shared/context_template/ ]; then
template_dir=~/.claude/skills/_shared/context_template
fi
Check locations in order:
~/.copilot/skills/_shared/context_template/ (Copilot install)~/.claude/skills/_shared/context_template/ (Claude Code install)Security note: Do not use nested command substitution like $(realpath ...) — use direct tilde expansion or cd + pwd for path resolution.
Scan the project to identify its stack. Check these files:
| File | Detects |
| ------------------------------------- | -------------------------------------------------- |
| package.json | Node.js — framework, test runner, key dependencies |
| requirements.txt / pyproject.toml | Python — framework, testing library |
| *.csproj / *.sln | .NET — framework, target version |
| pom.xml / build.gradle | Java/Kotlin — framework, build tool |
| Cargo.toml | Rust — edition, key crates |
| go.mod | Go — module path, dependencies |
Also scan:
.github/workflows/ or other CI config — identify CI/CD pipelinegit log --oneline -20 for recent activity; git branch -a for branching patternsRecord findings. These feed into Step 3.
Create the following directories:
mkdir -p .context/{decisions,retrospectives,tasks}
If the project has non-obvious workflows (complex branching, multi-step CI), also create .context/workflows/.
If the project has a rich domain with many entities or project-specific terminology, also create .context/domains/.
Universal files (copy verbatim from template):
META.mddecisions/index.mddecisions/ADR-001-example-decision.mdretrospectives/README.mdProject-specific files (generate from Step 1 scan):
| File | Generation approach | Don't duplicate |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| overview.md | Infer from manifest + directory structure. Leave <!-- TODO --> for unknowable fields (business goals, compliance). | — |
| architecture.md | System structure: layers, data flow, key integrations, where it runs. Structural — not code style, not decisions. | Don't repeat tech stack from overview.md |
| standards.md | Code style, naming conventions, error handling, structural patterns. Read 3+ source files. Use real file names as examples. | Don't describe what the code does — that's architecture.md |
| testing.md | Test framework, how to run tests, file naming, mocking approach. Read 2–3 real test files. | Don't duplicate file paths already in standards.md |
| decisions/ADR-001-example-decision.md | Replace the example with 1–2 real architectural choices visible in the codebase. Keep the ADR format exactly. | Don't re-document patterns in standards.md or structure in architecture.md |
For Claude Code — create or update CLAUDE.md:
If CLAUDE.md does not exist, copy it from the template:
~/.copilot/skills/_shared/context_template/CLAUDE.md → CLAUDE.md
Then fill in the [Project Name] and brief description placeholders.
If CLAUDE.md already exists, add at the top (preserve existing content):
## Project Context
See @.context/overview.md for project overview and tech stack.
See @.context/architecture.md for system structure, layers, and integrations.
See @.context/standards.md for coding conventions and patterns.
See @.context/testing.md for test framework and patterns.
See @.context/decisions/ for architectural decision records (ADRs).
For VS Code Copilot — create or update .github/copilot-instructions.md:
## Project Context
Read `.context/overview.md` for project overview and tech stack before starting any task.
Read `.context/architecture.md` for system structure and integration points.
Read `.context/standards.md` for coding conventions and patterns.
Read `.context/testing.md` for test framework and patterns.
Read `.context/decisions/index.md` for architectural decision records.
Confirm all required files exist and are non-empty:
for f in .context/META.md .context/overview.md .context/architecture.md \
.context/standards.md .context/testing.md \
.context/decisions/index.md .context/retrospectives/README.md; do
[ -s "$f" ] && echo "✅ $f" || echo "❌ $f — missing or empty"
done
Quality bar: Before finishing, apply the context-document-guidelines skill to each generated file. Each file must pass the quality checklist (specific to this project, contains real file paths, explains rationale, not generic boilerplate). Files that only contain placeholder text should be flagged for human completion rather than left as misleading stubs.
Initialized: .context/ for [project name]
Tech stack detected: [language, framework, test runner]
Files created: [count]
Files with TODOs: [count] — these need human input
Next steps:
1. Review .context/overview.md — fill in business goals, external links, compliance
2. Commit .context/ to version control
3. Tell your team — link to META.md
.context/ files that have content beyond placeholders<!-- TODO: [reason] --> for anything that cannot be inferred from code.context/, CLAUDE.md, and copilot-instructions.mddevelopment
Writes and runs a test suite for a piece of code, covering happy path, edge cases, error cases, and security cases. Use when: implementation is complete and needs test coverage, a bug needs a reproduction test and fix validation, or code needs coverage before a refactor. Do not use when: the code under test is not yet implemented, or the spec is still unclear.
testing
Use when creating a new skill, editing an existing skill, or helping a user author a skill for this system. Covers structure, discoverability, quality, and discipline hardening.
development
Evidence-based verification process to run before marking any task complete. Use this skill every time you're about to report that work is done — for features, bug fixes, refactoring, or any code change. This catches the most common failure mode: declaring "done" without proof. If you're finishing up and about to tell the user the task is complete, run this checklist first.
development
Teaches agents how to discover, select, and invoke skills from the skill library. Use this skill whenever you're uncertain which skill applies to a task, when composing multiple skills for complex work, or when you need to understand what skills are available. This is your go-to when facing an ambiguous task and need to figure out the right approach before diving into implementation.