Initial Commit
This commit is contained in:
237
.claude/templates/module-docs.md
Normal file
237
.claude/templates/module-docs.md
Normal file
@@ -0,0 +1,237 @@
|
||||
# [Module Name]
|
||||
|
||||
## Purpose
|
||||
|
||||
Brief description of what this module does and why it exists. Explain the problem it solves and the value it provides.
|
||||
|
||||
## Features
|
||||
|
||||
- Feature 1 - Brief description
|
||||
- Feature 2 - Brief description
|
||||
- Feature 3 - Brief description
|
||||
- Additional features as needed
|
||||
|
||||
## Architecture
|
||||
|
||||
High-level architecture explanation
|
||||
|
||||
- Design patterns used (e.g., Factory, Singleton, Observer)
|
||||
- Key abstractions and interfaces
|
||||
- How components interact
|
||||
- Performance considerations
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic Example
|
||||
|
||||
```typescript
|
||||
import { MyClass } from '@suaveplan/package';
|
||||
|
||||
// Basic usage example
|
||||
const instance = new MyClass();
|
||||
instance.doSomething();
|
||||
```
|
||||
|
||||
### Advanced Example
|
||||
|
||||
```typescript
|
||||
import { MyClass, type MyOptions } from '@suaveplan/package';
|
||||
|
||||
// More complex usage patterns
|
||||
const options: MyOptions = {
|
||||
// Configuration options
|
||||
};
|
||||
|
||||
const instance = new MyClass(options);
|
||||
|
||||
// Advanced usage with callbacks, generics, etc.
|
||||
instance.advancedMethod((result) => {
|
||||
console.log('Result:', result);
|
||||
});
|
||||
```
|
||||
|
||||
### Integration Example
|
||||
|
||||
```typescript
|
||||
// Example showing how this module integrates with other modules
|
||||
import { MyClass } from '@suaveplan/package';
|
||||
import { RelatedClass } from '@suaveplan/related-package';
|
||||
|
||||
const myInstance = new MyClass();
|
||||
const relatedInstance = new RelatedClass(myInstance);
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### ClassName
|
||||
|
||||
Main class description and purpose.
|
||||
|
||||
#### constructor(options?: Options)
|
||||
|
||||
**`Parameters:`**
|
||||
|
||||
- `options` (optional) - Configuration object
|
||||
- `option1: string` - Description of option1
|
||||
- `option2: number` - Description of option2
|
||||
- `option3?: boolean` - Description of optional option3
|
||||
|
||||
**Returns:** Instance of ClassName
|
||||
|
||||
**`Example:`**
|
||||
|
||||
```typescript
|
||||
const instance = new ClassName({
|
||||
option1: 'value',
|
||||
option2: 42
|
||||
});
|
||||
```
|
||||
|
||||
#### method(param: Type): ReturnType
|
||||
|
||||
Description of what the method does.
|
||||
|
||||
**`Parameters:`**
|
||||
|
||||
- `param: Type` - Description of the parameter
|
||||
- Include constraints or validation rules
|
||||
- Mention default values if applicable
|
||||
|
||||
**Returns:** Description of the return value
|
||||
|
||||
**`Throws:`**
|
||||
|
||||
- `ErrorType` - When this error occurs
|
||||
|
||||
**`Example:`**
|
||||
|
||||
```typescript
|
||||
const result = instance.method('value');
|
||||
```
|
||||
|
||||
#### asyncMethod(param: Type): Promise<ReturnType>
|
||||
|
||||
Description of what the async method does.
|
||||
|
||||
**`Parameters:`**
|
||||
|
||||
- `param: Type` - Description
|
||||
|
||||
**Returns:** Promise that resolves to description
|
||||
|
||||
**`Example:`**
|
||||
|
||||
```typescript
|
||||
const result = await instance.asyncMethod('value');
|
||||
```
|
||||
|
||||
### InterfaceName
|
||||
|
||||
Description of the interface and when to implement it.
|
||||
|
||||
```typescript
|
||||
interface InterfaceName {
|
||||
property: Type;
|
||||
method(param: Type): ReturnType;
|
||||
}
|
||||
```
|
||||
|
||||
**`Properties:`**
|
||||
|
||||
- `property: Type` - Description of the property
|
||||
|
||||
**`Methods:`**
|
||||
|
||||
- `method(param: Type): ReturnType` - Description of the method
|
||||
|
||||
### TypeName
|
||||
|
||||
Description of the type and its use cases.
|
||||
|
||||
```typescript
|
||||
type TypeName = /* type definition */;
|
||||
```
|
||||
|
||||
**`Usage:`**
|
||||
|
||||
```typescript
|
||||
const example: TypeName = /* example value */;
|
||||
```
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
### Design Decisions
|
||||
|
||||
- **Decision 1**: Explanation of why this approach was chosen
|
||||
- Alternatives considered
|
||||
- Trade-offs made
|
||||
|
||||
- **Decision 2**: Another important design decision
|
||||
- Technical rationale
|
||||
- Impact on performance or maintainability
|
||||
|
||||
### Performance Considerations
|
||||
|
||||
- **Time Complexity**: O(n) for operation X
|
||||
- **Space Complexity**: O(1) for operation Y
|
||||
- **Optimizations**: Specific optimizations implemented (caching, memoization, etc.)
|
||||
- **Benchmarks**: Performance metrics if available
|
||||
|
||||
### Known Limitations
|
||||
|
||||
- **Limitation 1**: Description and potential workarounds
|
||||
- **Limitation 2**: Description and potential workarounds
|
||||
- **Browser Compatibility**: Any browser-specific limitations
|
||||
- **Platform Support**: Node.js, Deno, Browser support notes
|
||||
|
||||
### Testing Strategy
|
||||
|
||||
- Unit tests cover: X, Y, Z
|
||||
- Integration tests cover: A, B, C
|
||||
- E2E tests cover: P, Q, R
|
||||
- Test coverage: XX%
|
||||
|
||||
### Migration Guide (if applicable)
|
||||
|
||||
If this replaces or significantly changes an existing module
|
||||
|
||||
```typescript
|
||||
// Old way (deprecated)
|
||||
import { OldClass } from '@suaveplan/package';
|
||||
const old = new OldClass();
|
||||
|
||||
// New way (recommended)
|
||||
import { NewClass } from '@suaveplan/package';
|
||||
const updated = new NewClass();
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [Related Module 1](../related-module/related-module.md) - Brief description of relationship
|
||||
- [Related Module 2](../../other-package/module/module.md) - Brief description of relationship
|
||||
- [External Documentation](https://example.com/docs) - Relevant external resources
|
||||
- [RFC/ADR](../../docs/adr/001-decision.md) - Architecture decision records if applicable
|
||||
|
||||
## Changelog
|
||||
|
||||
### Version X.Y.Z (YYYY-MM-DD)
|
||||
|
||||
- **Added**: New features
|
||||
- **Changed**: Changes to existing features
|
||||
- **Deprecated**: Soon-to-be removed features
|
||||
- **Removed**: Removed features
|
||||
- **Fixed**: Bug fixes
|
||||
- **Security**: Security improvements
|
||||
|
||||
## Contributing
|
||||
|
||||
Guidelines specific to this module
|
||||
|
||||
- Code style preferences
|
||||
- Testing requirements (maintain XX% coverage)
|
||||
- Documentation requirements
|
||||
- Review process
|
||||
|
||||
## License
|
||||
|
||||
Indicate if different from project license, otherwise remove this section.
|
||||
Reference in New Issue
Block a user