Loading...
Loading...
Generate living documentation from git diffs — analyze branch comparisons or last N commits to automatically create or update Component Docs, Changelogs, ADRs, and Runbooks in Markdown with Obsidian-compatible YAML frontmatter. Use when asked to: (1) document changes from a branch diff, (2) generate release notes, (3) update service documentation, (4) analyze commits and produce docs, (5) create ADRs from architectural changes. Triggers: 'document the diff', 'generate docs from commits', 'update docs for [service]', 'release notes', 'what changed and document it', 'living docs', 'analiza el diff y genera documentacion'.
npx skill4agent add rcrespodev/rcrespodev-skills living-docsaliases${GIT_REPO_ROOT}/docs/docs/
├── components/ # Component Docs (services, apps, libraries)
│ ├── auth-service.md
│ ├── user-service.md
│ └── shared-utils.md
├── changelogs/ # Changelogs and release notes
│ ├── changelog-auth-service-2026-02-13.md
│ └── changelog-global-2026-02-13.md
├── adrs/ # Architecture Decision Records
│ ├── adr-001-redis-caching.md
│ └── adr-002-event-driven-auth.md
├── runbooks/ # Runbooks and SOPs
│ ├── runbook-deploy-auth-service.md
│ └── runbook-database-migration.md
└── index.md # Auto-generated index linking all docs| Doc Type | Directory | Filename Pattern |
|---|---|---|
| Component Doc | | |
| Changelog | | |
| ADR | | |
| Runbook | | |
| Index | | |
docs/index.md# Documentation Index
> Auto-generated. Last updated: YYYY-MM-DD
## Components
- [[auth-service]] — Authentication and authorization service
- [[shared-utils]] — Shared utility library
## Recent Changelogs
- [[changelog-auth-service-2026-02-13]] — Added OAuth2 support
## Architecture Decisions
- [[adr-001-redis-caching]] — Accepted
## Runbooks
- [[runbook-deploy-auth-service]] — Deployment procedure1. Gather context → Determine diff scope
2. Extract diff data → Run extract-diff.sh or git commands
3. Classify changes → Identify what matters (see references/analysis-patterns.md)
4. Select templates → Pick doc types (see references/templates.md)
5. Generate docs → Write markdown with full YAML frontmatter
6. Verify output → Cross-check generated docs against diff
7. Present summary → Show what was generated and whyfeature/XDevelop${GIT_REPO_ROOT}/docs/${GIT_REPO_ROOT}/docs/# Branch comparison (auto-detects default branch)
bash <this-skill-path>/scripts/extract-diff.sh <repo-path> --branch <target>
# Last N commits
bash <this-skill-path>/scripts/extract-diff.sh <repo-path> --commits 20
# Filtered by path (for monorepos)
bash <this-skill-path>/scripts/extract-diff.sh <repo-path> --branch Develop --path services/auth/--statreferences/analysis-patterns.md| Change Type | Impact | Doc Types |
|---|---|---|
| New component / module | High | Component Doc (new) |
| Public API change | High | Component Doc + Changelog (Breaking if contract changed) |
| Business logic change | High | Component Doc + Changelog |
| Inter-component interface change | High | Component Doc + flag downstream consumers |
| Schema / data model change | High | ADR + Component Doc |
| Major dependency added | Medium-High | ADR + Component Doc |
| Infrastructure / deployment change | Medium | Runbook |
| Internal refactor (same behavior) | Low | Changelog (Internal) or skip |
| Release milestone | — | Changelog |
references/templates.mdaliasestypelayerstatusownertech_stacklast_updatedsource_branchcommit_range[[wiki-links]]last_updatedsource_branchcommit_rangestatusactivedebtzombiegapaliasesownertech_stacklast_updatedcommit_range| Section | Strategy |
|---|---|
| Frontmatter | Merge: Update |
| What It Does | Replace only if the component's purpose fundamentally changed |
| API Surface / Exported API | Merge: Add new entries, update changed entries, mark removed entries as deprecated |
| Dependencies | Replace with current state |
| Configuration | Merge: Add new env vars, update changed ones |
| Key Files | Replace with current state |
| Recent Changes | Append new changes at the top, keep last 5-10 entries |
owner: "[[TBD]]"## Documentation Generated
| File | Type | Reason |
|------|------|--------|
| docs/components/auth-service.md | Component Doc | New endpoints in routes/users.ts |
| docs/changelogs/changelog-auth-2026-02-13.md | Changelog | 12 commits with 3 features, 2 fixes |
### Key Changes Documented
- [bullets]
### Skipped (Low Impact)
- [what and why]${GIT_REPO_ROOT}/docs/index.mdstatus: debt=== FILE STATS ===
services/auth/src/routes/auth.ts | 45 +++++++++--
services/auth/src/services/oauth.ts | 120 ++++++++++++++++++++++++++++
services/auth/src/types/auth.dto.ts | 15 ++++
packages/shared-types/src/user.ts | 8 ++--
services/auth/package.json | 2 + (added passport-google-oauth20)
services/auth/tests/oauth.test.ts | 85 ++++++++++++++++++++
=== COMMIT LOG ===
a1b2c3d feat: add Google OAuth2 login flow
d4e5f6g feat: add OAuth callback handler
h7i8j9k fix: handle missing email in OAuth profile
l0m1n2o chore: add passport-google-oauth20 dependencydocs/components/auth-service.mddocs/changelogs/changelog-auth-2026-02-13.mddocs/adrs/adr-003-google-oauth.mddocs/components/shared-types.mdUserDTOscripts/extract-diff.shreferences/templates.mdreferences/analysis-patterns.md