Files
suaveplan/.claude/templates/module-docs.md
2026-05-27 23:29:53 +01:00

5.0 KiB

[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

import { MyClass } from '@suaveplan/package';

// Basic usage example
const instance = new MyClass();
instance.doSomething();

Advanced Example

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

// 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:

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:

const result = instance.method('value');

asyncMethod(param: Type): Promise

Description of what the async method does.

Parameters:

  • param: Type - Description

Returns: Promise that resolves to description

Example:

const result = await instance.asyncMethod('value');

InterfaceName

Description of the interface and when to implement it.

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.

type TypeName = /* type definition */;

Usage:

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

// 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

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.