DoneGate is a local-first delivery control layer for AI-assisted software work.
It gives repositories a stricter definition of done:
- a task is not done until verification passes
- documentation sync is recorded
- required docs and artifacts exist
- spec drift reopens stale work
- hooks, CLI flows, and MCP-driven agents all enforce the same rules
AI coding tools make it easy to produce changes quickly, but they do not automatically give teams a trustworthy delivery workflow.
In practice, the same problems keep showing up:
- code is declared finished before tests or manual verification are complete
- docs are assumed to be updated but no one records that fact
- a spec changes after work is marked complete and the repository has no reliable way to reopen that work
- local hooks, CI checks, and agent tools each invent their own rule set
DoneGate exists to solve that gap with a lightweight, file-backed control plane that works in local repos first and can be called from CLI, git hooks, CI wrappers, Hermes MCP, or Codex plugin integrations.
DoneGate is designed to:
- make delivery state explicit instead of conversational
- keep task lifecycle, verification, doc sync, and spec drift in one shared model
- let agents use the same gate humans use
- stay easy to install from a git checkout without requiring a hosted backend
- support worktree-heavy, branch-heavy agent workflows
DoneGate is intentionally not trying to be:
- a hosted project management system
- a multi-user lock manager
- a PR platform replacement
- a full background daemon platform
- A hook-friendly CLI for local workflows and CI
- A file-backed state model under
.donegate-mcp/ - MCP tool support for agent orchestration
- Self-test execution with artifact logging
- Spec hash tracking and drift detection
- Deviation logging for intentional exceptions
- Advisory review records for architect-style outcome gaps
- Follow-up task generation from review findings
- Dashboard, plan, progress, and supervision read models
- Branch-scoped active task context
- Task scope ownership and coverage checks
- Policy-aware hooks for
pre-commitandpre-push - Worktree-safe bootstrap and repo-local onboarding assets
- Startup guide
- End-to-end demo
- Repository metadata
- Contributing
- Release checklist
- v0.4.0 release notes
- Hermes example config
- Codex plugin integration
git clone https://github.com/thtwz/DoneGate.git
cd DoneGate
python3 -m venv .venv
. .venv/bin/activate
pip install -e ".[mcp,test]"After installation:
donegate-mcp --helpFrom the repository you want DoneGate to supervise:
donegate-mcp bootstrap --project-name my-project --repo-root .This does four important things:
- initializes
.donegate-mcp - installs managed
pre-commitandpre-pushhooks - resolves the correct git hooks path even in linked worktrees
- generates repo-local onboarding assets
Bootstrap writes:
.donegate-mcp/env.sh.donegate-mcp/onboarding/codex.md.donegate-mcp/onboarding/hermes-mcp.yaml
donegate-mcp --data-root .donegate-mcp --json task create \
--title "Ship gate" \
--spec-ref docs/spec.md \
--verification-mode self-test \
--test-command "pytest -q" \
--required-doc-ref docs/plan.md \
--required-artifact reports/pytest.txt \
--plan-node-id phase-1-task-a
donegate-mcp --data-root .donegate-mcp task activate TASK-0001 --repo-root .
donegate-mcp --data-root .donegate-mcp --json task active --repo-root .donegate-mcp --data-root .donegate-mcp task start TASK-0001
donegate-mcp --data-root .donegate-mcp task submit TASK-0001
donegate-mcp --data-root .donegate-mcp --json task self-test TASK-0001 --workdir .
donegate-mcp --data-root .donegate-mcp task doc-sync TASK-0001 --result synced --ref docs/plan.md
donegate-mcp --data-root .donegate-mcp --json task done TASK-0001
# later, if the task must be reopened for more work:
donegate-mcp --data-root .donegate-mcp --json task reopen TASK-0001- Create a task from a spec or ticket.
- Start work and submit it for verification.
- Record verification or run the configured self-test.
- Record documentation sync.
- Close the task only when the gate passes.
- If completed work must resume, use
task reopento move it back into an active non-done state. - Refresh spec hashes when requirements change and revalidate stale work.
DoneGate v0.4 adds an advisory review layer for the gap that pure verification cannot catch: work that passes its formal acceptance path but still misses the real user need.
This layer is intentionally advisory:
- it does not block
done - it does not replace verification or doc sync
- it records architect-style findings as explicit state
- it can convert findings into follow-up tasks
Advisory review requests are created automatically when a task first crosses into submitted-for-verification and again before it reaches done. Re-running the same lifecycle command does not create duplicate pending requests.
donegate-mcp --data-root .donegate-mcp task submit TASK-0001
donegate-mcp --data-root .donegate-mcp --json review list --task-id TASK-0001 --include-findingsA human or host LLM can record a review finding:
donegate-mcp --data-root .donegate-mcp --json task review TASK-0001 \
--checkpoint manual \
--provider manual \
--summary "The literal flow passes, but frequent users still need a faster path." \
--recommendation proceed_with_followups \
--finding-json '{"dimension":"outcome_gap","severity":"medium","title":"Missing fast path","details":"The accepted workflow still takes too many steps for repeat users.","recommended_action":"Add a shortcut workflow.","suggested_task_title":"Add fast path","suggested_task_summary":"Reduce the number of steps for frequent users."}'Then turn a useful finding into tracked work:
donegate-mcp --data-root .donegate-mcp --json task create-from-finding FINDING-1234abcd
donegate-mcp --data-root .donegate-mcp --json dashboard --include-tasksFindings converted into follow-up tasks move out of the open advisory count and are tracked separately as spawned follow-ups.
Dashboard output also lists tasks with pending advisory reviews, so agents and humans can see which requested reviews still need host-side attention. Plugin Stop hooks surface a lightweight advisory reminder when pending reviews or open advisory findings remain.
Review runs preserve both the requested provider and the completed provider. The compatibility provider_id field still reflects the provider that completed the review, while requested_provider_id records who was originally asked to review.
MCP hosts get the same surface through task_review, review_list, review_disposition, and task_create_from_finding. In Codex, the recommended pattern is for the DoneGate skill to inspect pending advisory requests, run an architect-style review in the host, and call the MCP tool to record normalized findings.
DoneGate's host integration is intentionally layered:
- the canonical skill in
skills/donegate/is the operating protocol - MCP tools are the deterministic execution surface
.codex-plugin/plugin.jsonpackages the skill, MCP server, and hook triggers for Codex-style hosts- hooks are lightweight triggers over CLI/MCP surfaces, not a second implementation of lifecycle policy
This keeps delivery doctrine in one skill and enforcement in one domain model while still allowing Codex, Hermes, and other MCP clients to share the same governed state.
If you give an LLM only this repository URL, the intended zero-context bootstrap path is:
git clone https://github.com/thtwz/DoneGate.git
cd DoneGate
python3 -m venv .venv
. .venv/bin/activate
pip install -e ".[mcp,test]"Then, in the target repository the model should supervise:
donegate-mcp bootstrap --project-name my-project --repo-root .
source .donegate-mcp/env.sh
donegate-mcp --data-root .donegate-mcp --json onboarding --repo-root . --agent codexIf no active task exists yet, the model should:
donegate-mcp --data-root .donegate-mcp --json task list --limit 10
donegate-mcp --data-root .donegate-mcp --json task create \
--title "Describe the current work" \
--spec-ref docs/spec.md
donegate-mcp --data-root .donegate-mcp task activate TASK-0001 --repo-root .From there, the model has enough information to use all major surfaces:
- CLI commands through
donegate-mcp - local hooks through the files installed by
bootstrap - supervision and onboarding through
--json supervisionand--json onboarding - Hermes MCP through
.donegate-mcp/onboarding/hermes-mcp.yaml - Codex integration through
.donegate-mcp/onboarding/codex.mdand the plugin setup in the startup guide
An LLM integrating DoneGate should follow this sequence:
- Clone and install DoneGate from this repository.
- Run
donegate-mcp bootstrap --project-name ... --repo-root .inside the target repository. - Read
donegate-mcp --json onboarding --repo-root . --agent <codex|hermes>. - Ensure a branch-scoped active task exists before editing code.
- Use
donegate-mcp --json supervision --repo-root .before commits or pushes. - Record verification and doc sync before calling a task done.
- Inspect advisory reviews before closing substantial work, and convert accepted outcome gaps into follow-up tasks.
The CLI is the primary stable interface for local adoption and CI wrappers.
Useful read commands:
donegate-mcp --data-root .donegate-mcp --json dashboard --include-tasks --limit 20
donegate-mcp --data-root .donegate-mcp --json progress
donegate-mcp --data-root .donegate-mcp --json plan
donegate-mcp --data-root .donegate-mcp --json supervision --repo-root .
donegate-mcp --data-root .donegate-mcp --json onboarding --repo-root . --agent codexManaged hooks use the same supervision model as the CLI.
Current policy behavior:
pre-commitblocks onneeds_task,task_mismatch, andneeds_revalidationpre-commitwarns onstale_verificationandstale_docspre-pushblocks on any status stronger thantracked
Use the generated onboarding asset or the example config:
.donegate-mcp/onboarding/hermes-mcp.yamlexamples/hermes-mcp-config.yaml
The repository-local onboarding asset is the preferred source because it is generated with the correct local interpreter and data_root.
DoneGate can also be exposed to Codex as a local plugin. The plugin layer should stay thin and point at the same MCP server, not reimplement delivery rules.
When Codex launches DoneGate as a shared plugin, make sure the Codex process inherits the repo-local environment from .donegate-mcp/env.sh. That file exports DONEGATE_MCP_ROOT and DONEGATE_MCP_REPO_ROOT, which let shared MCP sessions target the supervised repository instead of the plugin installation checkout.
If the host cannot inherit that environment, MCP calls should pass repo_root explicitly.
See:
- Startup guide
.donegate-mcp/onboarding/codex.md
When a task changes observable system behavior, do not treat any single signal as enough evidence to call it done. Real acceptance should verify the full closed loop:
- the externally observable outcome,
- the operation result at the system boundary,
- the persisted source-of-truth state,
- and the downstream derived state that depends on that persistence.
If any of those disagree, the task is not actually done and should be captured as failed verification or a deviation.
DoneGate stores a repo-local active task context and, when --repo-root points to a git repository, binds tasks to the current branch.
donegate-mcp --data-root .donegate-mcp task activate TASK-0001 --repo-root .
donegate-mcp --data-root .donegate-mcp --json task active --repo-root .
donegate-mcp --data-root .donegate-mcp task clear-active --repo-root .This makes branch-heavy agent workflows much safer in worktrees and parallel sessions.
donegate-mcp --data-root .donegate-mcp --json supervision --repo-root .The supervision read model can report:
cleanneeds_tasktask_mismatchneeds_revalidationstale_verificationstale_docstracked
When task scopes are configured, supervision also returns:
covered_filesuncovered_filespolicy.pre_commitpolicy.pre_push
DoneGate stores repo-local state under .donegate-mcp/, including:
project.jsonplan.jsonprogress.jsonsession.jsonsupervision.jsondeviations.jsonltasks/events/review_runs/review_findings/artifacts/onboarding/
For humans:
- This README
- Startup guide
- End-to-end demo
For LLMs and agent systems:
- This README
donegate-mcp --json onboarding --repo-root . --agent codex- Startup guide
.donegate-mcp/onboarding/codex.mdor.donegate-mcp/onboarding/hermes-mcp.yaml
Run the test suite with:
PYTHONPATH=src pytest -qDoneGate is licensed under Apache-2.0.