documentation-style

Enforce Why, What, and Test structure in public documentation comments.

15|5|Updated May 19, 2026
One-click install
npx skills add https://github.com/bobmatnyc/trusty-tools --skill documentation-style-bobmatnyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: documentation-style
Source: https://github.com/bobmatnyc/trusty-tools/tree/main/crates/trusty-code/src/assets/skills/documentation-style
Command: npx skills add https://github.com/bobmatnyc/trusty-tools --skill documentation-style-bobmatnyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill solves the problem of inconsistent, low-quality documentation that fails to provide clear context for developers and AI agents, reducing the cognitive load required to understand codebases.

Core Features & Use Cases

  • Four-Axis Documentation Model: Enforces a structured approach using Why, What, Test, and optional Spec References to ensure every doc comment provides maximum value.
  • Context-Economy Principles: Provides guidelines to prevent documentation bloat by focusing on contracts rather than implementation details.
  • Use Case: When reviewing a complex Rust module, use this skill to ensure all public functions clearly state their motivation, mechanical behavior, and corresponding test coverage.

Quick Start

Apply the documentation style guide to the current file by ensuring every public function includes a Why, What, and Test section in its doc comment.

Frequently Asked Questions about documentation-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Rust documentation across my codebase?

Standardize Rust documentation by enforcing a mandatory Why, What, and Test structure for all public artifacts. This ensures every doc comment provides high-density, context-efficient information by clearly stating motivation, mechanical behavior, and test coverage.

What is the Why/What/Test model for technical documentation?

The Why/What/Test model is a documentation structure that requires public functions to explicitly state their motivation, mechanical behavior, and corresponding test coverage. It prevents documentation bloat by focusing on contracts rather than implementation details.

How do I prevent documentation bloat in API design?

Prevent documentation bloat in API design by applying context-economy principles that focus on contracts rather than implementation details. This keeps information high-density and context-efficient, reducing cognitive load for both developers and AI agents.

Does spec-linked documentation work with code reviews?

Spec-linked documentation works effectively with code reviews by enforcing the four-axis model across all public artifacts. Reviewers can verify that modules clearly state their motivation, mechanical behavior, and test coverage.

Can I use this documentation style guide for non-Rust modules?

This documentation style guide applies to software engineering workflows including code reviews, API design, and module-level documentation. While it references Rust modules, the four-axis model and spec-linked conventions can standardize documentation across any codebase.

When should I not use context-economy principles for documentation?

Context-economy principles should not be used when implementation details are critical to understanding the artifact. This approach focuses on contracts to prevent bloat, so avoid it when step-by-step implementation context is required.