@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.
- package/README.md +27 -29
- package/index.js +21 -0
- package/package.json +6 -4
- package/skills/code-review/SKILL.md +136 -0
- package/skills/code-review/evals/trigger_eval.json +22 -0
- package/skills/discovery/SKILL.md +242 -0
- package/skills/discovery/evals/trigger_eval.json +24 -0
- package/skills/discovery/references/choice-server.js +216 -0
- package/skills/discovery/references/mockup-picker.md +90 -0
- package/skills/discovery/references/package.json +3 -0
- package/skills/draft-plan/SKILL.md +229 -0
- package/skills/draft-plan/evals/trigger_eval.json +22 -0
- package/skills/draft-plan/references/plan-template.md +96 -0
- package/skills/finalize/SKILL.md +123 -0
- package/skills/finalize/evals/trigger_eval.json +22 -0
- package/skills/finalize/references/rationalization-table.md +15 -0
- package/skills/plan-review/SKILL.md +215 -0
- package/skills/plan-review/evals/trigger_eval.json +22 -0
- package/skills/plan-review/references/annotate-server.js +465 -0
- package/skills/plan-review/references/install-codex-hook.sh +112 -0
- package/skills/plan-review/references/package.json +3 -0
- package/skills/plan-review/references/plan-review-template.html +730 -0
- package/skills/preflight/SKILL.md +128 -0
- package/skills/preflight/evals/trigger_eval.json +26 -0
- package/skills/root-cause-analysis/SKILL.md +82 -0
- package/skills/root-cause-analysis/evals/trigger_eval.json +22 -0
- package/skills/subagent-deployment/SKILL.md +105 -0
- package/skills/subagent-deployment/evals/trigger_eval.json +22 -0
- package/skills/subagent-deployment/references/safety-checklist.md +54 -0
- package/skills/subagent-execution/SKILL.md +182 -0
- package/skills/subagent-execution/agents/coder.md +55 -0
- package/skills/subagent-execution/agents/explorer.md +77 -0
- package/skills/subagent-execution/agents/planner.md +101 -0
- package/skills/subagent-execution/agents/researcher.md +78 -0
- package/skills/subagent-execution/evals/trigger_eval.json +22 -0
- package/skills/subagent-execution/references/install-codex-agents.mjs +98 -0
- package/skills/subagent-execution/references/review-package.sh +29 -0
- package/skills/subagent-execution/references/spawn-rules.md +88 -0
- package/skills/subagent-execution/references/task-brief.sh +39 -0
- package/skills/technical-spec/SKILL.md +190 -0
- package/skills/technical-spec/evals/trigger_eval.json +23 -0
- package/skills/technical-spec/references/scaffold.sh +98 -0
- package/skills/technical-spec/references/templates.md +159 -0
- package/skills/test-first-development/SKILL.md +121 -0
- package/skills/test-first-development/evals/trigger_eval.json +22 -0
- package/skills/test-first-development/references/rationalization-table.md +16 -0
- package/skills/workflow/SKILL.md +241 -0
- package/skills/workflow/evals/trigger_eval.json +30 -0
package/README.md
CHANGED
|
@@ -1,37 +1,30 @@
|
|
|
1
1
|
# @jabworks/condux
|
|
2
2
|
|
|
3
3
|
OpenCode plugin for the [condux](https://github.com/jabworks/agentic-toolkit)
|
|
4
|
-
workflow toolkit.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
workflow toolkit. One plugin line installs everything condux needs:
|
|
5
|
+
|
|
6
|
+
- **Skills** — bundles the 12 condux workflow skills (`workflow`, `discovery`,
|
|
7
|
+
`draft-plan`, `test-first-development`, `subagent-execution`,
|
|
8
|
+
`subagent-deployment`, `finalize`, `code-review`, `preflight`,
|
|
9
|
+
`root-cause-analysis`, `plan-review`, `technical-spec`) and registers them on
|
|
10
|
+
`config.skills.paths` via the `config` hook — no separate `npx skills add`
|
|
11
|
+
step. A skill you install yourself under the same name still wins; OpenCode
|
|
12
|
+
dedupes by name.
|
|
7
13
|
- **Agents** — injects the four condux specialist agents (`coder`, `explorer`,
|
|
8
|
-
`planner`, `researcher`) as subagents via the
|
|
14
|
+
`planner`, `researcher`) as subagents via the same hook, carrying the tool
|
|
9
15
|
restrictions their canonical definitions declare: `explorer` and `researcher`
|
|
10
16
|
are read-only (no `edit`, `write`, or `bash`) and `planner` cannot run shell
|
|
11
17
|
commands. If your `opencode.json` already defines an agent with the same name,
|
|
12
18
|
yours wins — injection is skip-if-present.
|
|
13
19
|
- **Plan-review listener (opt-in)** — with `CONDUX_PLAN_REVIEW=1`, when the
|
|
14
20
|
primary `plan` agent finishes a turn, spawns the plan-review annotate server
|
|
15
|
-
from
|
|
16
|
-
hooks, so this cannot block the next turn on the
|
|
17
|
-
Codex Stop hook).
|
|
21
|
+
(from the bundled skills, or any discoverable skill tree). Best-effort:
|
|
22
|
+
OpenCode does not await event hooks, so this cannot block the next turn on the
|
|
23
|
+
review outcome (unlike the Codex Stop hook).
|
|
18
24
|
|
|
19
25
|
## Install
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Install the OpenCode-facing skill variants (trigger conditions folded into each
|
|
24
|
-
description):
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
npx skills add https://github.com/jabworks/agentic-toolkit/tree/main/dist/opencode/skills -a opencode
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
This copies skills into `~/.config/opencode/skills/`.
|
|
31
|
-
|
|
32
|
-
### 2. Add the plugin
|
|
33
|
-
|
|
34
|
-
Add `@jabworks/condux` to your `opencode.json`:
|
|
27
|
+
Add `@jabworks/condux` to your `opencode.json` and restart OpenCode:
|
|
35
28
|
|
|
36
29
|
```jsonc
|
|
37
30
|
// opencode.json
|
|
@@ -40,7 +33,13 @@ Add `@jabworks/condux` to your `opencode.json`:
|
|
|
40
33
|
}
|
|
41
34
|
```
|
|
42
35
|
|
|
43
|
-
|
|
36
|
+
That's the whole install — skills and agents come with the plugin. The other
|
|
37
|
+
agentic-toolkit skills (git-commit, session-handoff, release, spec-browser, …)
|
|
38
|
+
are not part of condux; install those separately if you want them:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npx skills add https://github.com/jabworks/agentic-toolkit/tree/main/dist/opencode/skills -a opencode
|
|
42
|
+
```
|
|
44
43
|
|
|
45
44
|
## Notes
|
|
46
45
|
|
|
@@ -54,12 +53,11 @@ Restart OpenCode after adding the plugin.
|
|
|
54
53
|
(`edit` covers edit/write/patch). Read-side tools keep OpenCode's defaults,
|
|
55
54
|
because the Claude allowlists omit `Grep`/`Glob` while the prompts still expect
|
|
56
55
|
to search — denying those would break the agents rather than constrain them.
|
|
57
|
-
- The plan-review listener
|
|
58
|
-
discoverable skill tree (`.opencode/skills/`,
|
|
59
|
-
`.claude/skills/`, or their global equivalents)
|
|
60
|
-
`plan-review/references/annotate-server.js` from there.
|
|
56
|
+
- The plan-review listener finds `plan-review/references/annotate-server.js` in
|
|
57
|
+
the bundled skills first, then any discoverable skill tree (`.opencode/skills/`,
|
|
58
|
+
`.agents/skills/`, `.claude/skills/`, or their global equivalents).
|
|
61
59
|
- OpenCode caches npm plugins under `~/.cache/opencode/`. If an upgrade seems
|
|
62
60
|
to have no effect, clear that cache and restart OpenCode.
|
|
63
|
-
- The
|
|
64
|
-
sources — edit
|
|
65
|
-
|
|
61
|
+
- The `agents/` and `skills/` trees are generated from the toolkit's canonical
|
|
62
|
+
sources by `scripts/build-opencode.mjs` — edit the sources in the toolkit repo
|
|
63
|
+
(`skills/subagent-execution/agents/` and `skills/<name>/`), not here.
|
package/index.js
CHANGED
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
// including the tool restrictions those sources declare.
|
|
8
8
|
// User-defined agents with the same name always win — injection is skip-if-present.
|
|
9
9
|
//
|
|
10
|
+
// The same `config` hook registers the bundled skills/ tree (the 12 condux
|
|
11
|
+
// skills, generated alongside the agents) onto config.skills.paths, so
|
|
12
|
+
// `plugin: ["@jabworks/condux"]` alone installs both agents and skills — no
|
|
13
|
+
// separate `npx skills add` step for condux. This works because the config hook
|
|
14
|
+
// mutates the cached config before OpenCode lazily discovers skills.
|
|
15
|
+
//
|
|
10
16
|
// Optional plan-review listener (CONDUX_PLAN_REVIEW=1): when the primary
|
|
11
17
|
// `plan` agent finishes a turn (session.idle), spawns the plan-review annotate
|
|
12
18
|
// server from an installed condux skill tree. Best-effort only — OpenCode does
|
|
@@ -21,6 +27,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
21
27
|
|
|
22
28
|
const PKG_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
23
29
|
const AGENTS_DIR = path.join(PKG_DIR, 'agents');
|
|
30
|
+
const SKILLS_DIR = path.join(PKG_DIR, 'skills');
|
|
24
31
|
|
|
25
32
|
// Bundled agent files use exactly the frontmatter the toolkit generator emits:
|
|
26
33
|
// a JSON-quoted `description`, a plain `mode`, an optional `permission` deny map
|
|
@@ -55,6 +62,9 @@ function findAnnotateServer(worktree) {
|
|
|
55
62
|
path.join(worktree, '.claude', 'skills'),
|
|
56
63
|
path.join(os.homedir(), '.config', 'opencode', 'skills'),
|
|
57
64
|
path.join(os.homedir(), '.claude', 'skills'),
|
|
65
|
+
// The plan-review skill now also ships bundled in this package, so the
|
|
66
|
+
// listener works even when the user never ran a separate skills install.
|
|
67
|
+
SKILLS_DIR,
|
|
58
68
|
];
|
|
59
69
|
for (const root of roots) {
|
|
60
70
|
const candidate = path.join(root, 'plan-review', 'references', 'annotate-server.js');
|
|
@@ -86,6 +96,17 @@ export const ConduxPlugin = async ({ worktree }) => {
|
|
|
86
96
|
...(def.permission ? { permission: def.permission } : {}),
|
|
87
97
|
};
|
|
88
98
|
}
|
|
99
|
+
|
|
100
|
+
// Register the bundled condux skills so OpenCode discovers them without a
|
|
101
|
+
// separate install. Guarded on existsSync because a source checkout runs
|
|
102
|
+
// this file before the generator has produced skills/. Idempotent — the
|
|
103
|
+
// includes() check keeps re-fires (the hook runs per config load) from
|
|
104
|
+
// pushing duplicates, and never disturbs a user-provided paths entry.
|
|
105
|
+
if (existsSync(SKILLS_DIR)) {
|
|
106
|
+
cfg.skills ??= {};
|
|
107
|
+
cfg.skills.paths ??= [];
|
|
108
|
+
if (!cfg.skills.paths.includes(SKILLS_DIR)) cfg.skills.paths.push(SKILLS_DIR);
|
|
109
|
+
}
|
|
89
110
|
},
|
|
90
111
|
|
|
91
112
|
'chat.params': async (input) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jabworks/condux",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "OpenCode plugin for the condux workflow toolkit —
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "OpenCode plugin for the condux workflow toolkit — bundles the condux skills and injects the specialist agents (coder, explorer, planner, researcher) plus an opt-in plan-review listener.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -11,14 +11,16 @@
|
|
|
11
11
|
"exports": "./index.js",
|
|
12
12
|
"files": [
|
|
13
13
|
"index.js",
|
|
14
|
-
"agents/"
|
|
14
|
+
"agents/",
|
|
15
|
+
"skills/"
|
|
15
16
|
],
|
|
16
17
|
"keywords": [
|
|
17
18
|
"opencode",
|
|
18
19
|
"opencode-plugin",
|
|
19
20
|
"condux",
|
|
20
21
|
"workflow",
|
|
21
|
-
"agents"
|
|
22
|
+
"agents",
|
|
23
|
+
"skills"
|
|
22
24
|
],
|
|
23
25
|
"author": "jabworks",
|
|
24
26
|
"repository": {
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: "One-shot code review. Produces a diagnostic report categorized by severity (Critical / Important / Minor). Never fixes issues automatically. On-request only — never auto-triggers. After /finalize, ask once: \"Want a code review before merging?\" Trigger phrases: \"review this\", \"review before merge\", \"check this PR\"."
|
|
4
|
+
argument-hint: "<PR URL, diff, branch, or file path>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /code-review
|
|
8
|
+
|
|
9
|
+
One review pass. Categorized findings. You decide what to action. No fixing, no re-review, no loop.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/code-review # review current changes
|
|
15
|
+
/code-review <branch or path> # review specific scope
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## When This Runs
|
|
19
|
+
|
|
20
|
+
After `/finalize` completes, ask once:
|
|
21
|
+
|
|
22
|
+
> "Want a code review before merging?"
|
|
23
|
+
|
|
24
|
+
If yes → run this skill.
|
|
25
|
+
If no → done.
|
|
26
|
+
|
|
27
|
+
Do not ask again. Do not auto-trigger. Do not re-review after fixes unless explicitly requested.
|
|
28
|
+
|
|
29
|
+
## How It Works
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
┌──────────────────────────────────────────────────────────────────┐
|
|
33
|
+
│ CODE REVIEW │
|
|
34
|
+
├──────────────────────────────────────────────────────────────────┤
|
|
35
|
+
│ Step 1: SCOPE │
|
|
36
|
+
│ Read the diff or changed files. │
|
|
37
|
+
│ Understand what the change is trying to do. │
|
|
38
|
+
│ │
|
|
39
|
+
│ Step 2: REVIEW │
|
|
40
|
+
│ Evaluate across four dimensions (see below). │
|
|
41
|
+
│ │
|
|
42
|
+
│ Step 3: CATEGORIZE │
|
|
43
|
+
│ Assign each finding to Critical, Important, or Minor. │
|
|
44
|
+
│ │
|
|
45
|
+
│ Step 4: REPORT AND STOP │
|
|
46
|
+
│ Output the report. Done. │
|
|
47
|
+
│ Do not fix anything. Do not suggest re-reviewing. │
|
|
48
|
+
└──────────────────────────────────────────────────────────────────┘
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Review Dimensions
|
|
52
|
+
|
|
53
|
+
**Security**
|
|
54
|
+
|
|
55
|
+
- Auth and authorization gaps
|
|
56
|
+
- Injection risks (SQL, XSS, CSRF)
|
|
57
|
+
- Secrets or credentials in code
|
|
58
|
+
- Unsafe deserialization, path traversal, SSRF
|
|
59
|
+
|
|
60
|
+
**Correctness**
|
|
61
|
+
|
|
62
|
+
- Edge cases (null, empty, overflow, concurrent access)
|
|
63
|
+
- Error handling and propagation
|
|
64
|
+
- Off-by-one errors
|
|
65
|
+
- Type safety gaps not caught by the type system
|
|
66
|
+
|
|
67
|
+
**Performance**
|
|
68
|
+
|
|
69
|
+
- N+1 queries
|
|
70
|
+
- Unbounded loops or queries
|
|
71
|
+
- Unnecessary re-renders or allocations
|
|
72
|
+
- Missing indexes
|
|
73
|
+
|
|
74
|
+
**Maintainability**
|
|
75
|
+
|
|
76
|
+
- Naming clarity
|
|
77
|
+
- Single responsibility violations
|
|
78
|
+
- Duplication
|
|
79
|
+
- Non-obvious logic without explanation
|
|
80
|
+
|
|
81
|
+
## Severity Definitions
|
|
82
|
+
|
|
83
|
+
| Severity | Meaning |
|
|
84
|
+
| ---------------- | -------------------------------------------------------------------------------- |
|
|
85
|
+
| 🔴 **Critical** | Must fix before merging. Security risk, data loss potential, or broken behavior. |
|
|
86
|
+
| 🟡 **Important** | Should fix soon. Not a blocker today, but will cause problems. |
|
|
87
|
+
| 🔵 **Minor** | Worth noting. Style, small improvements, future-proofing. |
|
|
88
|
+
| ✅ **Good** | Patterns worth keeping. Positive signal. |
|
|
89
|
+
|
|
90
|
+
## Output Format
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
## Code Review: [feature or branch name]
|
|
94
|
+
|
|
95
|
+
### Summary
|
|
96
|
+
|
|
97
|
+
[1-2 sentences: what the change does and overall quality signal]
|
|
98
|
+
|
|
99
|
+
### Findings
|
|
100
|
+
|
|
101
|
+
| Severity | File | Line | Finding |
|
|
102
|
+
| ------------ | ------------------ | ---- | ------------- |
|
|
103
|
+
| 🔴 Critical | `path/to/file.ts` | 42 | [description] |
|
|
104
|
+
| 🟡 Important | `path/to/other.ts` | 18 | [description] |
|
|
105
|
+
| 🔵 Minor | `path/to/file.ts` | 67 | [description] |
|
|
106
|
+
|
|
107
|
+
### What Looks Good
|
|
108
|
+
|
|
109
|
+
- [Positive observations]
|
|
110
|
+
|
|
111
|
+
### Verdict
|
|
112
|
+
|
|
113
|
+
[Approve / Request Changes]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## What Does NOT Happen
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
✗ Auto-triggering after finalize without asking
|
|
120
|
+
✗ Fixing any finding automatically
|
|
121
|
+
✗ Requesting a re-review after fixes
|
|
122
|
+
✗ Looping: review → fix → re-review → fix → re-review
|
|
123
|
+
✗ Blocking merge on Minor findings
|
|
124
|
+
✗ Spawning a reviewer subagent (do the review inline)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## After the Report
|
|
128
|
+
|
|
129
|
+
The report is yours to action. Common next steps:
|
|
130
|
+
|
|
131
|
+
- **Critical findings** → fix via `/workflow` (new SMALL task), then decide if you want another review
|
|
132
|
+
- **Important findings** → create a follow-up task or fix now, your call
|
|
133
|
+
- **Minor findings** → note for later or ignore, your call
|
|
134
|
+
- **Nothing blocking** → merge
|
|
135
|
+
|
|
136
|
+
The agent does not manage this process. You do.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "query": "review this before merging", "should_trigger": true, "expected_skill": "code-review" },
|
|
3
|
+
{ "query": "code review the diff", "should_trigger": true, "expected_skill": "code-review" },
|
|
4
|
+
{ "query": "check this PR", "should_trigger": true, "expected_skill": "code-review" },
|
|
5
|
+
{ "query": "review branch feature/sso", "should_trigger": true, "expected_skill": "code-review" },
|
|
6
|
+
{ "query": "any security issues in this change?", "should_trigger": true, "expected_skill": "code-review" },
|
|
7
|
+
{ "query": "give me a severity report on these changes", "should_trigger": true, "expected_skill": "code-review" },
|
|
8
|
+
{ "query": "re-review now that I applied the fixes", "should_trigger": true, "expected_skill": "code-review" },
|
|
9
|
+
{ "query": "was the approach in this diff right?", "should_trigger": true, "expected_skill": "code-review" },
|
|
10
|
+
{ "query": "review this function for perf problems", "should_trigger": true, "expected_skill": "code-review" },
|
|
11
|
+
{ "query": "lgtm?", "should_trigger": true, "expected_skill": "code-review" },
|
|
12
|
+
{ "query": "find n+1 queries in this diff", "should_trigger": true, "expected_skill": "code-review" },
|
|
13
|
+
{ "query": "reveiw pls", "should_trigger": true, "expected_skill": "code-review" },
|
|
14
|
+
{ "query": "auto review every commit from now on", "should_trigger": true, "expected_skill": "code-review", "kind": "in-context" },
|
|
15
|
+
{ "query": "keep reviewing in a loop until its perfect", "should_trigger": true, "expected_skill": "code-review", "kind": "in-context" },
|
|
16
|
+
{ "query": "fix the critical findings from the review", "should_trigger": true, "expected_skill": "workflow" },
|
|
17
|
+
{ "query": "review the plan before implementation", "should_trigger": true, "expected_skill": "plan-review" },
|
|
18
|
+
{ "query": "review the spec folder", "should_trigger": true, "expected_skill": "plan-review", "accept": ["spec-browser"] },
|
|
19
|
+
{ "query": "merge it into main", "should_trigger": true, "expected_skill": "git-operations" },
|
|
20
|
+
{ "query": "review my resume", "should_trigger": false, "expected_skill": null },
|
|
21
|
+
{ "query": "what is a csrf token", "should_trigger": false, "expected_skill": null }
|
|
22
|
+
]
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discovery
|
|
3
|
+
description: "Refine a rough idea into a signed-off design. Asks goal-level questions, surfaces alternatives, then runs a post-approach detail round (contracts, mappings, edge cases) that feeds the tech spec; presents the design in sections for sign-off before any planning or code begins. Trigger for LARGE tasks, when scope is unclear, or when the user wants to brainstorm or explore a rough idea. Also when resuming or continuing an existing design or design doc — the existing-design check offers resume-or-fresh. Acts as a soft gate before /draft-plan — if discovery hasn't run, ask the user if they want to skip it consciously."
|
|
4
|
+
argument-hint: "<rough idea or feature description>"
|
|
5
|
+
effort: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /discovery
|
|
9
|
+
|
|
10
|
+
Turn a rough idea into a clear, agreed-upon design. Nothing gets planned or built until you sign off.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/discovery $ARGUMENTS
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## How It Works
|
|
19
|
+
|
|
20
|
+
Before Step 1, check for an existing design: glob `.condux/designs/*<slug>*.md`
|
|
21
|
+
and `specs/<slug>/` (slug = kebab-case of the feature name). If either
|
|
22
|
+
exists, offer: "Found an existing design for this feature at `<path>` —
|
|
23
|
+
resume from there, or start a fresh discovery?" Accept either answer, same
|
|
24
|
+
as any other soft gate in this skill.
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
┌──────────────────────────────────────────────────────────────────┐
|
|
28
|
+
│ DISCOVERY │
|
|
29
|
+
├──────────────────────────────────────────────────────────────────┤
|
|
30
|
+
│ Step 1: SCOPE CHECK │
|
|
31
|
+
│ Before asking detailed questions, assess: │
|
|
32
|
+
│ - Does this describe multiple independent subsystems? │
|
|
33
|
+
│ → Flag decomposition opportunity before going deeper │
|
|
34
|
+
│ - Is the request already well-defined (ticket, spec doc)? │
|
|
35
|
+
│ → Ask: "This looks well-defined. Skip discovery and │
|
|
36
|
+
│ go straight to planning?" │
|
|
37
|
+
│ - Is the scope genuinely unclear? │
|
|
38
|
+
│ → Proceed to Step 2 │
|
|
39
|
+
│ │
|
|
40
|
+
│ Step 2: CLARIFY — GOAL ROUND │
|
|
41
|
+
│ Ask targeted questions — one batch, not one at a time. │
|
|
42
|
+
│ Focus on: goals, constraints, what "done" looks like, │
|
|
43
|
+
│ known unknowns, and what should explicitly NOT be built. │
|
|
44
|
+
│ No implementation detail yet — that's Step 4's job. │
|
|
45
|
+
│ │
|
|
46
|
+
│ Step 3: PROPOSE │
|
|
47
|
+
│ Present 2-3 approaches with tradeoffs. │
|
|
48
|
+
│ Show design in sections — get acknowledgment per section │
|
|
49
|
+
│ before moving on. │
|
|
50
|
+
│ │
|
|
51
|
+
│ Step 4: DETAIL ROUND — feed the spec │
|
|
52
|
+
│ With the approach chosen, ask ONE more batch, grouped by │
|
|
53
|
+
│ spec concern — only concerns this feature touches, │
|
|
54
|
+
│ max ~2 questions each: │
|
|
55
|
+
│ api.md → contracts, error shapes, external calls │
|
|
56
|
+
│ fields.md → source-to-UI mappings, transformations │
|
|
57
|
+
│ quirks.md → edge cases, failure modes, known gotchas │
|
|
58
|
+
│ implementation.md → key files, patterns to follow │
|
|
59
|
+
│ Skip the round entirely if nothing is decidable yet. │
|
|
60
|
+
│ │
|
|
61
|
+
│ Step 5: INLINE SELF-REVIEW │
|
|
62
|
+
│ Before presenting the final design for sign-off, silently │
|
|
63
|
+
│ check — and fix anything that fails: │
|
|
64
|
+
│ ✓ No placeholders or TBDs in the design │
|
|
65
|
+
│ ✓ All requirements covered │
|
|
66
|
+
│ ✓ Out-of-scope items explicitly noted │
|
|
67
|
+
│ ✓ No subsystems that should be separate tasks │
|
|
68
|
+
│ ✓ Every contract, mapping, or edge case named in the │
|
|
69
|
+
│ design has a home in a spec concern file │
|
|
70
|
+
│ ✓ Unanswered detail questions surface as open questions, │
|
|
71
|
+
│ never silently dropped │
|
|
72
|
+
│ │
|
|
73
|
+
│ Step 6: SIGN-OFF │
|
|
74
|
+
│ Get explicit approval: "Looks good, proceed to planning" │
|
|
75
|
+
│ Do not proceed to /draft-plan without this. │
|
|
76
|
+
│ │
|
|
77
|
+
│ Step 7: SAVE DESIGN + SPEC (mandatory) │
|
|
78
|
+
│ Write the design summary to │
|
|
79
|
+
│ .condux/designs/YYYY-MM-DD-<feature>.md — this is the │
|
|
80
|
+
│ artifact /draft-plan's gate check globs for. │
|
|
81
|
+
│ Spec write-back is default-on: persist the concern files │
|
|
82
|
+
│ too (Spec Integration below) unless the user opts out. │
|
|
83
|
+
│ Then offer the browser review loop (Design Review Loop). │
|
|
84
|
+
└──────────────────────────────────────────────────────────────────┘
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Clarifying Questions — Good vs Bad
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Good (goal-oriented, unambiguous):
|
|
91
|
+
✓ "What does success look like for the user?"
|
|
92
|
+
✓ "Are there any libraries or patterns already in use we should follow?"
|
|
93
|
+
✓ "What should this explicitly NOT do?"
|
|
94
|
+
✓ "Is there a deadline or constraint that affects the approach?"
|
|
95
|
+
|
|
96
|
+
Bad (too detailed too early):
|
|
97
|
+
✗ "Should the button be primary or secondary variant?"
|
|
98
|
+
✗ "What exact file should this go in?"
|
|
99
|
+
✗ "Should we use useCallback here?"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Two rounds, two altitudes.** The examples above govern Step 2 — goal
|
|
103
|
+
altitude only. Step 4's detail round is the deliberate exception: once an
|
|
104
|
+
approach is chosen, contract/mapping/edge-case questions ("what shape does
|
|
105
|
+
the API error return?", "which field feeds the status badge?", "what happens
|
|
106
|
+
when the upstream times out?") are exactly right, and their answers land in
|
|
107
|
+
the matching spec concern file. What stays bad at *every* stage:
|
|
108
|
+
micro-decisions the agent should make itself (button variants, hook choices,
|
|
109
|
+
file placement).
|
|
110
|
+
|
|
111
|
+
## Soft Gate Behavior
|
|
112
|
+
|
|
113
|
+
If the user jumps straight to `/draft-plan` or starts describing implementation without running discovery:
|
|
114
|
+
|
|
115
|
+
> "We haven't run discovery on this yet — want to quickly align on the design first, or do you already have a clear picture and want to go straight to planning?"
|
|
116
|
+
|
|
117
|
+
Accept either answer. Never block. Never lecture.
|
|
118
|
+
|
|
119
|
+
## What Does NOT Happen
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
✗ Writing any code
|
|
123
|
+
✗ Writing a plan doc (that's /draft-plan)
|
|
124
|
+
✗ Asking questions one at a time in a long back-and-forth
|
|
125
|
+
✗ Proceeding to planning without explicit sign-off
|
|
126
|
+
✗ Treating a well-defined ticket as needing full discovery
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Output
|
|
130
|
+
|
|
131
|
+
A short design summary covering:
|
|
132
|
+
|
|
133
|
+
- What we're building and why
|
|
134
|
+
- Approach chosen + why alternatives were rejected
|
|
135
|
+
- Key constraints and out-of-scope items
|
|
136
|
+
- Open questions (if any remain after sign-off)
|
|
137
|
+
|
|
138
|
+
Detail-round answers (Step 4) belong in the spec concern files, not the
|
|
139
|
+
summary — the summary stays short; the spec carries the detail.
|
|
140
|
+
|
|
141
|
+
Save to: `.condux/designs/YYYY-MM-DD-<feature>.md` — always, at sign-off
|
|
142
|
+
(Step 7). The saved file is what `/draft-plan`'s gate check globs for; a
|
|
143
|
+
design that lives only in conversation doesn't count as signed off.
|
|
144
|
+
|
|
145
|
+
`.condux/` is gitignored working state, created on demand at the git root
|
|
146
|
+
(see `/workflow` → Artifacts). Before the first write, make sure it's
|
|
147
|
+
ignored — see the bootstrap step there. Honour an `AGENTS.md` path override
|
|
148
|
+
if the project defines one.
|
|
149
|
+
|
|
150
|
+
For side-by-side layout comparisons or architecture diagrams during the design phase, see `references/mockup-picker.md`.
|
|
151
|
+
|
|
152
|
+
## Design Review Loop
|
|
153
|
+
|
|
154
|
+
After saving, always offer — mirroring `/draft-plan`'s post-save review:
|
|
155
|
+
|
|
156
|
+
> "Design saved to `<path>`. Want to review it in the browser before we plan,
|
|
157
|
+
> or go straight to /draft-plan?"
|
|
158
|
+
|
|
159
|
+
**If review chosen:** locate `annotate-server.js` from the installed
|
|
160
|
+
`plan-review` skill (`find ~/.claude ~/.codex ~/.agents -name
|
|
161
|
+
annotate-server.js -path '*plan-review*' 2>/dev/null | head -1`) and launch
|
|
162
|
+
it in `--steer` mode against the saved design file (or the spec directory,
|
|
163
|
+
if the design was saved as a tech spec — see Spec Integration below):
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
node /path/to/plan-review/references/annotate-server.js .condux/designs/<file>.md --steer
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Poll `GET http://127.0.0.1:7777/api/decision` (long-poll — blocks until a
|
|
170
|
+
decision is submitted) and branch on the result. Design review is
|
|
171
|
+
**accept-or-fix** — there is no Reject at this stage:
|
|
172
|
+
|
|
173
|
+
- **Approve** → design is signed off; proceed to `/draft-plan`, carrying any
|
|
174
|
+
feedback notes into the plan.
|
|
175
|
+
- **Request Revisions** → revise the design file in place per the feedback
|
|
176
|
+
(the open tab live-reloads over SSE), then poll again.
|
|
177
|
+
|
|
178
|
+
**If straight to planning chosen:** proceed directly, no server launch.
|
|
179
|
+
|
|
180
|
+
## Spec Integration (Live Preview)
|
|
181
|
+
|
|
182
|
+
Integrates with the `technical-spec` skill to persist the design and render it live while discovery runs.
|
|
183
|
+
|
|
184
|
+
### At discovery start
|
|
185
|
+
|
|
186
|
+
Infer the feature slug (kebab-case from `$ARGUMENTS`). Specs live under
|
|
187
|
+
`<git-root>/specs/`, mirroring the repo structure: check
|
|
188
|
+
`<git-root>/specs/<pkg-relpath>/<feature-slug>/` (pkg-relpath = the nearest
|
|
189
|
+
package root's path relative to the git root, empty at the root) and
|
|
190
|
+
`<git-root>/specs/<feature-slug>/` for an existing spec.
|
|
191
|
+
|
|
192
|
+
If found, offer:
|
|
193
|
+
|
|
194
|
+
> "Found an existing spec for this feature. Open live preview while we refine the design? [y/n]"
|
|
195
|
+
|
|
196
|
+
If yes, go straight to **Launch preview** below (skip scaffold + write — spec already exists).
|
|
197
|
+
|
|
198
|
+
### At sign-off
|
|
199
|
+
|
|
200
|
+
The Markdown design doc (Step 7) is always written. The spec write-back is
|
|
201
|
+
**default-on** — announce it rather than ask:
|
|
202
|
+
|
|
203
|
+
> "Saving this as a tech spec too (decisions + the concern files from the
|
|
204
|
+
> detail round) and opening the live preview — say no to skip."
|
|
205
|
+
|
|
206
|
+
Unless the user opts out (the spec directory then becomes the target for the
|
|
207
|
+
Design Review Loop above, in directory mode):
|
|
208
|
+
|
|
209
|
+
1. **Find scripts** — the scaffold from technical-spec, the preview from
|
|
210
|
+
plan-review (its annotate server renders spec directories):
|
|
211
|
+
```bash
|
|
212
|
+
SCAFFOLD=$(find ~/.claude ~/.codex ~/.agents -name "scaffold.sh" -path "*technical-spec*" 2>/dev/null | head -1)
|
|
213
|
+
PREVIEW=$(find ~/.claude ~/.codex ~/.agents -name "annotate-server.js" -path "*plan-review*" 2>/dev/null | head -1)
|
|
214
|
+
```
|
|
215
|
+
If either is missing, tell the user: "the `technical-spec` / `plan-review` skills weren't found — install the condux plugin to enable spec integration."
|
|
216
|
+
|
|
217
|
+
2. **Scaffold** the spec dir and capture the output:
|
|
218
|
+
```bash
|
|
219
|
+
SCAFFOLD_OUT=$(bash "$SCAFFOLD" "<FeatureName>")
|
|
220
|
+
SPEC_PATH=$(echo "$SCAFFOLD_OUT" | sed 's/^[^:]*://; s/ .*//')
|
|
221
|
+
```
|
|
222
|
+
`SPEC_PATH` is an absolute path (e.g. `/repo/specs/apps/web/wan-config`).
|
|
223
|
+
The scaffold script places specs under `<git-root>/specs/`, mirroring the
|
|
224
|
+
repo structure, automatically.
|
|
225
|
+
|
|
226
|
+
3. **Write initial spec files** from the design into `$SPEC_PATH/`.
|
|
227
|
+
`decisions.md` always (chosen approach + rationale). Then every concern
|
|
228
|
+
the detail round produced answers for gets its file: `api.md`,
|
|
229
|
+
`fields.md`, `quirks.md`, `implementation.md`. A detail-round answer
|
|
230
|
+
that never lands in a spec file is a bug in the flow, not a judgment call.
|
|
231
|
+
|
|
232
|
+
4. **Launch preview** in the background, pointing at the absolute spec path:
|
|
233
|
+
```bash
|
|
234
|
+
node "$PREVIEW" "$SPEC_PATH"
|
|
235
|
+
```
|
|
236
|
+
Tell user: "Preview is live. The browser updates automatically as spec files change, and you can annotate any file and submit a decision. Ctrl+C in the terminal to stop."
|
|
237
|
+
|
|
238
|
+
### Keeping the spec current
|
|
239
|
+
|
|
240
|
+
As discovery continues and design details shift, update the relevant spec files — the preview re-renders on every save. This is the main benefit: the spec stays in sync with the conversation instead of being written once at the end.
|
|
241
|
+
|
|
242
|
+
If the user submits a decision in the preview, read `$SPEC_PATH/review.feedback.md` (notes grouped by file) and action it. Spec review is accept-or-fix (directory mode has no Reject): **Approve** = design is signed off, proceed; **Request Revisions** = fix the spec files, then continue the loop.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "query": "lets figure out the design for the billing revamp", "should_trigger": true, "expected_skill": "discovery" },
|
|
3
|
+
{ "query": "not sure what the scope is, help me think this through", "should_trigger": true, "expected_skill": "discovery" },
|
|
4
|
+
{ "query": "i have a rough idea for an activity feed", "should_trigger": true, "expected_skill": "discovery" },
|
|
5
|
+
{ "query": "clarify the requirements before we build anything", "should_trigger": true, "expected_skill": "discovery" },
|
|
6
|
+
{ "query": "surface some alternatives for the state management approach", "should_trigger": true, "expected_skill": "discovery" },
|
|
7
|
+
{ "query": "design session for the new onboarding", "should_trigger": true, "expected_skill": "discovery" },
|
|
8
|
+
{ "query": "brainstorm ideas for the notifications feature", "should_trigger": true, "expected_skill": "discovery" },
|
|
9
|
+
{ "query": "whats done look like for this feature? lets align first", "should_trigger": true, "expected_skill": "discovery" },
|
|
10
|
+
{ "query": "resume the design we started yesterday", "should_trigger": true, "expected_skill": "discovery" },
|
|
11
|
+
{ "query": "found an existing design doc for this, continue from it", "should_trigger": true, "expected_skill": "discovery" },
|
|
12
|
+
{ "query": "design a database schema for multi-tenancy", "should_trigger": true, "expected_skill": "discovery" },
|
|
13
|
+
{ "query": "big refactor, unclear boundaries — where do we even start", "should_trigger": true, "expected_skill": "discovery" },
|
|
14
|
+
{ "query": "resume where we left off last session", "should_trigger": true, "expected_skill": "session-handoff" },
|
|
15
|
+
{ "query": "pick up from the handoff doc", "should_trigger": true, "expected_skill": "session-handoff" },
|
|
16
|
+
{ "query": "we already have a signed off design, write the plan", "should_trigger": true, "expected_skill": "draft-plan" },
|
|
17
|
+
{ "query": "skip discovery, just plan it", "should_trigger": true, "expected_skill": "draft-plan" },
|
|
18
|
+
{ "query": "small tweak to the button color", "should_trigger": true, "expected_skill": "workflow" },
|
|
19
|
+
{ "query": "review the plan in the browser", "should_trigger": true, "expected_skill": "plan-review" },
|
|
20
|
+
{ "query": "save what we decided as a spec", "should_trigger": true, "expected_skill": "technical-spec" },
|
|
21
|
+
{ "query": "why does checkout 500 on submit", "should_trigger": true, "expected_skill": "root-cause-analysis" },
|
|
22
|
+
{ "query": "help me write my resume", "should_trigger": false, "expected_skill": null },
|
|
23
|
+
{ "query": "design a logo for the app", "should_trigger": false, "expected_skill": null }
|
|
24
|
+
]
|