|
| 1 | +--- |
| 2 | +name: design-author |
| 3 | +description: Create detailed design specs for features. Use when asked to design a feature, create a design spec, write a design doc, or create an implementation plan. Triggers include "design this feature", "create a design spec", "write a design doc". |
| 4 | +--- |
| 5 | + |
| 6 | +# Design Author |
| 7 | + |
| 8 | +Create detailed design specs for features, save them locally, and optionally open PRs for review. |
| 9 | + |
| 10 | +## Configuration |
| 11 | + |
| 12 | +Read `.github/orchestrator-config.json` for: |
| 13 | +- `design.docsPath` — where to save design docs (e.g., `design-docs/` or `docs/designs/`) |
| 14 | +- `design.templatePath` — path to design spec template (optional) |
| 15 | +- `design.folderPattern` — folder naming pattern (e.g., `[{platform}] {featureName}`) |
| 16 | +- `design.reviewRepo` — repo for design review PRs (optional) |
| 17 | + |
| 18 | +If no config, save to `docs/designs/` and use the built-in template below. |
| 19 | + |
| 20 | +## Design Spec Template |
| 21 | + |
| 22 | +Key sections every design spec should include: |
| 23 | + |
| 24 | +1. **Title** — Feature name |
| 25 | +2. **Components** — Which modules/repos affected |
| 26 | +3. **Problem description** — User problem, business context, examples |
| 27 | +4. **Requirements** — Functional requirements (must-have) |
| 28 | +5. **System Qualities** — Performance, telemetry, security, supportability |
| 29 | +6. **Solution options** — At least 2 options with pseudo code, pros/cons |
| 30 | +7. **Solution Decision** — Recommended option with reasoning |
| 31 | +8. **API surface** — Public/internal classes, methods (if applicable) |
| 32 | +9. **Data flow** — Request/response flow across components |
| 33 | +10. **Feature flag** — Flag name and gating strategy (if applicable) |
| 34 | +11. **Telemetry** — Key metrics, span names, success/failure signals |
| 35 | +12. **Testing strategy** — Unit tests, integration tests, E2E coverage |
| 36 | +13. **Rollout plan** — Staged rollout, feature flag configuration |
| 37 | +14. **Cross-repo impact** — Which repos need changes and in what order |
| 38 | + |
| 39 | +If a template file exists at the configured `design.templatePath`, follow that instead. |
| 40 | + |
| 41 | +## Workflow |
| 42 | + |
| 43 | +### Step 1: Understand the Feature |
| 44 | + |
| 45 | +Gather from the developer: |
| 46 | +1. What the feature does and why it's needed |
| 47 | +2. Which components/flows it affects |
| 48 | +3. Scope boundaries (in/out) |
| 49 | +4. Any existing designs to reference |
| 50 | + |
| 51 | +### Step 2: Research the Codebase |
| 52 | + |
| 53 | +Use the `codebase-researcher` skill to: |
| 54 | +- Understand how related functionality currently works |
| 55 | +- Identify which repos/files would be affected |
| 56 | +- Find existing patterns to follow (feature flags, error handling, telemetry) |
| 57 | +- Check for existing design docs on the same topic |
| 58 | + |
| 59 | +### Step 3: Research Existing Designs |
| 60 | + |
| 61 | +If `design.docsPath` is configured, search for related designs: |
| 62 | +```bash |
| 63 | +ls <docsPath>/ | grep -i "<keyword>" |
| 64 | +``` |
| 65 | +Use existing designs as **style reference and historical context**, not ground truth for behavior. |
| 66 | + |
| 67 | +### Step 4: Write the Design Spec |
| 68 | + |
| 69 | +Create the spec at: |
| 70 | +``` |
| 71 | +<docsPath>/<folderPattern>/<spec-name>.md |
| 72 | +``` |
| 73 | + |
| 74 | +For the **Solution options** section: |
| 75 | +- Always provide at least 2 options |
| 76 | +- Include pseudo code / API signatures for each |
| 77 | +- List concrete pros/cons |
| 78 | +- Clear recommendation in Solution Decision |
| 79 | + |
| 80 | +### Agent Implementation Notes |
| 81 | + |
| 82 | +Write the design knowing a coding agent will implement it. Be explicit about: |
| 83 | +- Class boundaries and responsibilities |
| 84 | +- Threading model |
| 85 | +- Error contracts |
| 86 | +- Integration points with other modules |
| 87 | + |
| 88 | +### Step 5: Present Design for Review |
| 89 | + |
| 90 | +After writing, **STOP and present choices** using `askQuestion`: |
| 91 | + |
| 92 | +``` |
| 93 | +askQuestion({ |
| 94 | + question: "Design spec written. What would you like to do?", |
| 95 | + options: [ |
| 96 | + { label: "📖 Review locally", description: "Open in editor for inline review" }, |
| 97 | + { label: "✅ Approve & plan PBIs", description: "Skip PR, move to work item planning" }, |
| 98 | + { label: "📋 Open draft PR", description: "Push to review repo as draft PR" }, |
| 99 | + { label: "🚀 Open published PR", description: "Push and publish PR for team review" }, |
| 100 | + { label: "✏️ Request changes", description: "Tell me what to revise" } |
| 101 | + ] |
| 102 | +}) |
| 103 | +``` |
| 104 | + |
| 105 | +**MANDATORY**: Wait for the developer's explicit choice. Do NOT auto-select. |
| 106 | + |
| 107 | +### Step 5a: Local Review (option 1) |
| 108 | + |
| 109 | +Open the file: `code "<spec path>"` |
| 110 | + |
| 111 | +Tell the developer: |
| 112 | +> "The spec is open. Here's how to review: |
| 113 | +> 1. Click the **+ icon** in the gutter to add inline comments |
| 114 | +> 2. When done, click the status bar button to submit comments |
| 115 | +> 3. I'll address each comment and present choices again" |
| 116 | +
|
| 117 | +### Step 5b: Push and Create PR (options 3 or 4) |
| 118 | + |
| 119 | +**Branch naming**: Discover alias from `git config user.email` (strip @domain): |
| 120 | +```powershell |
| 121 | +$alias = (git config user.email) -replace '@.*', '' |
| 122 | +git checkout -b "$alias/design-<feature-name-kebab-case>" |
| 123 | +``` |
| 124 | + |
| 125 | +**Git workflow** (from design docs directory): |
| 126 | +```powershell |
| 127 | +cd <docsPath>/ |
| 128 | +git add "<folder name>" |
| 129 | +git commit -m "Add design spec: <Feature Name>" |
| 130 | +git push origin $BRANCH_NAME |
| 131 | +``` |
| 132 | + |
| 133 | +**Create PR**: Use `gh pr create` or ADO MCP tools if available. |
| 134 | +- Set `--draft` for option 3, omit for option 4 |
| 135 | +- **PR description**: Use actual line breaks or HTML formatting, NOT literal `\n` escape sequences |
| 136 | +- Target branch: `main` (or the repo's default branch) |
| 137 | + |
| 138 | +Present the PR link: |
| 139 | +```markdown |
| 140 | +### PR Created |
| 141 | +**PR**: [link to PR] |
| 142 | +**Status**: Draft / Published |
| 143 | + |
| 144 | +### How to Review |
| 145 | +1. Open the PR link above |
| 146 | +2. Use inline commenting to leave feedback |
| 147 | +3. When done, say: **"address my design review comments"** |
| 148 | +4. I'll read the comments and update the spec |
| 149 | + |
| 150 | +When the team approves, say: **"design approved, plan the PBIs"** |
| 151 | +``` |
| 152 | + |
| 153 | +### Step 6: Address Review Comments |
| 154 | + |
| 155 | +When asked to address comments (from PR or local review): |
| 156 | +1. Read the feedback (from PR comments or `reviews.json`) |
| 157 | +2. For each comment: |
| 158 | + - Understand the feedback |
| 159 | + - Edit the local design spec to address it |
| 160 | + - If on a PR branch, reply to the thread confirming the resolution |
| 161 | +3. Commit and push the updates to the same branch |
| 162 | +4. Report a summary of changes made |
| 163 | +5. Return to Step 5 (present choices again) |
| 164 | + |
| 165 | +### Step 7: Proceed to Implementation |
| 166 | + |
| 167 | +When the developer confirms the design is approved: |
| 168 | +1. The PR can be completed/merged |
| 169 | +2. Hand off to the `feature-planner` skill for PBI decomposition |
| 170 | + |
| 171 | +## Important Caveats |
| 172 | + |
| 173 | +- **Existing designs may be outdated** — last-minute PR discussions often cause code to deviate. |
| 174 | + Always verify proposed patterns against the **current codebase**, not just existing designs. |
| 175 | +- **Use existing designs as style reference**, not as ground truth for current behavior. |
| 176 | +- For paths with brackets `[]` or spaces, use PowerShell with `-LiteralPath` |
| 177 | + |
| 178 | +### Open Questions |
| 179 | + |
| 180 | +If there are genuine unknowns during design, use `askQuestion` to resolve them interactively, |
| 181 | +or list them in the spec for the team to discuss during review. |
0 commit comments