@dollhousemcp/mcp-server
Version:
DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.
409 lines (344 loc) • 7.9 kB
Markdown
---
name: "Code Documentation"
description: "Technical documentation template for code modules, APIs, and functions"
type: "template"
version: "1.0.0"
author: "DollhouseMCP"
created: "2025-07-23"
category: "technical"
tags: ["documentation", "code", "api", "technical", "reference"]
variables:
module_name:
type: "string"
description: "Name of the module or component"
required: true
module_type:
type: "string"
description: "Type of code module"
default: "module"
enum: ["module", "class", "function", "api", "library", "component"]
version:
type: "string"
description: "Version number"
required: true
default: "1.0.0"
language:
type: "string"
description: "Programming language"
required: true
default: "typescript"
author:
type: "string"
description: "Author name"
required: true
outputFormats: ["markdown", "html", "jsdoc", "typedoc"]
includes: []
---
**Type:** {{module_type}}
**Version:** {{version}}
**Language:** {{language}}
**Author:** {{author}}
**Last Updated:** {{last_updated}}
{{
{{overview}}
{{else}}
[]
{{/if}}
1. [Installation](
2. [Quick Start](
3. [API Reference](
4. [Examples](
5. [Configuration](
6. [Error Handling](
7. [Testing](
8. [Contributing](
{{
{{installation_method}}
{{else}}
```bash
npm install {{module_name}}
yarn add {{module_name}}
pnpm add {{module_name}}
```
{{/if}}
{{
{{
- {{requirement}}
{{/each}}
{{else}}
- Node.js >= 18.0.0
- TypeScript >= 5.0.0 (if using TypeScript)
{{/if}}
```{{language}}
{{
{{quick_start_code}}
{{else}}
// Import the module
import { {{module_name}} } from '{{module_name}}';
// Basic usage
const instance = new {{module_name}}({
// configuration options
});
// Use the module
const result = await instance.doSomething();
console.log(result);
{{/if}}
```
{{
{{class_description}}
{{/if}}
```{{language}}
{{
{{constructor_signature}}
{{else}}
new {{module_name}}(options?: {{module_name}}Options)
{{/if}}
```
**Parameters:**
{{
{{
- `{{name}}` ({{type}}){{
{{/each}}
{{else}}
- `options` (Object) - Optional configuration object
- `option1` (string): Description of option1
- `option2` (boolean): Description of option2
{{/if}}
{{
{{
{{description}}
```{{../language}}
{{signature}}
```
**Parameters:**
{{
- `{{name}}` ({{type}}){{
{{/each}}
**Returns:** {{returns}}
**Example:**
```{{../language}}
{{example}}
```
{{/each}}
{{else}}
Brief description of what this method does.
```{{language}}
methodName(param1: string, param2?: number): Promise<Result>
```
**Parameters:**
- `param1` (string): Description of param1
- `param2` (number) - Optional: Description of param2
**Returns:** Promise<Result> - Description of return value
**Example:**
```{{language}}
const result = await instance.methodName('value', 123);
```
{{/if}}
{{
{{
- **Type:** {{type}}
- **Access:** {{access}}
- **Description:** {{description}}
{{
{{/each}}
{{else}}
- **Type:** string
- **Access:** public readonly
- **Description:** Description of this property
{{/if}}
{{
{{
{{description}}
**Event Data:**
```{{../language}}
{{data_structure}}
```
**Example:**
```{{../language}}
instance.on('{{name}}', (data) => {
console.log('Event received:', data);
});
```
{{/each}}
{{else}}
This module does not emit any events.
{{/if}}
```{{language}}
{{
{{basic_example}}
{{else}}
import { {{module_name}} } from '{{module_name}}';
async function main() {
const instance = new {{module_name}}({
debug: true
});
try {
const result = await instance.process('input data');
console.log('Success:', result);
} catch (error) {
console.error('Error:', error);
}
}
main();
{{/if}}
```
```{{language}}
{{
{{advanced_example}}
{{else}}
// Advanced usage with custom configuration
const config = {
timeout: 5000,
retries: 3,
customHandler: (data) => {
// Custom processing logic
return data.transform();
}
};
const instance = new {{module_name}}(config);
// Chain multiple operations
const result = await instance
.operation1()
.operation2()
.operation3()
.execute();
{{/if}}
```
{{
| Option | Type | Default | Description |
|--------|------|---------|-------------|
{{
| {{name}} | {{type}} | {{default}} | {{description}} |
{{/each}}
{{else}}
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| debug | boolean | false | Enable debug logging |
| timeout | number | 30000 | Operation timeout in ms |
| retries | number | 3 | Number of retry attempts |
{{/if}}
{{
{{
- `{{name}}`: {{description}}
{{/each}}
{{else}}
- `{{MODULE_NAME}}_DEBUG`: Enable debug mode
- `{{MODULE_NAME}}_TIMEOUT`: Override default timeout
{{/if}}
{{
{{
- **Code:** {{code}}
- **Description:** {{description}}
- **How to handle:** {{handling}}
{{/each}}
{{else}}
- **Code:** VALIDATION_ERROR
- **Description:** Input validation failed
- **How to handle:** Check input parameters
- **Code:** TIMEOUT_ERROR
- **Description:** Operation timed out
- **How to handle:** Retry or increase timeout
{{/if}}
```{{language}}
try {
const result = await instance.riskyOperation();
} catch (error) {
if (error.code === 'VALIDATION_ERROR') {
// Handle validation error
} else if (error.code === 'TIMEOUT_ERROR') {
// Handle timeout
} else {
// Handle unknown error
throw error;
}
}
```
```bash
npm test
npm run test:coverage
npm test -- path/to/test
```
```{{language}}
{{
{{test_example}}
{{else}}
import { {{module_name}} } from '{{module_name}}';
describe('{{module_name}}', () => {
let instance;
beforeEach(() => {
instance = new {{module_name}}();
});
test('should perform basic operation', async () => {
const result = await instance.doSomething();
expect(result).toBeDefined();
});
});
{{/if}}
```
```bash
git clone {{repository_url}}
npm install
npm run build
npm run dev
```
{{
{{code_style}}
{{else}}
- Use ESLint configuration
- Follow TypeScript best practices
- Write comprehensive tests
- Document all public APIs
{{/if}}
{{
{{license}}
{{else}}
MIT License - see LICENSE file for details
{{/if}}
---
*Generated with {{module_name}} v{{version}}*