Skip to content

Roles and duties ​

A role is a job that lives in your repo. A duty is the kind of work that job does. Workflow mapping is the list of stages that duty follows on the workflow you name.

You set that up once. Then sdd go asks the role that owns the current stage. When SDD_ROLE_MODEL is set, that role writes the note and the guide hands the next stage to the next role. You still decide.


What they are ​

A role is the file .sdd/roles/<name>.md. The file holds:

FieldWhat it is
JobThe one sentence this role is here to do
OwnsThe thing this role is responsible for
SkillThe line another rule can match, such as plan the change
NeverWork this role leaves alone
AsksThe gap check questions sdd go puts to you, one at a time, each with a default
StagesThe stage ids of a workflow that this role follows

A duty is one of three kinds of work. sdd setup writes one role for each:

RoleDutyWhat that duty is
plannerplanningTurn the request into a plan the person can answer
architectarchitectureName the modules the change touches
builderconstructionBuild the change pack: tasks, the implementation note, and the local check

The mapping is which stage ids of which workflow land on which duty. intent is planning on hotfix, patch, feature, and spike. design is architecture on feature. implement is construction on every workflow that has it. You choose the workflow with sdd setup -w. The default is feature.

A role proposes. The person decides. A role prepares a page and does not sign a gate.


How they help ​

You describe the work once. The guide picks the next stage from the role's list.

With SDD_ROLE_MODEL set:

  • sdd go runs a gap check before each clarify stage (or once at the start on workflows that have no clarify stage). It asks only where the request is missing something the triggers describe, one question at a time, each with a proposed default. Questions from the role file are conditions for that check, not a fixed script sdd go reads aloud.
  • The planner writes the reading. The architect writes the design. The builder writes the tasks and the implementation note.
  • sdd go prints Handoff: planner to architect. when the work moves. The next role sees the request and the answers already given.
  • The planner and the architect have write product code on their never list, so during sdd go their writes stay inside the change pack. The builder does not generate a release. Push, a pull request, and merge stay with you.
  • The same three duties follow a hotfix, a feature, a new product, or team-software. A hotfix has no design stage, so the architect has no stage there and the builder takes implement and the local check.
  • A software team can use named jobs — product manager, QA, product owner — and team-software already names who prepares each stage. Each of those stages waits until you sign that commit.

sdd role route prints who has a stage. Two roles listing the same stage asks you, so the handoff has one owner.


Walk through setup ​

On a terminal, sdd setup asks one piece at a time. Each question starts with why, then a choice. Press Enter through the full walk:

  • The folder is initialized.
  • The workflow stays feature.
  • No host is installed.
  • Planner, architect, and builder are written when .sdd/roles has no markdown files.
  • A line says a draft needs SDD_ROLE_MODEL. Setup leaves that command out of the repo.
  • An empty answer on the first change stops there.

A later visit prints what is already in place. Pick one piece, or walk all of them again. Files that are already there stay.

bash
sdd setup
sdd setup --step model
sdd setup --step roles
sdd setup --step check

The pieces are folder, workflow, host, roles, model, check, and start.

On the roles piece the choices are the three duties, the software team, or keep what is here. Enter on the full walk writes the three duties when the roles folder is empty, and keeps the files when any role markdown is already there. Choose the software team on that piece when you want the named jobs. Both architects are .sdd/roles/architect.md. When team.yaml or routing.yaml is already there, the team writer stops and writes nothing. When a software role file is already there, it prints Role already exists: … Nothing was written.

One missing duty file next to other role files stays missing. Add stages with sdd role edit <name> --stages .... Add context with sdd role context <name> --text "...".

sdd setup --yes, and a run that has no terminal, keep the short path. The workflow is feature unless you pass -w. The three duties are written only when the roles folder is empty. A host is installed when you pass --ai. --no-agent installs no host. The short path leaves the software team unwritten, leaves the model file unwritten, and leaves the first change for sdd go.

--step off a terminal needs --yes. check only prints, so it runs without --yes. sdd setup --yes --step roles means the three duties. sdd setup --yes --step host installs a host when --ai is set and no host is installed yet. Switching a host stays sdd agents install --force. sdd setup --yes --step model exits with No role model is configured. when nothing is configured, and creates no file. sdd setup --yes --step start prints Next: sdd go "what you want to build" and leaves the change unopened.

A host is separate from the role model. --ai leaves SDD_ROLE_MODEL unset.


Set up the three duties ​

Run this in your app folder before any role files exist when you want the short path:

bash
sdd setup --yes --no-agent

Setup initializes the folder and writes planner, architect, and builder for the feature workflow. You should see:

text
Ready.
Workflow: feature.
planner: intent, clarify_intent, brainstorm
architect: design, clarify_design
builder: tasks, clarify_tasks, implement, local_verify
Next: sdd go "what you want to build"

Then run the guide:

bash
sdd go "Fix empty list crash" --no-agent

Without SDD_ROLE_MODEL, the run stops with No role model is configured. after it records that no gap check could run. A later run with the model set can still ask clarifying questions; a failed no-model run does not mark the gap check done.

Set SDD_ROLE_MODEL to a command that reads one JSON object (roleId and prompt) on stdin and writes one JSON object on stdout. The sample file docs/examples/role-model.mjs is an example for sdd role run, not for sdd go. With that set, sdd go may stop on a gap-check question, on a question the role asks while drafting, or continue through intent and the optional clarify_intent and brainstorm stages when the request is clear enough. On a terminal, sdd go asks in place; answer there or with sdd go --answer "...". --no-clarify skips every gap check for that command and is kept for the whole interactive run. Accept a default with Enter or sdd go --accept-default.

When intent is ready, sdd go prints Handoff: planner to architect. Design and tasks are separate files under their own headings. The local test results file says no command was run. Implement has no file, so it is not sent to the model. The architect may ask while drafting design; the builder takes tasks after design is ready.

--no-agent means no AI host is installed. It does not set SDD_ROLE_MODEL. --ai copilot installs the host that sdd new and sdd next open. The guide still writes through SDD_ROLE_MODEL.

Name the workflow while the roles folder is still empty. These are the same command, one workflow each:

bash
sdd setup -w hotfix --no-agent
sdd setup -w greenfield --no-agent
sdd setup -w team-software --no-agent

On hotfix the print is planner: intent, architect: no stage on this workflow, and builder: implement, local_verify.

Add your AI host in the same setup when you want it:

bash
sdd setup --ai copilot
sdd doctor
sdd go "Fix empty list crash"

When role files are already in .sdd/roles, setup prints Roles are already here. and leaves them, including a folder that has only one of the three duty files. Change a list with sdd role edit.

Give a role facts about this repo. The next run includes them:

bash
sdd role context planner --text "This app is an expense tracker. An empty list should show a message."

What each duty does ​

RoleJobOwnsSkillNeverAsks
plannerPlan the changethe request, the planplan the changeaccept a spec, write product codeTriggers for the gap check (who the change is for, how you will know it worked, …)
architectName the modulesthe designname the modulesaccept a spec, write product codeTriggers for the gap check (which module owns the change, …)
builderBuild the changethe change packbuild the changeaccept a spec, generate a release

The builder has an empty ask list. It drafts and hands on.

Which stages each duty follows ​

sdd setup -w <workflow> writes this map onto the three role files. A stage id is shared, so a role that lists intent also matches every workflow that has intent.

WorkflowPlannerArchitectBuilder
hotfixintentno stage on this workflowimplement, local_verify
patchintentno stage on this workflowacceptance, implement, local_verify
featureintent, clarify_intent, brainstormdesign, clarify_designtasks, clarify_tasks, implement, local_verify
greenfieldvision, requirements, featuresarchitectureno stage on this workflow
spikeintent, research, outcomeno stage on this workflowno stage on this workflow
enterprise-featurefeature, hl_arb, storieslld, db_design, code_researchtasks, implement, local_verify
team-softwarerequirements, clarifications, hld, planlld, test_planimplement, pr_review, qa_testing, qa_signoff, po_review, po_signoff

Named stage ids keep their duty on every workflow. Planning ids are intent, vision, requirements, feature, stories, clarify_intent, brainstorm, hl_arb, research, outcome, and plan. Architecture ids are design, architecture, clarify_design, lld, db_design, and code_research. Construction ids are tasks, clarify_tasks, implement, local_verify, acceptance, and pr_review.

Any other stage id takes its duty from where it sits. Before the first architecture id, it is planning. From the first construction id onward, it is construction. Between those two, it is architecture. That is why hld is planning and test_plan is architecture on team-software, and why stories and plan stay planning after the design stages.

To point the three roles at a different workflow after setup, replace each list:

bash
sdd role edit planner --stages intent
sdd role edit architect --stages design,clarify_design
sdd role edit builder --stages implement,local_verify
sdd role route --stage=intent

--stages replaces the whole list. One role per stage id. Two roles listing the same id makes sdd role route ask you.


Set up your own roles ​

Use this when the three duties are the wrong split for your repo. The folder needs .sdd/ first: run sdd init --here --no-agent (or the setup above). Without it, sdd role create stops with SDD is not initialized here. Run sdd init first.

bash
sdd role create analyst --label "Analyst" --job "Write the reading" --stages intent,requirements
sdd role edit analyst --job "Write the reading" --stages intent,clarify_intent,brainstorm
sdd new "Add CSV export" -w feature -y
sdd role route

--stages is a comma-separated list of stage ids from the workflow you pass to sdd new -w. The same role can list ids that appear on more than one workflow.


Set up a software team ​

Use this when you want named jobs and a sign-off on every stage. On a terminal, sdd setup, choose the roles piece, and pick the software team. The same writer needs .sdd/ to exist, so run sdd init --here --no-agent first in a new folder. It is:

bash
sdd team init --template software
sdd team show
sdd new "Ship the export" -w team-software -y

Start from a folder that has no .sdd/roles/architect.md. Setup's architect and this template's architect are that same file, and the template writes nothing if one of its role files is already there. The shipped template still has no stage list. Add those with sdd role edit --stages after init.

The template writes six roles. Each file carries the job, what the role owns, and what it never does. It does not list stage ids. solo writes one developer whose job is "Build the accepted change on your own." research writes one researcher whose job is "Answer one question and leave the notes in the repo."

RoleJobUseful for
product-managerTurn a request into a short reading the person can acceptThe reading and the clarifications
architectName the modules and the seams between themHigh-level design, low-level design, and the pull-request review
product-ownerSay whether the reading matches the requestThe review and the final sign-off
dev-leadName who builds the next piece when more than one role is involvedThe plan, and the skill name the next owner
developerBuild the accepted change for one serviceDevelopment
qaPropose what to try and the evidence the person can recordThe test plan, the testing note, and the QA sign-off

The shipped routing file has one rule. The skill name the next owner goes to dev-lead.

Give each role the stages you want it to follow. This is the mapping that matches the workflow owners:

bash
sdd role edit product-manager --stages requirements,clarifications
sdd role edit architect --stages hld,lld,pr_review
sdd role edit dev-lead --stages plan
sdd role edit developer --stages implement
sdd role edit qa --stages test_plan,qa_testing,qa_signoff
sdd role edit product-owner --stages po_review,po_signoff
sdd role route --stage=requirements

Until you add a list, sdd role route uses the owner on the workflow stage when a role file of that name exists.

StageWho prepares itWorks with
requirementsproduct-managerarchitect, research-assistant
clarificationsproduct-managerresearch-assistant
hldarchitectproduct-manager
lldarchitectdeveloper
plandev-leadarchitect, developer
test_planqadeveloper
implementdeveloperdev-lead
pr_reviewarchitectdev-lead
qa_testingqadeveloper
qa_signoffqaproduct-owner
po_reviewproduct-ownerproduct-manager
po_signoffproduct-ownerqa

research-assistant is named on requirements and clarifications. Create that role when you want it in the repo:

bash
sdd role create research-assistant --label "Research assistant" --job "Gather evidence for the reading" --stages research

Every team-software stage is a hard gate. sdd go and sdd next stop until you sign the current commit. A role prepares the page. You sign. Merge stays a person action after po_signoff.

bash
sdd team signoff --note "I accept this stage"

The sign-off stores your git name and the commit SHA, so the folder must be a git repository with at least one commit. With none, it prints Cannot sign off: Git HEAD is unavailable in this project. A new commit needs a new sign-off. Your git name has to be listed under humans in .sdd/team.yaml.


See who has the stage ​

bash
sdd role route
sdd role route --stage=implement

Route tries these, in order:

  1. A rule in .sdd/routing.yaml.
  2. One role whose owns list names the artifact, or whose skills list names the skill. Two matches print Ask the human. and Two roles own this.
  3. One role whose stages list contains the stage id. Two matches print Ask the human. and Two roles list this stage.
  4. The workflow stage's owner, when a role file has that name.
  5. Ask the human. and No rule matched.

The handoff writes an Owner line from that workflow field. Hotfix, patch, feature, greenfield, spike, and enterprise-feature leave the field unset. team-software sets it to the owner in the table above.

Workflow packs and the gate fields are in Workflows. Commands are in the CLI reference.


Skill pack ​

The role files above stay short. They are the routing contract: the job, the never list, the questions, and the stages. A procedure for a full design, an acceptance gate, a smallest change, UX copy, a UI binding, QA scenarios, or a constitution interview lives in skills/ in this repository. That pack does not rewrite .sdd/roles, and sdd init does not copy it. Product names, extra bans, and commands stay in the product's .sdd/skill-config.yaml.

The map is Skill pack.