@mutmutco/hermes-plugin 3.139.1

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 (40) hide show
  1. package/README.md +4 -0
  2. package/__init__.py +72 -0
  3. package/package.json +20 -0
  4. package/plugin.yaml +9 -0
  5. package/prompts/soul.md +71 -0
  6. package/scripts/command-ladder-core.mjs +334 -0
  7. package/scripts/command-ladder-gate.mjs +126 -0
  8. package/scripts/deny-gate-crash.mjs +179 -0
  9. package/scripts/edit-tool-paths.mjs +113 -0
  10. package/scripts/env-write-lint.mjs +137 -0
  11. package/scripts/hook-io.mjs +22 -0
  12. package/scripts/hook-policy.mjs +78 -0
  13. package/scripts/hook-run.mjs +416 -0
  14. package/scripts/hook-trace.mjs +151 -0
  15. package/scripts/pretooluse-shell-gates.mjs +564 -0
  16. package/scripts/secret-echo-lint.mjs +177 -0
  17. package/scripts/throttle-core.mjs +324 -0
  18. package/scripts/vault-edit-gate.mjs +94 -0
  19. package/skills/bootstrap/SKILL.md +561 -0
  20. package/skills/bootstrap/seeds/Dockerfile.template +30 -0
  21. package/skills/bootstrap/seeds/README.template.md +37 -0
  22. package/skills/bootstrap/seeds/architecture.template.md +34 -0
  23. package/skills/bootstrap/seeds/decisions-readme.template.md +45 -0
  24. package/skills/bootstrap/seeds/docker-compose.template.yml +26 -0
  25. package/skills/bootstrap/seeds/gate.template.yml +85 -0
  26. package/skills/bootstrap/seeds/google-login.template.md +33 -0
  27. package/skills/bootstrap/seeds/manifest.json +26 -0
  28. package/skills/bootstrap/seeds/mmi-product-required-checks.template.json +23 -0
  29. package/skills/bootstrap/seeds/readme-mmi-developer-environment.block.md +5 -0
  30. package/skills/browser-automation/SKILL.md +95 -0
  31. package/skills/epic/SKILL.md +112 -0
  32. package/skills/hotfix/SKILL.md +165 -0
  33. package/skills/mmi/SKILL.md +398 -0
  34. package/skills/mmi-doctor/SKILL.md +66 -0
  35. package/skills/mmi-resume/SKILL.md +90 -0
  36. package/skills/onboard/SKILL.md +86 -0
  37. package/skills/rcand/SKILL.md +208 -0
  38. package/skills/release/SKILL.md +604 -0
  39. package/skills/secrets/SKILL.md +159 -0
  40. package/skills/stage/SKILL.md +153 -0
@@ -0,0 +1,159 @@
1
+ ---
2
+ name: secrets
3
+ description: Manage the full own-project vault and granted org-infra secret names.
4
+ ---
5
+
6
+ **Host-native invocation:** Claude `/mmi:secrets` · Codex `$mmi:secrets` · jervcode/Kimi `/skill:secrets` · Kilo `skill` tool. A backticked `/name` in this doc names the matching workflow (this skill or a sibling), not a literal command.
7
+
8
+ # /secrets — two-tier project secrets
9
+
10
+ **Authority:** a project-admin self-serves their own product repo's full vault tree (`mmi-cli oracle org access
11
+ role` → `project-admin` + `train`): stageless, `dev`, `rc`, and `main`. Do not redirect them to master for
12
+ an own-project coordinate. Only org-infra grants and cross-project administration stay master-only.
13
+
14
+ Secrets in the org split by **blast radius + who manages them** (not by storage — both tiers are SSM
15
+ SecureString + KMS, and **a value is never echoed to chat or logs**):
16
+
17
+ - **YOUR REPO** — `/mmi-future/<slug>/<KEY>` (the stageless canonical) plus
18
+ `/mmi-future/<slug>/{dev,rc,main}/*` (staged per-stage overrides) for a repo you are project-admin of.
19
+ You **self-serve your own repo's full tree** — the canonical root, dev, rc, AND main prod secrets — via
20
+ `/secrets`, on your **GitHub role alone**, no AWS, no waiting on the master (#2032).
21
+ - **ORG-INFRA** — the shared/infra namespaces (`/mmi-future/{shared,cloudflare,docs,mmi-hub}/*`), at
22
+ **every** tier (their `dev/` holds Hetzner/AWS/CF tokens + Hub tooling). **Crown jewels, master-only.**
23
+ A project-admin reaches one of these only via a master **grant**; the master is unrestricted (master ⊇
24
+ project-admin).
25
+
26
+ **Grant scope (#3652).** A grant is `rw` by default — it opens both keyless `use` and `set`/`rm` on that
27
+ key. `mmi-cli vault secrets grant <repo> <login> <key> --read` grants **consume-only** reach: keyless `use`
28
+ works, rotate and remove still refuse. Only a `--read` grant may name a **wildcard** key — `*` for the
29
+ whole namespace, `<provider>/*` for one provider group — so "may read every crown jewel" is one grant
30
+ instead of forty. A wildcard never confers write; asking for one as `rw` is refused, not narrowed.
31
+ `mmi-cli oracle org access capabilities` prints `grant (read)` or `grant (rw)` next to each name.
32
+
33
+ A bare `<KEY>` is the **stageless canonical** at the slug root — one value every stage shares (#2244)
34
+ and the path deploys resolve (#2523). A staged `dev/<KEY>` is a **per-stage override** and WINS for that
35
+ stage at deploy (#2522); `set`/`use` warn (names only) when an override shadows the canonical. The
36
+ `dev`/non-`dev` `tier` field in older JSON is compatibility metadata, not an authority boundary: an
37
+ own-project `main/SECRET_KEY_BASE` or `rc/DB_URL` remains project-admin self-service.
38
+
39
+ **Declare-first (#2528):** the registry catalog is the SSOT; SSM is a projection of it. A `set` to a
40
+ coordinate not declared in the catalog is **rejected** — the error names the attempted path and the fix.
41
+ Declare the key first via `mmi-cli oracle org project set <owner/repo> --secrets-file <catalog.json>` (`stages: []`
42
+ = the shared stageless canonical, `stages: ["dev"]` = a per-stage override), then retry. See what is
43
+ declared with `mmi-cli vault secrets catalog` or `secrets list`; ask for a key you lack via `mmi-cli vault secrets
44
+ request <KEY>`. There is no master bypass. `rm` of an undeclared path stays allowed, so cleanup keeps
45
+ working. Google OAuth is one stageless pair per repo: bare `GOOGLE_CLIENT_ID` + `GOOGLE_CLIENT_SECRET`
46
+ at the slug root (the staged `{dev,rc,main}/GOOGLE_*` shape is retired; `org oauth set-creds` writes the
47
+ bare keys).
48
+
49
+ All ops run through `mmi-cli vault secrets …`, which calls the org backend with the caller's `gh` token; the
50
+ backend re-verifies **project-admin-of-this-repo** and the **vault namespace** server-side and does the scoped
51
+ SSM op. This skill never touches AWS.
52
+
53
+ ## Step 0 — orient
54
+
55
+ Read the current repo + slug; the tier of a key follows from its name (above). `secrets list` shows what
56
+ exists and which ones **you** can manage (a `*`), never values.
57
+
58
+ ```bash
59
+ mmi-cli vault secrets list # names + tier + a * on the ones you can write. NEVER values.
60
+ ```
61
+
62
+ `secrets: no registry META` or `Hub API unreachable` → the repo is not registered with the Hub, GitHub auth
63
+ is missing, or the Hub API is unavailable. Run `mmi-cli oracle org project get <owner/repo>` to distinguish those cases;
64
+ a master-admin backfills the registry before secrets can be resolved.
65
+
66
+ ## Step 1 — the verb
67
+
68
+ Default to the **current repo**; pass `--repo owner/Name` to target another (you must be its project-admin).
69
+
70
+ ```bash
71
+ # CONSUME a secret keyless — injected into the command's env, NEVER printed (raw `secrets get` was
72
+ # removed, the floor wins, #2844):
73
+ mmi-cli vault secrets use SCRAPER_API_KEY -- <cmd>
74
+
75
+ # Write / rotate — the VALUE is read from stdin, NEVER an argument (so it can't leak into shell history
76
+ # or process args). Pipe it in:
77
+ printf %s "$THE_VALUE" | mmi-cli vault secrets set SCRAPER_API_KEY
78
+
79
+ # Validate a known provider key without printing its value:
80
+ mmi-cli vault secrets verify RECALL_API_KEY
81
+
82
+ # Remove:
83
+ mmi-cli vault secrets rm SCRAPER_API_KEY
84
+ ```
85
+
86
+ **Never** pass a value as an argument (`secrets set KEY thevalue` is wrong — there is no value arg). The
87
+ confirmation prints the **name and tier only**, never the value.
88
+
89
+ ## Rotation checklist
90
+
91
+ Before rotating, enumerate every copy of the key so no tier stays stale:
92
+
93
+ ```bash
94
+ mmi-cli vault secrets list --repo owner/Repo
95
+ ```
96
+
97
+ Check the bare canonical plus any `dev/`, `rc/`, `main/` overrides the list shows. Rotate the provider-side
98
+ key first, then write every declared coordinate that still needs that key. For keys with a provider probe
99
+ (`RECALL_API_KEY` today), `secrets set` validates the new value before printing success; `secrets verify
100
+ <KEY>` repeats the same probe later without printing the value. If the verifier fails, treat the rotation as
101
+ incomplete even if the vault write itself succeeded.
102
+
103
+ ## Step 2 — org-infra elevation (master-only)
104
+
105
+ Your own repo's full tree (dev/rc/main) is already self-serve (#2032). The **org-infra** namespaces
106
+ (`shared`/`cloudflare`/`docs`/`mmi-hub`, every tier) stay master-only. A project-admin who needs one of
107
+ those keys asks the master, who grants a **scoped, auditable** standing access to that one key (or revokes
108
+ it). These verbs are **master-only** — the backend 403s anyone else.
109
+
110
+ ```bash
111
+ # MASTER: let @oguz-mut consume one _org provider key from their MM-Chat project
112
+ mmi-cli vault secrets grant mutmutco/MM-Chat oguz-mut google/SOME_SHARED_KEY
113
+ # MASTER: withdraw it
114
+ mmi-cli vault secrets revoke mutmutco/MM-Chat oguz-mut google/SOME_SHARED_KEY
115
+ ```
116
+
117
+ The master can also operate the org-infra key directly while guiding (master ⊇ project-admin). Org-infra
118
+ access by a project-admin **always originates from the master** — own-project access does not.
119
+
120
+ ## Coordinate — where does a new project secret belong?
121
+
122
+ - Shared across stages → bare `<KEY>` at the project slug root (the usual canonical value).
123
+ - Genuinely stage-distinct → `<stage>/<KEY>` override for `dev`, `rc`, or `main`.
124
+ - The project-admin owns both shapes across their own project. A path under `_org`/shared infrastructure is
125
+ not a project coordinate and stays master-managed.
126
+
127
+ ## Tier-to-tier copy (provider keys, #1433)
128
+
129
+ **Encryption / stage-distinct keys** (`*_ENC_KEY`, `SECRET_KEY_BASE`, etc.) must be **generated per stage** —
130
+ never copied. **Provider sandbox keys** (e.g. Recall/Gemini for Katip dev/rc) **may** be shared across dev/rc
131
+ when they point at the same sandbox project; prod should stay distinct when the provider contract requires it.
132
+
133
+ Sanctioned copy within the own-project vault (org-infra/cross-project sources remain master-gated):
134
+ ```bash
135
+ mmi-cli vault secrets copy --from rc --to dev --keys RECALL_API_KEY,GEMINI_API_KEY
136
+ mmi-cli vault secrets copy --from rc --to dev --keys RECALL_API_KEY --dry-run # plan only
137
+ ```
138
+ Prefer this over manual copy piping — audit-logged, blocklist enforced.
139
+
140
+ ## Notes
141
+
142
+ - **Never echo a value** — not in chat, a commit, a log, or an issue. No command emits a value to stdout;
143
+ consume one keyless with `secrets use <KEY> -- <cmd>` (#2844). Treat every secret as write-once.
144
+ - Authority is **GitHub**: project-admin = repo `write` plus the registry `projectAdmins` entry, master =
145
+ org owner. The backend checks both with the org App token, so the decision is server-side (your token
146
+ scope can't widen it).
147
+ - Runtime consumes declared keys through its scoped broker token (and central deploy injects the declared
148
+ stage set without a repo `.env`); CI reads keylessly through its OIDC role. Neither uses raw `/secrets`
149
+ output. `secrets use <KEY>` is the safe local command-consumption path.
150
+ - Every self-service write is **attributable** — the backend logs actor + repo + KEY name (never the value).
151
+
152
+ ## Retro — one check before you finish
153
+ Before your final report, answer one question honestly: did **this skill's own instructions** misfire
154
+ this run — ambiguous wording, a misleading message, or an environment failure it should have warned
155
+ about? (Process only — never the user's code or task; e.g. a canonical-name or tier mix-up, or a step
156
+ that risked echoing a value.) If yes, file **one** lesson and move on; a clean run is silent (hard cap:
157
+ one per run). It lands on the Hub board (deduped) and is fixed only via a reviewed PR — never edit the
158
+ skill live; the retro is advisory, so if the call fails, note it and continue:
159
+ `mmi-cli learning skill-lesson --skill secrets --title "<what misfired>" --body "<what; evidence; proposed amendment>"`
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: stage
3
+ description: Run a local test stage, or a personal cloud dev stage with --live.
4
+ ---
5
+
6
+ **Host-native invocation:** Claude `/mmi:stage` · Codex `$mmi:stage` · jervcode/Kimi `/skill:stage` · Kilo `skill` tool. A backticked `/name` in this doc names the matching workflow (this skill or a sibling), not a literal command.
7
+
8
+ # /stage — local test environment
9
+
10
+ A throwaway **local** environment to exercise the current branch — a dev server / local stack, plus
11
+ Playwright or other tools where the project uses them. It is **off the promotion train**: any developer,
12
+ no version effect, no deploy. It lives in a **gitignored** workspace, **force-kills the previous stage**
13
+ before starting, and **auto-decommissions** when done.
14
+
15
+ Use `/stage` as the normal path for local previews, smoke tests, and Playwright targets. If the user
16
+ already asked to run or preview the app, that is enough authorization to start it; when intent is unclear,
17
+ ask before creating or destroying a stage. Manual dev-server commands are allowed when the user explicitly
18
+ wants a bypass or when a bounded diagnostic needs one, but say why. If the stage path itself fails, diagnose
19
+ from `mmi-cli stage --json`, `tmp/stage/state.json`, process/port/container evidence, and file Hub/org-default
20
+ friction instead of silently working around it.
21
+
22
+ The stage recipe is the **registry-derived default** for plumbing-free product repos: a `tenant-container`
23
+ repo that ships `docker-compose.yml` and has a Hub registry `portRange` needs **no committed config**.
24
+ `mmi-cli stage` derives a default compose stage — run `docker compose build --no-cache`, run `docker compose
25
+ up -d`, choose a free port from the registry range, and report the local URL (e.g. `http://127.0.0.1:3700/`).
26
+ The commands are shell-aware and `--apply` runs them cross-shell. Board, deploy, secret, and project registry
27
+ facts all live in the Hub registry — no repo-local control-plane file.
28
+
29
+ **Secrets are vault-native — no `.env` on disk (#2655).** The org forbids *using* `.env` files, not just
30
+ committing them. A repo **without** `.env.example` stages vault-native: `mmi-cli stage --apply` resolves the
31
+ declared dev runtime secrets (registry `requiredRuntimeSecrets[dev]`) from the vault and injects them straight
32
+ into the compose **process environment** — the compose file reads them via `environment:` passthrough, and no
33
+ secret ever touches disk. A repo that still ships `.env.example` keeps the legacy `.env` bootstrap for
34
+ back-compat until its compose migrates to passthrough; new repos should ship **no** `.env.example`.
35
+
36
+ ## Step 0 — inspect the plan
37
+
38
+ ```bash
39
+ mmi-cli stage --json
40
+ ```
41
+
42
+ The JSON reports `source` (`derived` / `local` / `none`) and, when derived, the local `url`. `source: none`
43
+ means neither a usable local recipe nor a derivable default exists — the message names the missing fact
44
+ (deployModel, `docker-compose.yml`, or registry `portRange`; `.env.example` is **not** required — #2655).
45
+ That gap does not mean the repo's Hub registry/org project setup is missing.
46
+
47
+ ## Step 1 — run the stage
48
+
49
+ A stage is **per worktree**. The CLI force-stops only the previous stage **in this worktree**, runs
50
+ `stage.build`, starts `stage.up`, records `tmp/stage/state.json`, picks a free port from the registry
51
+ range (skipping ports reserved by sibling worktrees), and polls `stage.healthUrl` when configured.
52
+ Use `--port` to pin a port when needed:
53
+
54
+ ```bash
55
+ mmi-cli stage run --apply
56
+ mmi-cli stage run --apply --port 5180
57
+ ```
58
+
59
+ Use a larger bound when the repo's local stack is known to be slow:
60
+ ```bash
61
+ mmi-cli stage run --apply --timeout-ms 120000
62
+ ```
63
+
64
+ All stage artifacts (build output, screenshots, Playwright traces, local DB files) stay under `tmp/stage/`
65
+ — never tracked.
66
+
67
+ A local stage is bound to the worktree that started it. Concurrent worktrees on one machine each keep
68
+ their own stage on separate ports — you do not need to stop one before starting another. For `jervaise`, continuity
69
+ keys on branch; use a distinct North Star slug per parallel grind or feature. Stage JSON/state records
70
+ the starting `cwd` plus git branch/commit when available.
71
+
72
+ ### Step 1a — post-smoke panel (when criteria exist)
73
+
74
+ When grinding or the user supplied **acceptance criteria** (from the issue body at Gate 1 — not
75
+ ad-hoc chat text), run a **Budget-routing panel** on observable stage signals before teardown:
76
+
77
+ 1. **Panel** (parallel):
78
+ - **requirements-match** (budget tier) — does the staged URL/behavior meet the criteria?
79
+ - **runtime-health** (budget tier) — console errors, failed `healthUrl`, broken UI signals
80
+ *(smoke observability — not the grind `correctness` hard lens)*
81
+ - **tests-actually-test** (budget tier) — if Playwright ran, did it exercise the changed path?
82
+ 2. **Confirm** — get an independent second model to verify the staged URL or behavior meets the acceptance criteria.
83
+ 3. Feed the result back to the active loop or report to the human. A blocker
84
+ means the stage failed smoke — do not claim the grind criterion met.
85
+ This panel is **not** a security clearance — grind Phase 2 still runs the `security` hard lens.
86
+
87
+ Skip when `/stage` is ad-hoc preview with no criteria.
88
+
89
+ ## Step 2 — stop when done
90
+
91
+ ```bash
92
+ mmi-cli stage stop --apply
93
+ ```
94
+
95
+ Stop the stage when the work is done, before switching context, or before replacing it with another stage.
96
+ If the user clearly wants the preview to stay up, leave it running and report that. The next `/stage` also
97
+ stops the previous recorded stage before starting, so a stale server does not linger between runs. For the
98
+ registry-derived Docker Compose default, stop also runs the recorded compose teardown (`docker compose down`)
99
+ from the original stage working directory.
100
+
101
+ ## /stage --live — personal cloud dev stage
102
+
103
+ dev.x stages are **not standing environments**: without `--live` the dev stage is dark. `--live`
104
+ deploys the **current branch** to the project's dev runtime and serves it **only to your public IP** —
105
+ gated at the **Cloudflare edge** (#1761). The CLI detects your IP, dispatches the central
106
+ `tenant-deploy.yml` (stage=dev), then `tenant-control.yml` `cf-gate-allow` (an ephemeral Cloudflare WAF
107
+ rule scoped to your dev host + IP). The box no longer IP-gates dev. No SSH from your machine; everything
108
+ moves through the central workflows.
109
+
110
+ ```bash
111
+ mmi-cli stage --live # dry-run plan
112
+ mmi-cli stage --live --apply # deploy + gate your IP at the Cloudflare edge
113
+ ```
114
+
115
+ Tear it down when done — the runtime stops and the Cloudflare edge gate is removed:
116
+
117
+ ```bash
118
+ mmi-cli stage --live --down --apply
119
+ ```
120
+
121
+ Personal dev stages only — rc/live environments still move exclusively through the promotion train.
122
+
123
+ ## Step 3 — report
124
+
125
+ The stage URL, what's running (server + tools), the workspace path (`tmp/stage/`), and the teardown command.
126
+
127
+ ## Notes
128
+
129
+ - `/stage` is local — no AWS, no deploy, no board or version effect. The one cloud exception is
130
+ `--live`: an on-demand **dev** stage of your branch, gated to your IP at the Cloudflare edge (above).
131
+ - Remote rc/live environments move only through `/rcand`, `/release`, and `/hotfix`.
132
+ - Everything is gitignored; `/stage` never produces a tracked change.
133
+ - **Playwright MCP output goes to `tmp/`**, never the repo root: if you drive the Playwright MCP server,
134
+ pass `--output-dir tmp/playwright-mcp` (or point its output there). `.playwright-mcp/` is kept gitignored
135
+ by the org `.gitignore` managed block (`mmi-cli doctor`) as a safety net, so a stray default capture is
136
+ never tracked.
137
+ - `tools[]` is declarative for now; stage hardening starts/stops the main configured process. Repos with
138
+ extra local services should encode them behind `stage.up` until a tool runner is added.
139
+ - **Stale Docker bundle:** the registry-derived Docker Compose default builds with `docker compose build
140
+ --no-cache` before `up`. If the browser still serves an old bundle, run `mmi-cli stage stop --apply`, rerun
141
+ `/stage`, then inspect `tmp/stage/state.json` identity, container image labels, and compose build inputs.
142
+ - **Stale `.env`:** when `.env` already exists from a prior `/stage` run, `stage run` does **not** refresh it
143
+ from an updated `.env.example` — it warns on stderr and keeps the stale file. Delete `.env` (or merge in the
144
+ new keys by hand) when `.env.example` changes, then re-run `/stage`.
145
+
146
+ ## Retro — one check before you finish
147
+ Before your final report, answer one question honestly: did **this skill's own instructions** misfire
148
+ this run — ambiguous wording, a misleading message, or an environment failure it should have warned
149
+ about? (Process only — never the user's code or task; e.g. a teardown that left a port bound, or a
150
+ Playwright output path aimed at the repo root.) If yes, file **one** lesson and move on; a clean run is
151
+ silent (hard cap: one per run). It lands on the Hub board (deduped) and is fixed only via a reviewed PR —
152
+ never edit the skill live; the retro is advisory, so if the call fails, note it and continue:
153
+ `mmi-cli learning skill-lesson --skill stage --title "<what misfired>" --body "<what; evidence; proposed amendment>"`