Skip to content

Commit ccc7e8d

Browse files
committed
feat: add issue-backed work task flow
1 parent ddc404a commit ccc7e8d

6 files changed

Lines changed: 583 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
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`.
4747
- Typed task metadata and repeatable acceptance criteria for `brigade work task add`, plus `brigade work task plan` for the completion checklist.
48+
- `brigade work task add --template` for `vertical-slice`, `bugfix`, `red-green-refactor`, `docs`, and `security-follow-up` defaults.
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.
4850
- `brigade work run --queue-next` to queue the successful run's extracted next step, with duplicate pending task protection.
4951
- `brigade work import add/list/show/promote` to manage a gitignored local import inbox for scanner-discovered candidate work.
5052
- `brigade work import validate` and `brigade work import ingest` for scanner-authored JSONL import files.
@@ -95,6 +97,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9597
- `brigade work task add --from-next` now reuses an equivalent pending task instead of adding duplicates.
9698
- `brigade work brief` now reports acceptance coverage for the next ledger task, and `brigade work run` passes accepted ledger criteria into the dogfood task prompt.
9799
- `brigade work brief` now includes pending local work imports and import counts in both text and JSON output.
100+
- `brigade work brief` now surfaces issue-backed next-task context.
101+
- `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.
98102
- `brigade work brief` now surfaces pending handoff ingest issue counts when the local handoff source config has an ingestor latest-run log.
99103
- The managed gitignore block now treats `.brigade/dogfood.toml`, `.brigade/security.toml`, `.brigade/runs/`, and `.brigade/security/` as local state.
100104
- The managed gitignore block now treats `.brigade/handoff-sources.json` as host-local state.

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Start-of-day commands:
270270

271271
- `brigade work brief` shows branch state, active sessions, pending tasks, import counts, latest dogfood run, and the command to continue.
272272
- `brigade work status` is the quick dashboard for branch state, dogfood readiness, paths, latest run, and extracted next step.
273-
- `brigade work doctor` checks dogfood config, security config, evidence bundles, Codex CLI, artifact paths, handoff inbox, ignore coverage, and latest run context.
273+
- `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.
274274
- `brigade work resume` shows the active or latest session, latest dogfood run, extracted next step, and suggested command.
275275
- `brigade work next` prints only the next task. Add `--json` for wrappers.
276276

@@ -279,10 +279,15 @@ Task ledger commands:
279279
- `brigade work tasks` lists `.brigade/work/tasks.json`.
280280
- `brigade work task add "..."` queues a task manually.
281281
- `brigade work task add "..." --type feature --priority high --acceptance "..."` queues typed work with repeatable acceptance criteria.
282+
- `brigade work task add "..." --template bugfix --acceptance "Regression test passes"` adds template acceptance criteria while preserving explicit acceptance criteria.
283+
- `brigade work task add --from-issue 42` imports a GitHub issue with `gh issue view` when `gh` is available.
282284
- `brigade work task add --from-next` promotes the latest extracted dogfood next step.
283-
- `brigade work task plan <task-id>` shows the task metadata, acceptance checklist, and suggested run command.
285+
- `brigade work task plan <task-id>` shows the task metadata, acceptance checklist, template guidance, and suggested run command.
284286
- `brigade work task done <task-id>` closes queued work.
285287

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

288293
- `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
@@ -94,14 +94,15 @@ Brigade-specific additions:
9494
- 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.
9595
- 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.
9696

97-
## Later Phase: Issue And TDD Work Loop
97+
## Current Phase: Issue And TDD Work Loop
9898

9999
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.
100100

101-
- Add task templates for vertical-slice work, bugfix work, and RED/GREEN/REFACTOR loops.
102-
- Let `brigade work run` consume structured acceptance criteria from the local task ledger or a GitHub issue mirror. Status: started for local ledger tasks with typed priority, repeatable acceptance criteria, `work task plan`, brief coverage, and criteria injection into ledger-driven runs.
101+
- 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.
102+
- Import GitHub issues into the local task ledger without building a sync engine. Status: implemented through the existing `gh` CLI.
103+
- 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.
103104
- Keep repo-shareable workflow rules separate from gitignored personal/global preferences.
104-
- Add doctor checks for missing acceptance criteria or stale active issue context.
105+
- 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.
105106

106107
First build slice:
107108

src/brigade/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def _build_parser() -> argparse.ArgumentParser:
183183
p_work_task_add.add_argument("text", nargs="*", help="Task text.")
184184
p_work_task_add.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to update.")
185185
p_work_task_add.add_argument("--from-next", action="store_true", help="Add the latest extracted dogfood next step.")
186+
p_work_task_add.add_argument("--from-issue", default=None, help="Import a GitHub issue by URL or number using gh.")
186187
p_work_task_add.add_argument("--type", choices=TASK_TYPES, default="task", help="Task type.")
187188
p_work_task_add.add_argument("--priority", choices=TASK_PRIORITIES, default="normal", help="Task priority.")
188189
p_work_task_add.add_argument(
@@ -191,6 +192,12 @@ def _build_parser() -> argparse.ArgumentParser:
191192
default=[],
192193
help="Acceptance criterion. Repeat for multiple criteria.",
193194
)
195+
p_work_task_add.add_argument(
196+
"--template",
197+
choices=["vertical-slice", "bugfix", "red-green-refactor", "docs", "security-follow-up"],
198+
default=None,
199+
help="Add template acceptance criteria and planning guidance.",
200+
)
194201
p_work_task_show = task_sub.add_parser("show", help="Show one work task.")
195202
p_work_task_show.add_argument("task_id", help="Task id or unique prefix.")
196203
p_work_task_show.add_argument("--target", "-t", type=Path, default=Path("."), help="Repo or workspace to inspect.")
@@ -765,9 +772,11 @@ def main(argv=None) -> int:
765772
target=args.target,
766773
text=text,
767774
from_next=args.from_next,
775+
from_issue=args.from_issue,
768776
task_type=args.type,
769777
priority=args.priority,
770778
acceptance=args.acceptance,
779+
template=args.template,
771780
)
772781
if args.task_command == "show":
773782
return work_cmd.task_show(target=args.target, task_id=args.task_id)

0 commit comments

Comments
 (0)