Dwight: AI Development, Inside Neovim.

Scope. Plan. Build. Ship. Learn.

Dwight turns your Neovim into an AI-powered development environment. It doesn't replace your editor — it makes it smarter. Feature pragmas in your source code scope context, autonomous agents plan and execute multi-step tasks with verification gates, and a learning system means every session improves the next one.

No context windows to manage. No copy-pasting into chat. Just describe what you want, and Dwight builds it — with git checkpoints at every step.

Get Started · Command Reference · Configuration


Why Dwight?

AI coding tools either give you autocomplete or require you to leave your editor. Dwight does neither.

Code-Scoped Context

Stop feeding entire codebases into AI. Dwight uses pragma comments in your source to define features, and treesitter to extract signatures. The AI sees exactly what it needs — nothing more.

// User authentication and session management. @feature:auth
package auth

The @feature:auth pragma tells Dwight which files belong together. When an agent works on auth, it only sees auth files. This keeps context tight and results accurate.

Autonomous Multi-Step Execution

Give Dwight a task like "Create a web UI with HTMX" and it will:

  1. Plan — break it into 4-8 sub-tasks automatically
  2. Execute — run each sub-task through an AI agent with tool use
  3. Verify — run go test ./... (or your test command) after each step
  4. Checkpoint — git commit after each passing step
  5. Learn — extract lessons for future sessions

If a step fails, it retries with the error context. If it still fails, it pauses so you can intervene.

Skill System

Skills are reusable markdown guides that tell the AI how to write code for your project. They encode patterns, anti-patterns, and conventions:

:DwightGenSkill      " AI-generates a skill from a description
:DwightMarketplace   " Browse curated skill packs for Go, React, Rust, etc.

Skills are stored in .dwight/skills/ and automatically included in agent context.

Session Replay

Step through past agent sessions like a debugger. See every tool call, every thought, every result:

:DwightReplay latest    " Step through the most recent session

Navigate with j/k, jump between tool calls with J/K, toggle cumulative view with v.


Get Started in Seconds

Installation

lazy.nvim:

{
  "otaleghani/dwight.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-treesitter/nvim-treesitter",
  },
  config = function()
    require("dwight").setup({
      backend = "claude_code",     -- or "codex", "gemini"
    })
  end,
}

Prerequisites

  • Neovim 0.10+
  • A CLI agent — one of:
  • Git — Dwight uses git for checkpoints and rollbacks
  • An API key (optional) — for skill generation and single-shot commands. Set ANTHROPIC_API_KEY or OPENAI_API_KEY.

See Getting Started for the full setup guide.

First Use

:DwightInit                   " Initialize .dwight/ in your project
:DwightBootstrap              " Auto-add @feature pragmas to all files
:DwightAuto Create a REST API " Plan + execute a multi-step task

Core Workflow

1. Scope → Core Concepts

Add pragma comments to define features: // @feature:auth, // @feature:database. Bootstrap does this automatically.

2. Plan → Auto Mode

:DwightAuto <task> breaks work into sub-tasks, each scoped to relevant features with verification gates.

3. Build → Auto Mode

Agents execute each sub-task: reading files, writing code, running commands, and self-correcting.

4. Review → Session Replay

Step through what the agent did with :DwightReplay. Check the diff with :DwightDiffReview.

5. Ship → CI/CD & GitHub

:DwightCI auto-fixes CI failures. :DwightPR generates pull requests. :DwightCommit writes conventional commits.

6. Learn → Core Concepts

Dwight extracts lessons from each session and applies them to future tasks automatically.


Feature Overview

FeatureCommandDescription
Auto Mode:DwightAutoMulti-step task planning and execution
Agent:DwightAgentSingle agentic task with tool use
Skills:DwightSkillsBrowse and manage coding skills
Marketplace:DwightMarketplaceInstall curated skill packs
Replay:DwightReplayStep through past sessions
Bootstrap:DwightBootstrapAuto-add feature pragmas
Split:DwightSplitFeatureBreak large features into smaller ones
Audit & Heal:DwightAudit / :DwightHealFind and fix codebase quality issues
Docs:DwightDocsGenerate project documentation
TDD:DwightTDDTest-driven development loop
CI/CD:DwightCIAuto-fix CI pipeline failures
GitHub:DwightPR / :DwightIssuePR and issue management
Workspace:DwightWorkspaceMulti-repo unified workspace
Stats:DwightStatsTelemetry dashboard and cost tracking
Whiteboard:DwightWhiteboardAI brainstorming scratchpad
Templates:DwightTemplateReusable prompt templates
Health:checkhealth dwightValidate your setup

See the full command reference for all 80+ commands.


Advanced Features

Multi-Repo Workspaces

Work across multiple repositories as a single workspace. Features can span repos, agents have cross-repo context.

:DwightWorkspaceAdd ../shared-lib
:DwightWorkspaceFeatures

See Multi-Repo Workspace for setup and usage.

Codebase Audit & Heal

Find quality issues with static analysis and AI review, then fix them automatically:

:DwightAudit auth --deep     " Static + AI review
:DwightHeal auth             " Char tests → plan → execute

See Codebase Audit & Heal for the full rehabilitation workflow.

Telemetry & Cost Tracking

Track every invocation, token, and dollar locally:

:DwightStats                 " Full dashboard with daily trends
:DwightStats export          " Export to JSON/CSV

See Telemetry & Stats for dashboard details.

MCP Server Integration

Connect external tools via the Model Context Protocol:

require("dwight").setup({
  mcp_servers = {
    { name = "db", command = "mcp-server-sqlite", args = { "project.db" } },
  },
})

Custom Language Support

Extend Dwight with project-specific language definitions:

require("dwight").setup({
  languages = {
    java = { detect = {"pom.xml"}, test_cmd = "mvn test -q", build_cmd = "mvn compile -q" },
  },
})

Community & Contributing

Dwight is open source (MIT).

  • Found a bug? Open an issue on GitHub.
  • Questions? Check :checkhealth dwight first — it catches most setup problems.