# CapInt

Capability-first orchestration engine for IDE agents.

Package: `@bcelep/capint` · CLI: `capint`

> **Yeni başlayan:** [GUNLUK.md](GUNLUK.md) (3 adım, chat yeterli) → [docs/kullanim-kilavuzu.md](docs/kullanim-kilavuzu.md) (tam kılavuz)

## Quick start

```bash
cd your-project
npx @bcelep/capint init              # full bundle (default)
npx @bcelep/capint init --bundle minimal   # CI stub (5 skills)
npx @bcelep/capint route "i18n çeviri lang file hub"
```

Init scaffolds docs, matrix, registry (core + recommended + optional from disk), **full skill library (~115)** + **workflows (17)**, and runs `capint ide sync` by default.  
Skip IDE sync: `capint init --no-ide-sync` then `capint ide sync` manually.

## Install flow

1. `npx @bcelep/capint init` — scaffold + bundle + IDE projections
2. `capint route "<task>"` — Execution Intent with `resolution_status: installed|not_installed`
3. `capint doctor` — drift check (read-only)
4. Optional: `capint upgrade --dry-run` / `capint uninstall --dry-run`
5. **Beginner:** `capint ui --open` — wizard, terminal opsiyonel

## Commands

### Routing

- `capint route "<task>"`
- `capint route --json "<task>"`
- `capint route --verbose "<task>"`
- `capint route --list`

### Operational (read-only / dry-run)

- `capint consult "<task>" [--json]` — recommendation only
- `capint status [--json]` — matrix/registry health
- `capint doctor [--json]` — drift diagnosis
- `capint audit [--json]` — project + contract audit

### Scaffold

- `capint init [--preset minimal] [--name Project] [--no-ide-sync]`
- `capint scaffold --list`
- `capint scaffold --preset minimal|prismx-compatible`

Init writes `AGENT.md`, `AGENTS.md`, `design.md`, `.gitignore` (managed fragment), matrix, registry, **all package skills/** and **workflows/**.  
Conflicts → `*.capint.new.md`. Manifest: `.capint/scaffold-manifest.json` (schema v2).

### IDE integration

- `capint ide sync [--dry-run] [--targets cursor,claude,gemini,antigravity]`
- `capint ide check [--json]`

### Lifecycle & skill health

- `capint skill list|disable|enable|pin [--json]`
- `capint recover --list|--latest [--apply]`
- `capint upgrade [--dry-run] [--apply]` — matrix merge + registry refresh + skill/workflow sync
- `capint uninstall [--dry-run] [--yes] [--keep-agent] [--keep-ide] [--include-sidecars]`

### Optional context (local adapters)

- `capint memory status [--json]` — local file availability (read-only)
- Route hot path unchanged unless `CAPINT_LOCAL_CONTEXT=1`

### UI wizard (v0.6)

- `capint ui [--port 3721] [--open]` — local http://127.0.0.1:3721 wizard
- Requires `capint init` in project root

### CLI scripting (v0.6.1)

- `capint pipeline ["<task>"]` — health + route chain
- Env: `CAPINT_DEBUG`, `CAPINT_DEFAULT_CONFIRM`
- See [docs/conventions/cli-scripting.md](docs/conventions/cli-scripting.md)

## Documentation

- **[GUNLUK.md](GUNLUK.md)** — günlük 3 adım (terminal yok)
- **[docs/kullanim-kilavuzu.md](docs/kullanim-kilavuzu.md)** — tam Türkçe kılavuz
- [docs/conventions/daily-use.md](docs/conventions/daily-use.md) — chat şablonları
- [docs/conventions/task-to-capability-cheatsheet.md](docs/conventions/task-to-capability-cheatsheet.md)
- [docs/manifest-schema.md](docs/manifest-schema.md) — scaffold manifest v2
- [docs/architecture-decisions.md](docs/architecture-decisions.md)
- [docs/execution-intent-contract.md](docs/execution-intent-contract.md)
- [docs/release-checklist.md](docs/release-checklist.md)
- [CHANGELOG.md](CHANGELOG.md)

## Architecture

Core chain:

- `src/lib/intent-parser.js`
- `src/lib/capability-router.js`
- `src/lib/execution-policy.js`
- `src/lib/context-memory-bridge.js`
- `src/lib/route-engine.js`

## Execution Intent contract

Every route produces:

- `intent`, `capability`, `resolution`, `memory`, `plan`
- `resolution_status`, `resolution_hint` when skill/workflow missing
- Adaptive `confirm` block (light: off; medium/heavy: devam/plan/analiz — CLI tokens optional)
- `verification_required` on medium/heavy or `not_installed`
- `orchestration`, `context_pack`, optional `local_adapters` (flag-gated)

Maintainer verification: `npm test` (28-step release-check)

```bash
npm install
npx playwright install chromium   # UI E2E
npm test
```

**Maintainer dogfood:** run CLI in-repo via `npm run capint -- <cmd>` — see [docs/maintainer-dogfood.md](docs/maintainer-dogfood.md) (do **not** `capint init` in this repo).
