New clone, or
deft/directivewon't run? Directive runs from an npm-installed engine — there is no committed shell shim, so you (agent or human) are the interpreter. Work the global-first ladder below top-down and stop at the first rung that yields a workingdirective. The version to install is always the one pinned in the project's committedpackage.json.
- Already installed? Run
directive doctor(or thedeftalias). If it runs, you're bootstrapped — skip the rest and follow itsNext command:.- Local engine. If
.deft/.cli/<platform>holds an intact engine at or above thepackage.jsonpin, use it.- Global install (canonical).
npm i -g @deftai/directive(Node ≥ 20), then re-rundirective doctor. Using pnpm?pnpm add -g @deftai/directive(same package, same registry) — make surePNPM_HOMEis on yourPATH(pnpm setupif not).- Sandbox install. If the global npm prefix isn't writable (sandboxed environment), install into the project instead:
npm install --prefix .deft/.cli/<platform> @deftai/directive@<pinned>. (This internal.deft/.cli/layout is always npm-shaped, regardless of your project's package manager.)- Corporate mirror symptoms. If install returns
E404/ETARGET, or@latestsilently stays behind the public release, follow the corporate or mirrored npm registry recovery.- Offline. If the npm registry is unreachable, install from a staged tarball / vendored payload. If none exists, stage one — recovery cannot proceed without a payload.
This block is always committed (never gitignored) and does not depend on the
.deft/core/payload being present, so it is reachable on a fresh clone even when the vendored framework is missing. Oncedirectiveruns, continue with the guidance below and inAGENTS.md.
Stuck? Support hub — symptom index to directive doctor or this cold-start. First project: getting-started.
One-shot, anti-slop — a layered framework for AI-assisted development.
What it is: Directive is a repo practice layer (standards + durable work state + gates), not a coding host or an app orchestrator. Capability index: content/docs/capabilities.md. Category map: docs/CATEGORY.md.
Deft is the company; Directive is the product. The published package is @deftai/directive; deft is the CLI alias.
📚 Public docs: https://deftai.github.io/directive/ — What, Install, Concepts, Gates, Upgrade, License.
- ! = MUST · ~ = SHOULD · ≉ = SHOULD NOT · ⊗ = MUST NOT · ? = MAY
Directive is three commands — init, update, and doctor. After install, walk the first-project tutorial.
| Your situation | Run this one command | What it does |
|---|---|---|
| New, empty project directory | directive init |
Scaffolds a fresh Directive deposit (.deft/core/, the AGENTS.md managed section, the xbrief/ layout, and a committed package.json pin). |
| Existing codebase (app code, no Directive yet) | directive init |
Installs Directive support beside your code without disturbing it, then points you at brownfield spec extraction. |
| Existing Directive project (already initialized) | directive update |
Refreshes the vendored payload and self-heals the engine. (init detects this state and delegates to update with a disclosure line — it never re-scaffolds an existing install.) |
| Not sure, or something looks broken | directive doctor |
Read-only diagnosis that prints exactly one recommended next step. |
| Legacy / pre-v0.20 layout | directive init (or directive doctor) |
Classifies the layout and routes you to the specific migration path (see UPGRADING.md). |
directive init is the universal entrypoint. directive (the deft alias also works) runs any verb; npx @deftai/directive <verb> or pnpm dlx @deftai/directive <verb> runs one without a global install.
npm i -g @deftai/directiveUsing pnpm? Same package, same registry:
pnpm add -g @deftai/directiveMake sure pnpm's global bin directory is on your PATH (run pnpm setup once to configure PNPM_HOME). Then:
directive init # classify this directory and set up (or route) accordingly
directive doctor # confirm the install and print your one next step
directive toolchain:check --consumerNode runtime (required): Install Node 20+, Git, GitHub CLI (gh), and the package manager you use (npm is bundled with Node; pnpm is an alternative). After directive init, confirm with directive doctor and directive toolchain:check --consumer. That consumer probe always checks Node, git, gh, and the selected manager (npm or pnpm). It does not require Python, uv, Go, or Task. Framework maintainers building this repository use a separate Node 24 pin plus pnpm, Go, and Task; see CONTRIBUTING.md. See UPGRADING.md § Node runtime for details.
What gets tracked vs ignored: init and update add Directive's local-only artifacts to your .gitignore — the reconstitutable deposit .deft/core/, the per-platform engine cache .deft/.cli/, session/ritual state such as .deft/ritual-state.json, and the .deft-cache/ content cache. Your committed package.json pin is never ignored: it is the anchor that lets directive init / directive update reconstitute .deft/core/ on a fresh clone, so it stays tracked in version control.
🔄 Upgrading an existing Directive project? The ordinary path is
directive updatefrom your project root (afternpm i -g @deftai/directive@latest, orpnpm add -g @deftai/directive@lateston pnpm). See UPGRADING.md for the canonical steps and the advanced/big-jump detail. On npm v12, install scripts and non-registry sources are opt-in — UPGRADING.md § npm v12 install-time security defaults (Directive packages need no allowlist; app trees may). Agents: ! Read UPGRADING.md on the first session after a framework update.
📦 Brownfield adoption: Adding Deft to an existing project with pre-v0.20
SPECIFICATION.md/PROJECT.md? See docs/BROWNFIELD.md and UPGRADING.md § Frozen pre-v0.20 document-model migration (#2068).
📢 Cloned manually (no installer)? Tell your agent:
Read deft/QUICK-START.md and follow it.It creates your project'sAGENTS.mdand starts the setup flow automatically.
Node is always required to run Deft. The Go installer is a legacy bridge, not the first-start installer — npm is canonical (above). Reach for it only when npm isn't an option: an offline / air-gapped deposit, or migrating an existing old on-disk layout.
⬇️ Legacy binaries — from the latest GitHub Release:
- Windows:
install-windows-amd64.exe|install-windows-arm64.exe- macOS:
install-macos-universal- Linux:
install-linux-amd64|install-linux-arm64
Windows: Download install-windows-amd64.exe (or install-windows-arm64.exe) and run it — SmartScreen may warn; click "More info" then "Run anyway".
macOS: Download install-macos-universal, then chmod +x install-macos-universal && ./install-macos-universal. If Gatekeeper blocks it: right-click then Open, or xattr -d com.apple.quarantine install-macos-universal.
Linux: Download install-linux-amd64 (or install-linux-arm64), then chmod +x install-linux-amd64 && ./install-linux-amd64.
npm i -g @deftai/directiveNode 20+ is required. For offline / air-gapped deposits or migrating a legacy on-disk layout, the Go-installer binaries remain at GitHub Releases (see Legacy and offline install).
Building from source requires Go 1.22+. Use go run ./cmd/deft-install/ or deft-install --yes --upgrade --maintainer --repo-root /path/to/directive --json. Maintainer setup: CONTRIBUTING.md.
Tell your agent read AGENTS.md and follow it, or run directive bootstrap. Output is USER.md + xbrief/PROJECT-DEFINITION.xbrief.json + scope xBRIEFs. Unix / macOS: ~/.config/deft/USER.md. Windows: %APPDATA%\deft\USER.md. Override: DEFT_USER_PATH. Full walkthrough: getting-started.
directive bootstrap walks user preferences → project definition → scope interview. The interview writes a scope xBRIEF to xbrief/proposed/. xbrief/*.xbrief.json files are the source of truth; .md files (PRD.md, SPECIFICATION.md, ROADMAP.md) are rendered views generated on demand via task *:render. Direct edits to the rendered .md files are overwritten on the next render — edit the underlying .xbrief.json instead.
directive bootstrap --strategy interview # Phase 3 — scope xBRIEF interview
directive bootstrap --project # Phase 2 — project configuration only
directive doctor # Check install integrity
directive agents:refresh # Refresh AGENTS.md managed sectionRead xbrief/PROJECT-DEFINITION.xbrief.json and the scope xBRIEFs in
xbrief/active/ (or xbrief/pending/ if none are active yet) and implement
the project following deft/main.md standards.
Extra roles live with their owners — this README does not re-author them.
| Role | Owner |
|---|---|
| First project / tutorial | content/docs/getting-started.md |
| Support | content/docs/SUPPORT.md |
| Capabilities | content/docs/capabilities.md |
| Maintainer | CONTRIBUTING.md |
| Architecture (maintainer-tier) | docs/ARCHITECTURE.md |
| Vocabulary | glossary.md |
Backlog triage, slicing, and swarming are in the getting-started tutorial and CONTRIBUTING. Content packs: task packs:slice -- --list-packs.
Rules cascade with precedence (highest first):
- USER.md (highest) — your personal overrides (
~/.config/deft/USER.mdon Unix/macOS,%APPDATA%\deft\USER.mdon Windows) - xbrief/PROJECT-DEFINITION.xbrief.json — project-specific rules and identity gestalt
- Language files (
languages/python.md,languages/go.md, ...) — language standards - Tool files (
tools/taskfile.md, ...) — tool guidelines - main.md (lowest) — general AI behavior
Note: project requirements (xbrief/specification.xbrief.json + scope xBRIEFs in xbrief/{proposed,pending,active,completed,cancelled}/) describe what to build and are deliberately kept on a separate ladder from the rule cascade above. ROADMAP.md is the rendered backlog view of those requirements.
Deft enforces a feature-branch policy by default (#746, #747): direct commits to master/main are blocked and PRs whose head_ref equals base_ref are refused at the CI gate. The policy is governed by a typed flag on xbrief/PROJECT-DEFINITION.xbrief.json:
{
"plan": {
"policy": { "allowDirectCommitsToMaster": false }
}
}Three enforcement surfaces back the rule:
- Git hooks —
.githooks/pre-commitand.githooks/pre-push. Activate them withtask setup; verify withtask verify:hooks-installed. - Pre-commit gate —
task verify:branchis wired into thetask checkaggregate. - CI —
.github/workflows/branch-gate.ymlrefuses PRs whosehead_refequalsbase_ref.
Reconfigure via deterministic tasks (audited to meta/policy-changes.log):
task policy:show— display the resolved policy and its source.task policy:enforce-branches— setallowDirectCommitsToMaster=false.task policy:allow-direct-commits -- --confirm— set the typed flag totrueafter the capability-cost disclosure.
Emergency bypass: set DEFT_ALLOW_DEFAULT_BRANCH_COMMIT=1 for the current shell.
GitHub is the primary supported SCM. Core features work without it. vBRIEF is legacy — see UPGRADING.md — xBRIEF rename.
Next Steps: Read main.md for comprehensive AI guidelines, then run npm i -g @deftai/directive (Node ≥ 20) to get started.
Copyright © 2025-2026 Jonathan "visionik" Taylor — https://deft.md License: MIT