skills/codebase-docs/SKILL.md
Generate and maintain AI-readable markdown documentation for a codebase in docs/. Use this skill whenever the user asks to document their codebase, generate project docs, create architecture docs, update documentation after code changes, build a knowledge base for AI agents, create onboarding docs, map out a codebase, or explain a project structure. Also trigger when users say things like "document this repo", "create docs for my project", "update the docs", "write architecture documentation", "help AI understand my code", "generate a codebase overview", or "maintain docs". This skill is specifically about creating structured markdown files in a docs/ directory that serve as a knowledge base — NOT about writing inline code comments, README files, or API reference docs from docstrings.
npx skillsauth add espennilsen/pi codebase-docsInstall 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.
Generate and maintain a structured set of markdown files in docs/ that give AI agents (and humans) a fast, accurate understanding of a codebase without needing to search through source files.
The docs you produce are a map, not the territory. They should let an AI agent answer questions like "where does authentication happen?", "how does data flow from API to database?", or "what are the key abstractions?" — without reading every file. Optimize for navigability and accuracy over exhaustiveness.
docs/ directory maintenanceBefore writing anything, understand what you're documenting.
docs/ directoryIf a docs/ directory already exists, read it first. You'll be updating, not starting from scratch.
Create the docs/ directory with the files described below. Not every project needs every file — use judgment. A small CLI tool doesn't need DATA_MODEL.md, and a pure library doesn't need DEPLOYMENT.md.
Refer to references/doc-templates.md for the exact templates and structure for each file. Read that file before writing any documentation.
| File | Purpose |
|------|---------|
| docs/OVERVIEW.md | Project purpose, tech stack, architecture style, key concepts. This is the entry point — an AI agent should read this first. |
| docs/STRUCTURE.md | Annotated directory tree showing what lives where and why. Maps directories to responsibilities. |
| docs/ARCHITECTURE.md | How components connect. Data flow, request lifecycle, key abstractions, dependency graph between modules. |
| File | When to Include | Purpose |
|------|-----------------|---------|
| docs/DATA_MODEL.md | Project has a database, ORM, or significant data structures | Schema overview, entity relationships, key types/interfaces |
| docs/API.md | Project exposes or consumes APIs | Endpoints, request/response shapes, auth patterns |
| docs/CONFIGURATION.md | Non-trivial config (env vars, feature flags, multi-environment) | All configuration knobs, defaults, and where they're used |
| docs/PATTERNS.md | Project uses recurring patterns worth documenting | Design patterns, conventions, error handling strategy, logging approach |
| docs/DEPLOYMENT.md | Project has deployment infrastructure | Build process, environments, CI/CD, infrastructure overview |
| docs/DEVELOPMENT.md | Project has non-obvious dev setup or workflow | Local setup, testing strategy, debugging tips, contribution workflow |
| docs/GLOSSARY.md | Domain-specific or project-specific terminology | Term definitions that an AI agent needs to understand the codebase |
Always generate docs/INDEX.md as the last file. This is a table of contents linking all other docs with one-line descriptions. An AI agent uses this to decide which file to read for a given question.
Follow these principles for every file:
process() method when..."src/auth/middleware.tsLast updated date at the top of each file## Changes Log section at the bottom of each file with space for noting updatesWhen updating rather than creating from scratch:
docs/ firstLast updated date and add a note to the Changes Logdocs/INDEX.md if any files were added or removedAfter generating or updating docs, do a quick sanity check:
STRUCTURE.md matches realityINDEX.md links to all docs that were createdAll files go in the docs/ directory at the project root. Use the exact filenames specified above (UPPERCASE with .md extension). Present the full set to the user when done, summarizing what was created and any areas where the docs might need human review (e.g., business logic descriptions, architectural decisions that aren't obvious from code alone).
tools
# pi-a2a Long-Running Tasks Skill ## Overview The pi-a2a extension supports **long-running tasks** that can execute for hours or days without timeouts. This is essential for: - Data processing pipelines - Batch operations - Research and aggregation tasks - External API jobs with unpredictable duration - Any A2A task that exceeds the standard timeout ## When to Use **Use long-running tasks when:** - Task execution time is unpredictable or known to exceed 10 minutes - The remote agent is proc
development
Orchestrate cmux terminal panes — split terminals, run parallel processes, read output from other panes, and use the built-in browser. Use when working inside cmux and you need to run a dev server, watch tests, spawn sub-agents, or preview web pages.
testing
Review UI designs and implementations for accessibility, consistency, usability, and visual quality. Use when asked to review a design, audit accessibility, check UI consistency, compare implementation against mockups, or evaluate a user interface.
tools
Create, review, and improve skills for Pi agents. A skill is a folder with a SKILL.md that teaches an agent specialized workflows, domain knowledge, or tool integrations. Use when asked to create a new skill, improve an existing skill, review a skill for quality, scaffold a skill from a workflow, or convert documentation into a skill. Also triggers on "make a skill for", "build a skill", "skill for [topic]", "teach the agent to", or "package this workflow as a skill".