From 66cd7de6e38cefa29f1584c1b96b75d3559c4707 Mon Sep 17 00:00:00 2001 From: Harsha Bharadwaj Date: Fri, 23 Oct 2026 14:40:34 +0530 Subject: [PATCH] feat: add team config and role templates Issue #59. sdd team init writes .sdd/team.yaml and the software, solo, or research roles. sdd role create can copy a shipped role. Host stubs state what they own, never do, check, and when they ask. --- .../brainstorm.md | 67 ++++++ .../clarify-design.md | 30 +++ .../clarify-intent.md | 30 +++ .../clarify-tasks.md | 30 +++ .../design.md | 55 +++++ .../feature.md | 38 +++ .../local-test-plan.md | 12 + .../local-test-results.md | 16 ++ .../meta.yaml | 38 +++ .../metrics.json | 50 ++++ .../tasks.md | 10 + docs/reference/cli.md | 16 +- .../cli/src/__tests__/cli.integration.test.ts | 21 ++ packages/cli/src/commands.ts | 2 + packages/cli/src/role-cmd.ts | 39 +++- packages/cli/src/team-cmd.ts | 43 ++++ .../teams/research/roles/researcher.md | 29 +++ .../core/defaults/teams/research/team.yaml | 7 + .../teams/software/roles/architect.md | 31 +++ .../defaults/teams/software/roles/dev-lead.md | 32 +++ .../teams/software/roles/developer.md | 30 +++ .../teams/software/roles/product-manager.md | 32 +++ .../teams/software/roles/product-owner.md | 30 +++ .../core/defaults/teams/software/team.yaml | 21 ++ .../defaults/teams/solo/roles/developer.md | 28 +++ packages/core/defaults/teams/solo/team.yaml | 7 + packages/core/src/__tests__/agents.test.ts | 2 +- packages/core/src/__tests__/team.test.ts | 102 ++++++++ packages/core/src/agents.ts | 16 ++ packages/core/src/defaults.ts | 4 + packages/core/src/role/index.ts | 13 +- packages/core/src/role/profile.ts | 76 ++++-- packages/core/src/role/schema.ts | 62 +++++ packages/core/src/role/team.ts | 218 ++++++++++++++++++ packages/core/src/role/types.ts | 32 ++- 35 files changed, 1245 insertions(+), 24 deletions(-) create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/brainstorm.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/clarify-design.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/clarify-intent.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/clarify-tasks.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/design.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/feature.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/local-test-plan.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/local-test-results.md create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/meta.yaml create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/metrics.json create mode 100644 changes/2026-10-23-issue-59-role-and-team-config/tasks.md create mode 100644 packages/cli/src/team-cmd.ts create mode 100644 packages/core/defaults/teams/research/roles/researcher.md create mode 100644 packages/core/defaults/teams/research/team.yaml create mode 100644 packages/core/defaults/teams/software/roles/architect.md create mode 100644 packages/core/defaults/teams/software/roles/dev-lead.md create mode 100644 packages/core/defaults/teams/software/roles/developer.md create mode 100644 packages/core/defaults/teams/software/roles/product-manager.md create mode 100644 packages/core/defaults/teams/software/roles/product-owner.md create mode 100644 packages/core/defaults/teams/software/team.yaml create mode 100644 packages/core/defaults/teams/solo/roles/developer.md create mode 100644 packages/core/defaults/teams/solo/team.yaml create mode 100644 packages/core/src/__tests__/team.test.ts create mode 100644 packages/core/src/role/schema.ts create mode 100644 packages/core/src/role/team.ts diff --git a/changes/2026-10-23-issue-59-role-and-team-config/brainstorm.md b/changes/2026-10-23-issue-59-role-and-team-config/brainstorm.md new file mode 100644 index 00000000..6777fe0e --- /dev/null +++ b/changes/2026-10-23-issue-59-role-and-team-config/brainstorm.md @@ -0,0 +1,67 @@ +# Brainstorm + +> **Issue 59 role and team config** · `2026-10-23-issue-59-role-and-team-config` · stage `brainstorm` +> **Optional stage** — skip if one approach is obvious: +> `sdd skip brainstorm -r "single approach is clear"` + +## Goal of exploration + +- + +## Approach A + +### Idea + +- + +### Pros + +- + +### Cons / risks + +- + +## Approach B + +### Idea + +- + +### Pros + +- + +### Cons / risks + +- + +## Approach C (optional) + +### Idea + +- + +### Pros + +- + +### Cons / risks + +- + +## Comparison + +| Criterion | A | B | C | +|-----------|---|---|---| +| Complexity | | | | +| Risk | | | | +| Fit to constraints | | | | + +## Recommendation for design stage + +- + +## Open questions (feed clarify / design) + +- diff --git a/changes/2026-10-23-issue-59-role-and-team-config/clarify-design.md b/changes/2026-10-23-issue-59-role-and-team-config/clarify-design.md new file mode 100644 index 00000000..ee6ff4bc --- /dev/null +++ b/changes/2026-10-23-issue-59-role-and-team-config/clarify-design.md @@ -0,0 +1,30 @@ +# Clarify + +> **Issue 59 role and team config** · `2026-10-23-issue-59-role-and-team-config` · stage `clarify_design` +> **Optional stage** — skip if nothing is ambiguous: +> `sdd skip clarify_design -r "no open questions"` + +## Context + +What just finished? What is about to start? + +- + +## Clarifying questions + +1. **Q:** + **A:** + +2. **Q:** + **A:** + +3. **Q:** + **A:** + +## Decisions / constraints captured + +- + +## Ready for next stage? + +- [ ] No blocking unknowns remain (or explicitly accepted risks) diff --git a/changes/2026-10-23-issue-59-role-and-team-config/clarify-intent.md b/changes/2026-10-23-issue-59-role-and-team-config/clarify-intent.md new file mode 100644 index 00000000..6c1fbf8c --- /dev/null +++ b/changes/2026-10-23-issue-59-role-and-team-config/clarify-intent.md @@ -0,0 +1,30 @@ +# Clarify + +> **Issue 59 role and team config** · `2026-10-23-issue-59-role-and-team-config` · stage `clarify_intent` +> **Optional stage** — skip if nothing is ambiguous: +> `sdd skip clarify_intent -r "no open questions"` + +## Context + +What just finished? What is about to start? + +- + +## Clarifying questions + +1. **Q:** + **A:** + +2. **Q:** + **A:** + +3. **Q:** + **A:** + +## Decisions / constraints captured + +- + +## Ready for next stage? + +- [ ] No blocking unknowns remain (or explicitly accepted risks) diff --git a/changes/2026-10-23-issue-59-role-and-team-config/clarify-tasks.md b/changes/2026-10-23-issue-59-role-and-team-config/clarify-tasks.md new file mode 100644 index 00000000..8ba59679 --- /dev/null +++ b/changes/2026-10-23-issue-59-role-and-team-config/clarify-tasks.md @@ -0,0 +1,30 @@ +# Clarify + +> **Issue 59 role and team config** · `2026-10-23-issue-59-role-and-team-config` · stage `clarify_tasks` +> **Optional stage** — skip if nothing is ambiguous: +> `sdd skip clarify_tasks -r "no open questions"` + +## Context + +What just finished? What is about to start? + +- + +## Clarifying questions + +1. **Q:** + **A:** + +2. **Q:** + **A:** + +3. **Q:** + **A:** + +## Decisions / constraints captured + +- + +## Ready for next stage? + +- [ ] No blocking unknowns remain (or explicitly accepted risks) diff --git a/changes/2026-10-23-issue-59-role-and-team-config/design.md b/changes/2026-10-23-issue-59-role-and-team-config/design.md new file mode 100644 index 00000000..c1423c4a --- /dev/null +++ b/changes/2026-10-23-issue-59-role-and-team-config/design.md @@ -0,0 +1,55 @@ +# Design + +> **Issue 59 role and team config** · `2026-10-23-issue-59-role-and-team-config` + +## Approach + +Extend the role file the current parser already reads. Add the new fields as string lists. Leave them off the file when they are empty, so a role created with only a label and a job stays the same shape. Put the team in `.sdd/team.yaml`, validated by a Zod schema in `packages/core/src/role/schema.ts`. Ship templates as files under `packages/core/defaults/teams//`. + +## Team file + +```yaml +template: software +branch: bot/{bot}/{change} +rooms: + commit: false +bots: + - name: developer + role: developer + wip: 1 +humans: + - name: Ada Lovelace +role_wip: + developer: 2 +``` + +`branch` must include `{bot}`. Bot names are unique. `wip` is a positive integer. `rooms.commit` is the rooms commit switch and is false in every shipped template. `role_wip` is optional. Humans are names compared with `git config user.name` by exact match after trim. Init fills `humans` from that git name only when the template list is empty. + +## Commands + +| Command | Result | +|---|---| +| `sdd team init --template software` | Writes the team file and each role. Refuses when `.sdd/team.yaml` or any of those role files already exists, and writes nothing in that case. | +| `sdd team show` | Prints the template, branch, rooms switch, bots, humans, and role limits. A matching git name is marked `(you)`. | +| `sdd role create --template software/developer` | Copies that role under the new name. `--name` still works. `--label` and `--job` override the template. | +| `sdd role create --name --label