Skip to content
dtoolkit

dwork — Projects

dwork

dwork is an AI-native, Markdown-driven project manager built for teams that work with AI coding agents. Instead of locking your project data into a proprietary database, dwork uses plain Markdown files — specifically BACKLOG.md — as the single source of truth. A SQLite + FTS5 index runs alongside for fast search, and both a REST API and MCP server expose everything to your agents and tools.

dwork follows dtoolkit’s core design principles:

  • Markdown is the source of truth. Every project lives in a directory with a BACKLOG.md file and a docs/ folder. You can read and edit these files with any text editor, and dwork keeps its SQLite index in sync.
  • SQLite + FTS5 is just an index. The database is disposable — dwork sync rebuilds it from your Markdown files at any time.
  • MCP + REST on the same port. The API server runs on port 7881, and the MCP server shares the same port. The web dashboard runs on 7882 (port + 1).
  • Bearer token auth. All API access is authenticated via API keys managed through the CLI.
  1. Install dwork globally or as a project dependency:

    install
    pnpm add -g @dtoolkit/dwork
  2. Initialize a new dwork workspace:

    terminal
    dwork init

    The interactive wizard creates ~/.dwork/ with a config.json and dwork.db, then scaffolds your first project.

  3. Start the server and dashboard:

    terminal
    dwork start

    This launches the REST + MCP API on port 7881 and the dashboard on port 7882.

  4. Check that everything is running:

    terminal
    dwork status

Each project gets its own directory under ~/.dwork/projects/ containing:

my-project/
├── BACKLOG.md # Tasks — the source of truth
├── docs/ # Numbered Markdown documents
│ ├── 001-architecture.md
│ ├── 002-api-design.md
│ └── 003-deployment-notes.md
└── metadata.json # Project config (name, description, created date)

Create a new project through the MCP create_project tool, the REST API, or the dashboard. dwork scaffolds the directory structure and creates an empty BACKLOG.md ready for tasks.

Each project tracks:

FieldDescription
idAuto-generated short ID
nameHuman-readable project name
descriptionOne-line summary
statusactive, paused, or archived
createdISO timestamp
updatedISO timestamp (last modification)

Tasks live inline in BACKLOG.md as Markdown list items with structured metadata in square brackets. This format is both human-readable and machine-parseable.

- [ ] Implement user authentication [feature|todo|P1|3h]
- [x] Fix login redirect loop [bug|done|P0|1h]
- [ ] Refactor database connection pool [chore|doing|P2|2h]
- [ ] Add rate limiting to API endpoints [task|todo|P1|4h]
- [ ] Remove deprecated v1 endpoints [chore|cancelled|P3|1h]

The metadata block follows the pattern [type|status|priority|estimate]:

TypeUse for
featureNew functionality or capabilities
taskGeneral work items, research, or spikes
bugDefects and regressions
choreMaintenance, cleanup, dependency updates
StatusDescription
todoNot started
doingCurrently in progress
doneCompleted
cancelledDropped or no longer needed
PriorityMeaning
P0Critical — drop everything
P1High — do this sprint
P2Medium — next sprint
P3Low — backlog

Estimates use shorthand notation: 1h, 3h, 1d, 3d, 1w. These are optional but help with planning and the dashboard’s workload views.

Each project supports numbered Markdown documents stored in the docs/ directory. These are intended for specs, architecture decisions, meeting notes, investigation logs, and anything else that supports the project but is not a task.

Documents are auto-numbered (001, 002, 003…) and indexed by FTS5 for full-text search. You can create, read, update, and list docs through the MCP tools, the REST API, or by directly adding Markdown files to the docs/ directory and running dwork sync.

terminal
# Sync Markdown files into the SQLite index
dwork sync

dwork uses SQLite FTS5 (contentless) to provide full-text search across all tasks and documents in all projects. The search supports:

  • Boolean operators (AND, OR, NOT)
  • Phrase matching with quotes
  • Prefix matching with *
  • Column filtering

Search is exposed through the MCP search tool, the REST GET /search endpoint, and the dashboard’s search bar.

terminal
# Example: search via the REST API
curl -H "Authorization: Bearer $DWORK_KEY" \
"http://localhost:7881/search?q=authentication+rate+limiting"

The dwork dashboard is a single-file React application served on port 7882 (one above the API port). It requires no build step — it loads React and dependencies from CDN and is served as a static asset by Fastify.

ViewDescription
OverviewGlobal kanban board showing tasks across all projects, grouped by status
Project detailPer-project view with tabs for kanban, task list, and docs
Task detailModal with full task info and a Markdown editor for notes
File treeDocs browser with directory tree navigation
SearchGlobal full-text search with instant results

The dashboard supports light and dark themes and is fully responsive for mobile use.

dwork integrates with @dtoolkit/codegraph-sdk to provide semantic code intelligence features. The code graph builds a knowledge graph from your codebase using tree-sitter WASM parsers, then exposes it through five dedicated MCP tools.

ToolDescription
graph_searchSearch for symbols, functions, classes, or patterns across the codebase
graph_statsGet statistics about the code graph — file count, symbol count, language breakdown
graph_traceTrace the call chain for a specific function or method
graph_impactAnalyze the impact of changing a specific symbol — what depends on it
graph_contextGet the full context around a symbol — its definition, references, and related code

These tools allow AI agents to reason about code structure when working on tasks. For example, an agent can use graph_impact before refactoring a function to understand what will break, or graph_trace to follow a bug through the call chain.

dwork exposes 21 MCP tools (plus 5 graph tools) and 1 MCP resource. All tools delegate to the service layer and are available when the MCP server is running on port 7881.

ToolDescription
create_projectCreate a new project with scaffolded directory structure
get_projectGet project details by ID
list_projectsList all projects with optional status filter
update_projectUpdate project metadata (name, description, status)
ToolDescription
add_taskAdd a task to a project’s BACKLOG.md
get_tasksList tasks for a project, with optional filters (status, type, priority)
update_taskUpdate task fields (status, priority, estimate, description)
ToolDescription
add_docCreate a new numbered document in a project
get_docRead a specific document by number
get_docsList all documents in a project
update_docUpdate the contents of a document
ToolDescription
searchFull-text search across all tasks and docs
overviewGlobal statistics — project count, task breakdown by status, recent activity
what_to_do_nextAI-powered suggestion of the highest-impact next task
ToolDescription
syncRe-index all Markdown files into the SQLite FTS5 database
ToolDescription
graph_searchSearch for symbols across the codebase
graph_statsCode graph statistics and language breakdown
graph_traceTrace call chains for a function
graph_impactImpact analysis for a symbol change
graph_contextFull context for a symbol (definition, references, related)
ResourceDescription
dwork://projectsRead-only resource listing all projects and their metadata

The REST API runs on port 7881 and mirrors the MCP tools. All endpoints require a Bearer token.

MethodPathDescription
GET/healthHealth check
GET/overviewGlobal stats
POST/projectsCreate project
GET/projectsList projects
GET/projects/:idGet project
PATCH/projects/:idUpdate project
POST/projects/:id/tasksAdd task
GET/projects/:id/tasksList tasks
PATCH/projects/:id/tasks/:taskIdUpdate task
POST/projects/:id/docsAdd doc
GET/projects/:id/docsList docs
GET/projects/:id/docs/:numGet doc
PATCH/projects/:id/docs/:numUpdate doc
GET/searchFull-text search
POST/syncRe-index Markdown files
GET/keysList API keys
POST/keysCreate API key
DELETE/keys/:idRevoke API key
CommandDescription
dwork initInteractive setup wizard — creates ~/.dwork/, configures database, scaffolds first project
dwork startStart the REST + MCP server (port 7881) and the dashboard (port 7882)
dwork statusShow server status, project count, and database stats
dwork syncRe-index all Markdown files into the SQLite database
dwork configureUpdate configuration interactively (ports, data directory, auth)
dwork keysManage API keys — list, create, revoke
terminal
pnpm add -g @dtoolkit/dwork
dwork init
dwork start

dwork stores its configuration in ~/.dwork/config.json. You can edit it directly or use dwork configure for an interactive experience.

SettingDefaultDescription
port7881REST + MCP API port
dataDir~/.dworkData directory for database and projects
auth.enabledtrueRequire Bearer token authentication
auth.keys[]API keys (managed via CLI or API)

Environment variables override config file values:

VariableOverrides
DWORK_PORTport
DWORK_DATA_DIRdataDir
┌─────────────────────────────────────────────────┐
│ Dashboard │
│ React SPA (:7882) │
└──────────────────────┬──────────────────────────┘
│ HTTP
┌──────────────────────▼──────────────────────────┐
│ Fastify Server (:7881) │
│ REST routes + MCP server │
│ Bearer token auth │
└──────────────────────┬──────────────────────────┘
┌──────────────────────▼──────────────────────────┐
│ Service Layer │
│ projects / tasks / docs / search / sync │
└────────┬─────────────────────────┬──────────────┘
│ │
┌────────▼────────┐ ┌──────────▼──────────┐
│ BACKLOG.md │ │ SQLite + FTS5 │
│ docs/*.md │ │ (index only) │
│ (source of │ │ │
│ truth) │◄───│ dwork sync │
└─────────────────┘ └─────────────────────┘