4.6 KiB
4.6 KiB
Codebase Mode — Onboarding Vault Workflow
Generates a StudyVault that helps new developers understand and navigate a source code project. All scanning and output MUST stay within CWD.
Phase C1: Project Exploration
- Scan project structure:
Globfor source files, config files, test files. Build a file tree. - Identify tech stack: Detect languages, frameworks, build tools, package managers from config files.
- Read key files: README, CONTRIBUTING, entry points (
main.*,index.*,app.*), config files. - Map project layout: Record directory purposes (e.g.,
src/,test/,config/,scripts/). - Present findings to user for confirmation before proceeding.
Phase C2: Architecture Analysis
- Identify architectural patterns: layered, hexagonal, microservice, monolith, serverless, etc.
- Map module boundaries: Which directories/packages form distinct modules or domains?
- Trace request flow: For a typical request (HTTP, event, CLI), trace the path through the code.
- Identify key abstractions: Interfaces, base classes, shared utilities, middleware, interceptors.
- Map dependencies: Internal module dependencies + external service integrations.
- Document data flow: How data enters, transforms, persists, and exits the system.
- Build architecture summary: Create a concise diagram (ASCII) + description for the vault.
Phase C3: Tag Standard
Define tag vocabulary before creating notes:
- Format: English, lowercase, kebab-case
- Categories:
#arch-*(architecture),#module-*(modules),#pattern-*(patterns),#config-*(config),#api-*(API),#test-*(testing) - Registry: Only registered tags allowed. Present registry to user for approval.
Phase C4: Vault Structure
Create StudyVault/ per codebase-templates.md folder structure:
00-Dashboard/— MOC, Quick Reference, Getting Started01-Architecture/— System overview, request flow, data flow02-XX/throughNN-XX/— One folder per module/domainNN+1-DevOps/— Build, deploy, CI/CD, environment configNN+2-Exercises/— Onboarding exercises
Phase C5: Dashboard Creation
Create 00-Dashboard/ with:
MOC (Map of Content)
- Architecture Overview: Link to architecture notes
- Module Map: Table of all modules with purpose + links
- API Surface: Summary of endpoints/commands/events
- Getting Started: Setup instructions, dev workflow, key commands
- Tag Index: Tag registry with hierarchy rules
- Onboarding Path: Recommended reading order for new developers
Quick Reference
- Key commands (build, test, deploy, lint)
- Environment setup steps
- Common debugging tips
- Important file locations
Phase C6: Module Notes
One note per module/domain. Per codebase-templates.md. Key rules:
- YAML frontmatter:
module,path,keywords(MANDATORY) - Purpose: What this module does (1-3 sentences)
- Key Files: Table of important files with descriptions
- Public Interface: Exported functions/classes/endpoints
- Internal Flow: How data moves through this module (ASCII diagram)
- Dependencies: What this module depends on + what depends on it
- Configuration: Relevant env vars, config keys
- Testing: How to run tests for this module, test patterns used
- Related Notes: Links to related modules and architecture notes
For API-heavy modules, create separate API notes per codebase-templates.md.
Phase C7: Onboarding Exercises
Create exercises that guide new developers through the codebase. Per codebase-templates.md.
- Code Reading: "Trace what happens when X occurs" — answer in fold callout
- Configuration: "How would you change Y?" — answer with file paths + snippets
- Debugging: "Where would you look if Z breaks?" — answer with investigation steps
- Extension: "How would you add feature W?" — answer with architectural approach
- Minimum 5 exercises per major module
- All answers use
> [!answer]- <label>fold callout (localize label to team language, e.g., "정답 보기" for Korean, "View Answer" for English)
Phase C8: Interlinking
## Related Noteson every module note- MOC links to every module note + exercise file
- Cross-link modules that depend on each other
- Architecture notes reference specific module implementations
- Exercises reference the modules they cover
- Quick Reference links to relevant module notes
Phase C9: Self-Review (MANDATORY)
Verify against quality-checklist.md Codebase Mode section. Fix and re-verify until all checks pass.