Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Backend Documentation Creator
L3 Worker that creates 2 backend documentation files. CONDITIONAL - only invoked when project has backend or database.
Purpose & Scope
- Creates api_spec.md (if hasBackend)
- Creates database_schema.md (if hasDatabase)
- Receives Context Store from ln-110-project-docs-coordinator
- OpenAPI 3.0 compliant API specification
- ER diagrams in Mermaid for database schema
- Never gathers context itself; uses coordinator input
Invocation (who/when)
- ln-110-project-docs-coordinator: CONDITIONALLY invoked when:
hasBackend=true (express, fastify, nestjs, fastapi detected)
hasDatabase=true (pg, mongoose, prisma, sequelize detected)
- Never called directly by users
Inputs
From coordinator:
contextStore: Context Store with backend-specific data
- API_TYPE (REST, GraphQL, gRPC)
- API_ENDPOINTS (from route scan)
- AUTH_SCHEME (JWT, OAuth2, API keys)
- DATABASE_TYPE (PostgreSQL, MongoDB, MySQL)
- SCHEMA_OVERVIEW (from migrations/models)
- ER_DIAGRAM (generated from schema)
targetDir: Project root directory
flags: { hasBackend, hasDatabase }
Documents Created (2, conditional)
| File |
Condition |
Questions |
Auto-Discovery |
| docs/project/api_spec.md |
hasBackend |
Q39-Q40 |
Medium |
| docs/project/database_schema.md |
hasDatabase |
Q41-Q42 |
High |
Workflow
Phase 1: Check Conditions
- Parse flags from coordinator
- If
!hasBackend && !hasDatabase: return early with empty result
- Determine which documents to create
Phase 2: Create Documents
For each applicable document:
- Check if file exists (idempotent)
- If exists: skip with log
- If not exists:
- Copy template
- Replace placeholders with Context Store values
- Generate ER diagram for database_schema.md
- Mark
[TBD: X] for missing data
Phase 3: Self-Validate
- Check SCOPE tag
- Validate format:
- api_spec.md: endpoint table, request/response examples
- database_schema.md: ER diagram, table definitions
- Check Maintenance section
Phase 4: Return Status
{
"created": ["docs/project/api_spec.md"],
"skipped": ["docs/project/database_schema.md"],
"tbd_count": 2,
"validation": "OK"
}
Critical Notes
- Conditional: Skip entirely if no backend/database detected
- OpenAPI compliant: api_spec.md follows OpenAPI 3.0 structure
- ER diagrams: Generated in Mermaid erDiagram format
- Idempotent: Never overwrite existing files
NO_CODE_EXAMPLES Rule (MANDATORY)
API spec documents contracts, NOT implementations:
- ALLOWED in api_spec.md: JSON request/response schemas (this IS the API contract), endpoint tables
- FORBIDDEN: Controller implementations, validation classes, service code, middleware examples
- TEMPLATE RULE: api_spec_template.md includes
<!-- NO_CODE_EXAMPLES: ... --> tag - FOLLOW IT
Stack Adaptation Rule (MANDATORY)
- Links must reference stack-appropriate docs (Microsoft for .NET, MDN for JS)
- API examples must match project stack (Express for Node.js, FastAPI for Python)
Format Priority (MANDATORY)
Tables (endpoints, schemas) > Mermaid (ER diagrams) > Lists > Text
Definition of Done
Reference Files
- Templates:
references/templates/api_spec_template.md, database_schema_template.md
- Questions:
references/questions_backend.md (Q39-Q42)
Version: 1.2.0
Last Updated: 2025-01-12
1---2name: ln-113-backend-docs-creator-53description: "Creates backend docs (api_spec.md, database_schema.md). Use when project has backend API or database."4license: MIT5metadata:6 source: https://skillmd.com/skills/majiayu000/ln-113-backend-docs-creator-57---89> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If `shared/` is missing, fetch files via WebFetch from `https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}`.1011# Backend Documentation Creator1213L3 Worker that creates 2 backend documentation files. CONDITIONAL - only invoked when project has backend or database.1415## Purpose & Scope16- Creates api_spec.md (if hasBackend)17- Creates database_schema.md (if hasDatabase)18- Receives Context Store from ln-110-project-docs-coordinator19- OpenAPI 3.0 compliant API specification20- ER diagrams in Mermaid for database schema21- Never gathers context itself; uses coordinator input2223## Invocation (who/when)24- **ln-110-project-docs-coordinator:** CONDITIONALLY invoked when:25 - `hasBackend=true` (express, fastify, nestjs, fastapi detected)26 - `hasDatabase=true` (pg, mongoose, prisma, sequelize detected)27- Never called directly by users2829## Inputs30From coordinator:31- `contextStore`: Context Store with backend-specific data32 - API_TYPE (REST, GraphQL, gRPC)33 - API_ENDPOINTS (from route scan)34 - AUTH_SCHEME (JWT, OAuth2, API keys)35 - DATABASE_TYPE (PostgreSQL, MongoDB, MySQL)36 - SCHEMA_OVERVIEW (from migrations/models)37 - ER_DIAGRAM (generated from schema)38- `targetDir`: Project root directory39- `flags`: { hasBackend, hasDatabase }4041## Documents Created (2, conditional)4243| File | Condition | Questions | Auto-Discovery |44|------|-----------|-----------|----------------|45| docs/project/api_spec.md | hasBackend | Q39-Q40 | Medium |46| docs/project/database_schema.md | hasDatabase | Q41-Q42 | High |4748## Workflow4950### Phase 1: Check Conditions511. Parse flags from coordinator522. If `!hasBackend && !hasDatabase`: return early with empty result533. Determine which documents to create5455### Phase 2: Create Documents56For each applicable document:571. Check if file exists (idempotent)582. If exists: skip with log593. If not exists:60 - Copy template61 - Replace placeholders with Context Store values62 - Generate ER diagram for database_schema.md63 - Mark `[TBD: X]` for missing data6465### Phase 3: Self-Validate661. Check SCOPE tag672. Validate format:68 - api_spec.md: endpoint table, request/response examples69 - database_schema.md: ER diagram, table definitions703. Check Maintenance section7172### Phase 4: Return Status73```json74{75 "created": ["docs/project/api_spec.md"],76 "skipped": ["docs/project/database_schema.md"],77 "tbd_count": 2,78 "validation": "OK"79}80```8182## Critical Notes83- **Conditional:** Skip entirely if no backend/database detected84- **OpenAPI compliant:** api_spec.md follows OpenAPI 3.0 structure85- **ER diagrams:** Generated in Mermaid erDiagram format86- **Idempotent:** Never overwrite existing files8788### NO_CODE_EXAMPLES Rule (MANDATORY)89API spec documents **contracts**, NOT implementations:90- **ALLOWED in api_spec.md:** JSON request/response schemas (this IS the API contract), endpoint tables91- **FORBIDDEN:** Controller implementations, validation classes, service code, middleware examples92- **TEMPLATE RULE:** api_spec_template.md includes `<!-- NO_CODE_EXAMPLES: ... -->` tag - FOLLOW IT9394### Stack Adaptation Rule (MANDATORY)95- Links must reference stack-appropriate docs (Microsoft for .NET, MDN for JS)96- API examples must match project stack (Express for Node.js, FastAPI for Python)9798### Format Priority (MANDATORY)99Tables (endpoints, schemas) > Mermaid (ER diagrams) > Lists > Text100101## Definition of Done102- [ ] Conditions checked (hasBackend, hasDatabase)103- [ ] Applicable documents created104- [ ] ER diagram generated (if database_schema.md created)105- [ ] Self-validation passed106- [ ] **Actuality verified:** all document facts match current code (paths, functions, APIs, configs exist and are accurate)107- [ ] Status returned to coordinator108109## Reference Files110- Templates: `references/templates/api_spec_template.md`, `database_schema_template.md`111- Questions: `references/questions_backend.md` (Q39-Q42)112113---114**Version:** 1.2.0115**Last Updated:** 2025-01-12