Skip to the content.

Command Reference

See also: USER-GUIDE.md for workflow overview and usage examples.

Command Hierarchy

DGS commands span a range of scope and automation. The hierarchy below orders them from lightest to heaviest — choose the smallest command that fits your task.

Tier Command Scope Subagents Best For
1 /dgs:fast <desc> 1-3 files, ~30 lines None Typo fixes, config tweaks, one-line changes
2 /dgs:quick Small feature or bug fix Planner + executor Bug fixes, small features, ad-hoc tasks
3 /dgs:quick --full Medium task needing quality guarantees Planner + checker + executor + verifier Tasks where you want plan-checking and post-execution verification without full milestone ceremony
4 /dgs:execute-phase <N> Full planned phase Research + planner + checker + executor + verifier Milestone work with research, planning, and verification
5 /dgs:debug [desc] Open-ended investigation Debug agents Systematic diagnosis when something is broken

How to choose: Start with /dgs:fast for trivial edits. If the scope warning fires (more than 3 files or 30 lines), step up to /dgs:quick. Use /dgs:quick --full when you want verification but don’t need milestone ceremony. Use /dgs:quick --debug when something is broken and you want investigation before fixing. Reserve /dgs:execute-phase for planned work with requirements and roadmap tracking.

What --full adds: The --full flag on /dgs:quick enables the plan-checker agent (validates plans achieve the task goal, up to 2 iterations) and the post-execution verifier agent (confirms deliverables match intent). These are the same quality gates used in /dgs:execute-phase, applied to an ad-hoc task.

What --debug adds: The --debug flag tells the planner to investigate root cause before fixing. The agent documents findings, may result in no code change if the issue is environmental. Same git mechanics as a regular quick task.

Core Workflow

Command Purpose When to Use
/dgs:new-project Project identity: questioning → PROJECT.md Start of a new project (run new-milestone after)
/dgs:new-milestone [name] Start next version cycle After new-project or completing a milestone
/dgs:abandon-milestone Discard an ad-hoc milestone, restore planning docs Abandoning an ad-hoc container
/dgs:discuss-phase [N] Capture implementation decisions Before planning, to shape how it gets built
/dgs:plan-phase [N] Research + plan + verify Before executing a phase
/dgs:execute-phase <N> Execute all plans in parallel waves After planning is complete
/dgs:verify-work [N] [--auto] Interactive UAT (--auto for rubber-stamp pass) After execution completes
/dgs:audit-phase <phase> [--rerun-failed] Automated phase verification (tests + structural inspection) After execution completes
/dgs:audit-milestone Verify milestone met its definition of done Before completing milestone
/dgs:complete-milestone Archive milestone, tag release All phases verified

Core Workflow Details

/dgs:new-project Establish project identity through interactive questioning. Creates PROJECT.md with goals, constraints, and scope. Run /dgs:new-milestone after to begin research and planning.

Usage: /dgs:new-project (interactive questioning flow) Usage: /dgs:new-project --auto @prd.md (from idea document) Usage: /dgs:new-project --auto spec-review-config (from finalized spec)

/dgs:new-milestone [name] Start a new milestone cycle for an existing project.

Usage: /dgs:new-milestone (interactive milestone creation) Usage: /dgs:new-milestone --auto spec-review-config (from finalized spec) Usage: /dgs:new-milestone --adhoc "Experiments" --version v0.1 (ad-hoc container milestone)

/dgs:discuss-phase [N] Extract implementation decisions that guide research and planning.

Usage: /dgs:discuss-phase 3 (discuss phase 3 interactively) Usage: /dgs:discuss-phase 3 --auto (auto-advance pipeline)

/dgs:plan-phase [N] Create executable plans for a phase with integrated research and verification.

Usage: /dgs:plan-phase 3 (full research + plan + verify) Usage: /dgs:plan-phase 3 --skip-research (plan without research) Usage: /dgs:plan-phase 3 --gaps (plan fixes for verification gaps) Usage: /dgs:plan-phase 3 --non-interactive (plan without prompts, stop after planning)

/dgs:execute-phase <N> Execute all plans in a phase using wave-based parallel execution.

Usage: /dgs:execute-phase 3 (execute phase 3) Usage: /dgs:execute-phase 3 --non-interactive (auto-approve without auto-advancing) Usage: /dgs:execute-phase 3 --auto (hands-off execution pipeline) Usage: /dgs:execute-phase 3 --gaps-only (execute only gap-closure plans)

/dgs:audit-phase <phase> [--rerun-failed] Automated phase-level verification combining test execution with structural inspection.

Usage: /dgs:audit-phase 41 (full audit of phase 41) Usage: /dgs:audit-phase 41 --rerun-failed (re-verify only previously-failed items)

/dgs:verify-work flag notes:

/dgs:complete-milestone <version> Merge all milestone work to main and archive the milestone. Manual only — jobs never auto-run this.

For each code repo (sequentially):

  1. Pulls latest base_branch from remote into main checkout
  2. Rebases milestone branch onto base_branch in worktree
  3. Conflict-agent attempts automatic resolution. If it fails: aborts rebase, provides manual resolution commands
  4. Fast-forward merges milestone branch to base_branch
  5. Pushes to remote
  6. Removes milestone branch and worktree

After all code repos merge: updates STATE.md in planning repo to mark milestone complete. Archives phase directories and creates a git tag.

Multi-repo: Repos process sequentially (repo 1 then repo 2, etc.). Stops on first failure. Already-merged repos are skipped on re-run (idempotent).

PR mode (git.completion_mode: pr): instead of steps 4–6, each repo’s milestone branch is pushed with --force-with-lease and an idempotent PR is opened via gh; the milestone parks at pr_open with a per-repo PR record (entry.prs). Re-run after all PRs merge to reap the worktree and archive — archival happens at reap, never at PR open. Four-eyes governance gates at PR open only. --merged asserts the merge without gh. gh is required only in this mode. See Completion Modes: Merge vs PR.

If rebase conflicts require manual resolution:

cd ~/dev/myapp--gsd-v19          # cd to worktree
git rebase main                  # start rebase
# resolve conflicts, then:
git add .
git rebase --continue
# repeat if multiple commits have conflicts
# when done, re-run /dgs:complete-milestone

Job-mode behavior: When invoked from a milestone job with <job-mode>silent</job-mode>, all interactive gates are auto-resolved: scope confirmation is auto-approved, incomplete requirements are acknowledged, phase directories are archived automatically, branch handling is kept for manual review, and tag push is skipped for safety.

Usage: /dgs:complete-milestone 1.0.0

/dgs:abandon-milestone

Cleanly discard an ad-hoc container milestone. Removes all milestone worktrees and local branches and path-scoped-restores the project planning docs (PROJECT.md, STATE.md, ROADMAP.md, REQUIREMENTS.md, config.json) to their pre-milestone snapshot, committing the reversion. Ad-hoc-only — refuses on spec/phase-driven milestones with guidance. Destructive; requires confirmation. Removes local worktrees/branches only — warns (does not delete) if a milestone branch was pushed to a remote. Lifecycle cleanup removes the snapshot base ref and ad-hoc config keys.

Usage: /dgs:abandon-milestone (interactive; requires confirmation)

See How Git is Used for a conceptual overview of the rebase-before-merge strategy.

Command Purpose When to Use
/dgs:progress Show status and next steps Anytime – “where am I?”
/dgs:resume-work Restore full context from last session Starting a new session
/dgs:pause-work Save context handoff Stopping mid-phase
/dgs:help Show all commands Quick reference
/dgs:update Update DGS with changelog preview Check for new versions
/dgs:join-discord Open Discord community invite Questions or community

Phase Management

Command Purpose When to Use
/dgs:add-phase Append new phase to roadmap Scope grows after initial planning
/dgs:insert-phase [N] Insert urgent work (decimal numbering) Urgent fix mid-milestone
/dgs:remove-phase [N] Remove future phase and renumber Descoping a feature
/dgs:list-phase-assumptions [N] Preview Claude’s intended approach Before planning, to validate direction
/dgs:plan-milestone-gaps Create phases for audit gaps After audit finds missing items
/dgs:research-phase [N] Deep ecosystem research only Complex or unfamiliar domain

Phase Management Details

/dgs:plan-milestone-gaps Create phases to close gaps identified by milestone audit.

Usage: /dgs:plan-milestone-gaps (interactive – confirms before creating phases) Usage: /dgs:plan-milestone-gaps --auto (non-interactive gap closure)

Brownfield & Utilities

Command Purpose When to Use
/dgs:map-codebase [<repo-name>] Map repos with per-repo + unified docs Before /dgs:new-project, after repo changes
/dgs:sync [pull\|push\|status] Pull from and push to all registered repos Keep planning and code repos in sync with remote
/dgs:fast <desc> Trivial edit with single atomic commit, no subagents Typo fix, config tweak, one-line change
/dgs:quick Ad-hoc task with DGS guarantees Bug fixes, small features, config changes
/dgs:debug [desc] Systematic debugging with persistent state When something breaks
/dgs:code-review [scope\|PR URL] On-demand multi-pass code review — auto-fix in local mode, comment-only on PRs Before complete-quick/complete-milestone, four-eyes PR review, after manual/skip-DGS edits
/dgs:security-review [scope\|PR URL] Threat-model-oriented review — reads the diff as new attack surface (trust boundaries, newly-reachable sinks, secrets); reports and routes, never auto-fixes After code-review settles the diff, when the change plausibly moved attack surface — auth, network, deserialization, secrets
/dgs:adversarial-review [scope] Claim-refutation review — refuter agents execute code to refute done-ness claims; verdicts with evidence, no auto-fix Final trust gate after audit-phase, code-review and security-review, before complete-quick/complete-milestone
/dgs:add-todo [desc] Capture an idea for later Think of something during a session
/dgs:check-todos [area] List pending todos, optionally filtered by area Review captured ideas
/dgs:cleanup Archive completed quick task directories Reduce clutter in quick/ directory
/dgs:settings Configure workflow toggles and model profile Change model, toggle agents
/dgs:set-profile <profile> Quick profile switch (quality, balanced, budget) Change cost/quality tradeoff
/dgs:reapply-patches Restore local modifications after update After /dgs:update if you had local edits

Brownfield & Utilities Details

/dgs:map-codebase [<repo-name>] Map registered repos to produce structured codebase documentation with per-repo detail and unified synthesis.

Usage: /dgs:map-codebase (refresh all repos) Usage: /dgs:map-codebase api-service (update specific repo only)

/dgs:quick Execute small, ad-hoc tasks with atomic commits and STATE.md tracking.

Completion honors git.completion_mode: in pr mode, /dgs:complete-quick opens a PR per touched repo instead of merging locally, and the quick parks at pr_open until the PR merges (reap with a re-run or dgs-tools reap-quicks). See Completion Modes: Merge vs PR.

Usage: /dgs:quick (prompts for task description) Usage: /dgs:quick fix the login button (with inline description) Usage: /dgs:quick --full add input validation (with plan-checking and verification) Usage: /dgs:quick --debug tests failing after merge (investigate before fixing)

/dgs:fast <description> Make a trivial edit with a single atomic commit. The lightest DGS command.

Usage: /dgs:fast fix the login button color (make edit and commit) Usage: /dgs:fast update timeout --dry-run (preview changes first)

/dgs:code-review [staged|unstaged|branch|<file>|<PR URL>] [--repo <name>] On-demand, human-invoked code review at lifecycle boundaries. Distinct from (a) the automatic per-plan codereview gate inside execute-phase, which reviews plan-executor output non-interactively, and (b) /dgs:diff-report, which summarizes a diff without reviewing it.

Usage: /dgs:code-review (context-aware default) Usage: /dgs:code-review branch (review all commits on this branch vs base) Usage: /dgs:code-review src/lib/foo.cjs (review one file) Usage: /dgs:code-review https://github.com/owner/repo/pull/123 (PR review mode) Usage: /dgs:code-review branch --repo my-api (pick a registered repo explicitly)

/dgs:security-review [staged|unstaged|branch|<PR URL>] [--repo <name>] [--base <branch>] Change-scoped security review — the security lens in the gate chain. Where /dgs:code-review reads the diff inward for line-level correctness, this reads it outward as new attack surface: what does the change let an attacker reach that they could not reach before?

Usage: /dgs:security-review (default: branch scope) Usage: /dgs:security-review staged (review what’s staged) Usage: /dgs:security-review branch --repo my-api (pick a registered repo explicitly) Usage: /dgs:security-review branch --base develop (override the base branch) Usage: /dgs:security-review https://github.com/owner/repo/pull/123 (review a PR, fork-safe and read-only)

/dgs:adversarial-review [<phase>|<quick-slug>|milestone] [--repo <name>] Claim-refutation review — the final trust gate. Distinct from audit-phase (goal-backward structural: does what the plan promised exist and wire up), /dgs:code-review (diff-inward line-level: is the code correct/clean/to-standard), and /dgs:security-review (trust-boundary-outward: what new attack surface does the diff introduce) — this asks whether the CLAIM that something works is actually true, by executing code rather than reading it.

Usage: /dgs:adversarial-review (default: most recently completed phase) Usage: /dgs:adversarial-review 04 (a specific phase) Usage: /dgs:adversarial-review milestone (all completed phases in the milestone) Usage: /dgs:adversarial-review 260704-btz (a quick slug) Usage: /dgs:adversarial-review 04 --repo my-api (pick a registered repo explicitly)

Testing & Dependency Scanning

Command Purpose When to Use
/dgs:package-scan Scan registered repos + product root for dependency vulnerabilities and licence issues Before release, after dependency changes, or on demand

Testing & Dependency Scanning Details

/dgs:package-scan [flags]

Standalone dependency vulnerability + licence scanner that runs across every repo in REPOS.md plus the product root.

Flags:

Flag Effect
--threshold critical\|high\|medium\|low Filter findings at or above the severity. Default from testing.packages.severity_threshold config.
--repo <name> Restrict scan to one registered repo (errors with a valid-repo list if the name is unknown).
--json Emit machine-readable JSON to stdout in addition to writing the markdown report.
--include-dev-deps / --no-include-dev-deps Include or exclude devDependencies. Default from testing.packages.include_dev_dependencies config.

Configuration: see Configuration Reference for testing.packages.* keys (tool selection, severity threshold, Snyk token placement, timeout).

Related files in the DGS install:

Usage:

/dgs:package-scan                              # scan everything with cascade default
/dgs:package-scan --threshold high             # high/critical only
/dgs:package-scan --repo api                   # single repo
/dgs:package-scan --json                       # emit JSON output
/dgs:package-scan --threshold critical --repo worker --no-include-dev-deps

Artifact Graph

Command Purpose When to Use
/dgs:query "<question>" Natural-language question answered as a read-only SELECT over the SQLite artifact index “Which ideas are pending?”, tracing idea → spec → milestone → phases
/dgs:integrity Report dangling links, orphaned artifacts, and broken milestone references (read-only) Before release, in CI / a pre-push hook, or on demand

Artifact Graph Details

/dgs:query "<question>" [--sql] [--limit N] Ask a natural-language question of the artifact graph. Read-only NL→SQL over the SQLite index.

Usage: /dgs:query "which ideas are still pending?" Usage: /dgs:query "phases in milestone v28.0" --sql (show the generated SQL) Usage: /dgs:query "specs referencing idea 12" --limit 20

/dgs:integrity [--quiet] Report artifact-graph integrity problems, grouped by class, with per-class and total counts. A clean graph prints ✓ no integrity issues.

Usage: /dgs:integrity (full grouped report) Usage: /dgs:integrity --quiet (summary counts only)

Ideas & Specs

Command Purpose When to Use
/dgs:add-idea Capture a new idea When inspiration strikes
/dgs:list-ideas View ideas by state Review your idea backlog
/dgs:discuss-idea [id] Develop idea through structured discussion Refine problem and approach before researching
/dgs:research-idea [id] Research idea’s feasibility and landscape Investigate technical options before spec writing
/dgs:develop-idea [id] Discussion then research in one flow Full idea development in one session
/dgs:update-idea <id> Edit or replace idea content Refine an idea over time
/dgs:reject-idea <id> Move idea to rejected Idea is out of scope
/dgs:restore-idea <id> Restore to pending Reconsider a rejected/done idea
/dgs:consolidate-ideas [id...] [--title "..."] Merge related ideas into one AI-synthesised idea Reduce idea backlog by merging overlapping ideas
/dgs:find-related-ideas [id] [--threshold ...] Find ideas related to a selected idea Discover overlapping ideas before consolidation
/dgs:undo-consolidation [id] Undo a consolidation Reverse a consolidation that did not turn out right
/dgs:write-spec Draft PRD from ideas with cross-LLM review Ready to formalize ideas into a spec
/dgs:import-spec <path> Import external document as DGS spec Have an external document to bring into DGS
/dgs:list-specs View specs by status Check spec pipeline
/dgs:refine-spec <slug> [--section <N>] Refine spec through conversational editing Iterate on a spec before approval
/dgs:approve-spec <slug> Approve draft spec after validation Finalize a spec for implementation

Ideas & Specs Details

/dgs:add-idea Capture a new idea into the ideas system interactively or from conversation context.

Usage: /dgs:add-idea (interactive: prompts for title, body, tags) Usage: /dgs:add-idea --auto (extracts from conversation context)

/dgs:list-ideas View ideas grouped by state (Pending, Done, Rejected) with development status indicators.

Usage: /dgs:list-ideas (show all ideas) Usage: /dgs:list-ideas --pending (focus on actionable ideas) Usage: /dgs:list-ideas --tag api (filter by tag)

/dgs:discuss-idea [id] Develop and refine an idea through structured, inline conversation.

Usage: /dgs:discuss-idea 5 (discuss idea #5) Usage: /dgs:discuss-idea (prompts to select from pending ideas)

/dgs:research-idea [id] Research an idea’s feasibility and technical landscape via subagent.

Usage: /dgs:research-idea 5 (research idea #5) Usage: /dgs:research-idea (prompts to select from pending ideas)

/dgs:develop-idea [id] Develop an idea through discussion then research as a single continuous flow.

Usage: /dgs:develop-idea 5 (develop idea #5) Usage: /dgs:develop-idea (prompts to select from pending ideas)

/dgs:update-idea <id> Edit or replace idea content, or append a timestamped note.

Usage: /dgs:update-idea 5 (edit idea #5) Usage: /dgs:update-idea 5 --note "discussed with team, they like it" (append note)

/dgs:write-spec [id...] Draft a structured PRD spec from pending ideas, send through cross-LLM review, and finalize.

Usage: /dgs:write-spec (interactive: select ideas, review draft, approve) Usage: /dgs:write-spec 1 3 (pre-select ideas 1 and 3) Usage: /dgs:write-spec 1 3 --auto (fully automated spec creation)

/dgs:list-specs View specs grouped by status (Draft, Final) with version and implementation tracking.

Usage: /dgs:list-specs (show all specs) Usage: /dgs:list-specs --final (see specs ready for projects)

/dgs:import-spec <path> [--ideas <id...>] Import an external document and convert it into a structured 9-section PRD spec using AI-powered restructuring.

Supported file types: PDF, markdown, and images.

How it works:

  1. Run the command with a path to your external document. DGS reads the file and converts its content into the standard 9-section PRD structure (Problem Statement, Goals, Non-Goals, User Stories, Requirements, Success Metrics, Open Questions, Timeline Considerations, Implementation Notes). Every detail from the source document is preserved — content is restructured, not summarized.

  2. DGS presents the converted spec for your review. You have four options:
    • Save — accept the conversion and save it as a draft spec. The original document is preserved as an attachment in the spec’s docs directory.
    • Edit — provide feedback on specific sections. DGS revises the conversion based on your input and presents the updated version for another review.
    • Discard — cancel the import without saving anything.
    • Restart — regenerate the conversion from scratch.
  3. When you save, DGS creates the spec with draft status, copies the original document into the spec’s attachment directory, and commits everything in a single atomic git commit.

If your project has codebase maps (codebase/) or product docs (docs/product/), DGS loads them as context during conversion. This means the Implementation Notes section references real modules and patterns from your codebase rather than generic placeholders.

Usage: /dgs:import-spec ./mobile-app-redesign.pdf Usage: /dgs:import-spec ./api-overhaul.md --ideas 3 7

Spec Lifecycle

Specs follow a two-state machine: draft and final. A spec starts as draft when created via /dgs:write-spec or /dgs:import-spec. It can be iteratively refined (each refinement increments the version) and formally approved to reach final status. All lifecycle changes are tracked in the spec’s Refinement Log.

/dgs:refine-spec <slug> [--section <N>] Refine a spec through a conversational editing session with Claude as a collaborative thinking partner.

Usage: /dgs:refine-spec spec-lifecycle-management (refine entire spec) Usage: /dgs:refine-spec spec-lifecycle-management --section 5 (focus on section 5) Usage: /dgs:refine-spec spec-lifecycle-management --section "open questions" (focus by heading name)

/dgs:approve-spec <slug> Approve a draft spec after completeness validation, transitioning it to final status.

Usage: /dgs:approve-spec spec-lifecycle-management (approve the spec)

Idea Consolidation Details

/dgs:consolidate-ideas [id...] [--title "..."] Merge two or more related pending ideas into a single AI-synthesised idea with full lineage tracking and history preservation.

How it works:

  1. Run the command with idea IDs or select interactively. DGS validates all source ideas exist and are in pending state.
  2. DGS reads the full content of each source idea (body, notes, discussion logs, research logs) and generates a coherent synthesised body.
  3. A diff-style preview shows what will happen: your N source ideas alongside the proposed merged idea. Review the synthesised body, title, and merged tags.
  4. Choose to approve (creates the consolidated idea), edit (describe changes and review again), or cancel (no changes).
  5. On approval, the CLI creates the new idea, moves sources to consolidated/, and commits everything atomically.

Usage: /dgs:consolidate-ideas 1 3 17 (consolidate ideas 1, 3, and 17) Usage: /dgs:consolidate-ideas (interactive: select from pending ideas) Usage: /dgs:consolidate-ideas 1 3 --title "Unified API resilience" (with explicit title)

/dgs:find-related-ideas [id] [--threshold high|medium|low] Find pending ideas related to a selected idea using multi-signal scoring, then optionally flow into consolidation.

Usage: /dgs:find-related-ideas 42 (find ideas related to #42) Usage: /dgs:find-related-ideas (interactive: select anchor idea) Usage: /dgs:find-related-ideas 42 --threshold low (show all matches including low)

/dgs:undo-consolidation [id] Undo a previous consolidation by restoring source ideas to pending and deleting the consolidated result idea.

Usage: /dgs:undo-consolidation 5 (undo consolidation of idea #5) Usage: /dgs:undo-consolidation (interactive: select from consolidated ideas)

Threads

Command Purpose When to Use
/dgs:add-thread [title] Create a thread — an organizing topic above ideas Starting a line of work that will generate multiple ideas/todos and decisions over time
/dgs:list-threads Thread index: status + live child idea/todo roll-up per thread Check what threads are open, dormant, or closed
/dgs:resume-thread [thread-id] Reload a thread’s goal, decisions ledger, next steps, and open todos Picking a thread back up in a new session
/dgs:promote-idea [idea-id] Promote an existing idea into the thread it anchors An idea has grown into an ongoing topic that will spawn more ideas/todos
/dgs:backfill-threads Adopt threads onto an existing idea backlog via a review-gated dry-run sweep Retrofitting threads onto ideas captured before threads existed

Threads Details

/dgs:add-thread [title] [--id thread-slug] [--projects a,b] Create a single thread directly, parallel to /dgs:add-idea. Mints the thread doc, seeds an empty Goal + Next Steps, and records a create Log entry — all in ONE commit. Create-only: this command runs no dedup pass itself — the create-time similarity/anti-fragmentation guard lives in the engine (see the Similarity guard note in USER-GUIDE.md).

Usage: /dgs:add-thread (prompts for a title) Usage: /dgs:add-thread "Payments v2 rework" (title-only create; id auto-derived from the title)

/dgs:list-threads [--status open|dormant|closed] [--projects a,b] A THREAD INDEX — rows are the threads themselves, each with its status and a live roll-up of child ideas + open todos ({idea_count} ideas / {todo_count} todos), in updated desc order. Distinct from list-ideas --by-thread (an ideas view grouped under thread headers).

Usage: /dgs:list-threads (all threads) Usage: /dgs:list-threads --status open (only open threads)

/dgs:resume-thread [thread-id] [--reopen] Load a thread’s goal, decisions ledger, next steps, and open todos into the session. A dormant thread flips to open automatically (audited). A closed thread NEVER auto-flips — it prompts before reopening; a non-interactive invocation displays without flipping, and --reopen performs the audited flip.

Usage: /dgs:resume-thread payments-v2-rework Usage: /dgs:resume-thread payments-v2-rework --reopen (reopen a closed thread)

/dgs:promote-idea [idea-id] [--id thread-slug] [--relink] Promote an existing idea into the anchoring thread it represents. Creates the thread and stamps the source idea’s single links.thread edge in ONE atomic commit. The idea is RETAINED additively as the thread’s anchor child — its status is never changed, and it keeps its full lifecycle (idea → spec → phase is still possible).

Usage: /dgs:promote-idea 42 (promote idea #42 into a new anchoring thread)

/dgs:backfill-threads [--projects a,b] Adopt threads on an EXISTING pending-ideas backlog via a review-gated, revertible dry-run classification sweep. Runs a deterministic dry-run classification, renders cluster-parent proposals conversationally (proposed title, one-line goal, child count + titles, confidence, ambiguity flags), shows a separate “unsure” bucket and a reported-defects list, and lets you accept/reject in natural language with bulk-accept and edit-at-review. Claude then AI-synthesizes each accepted thread’s Goal + Context and attributed Decisions Ledger, applies via the engine thread sweep-apply, and surfaces the one-command revert. Conversational review is the primary write surface — the raw dgs-tools thread sweep JSON stays available for non-interactive/automation consumers.

Usage: /dgs:backfill-threads (dry-run sweep + conversational review) Usage: /dgs:backfill-threads --projects api,web (scope the sweep to specific projects)

dgs-tools thread <verb> The full engine roster backing the five slash commands above (mirrors how dgs-tools query … backs /dgs:query in Artifact Graph Details and dgs-tools reap-quicks backs the reap sweep in PR Completion & reap-quicks):

create, list, append-note, append-context, append-decision, append-retraction, set-status, close, compact, link, promote, resume, sweep, sweep-apply, sweep-revert

Thread id is an immutable, auto-derived SLUG (not an integer) — derived from the title via slugifyThreadId when --id is omitted. Lifecycle is open / dormant / closed; appends to a closed thread are rejected (the file is left untouched) with a reopen hint (reopen with: dgs-tools thread set-status <id> open). Roll-up counts (idea_count/todo_count) are always live reverse-index queries — never text stored in the thread file itself.

Lineage flags. Sibling commands carry thread-aware engine flags (dgs-tools layer): ideas create --from-thread <id> and todo create --from-thread <id> (mint a new idea/todo pre-linked to a thread, stamping its links.thread edge in the SAME create commit), ideas list --by-thread and list-todos --by-thread (group results under thread headers), and thread link --relink (the cardinality-one override described above — moving a child to a different thread always requires it, never silently overwritten).

Command Purpose When to Use
/dgs:add-doc <file> Add a supporting document (PDF, image, spreadsheet) Attach reference material to an idea, spec, or product
/dgs:list-docs List all supporting documents by scope See what reference material exists
/dgs:remove-doc Remove a document Clean up outdated references
/dgs:search <query> Search across ideas, specs, docs, and projects Find anything in the planning directory

Documents & Search Details

/dgs:add-doc <file> Add a supporting document to a scoped docs/ directory with text extraction.

Usage: /dgs:add-doc architecture.pdf (auto-detects scope from context) Usage: /dgs:add-doc diagram.png --scope idea --scope-id 5 (attach to idea #5) Usage: /dgs:add-doc summary.md --scope product (add as product-level context)

/dgs:remove-doc Remove a document or move it to a different scope.

Usage: /dgs:remove-doc (prompts to select and remove) Usage: /dgs:remove-doc --move (reorganize without deleting)

/dgs:search <query> Search across ideas, specs, docs, and projects with fuzzy keyword matching.

Usage: /dgs:search "auth tokens" (search all content) Usage: /dgs:search authentication --ideas-only (search only ideas) Usage: /dgs:search review --include-rejected --tags api (broad search with filters)

Product docs as context: Documents added with --scope product are automatically loaded as context by several workflows:

This means uploading a target architecture or product summary via /dgs:add-doc --scope product will automatically inform spec drafting, phase planning, project initialization, and milestone creation.

Project Management

Command Purpose When to Use
/dgs:list-projects Show all projects with status and repos Overview of the product’s projects
/dgs:switch-project [name] Switch active project context Working on a different project
/dgs:complete-project Mark the current project as completed All milestones are done

Multi-Repo Management

Command Purpose When to Use
/dgs:init-product Initialize planning repo structure with recommended defaults Setting up multi-repo management
/dgs:add-repo [name] Register a sibling repo Adding a new repo to the project
/dgs:remove-repo [name] Unregister a repo from REPOS.md Removing a repo from the product
/dgs:overlap-check Show repos touched by multiple active projects Detect potential cross-project conflicts
/dgs:health Validate repo reachability and config After setup or when repos seem unreachable

Per-Console Context

The active context (a milestone or a standalone quick) is resolved per console with precedence --context flag > session binding (CLAUDE_CODE_SESSION_IDexecution.console_bindings) > DGS_CONTEXT env var > config default (execution.active_context) > none. Inside a Claude Code session the session binding is the default path (no shell setup); DGS_CONTEXT is the raw-shell path. See Per-Console Context in the User Guide for both workflows.

Session binding (CLAUDE_CODE_SESSION_IDexecution.console_bindings). In a Claude Code session, switch-context <slug> and quick-create bind the current session by writing config.local.json execution.console_bindings[CLAUDE_CODE_SESSION_ID] = <slug> instead of clobbering the shared execution.active_context — so parallel sessions on one project each keep their own focus. complete-quick / abandon-quick / complete-milestone drop every binding pointing at the finished slug. No .zshrc edit and no relaunch are needed.

Command Purpose When to Use
dgs-tools switch-context <slug> In a Claude Code session: bind THIS session (execution.console_bindings[CLAUDE_CODE_SESSION_ID]). In a raw shell with no session id: repoint the shared config default Focus the current console on a milestone or quick for parallel work
dgs-tools switch-context <slug> --print Raw-shell path: emit export DGS_CONTEXT=<slug> on stdout (read-only — writes no config). Eval it to bind a plain terminal: eval "$(dgs-tools switch-context <slug> --print)" Bind a non-Claude-Code terminal to a context
dgs-tools context (or context show) Print the resolved per-console context + source as <slug> (session\|flag\|env\|default); a session-bound console shows <slug> (session) Check what this console is bound to

--context <slug> flag. A one-shot per-command override accepted on the context-sensitive command set: fast, quick, complete-quick, abandon-quick, and complete-milestone. It binds the command’s context at the FLAG precedence level (flag > session binding > DGS_CONTEXT env > config default) and never overwrites the inherited session binding or DGS_CONTEXT — a stale --context (no live worktree) warns and falls through to the next level.

Per-context executor lock (execution.executing). While /dgs:execute-phase runs a wave, it records a lock in config.local.json execution.executing, keyed by context slug ({ "<slug>": { started_at, session_id } }). switch-context refuses to flip focus into or out of a context that is mid-execution (drift guard), but a lock on one context never blocks an independent console working a different context. Each entry honours a 6h-stale escape and the --force override; --print (read-only) is exempt.

unset DGS_CONTEXT advisory. When complete-quick or abandon-quick finalizes a quick the current console is bound to (DGS_CONTEXT equals that slug), the tool emits an unset DGS_CONTEXT line (stderr) and an unbind field in its JSON, so a raw shell can clear a binding that now points at a removed worktree. (Session bindings are cleared automatically.)

Safety guards (Phase 9). complete-quick refuses a milestone-bound console and complete-milestone refuses a quick-bound console (the actionable message names the bound slug and the correct command). An unbound console prints a one-time unbound — defaulting to <milestone> notice before context-sensitive commands. The standalone-quick cap (3) counts quick worktrees only — the milestone context never consumes a slot.

PR Completion & reap-quicks

git.completion_mode. complete-quick and complete-milestone honor the git.completion_mode config key: merge (the default — an absent key means merge) or pr. In pr mode, completion rebases, pushes the branch with --force-with-lease, and opens (or updates) a GitHub pull request per touched repo instead of merging locally; the quick or milestone parks at pr_open until its PRs merge, then a re-run reaps it. The GitHub CLI (gh) is a hard dependency only in pr mode (and for fast-PR) — the default merge path never invokes it. Full model: Completion Modes: Merge vs PR.

dgs-tools reap-quicks Sweep every live quick and reap the ones whose PRs have merged. For each quick at pr_open with a stored PR record, the sweep checks merge state via gh — every repo of a multi-repo quick must be merged; a partial merge never reaps. Merged quicks are reaped (base branch pulled, worktree and branch removed, console bindings dropped). Everything else is skipped with a reason, and a gh outage on one quick fails that quick only — the sweep continues. Output is a per-quick summary with reaped / skipped / failed counts.

Flag Effect
--merged Assert the merge and reap without gh — the probe is bypassed entirely. The escape hatch when gh is down or unauthenticated and you know the PR merged.
--slug <slug> Narrow the sweep to a single named quick.
--force-reap Override the post-merge-work guard (commits made in the worktree after the last pushed PR head otherwise block the reap).

A quick whose PR was closed without merging is never swept — it is skipped with guidance to run complete-quick <slug> --confirm-cleanup instead.

Usage: dgs-tools reap-quicks (sweep all merged quicks) Usage: dgs-tools reap-quicks --merged --slug 260702-abc (assert one quick merged, no gh)