@eskoubar95/spec 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/lib/copy-template.js +6 -6
  2. package/dist/lib/copy-template.js.map +1 -1
  3. package/package.json +2 -2
  4. package/template/.cursor/MCP-SETUP.md +16 -0
  5. package/template/.cursor/agents/batch-runner.md +52 -0
  6. package/template/.cursor/agents/verifier.md +40 -0
  7. package/template/.cursor/commands/_shared/branch-detection.md +78 -0
  8. package/template/.cursor/commands/_shared/git-workflow.md +3 -1
  9. package/template/.cursor/commands/_shared/github-workflows.md +7 -5
  10. package/template/.cursor/commands/_shared/helper-metadata.md +20 -0
  11. package/template/.cursor/commands/_shared/linear-automation.md +14 -6
  12. package/template/.cursor/commands/_shared/linear-helpers.md +26 -14
  13. package/template/.cursor/commands/_shared/pr-description.md +11 -2
  14. package/template/.cursor/commands/spec/init.md +33 -0
  15. package/template/.cursor/commands/spec/plan.md +43 -9
  16. package/template/.cursor/commands/spec/refine.md +7 -0
  17. package/template/.cursor/commands/task/batch.md +112 -0
  18. package/template/.cursor/commands/task/start.md +28 -6
  19. package/template/.cursor/commands/task/validate.md +19 -15
  20. package/template/.cursor/scripts/{validate-helpers.js → validate-helpers.cjs} +30 -32
  21. package/template/.cursor/skills/sdd-commit-unit/SKILL.md +42 -0
  22. package/template/.cursor/skills/sdd-design-system-bootstrap/SKILL.md +35 -0
  23. package/template/.cursor/skills/sdd-git-default-branch/SKILL.md +49 -0
  24. package/template/.cursor/skills/sdd-pr-create-or-update/SKILL.md +41 -0
  25. package/template/.cursor/skills/sdd-task-preflight/SKILL.md +47 -0
  26. package/template/.cursor/skills/sdd-validation-suite/SKILL.md +47 -0
  27. package/template/spec/00-root-spec.md +9 -0
  28. package/template/spec/templates/02-architecture.md +64 -0
  29. package/template/spec/templates/06-acceptance.md +59 -0
  30. package/template/spec/templates/07-design-system.md +145 -0
  31. package/template/spec/templates/08-infrastructure.md +76 -0
  32. package/template/spec/templates/09-sitemap.md +50 -0
  33. package/template/work/backlog/tasks.local.md +6 -0
  34. package/template/work/linear/FALLBACK-STRATEGY.md +84 -0
  35. package/template/work/linear/LABEL-MAPPING-GUIDE.md +72 -0
  36. package/template/work/linear/SETUP.md +75 -0
  37. package/template/work/linear/sync-config.md +86 -0
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: sdd-validation-suite
3
+ description: Run a lightweight, project-agnostic validation suite (lint, typecheck, build, tests when present) and summarize pass/fail with actionable error highlights.
4
+ metadata:
5
+ sdd_category: validation
6
+ ---
7
+
8
+ # SDD: Validation Suite
9
+
10
+ ## When to use
11
+
12
+ - During `/task/validate` before opening/updating a PR.
13
+ - During `/task/batch` after each task (and optionally after each logical unit).
14
+
15
+ ## Inputs
16
+
17
+ - Project type + tooling (from detection or repo files)
18
+ - Available scripts (package.json, makefile, etc.)
19
+ - Optional: workspace scope (monorepo), e.g. `apps/storefront`
20
+
21
+ ## Output contract
22
+
23
+ Return a compact report:
24
+ - `lint`: pass/fail/skipped
25
+ - `typecheck`: pass/fail/skipped
26
+ - `tests`: pass/fail/skipped
27
+ - `build`: pass/fail/skipped
28
+ - `highlights`: top 3 actionable errors (if any)
29
+
30
+ ## Execution strategy (project-agnostic)
31
+
32
+ - If JS/TS: prefer `npm run lint`, `npm run typecheck`, `npm test`, `npm run build` when scripts exist.
33
+ - If Python: prefer `ruff`, `mypy`, `pytest` when configured.
34
+ - If unknown: run the minimum safe checks available, and clearly mark skipped items.
35
+
36
+ **Monorepo rule (if applicable):**
37
+ - If the repo is a monorepo, run commands **scoped to the task workspace** (do not run repo-wide by default).
38
+ - Examples:
39
+ - `pnpm -C <workspace> run lint`
40
+ - `npm --prefix <workspace> run test`
41
+ - `yarn --cwd <workspace> test`
42
+ - If no workspace scope is provided for a monorepo task, treat validation as **blocked** until scope is clarified.
43
+
44
+ ## Rules
45
+
46
+ - Do not invent commands that don’t exist.
47
+ - If a step fails, stop and report errors before continuing.
@@ -19,6 +19,14 @@ What is the main value delivered to users?
19
19
  What feels in-scope right now?
20
20
  What explicitly feels out-of-scope?
21
21
 
22
+ ## 5.1 MVP vs Future (scope locking)
23
+
24
+ ### MVP (ship target)
25
+ - [List the minimum set of capabilities required to ship an MVP.]
26
+
27
+ ### Future ideas / Roadmap (park here)
28
+ - [If your initial prompt includes visionary “later” ideas, list them here so they don’t accidentally become MVP scope.]
29
+
22
30
  ## 6. Open Questions
23
31
  List uncertainties, assumptions, or things that need clarification.
24
32
 
@@ -32,5 +40,6 @@ Anything else discovered during discussion or research.
32
40
  If applicable, reference:
33
41
  - `spec/01-prd.md` (if PRD was created)
34
42
  - `spec/02-architecture.md` (if architecture is documented)
43
+ - `spec/06-acceptance.md` (MVP ship checklist / definition of done)
35
44
  - `spec/07-design-system.md` (if design is critical)
36
45
  - `spec/08-infrastructure.md` (if infrastructure is critical)
@@ -0,0 +1,64 @@
1
+ # Architecture
2
+
3
+ ## System Overview
4
+ High-level description of system architecture and how components interact.
5
+
6
+ ## Component Architecture
7
+ - Frontend: [Description]
8
+ - Backend/API: [Description]
9
+ - Database: [Description]
10
+ - External Services: [Description]
11
+
12
+ ## Data Flow
13
+ How data moves through the system:
14
+ - User actions → [flow description]
15
+ - Data fetching → [flow description]
16
+ - Mutations → [flow description]
17
+
18
+ ## Design Patterns
19
+ Architecture patterns used:
20
+ - [Pattern name]: [Description and rationale]
21
+
22
+ ## Technology Stack
23
+
24
+ Document the technologies, frameworks, and tools used in this project. This is the source of truth for framework/tool detection and rule activation.
25
+
26
+ **Format:**
27
+ - Frontend Framework: [Framework name, e.g., Next.js, Vite, React]
28
+ - Backend Framework: [Framework name, e.g., Express, FastAPI, Flask]
29
+ - CMS: [CMS name, e.g., Payload CMS, Strapi]
30
+ - Database: [Database name, e.g., PostgreSQL, MongoDB]
31
+ - Build Tool: [Build tool name, e.g., Vite, Webpack]
32
+ - Language: [Language name, e.g., TypeScript, Python]
33
+ - Other: [List other tools/libraries]
34
+
35
+ **Example:**
36
+ - Frontend Framework: Next.js
37
+ - CMS: Payload CMS
38
+ - Database: PostgreSQL
39
+ - Build Tool: Vite (for admin)
40
+ - Language: TypeScript
41
+
42
+ **Note:** If tech stack is documented here, it should also be referenced in `spec/08-infrastructure.md` for consistency.
43
+
44
+ ## API Design (if applicable)
45
+ - API structure: [Description]
46
+ - Authentication: [Description]
47
+ - Error handling: [Description]
48
+
49
+ ## Security Architecture (if critical)
50
+ - Authentication flow: [Description]
51
+ - Authorization: [Description]
52
+ - Data protection: [Description]
53
+
54
+ ## Scalability Considerations
55
+ - Current scale: [Description]
56
+ - Future scale: [Description]
57
+ - Scaling strategy: [Description]
58
+
59
+ ## CI/CD Architecture (if applicable)
60
+ - CI pipeline: [Description of CI workflow]
61
+ - CD pipeline: [Description of CD workflow]
62
+ - Testing strategy: [Unit tests, integration tests, E2E tests]
63
+ - Quality gates: [Required checks before merge/deploy]
64
+
@@ -0,0 +1,59 @@
1
+ # Acceptance Criteria / Ship Checklist
2
+
3
+ This document defines what “done” means for the **MVP** (and optionally later phases).
4
+ Use it as the project’s **ship gate** during planning and validation.
5
+
6
+ ## MVP definition (1–5 bullets)
7
+
8
+ - [What must be true to call the MVP shipped?]
9
+
10
+ ## Success criteria (measurable if possible)
11
+
12
+ - [Metric / outcome]
13
+
14
+ ## Scope boundaries
15
+
16
+ ### In scope (MVP)
17
+ - [Feature / capability]
18
+
19
+ ### Out of scope (MVP)
20
+ - [Feature / capability]
21
+
22
+ ### Future ideas / Roadmap (park here)
23
+ - [Item]
24
+
25
+ ## Non-functional requirements (MVP)
26
+
27
+ - **Performance**: [e.g., pages load < 2s on mid-tier device]
28
+ - **Reliability**: [e.g., error budget / retries]
29
+ - **Security**: [e.g., auth, roles, audit trail]
30
+ - **Accessibility**: [e.g., WCAG AA]
31
+ - **Privacy/Compliance**: [if applicable]
32
+
33
+ ## Quality gates (must pass to ship MVP)
34
+
35
+ - [ ] Key user journeys verified end-to-end
36
+ - [ ] Error/empty/loading states implemented for primary flows
37
+ - [ ] Logging/monitoring in place (minimum viable observability)
38
+ - [ ] Data migrations/backups strategy (if DB)
39
+ - [ ] Security basics covered (auth, access control, secrets handling)
40
+ - [ ] CI checks passing (lint/typecheck/tests/build as applicable)
41
+ - [ ] Deployment pipeline ready (preview + production)
42
+
43
+ ## Test plan (MVP)
44
+
45
+ - **Manual smoke tests**:
46
+ - [Flow 1]
47
+ - [Flow 2]
48
+ - **Automated tests**:
49
+ - Unit: [yes/no]
50
+ - Integration: [yes/no]
51
+ - E2E: [yes/no]
52
+
53
+ ## Release plan (MVP)
54
+
55
+ - **Rollout**: [gradual/full]
56
+ - **Rollback**: [plan]
57
+ - **Monitoring**: [what to watch]
58
+ - **Support**: [who responds to incidents]
59
+
@@ -0,0 +1,145 @@
1
+ # Design System (Tailwind + shadcn/ui default)
2
+
3
+ This document defines the **visual direction, tokens, component conventions, and UI quality gates** for this project.
4
+ It is intended to reduce “design babysitting” by making decisions explicit early.
5
+
6
+ ## Design goals (1–3 bullets)
7
+
8
+ - [e.g., “Calm, professional dashboard UI with strong information hierarchy.”]
9
+ - [e.g., “Fast to build with shadcn/ui primitives, customized via tokens.”]
10
+
11
+ ## References (2–3 links)
12
+
13
+ - [Link 1]
14
+ - [Link 2]
15
+ - [Link 3] (optional)
16
+
17
+ ## Style direction
18
+
19
+ - **Adjectives**: [e.g., minimal, calm, premium, technical, playful]
20
+ - **Do**: [e.g., subtle borders, low saturation, consistent spacing]
21
+ - **Don’t**: [e.g., heavy shadows everywhere, inconsistent radii, random colors]
22
+
23
+ ## Target surfaces
24
+
25
+ - **Primary**: [e.g., dashboard, editor, settings]
26
+ - **Secondary**: [e.g., marketing pages, onboarding]
27
+ - **Dense data UI?**: [yes/no] (tables, filters, bulk actions)
28
+
29
+ ## UI stack assumptions (edit if different)
30
+
31
+ - **Styling**: Tailwind CSS
32
+ - **Component library**: shadcn/ui
33
+ - **Icons**: [lucide-react / other]
34
+ - **Typography**: [Inter / other]
35
+
36
+ ## Tokens
37
+
38
+ ### Color tokens (semantic-first)
39
+
40
+ Define tokens by meaning, not by raw hex usage.
41
+
42
+ #### Neutral scale
43
+
44
+ - `background`: [hex]
45
+ - `surface`: [hex]
46
+ - `surfaceMuted`: [hex]
47
+ - `border`: [hex]
48
+ - `textPrimary`: [hex]
49
+ - `textSecondary`: [hex]
50
+ - `textMuted`: [hex]
51
+
52
+ #### Brand / accent
53
+
54
+ - `primary`: [hex]
55
+ - `primaryForeground`: [hex]
56
+ - `secondary`: [hex] (optional)
57
+ - `secondaryForeground`: [hex] (optional)
58
+
59
+ #### Semantic colors
60
+
61
+ - `success`: [hex]
62
+ - `successForeground`: [hex]
63
+ - `warning`: [hex]
64
+ - `warningForeground`: [hex]
65
+ - `error`: [hex]
66
+ - `errorForeground`: [hex]
67
+ - `info`: [hex]
68
+ - `infoForeground`: [hex]
69
+
70
+ #### States
71
+
72
+ - **Focus ring**: [color + thickness]
73
+ - **Disabled**: [opacity + cursor rules]
74
+ - **Hover/active**: [rule of thumb]
75
+
76
+ ### Typography tokens
77
+
78
+ - **Font family**: [e.g., Inter]
79
+ - **Scale**:
80
+ - `xs`: [size/line-height]
81
+ - `sm`: [size/line-height]
82
+ - `base`: [size/line-height]
83
+ - `lg`: [size/line-height]
84
+ - `xl`: [size/line-height]
85
+ - **Weights**: [regular/medium/semibold/bold]
86
+
87
+ ### Spacing tokens
88
+
89
+ - **Base unit**: 4px (default)
90
+ - **Scale**: 4, 8, 12, 16, 24, 32, 48, 64 (edit as needed)
91
+
92
+ ### Radius + shadow tokens
93
+
94
+ - **Radius**: `sm`, `md`, `lg` with definitions (or “use shadcn defaults”)
95
+ - **Shadow**: [subtle / medium / none] (define when to use which)
96
+
97
+ ### Motion (optional)
98
+
99
+ - **Animation duration**: [e.g., 150–250ms]
100
+ - **Easing**: [e.g., ease-out]
101
+
102
+ ## Component conventions (shadcn/ui)
103
+
104
+ ### Phase 1 “must-have” components
105
+
106
+ - Button, Input, Textarea, Select, Checkbox, RadioGroup, Switch
107
+ - Dialog, Sheet/Drawer, DropdownMenu, Tooltip
108
+ - Tabs, Table, Badge, Card, Skeleton
109
+ - Toast/Sonner, Separator
110
+
111
+ ### Component rules
112
+
113
+ - Variants must be token-driven (no ad-hoc colors).
114
+ - Every interactive component must have:
115
+ - hover/active/disabled
116
+ - focus-visible state
117
+ - loading state (if async)
118
+ - error state (if form-related)
119
+
120
+ ## UI patterns
121
+
122
+ - **Navigation**: [sidebar/topbar/breadcrumb rules]
123
+ - **Forms**: validation rules, error copy tone, required vs optional
124
+ - **Tables**: empty state, loading skeleton, pagination, bulk actions
125
+ - **Empty/error/loading states**: required for primary flows
126
+
127
+ ## Accessibility (minimum)
128
+
129
+ - **Target**: WCAG AA
130
+ - **Contrast**: document minimum ratios for text and UI elements
131
+ - **Keyboard**: all interactive UI must be reachable and operable
132
+ - **Focus**: visible focus ring everywhere, no focus traps
133
+ - **Screen readers**: labels/roles for inputs, dialogs, menus
134
+
135
+ ## UI Definition of Done (copy into tasks)
136
+
137
+ - [ ] Matches tokens and component conventions
138
+ - [ ] Responsive: mobile (320px), tablet (768px), desktop (1024px+)
139
+ - [ ] No horizontal scrolling in primary flows
140
+ - [ ] Keyboard navigation works end-to-end
141
+ - [ ] Focus states are visible and consistent
142
+ - [ ] Contrast meets WCAG AA
143
+ - [ ] Empty/loading/error states implemented for the flow
144
+ - [ ] No UI regressions in common paths (verify key screens)
145
+
@@ -0,0 +1,76 @@
1
+ # Infrastructure
2
+
3
+ ## Technology Stack
4
+
5
+ Document the technologies, frameworks, and tools used in this project. This is the source of truth for framework/tool detection and rule activation.
6
+
7
+ **Format:**
8
+ - Frontend Framework: [Framework name, e.g., Next.js, Vite, React]
9
+ - Backend Framework: [Framework name, e.g., Express, FastAPI, Flask]
10
+ - CMS: [CMS name, e.g., Payload CMS, Strapi]
11
+ - Database: [Database name, e.g., PostgreSQL, MongoDB]
12
+ - Build Tool: [Build tool name, e.g., Vite, Webpack]
13
+ - Language: [Language name, e.g., TypeScript, Python]
14
+ - Other: [List other tools/libraries]
15
+
16
+ **Example:**
17
+ - Frontend Framework: Next.js
18
+ - CMS: Payload CMS
19
+ - Database: PostgreSQL
20
+ - Build Tool: Vite (for admin)
21
+ - Language: TypeScript
22
+
23
+ ## Monorepo / Workspaces (if applicable)
24
+
25
+ If this repository is a **monorepo**, document the workspace boundaries explicitly so tasks, validation, and rules can be scoped correctly.
26
+
27
+ **Workspace map (recommended):**
28
+
29
+ - Workspace: [path, e.g., `apps/storefront`]
30
+ - Frontend Framework: [e.g., Next.js]
31
+ - Language: [e.g., TypeScript]
32
+ - Build Tool: [e.g., pnpm / npm / yarn]
33
+ - Notes: [scripts, deployment target, env vars]
34
+
35
+ - Workspace: [path, e.g., `apps/backend`]
36
+ - Backend Framework: [e.g., Medusa / FastAPI]
37
+ - Language: [e.g., TypeScript / Python]
38
+ - Notes: [DB, services, migrations]
39
+
40
+ ## Hosting
41
+ - Provider: [Provider name]
42
+ - Region: [Region]
43
+ - Pricing: [Free tier/Paid/etc.]
44
+ - URL: [production URL]
45
+
46
+ ## Database
47
+ - Provider: [Provider name]
48
+ - Type: [PostgreSQL/MySQL/MongoDB/etc.]
49
+ - Connection: [Managed/Self-hosted/etc.]
50
+ - Pricing: [Free tier/Paid/etc.]
51
+
52
+ ## External Services
53
+ - Newsletter: [Platform name, API quality, pricing, webhook support]
54
+ - Analytics: [Platform name]
55
+ - Payment: [Platform name]
56
+ - Other: [list]
57
+
58
+ ## CI/CD
59
+ - Provider: [Provider name, e.g., GitHub Actions, CircleCI, GitLab CI]
60
+ - Deployment strategy: [Automatic/Manual/etc.]
61
+ - Branch strategy: [main only/main + staging/etc.]
62
+
63
+ ## GitHub Actions (if using GitHub)
64
+ - Workflows: [List workflow files, e.g., ci.yml, deploy.yml, pr-checks.yml]
65
+ - CI checks: [List checks, e.g., tests, linting, type checking, build]
66
+ - Deployment: [Describe deployment workflow if applicable]
67
+ - PR requirements: [List required PR checks, e.g., tests passing, code review]
68
+
69
+ ## Environment Variables
70
+ - Required: [list of required env vars]
71
+ - Secrets: [list of secret env vars]
72
+ - Optional: [list of optional env vars]
73
+
74
+ ## Known Issues
75
+ - [List any known infrastructure issues or limitations]
76
+
@@ -0,0 +1,50 @@
1
+ # Sitemap / Information Architecture
2
+
3
+ This document prevents “missing pages” by making the UI surface area explicit **before implementation**.
4
+
5
+ ## MVP sitemap (required)
6
+
7
+ Write the MVP navigation as a tree. Keep it user-facing (not technical routes).
8
+
9
+ Example:
10
+
11
+ ```text
12
+ /
13
+ - Landing
14
+ - Pricing
15
+ - Sign in
16
+ - Sign up
17
+
18
+ /app
19
+ - Dashboard
20
+ - Projects
21
+ - Project details
22
+ - Settings
23
+ ```
24
+
25
+ ## Route notes (optional)
26
+
27
+ - **Auth-gated areas**: [list pages]
28
+ - **Roles**: [who can see what]
29
+ - **SEO pages**: [list]
30
+ - **Deep links**: [list]
31
+
32
+ ## Page inventory (MVP)
33
+
34
+ For each page, define the minimum:
35
+
36
+ - **Page**: [name]
37
+ - **Goal**: [what user achieves]
38
+ - **Primary actions**: [1–3]
39
+ - **Data**: [entities needed]
40
+ - **States required**: loading / empty / error
41
+
42
+ ## Future pages / Roadmap (park here)
43
+
44
+ - [Page]
45
+
46
+ ## Planning rule
47
+
48
+ - Every MVP feature must map to **at least one page** (or an explicit API-only surface).
49
+ - Every page must be represented in tasks (at least: scaffold + basic states).
50
+
@@ -17,6 +17,8 @@ Each task follows this structure:
17
17
 
18
18
  **Tags:** [comma-separated tags, e.g., design, frontend, infrastructure]
19
19
 
20
+ **Workspace:** [path within repo, e.g., apps/storefront] (optional; REQUIRED for monorepos)
21
+
20
22
  **Milestone:** [Milestone ID, e.g., M1]
21
23
 
22
24
  **Sprint:** [Sprint ID, e.g., Sprint 1] (optional)
@@ -51,6 +53,8 @@ Each task follows this structure:
51
53
 
52
54
  **Tags:** infrastructure, setup
53
55
 
56
+ **Workspace:** (optional; for monorepos)
57
+
54
58
  **Milestone:** M1
55
59
 
56
60
  **Acceptance:**
@@ -75,6 +79,8 @@ Each task follows this structure:
75
79
 
76
80
  **Tags:** engineering, backend, security
77
81
 
82
+ **Workspace:** (optional; for monorepos)
83
+
78
84
  **Milestone:** M1
79
85
 
80
86
  **Acceptance:**
@@ -0,0 +1,84 @@
1
+ # Linear MCP Fallback Strategy
2
+
3
+ This document defines how the SDD workflow should behave when Linear integration is unavailable or a Linear operation fails.
4
+
5
+ ## Goals
6
+
7
+ - **Never block the SDD workflow** if Linear is unavailable.
8
+ - **Log clearly** what failed (operation + error), and what fallback is used.
9
+ - **Keep local artifacts authoritative** (`work/backlog/*`) even when Linear sync is enabled.
10
+
11
+ ## Detecting Linear mode
12
+
13
+ Linear mode is enabled when:
14
+ - `work/linear/sync-config.md` exists, and
15
+ - it contains `MODE=linear`
16
+
17
+ If Linear mode is not enabled, operate in local mode only.
18
+
19
+ ## Connectivity verification
20
+
21
+ Before critical Linear operations:
22
+ - Read `MCP_CONNECTION_NAME` from `work/linear/sync-config.md` (optional).
23
+ - Run a simple “health” call (e.g. `list_teams`).
24
+
25
+ If the call fails or times out → treat Linear MCP as unavailable for this run.
26
+
27
+ ## Fallback cases
28
+
29
+ ### 1) MCP connection unavailable
30
+
31
+ **Behavior:**
32
+ - Continue with **local mode only**.
33
+ - Report: “Linear MCP is unavailable. Continuing in local mode.”
34
+ - Skip all Linear operations (projects/issues/documents/comments/status updates).
35
+
36
+ ### 2) A specific Linear operation fails
37
+
38
+ **Behavior:**
39
+ - Log the failure clearly:
40
+ - operation name (e.g. `create_issue`, `update_issue`, `create_project`)
41
+ - the error message
42
+ - Continue the workflow in **local mode** for the rest of the run (do not retry endlessly).
43
+ - Allow a user-initiated retry later (next command run).
44
+
45
+ ### 3) Resource not found (status/label/project/issue)
46
+
47
+ **Behavior:**
48
+ - **Status not found**: guide user to create the status in Linear (or update `sync-config.md` to use a status ID).
49
+ - **Label not found**: try to create the label automatically; if that fails, guide user to create it manually in Linear.
50
+ - **Project not found**: create it only if `AUTO_CREATE_PROJECTS=true` and user confirmed creation.
51
+ - **Issue not found**: guide user to verify the issue exists or re-run `/spec/plan` to re-sync tasks.
52
+
53
+ ### 4) Partial failure (some operations succeed)
54
+
55
+ **Behavior:**
56
+ - Keep the successful operations.
57
+ - Log what failed.
58
+ - Do not rollback.
59
+
60
+ ## Recovery strategy
61
+
62
+ When Linear becomes available again:
63
+ - Re-run `/spec/plan` to ensure milestones/projects and tasks/issues are in sync.
64
+ - Re-run `/task/start` or `/task/validate` to re-apply status/comments for the active task.
65
+
66
+ ## Where to log
67
+
68
+ When in Linear mode:
69
+ - Add a brief **Linear comment** on the issue for:
70
+ - task start
71
+ - task validation result
72
+ - errors (if any)
73
+
74
+ Always keep local artifacts updated:
75
+ - `work/backlog/tasks.local.md` remains the primary source of truth for tasks and status in local mode.
76
+
77
+ ## Related docs
78
+
79
+ - `work/linear/SETUP.md`
80
+ - `work/linear/sync-config.md`
81
+ - `work/linear/LABEL-MAPPING-GUIDE.md`
82
+ - `.cursor/commands/_shared/linear-automation.md`
83
+ - `.cursor/commands/_shared/linear-helpers.md`
84
+
@@ -0,0 +1,72 @@
1
+ # Linear Label + Status Mapping Guide
2
+
3
+ This guide defines how SDD task metadata maps to Linear statuses, labels, and projects.
4
+
5
+ ## Status mapping
6
+
7
+ SDD status values (from `work/backlog/tasks.local.md`) map to Linear issue statuses via `work/linear/sync-config.md`:
8
+
9
+ - `backlog` → `STATUS_BACKLOG`
10
+ - `in-progress` → `STATUS_IN_PROGRESS`
11
+ - `done` → `STATUS_DONE`
12
+ - `blocked` → `STATUS_BLOCKED`
13
+
14
+ Use **status names** (recommended) unless you need fixed status IDs.
15
+
16
+ ## Label strategy (project-agnostic)
17
+
18
+ ### 1) Source of truth: task tags
19
+
20
+ Prefer using `**Tags:**` in `work/backlog/tasks.local.md`.
21
+
22
+ Example:
23
+
24
+ ```markdown
25
+ **Tags:** backend, security, documentation
26
+ ```
27
+
28
+ **Rule:** Each tag can be used as a Linear label name.
29
+
30
+ - If `LABEL_PREFIX` is set in `sync-config.md`, prepend it to every auto-assigned label.
31
+ - If a label does not exist, the system may try to create it. If creation fails, guide the user to create it manually.
32
+
33
+ ### 2) Recommended label groups (optional)
34
+
35
+ These are suggestions, not requirements. Your team can rename them freely.
36
+
37
+ - **Core / domain labels**: `backend`, `frontend`, `infrastructure`, `security`, `design`, `documentation`, `performance`, `observability`, `integration`
38
+ - **Type labels (only when true)**: `feature`, `bug`, `improvement`
39
+ - **Decision label**: `decision` (for explicit choices / comparisons)
40
+ - **Release label**: `release`
41
+
42
+ ### 3) Avoid default “Feature everywhere”
43
+
44
+ Do **not** auto-add a “feature” label to all issues by default.
45
+ Only add `feature` if the task is actually a new feature (best: include `feature` explicitly in `**Tags:**`).
46
+
47
+ ## Projects / milestones
48
+
49
+ If `AUTO_CREATE_PROJECTS=true` in `sync-config.md`:
50
+ - Each milestone in `work/backlog/milestones.md` can be represented as a Linear project.
51
+ - Tasks link to projects via `**Milestone:** Mx` in `tasks.local.md`.
52
+
53
+ ## Comment templates (recommended)
54
+
55
+ ### Task started
56
+
57
+ - “Started `<task-id>` via SDD. Branch: `<branch>`. Plan: `<1–3 bullets>`.”
58
+
59
+ ### Task validated
60
+
61
+ - “Validated `<task-id>` via SDD: `<pass/fail>`. Evidence: `<lint/tests/build>`. PR: `<url>` (if any).”
62
+
63
+ ### Error / fallback
64
+
65
+ - “Linear operation `<op>` failed: `<error>`. Continuing in local mode.”
66
+
67
+ ## Related docs
68
+
69
+ - `work/linear/SETUP.md`
70
+ - `work/linear/sync-config.md`
71
+ - `work/linear/FALLBACK-STRATEGY.md`
72
+