Skip to content

feat(skills): standardize campaign worktrees, roles, parameters, and a scripted PEW - #1138

Open
sbalabanov wants to merge 1 commit into
mainfrom
skill/orchestrate-sdlc-update
Open

sbalabanov wants to merge 1 commit into
mainfrom
skill/orchestrate-sdlc-update

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

TLDR: all orchestration state moves under .sdlc/ in the main checkout. Each agent gets one worktree at .sdlc/worktree/<agent-name>, managed by a small helper; the ledger is .sdlc/campaign.json and reports and specs go in .sdlc/artifact/. The skill defines investigator, implementer and reviewer roles and takes tz= and per-role model parameters. PEW is now rendered by a script from the campaign ledger and GitHub, and the orchestrator prints the output unchanged.

Summary

  • Scripted PEW. scripts/pew.py (Bazel pew / pew-test) reads the ledger, by default <main checkout>/.sdlc/campaign.json (resolved with the worktree helper's resolver), and reads each listed PR's state, review decision and checks through gh. It prints a header line (PEW · <date time zone> · watch <off|on until …|stopping>), a Markdown table with one row per non-archived agent, and footnotes.
    • Every row has all four cells. Missing values render as unknown, and a missing model renders as model?.
    • PRs link inline to GitHub. Artifacts link inline as [kind](file:///abs/path).
    • CI is 🟢 pass only when every required check on the current head passed. A mix of skipped and passed shows as ⚪ skipped.
    • Footnotes carry only what has no column: what each 🙋 refers to, the review decision of open PRs, failing or pending non-required checks such as license/cla, GitHub fetch failures, and the archived-agent count.
    • A merged row is marked only by 🟣 Merged, with no strikethrough, because Claude Code shows ~~ as literal tildes.
    • gh is injected, so the tests need no network. A non-zero exit from gh pr checks is tolerated when it still printed JSON.
  • SKILL.md PEW section. PEW means running the script and printing its output unchanged. If the script fails, the orchestrator reports the error and does not improvise a table. Fields are never dropped for width; only the next-step and last-action phrases are kept short, and a stacked rendering of a wide table is accepted. The section keeps the semantic rules (🙋, the two worker states, Ready is not approval, archival) and states the orchestrator's duty to keep the ledger fields current. Formatting detail now lives in the script.
  • Ledger schema (watch.md). agents is keyed by agent name. The renderer reads role, model, issue, prs, artifacts (kind to {path, at}), state (working/idle), archived, next_step, last_action, last_update and author_action, plus parameters.display_timezone and watch. Legacy field names are not supported.
  • Worktree helper. scripts/worktree_control.py (Bazel worktree-control / worktree-control-test) has two commands.
    • CREATE <agent> [--base REF] [--branch NAME] fetches a remote base and adds a worktree at <main checkout>/.sdlc/worktree/<agent>, detached at origin/main by default. It refuses a path or branch that already exists.
    • REMOVE <agent> refuses when the caller is inside the worktree, or when the worktree has uncommitted, untracked or ignored files (Bazel's bazel-* symlinks and MODULE.bazel.lock are exempt). After git fetch --prune origin it also requires HEAD to be on an origin ref or its patches to have landed (git cherry). It then runs tool/bazel clean --expunge in the worktree, removes the worktree, and deletes the local branch with git branch -d. There is no force flag.
  • .sdlc is ignored as a whole by Git, Bazel (.bazelignore), make fmt (the goimports file list and .yamlfmt), and the message-ID linter walker. workflow.md defines the layout and warns that git clean -x in the main checkout deletes the ledger and artifacts.
  • Roles and worktrees (workflow.md). Adds the role definitions and a Worktrees section. Each reviewer is bound to one implementer's work item (reviews in the ledger). The same reviewer is resumed for every later round and rebinds to a successor implementer. It stays dormant between rounds and is archived together with its implementer, not after each report. The section also bans harness-managed worktree features for campaign work. Reports and specs are saved in .sdlc/artifact/ so they outlive worktree removal.
  • Skill parameters (SKILL.md).
    • tz=<IANA name or unambiguous abbreviation> sets display_timezone. The default is the machine's zone, with UTC as a disclosed fallback. Durable state stays in UTC.
    • investigator=, implementer= and reviewer= pass a model to the harness's spawn-time model selection. Each agent's concrete model is resolved at spawn and replaced by the agent's self-report.
  • The filegroup watch-control-source is renamed control-source because it packages all three scripts.

Open for the owner

  • A repro test that an investigator writes only to demonstrate a finding stays unpublished in its own worktree. workflow.md states this boundary; confirm or strike it.
  • An investigator with no PR has no archival trigger, so the lifecycle rule never removes its worktree.
  • If GitHub is unreachable for a PR, its number renders unlinked with ⚪ Unknown · ⚪ unknown, and the error appears in a footnote.

Test Plan

  • ./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes pew-test, watch-control-test and worktree-control-test. The pew tests cover sort order, Draft with skipped checks, a merged row with no ~, an artifact-only agent, multiple PRs, the archived count, missing values, the header time zone (PST, PDT, UTC, JST) and watch states, row times, footnotes, invalid ledgers, and four non-empty cells in every row.
  • make lint, make check-gazelle and make check-tidy pass on a staged tree.
  • To run PEW locally from a checkout with an active campaign ledger: ./tool/bazel run //.agents/skills/orchestrate-sdlc/scripts:pew (add -- --state /abs/path/campaign.json to pick another ledger). I ran it read-only against a live ledger, and checked that the default resolves to the main checkout's .sdlc/campaign.json from a linked worktree. It needs gh authenticated.
  • To run the worktree helper locally: ./tool/bazel run //.agents/skills/orchestrate-sdlc/scripts:worktree-control -- CREATE my-agent --branch my/topic, then ... -- REMOVE my-agent after pushing the branch.

🤖 Generated with Claude Code

@cla-assistant

cla-assistant Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sbalabanov
sbalabanov force-pushed the skill/orchestrate-sdlc-update branch 3 times, most recently from 3d48570 to b9e382f Compare November 25, 2026 18:18
@sbalabanov sbalabanov changed the title feat(skills): standardize campaign worktrees and agent roles feat(skills): standardize campaign worktrees, agent roles, and display timezone Nov 25, 2026
@sbalabanov
sbalabanov force-pushed the skill/orchestrate-sdlc-update branch from b9e382f to cc4a0ba Compare November 25, 2026 18:26
@sbalabanov sbalabanov changed the title feat(skills): standardize campaign worktrees, agent roles, and display timezone feat(skills): standardize campaign worktrees, roles, display timezone, and role models Nov 25, 2026
@sbalabanov
sbalabanov force-pushed the skill/orchestrate-sdlc-update branch 4 times, most recently from 20991c3 to 340b22a Compare November 25, 2026 22:50
@sbalabanov sbalabanov changed the title feat(skills): standardize campaign worktrees, roles, display timezone, and role models feat(skills): standardize campaign worktrees, roles, parameters, and a scripted PEW Nov 25, 2026
@sbalabanov
sbalabanov force-pushed the skill/orchestrate-sdlc-update branch 4 times, most recently from 5ecb07a to 9707541 Compare November 25, 2026 23:11
…ripted PEW

All orchestration state lives under .sdlc in the main checkout: per-agent worktrees at .sdlc/worktree/<agent-name>, created and removed through a stateless helper, the campaign ledger at .sdlc/campaign.json, and reports and specs in .sdlc/artifact. The skill defines investigator, implementer, and reviewer roles shown by icon in PEW, binds each reviewer to one implementer for its lifetime, takes tz and per-role model parameters, and defaults the display timezone to the machine's zone. PEW is rendered by a script from the campaign ledger and GitHub as a Markdown table that the orchestrator prints unchanged, so no field is dropped or hand-formatted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sbalabanov
sbalabanov force-pushed the skill/orchestrate-sdlc-update branch from 9707541 to 74203b8 Compare November 25, 2026 23:17
@sbalabanov
sbalabanov marked this pull request as ready for review November 25, 2026 23:17
@sbalabanov
sbalabanov requested review from a team as code owners November 25, 2026 23:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant