3.1 KiB
3.1 KiB
name: ipa-docs
description: IPA documentation sync specialist — tracks implementation status with symbols (pending/done/synced) across API_SPEC, DB_DESIGN, and UI_SPEC. Use when syncing docs after code implementation, verifying endpoint coverage, or keeping IPA docs accurate without full regeneration. Trigger phrases: "sync ipa docs", "update api spec after coding", "sync docs with implementation".
Overview
Synchronizes IPA-generated documentation with actual implementation after coding is complete. Updates status tracking, schema changes, and table definitions while preserving traceability IDs and manual notes.
When to Use
- After backend implementation to update endpoint and schema status
- When API routes or DB schema have changed
- After running a docs sync command in an IPA project
- When
docs/SRD.mdexists and implementation has progressed
Don't Use When
- No IPA docs exist yet (run ipa-spec first)
- You want to regenerate docs from scratch (use ipa-init instead)
- Only planning phase — no implementation has happened yet
IPA Documentation Structure
docs/
├── SRD.md # System Requirement Definition
├── UI_SPEC.md # Basic Design
├── API_SPEC.md # Detail Design (Interface)
└── DB_DESIGN.md # Detail Design (Database)
Sync Workflow
1. API_SPEC.md Sync
Status update rules:
| Before | After | Condition |
|---|---|---|
| pending | done | Endpoint implemented in code |
| done | synced | Docs verified match code exactly |
| synced | done | Code changed, needs re-sync |
Steps:
- Scan codebase for API routes/endpoints
- Compare with Endpoint Matrix
- Update status column
- Update request/response schemas if changed
- Preserve traceability lines (FR-xx, S-xx refs)
2. DB_DESIGN.md Sync
Steps:
- Read actual schema (Drizzle, Prisma, raw SQL)
- Compare with Table Definitions
- Update table columns, types, constraints
- Update ERD if structure changed
- Preserve traceability lines (E-xx refs)
3. UI_SPEC.md Sync (if requested)
Steps:
- Scan UI components in codebase
- Update Screen Specifications
- Preserve CJX section (personas, journey map)
- Preserve Design System section
Protected Sections
Never overwrite these manually-created sections:
| Doc | Protected Sections |
|---|---|
| SRD.md | All (source of truth) |
| UI_SPEC.md | CJX, Design System |
| API_SPEC.md | Traceability lines, Implementation Notes |
| DB_DESIGN.md | Traceability lines, Implementation Notes |
Sync Report Format
## Docs Sync Report
### API_SPEC.md
- Status Updates:
- POST /auth/login: pending → done
- GET /users/:id: done → synced
- Schema Updates:
- Updated: GET /users/:id response (added `avatar` field)
### DB_DESIGN.md
- Table Updates:
- users: Added `avatar_url` column
Traceability Validation
During sync, validate:
- Every endpoint has FR-xx ref
- Every screen has S-xx ref
- Every table has E-xx ref
Core Principles
- Update only what changed
- Preserve manual notes and comments
- Use incremental sync, not full regeneration
- Respect YAGNI/KISS/DRY