mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
- Introduced a unified API documentation template covering both Code API and HTTP API sections. - Created a folder navigation documentation template for directories containing subdirectories. - Developed a module README documentation template focusing on module purpose, usage, and dependencies. - Added a project architecture documentation template synthesizing module information and system design. - Implemented a project examples documentation template showcasing practical usage scenarios. - Established a project-level documentation template outlining project overview, architecture, and navigation.
99 lines
2.9 KiB
Plaintext
99 lines
2.9 KiB
Plaintext
# Module README Documentation Template
|
|
|
|
Generate comprehensive module documentation focused on understanding and usage. Explain WHAT the module does, WHY it exists, and HOW to use it. Do NOT duplicate API signatures (those belong in API.md).
|
|
|
|
## Structure
|
|
|
|
### 1. Purpose
|
|
|
|
**What**: Clearly state what this module is responsible for
|
|
**Why**: Explain why this module exists and what problems it solves
|
|
**Boundaries**: Define what is IN scope and OUT of scope
|
|
|
|
Example:
|
|
> The `auth` module handles user authentication and authorization. It exists to centralize security logic and provide a consistent authentication interface across the application. It does NOT handle user profile management or session storage.
|
|
|
|
### 2. Core Concepts
|
|
|
|
List and explain key concepts, patterns, or abstractions used by this module:
|
|
|
|
- **Concept 1**: [Brief explanation of important concept]
|
|
- **Concept 2**: [Another key concept users should understand]
|
|
- **Pattern**: [Architectural pattern used, e.g., "Uses middleware pattern for request processing"]
|
|
|
|
### 3. Usage Scenarios
|
|
|
|
Provide 2-4 common use cases with code examples:
|
|
|
|
#### Scenario 1: [Common use case title]
|
|
```typescript
|
|
// Brief example showing how to use the module for this scenario
|
|
import { functionName } from './module';
|
|
|
|
const result = functionName(input);
|
|
```
|
|
|
|
#### Scenario 2: [Another common use case]
|
|
```typescript
|
|
// Another practical example
|
|
```
|
|
|
|
### 4. Dependencies
|
|
|
|
#### Internal Dependencies
|
|
List other project modules this module depends on and explain why:
|
|
- **[Module Name]** - [Why this dependency exists and what it provides]
|
|
|
|
#### External Dependencies
|
|
List third-party libraries and their purpose:
|
|
- **[Library Name]** (`version`) - [What functionality it provides to this module]
|
|
|
|
### 5. Configuration
|
|
|
|
#### Environment Variables
|
|
List any environment variables the module uses:
|
|
- `ENV_VAR_NAME` - [Description, type, default value]
|
|
|
|
#### Configuration Options
|
|
If the module accepts configuration objects:
|
|
```typescript
|
|
// Example configuration
|
|
const config = {
|
|
option1: value, // Description of option1
|
|
option2: value, // Description of option2
|
|
};
|
|
```
|
|
|
|
### 6. Testing
|
|
|
|
Explain how to test code that uses this module:
|
|
```bash
|
|
# Command to run tests for this module
|
|
npm test -- path/to/module
|
|
```
|
|
|
|
**Test Coverage**: [Brief note on what's tested]
|
|
|
|
### 7. Common Issues
|
|
|
|
List 2-3 common problems and their solutions:
|
|
|
|
#### Issue: [Common problem description]
|
|
**Solution**: [How to resolve it]
|
|
|
|
---
|
|
|
|
## Rules
|
|
|
|
1. **No API duplication** - Refer to API.md for signatures
|
|
2. **Focus on understanding** - Explain concepts, not just code
|
|
3. **Practical examples** - Show real usage, not trivial cases
|
|
4. **Clear dependencies** - Help readers understand module relationships
|
|
5. **Concise** - Each section should be scannable and to-the-point
|
|
|
|
---
|
|
|
|
**Module Path**: [Auto-fill with actual module path]
|
|
**Last Updated**: [Auto-generated timestamp]
|
|
**See also**: [Link to API.md for interface details]
|