Skip to main content
v3.1.310-Step Practical Guide100% Local-First StandaloneZero Cloud Dependency

How to Use DevWorkflow

An end-to-end practical guide for developers connecting AI coding assistants (Claude Code, OpenCode, Codex, or Antigravity) to DevWorkflow. Follow this 10-step journey from global npm installation to verified task completion.

Step-by-Step Overview

The 10-Step Onboarding Journey

Every step includes validated commands, expected output, and actor responsibilities.

1. Install DevWorkflow from npm

Actor: Developer (CLI)

DevWorkflow is distributed publicly on npm as an MIT-licensed package. You do not need private repository access, deploy tokens, or external accounts to install or run the core tools.

Requires Node.js >= 20.0.0. The global installation provides both the `devwf` command-line executable and the headless MCP server entry point.

Terminal Command
Terminal Execution
npm install -g @programinglive/dev-workflow
Expected Terminal Output
+ @programinglive/dev-workflow@3.1.3
added 1 package in 2.4s
๐Ÿ’ก Pro Tips
  • Ensure Node.js 20 or newer is in your PATH (`node --version`).
  • You can also run without global installation using `npx @programinglive/dev-workflow <command>`.

2. Run Setup and System Diagnostics

Actor: Developer (CLI)

`devwf setup` initializes your local profile in `~/.devworkflow/` (or `DEVWF_PROFILE_DIR`). By default, it selects the standalone mode with zero external services.

`devwf doctor` checks runtime prerequisites: Node.js version, Git binary, SQLite WAL capabilities, file system permissions, and optional integration statuses.

Terminal Command
Terminal Execution
devwf setup
devwf doctor
Expected Terminal Output
[setup] Mode: LOCAL_FIRST_STANDALONE
[setup] Profile directory initialized: ~/.devworkflow
[setup] Storage: SQLite WAL local persistence ready

[doctor] Node.js: v22.23.4 (>=20.0.0 required) - OK
[doctor] Git: git version 2.47.1 - OK
[doctor] Storage: SQLite WAL mode enabled - OK
[doctor] Security mode: strict - OK
[doctor] Environment: Standalone local-first (0 cloud dependencies)
All core health checks PASSED.
๐Ÿ’ก Pro Tips
  • If you want to explicitly avoid prompts about optional Zettly integration on setup, run `devwf setup --skip-zettly`.
  • Add `--json` to `devwf doctor` for machine-parseable output in CI/CD scripts.

3. Choose and Connect an MCP-Compatible Coding Agent

Actor: Client Config

DevWorkflow implements the standard Model Context Protocol (MCP) server over standard input/output (stdio).

Any AI assistant supporting MCP can register DevWorkflow as a tool provider. Configure the client to execute `npx -y @programinglive/dev-workflow` or `node /path/to/dev-workflow/index.js`.

Client Configuration Examples
Client Configuration Examples
// OpenCode (~/.config/opencode/opencode.json)
{
  "mcp": {
    "dev-workflow": {
      "type": "local",
      "command": ["npx", "-y", "@programinglive/dev-workflow"],
      "enabled": true
    }
  }
}

// Claude Code (~/.claude/claude_desktop_config.json)
{
  "mcpServers": {
    "dev-workflow": {
      "command": "npx",
      "args": ["-y", "@programinglive/dev-workflow"]
    }
  }
}

// Antigravity IDE (Settings -> MCP Servers)
{
  "name": "dev-workflow",
  "command": "devwf",
  "args": ["mcp"],
  "env": { "DEVWF_SECURITY_MODE": "strict" }
}
๐Ÿ’ก Pro Tips
  • If you installed globally via npm, you can use `devwf` with args `['mcp']` or run `npx @programinglive/dev-workflow` directly.
  • DevWorkflow communicates via JSON-RPC 2.0 over stdin/stdout without opening any network ports.

4. Verify MCP Tool Discovery

Actor: Developer (CLI)

Run `devwf fleet doctor` to inspect local client configuration files and simulate the MCP stdio handshake.

This confirms that tools such as `start_task`, `create_feature_flow`, `run_tests`, and `complete_task` are visible to your agent before you begin coding.

Terminal Command
Terminal Execution
DEVWF_PUBLIC_LOCAL_FIRST=1 devwf fleet doctor --json
Expected Terminal Output
{
  "status": "healthy",
  "clients": [
    { "client": "opencode", "configPath": "~/.config/opencode/opencode.json", "registered": true },
    { "client": "claude", "configPath": "~/.claude/claude_desktop_config.json", "registered": true }
  ],
  "mcpStdio": {
    "handshake": "OK",
    "protocolVersion": "2024-11-05",
    "toolsDiscovered": 65
  }
}
๐Ÿ’ก Pro Tips
  • In Claude Code or OpenCode, you can also type `/mcp` inside the conversation to view registered tools interactively.
  • If tools are missing, verify that your client process was restarted after updating the configuration file.

5. Create and Start Your First Task

Actor: AI Agent (MCP)

Instead of writing code blindly, the AI agent invokes `start_task`. This pins the session to the target git repository, creates a local SQLite state record, and starts the governance tracker.

The task contract requires an English description, a task type (`feature`, `bugfix`, `refactor`, or `other`), an ordered plan, and a concrete Definition of Done.

AI Tool Call: start_task
AI Tool Call: start_task
{
  "description": "Add email format validation to checkout registration form",
  "type": "feature",
  "projectDir": "/path/to/my-project",
  "plan": [
    "Write failing unit test for invalid email domains",
    "Implement RFC-5322 regex validator in validator.js",
    "Run unit tests and verify 100% green suite",
    "Review git diff and check commit readiness"
  ],
  "definitionOfDone": [
    "Failing test created and verified failing on invalid email inputs",
    "Validator accepts valid emails and rejects malformed addresses",
    "npm test passes 100% with no regressions"
  ]
}
๐Ÿ’ก Pro Tips
  • You can also start a task from the terminal via the CLI: `devwf task create --description '...' --type feature`.
  • DevWorkflow's guard plugin strictly blocks shell mutation tools until `start_task` is called, preventing unmanaged edits.

6. Define Scope, Plan, and Definition of Done

Actor: AI Agent (MCP)

Immediately after task creation, the AI invokes `create_feature_flow` with a connected Mermaid flowchart (`flowchart TD` / `graph TD`).

This architecture design gate locks scope, prevents model hallucinations, and syncs a visual diagram to the task contract. If requirements shift during exploration, call `refine_with_ai` to update the plan and criteria.

AI Tool Call: create_feature_flow
AI Tool Call: create_feature_flow
{
  "description": "Email validation and error feedback pipeline",
  "mermaidCode": "flowchart TD\n    FormInput[User Form Input] --> Check[RFC-5322 Email Validator]\n    Check -->|Valid| Submit[Dispatch Registration Event]\n    Check -->|Invalid| Error[Render Inline Form Alert]"
}
๐Ÿ’ก Pro Tips
  • DevWorkflow enforces 2โ€“12 connected nodes in feature flows to keep diagrams concise, clear, and focused.
  • Use `set_plan` and `mark_plan_step` throughout development so observers can track step-by-step progress.

7. Execute Coding Through the AI Agent

Actor: AI Agent (MCP)

The AI agent implements code inside the pinned `projectDir`. The developer and AI work together through the Red-Green-Refactor cycle: write a failing test first, implement the minimum passing logic, and refactor cleanly.

The DevWorkflow guard plugin ensures that exploratory commands (`cat`, `ls`, `git diff`) and mutations (`edit`, `write`) remain bound to the active task contract.

Terminal Command
Terminal Execution
git status && git diff --stat
Expected Terminal Output
On branch feat/email-validation
Changes not staged for commit:
  modified:   src/validator.js
  modified:   tests/validator.test.js

2 files changed, 48 insertions(+), 3 deletions(-)
๐Ÿ’ก Pro Tips
  • Always work on an isolated branch (`git checkout -b <type>/<task-slug>`) rather than dirty shared branches.
  • Mark each plan step completed using `mark_plan_step` as you advance through the code.

8. Run Testing and Engineering Audits

Actor: AI Agent (MCP)

Before changes can be committed, tests must pass. The AI invokes `run_tests` (or executes your project test runner).

Next, invoke `audit` (`category: 'changes'` or `category: 'security'`) to inspect git diffs for leaked secrets, dead branches, high cyclomatic complexity, or missing error handlers.

AI Tool Call: run_tests & audit
AI Tool Call: run_tests & audit
{
  "command": "npm test"
}

// Output:
// โœ” Validator rejects addresses without @ symbol (1.2ms)
// โœ” Validator accepts standard user@example.com (0.8ms)
// โœ” Validator handles international domain extensions (1.1ms)
// โ„น tests 14 ยท pass 14 ยท fail 0
๐Ÿ’ก Pro Tips
  • Never claim tests pass without inspecting the actual command execution output.
  • Prove your Definition of Done criteria using `mark_dod_item` with concrete command evidence.

9. Review Changes and Commit

Actor: AI Agent (MCP)

The AI calls `check_ready_to_commit`. DevWorkflow scans for open DoD items, unhandled errors, uncommitted artifacts, and reversibility dimensions.

Once readiness is green, invoke `commit_and_push` with a Conventional Commit message (`feat: ...`, `fix: ...`).

AI Tool Call: commit_and_push
AI Tool Call: commit_and_push
{
  "commitMessage": "feat(validator): add RFC-5322 email validation to registration flow"
}

// Output:
// [feat/email-validation a1b2c3d] feat(validator): add RFC-5322 email validation
// 2 files changed, 48 insertions(+), 3 deletions(-)
// Pushed to origin/feat/email-validation
๐Ÿ’ก Pro Tips
  • `check_ready_to_commit` fails closed if any Definition of Done item remains unverified.
  • All commit messages should follow Conventional Commits formatting.

10. Complete the Task with Verified Evidence

Actor: AI Agent (MCP)

Call `complete_task` with the commit message and any observed follow-up items (`nextSteps`).

DevWorkflow persists the completed task into local history, updates session metrics, releases project locks, and resets the workflow for your next assignment.

AI Tool Call: complete_task
AI Tool Call: complete_task
{
  "commitMessage": "feat(validator): add RFC-5322 email validation",
  "nextSteps": [
    "Consider adding MX DNS record pre-validation in the backend service",
    "Update user onboarding documentation with new email formats"
  ]
}

// Output:
// โœ… Task completed successfully!
// Outcome saved to local SQLite history (~/.devworkflow/history.sqlite3)
// Workflow state reset to idle. Ready for next task.
๐Ÿ’ก Pro Tips
  • View past task outcomes anytime with `devwf list` or `get_workflow_status`.
  • Follow-up items recorded in `nextSteps` are readable later via `next_steps`.

Component Role Breakdown: CLI vs MCP vs AI Client

Understanding the boundaries between developer commands, AI model tool calls, and local runtime storage.

ComponentPrimary ActorExecution MediumKey ResponsibilitiesExample Invocations
DevWorkflow CLI (`devwf`)Developer / Terminal / CIDirect command-line executable (`bin/cli.js`), shell scripts, or CI/CD pipelines.
  • Environment setup & configuration (`setup`, `doctor`)
  • Fleet diagnostics across multiple AI client configs (`fleet doctor`)
  • Session inspection, share token generation, and manual task administration (`list`, `close`, `drop`)
  • Optional service integration management (`zettly connect`, `pair`)
devwf setup
devwf doctor
devwf fleet doctor --json
devwf list
DevWorkflow MCP ServerAI Assistant (Automated)JSON-RPC 2.0 stdio server (`index.js`) spawned directly by coding clients.
  • Task contracts, plans, and Definition of Done gates (`start_task`, `set_plan`, `mark_dod_item`)
  • Architecture diagram recording and visual flow sync (`create_feature_flow`)
  • Quality enforcement, test execution, and code auditing (`run_tests`, `audit`, `code_context`)
  • Release locking, pre-commit readiness checks, and task completion (`check_ready_to_commit`, `complete_task`)
start_task
create_feature_flow
run_tests
complete_task
External AI Coding ClientClaude Code / OpenCode / Codex / AntigravityInteractive developer UI or terminal agent running model reasoning and tool dispatch.
  • Code generation, file editing, and test authoring based on developer prompts
  • Dispatching DevWorkflow MCP tool calls in adherence with system rules
  • Analyzing test output, error traces, and git diffs during development
  • Explaining decisions and proposing follow-up recommendations to human developer
Read instructions
Write test cases
Call start_task
Propose git commits
DevWorkflow Runtime & StorageLocal OS Kernel / SQLite EngineEmbedded SQLite WAL databases and process-level file mutexes on the local machine.
  • Local-first atomic persistence of task states, plans, and DoD checklists
  • Process concurrency fencing to prevent split-brain edits on the same worktree
  • Durable history logging across machine restarts with zero cloud database dependency
  • Pre-tool guard plugin enforcement to prevent unmanaged bash or file mutation
~/.devworkflow/history.sqlite3
Kernel mutex locks
Pre-tool execution guards
Optional Enhancements

Optional Integrations: Zettly & Android Companion

DevWorkflow works 100% standalone out of the box. If your workflow involves higher-level sprint planning or a multi-screen desk cockpit, you can enable these integrations at any time without altering local history.

Zettly Integration

Optional ยท Planning & Retrospectives

Connect DevWorkflow to your self-hosted or cloud Zettly workspace to synchronize Todos, Eisenhower priority queues, visual Draw canvases, and daily engineering journal outcomes.

Standalone Guarantee:DevWorkflow is 100% functional without Zettly. No account, PocketBase store, or token is required for local-first standalone operations.
Setup Commands
Setup Commands
# Check current connection status
devwf zettly status --json

# Connect securely using hidden token stdin (never pass raw tokens on CLI args)
printf '%s' "$ZETTLY_API_TOKEN" | devwf zettly connect --url https://your-zettly.example --token-stdin

# Switch accounts or disconnect cleanly
devwf zettly disconnect --confirm
Benefits & Capabilities:
  • Synchronizes active tasks with Zettly Today and Priority Queue (/priority)
  • Syncs architecture diagrams from create_feature_flow to Zettly Draw canvases
  • Records completed task summaries into daily engineering activity journal
  • Enforces Eisenhower / Pareto 80/20 prioritization across multiple projects
Verification:devwf zettly doctor --json

DevWorkflow Android Companion

Optional ยท Mobile Engineering Cockpit

Pair an Android tablet or phone running the DevWorkflow Companion app (com.programinglive.devwfmonitor) to monitor active AI sessions, build progress, and fleet convergence on a secondary screen.

Standalone Guarantee:The Android Companion is completely optional. Terminal and browser interfaces provide full operational oversight on any desktop OS.
Setup Commands
Setup Commands
# Generate an encrypted pairing challenge QR / code for your Android device
devwf pair --url http://your-monitor-host:3100 --json
Benefits & Capabilities:
  • Real-time session monitor showing active coding tasks, DoD status, and plan steps
  • Live build and test suite execution progress indicators with background alerts
  • Fleet status view showing connected machines (workstation, laptop, server)
  • Zero interference with local coding: companion runs in read-only telemetry mode
Verification:devwf doctor --json

Zettly Code v1.0 (Persistent Code Memory)

Optional ยท Private / Local Knowledge Graph

Connect the optional Zettly Code engine via DevWorkflow's canonical `code_index` and `code_context` MCP tools to maintain a local SQLite WAL source-code knowledge graph and enforce mandatory `@zettly-code` bug-fix knowledge comments.

Standalone Guarantee:Zettly Code is maintained in a private repository and resolved optionally at runtime. DevWorkflow's public npm package works 100% standalone without it.
Setup Commands
Setup Commands
# Optional: point DevWorkflow to a local Zettly Code checkout
export ZETTLY_CODE_MODULE_PATH="/path/to/zettly-code/src/index.js"
Benefits & Capabilities:
  • Incremental SQLite WAL knowledge graph with revision-aware freshness checks
  • Bounded `code_context` retrieval (debug, symbol, dependencies, callers, tests, impact, history)
  • Enforces `@zettly-code` bug-fix comments via `audit({ category: 'bugfix_knowledge' })`
  • Strict workspace containment and secret/PII redaction
Verification:code_index ({ mode: 'status' })
Optional Extension ยท Zettly Code v1.0

Context-Aware Bug-Fix & Debugging Journey

When the optional Zettly Code engine is connected, DevWorkflow pairs persistent SQLite code memory (code_context, code_index) with mandatory @zettly-code bug-fix knowledge comments.

1. Start Bug-Fix Task

Open a governed bug-fix task with `start_task` (`type: 'bugfix'`) and concrete Definition of Done.

Start Bugfix
// AI Tool Call: start_task
{ "description": "Fix negative invoice discount calculation", "type": "bugfix", "projectDir": "/path/to/repo" }

2. Query `code_context` Before Scanning Files

Retrieve relevant symbols, invariants, past bug fixes, and covering tests from the knowledge graph.

Query Context
// AI Tool Call: code_context
{ "mode": "debug", "query": "calculateInvoice" }

3. Check `code_index` Freshness

Verify the local SQLite knowledge graph is fresh or incrementally update changed files.

Check Index
// AI Tool Call: code_index
{ "mode": "status" }

4. Fix, Test & Add `@zettly-code` Knowledge Comment

Apply the minimal verified fix, run regression tests, and record `@purpose`, `@bug-fix`, `@root-cause` (or `@hypothesis`), and `@fix`.

Fix & Annotate
/**
 * @zettly-code ZC-BILLING-001
 * @purpose Calculate monthly invoice amount safely
 * @bug-fix BUG-1001
 * @root-cause Unclamped discount produced negative invoice totals
 * @fix Clamped discount to subtotal maximum
 * @tests billing.test.js
 */

5. Refresh Index & Pass `bugfix_knowledge` Audit

Incrementally update the index and verify the mandatory bug-fix knowledge gate before closing.

Verify Gate
// AI Tool Call: audit
{ "category": "bugfix_knowledge", "files": ["src/billing.js"], "taskType": "BUG_FIX", "bugId": "BUG-1001" }

Ready for Real-World Workflows?

Explore 13 real-world developer tutorials covering solo coding, bugfixes, legacy refactoring, security audits, and multi-agent coordination.