diff --git a/README.md b/README.md index c4b647f..88e2d95 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,67 @@ Fordjent watches for new issues and automatically creates branches, writes code, | `[tester]` | **Tester** | Writes tests for existing code, reports bugs. | | `[devops]` | **DevOps** | Sets up CI/CD, Docker, infrastructure. Does not write application code. | +## Repository Policy (`fordjent-*` Topics) + +You control how much automation Fordjent applies via **repo topics** (Forgejo repo settings → Topics). By default, repos use the safer `plan-first + no-auto-merge` policy. Add an opt-in topic to change behavior. + +| Topic | Policy | Effect | +|-------|--------|--------| +| (none — default) | `plan-first + no-auto-merge` | Sub-issues cannot be implemented until human adds `plan-approved`. Reviewer cannot auto-merge. | +| `fordjent-yolo` | full automation | PM sub-issues fire immediately. Reviewer can auto-merge. Nothing blocks. | +| `fordjent-plan-first` | `plan-first` | Sub-issues are created in `planning` state. Human must add `plan-approved` to unblock. | +| `fordjent-no-auto-merge` | `no-auto-merge` | Reviewer cannot call `forgejo_merge_pr`. Posts review and waits for human. | +| `fordjent-require-review` | `require-review` | PRs must have `approved` label before anyone can merge. | + +Topics can be combined: `fordjent-plan-first` + `fordjent-require-review` = plan approval + PR approval required. + +### The Plan-First Flow (Default) + +With the default policy (plan-first + no-auto-merge): + +1. You create a `[pm]` issue to decompose a feature +2. PM analyzes the code and creates `[implementer]` sub-issues in `planning` state +3. Sub-issues are blocked — implementation tools cannot write code +4. You (human) review the plan and add `plan-approved` label to the parent issue +5. Fordjent unblocks all sub-issues (adds `ready`, removes `planning`) +6. Implementers pick up the issues, write code, create PRs +7. Reviewer posts its review as a comment (cannot auto-merge) +8. You (human) add `approved` label to the PR +9. Reviewer or you merges + +### The Yolo Flow + +With `fordjent-yolo` topic: + +1. You create a `[pm]` issue +2. PM analyzes and creates `[implementer]` sub-issues (automatically unblocked) +3. Implementers pick up immediately, write code, create PRs +4. Reviewer auto-merges PRs (spot-check code only) + +### Overriding Policy per Repo + +To add a topic to a Forgejo repo: + +1. Go to the repo's **Settings → Topics** tab +2. Add a topic like `fordjent-yolo` or `fordjent-plan-first` +3. Save + +Topics can be combined: `fordjent-plan-first` + `fordjent-require-review` = both plan approval and PR approval required. + ### Examples +#### Minimal (yolo) ``` [implementer] Add a SortDesc function to the utils package -[implementer] Fix the off-by-one error in processQueue -[pm] Decompose the authentication module into sub-issues -[reviewer] Review PR #5 for correctness and style -[tester] Write integration tests for the API handlers -[devops] Add Docker Compose for local development ``` +#### Plan-first (default) +``` +[pm] Decompose the authentication module into sub-issues +``` + +Then wait for sub-issues to be created in `planning` state, review the plan, and add `plan-approved` to the parent. + ### Issue Writing Tips - **Be specific**: "Add a function `SortDesc(items []string) []string` that sorts in descending order" works much better than "make sorting work". @@ -34,17 +84,20 @@ Fordjent watches for new issues and automatically creates branches, writes code, - **One task per issue**: The agent works best with focused, single-purpose issues. - **Mention relevant files**: "Look at `cmd/gogit/main.go` for where to wire this command." -### FSM Labels +## FSM Labels Fordjent manages these labels automatically. You generally don't need to set them manually: | Label | Meaning | |-------|---------| | `planning` | Issue is being analyzed by the PM | +| `plan-approved` | Human has approved the plan — unblocks sub-issues | | `implementing` | Agent is actively writing code | | `blocked` | Issue is waiting on a dependency | | `ready` | Issue is unblocked and ready to work on | | `review` | PR is ready for human review | +| `approved` | PR has been approved by a human | +| `automerge` | Reviewer should merge this PR automatically | | `done` | PR merged, issue closed | ### Dependency Tracking @@ -63,4 +116,6 @@ Example: ## Repository Setup -This repo is pre-seeded with `go.mod` and `.gitignore` so that Fordjent's scaffold detection doesn't block the first issue. \ No newline at end of file +This repo is pre-seeded with `go.mod` and `.gitignore` so that Fordjent's scaffold detection doesn't block the first issue. + +This repo also has the `fordjent-yolo` topic, so all issues get full automation. Remove the topic to use the safer default policy (plan-first + no-auto-merge).