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: MIT5---67> **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}`.89# Backend Documentation Creator1011L3 Worker that creates 2 backend documentation files. CONDITIONAL - only invoked when project has backend or database.1213## Purpose & Scope14- Creates api_spec.md (if hasBackend)15- Creates database_schema.md (if hasDatabase)16- Receives Context Store from ln-110-project-docs-coordinator17- OpenAPI 3.0 compliant API specification18- ER diagrams in Mermaid for database schema19- Never gathers context itself; uses coordinator input2021## Invocation (who/when)22- **ln-110-project-docs-coordinator:** CONDITIONALLY invoked when:23 - `hasBackend=true` (express, fastify, nestjs, fastapi detected)24 - `hasDatabase=true` (pg, mongoose, prisma, sequelize detected)25- Never called directly by users2627## Inputs28From coordinator:29- `contextStore`: Context Store with backend-specific data30 - API_TYPE (REST, GraphQL, gRPC)31 - API_ENDPOINTS (from route scan)32 - AUTH_SCHEME (JWT, OAuth2, API keys)33 - DATABASE_TYPE (PostgreSQL, MongoDB, MySQL)34 - SCHEMA_OVERVIEW (from migrations/models)35 - ER_DIAGRAM (generated from schema)36- `targetDir`: Project root directory37- `flags`: { hasBackend, hasDatabase }3839## Documents Created (2, conditional)4041| File | Condition | Questions | Auto-Discovery |42|------|-----------|-----------|----------------|43| docs/project/api_spec.md | hasBackend | Q39-Q40 | Medium |44| docs/project/database_schema.md | hasDatabase | Q41-Q42 | High |4546## Workflow4748### Phase 1: Check Conditions491. Parse flags from coordinator502. If `!hasBackend && !hasDatabase`: return early with empty result513. Determine which documents to create5253### Phase 2: Create Documents54For each applicable document:551. Check if file exists (idempotent)562. If exists: skip with log573. If not exists:58 - Copy template59 - Replace placeholders with Context Store values60 - Generate ER diagram for database_schema.md61 - Mark `[TBD: X]` for missing data6263### Phase 3: Self-Validate641. Check SCOPE tag652. Validate format:66 - api_spec.md: endpoint table, request/response examples67 - database_schema.md: ER diagram, table definitions683. Check Maintenance section6970### Phase 4: Return Status71```json72{73 "created": ["docs/project/api_spec.md"],74 "skipped": ["docs/project/database_schema.md"],75 "tbd_count": 2,76 "validation": "OK"77}78```7980## Critical Notes81- **Conditional:** Skip entirely if no backend/database detected82- **OpenAPI compliant:** api_spec.md follows OpenAPI 3.0 structure83- **ER diagrams:** Generated in Mermaid erDiagram format84- **Idempotent:** Never overwrite existing files8586### NO_CODE_EXAMPLES Rule (MANDATORY)87API spec documents **contracts**, NOT implementations:88- **ALLOWED in api_spec.md:** JSON request/response schemas (this IS the API contract), endpoint tables89- **FORBIDDEN:** Controller implementations, validation classes, service code, middleware examples90- **TEMPLATE RULE:** api_spec_template.md includes `<!-- NO_CODE_EXAMPLES: ... -->` tag - FOLLOW IT9192### Stack Adaptation Rule (MANDATORY)93- Links must reference stack-appropriate docs (Microsoft for .NET, MDN for JS)94- API examples must match project stack (Express for Node.js, FastAPI for Python)9596### Format Priority (MANDATORY)97Tables (endpoints, schemas) > Mermaid (ER diagrams) > Lists > Text9899## Definition of Done100- [ ] Conditions checked (hasBackend, hasDatabase)101- [ ] Applicable documents created102- [ ] ER diagram generated (if database_schema.md created)103- [ ] Self-validation passed104- [ ] **Actuality verified:** all document facts match current code (paths, functions, APIs, configs exist and are accurate)105- [ ] Status returned to coordinator106107## Reference Files108- Templates: `references/templates/api_spec_template.md`, `database_schema_template.md`109- Questions: `references/questions_backend.md` (Q39-Q42)110111---112**Version:** 1.2.0113**Last Updated:** 2025-01-12