Autonomous file-based AI workflow orchestrator for repository-based coding agents.
Project description
ai-workflow
ai-workflow is a file-based workflow orchestrator for repositories where AI coding agents such as Codex work through milestones, tasks, ADRs, generated prompts, Git branches, commits, PRs, and sequential handoffs.
It is designed to be installed once and initialized inside any Git repository:
python -m pip install aiw
aiw init
If aiw is installed globally on your machine, bare aiw ... commands remain compatible. Repository-generated examples use uv run aiw ... as the canonical form so the package and project environment are resolved consistently.
Core idea
- Tool logic lives in the installed Python package.
- Package entrypoints use clean module paths only: CLI commands use
ai_workflow.cli.main, and rendering entrypoints live under focusedai_workflow.rendering.*modules. - Project state lives in
.ai-workflow.yamlanddocs/ai/workspace. - JSON state is canonical.
- Durable handoff Markdown files are repository-owned; runtime Markdown reports and mirrors are generated.
- One milestone maps to one branch.
- One task maps to one logical commit.
- One finished milestone maps to one pull request.
- AI work is sequential: one active milestone and one active task run through the
coreexecution context.
Quick start
cd my-project
uv run aiw init
uv run aiw doctor
uv run aiw backlog promote BLG-001 --output docs/ai/plan/milestones.md
uv run aiw agent run --lane core --mode queue
Plan With ChatGPT Or Gemini
For a new workpackage, let a general planning model produce the local execution plan before Codex starts coding:
- Print the milestone-builder prompt:
uv run aiw agent plan-prompt --target milestones --print
- Paste that prompt into ChatGPT or Gemini with the product goal, repository context, screenshots, constraints, or backlog notes.
- Paste the returned Markdown into
docs/ai/plan/milestones.md. The output must start with# Milestones. - Validate and optionally optimize the local plan:
uv run aiw plan validate docs/ai/plan/milestones.md
uv run aiw plan optimize docs/ai/plan/milestones.md --dry-run
- Import or bootstrap it:
uv run aiw plan import docs/ai/plan/milestones.md
uv run aiw agent bootstrap --plan docs/ai/plan/milestones.md --lane core
docs/ai/plan/milestones.md should contain commit-shaped tasks. A commit-shaped task is one logical commit with observable acceptance criteria and clear conflict scopes. Avoid tiny checklist steps such as "add import", "rename variable", "run formatter", or "write one assertion"; merge those details into the nearest reviewable task.
Bad micro-task plan:
# Milestones
## M01 - Parser cleanup
Tasks:
- Add import
Acceptance: Import exists.
Conflict: src/parser.py
- Rename helper
Acceptance: Helper is renamed.
Conflict: src/parser.py
- Write assertion
Acceptance: Assertion exists.
Conflict: tests/test_parser.py
Optimized workpackage-shaped plan:
# Milestones
## M01 - Parser cleanup
Goal: Make parser cleanup reviewable as one implementation slice.
Tasks:
- Consolidate parser cleanup behavior
Acceptance: Parser uses the renamed helper through the intended import path.
Acceptance: Parser behavior is covered by focused tests.
Conflict: src/parser.py, tests/test_parser.py
- Update parser documentation
Acceptance: Parser docs describe the cleanup behavior.
Conflict: docs/parser.md
Open the generated prompt:
docs/ai/workspace/prompts/next-core.md
After the AI finishes the task:
uv run aiw agent finish --lane core --task TASK-001 --commit
uv run aiw agent run --lane core --mode queue
When the final task in a milestone passes checks, uv run aiw agent finish --commit attempts automatic milestone closeout:
uv run aiw agent finish --lane core --commit
The closeout flow finishes the milestone, pushes the milestone branch, creates or reuses the PR, checks mergeability when available, merges when safe, regenerates reports, and records exact blockers when push, PR, merge, credentials, branch protection, or cleanup fail.
Important commands
uv run aiw init
uv run aiw doctor
uv run aiw status
uv run aiw report all
uv run aiw backlog promote BLG-001 --output docs/ai/plan/milestones.md
uv run aiw plan import docs/ai/plan/milestones.md
uv run aiw milestone list
uv run aiw agent run --lane core --mode queue
uv run aiw agent finish --lane core --task TASK-001 --commit
uv run aiw git cleanup --dry-run
Repository-owned files
These files are intended to be durable project files:
.ai-workflow.yaml
docs/ai/START_HERE.md
docs/ai/README.md
docs/ai/plan/backlog.md
docs/ai/workspace/adr/*.md
docs/operator/operator.md
docs/operator/codex-agent.md
docs/ai/workspace/active-roadmap.md
docs/ai/workspace/current-status.md
docs/ai/workspace/next-handoff.md
Runtime/generated files
These files are local execution state or generated artifacts and can be regenerated by aiw:
docs/ai/plan/milestones.md
docs/ai/workspace/state/**/*.json
docs/ai/workspace/locks/
docs/ai/workspace/runs/
docs/ai/workspace/tasks/*.md
docs/ai/workspace/milestones/*.md
docs/ai/workspace/prompts/
docs/ai/workspace/reports/*.md
docs/ai/workspace/archive/
docs/ai/workspace/generated-packs/
docs/operator/queue-run.md
docs/ai/plan/milestones.md is a local execution plan. Keep it ignored by default and commit it only by explicit user opt-in; new workpackages can generate a fresh plan starting again at M01.
Development
uv run python -m pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiw-0.1.0.tar.gz.
File metadata
- Download URL: aiw-0.1.0.tar.gz
- Upload date:
- Size: 125.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf63e27e544560dcdf7adadfdb0a9774fe43338b88e07e21108c5978b98017c9
|
|
| MD5 |
70ab3674692ea091411f77f6a0c94aab
|
|
| BLAKE2b-256 |
fe45eac3134b95a89033fbfb5647eb0b545c7bdfda10c582325a4ced76739166
|
Provenance
The following attestation bundles were made for aiw-0.1.0.tar.gz:
Publisher:
release.yml on SunneV/AIWorkflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiw-0.1.0.tar.gz -
Subject digest:
cf63e27e544560dcdf7adadfdb0a9774fe43338b88e07e21108c5978b98017c9 - Sigstore transparency entry: 1751720536
- Sigstore integration time:
-
Permalink:
SunneV/AIWorkflow@2e35adc8f7388600eb3ad84853737828070a9664 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SunneV
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2e35adc8f7388600eb3ad84853737828070a9664 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aiw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aiw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 102.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7521a251e909d86192de37f2f806f55513d45345a933e83456c765fea78f2de8
|
|
| MD5 |
5a95e440d09834ccf3b11cf897484dd2
|
|
| BLAKE2b-256 |
691a55881f5311ee928248fb11262274fdcf04f0e6df822c0cfec6ea80f8b7df
|
Provenance
The following attestation bundles were made for aiw-0.1.0-py3-none-any.whl:
Publisher:
release.yml on SunneV/AIWorkflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiw-0.1.0-py3-none-any.whl -
Subject digest:
7521a251e909d86192de37f2f806f55513d45345a933e83456c765fea78f2de8 - Sigstore transparency entry: 1751720598
- Sigstore integration time:
-
Permalink:
SunneV/AIWorkflow@2e35adc8f7388600eb3ad84853737828070a9664 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/SunneV
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2e35adc8f7388600eb3ad84853737828070a9664 -
Trigger Event:
push
-
Statement type: