Loading...
Loading...
Analyzes project bounded contexts, extracts business rules and domain knowledge, writes ai-context/features/<context>.md files, and produces a teach-report.md with documentation coverage metrics. Trigger: /codebase-teach, teach codebase, extract domain knowledge, update feature docs.
npx skill4agent add fearovex/claude-config codebase-teachAnalyzes bounded contexts from the project's source tree, extracts domain knowledge per context, writesfiles, and producesai-context/features/<context>.mdwith coverage metrics.teach-report.md
/codebase-teachcodebase-teachai-context/features/memory-updatememory-initstatus: blockedstatus: failedai-context/stack.mdai-context/architecture.mdai-context/conventions.mdCLAUDE.md## Skills RegistryINFO: [filename] not found — proceeding without it.Last updated:Last analyzed:NOTE: [filename] last updated [date] — context may be stale. Consider running /memory-update or /project-analyze.config.yamlteach_max_files_per_contextmax_files = teach_max_files_per_contextmax_files = 10"File cap per context: [max_files] (source: config.yaml)""File cap per context: 10 (default)"src/src/auth/src/payments/app/features/domain/ai-context/features/sharedutilscommonlibtypeshookscomponents__tests__testtestsnode_modules.gitai-context/features/.md__template.md{ slug: kebab-case of directory name, dir_path, existing_feature_file: bool }UserProfileuser-profileauth_serviceauth-service"No bounded context directories detected."teach-report.md/memory-initai-context/features/"INFO: ai-context/features/ not found — feature files will be created if possible."teach-report.mdcontext_list = [{ slug, dir_path, existing_feature_file: bool }, ...]"Detected context: [slug] — [dir_path] (feature file: [exists|absent])"context_listdir_path.ts.tsx.js.jsx.py.java.kt.rb.go.ex.exs.cs.rs.php.swift*.test.**.spec.*test_**_test.**.d.ts*.min.*max_filesmax_files"[slug]: [total] files found — sampling [max_files] (cap applied)"skipped_filescontext_knowledge = { slug, rules[], invariants[], entities[], integrations[], files_read[], skipped[] }ai-context/features/<slug>.mdai-context/features/<slug>.mdai-context/features/[auto-updated]ai-context/features/<slug>.md<!-- [auto-updated]: codebase-teach ... --><!-- [/auto-updated] -->[auto-updated][auto-updated][auto-updated][auto-updated]# [Context Name] — Domain Knowledge
Last updated by: codebase-teach
Last run: YYYY-MM-DD
---
## Domain Overview
<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD -->
[AI-extracted 2–4 sentence summary of what this bounded context does and its primary responsibilities]
<!-- [/auto-updated] -->
---
## Business Rules and Invariants
<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD -->
[AI-extracted explicit conditional constraints and always-true invariants from the source]
- Rule: [description]
- Invariant: [description]
<!-- [/auto-updated] -->
---
## Data Model Summary
<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD -->
Key entities detected:
| Entity | Key Fields |
|--------|-----------|
| [Name] | [field1, field2, ...] |
<!-- [/auto-updated] -->
---
## Integration Points
<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD -->
External dependencies and integration touchpoints:
- [service/API name]: [what it is used for]
<!-- [/auto-updated] -->
---
## Decision Log
<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD -->
<!-- Append new AI-detected decisions below. Human entries above this marker are preserved. -->
<!-- [/auto-updated] -->
---
## Known Gotchas
<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD -->
<!-- Append new AI-detected gotchas below. Human entries above this marker are preserved. -->
<!-- [/auto-updated] -->_template.md_teach-report.mddocumented_contexts = count of contexts that have an ai-context/features/<slug>.md file after Step 3
total_contexts = count of contexts in context_list
coverage_pct = (documented_contexts / total_contexts) * 100 (0 if total_contexts == 0)
gap_list = contexts in context_list where existing_feature_file was false before Step 3
AND no file was created in Step 3teach-report.mdanalysis-report.md# Teach Report — [Project Name]
Last run: YYYY-MM-DD
Skill: codebase-teach
## Summary
Contexts detected: [total_contexts]
Contexts documented: [documented_contexts]
Coverage: [coverage_pct]%
## Coverage
[coverage_pct]% — [documented_contexts] of [total_contexts] contexts documented.
## Gaps
Contexts detected in code but not documented in ai-context/features/:
- [context-slug] — [dir_path]
[If no gaps: "None — all detected contexts are documented."]
## Files Read
### [context-slug]
- [file path] — sampled
- [file path] — sampled
- [file path] — SKIPPED: [reason]
[Repeat for each context]
## Sections Written / Updated
- ai-context/features/[context].md — [created|updated] — sections: [list of sections written]ai-context/features/Note: ai-context/features/ was absent at run time. Recommend running /memory-init to scaffold the directory before re-running /codebase-teach.
ai-context/stack.mdai-context/architecture.mdai-context/conventions.mdai-context/known-issues.mdai-context/changelog-ai.mddocs/_ai-context/features/[auto-updated]teach_max_files_per_contextteach-report.mdteach-report.md[auto-updated]<!-- [auto-updated]: codebase-teach — last run: YYYY-MM-DD --><!-- [/auto-updated] -->project-analyzeteach-report.md| Section | Content |
|---|---|
| Summary | Contexts detected, documented, coverage % |
| Coverage | Percentage and ratio |
| Gaps | Contexts found in code but undocumented (or "None") |
| Files Read | Per-context list of files sampled and skipped |
| Sections Written / Updated | Per-feature-file: created or updated, which sections |
ai-context/features/<context>.md[auto-updated]