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:
| Field | What it is |
|---|---|
| Job | The one sentence this role is here to do |
| Owns | The thing this role is responsible for |
| Skill | The line another rule can match, such as plan the change |
| Never | Work this role leaves alone |
| Asks | The gap check questions sdd go puts to you, one at a time, each with a default |
| Stages | The 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:
| Role | Duty | What that duty is |
|---|---|---|
| planner | planning | Turn the request into a plan the person can answer |
| architect | architecture | Name the modules the change touches |
| builder | construction | Build 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 goruns 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 scriptsdd goreads aloud.- The planner writes the reading. The architect writes the design. The builder writes the tasks and the implementation note.
sdd goprintsHandoff: 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 codeon their never list, so duringsdd gotheir 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-softwarealready 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/roleshas 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.
sdd setup
sdd setup --step model
sdd setup --step roles
sdd setup --step checkThe 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:
sdd setup --yes --no-agentSetup initializes the folder and writes planner, architect, and builder for the feature workflow. You should see:
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:
sdd go "Fix empty list crash" --no-agentWithout 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:
sdd setup -w hotfix --no-agent
sdd setup -w greenfield --no-agent
sdd setup -w team-software --no-agentOn 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:
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:
sdd role context planner --text "This app is an expense tracker. An empty list should show a message."What each duty does
| Role | Job | Owns | Skill | Never | Asks |
|---|---|---|---|---|---|
| planner | Plan the change | the request, the plan | plan the change | accept a spec, write product code | Triggers for the gap check (who the change is for, how you will know it worked, …) |
| architect | Name the modules | the design | name the modules | accept a spec, write product code | Triggers for the gap check (which module owns the change, …) |
| builder | Build the change | the change pack | build the change | accept 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.
| Workflow | Planner | Architect | Builder |
|---|---|---|---|
| hotfix | intent | no stage on this workflow | implement, local_verify |
| patch | intent | no stage on this workflow | acceptance, implement, local_verify |
| feature | intent, clarify_intent, brainstorm | design, clarify_design | tasks, clarify_tasks, implement, local_verify |
| greenfield | vision, requirements, features | architecture | no stage on this workflow |
| spike | intent, research, outcome | no stage on this workflow | no stage on this workflow |
| enterprise-feature | feature, hl_arb, stories | lld, db_design, code_research | tasks, implement, local_verify |
| team-software | requirements, clarifications, hld, plan | lld, test_plan | implement, 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:
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.
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:
sdd team init --template software
sdd team show
sdd new "Ship the export" -w team-software -yStart 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."
| Role | Job | Useful for |
|---|---|---|
| product-manager | Turn a request into a short reading the person can accept | The reading and the clarifications |
| architect | Name the modules and the seams between them | High-level design, low-level design, and the pull-request review |
| product-owner | Say whether the reading matches the request | The review and the final sign-off |
| dev-lead | Name who builds the next piece when more than one role is involved | The plan, and the skill name the next owner |
| developer | Build the accepted change for one service | Development |
| qa | Propose what to try and the evidence the person can record | The 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:
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=requirementsUntil you add a list, sdd role route uses the owner on the workflow stage when a role file of that name exists.
| Stage | Who prepares it | Works with |
|---|---|---|
| requirements | product-manager | architect, research-assistant |
| clarifications | product-manager | research-assistant |
| hld | architect | product-manager |
| lld | architect | developer |
| plan | dev-lead | architect, developer |
| test_plan | qa | developer |
| implement | developer | dev-lead |
| pr_review | architect | dev-lead |
| qa_testing | qa | developer |
| qa_signoff | qa | product-owner |
| po_review | product-owner | product-manager |
| po_signoff | product-owner | qa |
research-assistant is named on requirements and clarifications. Create that role when you want it in the repo:
sdd role create research-assistant --label "Research assistant" --job "Gather evidence for the reading" --stages researchEvery 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.
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
sdd role route
sdd role route --stage=implementRoute tries these, in order:
- A rule in
.sdd/routing.yaml. - One role whose
ownslist names the artifact, or whoseskillslist names the skill. Two matches printAsk the human.andTwo roles own this. - One role whose
stageslist contains the stage id. Two matches printAsk the human.andTwo roles list this stage. - The workflow stage's
owner, when a role file has that name. Ask the human.andNo 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.