repo-knowledge-base-builder
Build operational repo-local documentation for coding agents. Use when a repo needs docs that explain product intent, architecture, commands, testing, quality gates, observability, security, release,
SKILL.mdskills/repo-knowledge-base-builder/SKILL.md
GitHubRepo Knowledge Base Builder
Purpose
Create a docs/ knowledge base that works as project memory for agents. The docs must be operational: commands, paths, examples, invariants, failure modes, and update rules.
Inspect First
- README and existing docs
- manifests, scripts, CI, env examples, routes, schemas, migrations, and test layout
- source directories and module boundaries
- user-provided product description or feature specs
Procedure
Build the index first.
docs/00-index.mdlists the docs, what each owns, and when to update it.
Split knowledge by ownership.
- Product: goals, features, users, non-goals.
- Architecture: layers, boundaries, data flow, key decisions.
- Development: setup, commands, environment, CI.
- Testing: taxonomy, fixtures, examples, bug reproduction rule.
- Quality: style, dependencies, technical debt, golden patterns.
- Observability: logging, diagnostics, metrics/tracing where applicable.
- Security: baseline, secrets, auth/session, input validation.
- Release: checklist, rollback, smoke tests.
- Specs: feature-specific working decisions.
Convert decorative docs into operational docs.
- Prefer concrete paths and commands over general advice.
- Mark assumptions clearly.
- Mark deprecated docs clearly and link replacements.
Keep docs synchronized.
- Update docs when commands, env vars, routes, schemas, architecture, tests, or release behavior change.
- Use
documentation-sync-enforcerfor drift detection andscripts/check-docs. - Use
prompt-to-spec-converter,task-planning-and-pr-protocol, andrelease-readiness-harnessfor deeper specs, task protocol, and release docs.
Required Docs
docs/00-index.mddocs/product/vision.mddocs/architecture/overview.mddocs/architecture/boundaries.mddocs/development/local-setup.mddocs/development/commands.mddocs/development/environment.mddocs/testing/strategy.mddocs/quality/code-style.mddocs/quality/dependencies.mddocs/quality/technical-debt.mddocs/observability/debugging.mddocs/security/baseline.mddocs/release/checklist.md
Validation
- Every linked file exists.
- Commands in docs match wrappers or manifests.
- Environment variables mentioned in docs match
.env.example. - Docs identify their update triggers.
Completion Criteria
- A new agent can use docs to understand what to build, where to put it, how to validate it, and what not to break.
- Docs are not just prose summaries; they contain actionable repo facts.