@damian87/omp 0.9.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/.github/copilot-instructions.md +16 -0
  2. package/.github/skills/create-skill/SKILL.md +3 -3
  3. package/.github/skills/daily-log/SKILL.md +1 -1
  4. package/.github/skills/jira-ticket/SKILL.md +6 -3
  5. package/.github/skills/omp-autopilot/SKILL.md +5 -1
  6. package/.github/skills/ralph/SKILL.md +6 -4
  7. package/.github/skills/research-codebase/SKILL.md +10 -6
  8. package/.github/skills/research-codebase/reference/agent-prompts.md +8 -8
  9. package/.github/skills/schedule/SKILL.md +4 -0
  10. package/.github/skills/slack/SKILL.md +1 -0
  11. package/.github/skills/team/SKILL.md +9 -3
  12. package/.github/skills/team/scripts/team-launch.sh +11 -5
  13. package/.github/skills/ultraqa/SKILL.md +5 -2
  14. package/.github/skills/ultrawork/SKILL.md +9 -5
  15. package/.github/skills/weighted-consensus/SKILL.md +8 -3
  16. package/README.md +4 -1
  17. package/dist/src/cli.js +10 -1
  18. package/dist/src/cli.js.map +1 -1
  19. package/dist/src/comms/index.d.ts +13 -6
  20. package/dist/src/comms/index.js +65 -10
  21. package/dist/src/comms/index.js.map +1 -1
  22. package/dist/src/copilot/doctor.d.ts +1 -0
  23. package/dist/src/copilot/doctor.js +242 -8
  24. package/dist/src/copilot/doctor.js.map +1 -1
  25. package/dist/src/copilot/env-passthrough.d.ts +16 -0
  26. package/dist/src/copilot/env-passthrough.js +28 -0
  27. package/dist/src/copilot/env-passthrough.js.map +1 -0
  28. package/dist/src/copilot/launch.js +22 -6
  29. package/dist/src/copilot/launch.js.map +1 -1
  30. package/dist/src/copilot/setup.js +13 -0
  31. package/dist/src/copilot/setup.js.map +1 -1
  32. package/dist/src/copilot/trust.d.ts +22 -0
  33. package/dist/src/copilot/trust.js +62 -0
  34. package/dist/src/copilot/trust.js.map +1 -0
  35. package/dist/src/cost/index.d.ts +3 -0
  36. package/dist/src/cost/index.js +4 -0
  37. package/dist/src/cost/index.js.map +1 -0
  38. package/dist/src/cost/ledger.d.ts +21 -0
  39. package/dist/src/cost/ledger.js +72 -0
  40. package/dist/src/cost/ledger.js.map +1 -0
  41. package/dist/src/cost/summary.d.ts +22 -0
  42. package/dist/src/cost/summary.js +68 -0
  43. package/dist/src/cost/summary.js.map +1 -0
  44. package/dist/src/cost/tokenize.d.ts +7 -0
  45. package/dist/src/cost/tokenize.js +24 -0
  46. package/dist/src/cost/tokenize.js.map +1 -0
  47. package/dist/src/gateway/notify.d.ts +1 -1
  48. package/dist/src/gateway/notify.js +1 -1
  49. package/dist/src/gateway/notify.js.map +1 -1
  50. package/dist/src/instructions-memory.js +7 -6
  51. package/dist/src/instructions-memory.js.map +1 -1
  52. package/dist/src/team/tmux.d.ts +1 -1
  53. package/dist/src/team/tmux.js +41 -10
  54. package/dist/src/team/tmux.js.map +1 -1
  55. package/docs/general-skills.md +1 -0
  56. package/docs/plans/copilot-native-hooks.md +119 -0
  57. package/docs/plans/verification-plan.md +104 -0
  58. package/hooks/hooks.json +59 -72
  59. package/package.json +1 -1
  60. package/plugin.json +1 -1
  61. package/scripts/agent-stop.mjs +87 -0
  62. package/scripts/error.mjs +9 -7
  63. package/scripts/lib/cost-ledger.mjs +91 -0
  64. package/scripts/lib/hook-input.mjs +51 -0
  65. package/scripts/lib/hook-output.mjs +77 -6
  66. package/scripts/lib/loop-driver.mjs +44 -0
  67. package/scripts/lib/minify.mjs +80 -0
  68. package/scripts/post-tool-use-failure.mjs +21 -0
  69. package/scripts/post-tool-use.mjs +71 -8
  70. package/scripts/pre-tool-use.mjs +8 -6
  71. package/scripts/prompt-submit.mjs +14 -9
  72. package/scripts/session-end.mjs +7 -5
  73. package/scripts/session-start.mjs +8 -11
@@ -13,6 +13,22 @@ Default behaviours installed with this repo. Override per project as needed.
13
13
  - Read the diff before committing.
14
14
  - If unsure about scope, ask.
15
15
 
16
+ ## Cost/token discipline
17
+ Cost data is local, best-effort, and estimated. `omp cost [--today] [--session <id>]`
18
+ summarizes prompt/tool token estimates from the hook ledger; it is not provider billing.
19
+
20
+ The cost hooks apply when this plugin's `hooks/hooks.json` is active in a Copilot CLI
21
+ session. They give session-wide visibility for skills invoked inside that session, not
22
+ standalone coverage for copied skills, raw shell scripts, or external CLIs.
23
+
24
+ Before rerunning noisy commands or failed edits, inspect the latest output and narrow the
25
+ next attempt. Prefer bounded summaries for large logs. Oversized postToolUse output is
26
+ minimized before it re-enters model context, with raw output preserved on disk and savings
27
+ recorded in the cost ledger. Diagnostics (errors, stack traces, assertions) are preserved
28
+ inline; other trimmed detail must be recovered by re-reading the raw file path noted in the
29
+ hook output (an extra tool call), so full fidelity depends on the model following that pointer.
30
+ Budget gates and retry-cost guidance are not current live behavior.
31
+
16
32
  ## Skills
17
33
  Slash commands under `.github/skills/<name>/SKILL.md` are auto-discovered by Copilot. See `omp list` for the catalog active in this project.
18
34
 
@@ -25,13 +25,13 @@ Skills are modular, self-contained packages that extend agent capabilities by pr
25
25
  ### Three-Level Loading System
26
26
 
27
27
  1. **Metadata (name + description)** - Always in context (~100 words)
28
- 2. **SKILL.md body** - When skill triggers (<200 lines, ideally <500 lines for optimal performance)
28
+ 2. **SKILL.md body** - When skill triggers (under 200 lines; split overflow into `references/`)
29
29
  3. **Bundled resources** - As needed by agent (unlimited)
30
30
 
31
31
  ### Why Progressive Disclosure Matters
32
32
 
33
- - 85% reduction in initial context load
34
- - Activation times drop from 500ms+ to under 100ms
33
+ - Smaller initial context load
34
+ - Faster activation the agent loads the body only when the skill triggers
35
35
  - Agent loads only what's needed, when it's needed
36
36
  - Skills remain maintainable and focused
37
37
 
@@ -23,7 +23,7 @@ The SessionStart hook injects a one-line breadcrumb, e.g.:
23
23
 
24
24
  ```
25
25
  [DAILY LOG] Goal: <today's goal>
26
- N entries logged in the last 7 days — run `omp daily-log read` to load if relevant.
26
+ N entries logged in the last 7 days — run `omp daily-log read --days 7` to load if relevant.
27
27
  ```
28
28
 
29
29
  If the breadcrumb looks relevant to what the user is asking for — same feature, an open
@@ -16,21 +16,24 @@ Use `/jira-ticket` when work tracking is requested.
16
16
  ## Operations
17
17
 
18
18
  ### Create
19
- - Build from an approved plan or implementation slice
19
+ - Build from an approved plan or implementation slice (a plan file or markdown)
20
20
  - Include: Summary, Description, Acceptance Criteria
21
- - If Jira config is available, create via API; otherwise output a dry-run payload
21
+ - Render the payload with `omp jira render <plan-file>` — this **never** writes to Jira. To create/comment/update, run `omp jira apply <plan-file-or-ticket-key>`, which defaults to **dry-run** and only writes when Jira is configured with `JIRA_MODE=live`, the user has explicitly confirmed, and the CLI has explicit body/field support for the operation you need.
22
22
 
23
23
  ### Comment
24
24
  - Add implementation evidence, verification results, or status updates
25
25
  - Format for readability (use Jira wiki markup, not Markdown)
26
+ - Draft the comment payload and preview via dry-run only; do not run live comment writes from this skill until the CLI accepts an explicit comment body/body file.
26
27
 
27
28
  ### Safe update
28
29
  - Only update known simple fields (summary, description, labels)
30
+ - Draft update fields and preview via dry-run only; do not run live update writes from this skill until the CLI accepts explicit update fields.
29
31
  - Do not guess transitions, issue links, project keys, or secrets
30
32
 
31
33
  ## Rules
32
34
 
33
- - If Jira config is missing, always output a **dry-run payload** never fail silently
35
+ - Always preview with `omp jira render` or `omp jira apply … --dry-run` (the default); live writes require explicit user confirmation plus CLI support for the exact payload being written
36
+ - If Jira config is missing, the commands stay in dry-run and print the payload — never fail silently
34
37
  - Do not guess project keys, transitions, or credentials
35
38
  - Keep acceptance criteria testable and specific
36
39
  - Include file paths and evidence when commenting with implementation details
@@ -32,7 +32,7 @@ Run `/research-codebase` to understand current state. Skip if you already have f
32
32
 
33
33
  ### Phase 2 — Plan
34
34
 
35
- Run `/ralplan` to produce an implementation plan with acceptance criteria. If a consensus plan already exists from a prior `/ralplan`, skip this phase.
35
+ Run `/ralplan` to produce an implementation plan with acceptance criteria. If a plan already exists from a prior `/ralplan`, skip this phase.
36
36
 
37
37
  ### Phase 3 — Execute
38
38
 
@@ -73,3 +73,7 @@ Before claiming done:
73
73
  - [ ] Lint clean (if applicable)
74
74
  - [ ] `/verify` or `/ultraqa` produced PASS evidence
75
75
  - [ ] No uncommitted work left behind
76
+
77
+ ## Cost/token note
78
+
79
+ This skill can drive multiple tool calls or long-running output. Use `omp cost [--today] [--session <id>]` for local hook-ledger estimates only; it is not provider billing. Keep injected summaries concise and prefer bounded output when rerunning noisy commands.
@@ -21,16 +21,18 @@ Use `/ralph` when one owner should complete one clear task end-to-end.
21
21
 
22
22
  ## Input
23
23
 
24
- Accept a plan from `/ralplan`, a ticket, or a concrete task description. If a `/ralplan` consensus plan exists, use its acceptance criteria as your definition of done.
24
+ Accept a plan from `/ralplan`, a ticket, or a concrete task description. If a `/ralplan` plan exists, use its acceptance criteria as your definition of done.
25
25
 
26
26
  ## Steps
27
27
 
28
- 1. **Start** from the plan or task. State what "done" looks like before writing code.
28
+ 1. **Register the loop** run `omp ralph start "<task>" --max-iterations 10`. This tracks the loop so `omp ralph status` and `/team` nudges can see it and the iteration cap is enforced. State what "done" looks like before writing code.
29
29
  2. **Implement** one slice at a time, in plan order.
30
30
  3. **Verify after each slice** — run tests, lint, type-check. Do not batch verification to the end.
31
31
  4. **Fix** any failures immediately before moving to the next slice.
32
- 5. **Repeat** until all slices complete with evidence, or a blocker is hit.
33
- 6. **Final verification** run the full test suite one last time after all slices.
32
+ 5. **Tick the loop** run `omp ralph tick` after each slice. If it reports the iteration cap is reached, stop and report.
33
+ 6. **Repeat** until all slices complete with evidence, or a blocker is hit.
34
+ 7. **Final verification** — run the full test suite one last time after all slices.
35
+ 8. **End the loop** — run `omp ralph cancel` once done or blocked, so the tracked state is cleared.
34
36
 
35
37
  ## Circuit breaker
36
38
 
@@ -22,7 +22,7 @@ Respond: "I'm ready to research the codebase. What area or question should I inv
22
22
 
23
23
  ### 1. Read mentioned files
24
24
 
25
- If the user references specific files, read them with `view` in the **main context** before anything else.
25
+ If the user references specific files, read them directly in the **main context** before anything else.
26
26
 
27
27
  ### 2. Scope the tech stack
28
28
 
@@ -32,14 +32,14 @@ Detect from `package.json`, config files, directory structure, and project conve
32
32
 
33
33
  | Tier | When | Agent strategy |
34
34
  |------|------|----------------|
35
- | **Small** | Single file/component, narrow question | Main agent reads directly. No subagents. |
36
- | **Medium** | Cross-file, single area (e.g. "how does auth work") | 1–2 `explore` agents for locate + analyse |
37
- | **Large** | Cross-cutting, multi-area (e.g. "map the entire API layer") | Parallel locatoranalyserpattern-finder (see `reference/agent-prompts.md`) |
35
+ | **Small** | Single file/component, narrow question | Read and search directly (glob/grep/read). No delegation. |
36
+ | **Medium** | Cross-file, single area (e.g. "how does auth work") | Locate with glob/grep, then read and analyse the hits directly. |
37
+ | **Large** | Cross-cutting, multi-area (e.g. "map the entire API layer") | Sweep area-by-area (locate analysefind patterns), or delegate areas to parallel `omp team` workers (see `reference/agent-prompts.md`). |
38
38
 
39
39
  ### 4. Research
40
40
 
41
- - Track subtasks via SQL `todos` table
42
- - For medium/large: read `reference/agent-prompts.md` for subagent prompt templates
41
+ - Track subtasks in a markdown checklist as you go
42
+ - For large: read `reference/agent-prompts.md` for `omp team` worker prompt templates
43
43
  - **MUST GATE**: Before writing findings, show file:line evidence for every claim
44
44
 
45
45
  ### 5. Synthesise & write document
@@ -56,3 +56,7 @@ Show concise summary to user with key file references. Ask if they have follow-u
56
56
  ### 7. Follow-ups
57
57
 
58
58
  If the user has follow-ups, read `reference/follow-up.md` for the append protocol.
59
+
60
+ ## Cost/token note
61
+
62
+ This skill can drive multiple tool calls or long-running output. Use `omp cost [--today] [--session <id>]` for local hook-ledger estimates only; it is not provider billing. Keep injected summaries concise and prefer bounded output when rerunning noisy commands.
@@ -1,8 +1,8 @@
1
- # Subagent Prompt Templates
1
+ # Worker Prompt Templates
2
2
 
3
- Use these templates when spawning `explore` agents via the `task` tool. Only used for **medium** and **large** research tasks.
3
+ Use these templates when delegating research areas to parallel `omp team` workers. Only needed for **large** research tasks; for small/medium, run these roles directly in the main agent with glob/grep/read.
4
4
 
5
- ## Agent roles
5
+ ## Worker roles
6
6
 
7
7
  ### Locator — find WHERE files and components live
8
8
 
@@ -31,8 +31,8 @@ Do not evaluate consistency or suggest changes — only document occurrences.
31
31
 
32
32
  ## Guidelines
33
33
 
34
- - Each agent is stateless — provide complete context in the prompt
35
- - Remind every agent: "You are documenting, not evaluating"
36
- - Run independent explorations in parallel
37
- - For web research (only if user explicitly asks), use a `research` agent instead of `explore`
38
- - **Wait for ALL agents to complete before synthesising**
34
+ - Each worker is stateless — provide complete context in the prompt
35
+ - Remind every worker: "You are documenting, not evaluating"
36
+ - Run independent explorations in parallel across team panes
37
+ - For web research (only if user explicitly asks), do it in the main agent
38
+ - **Collect all worker outputs before synthesising**
@@ -69,3 +69,7 @@ omp schedule add --id nightly-tests --cron "0 2 * * *" \
69
69
  --prompt "Run the test suite; if anything fails, open an issue with the log." \
70
70
  --allow-all-tools --max-runs 7
71
71
  ```
72
+
73
+ ## Cost/token note
74
+
75
+ This skill can drive multiple tool calls or long-running output. Use `omp cost [--today] [--session <id>]` for local hook-ledger estimates only; it is not provider billing. Keep injected summaries concise and prefer bounded output when rerunning noisy commands.
@@ -57,6 +57,7 @@ The CLI returns a structured result:
57
57
  - Success: `posted to <channel> (ts=<ts>[, opened IM])` — relay that.
58
58
  - Failure: `notify failed [<CODE>]: <reason>` — surface the code + reason so the user
59
59
  can act. Common codes:
60
+ - `MISSING_TEXT` — the message body was empty; pass a non-empty `--text`.
60
61
  - `MISSING_TOKEN` — run `omp env init` to set `SLACK_BOT_TOKEN`.
61
62
  - `MISSING_TARGET` — pass `--target` or run `omp env init` to set `SLACK_HOME_CHANNEL`.
62
63
  - `BAD_TARGET` / `BAD_HOME_CHANNEL` — the ID is malformed; show the user the expected shape.
@@ -48,6 +48,8 @@ Write a temporary file at `/tmp/team-lanes-<timestamp>.json`:
48
48
  ### Step 2 — Launch
49
49
 
50
50
  ```bash
51
+ # Installed-plugin path (in a dev checkout the script is at the repo-relative
52
+ # .github/skills/team/scripts/team-launch.sh instead):
51
53
  bash ~/.copilot/installed-plugins/oh-my-copilot/oh-my-copilot/.github/skills/team/scripts/team-launch.sh \
52
54
  --session "team-<name>" --lanes <lanes-file>
53
55
  ```
@@ -76,7 +78,7 @@ Choose this only when the user explicitly wants the team to run in the backgroun
76
78
  ### Launch
77
79
 
78
80
  ```bash
79
- omp team <N>:copilot "<task description>"
81
+ omp team <N>:copilot "<task description>" --name <name>
80
82
  ```
81
83
 
82
84
  The runtime automatically:
@@ -89,9 +91,9 @@ The runtime automatically:
89
91
  ### Monitor and cleanup
90
92
 
91
93
  ```bash
92
- omp team status <team-name> # check progress
94
+ omp team status <name> # check progress (same <name> passed to --name)
93
95
  tmux attach -t omp-team-<name> # watch panes live
94
- omp team shutdown <team-name> # kill when done
96
+ omp team shutdown <name> # kill when done
95
97
  ```
96
98
 
97
99
  ## Prerequisites
@@ -125,3 +127,7 @@ Use `/ralplan` before `/team` to produce the plan. Use `/verify` after completio
125
127
  - Each pane is an independent session — no shared state
126
128
  - Workers can message each other via `omp team api send-message` (runtime mode only)
127
129
  - If tasks depend on each other, use `/ralph` instead
130
+
131
+ ## Cost/token note
132
+
133
+ This skill can drive multiple tool calls or long-running output. Use `omp cost [--today] [--session <id>]` for local hook-ledger estimates only; it is not provider billing. Keep injected summaries concise and prefer bounded output when rerunning noisy commands.
@@ -45,7 +45,9 @@ fi
45
45
  if command -v omp &>/dev/null; then
46
46
  AGENT_CMD="omp --madmax"
47
47
  elif command -v copilot &>/dev/null; then
48
- AGENT_CMD="copilot"
48
+ # --yolo = all permissions (tools+paths+urls) so worker panes never block on a
49
+ # trust/permission dialog. Matches the bypass `omp --madmax` grants.
50
+ AGENT_CMD="copilot --yolo"
49
51
  else
50
52
  echo "Neither omp nor copilot CLI found" >&2; exit 1
51
53
  fi
@@ -78,9 +80,11 @@ wait_for_ready() {
78
80
  return 0
79
81
  fi
80
82
 
81
- # Auto-accept folder trust dialog
83
+ # Auto-accept folder trust dialog. Use the `Enter` key NAME, not C-m:
84
+ # Copilot CLI >=1.0.61 ignores a literal carriage return (C-m) for TUI
85
+ # selection/submit, so C-m left the trust dialog open and the agent hung.
82
86
  if (( accepted == 0 )) && echo "$txt" | grep -q 'Do you trust'; then
83
- tmux send-keys -t "$pane" C-m
87
+ tmux send-keys -t "$pane" Enter
84
88
  accepted=1
85
89
  echo " ↳ Auto-accepted folder trust for $pane"
86
90
  fi
@@ -142,10 +146,12 @@ for i in $(seq 0 $((LANE_COUNT - 1))); do
142
146
  LANE_NAME=$(jq -r ".[$i].name" "$LANES_FILE")
143
147
  PANE_ID="${PANE_IDS[$i]}"
144
148
 
145
- # -l = literal (no key interpretation), then C-m = Enter as a separate call
149
+ # -l = literal (no key interpretation), then submit. Use the `Enter` key NAME,
150
+ # not C-m: Copilot CLI >=1.0.61 ignores a literal carriage return, so C-m left
151
+ # the prompt sitting unsent in the input buffer and the agent never started.
146
152
  tmux send-keys -t "$PANE_ID" -l "$LANE_PROMPT"
147
153
  sleep 0.3
148
- tmux send-keys -t "$PANE_ID" C-m
154
+ tmux send-keys -t "$PANE_ID" Enter
149
155
 
150
156
  echo " 📨 Sent to $PANE_ID ($LANE_NAME)"
151
157
  done
@@ -20,6 +20,8 @@ Use `/ultraqa` after implementation when shallow checks are not enough.
20
20
 
21
21
  ## Steps
22
22
 
23
+ Register the QA run first: `omp ultraqa start "<goal>" --max-cycles 5`. This tracks the cycle count and enforces the cap, and lets `omp ultraqa status`/`cancel` see the run.
24
+
23
25
  ### Cycle 1 (and each subsequent cycle)
24
26
 
25
27
  Number every cycle explicitly: "Cycle 1", "Cycle 2", etc.
@@ -33,13 +35,14 @@ Number every cycle explicitly: "Cycle 1", "Cycle 2", etc.
33
35
 
34
36
  ### After each cycle
35
37
 
38
+ - Record the outcome: `omp ultraqa cycle fail` (issues found) or `omp ultraqa cycle pass` (clean). This increments the counter and reports when the cap is reached.
36
39
  - If issues found → fix and start next cycle
37
- - If clean → report PASS and stop
40
+ - If clean → report PASS and run `omp ultraqa cancel` to clear the run
38
41
  - Track which issues were found and fixed per cycle
39
42
 
40
43
  ## Early exit conditions
41
44
 
42
- - **5 cycles reached** — stop, report remaining issues as known gaps
45
+ - **5 cycles reached** (enforced by `omp ultraqa cycle`) — stop, report remaining issues as known gaps
43
46
  - **Same failure 3 consecutive cycles** — stop, this is a design issue not a bug. Report it for `/ralplan`
44
47
  - **Critical regression found** — stop immediately, report before fixing anything else
45
48
 
@@ -21,17 +21,17 @@ Use `/ultrawork` when there are many independent, low-conflict work items that c
21
21
 
22
22
  ## Composition
23
23
 
24
- Ultrawork is the **parallelism primitive** in the skill stack:
24
+ Ultrawork is the **batch-execution** branch of `/omp-autopilot` Phase 3 — a sibling of `/ralph` (single linear task) and `/team` (parallel panes), not nested inside them:
25
25
  ```
26
- /omp-autopilot → /ralph (persistence) → /ultrawork (parallelism)
26
+ /omp-autopilot → /ralph OR /team OR /ultrawork
27
27
  ```
28
- Ralph wraps ultrawork when a persistent verify loop is needed around batched work.
28
+ Pick `/ultrawork` when the work is many independent mechanical items. It can also be invoked directly.
29
29
 
30
30
  ## Steps
31
31
 
32
32
  ### 1. Inventory
33
33
 
34
- List all tasks. For each, note the files it touches. Flag any collisions.
34
+ Register the batch so the run is tracked and `/team` nudges can see it: `omp ultrawork start "<objective>" --task-count <n>`. Then list all tasks. For each, note the files it touches. Flag any collisions.
35
35
 
36
36
  ### 2. Dependency check
37
37
 
@@ -51,7 +51,7 @@ Process each wave. For each task in the wave:
51
51
 
52
52
  ### 4. Report
53
53
 
54
- Summarise: completed, failed, blocked.
54
+ Summarise: completed, failed, blocked. Then clear the tracked state with `omp ultrawork cancel`.
55
55
 
56
56
  ## Stop conditions
57
57
 
@@ -71,3 +71,7 @@ Summarise: completed, failed, blocked.
71
71
  - `Completed` — items done with evidence
72
72
  - `Failed/blockers` — items that couldn't be completed and why
73
73
  - `Verification` — test/lint/build results per wave
74
+
75
+ ## Cost/token note
76
+
77
+ This skill can drive multiple tool calls or long-running output. Use `omp cost [--today] [--session <id>]` for local hook-ledger estimates only; it is not provider billing. Keep injected summaries concise and prefer bounded output when rerunning noisy commands.
@@ -70,9 +70,10 @@ omp council "<question>" [--models a,b,c | model:role:weight,...] \
70
70
  - Timed-out members that produced valid JSON before the kill signal are
71
71
  automatically recovered as survivors — they are not dropped.
72
72
 
73
- If `omp council` is not found (the published `omp` predates this feature), fall
74
- back to the local build from the repo root: `node dist/src/cli.js council "<question>" ...`
75
- (run `npm run build` first if `dist/` is stale).
73
+ If `omp council` is not found (the published `omp` predates this feature),
74
+ update the global CLI: `npm i -g @damian87/omp@latest`, then re-run `omp council`.
75
+ (The `node dist/src/cli.js council` build only resolves from inside the
76
+ oh-my-copilot repo, so it is not a portable fallback for an arbitrary project.)
76
77
 
77
78
  ### Step 3 — Present the result
78
79
 
@@ -126,3 +127,7 @@ default roster is used.
126
127
 
127
128
  Pair with `/code-review` (pass a review rubric + the diff as context) for a
128
129
  multi-model review verdict, or with `/ralplan` to weigh competing plans.
130
+
131
+ ## Cost/token note
132
+
133
+ This skill can drive multiple tool calls or long-running output. Use `omp cost [--today] [--session <id>]` for local hook-ledger estimates only; it is not provider billing. Keep injected summaries concise and prefer bounded output when rerunning noisy commands.
package/README.md CHANGED
@@ -55,7 +55,7 @@ That's it.
55
55
  - **Persistent execution** — Ralph, UltraQA, and Ultrawork keep going until the goal is verified
56
56
  - **File-state coordination** — workers swap typed messages over an outbox/inbox cursor with atomic `O_EXCL` task locks; no broker or daemon to babysit
57
57
  - **Chat bridge** — `omp gateway` runs long-lived chat connectors (Slack today, more next) so you can DM Copilot from anywhere
58
- - **Lifecycle hooks** — `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `SessionEnd`, `Error`
58
+ - **Lifecycle hooks** — `sessionStart`, `userPromptSubmitted`, `preToolUse`, `postToolUse`, `postToolUseFailure`, `sessionEnd`, `errorOccurred`
59
59
  - **Doctor included** — `omp doctor` verifies plugin manifest, skills discovery, hooks, and the underlying `copilot` CLI in one shot
60
60
 
61
61
  ---
@@ -84,6 +84,7 @@ That's it.
84
84
 
85
85
  - **Context & history as CLI subcommands** — `omp state` (key-value with TTL), `omp project-memory` (notes + directives), `omp trace` (per-session timeline + summary), `omp goal` / `omp memory sync` (managed repo context), `omp daily-log`
86
86
  - **Lightweight Copilot context** — managed instructions keep only the repo goal plus on-demand memory commands; set `OMP_DISABLE_INSTRUCTIONS_MEMORY=1` to skip writing the managed block entirely
87
+ - **Estimated cost ledger** — `omp cost [--today] [--session <id>]` summarizes local prompt/tool token estimates recorded by hooks. These are best-effort estimates, not provider billing.
87
88
  - **File-state worker coordination** — outbox JSONL + byte cursor, atomic `O_EXCL` task locks, optimistic CAS on claim
88
89
  - **Idle nudge** — content-based pane idle detection that pokes stuck workers
89
90
  - **Mode-state loops** — single source of truth per loop (Ralph/Ultrawork/UltraQA state files)
@@ -195,6 +196,7 @@ omp ralph start "<task>" [--max-iterations N]
195
196
  omp ultrawork start "<objective>" [--task-count N]
196
197
  omp ultraqa start "<goal>" [--max-cycles N]
197
198
  omp council "<question>" [--models a,b,c] [--context @file] [--json] # multi-model council
199
+ omp cost [--today] [--session <id>] # summarize estimated hook-ledger tokens
198
200
  omp comms status | send | recv | ask # drive a running copilot tmux session
199
201
  omp gateway serve [--only slack] # run chat connectors (today: slack)
200
202
  omp gateway status [--json] # per-connector readiness (no sockets)
@@ -272,6 +274,7 @@ omp grows in vertical slices. Items aren't pinned to specific semver versions
272
274
  - **Slack outbound — `omp gateway notify`** — stateless REST `chat.postMessage` from any process (cron `--notify-target`, in-session `/slack <message>`, ad-hoc `omp gateway notify --text "..."`). Default destination from `SLACK_HOME_CHANNEL`; explicit `--target slack:C…/G…/D…/U…` overrides; `U…` auto-resolves to a DM via `conversations.open`.
273
275
  - **Weighted-consensus council** — multi-model council with role weights + minority report. Via `omp council` or `/weighted-consensus`.
274
276
  - **Suggest** — `omp suggest "<task>"` recommends a slash-skill workflow without launching one.
277
+ - **Estimated cost ledger** — hook-driven prompt/tool token estimates are visible through `omp cost`; oversized `postToolUse` output is minimized before it re-enters model context, with raw output preserved on disk (diagnostics kept inline; other trimmed detail is recoverable by re-reading the raw path the hook reports — an extra tool call, so best with capable models). Budget gates and retry-cost guidance remain next-step optimization work, not shipped behavior yet.
275
278
 
276
279
  ### Up next
277
280
 
package/dist/src/cli.js CHANGED
@@ -26,7 +26,7 @@ function printResult(result, json) {
26
26
  }
27
27
  }
28
28
  function help() {
29
- return `oh-my-copilot\n\nRun \`omp\` with no arguments to launch copilot (permissions bypass OFF).\nUse \`omp help\` to show this list.\n\nCommands:\n (no args) launch copilot (bypass OFF by default)\n version [--json]\n list [--json]\n setup [--dry-run] [--scope project|user] [--plugin-root <dir>] [--json]\n doctor [--json] [--copilot-bin <path>] [--skip-copilot]\n launch -- <args...>\n --madmax [args...] (bare-flag launch with permissions bypass; alias of --yolo)\n team <N:role> "<task>" [--name <name>] [--json]\n team status <name> [--json]\n team shutdown <name> [--json]\n team api claim-task --input '<json>' [--json]\n team api transition-task-status --input '<json>' [--json]\n team api send-message --input '<json>' [--json]\n team api broadcast --input '<json>' [--json]\n team api mailbox-list --input '<json>' [--json]\n team api mailbox-mark-delivered --input '<json>' [--json]\n council "<question>" [--models a,b,c|m:role:weight] [--context <text|@file>] [--rubric <text|@file>] [--synth <model>] [--probe] [--timeout <ms>] [--synth-timeout <ms>] [--min-survivors <n>] [--max-concurrency <n>] [--tmp-dir <dir>] [--json]\n comms status [--session <name>] [--json] (is copilot on + online? auto-discovers session)\n comms send --text "<prompt>" [--force] [--session <name>] [--json]\n comms recv [--wait] [--lines <n>] [--timeout <ms>] [--session <name>] [--json]\n comms ask --text "<prompt>" [--force] [--lines <n>] [--timeout <ms>] [--session <name>] [--json]\n gateway serve [--only <name>[,<name>]] (run all configured connectors; today: slack)\n gateway status [--json] [--only <name>[,...]] (per-connector readiness; no sockets opened)\n gateway doctor [--json] [--only <name>[,...]] (alias for 'gateway status')\n gateway notify --text "<msg>" [--target slack:C\\|D\\|G\\|U... [:thread_ts]] [--thread-ts <ts>] [--json]\n (one-shot outbound Slack post; falls back to SLACK_HOME_CHANNEL)\n slack serve (deprecated alias for 'gateway serve --only slack')\n slack doctor [--json] (deprecated alias for 'gateway status --only slack')\n env init [--force] (interactive: write ~/.omp/.env with Slack tokens + optional SLACK_HOME_CHANNEL)\n non-interactive: set OMP_INIT_BOT_TOKEN/OMP_INIT_APP_TOKEN/OMP_INIT_HOME_CHANNEL\n (env vars preferred over --bot-token/--app-token/--home-channel flags)\n (--session is optional when exactly one omp-<digits> tmux session is running)\n${registeredCommandHelpLines().join("\n")}\n ralph start "<task>" [--max-iterations <n>] [--session-id <id>] [--json]\n ralph status [--json]\n ralph tick [--json]\n ralph cancel [--json]\n ultrawork start "<objective>" [--task-count <n>] [--summary <s>] [--json]\n ultrawork status [--json]\n ultrawork cancel [--json]\n ultraqa start "<goal>" [--max-cycles <n>] [--json]\n ultraqa cycle pass|fail|pending [--json]\n ultraqa status [--json]\n ultraqa cancel [--json]\n schedule add --id <id> --cron "<expr>" --prompt "<text>" [--bin copilot] [--model <m>] [--cwd <dir>] [--timeout <ms>] [--max-runs <n>] [--ttl-hours <h>] [--allow-all-tools] [--notify-target slack:<ID>] [--dry-run] [--json]\n schedule list [--json]\n schedule status <id> [--json]\n schedule run-now <id> [--json]\n schedule remove <id> [--json]\n goal set "<objective>" [--json]\n goal read [--json]\n memory sync [--json] (render goal+directives into copilot-instructions.md)\n daily-log set-goal "<text>" [--json]\n daily-log add "<text>" [--json]\n daily-log read [--days <n>] [--json]\n daily-log prune [--keep-days <n>] [--json]\n state write <key> <val> [--ttl <s>] | read|delete|status <key> | list | cleanup [--json]\n project-memory read [<id>] | index | add-note "<title>" [--body "<text>"] | add-directive "<rule>" [--json]\n trace timeline [<sessionId>] [--limit <n>] | summary [<sessionId>] | add <sessionId> <event> [<json>] [--json]\n catalog list [--json]\n catalog validate [--json]\n catalog capability <id> [--json]\n project inspect [--json]\n skill install <skill-dir> [--root <repo>] [--scope project|user] [--dry-run] [--json]\n lint:skills [--root <repo>]\n sync:dry-run [--root <repo>]\n jira:dry-run [--root <repo>]\n jira render <plan-file> [--root <repo>] [--json]\n jira apply <ticket-key-or-plan-file> --comment|--update|--transition|--link [--dry-run] [--json]\n`;
29
+ return `oh-my-copilot\n\nRun \`omp\` with no arguments to launch copilot (permissions bypass OFF).\nUse \`omp help\` to show this list.\n\nCommands:\n (no args) launch copilot (bypass OFF by default)\n version [--json]\n list [--json]\n setup [--dry-run] [--scope project|user] [--plugin-root <dir>] [--json]\n doctor [--json] [--copilot-bin <path>] [--skip-copilot] [--hooks]\n cost [--json] [--session <id>] [--days <n>]\n launch -- <args...>\n --madmax [args...] (bare-flag launch with permissions bypass; alias of --yolo)\n team <N:role> "<task>" [--name <name>] [--json]\n team status <name> [--json]\n team shutdown <name> [--json]\n team api claim-task --input '<json>' [--json]\n team api transition-task-status --input '<json>' [--json]\n team api send-message --input '<json>' [--json]\n team api broadcast --input '<json>' [--json]\n team api mailbox-list --input '<json>' [--json]\n team api mailbox-mark-delivered --input '<json>' [--json]\n council "<question>" [--models a,b,c|m:role:weight] [--context <text|@file>] [--rubric <text|@file>] [--synth <model>] [--probe] [--timeout <ms>] [--synth-timeout <ms>] [--min-survivors <n>] [--max-concurrency <n>] [--tmp-dir <dir>] [--json]\n comms status [--session <name>] [--json] (is copilot on + online? auto-discovers session)\n comms send --text "<prompt>" [--force] [--session <name>] [--json]\n comms recv [--wait] [--lines <n>] [--timeout <ms>] [--session <name>] [--json]\n comms ask --text "<prompt>" [--force] [--lines <n>] [--timeout <ms>] [--session <name>] [--json]\n gateway serve [--only <name>[,<name>]] (run all configured connectors; today: slack)\n gateway status [--json] [--only <name>[,...]] (per-connector readiness; no sockets opened)\n gateway doctor [--json] [--only <name>[,...]] (alias for 'gateway status')\n gateway notify --text "<msg>" [--target slack:C\\|D\\|G\\|U... [:thread_ts]] [--thread-ts <ts>] [--json]\n (one-shot outbound Slack post; falls back to SLACK_HOME_CHANNEL)\n slack serve (deprecated alias for 'gateway serve --only slack')\n slack doctor [--json] (deprecated alias for 'gateway status --only slack')\n env init [--force] (interactive: write ~/.omp/.env with Slack tokens + optional SLACK_HOME_CHANNEL)\n non-interactive: set OMP_INIT_BOT_TOKEN/OMP_INIT_APP_TOKEN/OMP_INIT_HOME_CHANNEL\n (env vars preferred over --bot-token/--app-token/--home-channel flags)\n (--session is optional when exactly one omp-<digits> tmux session is running)\n${registeredCommandHelpLines().join("\n")}\n ralph start "<task>" [--max-iterations <n>] [--session-id <id>] [--json]\n ralph status [--json]\n ralph tick [--json]\n ralph cancel [--json]\n ultrawork start "<objective>" [--task-count <n>] [--summary <s>] [--json]\n ultrawork status [--json]\n ultrawork cancel [--json]\n ultraqa start "<goal>" [--max-cycles <n>] [--json]\n ultraqa cycle pass|fail|pending [--json]\n ultraqa status [--json]\n ultraqa cancel [--json]\n schedule add --id <id> --cron "<expr>" --prompt "<text>" [--bin copilot] [--model <m>] [--cwd <dir>] [--timeout <ms>] [--max-runs <n>] [--ttl-hours <h>] [--allow-all-tools] [--notify-target slack:<ID>] [--dry-run] [--json]\n schedule list [--json]\n schedule status <id> [--json]\n schedule run-now <id> [--json]\n schedule remove <id> [--json]\n goal set "<objective>" [--json]\n goal read [--json]\n memory sync [--json] (render goal+directives into copilot-instructions.md)\n daily-log set-goal "<text>" [--json]\n daily-log add "<text>" [--json]\n daily-log read [--days <n>] [--json]\n daily-log prune [--keep-days <n>] [--json]\n state write <key> <val> [--ttl <s>] | read|delete|status <key> | list | cleanup [--json]\n project-memory read [<id>] | index | add-note "<title>" [--body "<text>"] | add-directive "<rule>" [--json]\n trace timeline [<sessionId>] [--limit <n>] | summary [<sessionId>] | add <sessionId> <event> [<json>] [--json]\n catalog list [--json]\n catalog validate [--json]\n catalog capability <id> [--json]\n project inspect [--json]\n skill install <skill-dir> [--root <repo>] [--scope project|user] [--dry-run] [--json]\n lint:skills [--root <repo>]\n sync:dry-run [--root <repo>]\n jira:dry-run [--root <repo>]\n jira render <plan-file> [--root <repo>] [--json]\n jira apply <ticket-key-or-plan-file> --comment|--update|--transition|--link [--dry-run] [--json]\n`;
30
30
  }
31
31
  async function resolveExistingInputPath(value) {
32
32
  const { existsSync } = await import("node:fs");
@@ -107,11 +107,20 @@ export async function runCli(argv = process.argv.slice(2)) {
107
107
  importMetaUrl: import.meta.url,
108
108
  copilotBin: flagValue(argv, "--copilot-bin"),
109
109
  skipCopilot: hasFlag(argv, "--skip-copilot"),
110
+ checkHooks: hasFlag(argv, "--hooks"),
110
111
  });
111
112
  return json
112
113
  ? { ok: report.ok, exitCode: report.ok ? 0 : 1, output: report }
113
114
  : { ok: report.ok, exitCode: report.ok ? 0 : 1, message: formatDoctor(report) };
114
115
  }
116
+ if (group === "cost") {
117
+ const { summarizeCost, formatCostSummary } = await import("./cost/summary.js");
118
+ const summary = summarizeCost(flagValue(argv, "--root") ?? process.cwd(), {
119
+ sessionId: flagValue(argv, "--session"),
120
+ today: hasFlag(argv, "--today"),
121
+ });
122
+ return json ? { ok: true, output: summary } : { ok: true, message: formatCostSummary(summary) };
123
+ }
115
124
  if (group === "launch") {
116
125
  const dashIndex = argv.indexOf("--");
117
126
  const passthrough = dashIndex >= 0 ? argv.slice(dashIndex + 1) : argv.slice(1);