intentdna 1.5.8 → 1.5.10

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.
@@ -316,6 +316,12 @@ workflows:
316
316
  role: surgeon
317
317
  depends_on: [investigate]
318
318
  description: "Fix identified issues. Max 5 files per round."
319
+ max_attempts: 3
320
+ on_fail: handoff
321
+ handoff_to: investigate
322
+ max_handoffs: 3
323
+ on_handoff_exhausted: skip
324
+ blocked_items_path: "docs/behavior/blocked_items.md"
319
325
  checkpoints:
320
326
  - assert: clean_working_tree
321
327
  message: "Commit all changes before proceeding"
@@ -337,9 +343,26 @@ workflows:
337
343
  produces:
338
344
  - type: git_commit
339
345
  description: "Rescue round commit"
340
- - id: review
346
+ - id: progress_check
341
347
  role: investigator
342
348
  depends_on: [fix]
349
+ description: "Check test progress after surgeon's fix."
350
+ prompt: |
351
+ Run tests. Compare green count with previous round.
352
+ If green count increased: PROGRESS — proceed to review.
353
+ If green count unchanged or decreased: NO_PROGRESS — record what surgeon tried
354
+ and why it didn't work, for the experience chain.
355
+ handoff:
356
+ consumes:
357
+ - type: git_commit
358
+ from: fix
359
+ description: "Fix commit from surgeon"
360
+ produces:
361
+ - type: summary
362
+ description: "Progress check result (PROGRESS or NO_PROGRESS)"
363
+ - id: review
364
+ role: investigator
365
+ depends_on: [progress_check]
343
366
  description: "Read-only review of surgeon's changes."
344
367
  prompt: |
345
368
  Review surgeon's git diff (read-only, do NOT modify any files):
@@ -352,6 +375,9 @@ workflows:
352
375
  Verdict: REQUEST_CHANGES → describe specific problems. Next round's investigate step will include this feedback.
353
376
  handoff:
354
377
  consumes:
378
+ - type: summary
379
+ from: progress_check
380
+ description: "Progress check result"
355
381
  - type: git_commit
356
382
  from: fix
357
383
  description: "Committed fix from surgeon"
@@ -0,0 +1,144 @@
1
+ version: "0.1.0"
2
+ id: template_persistent_executor
3
+ name: Persistent Executor (PRD-Driven)
4
+ type: project
5
+ namespace: pe
6
+
7
+ cascade:
8
+ inherits: ["species:default"]
9
+ priority: 100
10
+
11
+ genes:
12
+ prd_driven:
13
+ description: Every task must trace back to explicit acceptance criteria
14
+ codons:
15
+ - type: threshold
16
+ condition: "acceptance_criteria_defined == true"
17
+ action: block
18
+ - type: attract
19
+ target: reference_acceptance_criteria
20
+ - type: repel
21
+ target: work_without_spec
22
+
23
+ verify_before_done:
24
+ description: Never claim completion without passing acceptance criteria
25
+ codons:
26
+ - type: threshold
27
+ condition: "all_criteria_verified == true"
28
+ action: block
29
+ - type: attract
30
+ target: run_verification_before_reporting
31
+ - type: repel
32
+ target: claim_done_without_evidence
33
+
34
+ no_partial_completion:
35
+ description: Either fully complete a story or explicitly report what remains
36
+ codons:
37
+ - type: threshold
38
+ condition: "story_fully_complete == true"
39
+ action: escalate
40
+ - type: repel
41
+ target: silent_partial_delivery
42
+
43
+ small_increments:
44
+ description: One story per commit, verifiable increments
45
+ role: workflow_hint
46
+ codons:
47
+ - type: attract
48
+ target: one_story_one_commit
49
+ - type: repel
50
+ target: batch_multiple_stories
51
+ - type: attract
52
+ target: each_commit_passes_tests
53
+
54
+ contexts: {}
55
+
56
+ roles:
57
+ executor:
58
+ description: Implements stories from the PRD. Can modify code.
59
+ tool_permissions:
60
+ allow: [Read, Edit, Write, Grep, Glob, Bash]
61
+ scope:
62
+ read: ["**/*"]
63
+ write: ["src/**", "lib/**", "test/**"]
64
+ instructions:
65
+ - Pick the highest priority incomplete story
66
+ - Read acceptance criteria before starting
67
+ - Implement in small verifiable steps
68
+ - Run tests after each change
69
+ - Commit after each story completion
70
+ - "Commit message: feat($STORY): what was implemented"
71
+ - Do not move to next story until current one is verified
72
+
73
+ verifier:
74
+ description: Independently verifies story completion. Read-only + can run tests.
75
+ tool_permissions:
76
+ allow: [Read, Grep, Glob, Bash]
77
+ deny: [Edit, Write, NotebookEdit]
78
+ scope:
79
+ read: ["**/*"]
80
+ write: []
81
+ instructions:
82
+ - Read the acceptance criteria for the completed story
83
+ - Run tests independently (do not trust executor's output)
84
+ - Check each criterion individually
85
+ - "Mark each: VERIFIED / PARTIAL / MISSING"
86
+ - "Verdict: PASS (all verified) or FAIL (list what's missing)"
87
+ - On FAIL the executor must fix before proceeding
88
+
89
+ workflows:
90
+ persistent-execution:
91
+ name: Persistent Execution
92
+ description: "PRD-driven story execution: pick, implement, verify, repeat until all done"
93
+ steps:
94
+ - id: pick_story
95
+ role: executor
96
+ description: "Select next story from PRD by priority."
97
+ prompt: |
98
+ Read the PRD or task list.
99
+ Select the highest priority incomplete story.
100
+ Confirm: acceptance criteria are clear and testable.
101
+ If criteria are vague, ask for clarification before starting.
102
+ Output: story ID, title, acceptance criteria.
103
+
104
+ - id: implement
105
+ role: executor
106
+ depends_on: [pick_story]
107
+ description: "Implement the selected story."
108
+ prompt: |
109
+ Implement the story. Rules:
110
+ - Read acceptance criteria carefully
111
+ - Small steps: change → test → verify
112
+ - Maximum scope: what the story requires, nothing more
113
+ - Run tests after each meaningful change
114
+ - If stuck for 3 attempts on the same issue: STOP and report blocker
115
+ - Commit when story implementation is complete
116
+ - Do not start the next story
117
+
118
+ - id: verify
119
+ role: verifier
120
+ depends_on: [implement]
121
+ description: "Independent verification of story completion."
122
+ prompt: |
123
+ Verify the completed story independently:
124
+ 1. Read acceptance criteria
125
+ 2. Run all relevant tests (do not trust executor's results)
126
+ 3. Check each criterion: VERIFIED / PARTIAL / MISSING
127
+ 4. Run full test suite for regression check
128
+
129
+ PASS: All criteria verified → story complete, ready for next
130
+ FAIL: List what's missing → executor must fix
131
+
132
+ - id: report
133
+ role: verifier
134
+ depends_on: [verify]
135
+ description: "Report progress and determine next action."
136
+ prompt: |
137
+ Summary:
138
+ - Story: [ID] [title]
139
+ - Criteria: N/M verified
140
+ - Tests: X passing, Y failing
141
+ - Verdict: COMPLETE or NEEDS_FIX
142
+
143
+ If COMPLETE: "Story done. Pick next story to continue."
144
+ If NEEDS_FIX: "Story incomplete. Issues: [list]. Fix before proceeding."
@@ -0,0 +1,147 @@
1
+ version: "0.1.0"
2
+ id: template_qa_loop
3
+ name: QA Loop (Test-Fix Cycle)
4
+ type: project
5
+ namespace: ql
6
+
7
+ cascade:
8
+ inherits: ["species:default"]
9
+ priority: 100
10
+
11
+ genes:
12
+ convergence_protection:
13
+ description: Stop if no progress after 2 consecutive rounds
14
+ codons:
15
+ - type: threshold
16
+ condition: "consecutive_no_progress_rounds <= 2"
17
+ action: block
18
+ - type: attract
19
+ target: track_test_progress_per_round
20
+ - type: repel
21
+ target: infinite_retry_loop
22
+
23
+ separate_test_fix:
24
+ description: Tester and fixer must be separate roles
25
+ codons:
26
+ - type: threshold
27
+ condition: "tester_is_not_fixer == true"
28
+ action: block
29
+ - type: repel
30
+ target: self_test_own_fix
31
+
32
+ evidence_based_diagnosis:
33
+ description: Diagnose from test output, not guessing
34
+ role: workflow_hint
35
+ codons:
36
+ - type: attract
37
+ target: read_error_output_first
38
+ - type: repel
39
+ target: guess_without_running_tests
40
+ - type: attract
41
+ target: categorize_failures_by_type
42
+
43
+ regression_awareness:
44
+ description: Fixes must not introduce new failures
45
+ codons:
46
+ - type: threshold
47
+ condition: "new_failures_introduced == 0"
48
+ action: escalate
49
+ - type: attract
50
+ target: run_full_suite_after_fix
51
+
52
+ contexts: {}
53
+
54
+ roles:
55
+ tester:
56
+ description: Runs tests, diagnoses failures, categorizes issues. Read-only.
57
+ tool_permissions:
58
+ allow: [Read, Grep, Glob, Bash]
59
+ deny: [Edit, Write, NotebookEdit]
60
+ scope:
61
+ read: ["**/*"]
62
+ write: []
63
+ instructions:
64
+ - Run the full test suite
65
+ - Categorize failures by type (compile, logic, integration, flaky)
66
+ - For each failure trace the root cause
67
+ - Prioritize by severity
68
+ - Compare results with previous round — track progress
69
+ - Do NOT suggest code changes
70
+
71
+ fixer:
72
+ description: Fixes issues identified by tester. Can modify code.
73
+ tool_permissions:
74
+ allow: [Read, Edit, Write, Grep, Glob, Bash]
75
+ scope:
76
+ read: ["**/*"]
77
+ write: ["src/**", "lib/**", "test/**"]
78
+ instructions:
79
+ - Fix issues in priority order (compile first, then logic, then integration)
80
+ - One fix at a time, run tests after each
81
+ - If a fix introduces new failures, revert immediately
82
+ - Maximum 5 files per round
83
+ - "Same issue failing 3 times → STOP, report as blocked"
84
+ - Commit after each successful fix batch
85
+
86
+ workflows:
87
+ qa-cycle:
88
+ name: QA Cycle
89
+ description: "Test-fix loop: test, diagnose, fix, retest. Max 5 rounds with convergence protection."
90
+ max_rounds: 5
91
+ convergence_rule: "2 consecutive rounds with 0 test progress → STOP"
92
+ steps:
93
+ - id: test
94
+ role: tester
95
+ description: "Run tests and categorize failures."
96
+ prompt: |
97
+ Run the test suite. Record results:
98
+ - Total tests, passing, failing, skipped
99
+ - If round > 1: compare with previous round results
100
+ - Categorize each failure:
101
+ COMPILE: syntax/import errors — fix first
102
+ LOGIC: assertion failures — fix after compile
103
+ INTEGRATION: cross-module issues — fix after logic
104
+ FLAKY: intermittent failures — deprioritize
105
+ - If 0 failures: "All tests passing. QA complete."
106
+ - If round > 1 and no progress: warn "no improvement"
107
+
108
+ - id: diagnose
109
+ role: tester
110
+ depends_on: [test]
111
+ description: "Root cause analysis for top failures."
112
+ prompt: |
113
+ For the top 3 failures (by severity):
114
+ 1. Read the error output carefully
115
+ 2. Trace to the root cause in source code
116
+ 3. Identify the minimal fix needed
117
+ 4. Check if failures are related (shared root cause)
118
+ Output: prioritized fix list with file paths and line numbers.
119
+
120
+ - id: fix
121
+ role: fixer
122
+ depends_on: [diagnose]
123
+ description: "Apply fixes for diagnosed issues."
124
+ prompt: |
125
+ Fix the diagnosed issues. Rules:
126
+ - Follow the priority order from diagnosis
127
+ - One fix at a time → run tests → verify
128
+ - If fix causes new failures: revert and try different approach
129
+ - Maximum 5 files per round
130
+ - Same issue failed 3 times → STOP and report as blocked
131
+ - Commit: "fix($TYPE): description of what was fixed"
132
+
133
+ - id: retest
134
+ role: tester
135
+ depends_on: [fix]
136
+ description: "Verify fixes and check for regressions."
137
+ prompt: |
138
+ Run the full test suite again:
139
+ 1. Are the targeted failures fixed?
140
+ 2. Any new regressions introduced?
141
+ 3. Test delta: +N fixed, -M new failures
142
+
143
+ Progress check:
144
+ - If all tests pass: "QA complete. All green."
145
+ - If progress made (fewer failures): "Round N: +X fixed. Continue."
146
+ - If no progress (same or more failures): "No progress. [2 rounds → STOP]"
147
+ - If blocked items exist: "Blocked on: [list]. Human intervention needed."
@@ -0,0 +1,116 @@
1
+ # requirements-gate: 需求清晰度门控
2
+ # 在需求明确(>=80%)之前阻止实现,每轮只问一个问题
3
+ # 适用: 任何需要"先澄清需求再动手"的项目
4
+
5
+ version: "0.1.0"
6
+ id: template_requirements_gate
7
+ name: Requirements Clarity Gate
8
+ type: project
9
+ namespace: rg
10
+
11
+ cascade:
12
+ inherits: ["species:default"]
13
+ priority: 100
14
+
15
+ genes:
16
+ clarity_threshold:
17
+ description: Block implementation until requirements are sufficiently clear (>=80%)
18
+ codons:
19
+ - type: threshold
20
+ condition: "requirements_clarity_score >= 80"
21
+ action: block
22
+ - type: attract
23
+ target: clarify_before_building
24
+ - type: repel
25
+ target: implement_with_ambiguity
26
+
27
+ one_question_per_round:
28
+ description: Ask one focused question at a time to reduce cognitive load
29
+ role: workflow_hint
30
+ codons:
31
+ - type: attract
32
+ target: single_focused_question
33
+ - type: repel
34
+ target: question_dump
35
+
36
+ target_weakest_dimension:
37
+ description: Always probe the least clear dimension first
38
+ role: workflow_hint
39
+ codons:
40
+ - type: attract
41
+ target: identify_weakest_area
42
+ - type: repel
43
+ target: redundant_clarification
44
+
45
+ structured_output:
46
+ description: Requirements must be structured and actionable
47
+ codons:
48
+ - type: attract
49
+ target: testable_acceptance_criteria
50
+ - type: repel
51
+ target: vague_requirements
52
+ - type: attract
53
+ target: explicit_constraints
54
+
55
+ contexts: {}
56
+
57
+ roles:
58
+ interviewer:
59
+ description: Evaluates requirements clarity and asks clarifying questions. Read-only.
60
+ tool_permissions:
61
+ allow: [Read, Grep, Glob, Bash]
62
+ deny: [Edit, Write, NotebookEdit]
63
+ scope:
64
+ read: ["**/*"]
65
+ write: []
66
+ instructions:
67
+ - Evaluate requirements across 4 dimensions (Goal, Constraints, Criteria, Context)
68
+ - Score each dimension 0-100
69
+ - If average < 80 output the most critical question targeting the weakest dimension
70
+ - If average >= 80 output structured requirements document
71
+ - One question per round — do not dump multiple questions
72
+ - "80% threshold rationale: below this, >1/5 dimensions are underspecified"
73
+
74
+ workflows:
75
+ requirements-gate:
76
+ name: Requirements Gate
77
+ description: "Evaluate requirements clarity, block if ambiguous, proceed if clear"
78
+ steps:
79
+ - id: clarity_check
80
+ role: interviewer
81
+ description: "Score requirements across 4 dimensions."
82
+ prompt: |
83
+ Evaluate the given requirements across 4 dimensions:
84
+
85
+ 1. Goal (0-100): Is the desired outcome clear and measurable?
86
+ 2. Constraints (0-100): Are boundaries, limitations, and non-goals defined?
87
+ 3. Criteria (0-100): Are acceptance criteria specific and testable?
88
+ 4. Context (0-100): Is the technical/business context sufficient?
89
+
90
+ Calculate average score.
91
+
92
+ If average >= 80:
93
+ Output: structured requirements document with all 4 dimensions filled.
94
+ Status: PROCEED
95
+
96
+ If average < 80:
97
+ Identify the weakest dimension.
98
+ Output: one specific clarifying question targeting that dimension.
99
+ Status: BLOCK — "Requirements clarity at N%. Need clarification on: [dimension]"
100
+
101
+ - id: proceed_or_block
102
+ role: interviewer
103
+ depends_on: [clarity_check]
104
+ description: "Gate decision based on clarity score."
105
+ prompt: |
106
+ Based on clarity check results:
107
+
108
+ If PROCEED: Format the requirements as a structured spec:
109
+ - Goal: [what]
110
+ - Constraints: [boundaries]
111
+ - Acceptance Criteria: [testable conditions]
112
+ - Context: [technical/business background]
113
+ - Out of Scope: [explicit exclusions]
114
+
115
+ If BLOCK: Summarize what's missing and the question to ask.
116
+ Do NOT proceed with implementation planning until clarity >= 80%.
@@ -0,0 +1,145 @@
1
+ # research-orchestration: 并行假设驱动研究
2
+ # 适用: 需要结构化调研、多角度验证、有据可查结论的研究任务
3
+
4
+ version: "0.1.0"
5
+ id: template_research_orchestration
6
+ name: Research Orchestration (Parallel Hypotheses)
7
+ type: project
8
+ namespace: ro
9
+
10
+ cascade:
11
+ inherits: ["species:default"]
12
+ priority: 100
13
+
14
+ genes:
15
+ hypothesis_driven:
16
+ description: Research must start with explicit hypotheses before investigation
17
+ codons:
18
+ - type: threshold
19
+ condition: "hypotheses_defined == true"
20
+ action: block
21
+ - type: attract
22
+ target: state_hypothesis_before_investigating
23
+ - type: repel
24
+ target: undirected_exploration
25
+
26
+ cross_verify:
27
+ description: Findings must be cross-verified by independent researchers
28
+ role: workflow_hint
29
+ codons:
30
+ - type: attract
31
+ target: independent_verification
32
+ - type: repel
33
+ target: single_source_conclusion
34
+
35
+ evidence_graded:
36
+ description: Grade evidence quality and distinguish fact from inference
37
+ role: workflow_hint
38
+ codons:
39
+ - type: attract
40
+ target: grade_source_reliability
41
+ - type: attract
42
+ target: separate_fact_from_interpretation
43
+ - type: repel
44
+ target: treat_all_evidence_equally
45
+
46
+ structured_synthesis:
47
+ description: Synthesis must address all hypotheses with evidence
48
+ codons:
49
+ - type: threshold
50
+ condition: "all_hypotheses_addressed == true"
51
+ action: escalate
52
+ - type: attract
53
+ target: evidence_based_conclusions
54
+
55
+ contexts: {}
56
+
57
+ roles:
58
+ lead_researcher:
59
+ description: Decomposes questions, synthesizes findings. Read-only.
60
+ tool_permissions:
61
+ allow: [Read, Grep, Glob, Bash]
62
+ deny: [Edit, Write, NotebookEdit]
63
+ scope:
64
+ read: ["**/*"]
65
+ write: []
66
+ instructions:
67
+ - Decompose the research question into sub-questions
68
+ - Formulate hypotheses for each sub-question
69
+ - After investigation synthesize findings across all researchers
70
+ - Grade overall confidence in conclusions
71
+ - Identify remaining unknowns and next steps
72
+
73
+ researcher:
74
+ description: Investigates specific sub-questions. Read-only with analysis tools.
75
+ tool_permissions:
76
+ allow: [Read, Grep, Glob, Bash]
77
+ deny: [Edit, Write, NotebookEdit]
78
+ scope:
79
+ read: ["**/*"]
80
+ write: []
81
+ instructions:
82
+ - Focus on assigned sub-question only
83
+ - State hypothesis before investigating
84
+ - Gather evidence from code, docs, logs, tests
85
+ - Grade each piece of evidence (strong/moderate/weak)
86
+ - Report findings with evidence quality ratings
87
+ - Flag uncertainties and assumptions explicitly
88
+
89
+ workflows:
90
+ research:
91
+ name: Research
92
+ description: "Parallel hypothesis research: decompose, investigate, verify, synthesize"
93
+ steps:
94
+ - id: decompose
95
+ role: lead_researcher
96
+ description: "Break research question into sub-questions with hypotheses."
97
+ prompt: |
98
+ Analyze the research question:
99
+ 1. Break into 2-4 independent sub-questions
100
+ 2. For each sub-question:
101
+ - Hypothesis: what do we expect to find?
102
+ - Key sources: where to look (code, docs, logs, external)
103
+ - Success criteria: what constitutes a sufficient answer?
104
+ 3. Identify dependencies between sub-questions
105
+ 4. Assign investigation priority
106
+
107
+ - id: investigate
108
+ role: researcher
109
+ depends_on: [decompose]
110
+ description: "Investigate sub-questions in parallel."
111
+ prompt: |
112
+ Investigate assigned sub-question:
113
+ 1. State the hypothesis clearly
114
+ 2. Gather evidence from identified sources
115
+ 3. For each evidence item:
116
+ - Source: where found
117
+ - Quality: strong / moderate / weak
118
+ - Supports or contradicts hypothesis?
119
+ 4. Preliminary conclusion with confidence level
120
+ 5. List remaining unknowns
121
+
122
+ - id: verify
123
+ role: lead_researcher
124
+ depends_on: [investigate]
125
+ description: "Cross-verify findings across researchers."
126
+ prompt: |
127
+ Cross-verification:
128
+ 1. Do different researchers' findings contradict?
129
+ 2. Are there gaps — sub-questions not fully answered?
130
+ 3. Check: is the evidence quality sufficient for conclusions?
131
+ 4. If contradictions exist: identify the most reliable source
132
+ 5. If gaps exist: note what additional investigation is needed
133
+
134
+ - id: synthesize
135
+ role: lead_researcher
136
+ depends_on: [verify]
137
+ description: "Synthesize all findings into conclusions."
138
+ prompt: |
139
+ Final synthesis:
140
+ 1. For each original sub-question: answer with evidence
141
+ 2. For each hypothesis: confirmed / refuted / inconclusive
142
+ 3. Overall conclusion with confidence level (high/medium/low)
143
+ 4. Key findings (bullet points)
144
+ 5. Remaining unknowns
145
+ 6. Recommended next steps (if any)