Skill: Repository Understanding
Purpose
Before making changes, understand how the repo is organized, what commands it provides, how tests run, and what conventions the team follows.
When to Use This Skill
- Starting work on a new repository
- Onboarding to a project
- Planning a large refactoring or feature
- Before making cross-cutting changes
Steps
1) Understand the directory structure
Read the repo root and understand:
/crates, /src, /packages: source code directories
/tests, /test: test files
/docs: documentation
/scripts: build/CI scripts
/infra, /deploy: infrastructure/deployment configs
/assets, /static: non-code files
Example output:
markenz/
crates/ # Rust libraries (physics, world, rng)
apps/ # Rust applications (engine)
tests/ # Integration tests
docs/ # Documentation
observability/ # Logging schemas and conventions
runbooks/ # Incident response playbooks
scripts/ci/ # CI helper scripts
2) Read the AGENTS.md file
This is the authoritative source for:
- Canonical commands (lint, test, format, typecheck, build)
- Directory-scoped rules and conventions
- How to run the project locally
- How to contribute
Example:
# Canonical Commands
- cargo build # Build all crates
- cargo test --all # Run all tests
- cargo clippy --all # Linter
3) Identify main entrypoints
For applications:
- Which files are the main entry points? (main.rs, index.js, server.py)
- How does the app start? (CLI args, env vars, configs)
- What are the key services or modules?
For libraries:
- What is the public API? (exported functions, types, classes)
- What are the main invariants and constraints?
4) Understand the dependency graph
- What external dependencies does the project use?
- Which modules depend on which?
- Are there circular dependencies or tight coupling?
Example (Rust):
cargo tree
5) Review the test structure
- Where are tests located? (same file, separate directory, docs)
- How do you run tests? (
npm test, pytest, cargo test)
- Are there separate test suites? (unit, integration, e2e)
- What's the coverage target?
6) Understand the build/CI process
- How does the code get built? (npm, cargo, Python setuptools)
- What CI system is used? (.github/workflows, GitLab CI, etc.)
- What are the quality gates? (linters, type checkers, tests)
- How are artifacts packaged and released?
Example:
cat .github/workflows/ci.yml | grep "run:" | head -10
7) Identify the tech stack
- Language(s): JavaScript, Rust, Python, etc.
- Frameworks: React, Express, Django, Actix, etc.
- Databases: PostgreSQL, MongoDB, Redis, etc.
- Testing: Jest, pytest, cargo test, etc.
- CI: GitHub Actions, GitLab CI, Jenkins, etc.
8) Review the GLOBAL_RULES or standards
Read the governance files:
- AGENTS.md (repo-level rules)
- GLOBAL_RULES.md (shared across team)
- .windsurf/ (Windsurf-specific conventions)
Understand:
- Code style guidelines
- Security requirements (secrets, validation, redaction)
- Observability requirements (logging, metrics, tracing)
- Test coverage targets
- Documentation standards
9) Capture key mental models
Document these in your head:
- Data flow: How does data enter, flow through, and exit the system?
- Error paths: How are failures handled and logged?
- Concurrency model: Is it single-threaded, multi-threaded, async?
- Deployment: How does code get to production?
10) Ask clarifying questions
If anything is unclear:
- Check the README and docs
- Look for comments in key files
- Check the git log for recent changes
- Ask the team or open issues
Quality Checklist
Verification Commands
# Understand structure
ls -la
cat AGENTS.md
cat README.md
# Identify commands
grep -r "\"scripts\":" package.json | head -20
cat Justfile | grep "^[a-z]"
grep "^##" AGENTS.md | head -20
# Run a basic test
npm test
cargo test --lib
python -m pytest
# Check dependencies
cargo tree | head -50
npm list | head -50
# Understand CI
cat .github/workflows/ci.yml | head -30
KAIZA-AUDIT Compliance
When using this skill as part of another task, your KAIZA-AUDIT block should include:
- Scope: Modules/areas touched
- Key Decisions: Explain how your changes respect the repo's conventions and tech stack
- Verification: Confirm commands from AGENTS.md pass (lint, tests, etc.)
1---2name: repo-understanding3description: Build a complete mental model of a repository's structure, commands, dependencies, and conventions. Invoke as @repo-understanding.4---56# Skill: Repository Understanding78## Purpose9Before making changes, understand how the repo is organized, what commands it provides, how tests run, and what conventions the team follows.1011## When to Use This Skill12- Starting work on a new repository13- Onboarding to a project14- Planning a large refactoring or feature15- Before making cross-cutting changes1617## Steps1819### 1) Understand the directory structure20Read the repo root and understand:21- `/crates`, `/src`, `/packages`: source code directories22- `/tests`, `/test`: test files23- `/docs`: documentation24- `/scripts`: build/CI scripts25- `/infra`, `/deploy`: infrastructure/deployment configs26- `/assets`, `/static`: non-code files2728Example output:29```30markenz/31 crates/ # Rust libraries (physics, world, rng)32 apps/ # Rust applications (engine)33 tests/ # Integration tests34 docs/ # Documentation35 observability/ # Logging schemas and conventions36 runbooks/ # Incident response playbooks37 scripts/ci/ # CI helper scripts38```3940### 2) Read the AGENTS.md file41This is the authoritative source for:42- Canonical commands (lint, test, format, typecheck, build)43- Directory-scoped rules and conventions44- How to run the project locally45- How to contribute4647Example:48```markdown49# Canonical Commands50- cargo build # Build all crates51- cargo test --all # Run all tests52- cargo clippy --all # Linter53```5455### 3) Identify main entrypoints56For applications:57- Which files are the main entry points? (main.rs, index.js, server.py)58- How does the app start? (CLI args, env vars, configs)59- What are the key services or modules?6061For libraries:62- What is the public API? (exported functions, types, classes)63- What are the main invariants and constraints?6465### 4) Understand the dependency graph66- What external dependencies does the project use?67- Which modules depend on which?68- Are there circular dependencies or tight coupling?6970Example (Rust):71```bash72cargo tree73```7475### 5) Review the test structure76- Where are tests located? (same file, separate directory, docs)77- How do you run tests? (`npm test`, `pytest`, `cargo test`)78- Are there separate test suites? (unit, integration, e2e)79- What's the coverage target?8081### 6) Understand the build/CI process82- How does the code get built? (npm, cargo, Python setuptools)83- What CI system is used? (.github/workflows, GitLab CI, etc.)84- What are the quality gates? (linters, type checkers, tests)85- How are artifacts packaged and released?8687Example:88```bash89cat .github/workflows/ci.yml | grep "run:" | head -1090```9192### 7) Identify the tech stack93- Language(s): JavaScript, Rust, Python, etc.94- Frameworks: React, Express, Django, Actix, etc.95- Databases: PostgreSQL, MongoDB, Redis, etc.96- Testing: Jest, pytest, cargo test, etc.97- CI: GitHub Actions, GitLab CI, Jenkins, etc.9899### 8) Review the GLOBAL_RULES or standards100Read the governance files:101- AGENTS.md (repo-level rules)102- GLOBAL_RULES.md (shared across team)103- .windsurf/ (Windsurf-specific conventions)104105Understand:106- Code style guidelines107- Security requirements (secrets, validation, redaction)108- Observability requirements (logging, metrics, tracing)109- Test coverage targets110- Documentation standards111112### 9) Capture key mental models113Document these in your head:114- Data flow: How does data enter, flow through, and exit the system?115- Error paths: How are failures handled and logged?116- Concurrency model: Is it single-threaded, multi-threaded, async?117- Deployment: How does code get to production?118119### 10) Ask clarifying questions120If anything is unclear:121- Check the README and docs122- Look for comments in key files123- Check the git log for recent changes124- Ask the team or open issues125126## Quality Checklist127128- [ ] Directory structure understood129- [ ] AGENTS.md read and key commands identified130- [ ] Main entrypoints identified131- [ ] Dependency graph understood132- [ ] Test structure known133- [ ] Build/CI process clear134- [ ] Tech stack documented135- [ ] Governance rules reviewed136- [ ] Data flow understood137- [ ] Can run tests locally138139## Verification Commands140141```bash142# Understand structure143ls -la144cat AGENTS.md145cat README.md146147# Identify commands148grep -r "\"scripts\":" package.json | head -20149cat Justfile | grep "^[a-z]"150grep "^##" AGENTS.md | head -20151152# Run a basic test153npm test154cargo test --lib155python -m pytest156157# Check dependencies158cargo tree | head -50159npm list | head -50160161# Understand CI162cat .github/workflows/ci.yml | head -30163```164165## KAIZA-AUDIT Compliance166167When using this skill as part of another task, your KAIZA-AUDIT block should include:168- **Scope**: Modules/areas touched169- **Key Decisions**: Explain how your changes respect the repo's conventions and tech stack170- **Verification**: Confirm commands from AGENTS.md pass (lint, tests, etc.)