API Reference Cohere v#0.1.0

Copy Markdown View Source

Modules

A coherence layer for Elixir/Phoenix projects.

The check verb: every finding cohere can make, in one iterative command — the same command locally and in CI. Fix what it lists, run it again.

Classifies every module in the host app and groups the domain layer into context groups.

Derives the HTTP/LiveView surface from compiled Phoenix routers.

Derives object shape from Ecto schemas via __schema__/1 reflection.

Derives the background-job surface: Oban workers plus the queue and cron wiring that lives only in application config.

Design docs: the authored artifact of the feature loop.

A parsed design doc: frontmatter (slug, status, date, contexts, supersedes) plus the body and its sections keyed by heading.

Renders the cohere docs site: authored markdown in docs_src/ becomes static HTML in docs/, alongside pages derived from the compiled tasks and the repo's own coherence artifacts.

The drift sentinel: mechanically detects when the project has moved out from under its coherence artifacts.

Loads, parses, generates, and updates intent cards.

One authored intent card: the thin layer of truth that cannot be derived.

The derived map: the actual shape of the system, assembled from reflection over the compiled application.

Renders a Cohere.Map to markdown.

Frontmatter and section mechanics shared by every authored artifact — intent cards and design docs.

Owns the cohere block in the host's agent guidance file (AGENTS.md).

Assembles a work packet: context delivered, not discovered.

Discovers the host project: its OTP app, module inventory, namespaces, and which coherence-relevant capabilities are present.

The public function surface of a module, and a stable hash over it.

Mix Tasks

Prints the project's current coherence level and what the next rung requires.

The check verb of the feature loop: run it anytime, locally or in CI; fix what it lists and run it again.

The complete verb of the feature loop — the land step, one command.

The start verb of the feature loop — and, with no arguments, the listing.

Generates an intent card skeleton for each named context, bound to its current public surface (so a fresh card is born non-drifted).

Creates the cohere/ directory (map, intent/, design/), derives the first map, writes a README explaining the feature loop, and syncs the agent-guidance block into AGENTS.md — the loop's instructions, landed where agents already look.

Derives the system map from the compiled application and writes it to cohere/map.md (configurable via config :cohere, dir: ...).

Prints a work packet — map slices, intent cards, anchored designs (drafts inlined as live intent, accepted as pointers), per-directory agent guidance, related routes, and runtime-verification pointers — for the contexts a task touches.