intentdna 1.7.5 → 1.8.0

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 (152) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/LICENSE +201 -0
  4. package/README.md +143 -194
  5. package/dist/assets/candidates.d.ts +124 -0
  6. package/dist/assets/candidates.js +1249 -0
  7. package/dist/assets/catalog.d.ts +101 -0
  8. package/dist/assets/catalog.js +311 -0
  9. package/dist/assets/evidence.d.ts +93 -0
  10. package/dist/assets/evidence.js +391 -0
  11. package/dist/assets/index.d.ts +4 -0
  12. package/dist/assets/index.js +4 -0
  13. package/dist/assets/metadata.d.ts +19 -0
  14. package/dist/assets/metadata.js +227 -0
  15. package/dist/cli/commands/assets.d.ts +65 -0
  16. package/dist/cli/commands/assets.js +2871 -0
  17. package/dist/cli/commands/auth.d.ts +322 -0
  18. package/dist/cli/commands/auth.js +1592 -0
  19. package/dist/cli/commands/cloud-auth-guidance.d.ts +2 -0
  20. package/dist/cli/commands/cloud-auth-guidance.js +4 -0
  21. package/dist/cli/commands/cloud.d.ts +1359 -0
  22. package/dist/cli/commands/cloud.js +8364 -0
  23. package/dist/cli/commands/evolve.js +18 -2
  24. package/dist/cli/commands/generate.js +25 -2
  25. package/dist/cli/commands/guard.d.ts +1 -1
  26. package/dist/cli/commands/guard.js +1 -1
  27. package/dist/cli/commands/guide.d.ts +15 -0
  28. package/dist/cli/commands/guide.js +1747 -0
  29. package/dist/cli/commands/init.d.ts +12 -0
  30. package/dist/cli/commands/init.js +95 -60
  31. package/dist/cli/commands/org.d.ts +16 -0
  32. package/dist/cli/commands/org.js +2393 -0
  33. package/dist/cli/commands/release.d.ts +59 -0
  34. package/dist/cli/commands/release.js +716 -0
  35. package/dist/cli/commands/report.d.ts +82 -0
  36. package/dist/cli/commands/report.js +1516 -0
  37. package/dist/cli/commands/run.d.ts +6 -1
  38. package/dist/cli/commands/run.js +95 -26
  39. package/dist/cli/commands/sync.d.ts +8 -1
  40. package/dist/cli/commands/sync.js +436 -141
  41. package/dist/cli/commands/templates.d.ts +64 -0
  42. package/dist/cli/commands/templates.js +2151 -1
  43. package/dist/cli/commands/workflow.d.ts +26 -0
  44. package/dist/cli/commands/workflow.js +3053 -0
  45. package/dist/cli/index.js +703 -36
  46. package/dist/compiler/cascade.js +4 -9
  47. package/dist/compiler/compile.js +1 -0
  48. package/dist/governance/evidence-capture-attribution.d.ts +12 -0
  49. package/dist/governance/evidence-capture-attribution.js +46 -0
  50. package/dist/governance/index.d.ts +2 -0
  51. package/dist/governance/index.js +1 -0
  52. package/dist/hooks/cli.d.ts +5 -0
  53. package/dist/hooks/cli.js +149 -5
  54. package/dist/hooks/enforce.d.ts +1 -0
  55. package/dist/hooks/protocol.d.ts +1 -1
  56. package/dist/hooks/protocol.js +1 -1
  57. package/dist/hooks/state.d.ts +41 -0
  58. package/dist/hooks/state.js +126 -2
  59. package/dist/index.d.ts +3 -0
  60. package/dist/index.js +3 -0
  61. package/dist/mcp/tools-state.js +2 -0
  62. package/dist/organization/index.d.ts +121 -0
  63. package/dist/organization/index.js +413 -0
  64. package/dist/runtime/claude-sync-target.d.ts +49 -0
  65. package/dist/runtime/claude-sync-target.js +280 -0
  66. package/dist/runtime/codex-adapter.d.ts +254 -0
  67. package/dist/runtime/codex-adapter.js +1204 -0
  68. package/dist/runtime/codex-sync-target.d.ts +33 -0
  69. package/dist/runtime/codex-sync-target.js +241 -0
  70. package/dist/runtime/index.d.ts +8 -0
  71. package/dist/runtime/index.js +4 -0
  72. package/dist/runtime/output-artifact-registry.d.ts +1 -1
  73. package/dist/runtime/output-artifact-registry.js +2 -0
  74. package/dist/runtime/settings-adapter.d.ts +1 -1
  75. package/dist/runtime/settings-adapter.js +1 -1
  76. package/dist/runtime/skill-adapter.d.ts +5 -1
  77. package/dist/runtime/skill-adapter.js +120 -34
  78. package/dist/runtime/sync-artifact-registry.d.ts +99 -0
  79. package/dist/runtime/sync-artifact-registry.js +194 -0
  80. package/dist/runtime/sync-target-plan.d.ts +45 -0
  81. package/dist/runtime/sync-target-plan.js +19 -0
  82. package/dist/schema/controller-registry.d.ts +8 -1
  83. package/dist/schema/controller-registry.js +8 -0
  84. package/dist/schema/types.d.ts +35 -23
  85. package/dist/schema/types.js +10 -1
  86. package/dist/schema/validate.js +22 -22
  87. package/dist/schema/validators/controllers.js +38 -20
  88. package/dist/schema/workflow-authoring-contract.d.ts +29 -0
  89. package/dist/schema/workflow-authoring-contract.js +109 -0
  90. package/dist/schema/yaml-parser.js +18 -0
  91. package/dist/templates/api-backend.dna.yaml +19 -0
  92. package/dist/templates/brainstorming-first.dna.yaml +19 -0
  93. package/dist/templates/code-cleanup.dna.yaml +19 -0
  94. package/dist/templates/code-review-pipeline.dna.yaml +18 -0
  95. package/dist/templates/documentation-writer.dna.yaml +19 -0
  96. package/dist/templates/flutter-behavior-lock.dna.yaml +19 -0
  97. package/dist/templates/flutter-refactoring-rescue.dna.yaml +19 -0
  98. package/dist/templates/flutter-rewrite-diagnosis-review.dna.yaml +210 -0
  99. package/dist/templates/flutter-rewrite-fix-review-loop.dna.yaml +260 -0
  100. package/dist/templates/flutter-rewrite-new.dna.yaml +506 -0
  101. package/dist/templates/flutter-rewrite.dna.yaml +20 -0
  102. package/dist/templates/frontend-quality.dna.yaml +19 -0
  103. package/dist/templates/full-pipeline.dna.yaml +20 -0
  104. package/dist/templates/marketplace.d.ts +92 -0
  105. package/dist/templates/marketplace.js +502 -0
  106. package/dist/templates/metadata.d.ts +25 -0
  107. package/dist/templates/metadata.js +136 -3
  108. package/dist/templates/mobile-dev.dna.yaml +19 -0
  109. package/dist/templates/multi-agent-handoff-coordination.dna.yaml +156 -0
  110. package/dist/templates/multi-perspective-review.dna.yaml +19 -0
  111. package/dist/templates/persistent-executor.dna.yaml +19 -0
  112. package/dist/templates/qa-loop.dna.yaml +18 -0
  113. package/dist/templates/release-evidence-gate.dna.yaml +131 -0
  114. package/dist/templates/requirements-gate.dna.yaml +19 -0
  115. package/dist/templates/research-orchestration.dna.yaml +19 -0
  116. package/dist/templates/root-cause-analysis.dna.yaml +19 -0
  117. package/dist/templates/safe-refactoring.dna.yaml +321 -0
  118. package/dist/templates/secure-dev.dna.yaml +19 -0
  119. package/dist/templates/subagent-parallel.dna.yaml +19 -0
  120. package/dist/templates/systematic-debugging.dna.yaml +19 -0
  121. package/dist/templates/tdd-strict.dna.yaml +19 -0
  122. package/dist/templates/ui-visual-regression-qa.dna.yaml +133 -0
  123. package/dist/templates/workflow-author.dna.yaml +302 -0
  124. package/dist/templates/workflow-blocked-scope-triage.dna.yaml +242 -0
  125. package/dist/templates/workflow-completion-audit.dna.yaml +254 -0
  126. package/dist/templates/workflow-cross-boundary-resource-approval.dna.yaml +249 -0
  127. package/dist/templates/workflow-evidence-review.dna.yaml +198 -0
  128. package/dist/templates/workflow-module-inventory.dna.yaml +257 -0
  129. package/dist/templates/workflow-runtime-smoke-review.dna.yaml +252 -0
  130. package/dist/templates/workflow-verification-command-routing.dna.yaml +278 -0
  131. package/dist/workflow/authoring-packet.d.ts +67 -0
  132. package/dist/workflow/authoring-packet.js +218 -0
  133. package/dist/workflow/draft.d.ts +159 -0
  134. package/dist/workflow/draft.js +800 -0
  135. package/dist/workflow/index.d.ts +3 -0
  136. package/dist/workflow/index.js +3 -0
  137. package/dist/workflow/suggestion-review.d.ts +65 -0
  138. package/dist/workflow/suggestion-review.js +245 -0
  139. package/package.json +1 -1
  140. package/spec/README.md +15 -48
  141. package/spec/codex-adapter-contract.md +176 -0
  142. package/spec/sync-target-plan.md +158 -0
  143. package/spec/workflow-capability-ir.md +153 -0
  144. package/spec/agent-dispatch-fix.md +0 -116
  145. package/spec/control-plane-convergence-handoff-2026-04-24.md +0 -432
  146. package/spec/flutter-rewrite-template-optimization.md +0 -301
  147. package/spec/foundation-hardening.md +0 -178
  148. package/spec/hooks-infra-harness-hardening.md +0 -741
  149. package/spec/multi-config.md +0 -172
  150. package/spec/parallel-isolation.md +0 -268
  151. package/spec/template-version-namespace-fix.md +0 -653
  152. package/spec/workflow-pipeline.md +0 -101
@@ -6,6 +6,24 @@
6
6
  version: "0.1.0"
7
7
  id: template_safe_refactoring
8
8
  name: Safe Refactoring
9
+ purpose: Refactor code in small behavior-preserving steps after characterization and verification are in place.
10
+ maturity: reviewed
11
+ fit:
12
+ - Refactors where external behavior must stay stable.
13
+ - Cleanup work that needs tests before structural edits.
14
+ not_for:
15
+ - Feature changes mixed into refactor commits.
16
+ - Untested broad rewrites.
17
+ inputs:
18
+ - refactor task scope
19
+ - characterization tests
20
+ - verification command
21
+ outputs:
22
+ - scoped refactor commits
23
+ - regression evidence
24
+ - reviewable behavior preservation notes
25
+ lineage:
26
+ source: TDD refactor phase and verification-before-completion workflow shape
9
27
  type: project
10
28
  namespace: sr
11
29
 
@@ -64,3 +82,306 @@ genes:
64
82
  target: mixed_refactor_and_feature
65
83
 
66
84
  contexts: {}
85
+
86
+ variables:
87
+ task_id:
88
+ description: Refactor task identifier used for evidence artifacts
89
+ default: refactor-task
90
+ test_command:
91
+ description: Command that proves behavior has not regressed
92
+ default: npm test
93
+ target_scope:
94
+ description: Code paths allowed for the rewrite step
95
+ default: src/**
96
+
97
+ roles:
98
+ intent_mapper:
99
+ description: Locks the refactor intent, success criteria, and non-goals before code changes.
100
+ tool_permissions:
101
+ allow: [Read, Grep, Glob, Write]
102
+ deny: [Edit, Bash, NotebookEdit]
103
+ scope:
104
+ read: ["**/*"]
105
+ write: [".dna/refactor/**"]
106
+ instructions:
107
+ - Capture the exact refactor intent and explicit non-goals.
108
+ - Define observable behavior that must remain equivalent.
109
+ - Do not edit source code or tests.
110
+
111
+ boundary_guard:
112
+ description: Freezes the allowed read/write boundary and records risk constraints.
113
+ tool_permissions:
114
+ allow: [Read, Grep, Glob, Write]
115
+ deny: [Edit, Bash, NotebookEdit]
116
+ scope:
117
+ read: ["**/*"]
118
+ write: [".dna/refactor/**"]
119
+ instructions:
120
+ - Record allowed write paths and forbidden areas.
121
+ - Treat broad or unclear scope as a blocker.
122
+ - Do not edit implementation files.
123
+
124
+ baseline_tester:
125
+ description: Characterizes current behavior before rewrite.
126
+ tool_permissions:
127
+ allow: [Read, Grep, Glob, Bash, Write]
128
+ deny: [Edit, NotebookEdit]
129
+ scope:
130
+ read: ["**/*"]
131
+ write: [".dna/refactor/**"]
132
+ instructions:
133
+ - Run the declared test command before rewrite.
134
+ - Record baseline output and known failures.
135
+ - Do not change code to make the baseline pass.
136
+
137
+ rewrite_surgeon:
138
+ description: Performs behavior-preserving rewrite inside the frozen boundary.
139
+ tool_permissions:
140
+ allow: [Read, Edit, Write, Grep, Glob, Bash]
141
+ scope:
142
+ read: ["**/*"]
143
+ write: ["{{target_scope}}"]
144
+ instructions:
145
+ - Apply the smallest behavior-preserving rewrite that satisfies the intent.
146
+ - Stay inside the frozen boundary and do not expand scope silently.
147
+ - Run targeted checks after each material change.
148
+ - Revert or escalate if behavior may have changed.
149
+
150
+ equivalence_verifier:
151
+ description: Proves the rewrite is logically equivalent to baseline behavior.
152
+ tool_permissions:
153
+ allow: [Read, Grep, Glob, Bash, Write]
154
+ deny: [Edit, NotebookEdit]
155
+ scope:
156
+ read: ["**/*"]
157
+ write: [".dna/refactor/**"]
158
+ instructions:
159
+ - Compare baseline and post-rewrite behavior.
160
+ - Run the declared test command and record output.
161
+ - Mark any unproven equivalence as a blocker.
162
+
163
+ refactor_reviewer:
164
+ description: Reviews the diff and packages evidence for handoff.
165
+ tool_permissions:
166
+ allow: [Read, Grep, Glob, Bash, Write]
167
+ deny: [Edit, NotebookEdit]
168
+ scope:
169
+ read: ["**/*"]
170
+ write: [".dna/refactor/**"]
171
+ instructions:
172
+ - Review the final diff against intent, boundary, and equivalence evidence.
173
+ - Produce a compact evidence package with verdict and residual risks.
174
+ - Do not approve if tests, baseline, or boundary evidence is missing.
175
+
176
+ workflows:
177
+ refactor-equivalence:
178
+ name: Refactor With Equivalence
179
+ description: "Intent-locked refactor workflow: freeze scope, characterize baseline, rewrite, prove equivalence, and package evidence."
180
+ consumes:
181
+ - type: state
182
+ name: refactor_request
183
+ required: true
184
+ description: User refactor request and target behavior.
185
+ produces:
186
+ - type: file
187
+ path: ".dna/refactor/{{task_id}}/evidence.md"
188
+ description: Final evidence package for the refactor.
189
+ default_isolation: worktree
190
+ retry_policy:
191
+ max_retries: 1
192
+ retry_from: equivalence_verify
193
+ backoff: none
194
+ steps:
195
+ - id: intent_lock
196
+ role: intent_mapper
197
+ description: Lock intent, non-goals, and equivalence criteria.
198
+ enforce:
199
+ read_only: true
200
+ additional_write_paths: [".dna/refactor/**"]
201
+ handoff:
202
+ produces:
203
+ - type: file
204
+ path: ".dna/refactor/{{task_id}}/intent.md"
205
+ description: Locked intent, non-goals, and equivalence criteria.
206
+ completion:
207
+ - file_contains: { path: ".dna/refactor/{{task_id}}/intent.md", pattern: "Equivalence criteria" }
208
+ checkpoints:
209
+ - assert: clean_working_tree
210
+ action: warn
211
+ message: "Record any pre-existing dirty state before refactor."
212
+ prompt: |
213
+ Lock the refactor intent before any implementation work.
214
+ Write .dna/refactor/{{task_id}}/intent.md with:
215
+ - Refactor goal
216
+ - Explicit non-goals
217
+ - Equivalence criteria
218
+ - Allowed target scope: {{target_scope}}
219
+
220
+ - id: boundary_freeze
221
+ role: boundary_guard
222
+ depends_on: [intent_lock]
223
+ description: Freeze allowed scope, tool policy, and risky boundaries.
224
+ enforce:
225
+ read_only: true
226
+ additional_write_paths: [".dna/refactor/**"]
227
+ handoff:
228
+ consumes:
229
+ - type: file
230
+ path: ".dna/refactor/{{task_id}}/intent.md"
231
+ from: intent_lock
232
+ description: Locked intent.
233
+ produces:
234
+ - type: file
235
+ path: ".dna/refactor/{{task_id}}/boundary.md"
236
+ description: Frozen read/write/action boundary.
237
+ completion:
238
+ - file_contains: { path: ".dna/refactor/{{task_id}}/boundary.md", pattern: "Allowed writes" }
239
+ prompt: |
240
+ Freeze the refactor boundary. Write .dna/refactor/{{task_id}}/boundary.md with:
241
+ - Allowed writes
242
+ - Explicit forbidden areas
243
+ - Required checks
244
+ - Escalation triggers
245
+
246
+ - id: baseline_characterization
247
+ role: baseline_tester
248
+ depends_on: [boundary_freeze]
249
+ description: Capture baseline behavior before rewrite.
250
+ handoff:
251
+ consumes:
252
+ - type: file
253
+ path: ".dna/refactor/{{task_id}}/boundary.md"
254
+ from: boundary_freeze
255
+ description: Frozen boundary.
256
+ produces:
257
+ - type: test_result
258
+ path: ".dna/refactor/{{task_id}}/baseline.log"
259
+ description: Baseline test output before rewrite.
260
+ completion:
261
+ - command_success: "{{test_command}}"
262
+ - file_not_empty: ".dna/refactor/{{task_id}}/baseline.log"
263
+ checkpoints:
264
+ - assert: no_test_regression
265
+ command: "{{test_command}}"
266
+ message: "Baseline command must run before rewrite."
267
+ prompt: |
268
+ Capture baseline behavior before code edits.
269
+ Run: {{test_command}}
270
+ Save the output or a concise transcript to .dna/refactor/{{task_id}}/baseline.log.
271
+ If baseline already fails, record known failures and stop for review.
272
+
273
+ - id: rewrite
274
+ role: rewrite_surgeon
275
+ depends_on: [baseline_characterization]
276
+ description: Perform the behavior-preserving rewrite inside the frozen boundary.
277
+ isolation: worktree
278
+ enforce:
279
+ additional_write_paths: ["{{target_scope}}"]
280
+ handoff:
281
+ consumes:
282
+ - type: file
283
+ path: ".dna/refactor/{{task_id}}/intent.md"
284
+ from: intent_lock
285
+ description: Locked intent.
286
+ - type: file
287
+ path: ".dna/refactor/{{task_id}}/boundary.md"
288
+ from: boundary_freeze
289
+ description: Frozen boundary.
290
+ - type: test_result
291
+ path: ".dna/refactor/{{task_id}}/baseline.log"
292
+ from: baseline_characterization
293
+ description: Baseline behavior output.
294
+ produces:
295
+ - type: summary
296
+ name: rewrite_summary
297
+ description: Summary of behavior-preserving changes.
298
+ checkpoints:
299
+ - assert: no_test_regression
300
+ command: "{{test_command}}"
301
+ message: "Rewrite must keep the declared test command green."
302
+ prompt: |
303
+ Perform the rewrite inside {{target_scope}} only.
304
+ Preserve behavior exactly according to .dna/refactor/{{task_id}}/intent.md.
305
+ Keep changes small. Run {{test_command}} after material changes.
306
+ Produce a concise rewrite summary for the verifier.
307
+
308
+ - id: equivalence_verify
309
+ role: equivalence_verifier
310
+ depends_on: [rewrite]
311
+ description: Prove rewritten behavior is equivalent to baseline.
312
+ handoff:
313
+ consumes:
314
+ - type: test_result
315
+ path: ".dna/refactor/{{task_id}}/baseline.log"
316
+ from: baseline_characterization
317
+ description: Baseline test output.
318
+ - type: summary
319
+ name: rewrite_summary
320
+ from: rewrite
321
+ description: Rewrite summary.
322
+ produces:
323
+ - type: test_result
324
+ path: ".dna/refactor/{{task_id}}/equivalence.log"
325
+ description: Post-rewrite equivalence output.
326
+ - type: file
327
+ path: ".dna/refactor/{{task_id}}/equivalence.md"
328
+ description: Equivalence verdict and comparison notes.
329
+ completion:
330
+ - command_success: "{{test_command}}"
331
+ - file_contains: { path: ".dna/refactor/{{task_id}}/equivalence.md", pattern: "Equivalent: yes" }
332
+ checkpoints:
333
+ - assert: no_test_regression
334
+ command: "{{test_command}}"
335
+ message: "Equivalence validation must pass before review."
336
+ prompt: |
337
+ Prove equivalence after the rewrite.
338
+ Run: {{test_command}}
339
+ Save output to .dna/refactor/{{task_id}}/equivalence.log.
340
+ Write .dna/refactor/{{task_id}}/equivalence.md with:
341
+ - Equivalent: yes/no
342
+ - Baseline comparison
343
+ - Any unverified behavior or residual risk
344
+
345
+ - id: review
346
+ role: refactor_reviewer
347
+ depends_on: [equivalence_verify]
348
+ description: Review final diff and evidence before handoff.
349
+ enforce:
350
+ read_only: true
351
+ additional_write_paths: [".dna/refactor/**"]
352
+ handoff:
353
+ consumes:
354
+ - type: file
355
+ path: ".dna/refactor/{{task_id}}/intent.md"
356
+ from: intent_lock
357
+ description: Locked intent.
358
+ - type: file
359
+ path: ".dna/refactor/{{task_id}}/boundary.md"
360
+ from: boundary_freeze
361
+ description: Frozen boundary.
362
+ - type: test_result
363
+ path: ".dna/refactor/{{task_id}}/equivalence.log"
364
+ from: equivalence_verify
365
+ description: Equivalence test output.
366
+ - type: file
367
+ path: ".dna/refactor/{{task_id}}/equivalence.md"
368
+ from: equivalence_verify
369
+ description: Equivalence verdict.
370
+ produces:
371
+ - type: file
372
+ path: ".dna/refactor/{{task_id}}/evidence.md"
373
+ description: Final evidence package.
374
+ completion:
375
+ - file_contains: { path: ".dna/refactor/{{task_id}}/evidence.md", pattern: "Verdict: APPROVE" }
376
+ checkpoints:
377
+ - assert: clean_working_tree
378
+ action: warn
379
+ message: "Record final dirty state before handoff."
380
+ prompt: |
381
+ Review the final diff and evidence.
382
+ Write .dna/refactor/{{task_id}}/evidence.md with:
383
+ - Intent summary
384
+ - Boundary summary
385
+ - Test/equivalence evidence
386
+ - RuntimeDecisionEvent or diagnostic evidence refs when available
387
+ - Verdict: APPROVE or REQUEST_CHANGES
@@ -5,6 +5,25 @@
5
5
  version: "0.1.0"
6
6
  id: template_secure_dev
7
7
  name: Secure Development Baseline
8
+ purpose: Provide a security-first development baseline with code quality, safe operations, review, implementation, and hotfix boundaries.
9
+ maturity: draft
10
+ fit:
11
+ - Development teams needing a general security and quality baseline before richer workflows exist.
12
+ - Work where destructive operations and unsafe changes must be constrained.
13
+ not_for:
14
+ - Replacing formal security review, threat modeling, or incident response.
15
+ - Granting broad production authority or bypassing human approval.
16
+ inputs:
17
+ - development task scope
18
+ - security and operational constraints
19
+ - review or hotfix context
20
+ outputs:
21
+ - security and quality guardrails
22
+ - review or implementation role boundaries
23
+ - safe-operation reminders
24
+ lineage:
25
+ source: built-in secure development baseline template
26
+ reference: src/templates/secure-dev.dna.yaml
8
27
  type: project
9
28
  namespace: sd
10
29
 
@@ -6,6 +6,25 @@
6
6
  version: "0.1.0"
7
7
  id: template_subagent_parallel
8
8
  name: Subagent Parallel Development
9
+ purpose: Split large work into isolated subagent lanes with two-phase review before integration.
10
+ maturity: reviewed
11
+ fit:
12
+ - Large tasks with independent subtasks and clear write-scope boundaries.
13
+ - Parallel implementation where each lane needs spec compliance and code quality review.
14
+ not_for:
15
+ - Shared-file work without a conflict plan.
16
+ - Letting parallel workers change architecture or global scope independently.
17
+ inputs:
18
+ - task decomposition
19
+ - lane ownership and write scopes
20
+ - per-lane acceptance criteria
21
+ outputs:
22
+ - subtask implementation outputs
23
+ - two-phase review evidence
24
+ - integrated result plan
25
+ lineage:
26
+ source: subagent-driven development and parallel-agent workflow shape
27
+ reference: docs/archive/2026H1/references/branch-consolidation-handoff-20260709.md
9
28
  type: project
10
29
  namespace: sap
11
30
 
@@ -5,6 +5,25 @@
5
5
  version: "0.1.0"
6
6
  id: template_systematic_debugging
7
7
  name: Systematic Debugging
8
+ purpose: Debug through hypotheses, evidence, root-cause isolation, and regression prevention instead of trial-and-error fixes.
9
+ maturity: reviewed
10
+ fit:
11
+ - Defects where the cause is unknown or multiple causes are plausible.
12
+ - Teams needing a repeatable debugging discipline before code changes.
13
+ not_for:
14
+ - Applying guessed fixes without evidence.
15
+ - Ignoring regression tests after a bug is fixed.
16
+ inputs:
17
+ - bug report or failing behavior
18
+ - logs, tests, traces, and reproduction steps
19
+ - changed code or environment context
20
+ outputs:
21
+ - ranked hypotheses
22
+ - verified root cause
23
+ - fix and regression-prevention evidence
24
+ lineage:
25
+ source: systematic-debugging workflow pattern
26
+ reference: src/templates/systematic-debugging.dna.yaml
8
27
  type: project
9
28
  namespace: dbg
10
29
 
@@ -5,6 +5,25 @@
5
5
  version: "0.1.0"
6
6
  id: template_tdd_strict
7
7
  name: Strict Test-Driven Development
8
+ purpose: Enforce a red-green-refactor loop where meaningful tests are written before implementation and stay green through cleanup.
9
+ maturity: reviewed
10
+ fit:
11
+ - Feature or bug work where desired behavior can be specified with tests first.
12
+ - Teams practicing strict TDD with continuous verification.
13
+ not_for:
14
+ - Exploratory spikes where the behavior contract is intentionally unknown.
15
+ - Writing tautological or implementation-only tests after the fact.
16
+ inputs:
17
+ - behavior requirement
18
+ - test location and framework
19
+ - verification command
20
+ outputs:
21
+ - failing test first
22
+ - minimal passing implementation
23
+ - refactor evidence with tests green
24
+ lineage:
25
+ source: strict test-driven development workflow
26
+ reference: src/templates/tdd-strict.dna.yaml
8
27
  type: project
9
28
  namespace: tdd
10
29
 
@@ -0,0 +1,133 @@
1
+ version: "0.1.0"
2
+ id: template_ui_visual_regression_qa
3
+ name: UI Visual Regression QA
4
+ purpose: Capture desktop and mobile UI evidence so visual regressions, blank states, overflow, and route issues are reviewed before release.
5
+ maturity: reviewed
6
+ fit:
7
+ - UI routes that need screenshot, DOM, and layout evidence before completion.
8
+ - Local or deployed product surfaces where visual QA must be separated from runtime enforcement.
9
+ not_for:
10
+ - Claiming runtime policy authority from browser-rendered evidence.
11
+ - Accepting desktop-only checks for responsive UI work.
12
+ inputs:
13
+ - target local or deployed route
14
+ - desktop and mobile viewport requirements
15
+ - screenshot, DOM, and layout evidence directory
16
+ outputs:
17
+ - visual QA evidence bundle
18
+ - layout and overflow findings
19
+ - reviewed visual QA verdict
20
+ lineage:
21
+ source: IntentDNA Online visual QA correction path
22
+ reference: apps/online
23
+ type: project
24
+ namespace: uvr
25
+
26
+ cascade:
27
+ inherits: ["species:default"]
28
+ priority: 100
29
+
30
+ variables:
31
+ target_url:
32
+ description: "Local or deployed UI route to inspect"
33
+ default: "$ARGUMENTS"
34
+ evidence_dir:
35
+ description: "Screenshot, DOM, and layout evidence output directory"
36
+ default: ".dna/ui-qa/$ARGUMENTS"
37
+ verdict_path:
38
+ description: "Visual QA verdict artifact"
39
+ default: ".dna/ui-qa/$ARGUMENTS.verdict.json"
40
+
41
+ evidence:
42
+ - label: Online route visual QA boundary
43
+ kind: doc
44
+ path: docs/archive/2026H1/references/three-products-boundary.md
45
+ description: Product boundary requiring online UI to remain projection/authoring/community, not runtime truth.
46
+
47
+ genes:
48
+ viewport_evidence_required:
49
+ description: UI QA requires explicit desktop and mobile evidence before pass claims
50
+ codons:
51
+ - type: attract
52
+ target: capture_mobile_and_desktop_screenshots
53
+ - type: attract
54
+ target: inspect_dom_and_console
55
+ - type: repel
56
+ target: visual_pass_without_screenshot
57
+ - type: threshold
58
+ condition: "viewport_evidence_count >= 2"
59
+ action: block
60
+
61
+ layout_stability:
62
+ description: Detect overlap, clipping, blank states, and horizontal overflow
63
+ codons:
64
+ - type: attract
65
+ target: overflow_check
66
+ - type: attract
67
+ target: text_fit_check
68
+ - type: attract
69
+ target: nonblank_canvas_or_media_check
70
+ - type: repel
71
+ target: screenshot_only_happy_path
72
+
73
+ projection_boundary:
74
+ description: UI evidence is product QA, not runtime enforcement
75
+ codons:
76
+ - type: repel
77
+ target: browser_state_as_policy_truth
78
+ - type: threshold
79
+ condition: "ui_claims_runtime_authority == false"
80
+ action: block
81
+
82
+ contexts: {}
83
+
84
+ roles:
85
+ visual_tester:
86
+ description: Captures UI evidence and console/layout diagnostics.
87
+ tool_permissions:
88
+ allow: [Read, Write, Grep, Glob, Bash]
89
+ deny: [Edit, NotebookEdit]
90
+ scope:
91
+ read: ["**/*"]
92
+ write: [".dna/ui-qa/**", "output/ui-qa/**"]
93
+ instructions:
94
+ - Open {{target_url}} at mobile and desktop viewports.
95
+ - Capture screenshots, console errors, DOM summaries, and horizontal overflow checks.
96
+ - Record evidence under {{evidence_dir}}.
97
+ - Do not change application code or product policy.
98
+
99
+ visual_reviewer:
100
+ description: Reviews UI evidence and writes a pass/fail visual verdict.
101
+ tool_permissions:
102
+ allow: [Read, Write, Grep, Glob]
103
+ deny: [Edit, Bash, NotebookEdit]
104
+ scope:
105
+ read: ["**/*", ".dna/ui-qa/**", "output/ui-qa/**"]
106
+ write: [".dna/ui-qa/**"]
107
+ instructions:
108
+ - Inspect all screenshots and diagnostics before judging.
109
+ - Fail if text overlaps, critical controls are clipped, canvas/media is blank, or public pages expose management-only data.
110
+ - Distinguish product defects from environment blockers.
111
+ - Write {{verdict_path}} with PASS, REQUEST_CHANGES, BLOCKED, or INCONCLUSIVE.
112
+
113
+ workflows:
114
+ visual-regression-qa:
115
+ name: UI Visual Regression QA
116
+ description: Capture viewport evidence, inspect layout, and write a visual QA verdict.
117
+ steps:
118
+ - id: collect-ui-evidence
119
+ role: visual_tester
120
+ description: Capture screenshots and layout diagnostics for the target route.
121
+ prompt: |
122
+ Collect UI QA evidence for {{target_url}}.
123
+ Use at least one mobile and one desktop viewport.
124
+ Save screenshots, console output, DOM/layout notes, and overflow results under {{evidence_dir}}.
125
+ Do not treat browser-local state as runtime truth.
126
+ - id: review-ui-evidence
127
+ role: visual_reviewer
128
+ depends_on: [collect-ui-evidence]
129
+ description: Review captured evidence and write a visual verdict.
130
+ prompt: |
131
+ Review all evidence under {{evidence_dir}}.
132
+ Check overlap, clipping, blank states, console errors, privacy leaks, and public/management separation.
133
+ Write {{verdict_path}} with verdict, blockers, evidence paths, and next actions.