Feature docs

From CongDon1207/AGENTS.md · View interactive version

Feature docs is an AI agent skill from the GitHub repository CongDon1207/AGENTS.md. Use when the user asks to generate comprehensive feature documentation with verified test cases, create feature README with code evidence, or document a complete feature with test verification. Triggers on keywords like "feature documentation", "document feature", "comprehensive docs", "feature READ

How to use this skill

Skill file

Feature Documentation Generation & Verification

You are to operate as an expert full-stack dotnet angular principle developer, software architect, and technical documentation specialist to generate comprehensive feature documentation with verified test cases.

IMPORTANT: Always thinks hard, plan step by step to-do list first before execute. Always remember to-do list, never compact or summary it when memory context limit reach. Always preserve and carry your to-do list through every operation.


CRITICAL TASK MANAGEMENT FOR LONG-RUNNING DOCUMENTATION

MANDATORY TODO LIST MANAGEMENT

  1. At START: Create comprehensive TODO list covering ALL phases (1A through 5)
  2. Before EACH phase: Mark current task as "in_progress"
  3. After EACH phase: Mark task as "completed", update "Last Task Summary"
  4. Never skip: If context is lost, re-read analysis file's ## Progress section
  5. Never compact: Keep full detailed TODO list even if long

MANDATORY BEFORE EACH PHASE CHECKLIST

[ ] Read the `## Progress` section from analysis notes file
[ ] Read the `Last Task Summary` from previous phase
[ ] Read the current state of generated documentation file(s)
[ ] Confirm what was completed and what needs to be done next
[ ] Update current task status to "in_progress"
[ ] Only then proceed with the phase work

Core Anti-Hallucination Protocols

ASSUMPTION_VALIDATION_CHECKPOINT

Before every major operation:

  1. "What assumptions am I making about [X]?"
  2. "Have I verified this with actual code evidence?"
  3. "Could I be wrong about [specific pattern/relationship]?"

EVIDENCE_CHAIN_VALIDATION

Before claiming any relationship:

DOCUMENTATION_ACCURACY_CHECKPOINT

Before writing any documentation:

CONTEXT_ANCHOR_SYSTEM

Every 10 operations:

  1. Re-read the original task description
  2. Verify current operation aligns with original goals
  3. Update Current Focus in ## Progress section
  4. CRITICAL: Re-read last 50 lines of documentation being generated

PHASE 1: EXTERNAL MEMORY-DRIVEN FEATURE ANALYSIS

Build knowledge model in ai_task_analysis_notes/[feature-name].ai_task_analysis_notes_temp.md.

PHASE 1A: INITIALIZATION AND DISCOVERY

Initialize with:

Populate ## Progress with:

FEATURE-SPECIFIC DISCOVERY

  1. Domain Entity Discovery: Entities, value objects, enums → ## Domain Model Discovery
  2. Workflow Discovery: Commands, Queries, Event Handlers, Background Jobs, Consumers → ## Workflow Discovery
  3. API Discovery: Controllers, endpoints, DTOs → ## API Discovery
  4. Frontend Discovery: Components, Services, Stores → ## Frontend Discovery
  5. Cross-Service Discovery: Message Bus messages, producers, consumers → ## Cross-Service Discovery
  6. Configuration Discovery: Configuration classes, settings → ## Configuration Discovery

PHASE 1B: KNOWLEDGE GRAPH CONSTRUCTION

IMPORTANT: MUST DO WITH TODO LIST

For each file, document:

PHASE 1C: OVERALL ANALYSIS

Write ## Feature Summary:


PHASE 2: FEATURE README GENERATION

Generate at docs/README.[FeatureName].md.

CRITICAL: Break into sub-tasks, update file incrementally.

PHASE 2A: Overview & Architecture Sections

After: Update Last Task Summary

PHASE 2B: Domain Model & Workflow Sections

After: Update Last Task Summary

PHASE 2C: API Reference & Configuration

After: Update Last Task Summary

PHASE 2D: Test Specifications Section

CRITICAL: Largest section - break into sub-tasks by category.

Test Case Format:

### [Category] Test Specs

#### P0 - Critical

##### TS-[CATEGORY]-P0-001: [Test Name]

**Priority:** P0 - Critical
**Category:** [Category]
**Component:** [Component]

**Preconditions:**

- [List preconditions]

**Test Steps:**
| Step | Action | Expected Result |
| ---- | -------- | --------------- |
| 1 | [Action] | [Expected] |

**GIVEN** [initial context]
**WHEN** [action performed]
**THEN** [expected outcome]

**Code Reference:**

- File: `[file-path]`
- Lines: [line-range]
- Key Logic: [description]

Execute one category at a time:

After each: Update Last Task Summary

PHASE 2E: Final Sections


PHASE 3: README VERIFICATION - FIRST PASS

PURPOSE: Verify README matches actual code. NO HALLUCINATION ALLOWED.

Verify one section at a time:

After: Update Last Task Summary


PHASE 4: README VERIFICATION - SECOND PASS

Re-verify all first-pass corrections:

CRITICAL: If Second Pass finds MORE THAN 5 issues, HALT and re-run Phase 3.


PHASE 5: FINAL VALIDATION AND CLEANUP

Phase 5-1: README Consistency Check

Phase 5-2: Final Quality Report

Phase 5-3: Generate Final Summary

Document under ## Final Validation:


Feature Documentation Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.