sequant 1.10.1 → 1.12.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 (63) hide show
  1. package/README.md +92 -3
  2. package/dist/bin/cli.js +55 -2
  3. package/dist/dashboard/server.d.ts +37 -0
  4. package/dist/dashboard/server.js +968 -0
  5. package/dist/src/commands/dashboard.d.ts +25 -0
  6. package/dist/src/commands/dashboard.js +44 -0
  7. package/dist/src/commands/doctor.d.ts +18 -1
  8. package/dist/src/commands/doctor.js +105 -2
  9. package/dist/src/commands/init.d.ts +1 -0
  10. package/dist/src/commands/init.js +26 -2
  11. package/dist/src/commands/run.d.ts +20 -0
  12. package/dist/src/commands/run.js +151 -3
  13. package/dist/src/commands/state.d.ts +60 -0
  14. package/dist/src/commands/state.js +267 -0
  15. package/dist/src/commands/stats.d.ts +3 -2
  16. package/dist/src/commands/stats.js +246 -38
  17. package/dist/src/commands/status.d.ts +2 -0
  18. package/dist/src/commands/status.js +28 -3
  19. package/dist/src/lib/ac-linter.d.ts +116 -0
  20. package/dist/src/lib/ac-linter.js +304 -0
  21. package/dist/src/lib/ac-parser.d.ts +61 -0
  22. package/dist/src/lib/ac-parser.js +156 -0
  23. package/dist/src/lib/fs.d.ts +19 -0
  24. package/dist/src/lib/fs.js +58 -1
  25. package/dist/src/lib/plugin-version-sync.d.ts +26 -0
  26. package/dist/src/lib/plugin-version-sync.js +91 -0
  27. package/dist/src/lib/project-name.d.ts +40 -0
  28. package/dist/src/lib/project-name.js +191 -0
  29. package/dist/src/lib/semgrep.d.ts +136 -0
  30. package/dist/src/lib/semgrep.js +406 -0
  31. package/dist/src/lib/settings.d.ts +7 -0
  32. package/dist/src/lib/settings.js +1 -0
  33. package/dist/src/lib/stacks.d.ts +14 -0
  34. package/dist/src/lib/stacks.js +159 -0
  35. package/dist/src/lib/system.d.ts +19 -0
  36. package/dist/src/lib/system.js +26 -0
  37. package/dist/src/lib/templates.d.ts +34 -1
  38. package/dist/src/lib/templates.js +117 -7
  39. package/dist/src/lib/workflow/metrics-schema.d.ts +153 -0
  40. package/dist/src/lib/workflow/metrics-schema.js +138 -0
  41. package/dist/src/lib/workflow/metrics-writer.d.ts +102 -0
  42. package/dist/src/lib/workflow/metrics-writer.js +189 -0
  43. package/dist/src/lib/workflow/state-manager.d.ts +18 -1
  44. package/dist/src/lib/workflow/state-manager.js +61 -1
  45. package/dist/src/lib/workflow/state-schema.d.ts +152 -1
  46. package/dist/src/lib/workflow/state-schema.js +99 -0
  47. package/dist/src/lib/workflow/state-utils.d.ts +67 -3
  48. package/dist/src/lib/workflow/state-utils.js +289 -8
  49. package/dist/src/lib/workflow/types.d.ts +2 -0
  50. package/dist/src/lib/workflow/types.js +1 -0
  51. package/package.json +5 -1
  52. package/templates/hooks/pre-tool.sh +6 -0
  53. package/templates/memory/constitution.md +1 -5
  54. package/templates/skills/_shared/references/prompt-templates.md +350 -0
  55. package/templates/skills/_shared/references/subagent-types.md +131 -0
  56. package/templates/skills/exec/SKILL.md +82 -0
  57. package/templates/skills/fullsolve/SKILL.md +19 -2
  58. package/templates/skills/loop/SKILL.md +3 -1
  59. package/templates/skills/qa/SKILL.md +79 -9
  60. package/templates/skills/qa/references/quality-gates.md +85 -1
  61. package/templates/skills/qa/references/semgrep-rules.md +207 -0
  62. package/templates/skills/qa/scripts/quality-checks.sh +54 -0
  63. package/templates/skills/spec/SKILL.md +215 -4
package/README.md CHANGED
@@ -9,12 +9,31 @@ Solve GitHub issues with structured phases and quality gates — from issue to m
9
9
 
10
10
  ## Quick Start
11
11
 
12
+ ### Option A: Install as Claude Code Plugin (Recommended)
13
+
14
+ ```bash
15
+ # Add the Sequant marketplace
16
+ /plugin marketplace add admarble/sequant
17
+
18
+ # Install the plugin
19
+ /plugin install sequant
20
+ ```
21
+
22
+ Then run setup:
23
+ ```
24
+ /sequant:setup # Initialize worktrees directory
25
+ ```
26
+
27
+ ### Option B: Install via npm
28
+
12
29
  ```bash
13
30
  # In your project directory
14
31
  npx sequant init
15
32
  npx sequant doctor # Verify setup
16
33
  ```
17
34
 
35
+ ### Start Using
36
+
18
37
  Then in Claude Code:
19
38
 
20
39
  ```
@@ -31,9 +50,20 @@ Or step-by-step:
31
50
 
32
51
  ### Prerequisites
33
52
 
53
+ **Required:**
34
54
  - [Claude Code](https://claude.ai/code) — AI coding assistant
35
55
  - [GitHub CLI](https://cli.github.com/) — run `gh auth login`
36
- - Node.js 18+ and Git
56
+ - Git (for worktree-based isolation)
57
+
58
+ **For npm installation:**
59
+ - Node.js 18+
60
+
61
+ **Optional MCP servers (enhanced features):**
62
+ - `chrome-devtools` — enables `/test` for browser-based UI testing
63
+ - `sequential-thinking` — enhanced reasoning for complex decisions
64
+ - `context7` — library documentation lookup
65
+
66
+ > **Note:** Sequant is optimized for Node.js/TypeScript projects. The worktree workflow works with any git repository.
37
67
 
38
68
  ---
39
69
 
@@ -52,6 +82,24 @@ Sequant adds slash commands to Claude Code that enforce a structured workflow:
52
82
 
53
83
  > `/test` is optional — used for UI features when Chrome DevTools MCP is available.
54
84
 
85
+ ### Worktree Isolation
86
+
87
+ Sequant uses Git worktrees to isolate each issue's work:
88
+
89
+ ```
90
+ your-project/ # Main repo (stays on main branch)
91
+ ../worktrees/
92
+ feature/
93
+ 123-add-login/ # Issue #123 worktree (feature branch)
94
+ 456-fix-bug/ # Issue #456 worktree (feature branch)
95
+ ```
96
+
97
+ **Why worktrees?**
98
+ - Work on multiple issues simultaneously
99
+ - Never pollute your main branch
100
+ - Each issue has its own dependencies and build
101
+ - Safe to discard failed experiments
102
+
55
103
  ### Quality Gates
56
104
 
57
105
  Every `/qa` runs automated checks:
@@ -59,7 +107,11 @@ Every `/qa` runs automated checks:
59
107
  - **AC Adherence** — Code verified against acceptance criteria
60
108
  - **Type Safety** — Detects `any`, `as any`, missing types
61
109
  - **Security Scans** — OWASP-style vulnerability detection
110
+ - **Semgrep Static Analysis** — Stack-aware rulesets, custom rules via `.sequant/semgrep-rules.yaml`
62
111
  - **Scope Analysis** — Flags changes outside issue scope
112
+ - **Execution Evidence** — Scripts/CLI must pass smoke tests
113
+ - **Test Quality** — Validates test coverage and mock hygiene
114
+ - **Anti-Pattern Detection** — Catches N+1 queries, empty catch blocks, stale dependencies
63
115
 
64
116
  When checks fail, `/loop` automatically fixes and re-runs (up to 3x).
65
117
 
@@ -112,9 +164,9 @@ npx sequant run 123 --base feature/dashboard # Custom base branch
112
164
 
113
165
  | Command | Purpose |
114
166
  |---------|---------|
115
- | `/merger` | Multi-issue integration and merge |
116
167
  | `/testgen` | Generate test stubs from spec |
117
168
  | `/verify` | CLI/script execution verification |
169
+ | `/setup` | Initialize Sequant in a project |
118
170
 
119
171
  ### Utilities
120
172
 
@@ -123,6 +175,7 @@ npx sequant run 123 --base feature/dashboard # Custom base branch
123
175
  | `/assess` | Issue triage and status assessment |
124
176
  | `/docs` | Generate feature documentation |
125
177
  | `/clean` | Repository cleanup |
178
+ | `/improve` | Codebase analysis and improvement discovery |
126
179
  | `/security-review` | Deep security analysis |
127
180
  | `/reflect` | Workflow improvement analysis |
128
181
 
@@ -136,9 +189,12 @@ npx sequant update # Update skill templates
136
189
  npx sequant doctor # Check installation
137
190
  npx sequant status # Show version and config
138
191
  npx sequant run <issues...> # Execute workflow
192
+ npx sequant state <cmd> # Manage workflow state (init/rebuild/clean)
193
+ npx sequant stats # View local workflow analytics
194
+ npx sequant dashboard # Launch real-time workflow dashboard
139
195
  ```
140
196
 
141
- See [Run Command Options](docs/run-command.md) for advanced usage.
197
+ See [Run Command Options](docs/run-command.md), [State Command](docs/state-command.md), and [Analytics](docs/analytics.md) for details.
142
198
 
143
199
  ---
144
200
 
@@ -173,16 +229,49 @@ See [Customization Guide](docs/customization.md) for all options.
173
229
  ## Documentation
174
230
 
175
231
  - [Getting Started](docs/getting-started/installation.md)
232
+ - [What We've Built](docs/what-weve-built.md) — Comprehensive project overview
176
233
  - [Workflow Concepts](docs/concepts/workflow-phases.md)
177
234
  - [Run Command](docs/run-command.md)
178
235
  - [Feature Branch Workflows](docs/feature-branch-workflow.md)
179
236
  - [Customization](docs/customization.md)
237
+ - [Plugin Updates & Versioning](docs/plugin-updates.md)
180
238
  - [Troubleshooting](docs/troubleshooting.md)
181
239
 
182
240
  Stack guides: [Next.js](docs/stacks/nextjs.md) · [Rust](docs/stacks/rust.md) · [Python](docs/stacks/python.md) · [Go](docs/stacks/go.md)
183
241
 
184
242
  ---
185
243
 
244
+ ## Feedback & Contributing
245
+
246
+ ### Reporting Issues
247
+
248
+ - **Plugin issues:** [Plugin Feedback template](https://github.com/admarble/sequant/issues/new?template=plugin-feedback.yml)
249
+ - **Bug reports:** [Bug template](https://github.com/admarble/sequant/issues/new?template=bug.yml)
250
+ - **Feature requests:** [Feature template](https://github.com/admarble/sequant/issues/new?template=feature.yml)
251
+ - **Questions:** [GitHub Discussions](https://github.com/admarble/sequant/discussions)
252
+
253
+ ### Using `/improve` for Feedback
254
+
255
+ Run `/improve` in Claude Code to analyze your codebase and create structured issues:
256
+
257
+ ```
258
+ /improve # Analyze entire codebase
259
+ /improve security # Focus on security concerns
260
+ /improve tests # Find test coverage gaps
261
+ ```
262
+
263
+ The skill will present findings and offer to create GitHub issues automatically.
264
+
265
+ ### Contributing
266
+
267
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
268
+
269
+ ### Telemetry
270
+
271
+ Sequant does not collect any usage telemetry. See [docs/telemetry.md](docs/telemetry.md) for details.
272
+
273
+ ---
274
+
186
275
  ## License
187
276
 
188
277
  MIT
package/dist/bin/cli.js CHANGED
@@ -39,6 +39,8 @@ import { statusCommand } from "../src/commands/status.js";
39
39
  import { runCommand } from "../src/commands/run.js";
40
40
  import { logsCommand } from "../src/commands/logs.js";
41
41
  import { statsCommand } from "../src/commands/stats.js";
42
+ import { dashboardCommand } from "../src/commands/dashboard.js";
43
+ import { stateInitCommand, stateRebuildCommand, stateCleanCommand, } from "../src/commands/state.js";
42
44
  const program = new Command();
43
45
  // Handle --no-color before parsing
44
46
  if (process.argv.includes("--no-color")) {
@@ -64,6 +66,7 @@ program
64
66
  .option("-f, --force", "Overwrite existing configuration")
65
67
  .option("-i, --interactive", "Force interactive mode even in non-TTY environment")
66
68
  .option("--skip-setup", "Skip the dependency setup wizard")
69
+ .option("--no-symlinks", "Use copies instead of symlinks for scripts/dev/ files")
67
70
  .action(initCommand);
68
71
  program
69
72
  .command("update")
@@ -74,11 +77,26 @@ program
74
77
  program
75
78
  .command("doctor")
76
79
  .description("Check your Sequant installation for issues")
80
+ .option("--skip-issue-check", "Skip closed-issue verification check")
77
81
  .action(doctorCommand);
78
82
  program
79
83
  .command("status")
80
- .description("Show Sequant version and configuration status")
81
- .action(statusCommand);
84
+ .description("Show Sequant version, configuration, and workflow state")
85
+ .argument("[issue]", "Issue number to show details for", parseInt)
86
+ .option("--issues", "Show all tracked issues")
87
+ .option("--json", "Output as JSON")
88
+ .option("--rebuild", "Rebuild state from run logs")
89
+ .option("--cleanup", "Clean up stale/orphaned entries")
90
+ .option("--dry-run", "Preview cleanup without changes")
91
+ .option("--max-age <days>", "Remove entries older than N days", parseInt)
92
+ .option("--all", "Remove all orphaned entries (merged and abandoned)")
93
+ .action((issue, options) => {
94
+ // Support positional arg: `sequant status 42` → --issue 42
95
+ if (issue) {
96
+ options.issue = issue;
97
+ }
98
+ return statusCommand(options);
99
+ });
82
100
  program
83
101
  .command("run")
84
102
  .description("Execute workflow for GitHub issues using Claude Agent SDK")
@@ -99,7 +117,9 @@ program
99
117
  .option("--testgen", "Run testgen phase after spec")
100
118
  .option("--quiet", "Suppress version warnings and non-essential output")
101
119
  .option("--chain", "Chain issues: each branches from previous (requires --sequential)")
120
+ .option("--qa-gate", "Wait for QA pass before starting next issue in chain (requires --chain)")
102
121
  .option("--base <branch>", "Base branch for worktree creation (default: main or settings.run.defaultBase)")
122
+ .option("--no-mcp", "Disable MCP server injection in headless mode")
103
123
  .action(runCommand);
104
124
  program
105
125
  .command("logs")
@@ -119,6 +139,39 @@ program
119
139
  .option("--csv", "Output as CSV")
120
140
  .option("--json", "Output as JSON")
121
141
  .action(statsCommand);
142
+ program
143
+ .command("dashboard")
144
+ .description("Start visual workflow dashboard in browser")
145
+ .option("-p, --port <port>", "Port to run server on", parseInt)
146
+ .option("--no-open", "Don't automatically open browser")
147
+ .option("-v, --verbose", "Enable verbose logging")
148
+ .action(dashboardCommand);
149
+ // State management command with subcommands
150
+ const stateCmd = program
151
+ .command("state")
152
+ .description("Manage workflow state for worktrees");
153
+ stateCmd
154
+ .command("init")
155
+ .description("Populate state for untracked worktrees")
156
+ .option("--json", "Output as JSON")
157
+ .option("-v, --verbose", "Enable verbose output")
158
+ .action(stateInitCommand);
159
+ stateCmd
160
+ .command("rebuild")
161
+ .description("Recreate state from logs and worktrees")
162
+ .option("--json", "Output as JSON")
163
+ .option("-v, --verbose", "Enable verbose output")
164
+ .option("-f, --force", "Force rebuild without confirmation")
165
+ .action(stateRebuildCommand);
166
+ stateCmd
167
+ .command("clean")
168
+ .description("Remove entries for deleted worktrees")
169
+ .option("--json", "Output as JSON")
170
+ .option("-v, --verbose", "Enable verbose output")
171
+ .option("-d, --dry-run", "Preview cleanup without changes")
172
+ .option("--max-age <days>", "Remove entries older than N days", parseInt)
173
+ .option("--all", "Remove all orphaned entries (merged and abandoned)")
174
+ .action(stateCleanCommand);
122
175
  // Parse and execute
123
176
  program.parse();
124
177
  // Show help if no command provided
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Sequant Dashboard Server
3
+ *
4
+ * A lightweight web dashboard for visualizing workflow state using:
5
+ * - Hono: Fast, lightweight web framework
6
+ * - htmx: HTML-first interactivity
7
+ * - Pico CSS: Classless styling
8
+ * - SSE: Server-sent events for live updates
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { startDashboard } from './server';
13
+ * await startDashboard({ port: 3456, open: true });
14
+ * ```
15
+ */
16
+ import { Hono } from "hono";
17
+ import { StateManager } from "../src/lib/workflow/state-manager.js";
18
+ export interface DashboardOptions {
19
+ /** Port to run the server on (default: 3456) */
20
+ port?: number;
21
+ /** Whether to open browser automatically (default: true) */
22
+ open?: boolean;
23
+ /** Custom state file path */
24
+ statePath?: string;
25
+ /** Enable verbose logging */
26
+ verbose?: boolean;
27
+ }
28
+ /**
29
+ * Create the Hono app
30
+ */
31
+ export declare function createApp(stateManager: StateManager): Hono;
32
+ /**
33
+ * Start the dashboard server
34
+ */
35
+ export declare function startDashboard(options?: DashboardOptions): Promise<{
36
+ close: () => void;
37
+ }>;