API Reference Capstone v#0.33.3

Copy Markdown View Source

Modules

Top-level namespace for the capstone mix-generator package.

Provenance and drift checking for the checked-in generator baselines.

The wall clock, as the one module under lib/ allowed to read it.

Reads and validates a project's target.exs — the hand-authored record of what a project asked Capstone for (goals.md D16).

The container: section of target.exs.

The container: [sidecars: ...] sub-section of target.exs. Every key is optional and defaults to false.

Raised by Capstone.Config.read!/1 and Capstone.Config.read_string!/1 when target.exs fails validation.

Shared validation primitives for target.exs section keyword lists.

Parses Elixir source into a plain term without ever evaluating it.

The project: section of target.exs — the identity of the generated project.

The security: section of target.exs. Every key is optional and defaults to false.

Content hashing for manifest file entries.

Reads and writes plugin.exs — the generated lock file (SDD 8.2).

One file a plugin owns or contributes to (SDD 7.3).

Raised when plugin.exs is plain data of the wrong shape — a missing or unknown key, an unsupported schema_version, or a field whose value is outside its domain.

One plugin's entry in plugin.exs (SDD 8.2): what it is, which version of it was applied, where that version came from, when it was applied, and every file it owns or contributes to.

The mix capstone.new sequence, with every effect injected.

Environment hygiene for the bootstrap.

The mix capstone.new argv contract: exactly one switch, --path.

Raised when mix capstone.new is given argv it cannot act on.

Edits to the freshly generated project.

The two effectful operations of the bootstrap, each behind an injected seam so every branch is reachable in-process.

Reads and writes manifest.exs — a plugin's manifest (SDD 7.1).

Installs a derived plugin into a target project (SDD 7.3).

The contract a plugin implements.

Decides what a hunk means (SDD 7.3).

Turns an observed diff into a plugin (SDD R1, 10).

Compares a meta project against its baseline (SDD R1).

The one resolve → extract → apply → record → clean-up sequence both mix capstone.new and mix capstone.update use — see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md.

Reads what a raw working project changed in mix.exs (SDD R1, D10).

Packages a derived plugin directory (what mix capstone.plugin.derive writes to priv/meta/meta_<name>/) into a versioned, content-addressed .tar.gz — see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md.

Records an applied plugin in the target's plugin.exs (SDD 8.2, R5, R6).

Resolves a plugin type + the running Elixir/Capstone versions to one concrete archive under a plugin registry directory — see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md.

Downloads plugin archives from this repository's GitHub releases into a local cache directory, so priv/plugins/ is never committed to source control or shipped inside the hex package — see Capstone.Plugin.Registry.default_dir/0.

Raised when listing or downloading a release asset fails.

A validated, absolute path to the project Capstone is acting on.

Raised when a project-relative path would escape the target root.

Raised when a path is not a usable project root.

Codec for the plain-data .exs files Capstone owns — target.exs and plugin.exs.

Adds a child to a project's supervision tree, structurally.

Raised when a supervision tree a plugin must extend cannot be located.

Places a contribution inside a config/*.exs, by that file's own rules.

Raised when a config/*.exs site a plugin must contribute to cannot be located.

Raised when an .exs file is not the plain data Capstone expects.

Raised when a term cannot be written as re-readable .exs source.

Locates and patches constructs in a mix.exs, structurally (SDD R5, R6).

Raised when a mix.exs construct a plugin must edit cannot be located.

Converts a meta-project file into a name-agnostic EEx template, and back.

Applies whatever plugins a project's target.exs newly lists that its plugin.exs hasn't recorded yet — see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md.

SimpleEnum is a simple library that implements Enumerations in Elixir.

Utilities to work with Elixir source code.

General purpose utilities for working with Capstone.Vendor.Sourceror.Zipper.

Utilities for working with functions.

Utilities for working with keyword.

Utilities for working with lists.

Utilities for working with maps.

Utilities for working with Elixir modules

Utilities for working with strings.

Utilities for working with tuples.

Utilities to merge an un-merge comments and quoted expressions.

Functions to identify an classify forms and quoted expressions.

Functions that generate patches for common operations.

Represents a start/end position in a source file as :line and :column keyword lists.

The state struct for Capstone.Vendor.Sourceror traversal functions.

Tree-like data structure that provides enhanced navigation and modification of an Elixir AST.

TypedStruct is a library for defining structs with a type without writing boilerplate code.

This module defines the plugin interface for Capstone.Vendor.TypedStruct.

Data Validation for Elixir.

Implementation of this behaviour should be set in validator options as :error_renderer or in :vex application config with same key.

Common validator behavior.

Ensure a value is absent.

Ensure an attribute is set to a positive (or custom) value.

Ensure a value meets a custom criteria.

Ensure a value, if provided, is equivalent to a second value.

Ensure a value is not a member of a list of values.

Ensure a value matches a regular expression.

Ensure a value is a member of a list of values.

Ensure a value's length meets a constraint.

Ensure a value is a number.

Ensure a value is present.

Ensure a value is a valid UUID string.

Fails loudly when the Capstone.Config actually on the code path came from an older capstone than this project's own dependency tree pins.

Mix Tasks

Builds a DERIVED baseline from a generator baseline plus a plugin.

Rewrites priv/baselines.exs and emits the content-addressed snapshot.

Fails while any unresolved :manual region remains.

Generates a stock Elixir or Phoenix project, adds the capstone dev dependency, writes target.exs, and fetches and compiles dependencies.

Applies a derived plugin to a target project.

Derives a plugin from a raw working project (SDD 10).

Packages a derived plugin into priv/plugins/ (SDD-adjacent; see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md).

Retires a plugin archive so future resolutions skip it (SDD-adjacent; see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md).

Applies whatever plugins target.exs newly lists (SDD-adjacent; see docs/superpowers/specs/2026-08-26-plugin-ecosystem-design.md).