elixir-writing-docs

Guide Elixir documentation with @moduledoc, @doc, @typedoc, and doctests.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/javierhbr/random-poc --skill elixir-writing-docs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: elixir-writing-docs
Source: https://github.com/javierhbr/random-poc/tree/main/custom-skills/beagle-main/plugins/beagle-elixir/skills/elixir-writing-docs
Command: npx skills add https://github.com/javierhbr/random-poc --skill elixir-writing-docs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write clear, comprehensive, and maintainable documentation for their Elixir code, improving code quality and developer onboarding.

Core Features & Use Cases

  • Standardized Documentation: Guides on using @moduledoc, @doc, @typedoc, and doctests according to Elixir best practices.
  • Code Clarity: Ensures documentation is accurate, easy to understand, and effectively communicates the purpose and usage of code.
  • Use Case: When writing a new Elixir module, use this Skill to ensure your @moduledoc includes a concise summary, relevant examples, and configuration details, making it immediately understandable to other developers.

Quick Start

Use the elixir-writing-docs skill to document the MyApp.Inventory module, including examples and configuration.

Frequently Asked Questions about elixir-writing-docs

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

FAQPage Schema
How do I write Elixir module documentation using @moduledoc and @doc?▼

To write Elixir documentation, use `@moduledoc` for module overviews and `@doc` for functions. Ensure the first line is a concise summary, followed by structured content and clear examples to improve code clarity and developer onboarding.

What is the difference between @doc and code comments in Elixir?▼

Elixir documentation uses `@doc` and `@moduledoc` to generate API references, while code comments explain internal implementation details. Use `@doc` for public APIs and reserve comments for private code logic to ensure accurate, maintainable documentation.

How do I add metadata like @doc since and @doc deprecated in Elixir?▼

Add metadata to Elixir documentation using `@doc since: "1.2.0"` or `@doc deprecated: "use new_function/1 instead"`. This annotates API version history and deprecation warnings directly in the generated ExDoc references for better developer experience.

When should I use @doc false for Elixir functions?▼

Use `@doc false` in Elixir when you need to hide internal functions from generated ExDoc output. This keeps public API documentation clean while suppressing documentation generation for private or unstable APIs that should not be exposed.

How do I write doctests for Elixir functions?▼

Write Elixir doctests by embedding example code in `@doc` strings using the `iex>` prompt format. ExDoc extracts these examples and runs them as unit tests, ensuring your documentation remains accurate and validated during the build process.

Does Elixir support documenting behavior modules and types?▼

Yes, Elixir supports documenting behavior modules and types. Use `@moduledoc` to explain callbacks and use `@typedoc` to provide descriptions for types, ensuring that ExDoc accurately renders the behavior contracts and type definitions in the API reference.