# cordance

> Deterministic-first context-pack compiler for AI coding agents.
> Doctrine-shaped. Source-traced. Cortex-aware. Axiom-harness compatible.

[![crates.io](https://img.shields.io/crates/v/cordance.svg)](https://crates.io/crates/cordance)
[![docs.rs](https://docs.rs/cordance/badge.svg)](https://docs.rs/cordance)
[![license](https://img.shields.io/badge/license-MIT_OR_Apache--2.0-blue.svg)](#license)

## Discoverability

Search terms: Cordance, AI coding agents, MCP, context pack compiler,
AGENTS.md generator, Claude Code, Cursor, Codex, axiom harness target,
Cortex receipt, engineering doctrine.

## Install

```sh
cargo install cordance
```

This is the canonical install path. It pulls in
[`cordance-cli`](https://crates.io/crates/cordance-cli) and produces the
`cordance` binary. `cargo install cordance-cli` is the equivalent direct
path — both install the same binary.

## Golden path

```sh
cd my-project          # any git repo
cordance init          # write a default cordance.toml
cordance pack          # compile the pack, emit every target
cordance advise        # deterministic doctrine checks (no LLM)
cordance check         # drift detection vs .cordance/sources.lock
```

The first `cordance pack` writes the initial outputs. The second
`cordance pack` against an unchanged tree produces a **byte-identical**
`.cordance/pack.json` — every output's SHA-256 is pinned in `sources.lock`,
and `cordance check` will exit non-zero if anything drifts.

## What it does

Run `cordance pack` against any repo and you get:

- `AGENTS.md` + `CLAUDE.md` with **fenced editable regions** — hand edits
  outside the `<!-- cordance:begin … -->` / `<!-- cordance:end … -->` markers
  survive regeneration.
- `.cursor/rules/*.mdc` derived from your project doctrine.
- `.codex/AGENTS.md` + `agents/codex/AGENTS.md` for Codex CLI.
- A `pai-axiom-project-harness-target.v1` JSON the axiom validators accept
  verbatim.
- A `cordance-cortex-receipt-v1-candidate` JSON that Cortex's
  `cortex_memory_accept` flow can ingest.
- A `.cordance/sources.lock` so drift is auditable.

## Workspace

| Crate | Purpose |
| --- | --- |
| [`cordance-core`](https://crates.io/crates/cordance-core) | Types, schemas, ports. No I/O. |
| [`cordance-scan`](https://crates.io/crates/cordance-scan) | Deterministic repo scanner. |
| [`cordance-doctrine`](https://crates.io/crates/cordance-doctrine) | `engineering-doctrine` consumer. |
| [`cordance-emit`](https://crates.io/crates/cordance-emit) | Target emitters. |
| [`cordance-cortex`](https://crates.io/crates/cordance-cortex) | Cortex candidate-receipt builder. |
| [`cordance-advise`](https://crates.io/crates/cordance-advise) | Deterministic doctrine checks. |
| [`cordance-llm`](https://crates.io/crates/cordance-llm) | Bounded candidate-prose adapters. |
| [`cordance-cli`](https://crates.io/crates/cordance-cli) | CLI library + binary. |
| **`cordance`** | **This umbrella package — installs the binary.** |

Run `cordance --help` for the full subcommand surface, or visit the
[project README](https://github.com/0ryant/cordance#readme) for the design
documents.

## License

Dual-licensed under MIT OR Apache-2.0.
