agentmachinist 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. agentmachinist-0.1.0/.github/workflows/ci.yml +28 -0
  2. agentmachinist-0.1.0/.github/workflows/machinist-approve.yml +31 -0
  3. agentmachinist-0.1.0/.github/workflows/release.yml +31 -0
  4. agentmachinist-0.1.0/.gitignore +19 -0
  5. agentmachinist-0.1.0/.machinist/specs/.gitkeep +0 -0
  6. agentmachinist-0.1.0/.machinist/specs/issue-1-spec.md +62 -0
  7. agentmachinist-0.1.0/AgentMachinist-Prompt.md +37 -0
  8. agentmachinist-0.1.0/LICENSE +21 -0
  9. agentmachinist-0.1.0/PKG-INFO +131 -0
  10. agentmachinist-0.1.0/README.md +114 -0
  11. agentmachinist-0.1.0/docs/getting-started.md +254 -0
  12. agentmachinist-0.1.0/docs/onboarding.html +384 -0
  13. agentmachinist-0.1.0/docs/superpowers/specs/2026-08-16-agentmachinist-design.md +124 -0
  14. agentmachinist-0.1.0/machinist.yaml +29 -0
  15. agentmachinist-0.1.0/pyproject.toml +36 -0
  16. agentmachinist-0.1.0/src/machinist/__init__.py +0 -0
  17. agentmachinist-0.1.0/src/machinist/cli.py +180 -0
  18. agentmachinist-0.1.0/src/machinist/config.py +107 -0
  19. agentmachinist-0.1.0/src/machinist/github.py +143 -0
  20. agentmachinist-0.1.0/src/machinist/harness/__init__.py +23 -0
  21. agentmachinist-0.1.0/src/machinist/harness/base.py +66 -0
  22. agentmachinist-0.1.0/src/machinist/harness/claude_code.py +14 -0
  23. agentmachinist-0.1.0/src/machinist/harness/codex.py +12 -0
  24. agentmachinist-0.1.0/src/machinist/harness/opencode.py +12 -0
  25. agentmachinist-0.1.0/src/machinist/harness/pi.py +12 -0
  26. agentmachinist-0.1.0/src/machinist/phases/__init__.py +0 -0
  27. agentmachinist-0.1.0/src/machinist/phases/execute.py +90 -0
  28. agentmachinist-0.1.0/src/machinist/phases/spec.py +82 -0
  29. agentmachinist-0.1.0/src/machinist/phases/status.py +56 -0
  30. agentmachinist-0.1.0/src/machinist/phases/watch.py +50 -0
  31. agentmachinist-0.1.0/src/machinist/templates/github/machinist-approve.yml +31 -0
  32. agentmachinist-0.1.0/src/machinist/templates/github/machinist-spec.yml +42 -0
  33. agentmachinist-0.1.0/src/machinist/templates/implement-prompt.md +21 -0
  34. agentmachinist-0.1.0/src/machinist/templates/machinist.yaml +29 -0
  35. agentmachinist-0.1.0/src/machinist/templates/spec-prompt.md +43 -0
  36. agentmachinist-0.1.0/src/machinist/workspace.py +106 -0
  37. agentmachinist-0.1.0/tasks/todo.md +108 -0
  38. agentmachinist-0.1.0/tests/test_cli.py +256 -0
  39. agentmachinist-0.1.0/tests/test_config.py +112 -0
  40. agentmachinist-0.1.0/tests/test_docs.py +91 -0
  41. agentmachinist-0.1.0/tests/test_execute_phase.py +222 -0
  42. agentmachinist-0.1.0/tests/test_github.py +223 -0
  43. agentmachinist-0.1.0/tests/test_harness.py +96 -0
  44. agentmachinist-0.1.0/tests/test_spec_phase.py +150 -0
  45. agentmachinist-0.1.0/tests/test_status_phase.py +128 -0
  46. agentmachinist-0.1.0/tests/test_watch_phase.py +107 -0
  47. agentmachinist-0.1.0/tests/test_workspace.py +203 -0
  48. agentmachinist-0.1.0/uv.lock +267 -0
@@ -0,0 +1,28 @@
1
+ # Test suite for AgentMachinist itself. No secrets needed: the tests
2
+ # never touch the network (gh and harness subprocesses are faked; git
3
+ # tests run against local repos in tmp dirs).
4
+
5
+ name: CI
6
+
7
+ on:
8
+ push:
9
+ branches: [main]
10
+ pull_request:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Install dependencies
25
+ run: uv sync
26
+
27
+ - name: Run tests
28
+ run: uv run pytest
@@ -0,0 +1,31 @@
1
+ # AgentMachinist — Phase 2 convenience: convert a '/machinist-execute'
2
+ # comment on a machinist draft PR into the 'machinist:approved' label.
3
+ #
4
+ # Only comments from the repo owner, org members, or collaborators are
5
+ # honored; anyone else commenting the command is ignored.
6
+
7
+ name: Machinist Approve
8
+
9
+ on:
10
+ issue_comment:
11
+ types: [created]
12
+
13
+ permissions:
14
+ pull-requests: write
15
+ issues: write
16
+
17
+ jobs:
18
+ approve:
19
+ if: >-
20
+ github.event.issue.pull_request
21
+ && startsWith(github.event.comment.body, '/machinist-execute')
22
+ && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Apply approval label
26
+ env:
27
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28
+ run: |
29
+ gh pr edit ${{ github.event.issue.number }} \
30
+ --repo ${{ github.repository }} \
31
+ --add-label "machinist:approved"
@@ -0,0 +1,31 @@
1
+ # Publishes agentmachinist to PyPI when a GitHub Release is published.
2
+ #
3
+ # Uses PyPI Trusted Publishing (OIDC) — no API tokens stored anywhere.
4
+ # One-time setup on pypi.org is required first; see README "Releasing".
5
+
6
+ name: Release to PyPI
7
+
8
+ on:
9
+ release:
10
+ types: [published]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ publish:
17
+ runs-on: ubuntu-latest
18
+ environment: pypi
19
+ permissions:
20
+ id-token: write # OIDC token for PyPI Trusted Publishing
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v5
26
+
27
+ - name: Build sdist and wheel
28
+ run: uv build
29
+
30
+ - name: Publish to PyPI
31
+ run: uv publish --trusted-publishing always
@@ -0,0 +1,19 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+
8
+ # Environments
9
+ .venv/
10
+
11
+ # Tooling
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+
15
+ # macOS
16
+ .DS_Store
17
+
18
+ # Machinist runtime state (consumer repos keep specs; this repo doesn't run itself)
19
+ .machinist/runs/
File without changes
@@ -0,0 +1,62 @@
1
+ # Spec: Create a friendly user-guide for AgentMachinist (#1)
2
+
3
+ ## Summary
4
+
5
+ Write a beginner-friendly "Getting Started with AgentMachinist" guide as a new `docs/getting-started.md`, walking a newcomer from zero to their first harness-generated spec PR, and link it from `README.md`. The guide documents only what actually ships in v0.1 (`machinist init` and `machinist spec <n>`), clearly marks `watch`/`run`/`status` as upcoming, and is backed by drift tests so its commands and config examples can never silently diverge from the code.
6
+
7
+ ## Requirements
8
+
9
+ The issue asks for "a Getting started with AgentMachinist guide that will allow anyone to be able to leverage this build system." Interpretation chosen: a single in-repo Markdown guide (no docs-site generator), aimed at a developer who knows git and GitHub but has never seen AgentMachinist, documenting the current v0.1 behavior truthfully rather than the full three-phase vision as if it were done.
10
+
11
+ 1. A guide exists at `docs/getting-started.md` and covers, in order: what AgentMachinist is (the three-phase issue → spec → approve → execute pipeline, and that the agent never merges), prerequisites, installation, repository setup with `machinist init`, running a first task with `machinist spec <n>`, reviewing and approving via the `machinist:approved` label or `/machinist-execute` comment, local vs. CI spec generation, a full `machinist.yaml` configuration reference, harness selection, troubleshooting, and current v0.1 limits.
12
+ 2. Every `machinist <subcommand>` the guide mentions is a real command registered on the Click group in `src/machinist/cli.py` (`init`, `spec`, `watch`, `run`, `status`), and every flag shown (`--force`, `--workflows/--no-workflows`, `--version`) exists.
13
+ 3. Every fenced ```yaml block in the guide validates against `MachinistConfig` from `src/machinist/config.py` (all fields have defaults, so partial top-level snippets validate too; `extra="forbid"` catches typos).
14
+ 4. The configuration reference documents every key in the packaged template `src/machinist/templates/machinist.yaml`, including defaults and the validated ranges from `config.py` (`timeout_minutes` 1–240, `spec_timeout_minutes` 1–60, `poll_interval_seconds` ≥ 10, `repo` shaped `owner/repo`).
15
+ 5. The troubleshooting section covers the real failure modes and quotes the actual error text users will see: missing config (`machinist.yaml not found. Run 'machinist init' first.` from `config.py`), missing `gh` (`github.py`), missing harness executable (`harness/base.py`), harness timeout, empty spec (`phases/spec.py`), and a leftover workspace (`workspace <path> already exists; remove it (or 'git worktree remove' it) and retry` from `workspace.py`).
16
+ 6. Commands not yet implemented (`watch`, `run`, `status` — all raise "not implemented" in `cli.py`) are presented in a clearly labeled "What's next" section, matching the milestones in `docs/superpowers/specs/2026-08-16-agentmachinist-design.md`, never as working features.
17
+ 7. `README.md` links to `docs/getting-started.md` near the top; existing README content is otherwise unchanged.
18
+ 8. Drift tests in a new `tests/test_docs.py` enforce requirements 1–3 and 7, and the full suite stays green.
19
+
20
+ ## Proposed approach
21
+
22
+ **New: `docs/getting-started.md`** — the guide itself, ~250–350 lines, friendly second-person prose. Section plan, grounded in the code:
23
+
24
+ 1. **What is AgentMachinist?** — reuse the ASCII pipeline diagram style from `README.md`; emphasize the human-in-the-loop guarantees (spec approved before code, PR reviewed before merge).
25
+ 2. **Before you begin** — prerequisites with verification commands: `git`, authenticated `gh` (`gh auth status`), `uv`, and at least one harness CLI (`claude`, `opencode`, `pi`, `codex` — the `default_command` values in `src/machinist/harness/*.py`).
26
+ 3. **Install** — `uv tool install` per README's Install section; verify with `machinist --version` (works via `click.version_option(package_name="agentmachinist")` in `cli.py`).
27
+ 4. **Set up your repository** — run `machinist init`; explain each artifact it writes (`machinist.yaml`, `.machinist/specs/`, `.github/workflows/machinist-spec.yml`, `machinist-approve.yml`) and the printed "Next steps"; cover `--no-workflows` and `--force`; note the `ANTHROPIC_API_KEY` secret is only needed for the CI path.
28
+ 5. **Your first agent task** — create an issue, label it `agent-task`, run `machinist spec <n>`; narrate what happens using `phases/spec.py` as ground truth: isolated worktree under `~/.machinist/workspaces`, harness runs in read-only print mode, spec lands at `.machinist/specs/issue-<n>-spec.md` on branch `agent/issue-<n>`, draft PR titled `Spec: <title> (#<n>)` with `Closes #<n>`.
29
+ 6. **Review and approve** — read the spec in the PR's Files changed; apply `machinist:approved` or comment `/machinist-execute`; note the OWNER/MEMBER/COLLABORATOR restriction from `machinist-approve.yml`.
30
+ 7. **What's next (v0.1 status)** — `run`, `watch`, `status` are stubs today; link the design doc's milestones.
31
+ 8. **Configuration reference** — one annotated full-config yaml block (kept identical in spirit to `src/machinist/templates/machinist.yaml`) plus a prose walkthrough of each section, including workspace strategies/cleanup policies and the test gate.
32
+ 9. **Troubleshooting** — table of symptom → cause → fix using the real exception messages listed in requirement 5.
33
+
34
+ **Edit: `README.md`** — add one line under the intro paragraph: `New here? Start with the [Getting Started guide](docs/getting-started.md).` Nothing else moves.
35
+
36
+ **New: `tests/test_docs.py`** — follows the existing test style (plain functions, stdlib + project imports, like `tests/test_cli.py`):
37
+ - `test_guide_exists_with_required_sections` — asserts the file exists and contains the required section headings.
38
+ - `test_readme_links_to_guide` — asserts `docs/getting-started.md` appears in `README.md`.
39
+ - `test_guide_subcommands_are_real` — regex `machinist ([a-z][a-z-]*)` over the guide; every captured subcommand must be in `main.commands` (import `main` from `machinist.cli`).
40
+ - `test_guide_yaml_blocks_validate` — extract every ```yaml fenced block, `yaml.safe_load` it, and `MachinistConfig.model_validate` it; mirrors the existing `test_init_template_round_trips_through_schema` pattern so schema drift fails loudly. Guide convention (stated in a comment): yaml snippets are always rooted at the top level.
41
+ - `test_guide_uses_real_label_names` — asserts `agent-task` and `machinist:approved` appear, guarding against label renames leaving the docs stale.
42
+
43
+ Per the project's TDD convention, `tests/test_docs.py` is written first (red), then the guide and README link make it green.
44
+
45
+ ## Testing plan
46
+
47
+ - **Automated:** `uv run pytest` (the repo's own `machinist.yaml` test gate; `pyproject.toml` sets `testpaths = ["tests"]`, `-q`). The five new tests in `tests/test_docs.py` prove requirements 1–3, 5 (heading/section presence), 7, and 8; the existing 59 tests must stay green.
48
+ - **Manual smoke:** in a scratch git repo, follow the guide verbatim through section 4 (`uv tool install` → `machinist --version` → `machinist init` → inspect written files) confirming every command and output matches. The `machinist spec` walkthrough is verified against `phases/spec.py` and `tests/test_spec_phase.py` behavior rather than a live run, since a live run creates a real PR.
49
+ - **Review check:** diff the guide's config reference against `src/machinist/config.py` field-by-field to confirm defaults and ranges (requirement 4).
50
+
51
+ ## Out of scope
52
+
53
+ - No docs-site generator (MkDocs/Sphinx), hosting, or publishing pipeline — one Markdown file only.
54
+ - No screenshots, video, or diagrams beyond ASCII.
55
+ - No documentation of `watch`/`run`/`status` behavior beyond the roadmap note; no changes to CLI code, templates, or workflows.
56
+ - No restructuring of `README.md` beyond adding the link; no changes to the design doc under `docs/superpowers/specs/`.
57
+ - No translations.
58
+
59
+ ## Open questions
60
+
61
+ 1. Is `agentmachinist` actually published to PyPI? `README.md` offers both `uv tool install agentmachinist` and the `git+https://github.com/vscarpenter/AgentMachinist` fallback; the guide should lead with whichever actually works today.
62
+ 2. Should the guide live at `docs/getting-started.md` (proposed) or replace/absorb parts of `README.md`? The proposal keeps README as the terse front door and the guide as the narrative walkthrough.
@@ -0,0 +1,37 @@
1
+ You are an expert systems engineer and developer tools architect. I want you to help me build a local-first, open-source agentic build and CI/CD system called **AgentMachinist**.
2
+
3
+ AgentMachinist enables a solo developer working on a Mac to bridge GitHub issues with local coding harnesses (like Claude Code, OpenCode, PI, or Codex).
4
+
5
+ Please review the core architecture below and help me implement the initial project structure, configuration files, and automation scripts.
6
+
7
+ ---
8
+
9
+ ### Core Architecture & Workflow Requirements
10
+
11
+ 1. **The Harness Abstraction Layer (`machinist.yaml`)**
12
+ - Create a configuration schema and parser that defines which coding harness to use (`claude-code`, `opencode`, `pi`, `codex`), timeout settings, and workspace rules.
13
+
14
+ 2. **Phase 1: GitHub Issue Ingestion & Spec Generation**
15
+ - Write a script or GitHub Action workflow template that triggers upon GitHub issue creation (or when an `agent-task` label is applied).
16
+ - The script should invoke the configured harness to read the issue and generate an implementation spec and plan saved to a dedicated directory (e.g., `.machinist/specs/issue-<number>-spec.md`).
17
+ - It must automatically create a new git branch (`agent/issue-<number>`), commit the spec file, and **open a Draft Pull Request** on GitHub referencing the original issue.
18
+
19
+ 3. **Phase 2: Human Review & Approval Mechanism**
20
+ - Define how approvals are tracked (e.g., transitioning the Draft PR to "Ready for Review" or detecting a specific label/comment like `/machinist-execute`).
21
+
22
+ 4. **Phase 3: Local Execution Daemon / CLI (`machinist`)**
23
+ - Build a lightweight local command-line interface (written in Python, Node, or Go—let's discuss or use a clean Python/Click or Go structure) that can run on my Mac.
24
+ - The CLI should have commands like:
25
+ - `machinist init`: Sets up `machinist.yaml` and local directories.
26
+ - `machinist watch`: Polls or listens for approved PRs/labels on GitHub.
27
+ - `machinist run <issue-number>`: Pulls the approved spec branch locally, invokes the local coding harness (e.g., executing Claude Code or the chosen CLI tool headlessly or interactively with the spec), runs tests, and pushes the implementation commits back to the PR branch.
28
+
29
+ ---
30
+
31
+ ### Your Immediate Task
32
+ 1. Propose the optimal technology stack (e.g., Python or TypeScript) for the local CLI and GitHub integration.
33
+ 2. Outline the directory structure for the AgentMachinist repository.
34
+ 3. Write the initial code for `machinist.yaml` schema, the core CLI entrypoint, and the GitHub API wrapper for handling Draft PR creation.
35
+
36
+ Let's start step-by-step. Give me the project layout and the core bootstrapping code first.
37
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vinny Carpenter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.5
2
+ Name: agentmachinist
3
+ Version: 0.1.0
4
+ Summary: Local-first agentic build & CI/CD: bridge GitHub issues to local coding harnesses
5
+ Project-URL: Homepage, https://github.com/vscarpenter/AgentMachinist
6
+ Project-URL: Repository, https://github.com/vscarpenter/AgentMachinist
7
+ Project-URL: Issues, https://github.com/vscarpenter/AgentMachinist/issues
8
+ Author-email: Vinny Carpenter <vscarpenter@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,ci,claude-code,developer-tools,github
12
+ Requires-Python: >=3.12
13
+ Requires-Dist: click>=8.1
14
+ Requires-Dist: pydantic>=2.7
15
+ Requires-Dist: pyyaml>=6.0
16
+ Description-Content-Type: text/markdown
17
+
18
+ # AgentMachinist
19
+
20
+ Local-first agentic build & CI/CD for solo developers. AgentMachinist bridges
21
+ GitHub issues to local coding harnesses — Claude Code, OpenCode, PI, or
22
+ Codex — through a three-phase, human-in-the-loop pipeline that runs on your Mac.
23
+
24
+ New here? Start with the [Getting Started guide](docs/getting-started.md).
25
+ Prefer a visual tour? Open [`docs/onboarding.html`](docs/onboarding.html) in a
26
+ browser — a self-contained illustrated handbook of the pipeline and its
27
+ principles.
28
+
29
+ ```
30
+ GitHub issue (label: agent-task)
31
+ │
32
+ ▼
33
+ Phase 1 · SPEC harness writes .machinist/specs/issue-<n>-spec.md
34
+ │ → branch agent/issue-<n> → draft PR (Closes #<n>)
35
+ ▼
36
+ Phase 2 · APPROVE you review the spec; apply label machinist:approved
37
+ │ (or comment /machinist-execute on the PR)
38
+ ▼
39
+ Phase 3 · EXECUTE local daemon implements the spec in an isolated
40
+ worktree, runs your tests, pushes to the PR branch,
41
+ and marks it ready for review
42
+ ```
43
+
44
+ The agent never merges anything. You approve the spec before code is written,
45
+ and you review the PR before it lands.
46
+
47
+ ## Install
48
+
49
+ ```sh
50
+ uv tool install agentmachinist # or: uv tool install git+https://github.com/vscarpenter/AgentMachinist
51
+ ```
52
+
53
+ Prerequisites: [`gh`](https://cli.github.com) (authenticated), `git`, and at
54
+ least one coding harness CLI (`claude`, `opencode`, `pi`, or `codex`).
55
+
56
+ ## Quickstart
57
+
58
+ In the repository you want agents to work on:
59
+
60
+ ```sh
61
+ machinist init # writes machinist.yaml, .machinist/, and GitHub workflows
62
+ machinist spec 42 # Phase 1 for issue #42 (or let `watch` pick it up)
63
+ machinist watch # daemon: polls for labeled issues and approved PRs
64
+ machinist run 42 # Phase 3 for an approved spec
65
+ ```
66
+
67
+ ## Configuration (`machinist.yaml`)
68
+
69
+ ```yaml
70
+ version: 1
71
+ harness:
72
+ name: claude-code # claude-code | opencode | pi | codex
73
+ command: null # optional executable override
74
+ timeout_minutes: 30 # Phase 3 implementation budget
75
+ spec_timeout_minutes: 10 # Phase 1 spec budget
76
+ github:
77
+ repo: null # "owner/repo"; null = derived from origin
78
+ labels:
79
+ trigger: agent-task
80
+ approved: "machinist:approved"
81
+ poll_interval_seconds: 60
82
+ workspace:
83
+ root: ~/.machinist/workspaces
84
+ strategy: worktree # worktree | clone
85
+ cleanup: on_success # always | on_success | never
86
+ branch_prefix: agent/
87
+ tests:
88
+ command: null # e.g. "pytest -q"; null skips the test gate
89
+ ```
90
+
91
+ Unknown keys are rejected — typos fail loudly instead of being ignored.
92
+
93
+ ## How approval works
94
+
95
+ The single source of truth is the `machinist:approved` label on the draft PR.
96
+ Apply it by hand, or comment `/machinist-execute` on the PR — the bundled
97
+ `machinist-approve.yml` workflow converts that comment into the label (only
98
+ for repo owners, members, and collaborators). Draft → Ready for Review is
99
+ reserved as the *agent's* signal that implementation is complete.
100
+
101
+ ## Spec generation: local or CI
102
+
103
+ Both paths run the same `machinist spec <n>` command:
104
+
105
+ - **Local (default):** `machinist watch` sees the `agent-task` label and
106
+ generates the spec on your machine using your existing harness login.
107
+ - **CI:** the bundled `machinist-spec.yml` workflow runs it in GitHub Actions
108
+ when an issue is labeled — works while your Mac sleeps, but requires an
109
+ `ANTHROPIC_API_KEY` repository secret.
110
+
111
+ ## Status
112
+
113
+ v0.1 (M3): all three phases work end-to-end — `init`, `spec`, `run`,
114
+ `status`, and the `watch` daemon (`--once` for a single cron-friendly pass).
115
+ The pipeline has dogfooded itself: its own getting-started guide was specced,
116
+ approved, implemented, test-gated, and merged by the pipeline (issue #1 →
117
+ PR #3). See `docs/superpowers/specs/` for the design.
118
+
119
+ ## Releasing (maintainer notes)
120
+
121
+ Publishing uses [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/)
122
+ — no tokens. One-time setup: on pypi.org under *Publishing*, add a pending
123
+ publisher for project `agentmachinist` (owner `vscarpenter`, repo
124
+ `AgentMachinist`, workflow `release.yml`, environment `pypi`). After that,
125
+ each release is: bump `version` in `pyproject.toml`, commit, then create a
126
+ GitHub Release for tag `v<version>` — the release workflow builds and
127
+ publishes automatically.
128
+
129
+ ## License
130
+
131
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,114 @@
1
+ # AgentMachinist
2
+
3
+ Local-first agentic build & CI/CD for solo developers. AgentMachinist bridges
4
+ GitHub issues to local coding harnesses — Claude Code, OpenCode, PI, or
5
+ Codex — through a three-phase, human-in-the-loop pipeline that runs on your Mac.
6
+
7
+ New here? Start with the [Getting Started guide](docs/getting-started.md).
8
+ Prefer a visual tour? Open [`docs/onboarding.html`](docs/onboarding.html) in a
9
+ browser — a self-contained illustrated handbook of the pipeline and its
10
+ principles.
11
+
12
+ ```
13
+ GitHub issue (label: agent-task)
14
+ │
15
+ ▼
16
+ Phase 1 · SPEC harness writes .machinist/specs/issue-<n>-spec.md
17
+ │ → branch agent/issue-<n> → draft PR (Closes #<n>)
18
+ ▼
19
+ Phase 2 · APPROVE you review the spec; apply label machinist:approved
20
+ │ (or comment /machinist-execute on the PR)
21
+ ▼
22
+ Phase 3 · EXECUTE local daemon implements the spec in an isolated
23
+ worktree, runs your tests, pushes to the PR branch,
24
+ and marks it ready for review
25
+ ```
26
+
27
+ The agent never merges anything. You approve the spec before code is written,
28
+ and you review the PR before it lands.
29
+
30
+ ## Install
31
+
32
+ ```sh
33
+ uv tool install agentmachinist # or: uv tool install git+https://github.com/vscarpenter/AgentMachinist
34
+ ```
35
+
36
+ Prerequisites: [`gh`](https://cli.github.com) (authenticated), `git`, and at
37
+ least one coding harness CLI (`claude`, `opencode`, `pi`, or `codex`).
38
+
39
+ ## Quickstart
40
+
41
+ In the repository you want agents to work on:
42
+
43
+ ```sh
44
+ machinist init # writes machinist.yaml, .machinist/, and GitHub workflows
45
+ machinist spec 42 # Phase 1 for issue #42 (or let `watch` pick it up)
46
+ machinist watch # daemon: polls for labeled issues and approved PRs
47
+ machinist run 42 # Phase 3 for an approved spec
48
+ ```
49
+
50
+ ## Configuration (`machinist.yaml`)
51
+
52
+ ```yaml
53
+ version: 1
54
+ harness:
55
+ name: claude-code # claude-code | opencode | pi | codex
56
+ command: null # optional executable override
57
+ timeout_minutes: 30 # Phase 3 implementation budget
58
+ spec_timeout_minutes: 10 # Phase 1 spec budget
59
+ github:
60
+ repo: null # "owner/repo"; null = derived from origin
61
+ labels:
62
+ trigger: agent-task
63
+ approved: "machinist:approved"
64
+ poll_interval_seconds: 60
65
+ workspace:
66
+ root: ~/.machinist/workspaces
67
+ strategy: worktree # worktree | clone
68
+ cleanup: on_success # always | on_success | never
69
+ branch_prefix: agent/
70
+ tests:
71
+ command: null # e.g. "pytest -q"; null skips the test gate
72
+ ```
73
+
74
+ Unknown keys are rejected — typos fail loudly instead of being ignored.
75
+
76
+ ## How approval works
77
+
78
+ The single source of truth is the `machinist:approved` label on the draft PR.
79
+ Apply it by hand, or comment `/machinist-execute` on the PR — the bundled
80
+ `machinist-approve.yml` workflow converts that comment into the label (only
81
+ for repo owners, members, and collaborators). Draft → Ready for Review is
82
+ reserved as the *agent's* signal that implementation is complete.
83
+
84
+ ## Spec generation: local or CI
85
+
86
+ Both paths run the same `machinist spec <n>` command:
87
+
88
+ - **Local (default):** `machinist watch` sees the `agent-task` label and
89
+ generates the spec on your machine using your existing harness login.
90
+ - **CI:** the bundled `machinist-spec.yml` workflow runs it in GitHub Actions
91
+ when an issue is labeled — works while your Mac sleeps, but requires an
92
+ `ANTHROPIC_API_KEY` repository secret.
93
+
94
+ ## Status
95
+
96
+ v0.1 (M3): all three phases work end-to-end — `init`, `spec`, `run`,
97
+ `status`, and the `watch` daemon (`--once` for a single cron-friendly pass).
98
+ The pipeline has dogfooded itself: its own getting-started guide was specced,
99
+ approved, implemented, test-gated, and merged by the pipeline (issue #1 →
100
+ PR #3). See `docs/superpowers/specs/` for the design.
101
+
102
+ ## Releasing (maintainer notes)
103
+
104
+ Publishing uses [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/)
105
+ — no tokens. One-time setup: on pypi.org under *Publishing*, add a pending
106
+ publisher for project `agentmachinist` (owner `vscarpenter`, repo
107
+ `AgentMachinist`, workflow `release.yml`, environment `pypi`). After that,
108
+ each release is: bump `version` in `pyproject.toml`, commit, then create a
109
+ GitHub Release for tag `v<version>` — the release workflow builds and
110
+ publishes automatically.
111
+
112
+ ## License
113
+
114
+ MIT — see [LICENSE](LICENSE).