sdd-layer 0.25.3

Spec-Driven Development CLI and agent harness
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# SDD project configuration template.
# Copy to sdd.config.yaml in each target project and adjust before running /sdd orchestration.

project:
  name: example-project
  type: fullstack # frontend | backend | fullstack | library | mobile | infra | data
  lifecycle: brownfield # greenfield | brownfield
  primary_language: typescript
  stack:
    - react
    - node
    - postgres

systems:
  work_tracker: jira # jira | linear | github-issues | none
  docs: confluence # confluence | notion | markdown | none
  repo: bitbucket # bitbucket | github | gitlab
  ci: bitbucket-pipelines # bitbucket-pipelines | github-actions | gitlab-ci | other | none
  chat: slack # slack | teams | none

paths:
  source:
    - src
    - app
    - packages
  tests:
    - test
    - tests
    - __tests__
  docs:
    - docs
    - adr
  migrations:
    - migrations
    - db/migrations

commands:
  install: npm install
  lint: npm run lint
  typecheck: npm run typecheck
  test: npm test
  build: npm run build

quality:
  # Piloto seguro: observa e registra decisões sem interromper o fluxo atual.
  profile: auto # auto | fast | standard | critical
  mode: shadow # shadow | enforce
  attempts:
    standard: 2
    critical: 3
  thresholds:
    requirement_coverage: 1.0
    evidence_coverage: 1.0
    semantic_standard: 0.90
    semantic_critical: 0.97
  judge:
    enabled: true
    critical_runs: 2
    require_independence_for_critical: true
  # Campos legados permanecem aceitos como metadados de projeto.
  require_tests: true
  require_ci: true
  require_review_evidence: true
  require_memory: true
  min_acceptance_criteria: 1

risk_policy:
  require_refinement_for:
    - migration
    - feature_flag
    - remote_config
    - external_dependency
    - data_sensitive
    - auth
    - payment
  require_agent_team_for:
    - cross_layer
    - security_sensitive
    - performance_sensitive
    - data_contract
    - brownfield_unknowns
  require_deploy_checkpoint_for:
    - production
    - migration
    - feature_flag
    - infra

approvers:
  # IDs/autores autorizados para gates por canal. Allowlist vazia nega.
  cli: []
  slack: []

adapters:
  github:
    owner: ""
    repo: ""
    base_branch: main
    auth:
      # GitHub App Ă© o caminho recomendado; token_env Ă© fallback para dev/CI.
      app_id: ""
      installation_id: ""
      private_key_env: GITHUB_APP_PRIVATE_KEY
      token_env: GITHUB_TOKEN
    project:
      owner_type: organization # organization | user
      owner: ""
      number: 1
      # id: "PVT_kw..."
      field_mapping:
        status_field_id: ""
        todo_option_id: ""
        in_progress_option_id: ""
        done_option_id: ""
    webhook_secret_env: GITHUB_WEBHOOK_SECRET
    webhook:
      enabled: false
      port: 8787
      path: /github/webhook
  canonical_artifacts:
    idea: work_tracker
    prd: docs
    techspec: docs
    tasks: work_tracker
    refinement: docs
    execution: repo
    review: repo
    qa: docs
    memory: docs
  traceability_field: Rastreabilidade

artifact_store:
  enabled: true
  mode: fallback # always | fallback
  base_path: docs
  directory_pattern: "{orchestration_slug}"
  save_when: approved # approved | generated
  index_file: traceability-map.yaml
  files:
    project-discovery: "00-project-discovery.md"
    risk: "00-risk-classification.md"
    idea: "01-idea.md"
    prd: "02-prd.md"
    techspec: "03-techspec.md"
    tasks: "04-tasks.md"
    refinement: "05-refinement.md"
    execution: "06-execution.md"
    review: "07-review.md"
    qa: "08-qa.md"
    memory: "09-memory.md"

orchestration:
  # Isolamento da execução — sem pergunta obrigatória a cada orquestração:
  #   local    → (default) trabalha direto no branch da orquestração (checkout normal)
  #   worktree → cópias isoladas em .worktree/<key>/, criadas a partir do branch <key>
  #   cloud    → reservado; ainda sem integração (o `next` falha orientando o ajuste)
  # Override pontual por orquestração: `sdd orchestration next ... --worktree yes|no`.
  isolation: local
  # Destino canĂ´nico dos artefatos:
  #   local → (default) Markdown em docs/<slug>/
  #   cloud → providers integrados (Jira/Confluence/GitHub..., conforme systems: e
  #           adapters.canonical_artifacts); exige ao menos um provider configurado em
  #           systems.work_tracker/docs/repo e mantém o Markdown local como espelho/fallback.
  artifacts: local

diagrams:
  auto_markdown: true
  visual: explicit # explicit | always | never
  visual_stage_allowlist:
    - idea
    - prd
    - techspec

providers:
  default: codex
  model: gpt-5.5
  effort: xhigh
  offline: true
  registry:
    codex:
      kind: openai-compatible
      auth_env: OPENAI_API_KEY
      auth_methods:
        - id: codex-cli
          label: Codex CLI
          kind: cli
          command: codex
          check_command: codex login status
          check_success_text: Logged in
          login_command: codex login
        - id: openai-api
          label: OpenAI API
          kind: env
          env: OPENAI_API_KEY
      model: gpt-5.5
      models:
        - id: gpt-5.4
          label: Codex / GPT-5.4
          context_window_tokens:
          pricing:
            currency: USD
            input_per_million:
            cached_input_per_million:
            output_per_million:
        - id: gpt-5.5
          label: Codex / GPT-5.5
          context_window_tokens:
          pricing:
            currency: USD
            input_per_million:
            cached_input_per_million:
            output_per_million:
      effort: xhigh
      efforts: [medium, high, xhigh]
      stage_models:
        idea: gpt-5.4
        prd: gpt-5.4
        techspec: gpt-5.5
        tasks: gpt-5.4
        refinement: gpt-5.4
        execution: gpt-5.5
        review: gpt-5.5
        memory: gpt-5.4
      stage_efforts:
        idea: medium
        prd: high
        techspec: xhigh
        tasks: high
        refinement: high
        execution: high
        review: xhigh
        memory: medium
      capabilities: [chat, tools, code]
      timeouts:
        request_ms: 30000
      retries:
        max_attempts: 1
      token_budget: 12000
      usage_limits:
        # Limites declarativos aparecem no TUI; saldo real depende do provider/adapter expor essa API.
        - window: weekly
          limit: 40
          remaining:
          unit: hours
          resets_at:
          source: manual
      enabled: true
    claude:
      kind: anthropic
      auth_env: ANTHROPIC_API_KEY
      auth_methods:
        - id: claude-code
          label: Claude Code
          kind: cli
          command: claude
          check_command: claude auth status
          check_success_text: "\"loggedIn\": true"
          login_command: claude auth login
        - id: anthropic-api
          label: Anthropic API
          kind: env
          env: ANTHROPIC_API_KEY
      model: claude-sonnet-4-6
      models:
        - id: claude-haiku-4-5
          label: Claude Haiku 4.5
        - id: claude-sonnet-4-6
          label: Claude Sonnet 4.6
        - id: claude-opus-4-8
          label: Claude Opus 4.8
      effort: xhigh
      efforts: [medium, high, xhigh]
      stage_models:
        idea: claude-sonnet-4-6
        prd: claude-sonnet-4-6
        techspec: claude-opus-4-8
        tasks: claude-sonnet-4-6
        refinement: claude-sonnet-4-6
        execution: claude-sonnet-4-6
        review: claude-opus-4-8
        memory: claude-sonnet-4-6
      stage_efforts:
        idea: medium
        prd: high
        techspec: xhigh
        tasks: high
        refinement: high
        execution: high
        review: xhigh
        memory: medium
      capabilities: [chat, tools]
      enabled: true
    antigravity:
      kind: local-cli
      auth_env: GEMINI_API_KEY
      auth_methods:
        - id: antigravity-cli
          label: Antigravity CLI
          kind: cli
          command: agy
          check_command: agy models
          login_command: agy
        - id: google-ai-api
          label: Google AI API
          kind: env
          env: GEMINI_API_KEY
      model: gemini-3.1-pro
      models:
        - id: gemini-3.5-flash
          label: Gemini 3.5 Flash
        - id: gemini-3.1-pro
          label: Gemini 3.1 Pro
        - id: claude-opus-4.6
          label: Claude Opus 4.6 via Antigravity
      effort: high
      efforts: [medium, high, xhigh]
      stage_models:
        idea: gemini-3.5-flash
        prd: gemini-3.1-pro
        techspec: gemini-3.1-pro
        tasks: gemini-3.1-pro
        refinement: gemini-3.1-pro
        execution: gemini-3.1-pro
        review: gemini-3.1-pro
        memory: gemini-3.5-flash
      stage_efforts:
        idea: medium
        prd: high
        techspec: xhigh
        tasks: high
        refinement: high
        execution: high
        review: xhigh
        memory: medium
      capabilities: [chat]
      enabled: true
    opencode:
      kind: local-cli
      auth_env:
      auth_methods:
        - id: opencode-cli
          label: opencode CLI
          kind: cli
          command: opencode
          check_command: opencode providers list
          check_success_regex: '\b[1-9][0-9]* credentials?\b'
          login_command: opencode providers login
        - id: opencode-provider
          label: opencode Go/Zen credential
          kind: cli
          command: opencode
          check_command: opencode providers list
          check_success_regex: '\b[1-9][0-9]* credentials?\b'
          login_command: opencode providers login
      model: opencode-go/deepseek-v4-pro
      models:
        - id: opencode/deepseek-v4-flash
          label: Zen / DeepSeek v4 Flash
        - id: opencode/kimi-k2.7
          label: Zen / Kimi K2.7
        - id: opencode/minimax-m3-free
          label: Zen / MiniMax M3
        - id: opencode/mimo-v2.5-free
          label: Zen / MiMo v2.5
        - id: opencode/glm-5.1
          label: Zen / GLM 5.1
        - id: opencode-go/deepseek-v4-flash
          label: Go / DeepSeek v4 Flash
        - id: opencode-go/deepseek-v4-pro
          label: Go / DeepSeek v4 Pro
        - id: opencode-go/kimi-k2.7
          label: Go / Kimi K2.7
        - id: opencode-go/minimax-m3
          label: Go / MiniMax M3
        - id: opencode-go/mimo-v2.5
          label: Go / MiMo v2.5
        - id: opencode-go/glm-5.1
          label: Go / GLM 5.1
        - id: opencode-go/qwen3.7-plus
          label: Go / Qwen 3.7 Plus
        - id: opencode-go/qwen3.7-max
          label: Go / Qwen 3.7 Max
      effort: xhigh
      efforts: [medium, high, xhigh]
      stage_models:
        idea: opencode-go/deepseek-v4-flash
        prd: opencode-go/deepseek-v4-pro
        techspec: opencode-go/kimi-k2.7
        tasks: opencode-go/qwen3.7-plus
        refinement: opencode-go/qwen3.7-plus
        execution: opencode-go/kimi-k2.7
        review: opencode-go/glm-5.1
        memory: opencode-go/minimax-m3
      stage_efforts:
        idea: medium
        prd: high
        techspec: xhigh
        tasks: high
        refinement: high
        execution: high
        review: xhigh
        memory: medium
      capabilities: [chat, code]
      enabled: true
    cursor:
      kind: local-cli
      auth_env:
      auth_methods:
        - id: cursor-cli
          label: Cursor CLI
          kind: cli
          command: cursor
          check_command: cursor agent status
          check_success_text: Logged in
          login_command: cursor agent login
      model: composer-2.5
      models:
        - id: composer-2.5-fast
          label: Composer 2.5 Fast
        - id: composer-2.5
          label: Composer 2.5
        - id: sonnet-4.6
          label: Sonnet 4.6
        - id: haiku
          label: Haiku
      effort: high
      efforts: [medium, high, xhigh]
      stage_models:
        idea: composer-2.5-fast
        prd: composer-2.5
        techspec: sonnet-4.6
        tasks: composer-2.5
        refinement: composer-2.5
        execution: composer-2.5
        review: sonnet-4.6
        memory: haiku
      stage_efforts:
        idea: medium
        prd: high
        techspec: xhigh
        tasks: high
        refinement: high
        execution: high
        review: xhigh
        memory: medium
      capabilities: [chat, tools, code]
      enabled: true
    rig:
      kind: rig-adapter
      auth_env:
      auth_methods:
        - id: openai-api
          label: OpenAI API via Rig
          kind: env
          env: OPENAI_API_KEY
        - id: anthropic-api
          label: Anthropic API via Rig
          kind: env
          env: ANTHROPIC_API_KEY
        - id: google-ai-api
          label: Google AI API via Rig
          kind: env
          env: GEMINI_API_KEY
        - id: rig-generic-api
          label: Generic Rig provider API
          kind: env
          env: RIG_PROVIDER_API_KEY
      model: openai/gpt-5.5
      models:
        - id: openai/gpt-5.4
          label: Rig / OpenAI GPT-5.4
        - id: openai/gpt-5.5
          label: Rig / OpenAI GPT-5.5
        - id: anthropic/claude-sonnet-4-6
          label: Rig / Claude Sonnet 4.6
        - id: anthropic/claude-opus-4-8
          label: Rig / Claude Opus 4.8
        - id: google/gemini-3.1-pro
          label: Rig / Gemini 3.1 Pro
        - id: ollama/llama3.3
          label: Rig / Ollama Llama 3.3
      effort: high
      efforts: [medium, high, xhigh]
      stage_models:
        idea: openai/gpt-5.4
        prd: openai/gpt-5.4
        techspec: openai/gpt-5.5
        tasks: openai/gpt-5.4
        refinement: openai/gpt-5.4
        execution: openai/gpt-5.5
        review: anthropic/claude-opus-4-8
        memory: openai/gpt-5.4
      stage_efforts:
        idea: medium
        prd: high
        techspec: xhigh
        tasks: high
        refinement: high
        execution: high
        review: xhigh
        memory: medium
      capabilities: [chat, tools, code, provider-routing]
      enabled: false
runtime:
  node_effect_bridge:
    enabled: false
    command: pnpm effect-orchestration

memory:
  learning_enabled: true
  index_path: .sdd/memory/learnings.jsonl
  redact_secrets: true

intelligence:
  enabled: true
  index_dir: .sdd/intelligence
  context_pack_dir: .sdd/intelligence/context-packs
  max_context_chars: 24000
  redact_secrets: true
  context_materialization:
    enabled: true
    mode: proposal
    targets: [agents, claude, cursor, antigravity]
    local_agents: false
    max_boundaries: 4
    excludes: [.agents, .codex, .claude, .cursor, .devin, .kiro, .opencode, .trae, .git, .sdd, .codegraph, .cache, target, node_modules, dist, build, .next, coverage, tmp, temp, vendor]
  code_intelligence:
    enabled: true
    preferred: auto
    providers:
      codegraph:
        command: codegraph
        index_marker: .codegraph/
      lexa:
        command: lexa
        index_marker: .lexa/graph.lexa

optimization:
  enabled: true
  codegraph:
    mode: adaptive
    command: codegraph
    index_marker: .codegraph/
    auto_index: true
  rtk:
    enabled: auto
    command: rtk
  caveman:
    enabled: auto
    command: caveman
    apply_to: [trace, handoff, memory-derived]
  ignored_paths:
    - .git
    - .codegraph
    - .sdd
    - .sdd-execution
    - .sdd-parallel
    - target
    - node_modules
    - dist
    - build
    - .next
    - .cache
    - coverage
    - tmp
    - temp
    - vendor