@jabworks/condux 0.2.0 → 0.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 (48) hide show
  1. package/README.md +27 -29
  2. package/index.js +21 -0
  3. package/package.json +6 -4
  4. package/skills/code-review/SKILL.md +136 -0
  5. package/skills/code-review/evals/trigger_eval.json +22 -0
  6. package/skills/discovery/SKILL.md +242 -0
  7. package/skills/discovery/evals/trigger_eval.json +24 -0
  8. package/skills/discovery/references/choice-server.js +216 -0
  9. package/skills/discovery/references/mockup-picker.md +90 -0
  10. package/skills/discovery/references/package.json +3 -0
  11. package/skills/draft-plan/SKILL.md +229 -0
  12. package/skills/draft-plan/evals/trigger_eval.json +22 -0
  13. package/skills/draft-plan/references/plan-template.md +96 -0
  14. package/skills/finalize/SKILL.md +123 -0
  15. package/skills/finalize/evals/trigger_eval.json +22 -0
  16. package/skills/finalize/references/rationalization-table.md +15 -0
  17. package/skills/plan-review/SKILL.md +215 -0
  18. package/skills/plan-review/evals/trigger_eval.json +22 -0
  19. package/skills/plan-review/references/annotate-server.js +465 -0
  20. package/skills/plan-review/references/install-codex-hook.sh +112 -0
  21. package/skills/plan-review/references/package.json +3 -0
  22. package/skills/plan-review/references/plan-review-template.html +730 -0
  23. package/skills/preflight/SKILL.md +128 -0
  24. package/skills/preflight/evals/trigger_eval.json +26 -0
  25. package/skills/root-cause-analysis/SKILL.md +82 -0
  26. package/skills/root-cause-analysis/evals/trigger_eval.json +22 -0
  27. package/skills/subagent-deployment/SKILL.md +105 -0
  28. package/skills/subagent-deployment/evals/trigger_eval.json +22 -0
  29. package/skills/subagent-deployment/references/safety-checklist.md +54 -0
  30. package/skills/subagent-execution/SKILL.md +182 -0
  31. package/skills/subagent-execution/agents/coder.md +55 -0
  32. package/skills/subagent-execution/agents/explorer.md +77 -0
  33. package/skills/subagent-execution/agents/planner.md +101 -0
  34. package/skills/subagent-execution/agents/researcher.md +78 -0
  35. package/skills/subagent-execution/evals/trigger_eval.json +22 -0
  36. package/skills/subagent-execution/references/install-codex-agents.mjs +98 -0
  37. package/skills/subagent-execution/references/review-package.sh +29 -0
  38. package/skills/subagent-execution/references/spawn-rules.md +88 -0
  39. package/skills/subagent-execution/references/task-brief.sh +39 -0
  40. package/skills/technical-spec/SKILL.md +190 -0
  41. package/skills/technical-spec/evals/trigger_eval.json +23 -0
  42. package/skills/technical-spec/references/scaffold.sh +98 -0
  43. package/skills/technical-spec/references/templates.md +159 -0
  44. package/skills/test-first-development/SKILL.md +121 -0
  45. package/skills/test-first-development/evals/trigger_eval.json +22 -0
  46. package/skills/test-first-development/references/rationalization-table.md +16 -0
  47. package/skills/workflow/SKILL.md +241 -0
  48. package/skills/workflow/evals/trigger_eval.json +30 -0
@@ -0,0 +1,241 @@
1
+ ---
2
+ name: workflow
3
+ description: "Routes any dev task into the right execution tier (Small/Medium/Large) and carries condux's operating rules — proportional effort, lazy skill loading, soft gates, implement-yourself-by-default. Confirms the tier with the user, then executes the matching flow, loading downstream skills only when a step needs them. Trigger with any implementation request — feature, bug fix, refactor, new endpoint, UI change. Every dev task starts here; other skills execute within /workflow, not instead of it. Also the operating manual — questions about how condux works, its tiers, soft gates, checkpoints, and named agents."
4
+ argument-hint: "<task description>"
5
+ ---
6
+
7
+ # /workflow
8
+
9
+ Pick the right tier, confirm it, execute. No over-engineering for a button change.
10
+ No under-planning for a cross-cutting feature.
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /workflow $ARGUMENTS
16
+ ```
17
+
18
+ ## Live Context
19
+
20
+ ```!
21
+ git status --short
22
+ git log --oneline -5
23
+ ```
24
+
25
+ ## Operating Rules
26
+
27
+ Condux is **lean and proportional** — the opposite of "always run every gate."
28
+
29
+ 1. **Proportional, not maximal.** Match the tier to the task. Don't discovery a
30
+ typo. Don't wing a cross-cutting refactor.
31
+ 2. **Lazy loading.** Never load `discovery`, `draft-plan`, `test-first-development`,
32
+ `subagent-execution`, or `finalize` upfront. Load a skill only when the tier flow
33
+ reaches the step that needs it.
34
+ 3. **Soft gates, not hard walls.** A gate (e.g. discovery before planning) can be
35
+ skipped — but only *consciously*. If a gate hasn't run, ask the user whether they
36
+ want to skip it; never silently bypass it.
37
+ 4. **The user is in control.** Condux shapes *how* you work, but explicit user
38
+ instructions (CLAUDE.md, AGENTS.md, direct requests) always win. "Treat this as
39
+ LARGE" or "skip the plan" is always valid.
40
+ 5. **Implement yourself by default.** Spawning agents is the exception — only
41
+ delegate with a concrete justification (see Agents below).
42
+ 6. **House style rides along.** Before the first line of code in any tier, load
43
+ the `coding-directive` skill if it is installed — skip silently when it
44
+ isn't. Codebase mimicry and repo config still win over the directive.
45
+
46
+ ## Entry Contract
47
+
48
+ Every dev task starts with `/workflow` — no exceptions unless the user says so.
49
+
50
+ **Valid bypasses (explicit user instruction required):**
51
+ - Mid-flow: "I've already designed/planned this" → skip to the relevant step.
52
+ - Explicit opt-out: "skip workflow", "just do it" → proceed, but note the skip.
53
+
54
+ **Not valid bypasses:**
55
+ - Your own judgment that the task "seems small" — tier inference is this skill's
56
+ job, not yours.
57
+ - Being loaded as companion context alongside another skill — run `/workflow`
58
+ first; the other skill executes within it, not instead of it.
59
+
60
+ ## Tiers
61
+
62
+ | Tier | Looks like | Flow |
63
+ |---|---|---|
64
+ | **SMALL** | isolated change, 1–3 files, clear requirements (a button, a label, a prop, a typo) | implement → `/preflight` → `/finalize` |
65
+ | **MEDIUM** | multi-file, some design needed, known boundaries (new form + API route, new procedure) | quick inline plan → implement → `/preflight` → `/finalize` |
66
+ | **LARGE** | cross-cutting, unclear scope, multiple subsystems (new module, auth flow, data-model change) | `/discovery` → `/draft-plan` → implement → `/preflight` → `/finalize` |
67
+
68
+ Every tier ends with `preflight` then `finalize` — no exceptions.
69
+
70
+ ## The Router
71
+
72
+ 1. **Infer the tier.** How many files? Requirement clear or needs design? Crosses
73
+ service/package boundaries? Unknowns needing exploration first?
74
+ 2. **Spec lookup.** Detect the package root (walk up from CWD to git root, find the
75
+ nearest `package.json` / `Cargo.toml` / `go.mod` / `pyproject.toml`). Check both
76
+ scopes (deduplicate if identical):
77
+ `ls <package-root>/specs/ 2>/dev/null` and `ls <git-root>/specs/ 2>/dev/null`.
78
+ Match the task subject to a spec dir (fuzzy kebab-case: "checkout flow" →
79
+ `specs/checkout-flow`). If found, read `index.md`, then load by task type —
80
+ bug/debug → `quirks.md`, `api.md`, `fields.md`; refactor → `implementation.md`,
81
+ `decisions.md`; new feature → `decisions.md`, `api.md`, `fields.md`. Carry this
82
+ context through; don't re-read mid-task. No spec → proceed without comment.
83
+ 3. **Confirm with the user.** State the inferred tier + a one-sentence reason. If a
84
+ spec was loaded, mention it and offer the companion: "Found spec for
85
+ `checkout-flow` — loaded as context. Want the live HTML preview while we work?
86
+ [y/n]" (if yes, load `technical-spec` and run its preview). Wait for explicit
87
+ confirmation before proceeding.
88
+ 4. **Execute the tier flow**, loading only the skills the tier needs, when needed.
89
+ 5. **Checkpoints (MEDIUM/LARGE).** At each phase boundary, stop and present a
90
+ "what next?" menu (AskUserQuestion), recommended option first. The user drives
91
+ every transition — never auto-advance. SMALL runs linear with no menus.
92
+
93
+ ### Tier flows
94
+
95
+ - **SMALL:** implement directly (no plan doc, no discovery) → `/preflight` → `/finalize`.
96
+ - **MEDIUM:** short inline plan (same section shape as draft-plan, kept lean —
97
+ Overview · Files · Interfaces · Sketch where non-obvious · Edge cases) → CP-1 →
98
+ implement top-to-bottom → CP-2 → `/preflight` → `/finalize` → CP-3.
99
+ - **LARGE:** load `discovery`, run fully to sign-off → load `draft-plan`, produce the
100
+ plan doc, sign-off → CP-1 → implement task by task (`subagent-execution` if the
101
+ user picks it) → CP-2 → `/preflight` → `/finalize` → CP-3.
102
+
103
+ ## Checkpoints
104
+
105
+ After the user picks, load **only** that skill, run it, then return to the nearest
106
+ checkpoint and re-present the menu until the user chooses Done.
107
+
108
+ ### CP-1 — Plan ready
109
+
110
+ *After draft-plan sign-off (LARGE) or the inline plan (MEDIUM). Plan review already
111
+ happened (or was declined) in draft-plan's own save step — don't re-offer it.*
112
+
113
+ | Option | What it does |
114
+ |---|---|
115
+ | **Start implementing** *(recommended)* | Implement the plan top-to-bottom yourself |
116
+ | **Write tests first** | Load `test-first-development`; one upfront consent, then test-first |
117
+ | **Spawn specialist agents** | Load `subagent-execution`; execute the plan with named agents |
118
+ | **Dispatch independent tasks in parallel** | Load `subagent-deployment`; fan out N independent tasks |
119
+ | **Revise the plan** | Loop back to `draft-plan` with the new direction |
120
+
121
+ ### CP-2 — Implementation done
122
+
123
+ | Option | What it does |
124
+ |---|---|
125
+ | **Verify & finalize** *(recommended)* | Run `preflight`, then `finalize` |
126
+ | **Code review first** | Load `code-review` on the diff before finalizing |
127
+ | **Keep building** | More scope remains — re-confirm the tier if it grew |
128
+
129
+ ### CP-3 — Finalized and green
130
+
131
+ | Option | What it does |
132
+ |---|---|
133
+ | **Code review** *(recommended)* | `/code-review` the diff before merging |
134
+ | **Commit** | Load the `git-commit` skill if installed (conventional message from the diff, safe staging); otherwise follow the repo's commit conventions |
135
+ | **Cut a release** | Load the `release` skill if installed — machinery detection, dry-run plan, then tag → push → GitHub release; otherwise follow the repo's release conventions |
136
+ | **Done** | Stop here |
137
+
138
+ ## Skills and Gates
139
+
140
+ Load each only when its step is reached.
141
+
142
+ | Skill | When | Gate discipline |
143
+ |---|---|---|
144
+ | `discovery` | LARGE, before planning, or scope unclear | soft gate — ask before skipping |
145
+ | `draft-plan` | LARGE, after discovery sign-off | needs a signed-off design; no design → apply the discovery soft gate first |
146
+ | `test-first-development` | user asks, or picks it at CP-1 | one upfront consent; always ask before editing an existing test spec |
147
+ | `subagent-execution` | LARGE plan where specialization/parallelism pays off | default is implement yourself |
148
+ | `subagent-deployment` | 2+ independent tasks, no shared files/deps | ad-hoc work, not ordered plans |
149
+ | `preflight` | end of every tier, before finalize | automatic on SMALL; recommended CP-2 choice |
150
+ | `finalize` | after all implementation | runs in order, once, stops on first failure; check AGENTS.md for the real commands |
151
+ | `code-review` | on request only | never auto-triggers, never fixes; after finalize you may ask ONCE |
152
+ | `root-cause-analysis` | any bug investigation | load when debugging starts, not proactively; investigation before fixes |
153
+ | `plan-review` | plan/spec annotation in the browser | via ExitPlanMode/Stop hook, draft-plan's save step, or manually |
154
+ | `technical-spec` | spec context + persistence (see below) | confirm before writing; never silently modify spec files |
155
+
156
+ **Spec companion (`technical-spec`):** the router's step-2 lookup loads spec context
157
+ silently — no spec, no noise. `discovery` integrates it at sign-off (design doc always;
158
+ structured spec default-on, opt-out + live preview). `preflight` closes the loop — its
159
+ Drift Check compares the implementation against the task's spec before finalize.
160
+ Whenever a task **modifies** spec files
161
+ (`specs/`, OpenAPI YAMLs, contracts, field mappings), offer: "Want the live spec
162
+ preview open to review the changes?"
163
+
164
+ ## Artifacts
165
+
166
+ Two tiers, split by durability — not by which skill produced them.
167
+
168
+ | Tier | Where | Contents | Git |
169
+ |---|---|---|---|
170
+ | **Durable** | `<git-root>/specs/` | tech specs (`technical-spec`), browsable via `spec-browser` | committed |
171
+ | **Working state** | `<git-root>/.condux/` | `designs/` · `plans/` · `progress/` · `scratch/` | gitignored |
172
+
173
+ The spec is what you keep; the design and plan are scaffolding for building
174
+ it. Don't promote working state into `docs/` or the repo root — a project's
175
+ `docs/` belongs to the project, not to condux.
176
+
177
+ **Bootstrap.** `.condux/` is created on demand at the git root by the first
178
+ skill that writes there. Before that first write, check it's ignored:
179
+
180
+ ```bash
181
+ git check-ignore -q .condux/ || echo "not ignored"
182
+ ```
183
+
184
+ If it isn't, offer once: "condux keeps its working files in `.condux/` — add
185
+ it to `.gitignore` so they stay out of your commits?" On yes, append
186
+ `.condux/` to the repo's `.gitignore`. If the user would rather not touch a
187
+ tracked file, write it to `.git/info/exclude` instead. Never edit either file
188
+ without asking. Not a git repo → fall back to CWD and say so once.
189
+
190
+ **Override.** A project can relocate either tier in `AGENTS.md`; an explicit
191
+ override always wins over these defaults.
192
+
193
+ ## Agents
194
+
195
+ Four **named specialist agents** ship with condux — never invent a generic subagent
196
+ with an injected prompt. Implement yourself by default; spawn only with concrete
197
+ justification (unfamiliar codebase, external API to verify, genuinely parallel
198
+ exploration, or a LARGE plan via `subagent-execution`).
199
+
200
+ - `explorer` — read-only codebase navigation (haiku, non-blocking; LSP over grep).
201
+ - `researcher` — external API/library verification (sonnet, non-blocking; resolves
202
+ the installed version first, omits what it can't verify).
203
+ - `planner` — design → executable plan (sonnet; always delegates to explorer, and
204
+ researcher when external libs are involved, before planning).
205
+ - `coder` — executes a provided plan only (sonnet; no exploration, no
206
+ typecheck/lint/test — that's finalize's job).
207
+
208
+ Pipeline: explorer/researcher gather (non-blocking) → planner plans → coder executes
209
+ → finalize validates. Spawn mechanics, model tiering, and the parallel-safety
210
+ checklist live in `subagent-execution` and `subagent-deployment`.
211
+
212
+ ## Escalating Mid-Task
213
+
214
+ Scope turns out bigger than the confirmed tier? Stop immediately, report what you
215
+ found ("this touches auth middleware, not just the UI"), re-confirm the tier before
216
+ continuing. Never silently expand scope.
217
+
218
+ ## Red Flags
219
+
220
+ Stop if you catch yourself doing any of these:
221
+
222
+ | Doing | Instead |
223
+ |---|---|
224
+ | Skipping `/workflow` because the task "seems small" | That judgment belongs to the router — run it first |
225
+ | Loading every condux skill upfront | Let the tier flow pull each in at its step |
226
+ | Discovery or a plan doc for a SMALL/MEDIUM task | Implement directly; verify; finalize |
227
+ | Tests / lint / typecheck mid-implementation | Save it all for `finalize` |
228
+ | Spawning agents for a task you can just do | Default is to implement yourself |
229
+ | Silently skipping discovery on a LARGE task | Ask — it's a soft gate, not a free pass |
230
+ | Rewriting a test spec to make it pass | Stop and ask — never silently edit specs |
231
+ | Auto-running code-review, commits, or agents | They're checkpoint choices; run only when picked |
232
+ | Auto-advancing past a checkpoint on MEDIUM/LARGE | The user owns every transition |
233
+ | Expanding scope past the confirmed tier | Stop, report, re-confirm |
234
+
235
+ ## Tips
236
+
237
+ 1. Be specific: "add export button to invoice table that calls exportInvoices" →
238
+ SMALL. "improve the invoice flow" → clarify before a tier can be inferred.
239
+ 2. Override anytime: "treat this as LARGE" is always valid.
240
+ 3. Tests-first is opt-in: pick it at CP-1 or say so anytime.
241
+ 4. Review is separate: after `/finalize`, run `/code-review` if you want one.
@@ -0,0 +1,30 @@
1
+ [
2
+ { "query": "add an export button to the invoice table", "should_trigger": true, "expected_skill": "workflow" },
3
+ { "query": "fix the label on the settings page", "should_trigger": true, "expected_skill": "workflow" },
4
+ { "query": "build a new auth flow with SSO", "should_trigger": true, "expected_skill": "workflow" },
5
+ { "query": "refactor the dashboard module to feature-sliced design", "should_trigger": true, "expected_skill": "workflow" },
6
+ { "query": "new endpoint for order history", "should_trigger": true, "expected_skill": "workflow" },
7
+ { "query": "can you wire the onSave prop through", "should_trigger": true, "expected_skill": "workflow" },
8
+ { "query": "implement dark mode", "should_trigger": true, "expected_skill": "workflow" },
9
+ { "query": "quick typo fix in the header", "should_trigger": true, "expected_skill": "workflow" },
10
+ { "query": "treat this as LARGE: migrate sessions to redis", "should_trigger": true, "expected_skill": "workflow" },
11
+ { "query": "route this task", "should_trigger": true, "expected_skill": "workflow" },
12
+ { "query": "implemnt a serch bar in the navbar", "should_trigger": true, "expected_skill": "workflow" },
13
+ { "query": "update the readme wording for the install section", "should_trigger": true, "expected_skill": "workflow" },
14
+ { "query": "theres a bug where checkout crashes on empty cart", "should_trigger": true, "expected_skill": "root-cause-analysis" },
15
+ { "query": "i want to explore ideas for a notification system", "should_trigger": true, "expected_skill": "discovery" },
16
+ { "query": "write the plan for the feature we just designed", "should_trigger": true, "expected_skill": "draft-plan" },
17
+ { "query": "am I done? verify this", "should_trigger": true, "expected_skill": "preflight" },
18
+ { "query": "run the quality gate", "should_trigger": true, "expected_skill": "finalize" },
19
+ { "query": "review this diff before I merge", "should_trigger": true, "expected_skill": "code-review" },
20
+ { "query": "whats the difference between the workflow tiers", "should_trigger": true, "expected_skill": "workflow" },
21
+ { "query": "how does condux work", "should_trigger": true, "expected_skill": "workflow" },
22
+ { "query": "explain the soft gates", "should_trigger": true, "expected_skill": "workflow" },
23
+ { "query": "can I skip workflow and just start", "should_trigger": true, "expected_skill": "workflow" },
24
+ { "query": "what are the four named agents", "should_trigger": true, "expected_skill": "workflow" },
25
+ { "query": "who wins, my CLAUDE.md or condux rules", "should_trigger": true, "expected_skill": "workflow" },
26
+ { "query": "why does condux ban mid-task test runs", "should_trigger": true, "expected_skill": "workflow" },
27
+ { "query": "what should we improve next in the toolkit repo", "should_trigger": true, "expected_skill": "toolkit-research-frontier" },
28
+ { "query": "format this json blob", "should_trigger": false, "expected_skill": null },
29
+ { "query": "explain how react suspense works", "should_trigger": false, "expected_skill": null }
30
+ ]