> ## Documentation index
> Fetch the complete documentation index at: https://cynrath-agent-context-kit-git-feat-unified-local-toolkit-eedde3.docs7.io/llms.txt
> Ask it with GET https://cynrath-agent-context-kit-git-feat-unified-local-toolkit-eedde3.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Agent integration

# Agent Integration Guide

ACKit makes a repository agent-ready and stays verifiable.

## Instruction surfaces

| Agent | File ACKit manages | Mechanism |
|---|---|---|
| Codex/AGENTS-family | `AGENTS.md` | managed block with canonical workflow |
| Claude Code | `CLAUDE.md` | managed block containing official `@AGENTS.md` import |
| Gemini CLI | `GEMINI.md` | managed block: "read AGENTS.md" |
| GitHub Copilot | `.github/copilot-instructions.md` | managed block |

`ackit init --dry-run` shows the plan; without the flag it writes. Files that
already exist WITHOUT an ACKit block are refused — user bytes are never
touched (REQ-GOV-008). Managed blocks update idempotently and repair legacy
duplicates.

## Managed-asset lifecycle (init → sync)

> Availability: `ackit sync` is RELEASED in `0.4.0` and ships in published npm
> `@cynrath/agent-context-kit@0.5.5`.

`ackit init` is the first-time onboarding; `ackit sync` is the later,
version-aware reconciliation. Both run on the same ownership engine — the
same refusals, conflicts, and no-write rules apply.

```bash
ackit sync --dry-run   # preview: what would change and why (writes nothing)
ackit sync --check     # read-only CI gate: exit 1 when out-of-sync or blocked
ackit sync             # apply: reconcile ACKit-owned assets
ackit sync --force     # additionally discard local edits on OWNED skills
```

Rules that hold for both commands:

- ACKit never silently rewrites repository instruction/skill files merely because the npm package was upgraded.
- Only ACKit-owned managed regions/assets are eligible for reconciliation when the user explicitly runs the state-changing sync/init command.
- Write decisions are content-driven: when canonical content is unchanged,
  files are not rewritten (`up-to-date`, zero diff, no timestamp churn).
- User-authored files without an ACKit managed block are refused
  (`refused-non-managed`), never modified.
- Third-party skills are never overwritten, even with `--force`
  (`refused-third-party`).
- An ACKit-owned skill modified locally since the last sync conflicts by
  default (`conflict-user-modified`); only `--force` discards local edits.
- `ackit doctor` reports managed-asset staleness read-only (`up-to-date` /
  `updates available` / `conflict-user-modified`) but never writes and never
  fails on staleness; use `ackit sync --check` for CI gating.

## Set up a local MCP client

ACKit starts an installed local stdio server for one authorized project.
Preview the registration from the project root, then apply it for the client
you intend to use.

```powershell
ackit mcp setup
ackit --root . mcp setup --client codex
ackit --root . mcp setup --client codex --apply
ackit --root . mcp setup --client codex --status
ackit --root . mcp setup --client codex --uninstall
```

These setup commands describe the source checkout until they ship in a
package release. From a built checkout replace the initial `ackit` with
`node dist/cli/index.js` and select the target repository explicitly.

| Client | Project configuration written |
|---|---|
| `codex` | Trusted project `.codex/config.toml` under `mcp_servers.ackit` |
| `claude-code` | `.mcp.json` under `mcpServers.ackit` |
| `cursor` | `.cursor/mcp.json` under `mcpServers.ackit` |
| `vscode` | Native Copilot workspace `.mcp.json`, shared with Claude Code |
| `vscode-editor` | Editor-managed `.vscode/mcp.json` for existing Local harness use |
| `opencode` | OpenCode v2 `opencode.jsonc` or existing `opencode.json` under `mcp.servers.ackit` |
| `gemini` | `.gemini/settings.json` under `mcpServers.ackit` |
| `claude-desktop` | Explicit user scope on Windows or macOS |

`--scope global` selects a supported user configuration, and
`--apply` or `--uninstall` still requires `--root`. A scope that needs manual
registration returns a portable fragment. Replace its placeholders with a
verified Node binary, the installed ACKit entrypoint and the approved project
root. Use the client’s own trust and registration flow where required.

Apply writes the canonical root and installed executable into a local
configuration file. The preview prints a portable fragment. Keep
machine-specific registrations and the local ownership backup private.
A conflicting or malformed file, unsafe link, or concurrent edit produces
a diagnostic. Repeated setup updates only the owned registration. Uninstall
preserves unrelated edits or restores the original file when unchanged.
The setup command detects client launchers on PATH. A detected launcher
provides installation information rather than a verified connection.

Use `ackit_capabilities` or `repo://workspace` to confirm the active root
scope, then call `ackit_status`, `ackit_scan_summary` or `ackit_pack_summary`.
Use the CLI for state transitions that the active MCP profile does not expose.

Client formats and references are recorded in
[ADR-0037](../decisions/ADR-0037-project-mcp-client-setup.md).

## Task status loop (read-only)

Start agent work loops with the canonical status projection instead of
hand-inspecting task, workflow, evidence, verdict, drift, and checkpoint
stores separately:

```bash
ackit status             # the single active task
ackit status TASK-0007   # explicit task
ackit --json status TASK-0007   # stable ackit.status.v1 contract
```

One call answers what task, what stage, what blocks completion (verbatim
gate strings with stable codes), what is stale (verification freshness +
independence, checkpoint staleness, evidence problems), and what next
(derived suggested commands plus the recorded checkpoint next action).
`ackit status` never mutates: no writes, no journal, no clock reads —
safe to poll between steps.

## Skills for agents

Install the built-ins so agents follow the same workflow the tool enforces:

```bash
ackit skills install     # or: ackit sync (also reconciles instruction shims)
ackit skills list
```
