@irythill/orq 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +240 -3
- package/README.pt-BR.md +241 -0
- package/dist/accounts.js +18 -0
- package/dist/agents.js +202 -0
- package/dist/banner.js +87 -0
- package/dist/cli.js +90 -0
- package/dist/commands/agent.js +334 -0
- package/dist/commands/baseline.js +101 -0
- package/dist/commands/block.js +74 -0
- package/dist/commands/board.js +435 -0
- package/dist/commands/claim.js +88 -0
- package/dist/commands/completion.js +88 -0
- package/dist/commands/config.js +35 -0
- package/dist/commands/deps.js +82 -0
- package/dist/commands/instructions.js +66 -0
- package/dist/commands/lang.js +35 -0
- package/dist/commands/lock.js +69 -0
- package/dist/commands/pick.js +91 -0
- package/dist/commands/quota.js +10 -0
- package/dist/commands/run.js +46 -0
- package/dist/commands/set.js +27 -0
- package/dist/commands/setup.js +187 -0
- package/dist/commands/stats.js +41 -0
- package/dist/commands/verify.js +123 -0
- package/dist/commands/wait.js +81 -0
- package/dist/config.js +93 -0
- package/dist/fsutil.js +9 -0
- package/dist/i18n.js +21 -0
- package/dist/install.js +137 -0
- package/dist/keyring.js +51 -0
- package/dist/lock.js +81 -0
- package/dist/paths.js +34 -0
- package/dist/pick.js +115 -0
- package/dist/process.js +147 -0
- package/dist/quota.js +276 -0
- package/dist/roles.js +28 -0
- package/dist/stats.js +159 -0
- package/dist/suggest.js +121 -0
- package/dist/terminal.js +83 -0
- package/dist/testrun.js +203 -0
- package/dist/toml-set.js +46 -0
- package/package.json +27 -6
- package/skills/issue/SKILL.md +197 -0
- package/skills/orq-setup/SKILL.md +114 -0
- package/skills/orq-status/SKILL.md +37 -0
- package/templates/workspace.CLAUDE.md +49 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue
|
|
3
|
+
description: Runs a Plane issue end to end by orchestrating coding agents in herdr or any terminal (herdr-agent / orq agent + orq wait) — implementer and cross-vendor reviewer picked by orq pick, tests by herdr-verify / orq verify, comment and status in Plane. Use when the user says "/issue <ID>", "take issue X", "run ABC-123", or asks to check/create issues in the conductor's ecosystem.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /issue <ID> — conductor playbook (herdr or any terminal)
|
|
7
|
+
|
|
8
|
+
You are the **orchestrator**: you plan, dispatch, follow up and report. **Do not implement anything yourself** (it
|
|
9
|
+
burns the conductor's model). Talk to the user in the user's language.
|
|
10
|
+
|
|
11
|
+
**Ecosystem configuration:** the **workspace** `CLAUDE.md` (the folder named in your conductor instructions) defines
|
|
12
|
+
the repositories and their groups (= herdr workspace, `-g`), **each repo's base branch**, verification commands,
|
|
13
|
+
Plane projects (identifier → project_id), default assignee, labels/modules and MCP limitations. Read it before you
|
|
14
|
+
start. Below, `$WS` = workspace.
|
|
15
|
+
**Inside herdr** (`HERDR_ENV=1`): children open in herdr tabs and their notices reach your pane — the flow below.
|
|
16
|
+
**Outside herdr** (any terminal, tmux, any OS): the same flow with these swaps —
|
|
17
|
+
- `herdr-agent ...` → `orq agent ...` (same flags; it is the same program). Children run in tmux windows inside tmux,
|
|
18
|
+
else in the background (their screen goes to a log; the answer is still `<prefix>.out.md`). No `-T`.
|
|
19
|
+
- `herdr-claim` → `orq claim` (set `ORQ_CONDUCTOR_ID` to a fixed name per conductor), `herdr-deps` → `orq deps`.
|
|
20
|
+
- **Completion signal:** no line arrives in your pane. After dispatching, run `orq wait <prefix>` **as a background
|
|
21
|
+
task** (Claude Code: Bash with `run_in_background`); its exit wakes you and its output is the line
|
|
22
|
+
`[ORQ AGENT DONE] <title> status=ok|fail ... answer: <file>` — treat it exactly like `[HERDR-AGENT DONE]`. Several
|
|
23
|
+
children in parallel: `orq wait --any <prefix1> <prefix2>` (one wake-up per finish; wait again for the rest).
|
|
24
|
+
No background tasks in your harness → run `orq wait` in the foreground; that is the one allowed blocking wait.
|
|
25
|
+
- `herdr-verify` → `orq verify`, `herdr-baseline` → `orq baseline` (same flags). They run in a tmux window or in
|
|
26
|
+
the background like children, and you wait for them the same way: `orq wait $O/verify-<repo>`.
|
|
27
|
+
- Peeking at a child: `<prefix>.log` (not `herdr pane read`).
|
|
28
|
+
Issue artifacts (prompts, notes) live in `$WS/.orquestra/<ID>/`.
|
|
29
|
+
|
|
30
|
+
## 1. Read the issue
|
|
31
|
+
- **First, claim it:** `herdr-claim -w $WS <ID>`. Exit 1 = another conductor owns it: **stop** and tell the user
|
|
32
|
+
(don't read it, don't dispatch anything). Taking it over (e.g. switching accounts) only with the user's OK:
|
|
33
|
+
`herdr-claim -w $WS -f <ID>`. Several conductors may share a workspace; `herdr-claim -w $WS -l` lists who has what.
|
|
34
|
+
- `mcp__plane__workitem` `retrieve_by_identifier` with `workitem_identifier: "<ID>"`; then `workitem_comment list`.
|
|
35
|
+
- Extract: goal, **acceptance criteria**, affected repos, links. No acceptance criteria → write a short proposal and
|
|
36
|
+
**ask the user** before dispatching.
|
|
37
|
+
- Issue missing assignee, priority, labels or module → **fill them in** following the workspace `CLAUDE.md` "Issue
|
|
38
|
+
standard". The same standard applies to any new issue you create.
|
|
39
|
+
- Move it to **In Progress** (`workitem update` with the state_id from `state list`).
|
|
40
|
+
|
|
41
|
+
## 2. Classify
|
|
42
|
+
One task per repo. Level:
|
|
43
|
+
- **simple** — CRUD, UI/text tweak, localized bug, 1–3 files.
|
|
44
|
+
- **medium** — business rule, API↔front integration, several files.
|
|
45
|
+
- **heavy** — architecture, data migration, hard/concurrency bug, security.
|
|
46
|
+
|
|
47
|
+
## 3. Pick agent and model: always `orq pick`, never by hand
|
|
48
|
+
`orq pick` decides agent, model, effort and account (user config + delivery and token history + current quota +
|
|
49
|
+
rotation). **Do not choose by preference, by a rule you read elsewhere, or by what worked last time**: run it before
|
|
50
|
+
EVERY dispatch (implementation, review, second opinion) and use its output verbatim.
|
|
51
|
+
```bash
|
|
52
|
+
orq pick impl --level simple|medium|heavy # → e.g. -a codex -m gpt-6-sol -e low
|
|
53
|
+
orq pick review --level <level> --impl-agent <agent that implemented> # → another vendor, e.g. -a opencode -m ...
|
|
54
|
+
orq pick opinion # second opinion (e.g. Copilot), see step 5
|
|
55
|
+
```
|
|
56
|
+
The output goes straight into `herdr-agent` (`herdr-agent $(orq pick ...) -g ... -t ... -d ... -o ... -- prompt.md`).
|
|
57
|
+
- Exit 3 = no candidate (quota exhausted, no agent with that role): **stop and ask the user**.
|
|
58
|
+
- Implementer failed review twice (step 6) → pick again without it: `orq pick impl --level <level> --exclude-agent <agent>`.
|
|
59
|
+
- `--exclude-agent` never "sticks": every `orq pick` call decides again, with only that dispatch's exclusions.
|
|
60
|
+
- The conductor's own model (e.g. Opus) as implementer: only with the user's OK, never through `orq pick`.
|
|
61
|
+
- Want to understand a choice? `orq pick ... --explain --no-record` (score of each candidate; not counted in rotation).
|
|
62
|
+
|
|
63
|
+
**Every child runs through `herdr-agent`** (agent from `orq pick`): headless (`claude -p` / `codex exec` /
|
|
64
|
+
`opencode run` / `agy -p` / `copilot -p`) in a herdr tab (workspace = group `-g`, tab = title) with live output.
|
|
65
|
+
When it finishes it writes `<prefix>.done` and sends ONE line `[HERDR-AGENT DONE] <title> status=ok|fail ...` to your
|
|
66
|
+
pane; no MCP, and a **4 GB memory cap per agent** (own cgroup: if it blows up, only it dies). NEVER `herdr agent start`
|
|
67
|
+
for children (no memory cap, no answer file). **Screen mode (`-T`, or `HERDR_AGENT_TUI=1`):** the tab shows the
|
|
68
|
+
agent's own TUI instead of the log; same cap, same files, same signal (end-of-turn hook). The screen stays open after
|
|
69
|
+
the turn (it holds memory until the tab closes); `-R` with the tab open types the follow-up into it. Use it when the
|
|
70
|
+
user wants to watch. The repo must already be trusted in Codex/Claude (otherwise the TUI stops at the "trust this
|
|
71
|
+
folder?" dialog — tell the user, don't approve it for them).
|
|
72
|
+
|
|
73
|
+
## 4. Dispatch the implementer
|
|
74
|
+
Write the prompt to `$WS/.orquestra/<ID>/impl-<repo>.md` (short: goal, acceptance criteria, likely files, the repo's
|
|
75
|
+
verification commands, "base: origin/<BASE>; don't rebase/merge other branches; local commits, no push; commit
|
|
76
|
+
messages following <path of the repo's commit conventions, see step 7>").
|
|
77
|
+
Always include:
|
|
78
|
+
- **Repo checklist:** copy the repo's "Checklist" column from the workspace `CLAUDE.md`.
|
|
79
|
+
- **No tests in the child** (memory rule): "don't run jest/vitest; I run the related tests afterwards".
|
|
80
|
+
- **Fresh branch:** "before your final answer: `git fetch origin <BASE> && git rebase origin/<BASE>`; on conflict stop
|
|
81
|
+
and report; after the rebase repeat lint/tsc". Codex has no network: for it, you fetch and check in step 5.
|
|
82
|
+
|
|
83
|
+
**Base = the repo's base branch from the workspace `CLAUDE.md`, always from the updated remote (`origin/<BASE>`).**
|
|
84
|
+
Worktree with `git worktree add` (not `herdr worktree create`: that opens a separate herdr workspace per worktree, and
|
|
85
|
+
children are grouped by the repo's `-g`).
|
|
86
|
+
```bash
|
|
87
|
+
R=$WS/<repo>; BASE=<repo base>; B=<prefix>plane-<lowercase-id>; WT=$WS/.worktrees/<repo>-plane-<lowercase-id>
|
|
88
|
+
O=$WS/.orquestra/<ID>
|
|
89
|
+
git -C $R fetch origin $BASE
|
|
90
|
+
git -C $R worktree add -b $B $WT origin/$BASE # already exists? reuse $WT, don't recreate it
|
|
91
|
+
git -C $WT log -1 --format='%h %s' # check HEAD == origin/$BASE before launching
|
|
92
|
+
```
|
|
93
|
+
**Dependencies — NEVER install inside the worktree** (each `node_modules` is ~1 GB and tens of thousands of files;
|
|
94
|
+
on a modest disk that saturates I/O and memory and freezes the machine). The worktree uses a **link** to the main
|
|
95
|
+
repo's `node_modules`:
|
|
96
|
+
```bash
|
|
97
|
+
herdr-deps -r $R -b $BASE -w $WT # link; stale deps → fast-forward + ONE install in $R (per-repo lock across conductors)
|
|
98
|
+
```
|
|
99
|
+
Exit 3 = stale deps and `$R` dirty or not on `$BASE` → **ask the user**. If another conductor is installing in the
|
|
100
|
+
same repo, the command waits its turn (never install by hand).
|
|
101
|
+
In the child's prompt: "node_modules is shared (link): don't run install/add; if you need a new dependency, stop and
|
|
102
|
+
tell me".
|
|
103
|
+
**Dispatch** (no MCP; memory cap; writes in automatic mode — that is why implementation only happens in a worktree):
|
|
104
|
+
```bash
|
|
105
|
+
herdr-agent $(orq pick impl --level <level>) -g <group> -t "<ID> impl <repo>" -d $WT -o $O/impl-<repo> -- $O/impl-<repo>.md
|
|
106
|
+
```
|
|
107
|
+
- The Claude account (`-c`) already comes from `orq pick` (the least used one under the limit).
|
|
108
|
+
- Full final answer in `$O/impl-<repo>.out.md`; log in `.log`; the agent's session id in `.id`.
|
|
109
|
+
- Codex's sandbox has no network: `git fetch` is yours, beforehand (above). Push/PR: yours (step 7).
|
|
110
|
+
- `herdr-agent` returns immediately (no need to background it); the child's pane is in `<prefix>.pane`
|
|
111
|
+
(`herdr pane read $(cat <prefix>.pane) --source recent` to peek).
|
|
112
|
+
- **No baseline in the issue flow:** don't run `herdr-baseline` before dispatching (the base moves with every merge and
|
|
113
|
+
the full suite blocks every conductor's test queue). `herdr-verify` checks the base on demand (step 4b).
|
|
114
|
+
- **Children start WITHOUT MCP** (Plane is yours; each MCP costs ~150–200 MB per session and `systemd-oomd` kills the
|
|
115
|
+
whole herdr server when memory runs out) — `herdr-agent` takes care of it.
|
|
116
|
+
- Every child prompt ends with: "Don't try to talk to the conductor or use herdr; finish with your complete final
|
|
117
|
+
answer (that is what I read)."
|
|
118
|
+
- **Verification in the child: lint and tsc only, one command at a time** (the cap is 4 GB per agent and jest/vitest
|
|
119
|
+
blow it; tests are yours, step 4b): use the Verification column of the workspace `CLAUDE.md` and put in the prompt
|
|
120
|
+
"verify sequentially, never in parallel or watch mode: (1) lint only the changed files (`git diff --name-only
|
|
121
|
+
origin/<BASE>...HEAD`); (2) `NODE_OPTIONS=--max-old-space-size=2048 tsc --noEmit` for the project. Don't run tests".
|
|
122
|
+
Full suite only in CI (or a manual `herdr-baseline` if the user asks).
|
|
123
|
+
- An issue that changes an API contract: **API first**; consumers afterwards, with the new contract in the prompt.
|
|
124
|
+
- **Never block waiting** (`herdr agent wait`, `pane wait-output`, `sleep`, `timeout`): completion arrives as a
|
|
125
|
+
`[HERDR-AGENT DONE]` line in your pane. Dispatch, report in one line and end your turn. "Done yet?" = `<prefix>.done`
|
|
126
|
+
exists (never `pgrep`).
|
|
127
|
+
- Investigation only (no code): "READ ONLY" prompt, in the repo itself, no worktree. `herdr-agent -r` (Claude:
|
|
128
|
+
`--permission-mode plan`; the others: throwaway worktree, no editing).
|
|
129
|
+
|
|
130
|
+
## 4b. Tests (yours, not the child's)
|
|
131
|
+
Child with `status=ok` → run the tests related to the diff, in their own tab, one at a time on the machine (queue):
|
|
132
|
+
`herdr-verify -w $WS -r <repo> -d $WT -b <BASE> -o $O/verify-<repo> -g <group>` → `$O/verify-<repo>.txt` with
|
|
133
|
+
**new failures** and pre-existing ones: if any test fails, it runs the same test files on an updated
|
|
134
|
+
`origin/<BASE>` (whatever fails there is pre-existing). You get `[HERDR-AGENT DONE] verify ... new=N`.
|
|
135
|
+
`new>0` → fix round with the list (step 6), no review. `new=0` → review.
|
|
136
|
+
**Mandatory order every round (impl and each fix): child `ok` → verify → review.** Never dispatch the review (or an
|
|
137
|
+
"early" fix) while this round's verify is pending, even if it is queued behind another verify: wait for
|
|
138
|
+
`[HERDR-AGENT DONE] ... verify ...` and end your turn until then.
|
|
139
|
+
|
|
140
|
+
## 5. Cross review (always another vendor)
|
|
141
|
+
```bash
|
|
142
|
+
herdr-agent $(orq pick review --level <level> --impl-agent <who implemented>) -b $BASE \
|
|
143
|
+
-g <group> -t "<ID> review <repo>" -d $WT -o $O/review-<repo> -r -i $O/impl-<repo>.md -i $O/verify-<repo>.txt \
|
|
144
|
+
-- $O/review-<repo>.md
|
|
145
|
+
```
|
|
146
|
+
`-b $BASE` attaches the diff (`origin/$BASE...HEAD`): always use it. The review prompt works for any reviewer and says
|
|
147
|
+
"the diff is attached; for context, open files with your file-reading tool; don't run lint, tsc or tests (the results
|
|
148
|
+
are in the attached verify)". If the reviewer ends with `status=fail` and no verdict (empty answer, or a
|
|
149
|
+
`jetski: ... permission` line), that is not a rejection: run `orq pick review ... --exclude-agent <it>` and redo it.
|
|
150
|
+
`--exclude-agent` applies **only to redoing that review**: for the next round's review, run `orq pick review` without
|
|
151
|
+
exclusions (the failure may have been a one-off). An agent that failed twice in a row with no verdict →
|
|
152
|
+
`orq block <agent> --days 1` and tell the user.
|
|
153
|
+
**Second opinion** (`orq pick opinion`, read only, same attachments): only on **heavy** issues or when reviewer and
|
|
154
|
+
implementer disagree about a blocker. It never becomes a round by itself: you weigh both answers and decide.
|
|
155
|
+
**Before dispatching:** `git -C $R fetch origin $BASE; git -C $WT merge-base --is-ancestor origin/$BASE HEAD` — if it
|
|
156
|
+
fails, don't review yet: send a fix "rebase on origin/<BASE> and repeat the checks".
|
|
157
|
+
Always **in the same worktree `$WT`**, with the prompt in `$WS/.orquestra/<ID>/review-<repo>.md` = acceptance
|
|
158
|
+
criteria + "review only the attached diff; answer APPROVED or a numbered list of problems (blocker/suggestion)".
|
|
159
|
+
Fixed review checklist, besides the criteria: (a) identifiers/keys consistent across the touched modules (same concept
|
|
160
|
+
= same field); (b) dependency downgrade, override or pin → check the CVE/advisory behind the current version; (c) the
|
|
161
|
+
repo checklist.
|
|
162
|
+
|
|
163
|
+
## 6. Loop
|
|
164
|
+
Blocking problems → write the list to `$O/fix-<n>.md` and continue the implementer's session (any agent):
|
|
165
|
+
`herdr-agent -a <same> [-c <same account>] -g <group> -t "<ID> fix<n> <repo>" -d $WT -o $O/impl-<repo> -R $(cat $O/impl-<repo>.id) -- $O/fix-<n>.md`.
|
|
166
|
+
A fix is a continuation: same agent and session, no `orq pick`. Then a new `herdr-verify` (4b) and a new review
|
|
167
|
+
(`orq pick review` again). **Maximum: `orq config get policy.max_rounds` rounds**; over it → `orq pick impl
|
|
168
|
+
--exclude-agent <it>` only with the user's OK, or stop and report. Non-blocking suggestions go into the comment; they
|
|
169
|
+
don't become a round.
|
|
170
|
+
|
|
171
|
+
## 7. Close
|
|
172
|
+
**Commit/PR conventions belong to the repo, not to you.** The **implementer, in the worktree** (where the repo's
|
|
173
|
+
rules live) commits and writes the PR. Find and cite in the prompt, by path, whatever the repo has:
|
|
174
|
+
`.claude/skills/commit-conventions/SKILL.md` or `.agents/skills/commit-conventions/SKILL.md`,
|
|
175
|
+
`.github/pull_request_template.md`, `commitlint.config.*`. None of those → plain Conventional Commits.
|
|
176
|
+
- Commits: from step 4 on, the prompt says "follow <commit conventions path>". If the review flags a deviation, ask the
|
|
177
|
+
implementer for `git commit --amend`/`rebase -i` before the PR.
|
|
178
|
+
- PR (**only when the user asks**): you, in `$WT`: `git -C $WT push -u origin <branch>` and `gh pr create` with a body
|
|
179
|
+
built **from the repo's `.github/pull_request_template.md`** (every section; `<ID>` where the template asks for the
|
|
180
|
+
issue) and the answer in `$O/impl-<repo>.out.md`. Check the opened PR against the template.
|
|
181
|
+
- Plane comment (`workitem_comment create`): summary, repo(s), branch, agents and models used (`orq pick` output),
|
|
182
|
+
review result, checks that ran.
|
|
183
|
+
- **CI after every push:** `gh pr checks <n>` (no `--watch`; if pending, end your turn and check on the next notice).
|
|
184
|
+
Red → `gh run view <id> --log-failed | tail -40`: error from the diff → fix round; error already on the base → create
|
|
185
|
+
a Plane issue (workspace standard) and tell the user. "Ready to merge" only with green checks or an explained failure
|
|
186
|
+
+ issue.
|
|
187
|
+
- Move it to **In Review** (finished child tabs close by themselves; close any leftover with
|
|
188
|
+
`herdr tab list | jq -r '.result.tabs[]|select(.label|startswith("<ID> "))|.tab_id' | xargs -rn1 herdr tab close`)
|
|
189
|
+
and **release the issue**: `herdr-claim -w $WS -r <ID>`. The worktree stays until the merge.
|
|
190
|
+
- **After the merge** (when the user confirms): `git -C $R fetch origin $BASE; git -C $R cherry origin/$BASE <branch>`
|
|
191
|
+
with no `+` lines → `git -C $R worktree remove $WT` and `git -C $R branch -D <branch>`; with `+` lines → ask.
|
|
192
|
+
- **Never** push, PR, merge or deploy unless the user asks. Report to the user in 3–5 lines.
|
|
193
|
+
|
|
194
|
+
## Saving tokens
|
|
195
|
+
Short prompts (never paste the whole `CLAUDE.md` — the agent reads the repo's own). Reviews judge only the diff, but the prompt must say the reviewer **may open files for context** (cat, rg, git
|
|
196
|
+
show — read only): Codex read "review only the diff" as "use only the attached diff" and returned an empty review. Don't re-read
|
|
197
|
+
the whole issue at every step. Respect the MCP limitations listed in the workspace `CLAUDE.md`.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orq-setup
|
|
3
|
+
description: Guided first-time setup of orq for a new developer — detects and smoke-tests the installed agent CLIs, asks which agents take which roles, models, Claude accounts and pick weights, writes ~/.config/orq/config.toml, then prepares a conductor workspace (orq setup --workspace + workspace CLAUDE.md) and checks Plane. Use when the user says "/orq-setup", "set up orq", "configure orq" or just installed orq (npm i -g @irythill/orq, or install.sh).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /orq-setup — configure orq for this developer
|
|
7
|
+
|
|
8
|
+
You are setting up orq for someone who just installed it (`npm i -g @irythill/orq`, or `install.sh` from a clone).
|
|
9
|
+
Be brief, one step at a time. Talk to the user in the user's language. **Ask before writing or running anything that
|
|
10
|
+
costs tokens or changes files**; show what you will write first. Never handle API keys or tokens yourself: tell the
|
|
11
|
+
user where to put them.
|
|
12
|
+
`$ORQ` = docs and examples: a clone of the repo if there is one, else https://github.com/irythill/orq (`docs/`,
|
|
13
|
+
`examples/`; the npm package ships only the CLI, the skills and the workspace template).
|
|
14
|
+
|
|
15
|
+
## 0. Preflight
|
|
16
|
+
- `command -v orq` missing → tell the user to run `npm i -g @irythill/orq` and stop.
|
|
17
|
+
- `orq setup --install`: shows what orq found (git, terminal host, memory cap, keyring, shell completion) and links
|
|
18
|
+
the skills for Claude Code. `git` missing → stop: it is required. herdr is optional (tabs per child; on Linux,
|
|
19
|
+
`$ORQ/install.sh` adds it as a service): without it children run in tmux windows or in the background.
|
|
20
|
+
- Existing `~/.config/orq/config.toml` (or `config.json`)? Show it in short and ask: start over, or adjust it.
|
|
21
|
+
|
|
22
|
+
## 1. Detect and smoke-test the agents
|
|
23
|
+
- `command -v claude codex opencode agy copilot` → list what's installed (`agy` = Antigravity).
|
|
24
|
+
- Offer one headless smoke test per agent found. Say that **each costs a few tokens** and needs the CLI logged in; run
|
|
25
|
+
only the ones the user approves (AskUserQuestion, multiSelect), one at a time, with a timeout:
|
|
26
|
+
```bash
|
|
27
|
+
timeout 120 claude -p "reply ok"
|
|
28
|
+
timeout 120 codex exec --skip-git-repo-check "reply ok"
|
|
29
|
+
timeout 120 opencode run "reply ok"
|
|
30
|
+
timeout 120 agy -p "reply ok"
|
|
31
|
+
timeout 120 copilot -p "reply ok" -s
|
|
32
|
+
```
|
|
33
|
+
- Report a table: agent · installed · test ok/failed/skipped. Failed → likely not logged in: tell the user the login
|
|
34
|
+
command (`claude`, `codex login`, `opencode auth login`, `agy`, `copilot` then `/login`) and offer to retest. Only
|
|
35
|
+
agents that passed (or that the user insists on) go into the config.
|
|
36
|
+
|
|
37
|
+
## 2. Agents and roles — `orq setup` suggests, the user decides
|
|
38
|
+
Don't ask "which roles should this agent take?": newcomers can't answer that. Ask what they know (AskUserQuestion)
|
|
39
|
+
and let `orq setup` apply the rules (src/suggest.ts):
|
|
40
|
+
- per working agent: **plan** — `free` · `small` (Pro, Copilot Pro, monthly allowance) · `large` (Max, high tiers) ·
|
|
41
|
+
`payg` (API, MiniMax); its **vendor** only for agents orq doesn't know (opencode: the provider, e.g. `minimax`);
|
|
42
|
+
- which one they **trust most** to write code (optional);
|
|
43
|
+
- where they will **talk to orq** (the conductor): an agent name, or `other`;
|
|
44
|
+
- how many tasks they usually run **in parallel**; how much **RAM** agents may use (suggest total RAM).
|
|
45
|
+
Then write the answers to a temp file and show the proposal:
|
|
46
|
+
```bash
|
|
47
|
+
orq setup --answers /tmp/orq-answers.json # {"agents":{"codex":{"plan":"large","trust":true},...},"conductor":"claude","parallel":3,"ramGB":16}
|
|
48
|
+
```
|
|
49
|
+
Explain each `# Why:` line in plain words and ask what to change. Whatever they fix becomes `[roles.<role>] agent = ...`;
|
|
50
|
+
the rest stays `auto`. Presets for those who want no questions: `--preset economy | quality | single-agent`.
|
|
51
|
+
**Models** (`models.<role>.<level> = "model[@effort]"`): optional — without them each CLI uses its default model.
|
|
52
|
+
Offer `$ORQ/examples/irythill/config.toml` as an example, saying clearly **it is one person's choices**.
|
|
53
|
+
**quota names:** what `orq quota` prints for that agent.
|
|
54
|
+
|
|
55
|
+
## 3. Claude accounts
|
|
56
|
+
- `claude-accounts` lists them. None and the user has more than one account → offer to create
|
|
57
|
+
`~/.config/claude-accounts` (lines `<name> <CLAUDE_CONFIG_DIR>`, e.g. `work ~/.claude`, `personal ~/.claude-personal`)
|
|
58
|
+
and explain the alias + one-time login from `$ORQ/docs/claude-accounts.md`. One account → skip; `quota = ["<name>"]`
|
|
59
|
+
only if listed there.
|
|
60
|
+
- Re-run `orq setup --install` afterwards so the skills are linked into each account's folder too.
|
|
61
|
+
|
|
62
|
+
## 4. Policy
|
|
63
|
+
Explain simply, then suggest the example's values and ask if they want to change any:
|
|
64
|
+
- `quota_limit` (90): an agent at or above this % of its 5h/weekly quota is left out.
|
|
65
|
+
- weights — already suggested by `orq setup` from the parallel tasks: `quality` (did it deliver?), `tokens` (spent
|
|
66
|
+
little?), `speed` (finished fast?), `rotation` (penalty for being picked recently, spreads the work).
|
|
67
|
+
- `max_rounds` (2) review rounds before handing back; `machine.agent_mem_max` / `test_mem_max` come from `orq setup`
|
|
68
|
+
(RAM and parallel tasks) — the user may change them.
|
|
69
|
+
- **Language** of orq's messages (board, notices, CLI): `[ui] lang = "auto" | "en" | "pt"` (auto = system locale).
|
|
70
|
+
Suggest the language the user is talking to you in. Mention they can switch any time with `orq lang toggle`, the
|
|
71
|
+
`l` key in `orq board`, or a herdr key bound to the `orq.lang-toggle` action (see the comments in
|
|
72
|
+
`herdr-plugin/herdr-plugin.toml`).
|
|
73
|
+
- **Board theme**: `[ui] theme = "gunmetal"` (default, dark) | `"chrome"` (light) | `"lcd"` (green) | `"terminal"`.
|
|
74
|
+
Light terminal → suggest `chrome`; they can cycle with `t` inside `orq board`.
|
|
75
|
+
|
|
76
|
+
## 5. Write and validate
|
|
77
|
+
- Show the full TOML (the proposal plus the changes they asked for). After the OK: `orq setup --answers <file> --write`
|
|
78
|
+
(backs up an existing config as `config.toml.bak-<timestamp>`), then apply their edits with `orq set` or by editing
|
|
79
|
+
the file.
|
|
80
|
+
- Validate: `orq config files` and `orq config` (exit 2 = error: fix and retry).
|
|
81
|
+
- Show the picks: `orq pick impl --level medium --explain --no-record` and
|
|
82
|
+
`orq pick review --impl-agent <their main implementer> --explain --no-record`. Exit 3 = no candidate: explain why
|
|
83
|
+
(roles, vendor, quota) and adjust.
|
|
84
|
+
|
|
85
|
+
## 6. Workspace
|
|
86
|
+
- Ask for the folder that groups their repos (e.g. `~/Code/acme-platform`). After the OK:
|
|
87
|
+
`orq setup --workspace <folder> --conductor <the conductor agent>` — `.orquestra/`, `.worktrees/`, the map
|
|
88
|
+
`<folder>/CLAUDE.md` from the template (never overwrites one) and the `/issue` playbook in the conductor's format
|
|
89
|
+
(`.claude/skills/issue/SKILL.md` for Claude Code, `AGENTS.md` for the others). Conductor in herdr (clone only):
|
|
90
|
+
`$ORQ/setup/new-conductor.sh <name> <folder>` also writes its instructions and permissions.
|
|
91
|
+
- Fill the repo table in `<folder>/CLAUDE.md` by inspecting each git repo inside it:
|
|
92
|
+
- base branch: `git -C <repo> symbolic-ref --short refs/remotes/origin/HEAD` (strip `origin/`); ask if the team
|
|
93
|
+
branches from another one (e.g. `dev`).
|
|
94
|
+
- group: the repo folder name in lower case (the herdr workspace or tmux group for its children).
|
|
95
|
+
- stack and verification: `package.json` scripts (lint, typecheck, test) with the package manager from the lockfile;
|
|
96
|
+
otherwise `Makefile`, `pyproject.toml`, `Cargo.toml`, `go.mod`… Leave `—` when nothing fits.
|
|
97
|
+
Show the filled table and write it only after the OK. Plane projects and the issue standard: ask, or leave the
|
|
98
|
+
placeholders and say so.
|
|
99
|
+
|
|
100
|
+
## 7. Plane
|
|
101
|
+
- Point to `$ORQ/docs/plane.md` (on GitHub without a clone). Check `claude mcp list` (and `CLAUDE_CONFIG_DIR=<dir> claude mcp list` for every
|
|
102
|
+
account that will run a conductor) for a `plane` server.
|
|
103
|
+
- Missing → tell the user to follow docs/plane.md; the API key goes in **their** MCP config, typed by them, never in
|
|
104
|
+
this chat or in a repo.
|
|
105
|
+
|
|
106
|
+
## 8. Wrap up
|
|
107
|
+
Short checklist: agents tested and enabled (roles), accounts, config path (+ backup), workspace and repos filled,
|
|
108
|
+
Plane ok/pending, anything skipped. Then how to start:
|
|
109
|
+
```bash
|
|
110
|
+
cd <folder> && claude # any terminal (or codex, opencode… reading AGENTS.md)
|
|
111
|
+
cd <folder> && herdr-conductor # or inside a herdr pane (clone + install.sh)
|
|
112
|
+
```
|
|
113
|
+
and in the conductor: `/issue DEMO-123`. `orq board` in another tab shows everything; shell completion:
|
|
114
|
+
`orq completion bash|zsh|fish|powershell` (the line to add is in `orq setup --install`).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orq-status
|
|
3
|
+
description: Read-only summary of the orq orchestration in chat — test queue, running agents, conductors and their issues, quota per agent/account, active blocks and the recent scoreboard (orq stats). Use when the user says "/orq-status", "how's the queue", "what's running", "how much quota is left" or asks for an orq status report.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /orq-status — orchestration status in chat
|
|
7
|
+
|
|
8
|
+
**Read only.** Collect, summarize, stop. Do not dispatch, kill, unblock, or claim anything: if something looks
|
|
9
|
+
wrong, point it out and suggest the command, but let the user decide. Talk to the user in the user's language.
|
|
10
|
+
|
|
11
|
+
## 1. Collect (one Bash call, all in parallel is fine)
|
|
12
|
+
```bash
|
|
13
|
+
orq board --once 2>&1 # queue, agents, conductors, quota
|
|
14
|
+
orq block -l # agents/accounts out of orq pick
|
|
15
|
+
orq stats --days ${DAYS:-7} # scoreboard (default: last 7 days)
|
|
16
|
+
```
|
|
17
|
+
- `orq board --once` (plain text when piped; `--json` for exact fields) already gathers the test queue (TRANSPORT), running agents (TRACKS), conductors with their
|
|
18
|
+
claimed issues (MASTER) and quota (MIXER). Its quota comes from a cache refreshed in the background: if MIXER says
|
|
19
|
+
"collecting..." (or the cache is old and the user asked about quota), run `orq quota` directly instead.
|
|
20
|
+
- The user passed a number (`/orq-status 30`)? Use it as `--days`. `-w <workspace>` → pass it to `orq stats -w` and
|
|
21
|
+
as `-w <workspace>` to the board.
|
|
22
|
+
- A command missing or failing (e.g. herdr not running): say so in one line and summarize what the others returned.
|
|
23
|
+
`orq quota` exiting 1 is a known quirk (last agent not requested), not a failure — use its output.
|
|
24
|
+
|
|
25
|
+
## 2. Summarize (short, scannable)
|
|
26
|
+
Sections in this order; skip a section that is empty, saying so in one line ("queue empty", "no agents running"):
|
|
27
|
+
1. **Test queue** — what is running (issue, repo, for how long) and how many are waiting.
|
|
28
|
+
2. **Agents** — one line each: issue, label, agent·model, elapsed, memory. Flag ⚠ for >3 h running, memory near
|
|
29
|
+
the cap, or orphans (no `.run.sh`).
|
|
30
|
+
3. **Conductors** — issue(s) and state; call out any **asking for approval** (the user must act there).
|
|
31
|
+
4. **Quota** — per account/agent, the higher of 5h/week. Flag ≥70 % and ≥90 %; `?` = no data (log in again).
|
|
32
|
+
Add active blocks from `orq block -l` with their end date.
|
|
33
|
+
5. **Scoreboard** — per agent: runs, first-pass approval, median duration, new tokens. Two or three lines, not the
|
|
34
|
+
whole table, unless the user asks.
|
|
35
|
+
|
|
36
|
+
End with **at most two** suggested next actions, only when something needs attention (e.g. "Antigravity block
|
|
37
|
+
ends 16/10: `orq block -r antigravity` when quota is back"; "conductor X is waiting for your approval").
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# CLAUDE.md — {{NAME}} ecosystem ({{WORKSPACE}})
|
|
2
|
+
|
|
3
|
+
This folder groups the ecosystem's repositories. Each repo has its own `CLAUDE.md`/`AGENTS.md` with commands and
|
|
4
|
+
rules — read the repo's own before touching it. This file only holds the map and the orchestration settings.
|
|
5
|
+
|
|
6
|
+
## Orchestration (read by the `/issue` skill)
|
|
7
|
+
- **Workspace:** `{{WORKSPACE}}`
|
|
8
|
+
- **Conductor (herdr):** opened with `herdr-conductor [account] [model] [-r <session-id>]` in a herdr pane, in this folder
|
|
9
|
+
(instructions in `.orquestra-conductor.md`); the **Group** in the table below is the herdr workspace (`-g`).
|
|
10
|
+
Tests from the Verification column (jest/vitest) **don't run in the child**: the conductor runs `herdr-verify` (`orq verify`
|
|
11
|
+
outside herdr; one at a time on the machine); the child does lint + `tsc` (`NODE_OPTIONS=--max-old-space-size=2048`).
|
|
12
|
+
- **Agents:** chosen by `orq-pick` from each developer's `~/.config/orq/config.toml` — nothing about models here.
|
|
13
|
+
|
|
14
|
+
## Repositories
|
|
15
|
+
|
|
16
|
+
| Folder | What it is | Stack / PM | Group | Base | Verification | Checklist |
|
|
17
|
+
|---|---|---|---|---|---|---|
|
|
18
|
+
| `{{repo}}` | {{description}} | {{stack}} | `{{group}}` | `dev` | `{{lint}}`, `{{typecheck}}`, `{{test}}` | {{what every implementer must remember in this repo, or —}} |
|
|
19
|
+
|
|
20
|
+
## How they connect
|
|
21
|
+
- {{who consumes whom; what changes first when a contract changes}}
|
|
22
|
+
|
|
23
|
+
## Branches
|
|
24
|
+
- Work starts from an **updated `origin/<Base>`** (Base column) and comes back through a PR to the same base.
|
|
25
|
+
- **Branch prefix:** `{{prefix, e.g. your-user/ — or empty}}` → one branch per issue `<prefix>plane-<lowercase-id>`.
|
|
26
|
+
Worktrees in `{{WORKSPACE}}/.worktrees/<repo>-plane-<id>`.
|
|
27
|
+
- Commit/PR conventions live **in each repo** (`.claude|.agents/skills/commit-conventions`,
|
|
28
|
+
`.github/pull_request_template.md`, `commitlint`) — don't copy them here; the `/issue` skill tells the implementer
|
|
29
|
+
to follow them.
|
|
30
|
+
- **Never** merge, push to the base/`main` or deploy unless the user asks.
|
|
31
|
+
|
|
32
|
+
## Plane ({{PLANE_URL}}, workspace `{{SLUG}}`)
|
|
33
|
+
| Project | Identifier | project_id | Repos |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| {{name}} | `{{ID}}` | `{{uuid}}` | {{repos}} |
|
|
36
|
+
|
|
37
|
+
States: Backlog → Todo → In Progress → **In Review** → Done.
|
|
38
|
+
|
|
39
|
+
### Issue standard (when creating or triaging)
|
|
40
|
+
- **State**: `Todo` if ready, `Backlog` if still an idea.
|
|
41
|
+
- **Assignee**: `{{user}}` → `{{user_id}}`.
|
|
42
|
+
- **Created by**: automatic (owner of the MCP token).
|
|
43
|
+
- **Priority**: `urgent` / `high` / `medium` (default) / `low`.
|
|
44
|
+
- **Labels**: {{convention — e.g. 1 type + at least 1 area}}.
|
|
45
|
+
- **Module**: pick an existing, active one; none fits → propose one to the user before creating it.
|
|
46
|
+
- **Parent/relation** to the originating issue, when there is one.
|
|
47
|
+
|
|
48
|
+
### MCP limitations
|
|
49
|
+
- {{e.g. don't use `pql`; `workitem count` returns 404}}
|