Skip to content

Commit 1d7fc09

Browse files
committed
feat: add issue-backed work task flow
1 parent ad427b1 commit 1d7fc09

6 files changed

Lines changed: 799 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4444
- `brigade work bootstrap` to initialize and verify the dogfood-backed daily work loop in one command.
4545
- `brigade work brief` and `brigade work brief --json` as a start-of-day entrypoint with git state, latest sessions, latest dogfood run, resolved next task, and suggested command.
4646
- `brigade work tasks` plus `brigade work task add/show/done` to manage a gitignored local task ledger under `.brigade/work/tasks.json`.
47+
- `brigade work task add --template` for `vertical-slice`, `bugfix`, `red-green-refactor`, `docs`, and `security-follow-up` defaults, with repeatable `--acceptance` criteria preserved.
48+
- `brigade work task plan <task-id>` to show task acceptance criteria and template-specific execution guidance.
49+
- `brigade work task add --from-issue <issue-url-or-number>` to import GitHub issue title and metadata through the existing `gh` CLI when available.
4750
- `brigade work run --queue-next` to queue the successful run's extracted next step, with duplicate pending task protection.
4851
- `brigade work import add/list/show/promote` to manage a gitignored local import inbox for scanner-discovered candidate work.
4952
- `brigade work import validate` and `brigade work import ingest` for scanner-authored JSONL import files.
@@ -82,6 +85,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8285
- `brigade work run` now consumes the oldest pending ledger task before falling back to the latest extracted dogfood next step, and marks consumed tasks done after successful runs.
8386
- `brigade work task add --from-next` now reuses an equivalent pending task instead of adding duplicates.
8487
- `brigade work brief` now includes pending local work imports and import counts in both text and JSON output.
88+
- `brigade work brief` now surfaces issue-backed next-task context.
89+
- `brigade work doctor` now warns on pending tasks without acceptance criteria, unchecked or closed issue-backed tasks, and active work sessions left open too long.
8590
- The managed gitignore block now treats `.brigade/dogfood.toml`, `.brigade/security.toml`, `.brigade/runs/`, and `.brigade/security/` as local state.
8691
- Live smoke docs now keep Codex agent execution in a trusted repo cwd while writing temporary roster, artifacts, and handoff output under `/tmp`.
8792
- Handoff write failures now preserve final run artifacts, print the final answer, return nonzero, and mark `run.json` as `handoff-failed`.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,23 @@ Start-of-day commands:
256256

257257
- `brigade work brief` shows branch state, active sessions, pending tasks, import counts, latest dogfood run, and the command to continue.
258258
- `brigade work status` is the quick dashboard for branch state, dogfood readiness, paths, latest run, and extracted next step.
259-
- `brigade work doctor` checks dogfood config, security config, evidence bundles, Codex CLI, artifact paths, handoff inbox, ignore coverage, and latest run context.
259+
- `brigade work doctor` checks dogfood config, security config, evidence bundles, Codex CLI, artifact paths, handoff inbox, task acceptance, issue-backed tasks, stale active sessions, ignore coverage, and latest run context.
260260
- `brigade work resume` shows the active or latest session, latest dogfood run, extracted next step, and suggested command.
261261
- `brigade work next` prints only the next task. Add `--json` for wrappers.
262262

263263
Task ledger commands:
264264

265265
- `brigade work tasks` lists `.brigade/work/tasks.json`.
266266
- `brigade work task add "..."` queues a task manually.
267+
- `brigade work task add "..." --template bugfix --acceptance "Regression test passes"` adds template acceptance criteria while preserving explicit acceptance criteria.
268+
- `brigade work task add --from-issue 42` imports a GitHub issue with `gh issue view` when `gh` is available.
267269
- `brigade work task add --from-next` promotes the latest extracted dogfood next step.
270+
- `brigade work task plan <task-id>` shows acceptance criteria and template-specific execution guidance.
268271
- `brigade work task done <task-id>` closes queued work.
269272

273+
Available task templates are `vertical-slice`, `bugfix`, `red-green-refactor`, `docs`, and `security-follow-up`.
274+
Issue-backed tasks keep issue URL, number, title, labels, state, and source metadata in the local gitignored ledger.
275+
270276
Import inbox commands:
271277

272278
- `brigade work import add "..."` creates a scanner-ready local import.

ROADMAP.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ Brigade-specific additions:
6969
- Enrich reviewed indicators and suspicious package or domain findings through optional providers such as MISP, then route enriched findings into local evidence bundles and work imports. Status: started with `security-enrichment.json`, `security-enrichment.md`, and review/doctor visibility.
7070
- Track false-positive taxonomy, runtime-confidence rules, suppressions, and regression fixtures as first-class project artifacts. Status: started with `brigade security review`, reasoned suppressions, unsuppress, and stale-suppression doctor warnings.
7171

72-
## Later Phase: Issue And TDD Work Loop
72+
## Current Phase: Issue And TDD Work Loop
7373

7474
Goal: make Brigade support a narrow issue lifecycle for daily work: pick one task, define acceptance, test first when practical, implement, review, refactor, and close.
7575

76-
- Add task templates for vertical-slice work, bugfix work, and RED/GREEN/REFACTOR loops.
77-
- Let `brigade work run` consume structured acceptance criteria from the local task ledger or a GitHub issue mirror.
76+
- Add task templates for vertical-slice work, bugfix work, RED/GREEN/REFACTOR loops, docs work, and security follow-ups. Status: implemented in the local task ledger.
77+
- Import GitHub issues into the local task ledger without building a sync engine. Status: implemented through the existing `gh` CLI.
78+
- Let `brigade work run` consume structured acceptance criteria from the local task ledger or a GitHub issue mirror. Status: started with local ledger acceptance criteria and issue metadata.
7879
- Keep repo-shareable workflow rules separate from gitignored personal/global preferences.
79-
- Add doctor checks for missing acceptance criteria or stale active issue context.
80+
- Add doctor checks for missing acceptance criteria or stale active issue context. Status: started with missing acceptance, closed remote issues, unchecked issue-backed tasks, and stale active sessions.
8081

8182
First build slice:
8283

src/brigade/cli.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ def _build_parser() -> argparse.ArgumentParser:
150150
p_work_task_add.add_argument("text", nargs="*", help="Task text.")
151151
p_work_task_add.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to update.")
152152
p_work_task_add.add_argument("--from-next", action="store_true", help="Add the latest extracted dogfood next step.")
153+
p_work_task_add.add_argument("--from-issue", default=None, help="Import a GitHub issue by URL or number using gh.")
154+
p_work_task_add.add_argument("--type", dest="task_type", default=None, help="Optional task type metadata.")
155+
p_work_task_add.add_argument("--priority", default=None, help="Optional task priority metadata.")
156+
p_work_task_add.add_argument(
157+
"--acceptance",
158+
action="append",
159+
default=[],
160+
help="Acceptance criterion. May be repeated.",
161+
)
162+
p_work_task_add.add_argument(
163+
"--template",
164+
choices=["vertical-slice", "bugfix", "red-green-refactor", "docs", "security-follow-up"],
165+
default=None,
166+
help="Add template acceptance criteria and planning guidance.",
167+
)
168+
p_work_task_plan = task_sub.add_parser("plan", help="Show execution guidance for one work task.")
169+
p_work_task_plan.add_argument("task_id", help="Task id or unique prefix.")
170+
p_work_task_plan.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to inspect.")
153171
p_work_task_show = task_sub.add_parser("show", help="Show one work task.")
154172
p_work_task_show.add_argument("task_id", help="Task id or unique prefix.")
155173
p_work_task_show.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to inspect.")
@@ -645,7 +663,18 @@ def main(argv=None) -> int:
645663
if args.work_command == "task":
646664
if args.task_command == "add":
647665
text = " ".join(args.text) if args.text else None
648-
return work_cmd.task_add(target=args.target, text=text, from_next=args.from_next)
666+
return work_cmd.task_add(
667+
target=args.target,
668+
text=text,
669+
from_next=args.from_next,
670+
from_issue=args.from_issue,
671+
task_type=args.task_type,
672+
priority=args.priority,
673+
acceptance=args.acceptance,
674+
template=args.template,
675+
)
676+
if args.task_command == "plan":
677+
return work_cmd.task_plan(target=args.target, task_id=args.task_id)
649678
if args.task_command == "show":
650679
return work_cmd.task_show(target=args.target, task_id=args.task_id)
651680
if args.task_command == "done":

0 commit comments

Comments
 (0)