From Claude Code Setup
Generate feature/module documentation after implementation. Covers business context (why, for whom, use cases), technical architecture (data flow, API, decisions), and operational details (limitations, edge cases). Integrates with the SSOT structure (docs/DOCUMENTATION_STRATEGY.md). USE WHEN: after >3 new files or a feature change. Triggers: "document this feature", "update docs/features", "doc-feature", "sync docs ↔ code", «задокументируй фичу», «обнови docs/features».
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-setup:doc-featureThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
product-discovery → requirements docs → [dev phase] → doc-feature
(JTBD, RICE) (PRD, contracts) (code) (feature doc)
doc-feature fills the gap between product specs and code-level docs. Routing decisions (where each piece of information belongs) come from the doc-routing skill.
/doc-feature [Feature Name]
/doc-feature Reports Phase 2
/doc-feature Search Module
docs/features/{kebab-case-name}.md
.claude/memory/MEMORY.md or your auto-memory file) — it contains API gotchas, decisions, and patterns already documented{ field: type } from the type definitionsThis phase MUST be thorough. Spend time reading code, not just listing files.
Detect scope: git diff --name-only main..HEAD → group by directory
Read existing knowledge (MUST read all that exist in your project):
docs/requirements/ — related requirements, business rules, user storiesdocs/GLOSSARY.md — terminology (metric names, domain types, role names).claude/research/ — research docs relevant to this featuredocs/requirements/product/PRD.md — product strategy contextAnalyze code IN DEPTH (MUST actually read the files, not just grep). Layer names below are examples from a typical frontend stack — map to your architecture:
Detect gaps: What's NOT documented that should be?
This is a MANDATORY checkpoint. You MUST present what you learned and ask questions.
Output a structured summary to chat:
📋 FEATURE DOCUMENTATION: {Feature Name}
📊 SCOPE ({N} files changed, {M} new):
• Hooks/services: {list}
• API: {endpoints used}
• Components: {list}
• Types: {list}
✅ WHAT I UNDERSTAND:
• Goal: [1 sentence — what problem this solves for the user]
• User: [who uses this and in what scenario]
• Data flow: [Source] → [Transform] → [UI Component]
• Key behavior: [what the user sees/does]
• API gotchas found: [list any response format surprises]
📝 WHAT I WILL DOCUMENT:
• Business context: [problem, users, use cases]
• Architecture: [data flow, endpoints, key files]
• Decisions: [N key decisions found in code/memory]
• Edge cases: [N edge cases found]
• New terms: [terms to add to the glossary]
🔄 REQUIREMENTS SYNC:
In requirements: [list existing use cases found in docs/requirements/]
Missing from requirements:
• [UC: scenario discovered in code but not in requirements]
→ These will be added to docs/requirements/ in Phase 3
❓ WHAT NEEDS CLARIFICATION:
1. [Specific question about business context]
2. [Specific question about user behavior]
3. [Specific question about edge case handling]
Answer the questions — I'll capture answers and generate documentation.
Or "skip" — I'll create the doc with [NEEDS_CLARIFICATION] markers where answers are needed.
⛔ STOP HERE. WAIT for user response.
[NEEDS_CLARIFICATION: original question]Bidirectional flow — discoveries flow not only into the feature doc, but also BACK to requirements.
Execute these steps IN ORDER:
Create docs/features/{kebab-case-name}.md using the template below.
Fill ALL sections with real data from Phase 1 analysis + Phase 2 answers.
Quality requirements for each section:
⛔ This step is NOT optional. Requirements must stay in sync with implementation reality.
docs/requirements/ — find the file(s) related to this feature### UC-{NNN}: {Scenario name}
**Actor:** {Role from the glossary}
**Precondition:** {What must be set up}
**Flow:**
1. {Step}
2. {Step}
**Result:** {What the user gets}
**Source:** Discovered during {feature name} implementation (YYYY-MM-DD)
Updated: docs/requirements/... (+N use cases)Verified: docs/requirements/... (no gaps found)Why this matters: Requirements are the SSOT for product behavior. If they don't reflect what was actually built, future sessions will lack business context. Feature docs capture HOW (architecture), requirements capture WHAT (user scenarios). Both must be current.
If new domain terms appeared (widget types, metric names, filter categories):
docs/GLOSSARY.md with clear definitionsFor each API endpoint used by the feature, add an @example to the function in your API layer (TSDoc/JSDoc/docstring — whatever your stack uses):
/**
* @example
* // Response shape:
* // { orders: [{ order_id: "9007199254740993", status: "shipped", total: 129.5 }] }
* // Gotcha: order_id exceeds Number.MAX_SAFE_INTEGER — keep it as a string
*/
Add a reference to the new feature doc in your project memory file.
📋 DOCUMENTATION COMPLETE:
Created: docs/features/{name}.md
Updated: docs/requirements/... (+N use cases) [or: no changes needed]
Updated: docs/GLOSSARY.md (+N terms) [or: no new terms]
Updated: <api layer> (N @example added) [or: examples already present]
Updated: <project memory> (+1 reference)
# {Feature Name}
**Date:** YYYY-MM-DD
**Status:** Active | Draft | Deprecated
**Issue:** [your tracker ID, e.g. TICKET-123]
**PRD Section:** [link to PRD section if it exists]
## Why (Business Context)
### Problem
[What BUSINESS problem this solves — from the user's perspective, not the developer's.
Example: "The analyst spends 2+ hours manually collecting numbers scattered across
several source systems. They need automated monitoring with trend visualization."]
### Users & Use Cases
- **[Role from the glossary]:** [Concrete scenario with actions]
- Precondition: [what must be configured]
- Action: [what the user does]
- Result: [what they get]
### Success Criteria
- [ ] [Measurable criterion — e.g. "Data loads in < 3 seconds for 1000 records"]
- [ ] [User-facing criterion — e.g. "Filtering narrows the table in real time"]
## What (Architecture)
### Data Flow
```
[Concrete names: component → hook → API endpoint → response type]
Example:
OrdersPage → useOrdersData() → getOrders() → BackendOrder[]
→ getOrderStats() → BackendOrderStats
```
### API Endpoints Used
| Endpoint | Method | Purpose | Response Format | Gotchas |
| ---------- | ------ | -------------- | ---------------------------------------- | ------------------------------------------------------ |
| /v1/orders | GET | Paginated list | `{ data: [...], meta: { page, total } }` | `page` is 1-based; `per_page` > 100 is silently capped |
### Key Files
| File | Role | Lines of interest |
| ---------------------- | --------------------------- | ----------------------------- |
| <hooks dir>/use-xxx.ts | Data fetching + aggregation | L45: batch logic, L120: merge |
| <api layer> | API calls | L300: endpoint definition |
## How (Implementation Details)
### Key Decisions
- **Decision:** [What was decided]
**Why:** [Business or technical reason — not "because it's simpler", be specific]
**Alternative considered:** [What was considered and why it was rejected]
**Date:** YYYY-MM-DD
### Domain Terms Used
- **[Term]** (see GLOSSARY.md): [how it applies to this feature]
## Limitations & Edge Cases
| Case | Current Behavior | Workaround / Future Plan |
| -------------------- | ------------------ | ------------------------ |
| [Concrete edge case] | [What happens now] | [What's planned] |
| [API error] | [How it's handled] | [What could be improved] |
## Related
- Requirements: `docs/requirements/...`
- Research: `.claude/research/...`
- ADR: `docs/architecture/decisions/ADR-NNN`
- Memory: <project memory file> → [section name]
npx claudepluginhub akuroglo/claude-code-setup --plugin claude-code-setupGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.