sequant 2.1.2 → 2.3.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 (146) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +73 -0
  4. package/dist/bin/cli.js +95 -9
  5. package/dist/src/commands/doctor.d.ts +25 -0
  6. package/dist/src/commands/doctor.js +36 -1
  7. package/dist/src/commands/init.d.ts +1 -0
  8. package/dist/src/commands/init.js +118 -0
  9. package/dist/src/commands/locks.d.ts +67 -0
  10. package/dist/src/commands/locks.js +290 -0
  11. package/dist/src/commands/merge.js +11 -0
  12. package/dist/src/commands/prompt.d.ts +39 -0
  13. package/dist/src/commands/prompt.js +179 -0
  14. package/dist/src/commands/run-display.d.ts +26 -0
  15. package/dist/src/commands/run-display.js +150 -0
  16. package/dist/src/commands/run-progress.d.ts +32 -0
  17. package/dist/src/commands/run-progress.js +76 -0
  18. package/dist/src/commands/run.js +83 -73
  19. package/dist/src/commands/stats.d.ts +2 -0
  20. package/dist/src/commands/stats.js +94 -8
  21. package/dist/src/commands/status.js +27 -1
  22. package/dist/src/commands/watch.d.ts +16 -0
  23. package/dist/src/commands/watch.js +147 -0
  24. package/dist/src/lib/ac-linter.d.ts +1 -1
  25. package/dist/src/lib/ac-linter.js +81 -0
  26. package/dist/src/lib/assess-collision-detect.d.ts +91 -0
  27. package/dist/src/lib/assess-collision-detect.js +217 -0
  28. package/dist/src/lib/assess-comment-parser.d.ts +59 -1
  29. package/dist/src/lib/assess-comment-parser.js +124 -2
  30. package/dist/src/lib/cli-ui/format.d.ts +19 -0
  31. package/dist/src/lib/cli-ui/format.js +34 -0
  32. package/dist/src/lib/cli-ui/run-renderer-types.d.ts +181 -0
  33. package/dist/src/lib/cli-ui/run-renderer-types.js +7 -0
  34. package/dist/src/lib/cli-ui/run-renderer.d.ts +239 -0
  35. package/dist/src/lib/cli-ui/run-renderer.js +1173 -0
  36. package/dist/src/lib/heuristics/behavior-rule-detector.d.ts +94 -0
  37. package/dist/src/lib/heuristics/behavior-rule-detector.js +467 -0
  38. package/dist/src/lib/locks/index.d.ts +7 -0
  39. package/dist/src/lib/locks/index.js +5 -0
  40. package/dist/src/lib/locks/lock-manager.d.ts +168 -0
  41. package/dist/src/lib/locks/lock-manager.js +433 -0
  42. package/dist/src/lib/locks/types.d.ts +59 -0
  43. package/dist/src/lib/locks/types.js +31 -0
  44. package/dist/src/lib/qa/markdown-only-ci.d.ts +46 -0
  45. package/dist/src/lib/qa/markdown-only-ci.js +74 -0
  46. package/dist/src/lib/relay/activation.d.ts +60 -0
  47. package/dist/src/lib/relay/activation.js +122 -0
  48. package/dist/src/lib/relay/archive.d.ts +34 -0
  49. package/dist/src/lib/relay/archive.js +106 -0
  50. package/dist/src/lib/relay/frame.d.ts +20 -0
  51. package/dist/src/lib/relay/frame.js +76 -0
  52. package/dist/src/lib/relay/index.d.ts +13 -0
  53. package/dist/src/lib/relay/index.js +13 -0
  54. package/dist/src/lib/relay/paths.d.ts +43 -0
  55. package/dist/src/lib/relay/paths.js +59 -0
  56. package/dist/src/lib/relay/pid.d.ts +34 -0
  57. package/dist/src/lib/relay/pid.js +72 -0
  58. package/dist/src/lib/relay/reader.d.ts +35 -0
  59. package/dist/src/lib/relay/reader.js +115 -0
  60. package/dist/src/lib/relay/types.d.ts +68 -0
  61. package/dist/src/lib/relay/types.js +76 -0
  62. package/dist/src/lib/relay/writer.d.ts +48 -0
  63. package/dist/src/lib/relay/writer.js +113 -0
  64. package/dist/src/lib/settings.d.ts +31 -1
  65. package/dist/src/lib/settings.js +18 -3
  66. package/dist/src/lib/skill-version.d.ts +19 -0
  67. package/dist/src/lib/skill-version.js +68 -0
  68. package/dist/src/lib/templates.d.ts +1 -0
  69. package/dist/src/lib/templates.js +1 -1
  70. package/dist/src/lib/version-check.d.ts +60 -5
  71. package/dist/src/lib/version-check.js +97 -9
  72. package/dist/src/lib/workflow/batch-executor.d.ts +20 -1
  73. package/dist/src/lib/workflow/batch-executor.js +249 -176
  74. package/dist/src/lib/workflow/config-resolver.js +4 -0
  75. package/dist/src/lib/workflow/heartbeat.d.ts +71 -0
  76. package/dist/src/lib/workflow/heartbeat.js +194 -0
  77. package/dist/src/lib/workflow/phase-executor.d.ts +88 -3
  78. package/dist/src/lib/workflow/phase-executor.js +276 -52
  79. package/dist/src/lib/workflow/phase-mapper.d.ts +3 -2
  80. package/dist/src/lib/workflow/phase-mapper.js +17 -20
  81. package/dist/src/lib/workflow/platforms/github.d.ts +1 -1
  82. package/dist/src/lib/workflow/platforms/github.js +20 -3
  83. package/dist/src/lib/workflow/pr-status.d.ts +18 -2
  84. package/dist/src/lib/workflow/pr-status.js +41 -9
  85. package/dist/src/lib/workflow/qa-stagnation.d.ts +117 -0
  86. package/dist/src/lib/workflow/qa-stagnation.js +179 -0
  87. package/dist/src/lib/workflow/run-orchestrator.d.ts +76 -0
  88. package/dist/src/lib/workflow/run-orchestrator.js +382 -29
  89. package/dist/src/lib/workflow/run-reflect.js +1 -1
  90. package/dist/src/lib/workflow/run-state.d.ts +71 -0
  91. package/dist/src/lib/workflow/run-state.js +14 -0
  92. package/dist/src/lib/workflow/state-cleanup.d.ts +13 -5
  93. package/dist/src/lib/workflow/state-cleanup.js +17 -5
  94. package/dist/src/lib/workflow/state-manager.d.ts +12 -1
  95. package/dist/src/lib/workflow/state-manager.js +37 -0
  96. package/dist/src/lib/workflow/state-schema.d.ts +62 -0
  97. package/dist/src/lib/workflow/state-schema.js +35 -1
  98. package/dist/src/lib/workflow/types.d.ts +74 -1
  99. package/dist/src/lib/workflow/worktree-manager.d.ts +12 -4
  100. package/dist/src/lib/workflow/worktree-manager.js +76 -17
  101. package/dist/src/mcp/tools/run.d.ts +44 -0
  102. package/dist/src/mcp/tools/run.js +104 -13
  103. package/dist/src/ui/tui/App.d.ts +14 -0
  104. package/dist/src/ui/tui/App.js +41 -0
  105. package/dist/src/ui/tui/ElapsedTimer.d.ts +10 -0
  106. package/dist/src/ui/tui/ElapsedTimer.js +31 -0
  107. package/dist/src/ui/tui/Header.d.ts +6 -0
  108. package/dist/src/ui/tui/Header.js +15 -0
  109. package/dist/src/ui/tui/IssueBox.d.ts +16 -0
  110. package/dist/src/ui/tui/IssueBox.js +68 -0
  111. package/dist/src/ui/tui/Spinner.d.ts +9 -0
  112. package/dist/src/ui/tui/Spinner.js +18 -0
  113. package/dist/src/ui/tui/index.d.ts +15 -0
  114. package/dist/src/ui/tui/index.js +29 -0
  115. package/dist/src/ui/tui/theme.d.ts +29 -0
  116. package/dist/src/ui/tui/theme.js +52 -0
  117. package/dist/src/ui/tui/truncate.d.ts +11 -0
  118. package/dist/src/ui/tui/truncate.js +31 -0
  119. package/package.json +10 -3
  120. package/templates/agents/sequant-explorer.md +1 -0
  121. package/templates/agents/sequant-qa-checker.md +2 -1
  122. package/templates/agents/sequant-testgen.md +1 -0
  123. package/templates/hooks/post-tool.sh +11 -0
  124. package/templates/hooks/pre-tool.sh +18 -9
  125. package/templates/hooks/relay-check.sh +107 -0
  126. package/templates/relay/frame.txt +11 -0
  127. package/templates/scripts/cleanup-worktree.sh +25 -3
  128. package/templates/scripts/new-feature.sh +6 -0
  129. package/templates/skills/_shared/references/behavior-rule-detection.md +205 -0
  130. package/templates/skills/_shared/references/subagent-types.md +21 -8
  131. package/templates/skills/assess/SKILL.md +261 -94
  132. package/templates/skills/assess/references/predicted-collision-detection.md +109 -0
  133. package/templates/skills/docs/SKILL.md +141 -22
  134. package/templates/skills/exec/SKILL.md +10 -49
  135. package/templates/skills/fullsolve/SKILL.md +80 -32
  136. package/templates/skills/loop/SKILL.md +28 -0
  137. package/templates/skills/merger/SKILL.md +621 -0
  138. package/templates/skills/qa/SKILL.md +746 -8
  139. package/templates/skills/qa/scripts/quality-checks.sh +47 -1
  140. package/templates/skills/setup/SKILL.md +6 -0
  141. package/templates/skills/spec/SKILL.md +217 -964
  142. package/templates/skills/spec/references/parallel-groups.md +7 -0
  143. package/templates/skills/spec/references/quality-checklist.md +75 -0
  144. package/templates/skills/spec/references/recommended-workflow.md +4 -2
  145. package/templates/skills/test/SKILL.md +0 -27
  146. package/templates/skills/testgen/SKILL.md +24 -44
@@ -25,6 +25,13 @@ When the implementation involves 3+ independent tasks that could be parallelized
25
25
 
26
26
  ## Model Selection
27
27
 
28
+ > **Note:** Per anthropics/claude-code#43869, the `[model: ...]` annotation
29
+ > below and the `model=` parameter `/exec` passes to `Agent(...)` are currently
30
+ > ignored — every spawned subagent inherits the parent session's model. The
31
+ > guidance here reflects the *intended* tier for each task once upstream fixes
32
+ > ship; the parser in `exec/SKILL.md` is kept intact so it reactivates
33
+ > automatically.
34
+
28
35
  Include a `[model: haiku]` or `[model: sonnet]` annotation at the end of each task line:
29
36
 
30
37
  | Task Type | Recommended Model |
@@ -0,0 +1,75 @@
1
+ # Feature Quality Planning — Full Checklist
2
+
3
+ Use this checklist for **Complex** tier issues or when the exception-based summary in SKILL.md flags significant gaps. For Simple/Standard tiers, the exception-based approach in the main prompt is sufficient.
4
+
5
+ ## Section Applicability
6
+
7
+ | Issue Type | Sections Required |
8
+ |------------|-------------------|
9
+ | Bug fix | Completeness, Error Handling, Test Coverage |
10
+ | New feature | All sections |
11
+ | Refactor | Completeness, Code Quality, Test Coverage |
12
+ | UI change | All sections including Polish |
13
+ | Backend/API | Completeness, Error Handling, Code Quality, Test Coverage, Best Practices |
14
+ | CLI/Script | Completeness, Error Handling, Test Coverage, Best Practices |
15
+ | Docs only | Completeness only |
16
+
17
+ ## Completeness Check
18
+
19
+ - [ ] All AC items have corresponding implementation steps
20
+ - [ ] Integration points with existing features identified
21
+ - [ ] No partial implementations or TODOs planned
22
+ - [ ] State management considered (if applicable)
23
+ - [ ] Data flow is complete end-to-end
24
+
25
+ ## Error Handling
26
+
27
+ - [ ] Invalid input scenarios identified
28
+ - [ ] API/external service failures handled
29
+ - [ ] Edge cases documented (empty, null, max values)
30
+ - [ ] Error messages are user-friendly
31
+ - [ ] Graceful degradation planned
32
+
33
+ ## Code Quality
34
+
35
+ - [ ] Types fully defined (no `any` planned)
36
+ - [ ] Follows existing patterns in codebase
37
+ - [ ] Error boundaries where needed
38
+ - [ ] No magic strings/numbers
39
+ - [ ] Consistent naming conventions
40
+
41
+ ## Test Coverage Plan
42
+
43
+ - [ ] Unit tests for business logic
44
+ - [ ] Integration tests for data flow
45
+ - [ ] Edge case tests identified
46
+ - [ ] Mocking strategy appropriate
47
+ - [ ] Critical paths have test coverage
48
+
49
+ ## Best Practices
50
+
51
+ - [ ] Logging for debugging/observability
52
+ - [ ] Accessibility considerations (if UI)
53
+ - [ ] Performance implications considered
54
+ - [ ] Security reviewed (auth, validation, sanitization)
55
+ - [ ] Documentation updated (if behavior changes)
56
+
57
+ ## Polish (UI features only)
58
+
59
+ - [ ] Loading states planned
60
+ - [ ] Error states have UI
61
+ - [ ] Empty states handled
62
+ - [ ] Responsive design considered
63
+ - [ ] Keyboard navigation works
64
+
65
+ ## Derived ACs
66
+
67
+ Based on quality planning, identify additional ACs:
68
+
69
+ | Source | Derived AC | Priority |
70
+ |--------|-----------|----------|
71
+ | Error Handling | AC-N: Handle [specific error] with [specific response] | High/Medium/Low |
72
+ | Test Coverage | AC-N+1: Add tests for [specific scenario] | High/Medium/Low |
73
+ | Best Practices | AC-N+2: Add logging for [specific operation] | High/Medium/Low |
74
+
75
+ Derived ACs are numbered sequentially after original ACs.
@@ -14,16 +14,18 @@ This document shows the expected output format for the `## Recommended Workflow`
14
14
 
15
15
  ## Examples
16
16
 
17
- ### Simple Bug Fix
17
+ ### Simple Bug Fix (spec confirms straightforward scope)
18
18
 
19
19
  ```markdown
20
20
  ## Recommended Workflow
21
21
 
22
22
  **Phases:** exec → qa
23
23
  **Quality Loop:** disabled
24
- **Reasoning:** Straightforward bug fix with clear root cause. No planning needed.
24
+ **Reasoning:** This spec pass confirmed a clear root cause and narrow scope — no testgen or additional phases required; proceed to exec.
25
25
  ```
26
26
 
27
+ *Note:* Since #533, spec always runs by default. `**Phases:**` lists phases **after** spec — use `exec → qa` here to indicate "spec is done; only exec and qa remain."
28
+
27
29
  ### Standard Feature
28
30
 
29
31
  ```markdown
@@ -805,33 +805,6 @@ Both can be used together:
805
805
 
806
806
  ---
807
807
 
808
- ## State Tracking
809
-
810
- **IMPORTANT:** Update workflow state when running standalone (not orchestrated).
811
-
812
- ### State Updates (Standalone Only)
813
-
814
- When NOT orchestrated (`SEQUANT_ORCHESTRATOR` is not set):
815
-
816
- **At skill start:**
817
- ```bash
818
- npx tsx scripts/state/update.ts start <issue-number> test
819
- ```
820
-
821
- **On successful completion:**
822
- ```bash
823
- npx tsx scripts/state/update.ts complete <issue-number> test
824
- ```
825
-
826
- **On failure:**
827
- ```bash
828
- npx tsx scripts/state/update.ts fail <issue-number> test "X/Y tests failed"
829
- ```
830
-
831
- **Why this matters:** State tracking enables dashboard visibility, resume capability, and workflow orchestration. Skills update state when standalone; orchestrators handle state when running workflows.
832
-
833
- ---
834
-
835
808
  ## Output Verification
836
809
 
837
810
  **Before responding, verify your output includes ALL of these:**
@@ -39,9 +39,16 @@ When invoked as `/testgen <issue-number>`, your job is to:
39
39
  - `/testgen 123` - Generate test stubs for issue #123 based on /spec comment
40
40
  - `/testgen` - Generate stubs for the most recently discussed issue in conversation
41
41
 
42
- ## Token Optimization with Haiku Sub-Agents
42
+ ## Sub-Agent Delegation for Stub Generation
43
43
 
44
- **Purpose:** Test stub generation is highly mechanical and benefits from using haiku sub-agents to minimize token cost.
44
+ **Purpose:** Test stub generation is highly mechanical and is delegated to `sequant-testgen` so the main agent focuses on orchestration.
45
+
46
+ > **Upstream caveat:** `sequant-testgen` declares `model: haiku`, but per
47
+ > anthropics/claude-code#43869 that declaration is currently ignored — the
48
+ > subagent inherits the parent session's model. Older versions of this doc
49
+ > claimed concrete token-cost savings from haiku. Those numbers are not
50
+ > achievable until the upstream fix ships; treat the haiku claim as the
51
+ > *intended* tier, not the runtime one.
45
52
 
46
53
  **Pattern:** Use `Agent(subagent_type="sequant-testgen")` for:
47
54
  1. Parsing verification criteria from /spec comments
@@ -49,13 +56,12 @@ When invoked as `/testgen <issue-number>`, your job is to:
49
56
  3. Writing test file content
50
57
 
51
58
  **Benefits:**
52
- - 90% token cost reduction for mechanical generation
53
- - Faster execution for templated operations
54
- - Main agent focuses on orchestration and decisions
59
+ - Main agent focuses on orchestration and decisions, not stub templating
60
+ - Designated tier (`haiku`) will yield token savings once anthropics/claude-code#43869 is fixed; today subagents inherit the parent's model
55
61
 
56
62
  ### Sub-Agent Usage
57
63
 
58
- **Step 1: Parse Verification Criteria (use haiku)**
64
+ **Step 1: Parse Verification Criteria (designated haiku — currently inert per anthropics/claude-code#43869)**
59
65
 
60
66
  ```javascript
61
67
  Agent(subagent_type="sequant-testgen", prompt=`
@@ -87,7 +93,7 @@ ${specComment}
87
93
  `)
88
94
  ```
89
95
 
90
- **Step 2: Generate Test Stubs (use haiku for each AC)**
96
+ **Step 2: Generate Test Stubs (designated haiku currently inert per anthropics/claude-code#43869)**
91
97
 
92
98
  ```javascript
93
99
  // For each AC with Unit Test or Integration Test verification method
@@ -122,16 +128,16 @@ The main agent handles file operations to ensure proper coordination:
122
128
 
123
129
  | Task | Agent | Reasoning |
124
130
  |------|-------|-----------|
125
- | Parse /spec comment | haiku | Mechanical text extraction |
126
- | Generate test stub code | haiku | Templated generation |
127
- | Identify failure scenarios | haiku | Pattern matching |
131
+ | Parse /spec comment | `sequant-testgen` (declared haiku, inert per #43869) | Mechanical text extraction |
132
+ | Generate test stub code | `sequant-testgen` (declared haiku, inert per #43869) | Templated generation |
133
+ | Identify failure scenarios | `sequant-testgen` (declared haiku, inert per #43869) | Pattern matching |
128
134
  | Decide file locations | main | Requires codebase context |
129
135
  | Write files | main | File system coordination |
130
136
  | Post GitHub comment | main | Session context needed |
131
137
 
132
138
  ### Parallel Sub-Agent Execution
133
139
 
134
- When multiple ACs need test stubs, spawn haiku agents in parallel:
140
+ When multiple ACs need test stubs, spawn `sequant-testgen` agents in parallel (declared haiku tier, currently inert per anthropics/claude-code#43869):
135
141
 
136
142
  ```javascript
137
143
  // Spawn all stub generation agents in a single message
@@ -143,11 +149,12 @@ const stubPromises = criteria
143
149
  // Main agent writes all files
144
150
  ```
145
151
 
146
- **Cost savings example:**
147
- - 5 AC items with Unit Test verification
148
- - Without haiku: ~50K tokens (main agent generates all)
149
- - With haiku: ~5K tokens (main orchestrates, haiku generates)
150
- - Savings: ~90%
152
+ **Cost savings (when upstream lands):**
153
+ Once anthropics/claude-code#43869 is fixed and the declared haiku tier takes
154
+ effect, delegating mechanical stub generation to `sequant-testgen` will
155
+ substantially reduce token cost vs. having the main agent generate every stub.
156
+ Concrete savings are not measured here because the declaration is currently
157
+ inert.
151
158
 
152
159
  ## Workflow
153
160
 
@@ -626,7 +633,7 @@ Cannot generate test files - no feature worktree exists for Issue #<N>.
626
633
 
627
634
  **Options:**
628
635
  1. Run `/exec <issue>` first (creates worktree automatically)
629
- 2. Create worktree manually: `./scripts/dev/new-feature.sh <issue>`
636
+ 2. Create worktree manually: `./scripts/new-feature.sh <issue>`
630
637
  3. Use the browser/manual test scenarios from this comment
631
638
  ```
632
639
 
@@ -672,33 +679,6 @@ Generated with [Claude Code](https://claude.com/claude-code)
672
679
 
673
680
  ---
674
681
 
675
- ## State Tracking
676
-
677
- **IMPORTANT:** Update workflow state when running standalone (not orchestrated).
678
-
679
- ### State Updates (Standalone Only)
680
-
681
- When NOT orchestrated (`SEQUANT_ORCHESTRATOR` is not set):
682
-
683
- **At skill start:**
684
- ```bash
685
- npx tsx scripts/state/update.ts start <issue-number> testgen
686
- ```
687
-
688
- **On successful completion:**
689
- ```bash
690
- npx tsx scripts/state/update.ts complete <issue-number> testgen
691
- ```
692
-
693
- **On failure:**
694
- ```bash
695
- npx tsx scripts/state/update.ts fail <issue-number> testgen "Failed to generate test stubs"
696
- ```
697
-
698
- **Note:** `/testgen` is an optional skill that generates test stubs. State tracking is informational - it doesn't block subsequent phases.
699
-
700
- ---
701
-
702
682
  ## Output Verification
703
683
 
704
684
  **Before responding, verify your output includes ALL of these:**