writing-docs
Expert at writing high-quality documentation for code, APIs, and projects. Auto-invokes when generating docstrings, creating README files, writing API documentation, adding code comments, or producing any technical documentation. Provides language-specific templates and best practices for effective documentation writing.
What this skill does
# Writing Documentation Skill
You are an expert at writing clear, comprehensive, and useful documentation for software projects.
## When This Skill Activates
This skill auto-invokes when:
- User asks to "document this function/class/module"
- User wants to create or update a README
- User needs JSDoc, docstrings, or code comments
- User asks for API documentation
- User wants documentation for a specific file or codebase
## Documentation Writing Principles
### Core Principles
1. **Clarity Over Cleverness**
- Use simple, direct language
- Avoid jargon when possible
- Define technical terms when first used
2. **Show, Don't Just Tell**
- Include working code examples
- Demonstrate common use cases
- Show expected outputs
3. **Structure for Scanning**
- Use clear headings
- Keep paragraphs short
- Use lists for multiple items
- Highlight important information
4. **Write for Your Audience**
- Consider the reader's expertise level
- Provide appropriate context
- Link to prerequisites when needed
## Language-Specific Templates
### JavaScript/TypeScript (JSDoc)
```javascript
/**
* Brief one-line description of what the function does.
*
* Longer description if needed. Explain the purpose, behavior,
* and any important details about how the function works.
*
* @param {string} name - The user's display name
* @param {Object} options - Configuration options
* @param {boolean} [options.verbose=false] - Enable verbose output
* @param {number} [options.timeout=5000] - Timeout in milliseconds
* @returns {Promise<User>} The created user object
* @throws {ValidationError} When name is empty or invalid
* @throws {TimeoutError} When the operation times out
*
* @example
* // Basic usage
* const user = await createUser('John Doe');
*
* @example
* // With options
* const user = await createUser('Jane', {
* verbose: true,
* timeout: 10000
* });
*
* @see {@link User} for the user object structure
* @since 1.2.0
*/
```
### Python (Google Style Docstrings)
```python
def create_user(name: str, **options) -> User:
"""Create a new user with the given name.
Longer description if needed. Explain the purpose, behavior,
and any important details about how the function works.
Args:
name: The user's display name. Must be non-empty.
**options: Optional keyword arguments.
verbose (bool): Enable verbose output. Defaults to False.
timeout (int): Timeout in milliseconds. Defaults to 5000.
Returns:
User: The created user object with populated fields.
Raises:
ValidationError: When name is empty or invalid.
TimeoutError: When the operation times out.
Example:
Basic usage::
user = create_user('John Doe')
With options::
user = create_user('Jane', verbose=True, timeout=10000)
Note:
The user is not persisted until `user.save()` is called.
See Also:
User: The user object class.
"""
```
### Go
```go
// CreateUser creates a new user with the given name.
//
// CreateUser validates the name, initializes a User struct with default
// values, and returns a pointer to the new user. The user is not persisted
// to the database until Save() is called.
//
// Parameters:
// - name: The user's display name. Must be non-empty string.
// - opts: Optional configuration. See UserOptions for available options.
//
// Returns the created User pointer and any error encountered.
//
// Example:
//
// user, err := CreateUser("John Doe", nil)
// if err != nil {
// log.Fatal(err)
// }
//
// Errors:
// - ErrEmptyName: returned when name is empty
// - ErrInvalidName: returned when name contains invalid characters
func CreateUser(name string, opts *UserOptions) (*User, error) {
```
### Rust
```rust
/// Creates a new user with the given name.
///
/// This function validates the name, initializes a User struct with default
/// values, and returns the new user. The user is not persisted to the
/// database until [`User::save`] is called.
///
/// # Arguments
///
/// * `name` - The user's display name. Must be non-empty.
/// * `options` - Optional configuration settings.
///
/// # Returns
///
/// Returns `Ok(User)` on success, or an error if validation fails.
///
/// # Errors
///
/// * [`UserError::EmptyName`] - If `name` is empty.
/// * [`UserError::InvalidName`] - If `name` contains invalid characters.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let user = create_user("John Doe", None)?;
/// ```
///
/// With options:
///
/// ```
/// let opts = UserOptions { verbose: true, ..Default::default() };
/// let user = create_user("Jane", Some(opts))?;
/// ```
///
/// # Panics
///
/// This function does not panic under normal circumstances.
```
## README Template
```markdown
# Project Name
Brief description of what this project does and why it exists.
## Features
- Feature 1: Brief description
- Feature 2: Brief description
- Feature 3: Brief description
## Installation
### Prerequisites
- Requirement 1 (version X.X+)
- Requirement 2
### Install via [package manager]
\`\`\`bash
npm install project-name
# or
pip install project-name
\`\`\`
### Install from source
\`\`\`bash
git clone https://github.com/user/project-name
cd project-name
npm install
\`\`\`
## Quick Start
\`\`\`javascript
import { Project } from 'project-name';
const project = new Project();
project.doSomething();
\`\`\`
## Usage
### Basic Example
\`\`\`javascript
// Code example with comments
\`\`\`
### Advanced Usage
\`\`\`javascript
// More complex example
\`\`\`
## API Reference
### `functionName(param1, param2)`
Description of the function.
**Parameters:**
- `param1` (Type): Description
- `param2` (Type, optional): Description. Default: `value`
**Returns:** Type - Description
**Example:**
\`\`\`javascript
const result = functionName('value', { option: true });
\`\`\`
## Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `option1` | string | `"default"` | Description |
| `option2` | number | `10` | Description |
## Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing`)
5. Open a Pull Request
## License
[License Type] - see [LICENSE](LICENSE) for details.
```
## Writing Guidelines
### Function Documentation
**Always Include:**
1. Brief description (first line)
2. Parameter descriptions with types
3. Return value description
4. Possible errors/exceptions
5. At least one example
**Include When Relevant:**
- Side effects
- Performance considerations
- Thread safety notes
- Deprecation notices
- Links to related functions
### Class Documentation
**Always Include:**
1. Class purpose and responsibility
2. Constructor documentation
3. Public method documentation
4. Important properties
**Include When Relevant:**
- Inheritance relationships
- Interface implementations
- State management notes
- Lifecycle information
### Module/File Documentation
**Always Include:**
1. Module purpose
2. Main exports
3. Usage overview
**Include When Relevant:**
- Dependencies
- Configuration requirements
- Architecture notes
## Common Patterns
### Documenting Options Objects
```javascript
/**
* @typedef {Object} CreateUserOptions
* @property {boolean} [verbose=false] - Enable verbose logging
* @property {number} [timeout=5000] - Operation timeout in ms
* @property {string} [role='user'] - Initial user role
*/
/**
* Creates a user with the specified options.
* @param {string} name - User name
* @param {CreateUserOptions} [options] - Configuration options
*/
```
### Documenting Callbacks
```javascript
/**
* @callback UserCallback
* @param {Error|null} error - Error if operation failed
* @param {User} user - The user object if successful
*/
/**
* Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.