[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DE2X3PYM0WM9KQVBRSZ8AZ":3,"skill-same:01M6DE2X3PYM0WM9KQVBRSZ8AZ":112},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6DE2X3PYM0WM9KQVBRSZ8AZ","credential-forge",null,"One discipline that harvests, farms, vaults, captures, and lifecycle-manages every credential the owner already owns — 12-store auth harvester (grok\u002Fclaude\u002Fzcode\u002F gemini\u002Fcursor\u002Fgcloud\u002Faws\u002Fgh\u002Fscw\u002Fopencode), key-farm roster + rotation manifest (\u003CBASE>__\u003Caccount>), 1Password op:\u002F\u002F materialize (forge-run), browser-assisted OAuth capture ladder (device-code first), JWT expiry ledger + refresh watchdog + statusline telemetry. Secret VALUES live in process memory only; names\u002Fshapes\u002Fpaths on disk. Use for credential inventory, harvesting auth stores, env-var key farming, vault sync, OAuth device-code capture, token expiry checks, rotation cooldowns, or secret-hygiene audits.","Prekzursil\u002Fagent-skills-toolchain","Prekzursil","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F54636077?v=4","01M6DACZ1PCQHD99SCR1YXG28B","Andrei Mihai Visalon","01M6DACZ670WZF535V3WYYSS4Z",0,"MIT","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"credential forge","forge","credential","discipline","farm","live","token","zcode","vaults","opencode","only","memory","disk","inventory","watchdog","browser","code","run","sync","auth","2026-11-10 10:12:30",false,"---\nname: credential-forge\ndescription: One discipline that harvests, farms, vaults, captures, and lifecycle-manages\n  every credential the owner already owns — 12-store auth harvester (grok\u002Fclaude\u002Fzcode\u002F\n  gemini\u002Fcursor\u002Fgcloud\u002Faws\u002Fgh\u002Fscw\u002Fopencode), key-farm roster + rotation manifest\n  (\u003CBASE>__\u003Caccount>), 1Password op:\u002F\u002F materialize (forge-run), browser-assisted OAuth\n  capture ladder (device-code first), JWT expiry ledger + refresh watchdog + statusline\n  telemetry. Secret VALUES live in process memory only; names\u002Fshapes\u002Fpaths on disk.\n  Use for credential inventory, harvesting auth stores, env-var key farming, vault\n  sync, OAuth device-code capture, token expiry checks, rotation cooldowns, or\n  secret-hygiene audits.\n---\n\n# credential-forge — harvest · farm · vault · capture · lifecycle\n\nOne discipline for every credential the owner **already possesses**. It moves the\nowner's existing credentials between the places the owner controls (auth stores ↔\nenv vars ↔ 1Password vault ↔ tool runtimes), inventories them, materializes them\ninto child processes at exec time, captures fresh OAuth grants when the owner\nconsents, and keeps expiries visible. It never creates, cracks, guesses, or\ntouches credentials the owner does not already own.\n\nHonesty about what this is: harvesting credentials from local stores is exactly\nwhat info-stealer malware does. The two differences are **ownership** (owner's own\naccounts, owner-initiated) and **hygiene** (the verbatim rules below — enforced\nmechanically by the nightly audit gate, not by good intentions). Both are\nload-bearing; drop either and this discipline is a stealer.\n\n## The five laws\n\n1. **Values in process memory only.** Secret VALUES never appear in any file,\n   commit, log, transcript, or reply — env-var NAMES, file paths, key SHAPES,\n   lengths, and masks (≤4 chars) only.\n2. **Reference-not-literal.** Configs carry `${ENV}` refs or `op:\u002F\u002F` URIs,\n   resolved at runtime — never literal secrets. The audit gate's\n   REFERENCE_RE whitelist enforces this mechanically.\n3. **Backup-first.** Every config-file edit gets a dated `.bak-\u003Cop>-\u003CYYYYMMDD>`\n   copy plus JSON\u002FTOML re-validation before and after.\n4. **Owner-consent gates.** Every browser lane is owner-initiated and\n   owner-visible; device codes are typed by the owner. Silent consent automation\n   is forbidden (phishing-kit equivalence).\n5. **Provider-native refresh.** The owning CLI refreshes its own store; we never\n   hand-roll token POSTs against inferred endpoints. Unrefreshable stores are\n   marked stale + alerted, not poked.\n\n## Where things live\n\n| What | Where | Rule |\n|---|---|---|\n| Doctrine (this file) + references | `~\u002F.zcode\u002Fskills\u002Fcredential-forge\u002F` AND `~\u002F.agents\u002Fskills\u002Fcredential-forge\u002F` | Dual tree, docs byte-identical (`diff` clean); value-free and committable |\n| Scripts | `~\u002F.agents\u002Fskills\u002Fcredential-forge\u002Fscripts\u002F` — `harvest.py`, `roster.py`, `materialize.py`, `capture.py`, `lifecycle.py`, `telemetry.py`, `_common.py` | Sibling-built (the `.agents` tree is canonical; observed landing there 2026-10-22, mid-write during this doc pass — not mirrored to `.zcode` until finalized). This doc references them by path, never duplicates code. Shorthand below: `SCRIPTS\u002Fx.py` = that dir |\n| Audit gate | `~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py` | Pre-existing estate script — genuinely at `~\u002F.agents\u002Fscripts\u002F` |\n| State | `~\u002F.agents\u002Fstate\u002Fcredential-forge\u002F` → `roster.json`, `ledger.json`, `rotation-manifest.json` | OUTSIDE the skill tree; names, shapes, expiries, liveness ONLY — never values |\n\n## Routing table\n\n| Trigger | Capability | Entry point |\n|---|---|---|\n| \"what's in ~\u002F.grok \u002F .claude \u002F .gemini …\", harvest a store, import a credential somewhere | (1) Harvester | `python SCRIPTS\u002Fharvest.py --store \u003Cid> --dry-shape` then `--sink env\\|bridge\\|vault` → [references\u002Fstore-map.md](references\u002Fstore-map.md) |\n| \"which keys do I have\", env-var inventory, retire a key, rotation manifest | (2) Key-farm roster | `python SCRIPTS\u002Froster.py sync \\| status \\| retire \u003Cname>` → [references\u002Fnaming-spec.md](references\u002Fnaming-spec.md) |\n| \"run X with the key from the vault\", resolve op:\u002F\u002F into a child process | (3) 1P vault SSOT | `python SCRIPTS\u002Fmaterialize.py forge-run -- \u003Ccmd…>` \u002F `vault-sync` |\n| \"log in \u002F re-consent provider Y\", capture a fresh OAuth grant | (4) OAuth capture | `python SCRIPTS\u002Fcapture.py --provider \u003Cid>` → [references\u002Foauth-flows.md](references\u002Foauth-flows.md) |\n| \"when does my … token expire\", stale-store alert, refresh pass | (5a) Lifecycle | `python SCRIPTS\u002Flifecycle.py ledger build \\| show` \u002F `watchdog` |\n| \"key\u002Fexpiry segment for the statusline\" | (5b) Telemetry | `python SCRIPTS\u002Ftelemetry.py` (`forge:\u003Cn>keys exp:\u003Cmin>d`) |\n| Nightly \"are any trees leaking values\" | Hygiene gate | `~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py … --rotation-manifest …` → [references\u002Fhygiene.md](references\u002Fhygiene.md) |\n\n## Capability 1 — store harvester (`harvest.py`)\n\nGeneralizes the proven grok 8-step (estate `grokPattern`, executed live\n2026-10-21) to any store in [references\u002Fstore-map.md](references\u002Fstore-map.md).\nPipeline, per store:\n\n**detect** (path probe + mtime; a store rewritten since the last ledger pass is\nLIVE evidence) → **shape** (the `Temp\\authmap\\shape_json.py` walker: strings →\n`string(len=N)`, numbers → `number`, never values) → **classify**\n(`oauth-pair | api-key | cookie | password-shaped`) → **normalize** in memory to\n`{provider, account, kind, access_len, refresh_len, expires_at, issuer}` — bridge\nsinks get the single-entry doc; the raw issuer-map shape is rejected by the\nbridge (estate-verified) → **sink** (bridge admin API import \u002F winreg env-persist\n\u002F 1P vault write).\n\n```bash\npython SCRIPTS\u002Fharvest.py --store gemini --dry-shape          # names\u002Ftypes\u002Flengths + offline JWT exp\npython SCRIPTS\u002Fharvest.py --store gemini --sink env --dry-run # prints target name+scope only, writes nothing\npython SCRIPTS\u002Fharvest.py --store grok  --sink bridge         # live (already wired — see store-map)\n```\n\nAll prints are statuses\u002Fcounts\u002Flengths (the `grok-lane-import.py` convention).\nIdempotent: re-run reveals rather than re-mints. Per-store irreversibility rules\ninherited from grok-lane: never rotate `credentialEncryptionKey` after import,\nnever delete `runtime\u002Fdata\u002F`, never share one Build credential across bridge\ninstances (grok-lane\u002FSKILL.md:105-107).\n\n## Capability 2 — key-farm roster (`roster.py`)\n\nEnumerates HKCU+HKLM env **names only** (the names-only PowerShell enumeration is\nthe proven safe form; 339 names \u002F 232 secret-ish already mapped in the estate),\nunifies all naming forms to `\u003CBASE>__\u003Caccount>` via the alias map in\n[references\u002Fnaming-spec.md](references\u002Fnaming-spec.md), and emits:\n\n- `state\u002Froster.json` — per key: env name, provider, account tag,\n  `status(active|retired|unknown)`, `vault_ref(op:\u002F\u002F… or null)`, `last_seen`,\n  `vault_sync(synced|blocked)`\n- `state\u002Frotation-manifest.json` — `providers[].environmentVariables`, exactly\n  the schema the audit gate reads (audit_secret_artifacts.py:195-198). This\n  closes the estate gap that NO manifest covered the 232 names.\n\n```bash\npython SCRIPTS\u002Froster.py sync        # names-only env scan → roster + manifest\npython SCRIPTS\u002Froster.py status\npython SCRIPTS\u002Froster.py retire EXA_API_KEY__old1\n```\n\nRotation semantics (adopted verbatim from searchhub `rotation.py`, read\n2026-10-22): **402** → cool until UTC billing reset + rotate-retry-once; **429**\n→ never cool, honor `Retry-After`; **ambiguous** → probe the usage API; manual\nswitch overrides cooldown; never flip a global active pointer. Seeding stores\n`${ENV}` REFERENCES — \"never the literal secret\" (rotation.py:252-253), idempotent\n(:253) — the same doctrine as `op:\u002F\u002F` URIs, proven twice.\n\n## Capability 3 — 1Password vault SSOT (`materialize.py`)\n\n`forge-run` is the estate's `op run`: it resolves `op:\u002F\u002Fvault\u002Fitem\u002Ffield` refs\nAND plain env names (via the roster) into a child process's environment at exec\ntime, then execs. Values exist only in the child's env — never in dotfiles,\nnever in the skill tree.\n\n```bash\npython SCRIPTS\u002Fmaterialize.py forge-run -- .\u002Ftool --flag  # refs+roster → child env\npython SCRIPTS\u002Fmaterialize.py vault-sync                  # push new harvests to 1P (gated, below)\n```\n\nVault access via the `op-personal` wrapper (`~\u002F.local\u002Fbin\u002Fop-personal` —\nConnect-bypass for full vault reads, one Windows Hello per unlock window).\nPython callers strip `OP_CONNECT_*` inline in the env dict (the bash wrapper is\nnot exec-able from Windows python — estate gotcha).\n\n**HONEST LIMIT (baked in):** only the `Shared with Grok Bot` vault is\nCLI-visible; the 9 fleet Login items are NOT (1password-ops\u002FSKILL.md:28,32).\nSo the vault is SSOT-of-record while HKCU registry remains the materialized\ncache; roster entries carry `vault_sync: synced|blocked`, and `vault-sync`\nnever force-migrates password-shaped vars (`INSTITUTIONAL_PASSWORD` etc.) —\nthey are listed as op:\u002F\u002F migration candidates with a documented-exception path.\n\n## Capability 4 — browser-assisted OAuth capture (`capture.py`)\n\nStrict preference ladder, owner-in-the-loop (full verdicts in\n[references\u002Foauth-flows.md](references\u002Foauth-flows.md)):\n\n1. **DEVICE-CODE first** wherever the IdP offers it (Entra devicecode endpoint\n   verified live 2026-10-22: HTTP 200, `expires_in` 900, poll 5 s; owner types\n   the code at login.microsoft.com\u002Fdevicelogin themselves). `az` \u002F\n   `gcloud --no-launch-browser` \u002F `gh` web flows need zero browser automation.\n2. **SSO-COOKIE** via env-held credentials POSTed to the portal\n   (institutional-literature-access recipe, owner-sanctioned, no bot-wall).\n3. **BROWSER-ATTACH consent-click LAST** — only for IdPs with no device flow\n   AND no bot-wall, owner-initiated and owner-visible, driven by shelling out\n   to `python playwright` (attach MCP tools are not mounted in workflow\n   subagents).\n\n**Anti-phishing-equivalence rule (verbatim):** silent consent-click automation\nin a logged-in real profile is functionally an OAuth-phishing kit — owner's\nown-accounts, owner-initiated, owner-visible only. Hard refusals encoded as\nrefuse-paths: never automate accounts.google.com; never headless capture\nagainst Cloudflare\u002FAkamai-fronted IdPs; never extract httpOnly cookies via\nattach (the cookie-bridge phone-side lane owns that); cdp-endpoint fallback\nstays OFF; downloads-throwing flows route to browser-rail.\n\n```bash\npython SCRIPTS\u002Fcapture.py --provider google-oauth  # REFUSES (hard wall)\npython SCRIPTS\u002Fcapture.py --provider entra-device  # prints owner steps; polls only with --owner-present\n```\n\n## Capability 5 — lifecycle (`lifecycle.py` + `telemetry.py`)\n\n- **Expiry ledger:** decodes JWT `exp` claims OFFLINE (base64 payload split, no\n  network). Every store's exp source is known from the store-map (.grok\n  `expires_at` RFC3339, .gemini `expiry_date` unix-ms + id_token JWT, .claude\n  `refreshTokenExpiresAt`, .zcode none → derive from JWT, AWS sso cache\n  `expiresAt`, manifest `expiresAt` for static keys). Emits `days_to_expiry`\n  with `expiring_soon` thresholds at 7 d \u002F 1 d.\n- **Refresh watchdog:** a Scheduled Task runs `lifecycle.py watchdog` — one pass\n  of PROVIDER-NATIVE refresh only (the owning CLI rewrites its own store; CLI\n  mtimes verified live 2026-10-22). Stores this box cannot refresh\n  (cursor-agent STALE since 09-02, opencode STALE since 04-27) are marked stale\n  and alerted, never acted on. Failures auto-quarantine in the roster with an\n  alert — never a 3 a.m. stack trace.\n- **Telemetry:** `telemetry.py` fuses ledger expiry + hub\u002Fbridge usage into\n  statusline segments (`forge:\u003Cn>keys exp:\u003Cmin>d`), extending the existing\n  5h\u002Fwk `rate_limits` statusline pattern.\n- **Hygiene enforcement:** nightly schtask runs\n  `~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py` over both skill trees + the\n  state dir with `--rotation-manifest` (exit 2 = findings\u002Ferrors → alert,\n  audit_secret_artifacts.py:212). Its REFERENCE_RE whitelist (:34-38) is what\n  lets `${ENV}`\u002Fop:\u002F\u002F references pass while literals fail — **the gate IS the\n  doctrine.**\n\n```bash\npython SCRIPTS\u002Flifecycle.py ledger build\npython SCRIPTS\u002Flifecycle.py ledger show --store gemini\npython SCRIPTS\u002Ftelemetry.py\n```\n\n## Auth-store map (summary — full registry in references\u002Fstore-map.md)\n\n| id | Path | Kind | Status 2026-10-22 | Refresh owner |\n|---|---|---|---|---|\n| grok | `~\u002F.grok\u002Fauth.json` | issuer-keyed OAuth | LIVE (mtime 10-22) | grok CLI \u002F bridge |\n| codex | `~\u002F.codex` | env-key only, no auth file | n\u002Fa (roster-relevant) | — |\n| claude | `~\u002F.claude\u002F.credentials.json` | designOauth live, claudeAiOauth EMPTY | LIVE (mtime 10-21) | claude CLI |\n| zcode | `~\u002F.zcode\u002Fv2\u002Fcredentials.json` | flat KV | LIVE (mtime 10-22) | zcode CLI |\n| gemini | `~\u002F.gemini\u002Foauth_creds.json` | standard OIDC pair | LIVE (mtime 10-21) | gemini-cli |\n| cursor | `%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb` (3.01 GB SQLite) | desktop keyring | LIVE desktop \u002F STALE cli | Cursor app |\n| cursor-agent | auth.json (stores-research locator) | OAuth | STALE 2026-09-02 | none on this box |\n| opencode | `~\u002F.local\u002Fshare\u002Fopencode\u002Fauth.json` | OAuth | STALE 2026-04-27 (mtime-confirmed) | none on this box |\n| gcloud | `%APPDATA%\\gcloud\\credentials.db` + `legacy_credentials\u002F` | 6 accounts | LIVE (mtime 10-21) | gcloud CLI |\n| aws | `~\u002F.aws\u002Fsso\u002Fcache\u002F*.json` | SSO | cached | aws sso login |\n| gh | `%APPDATA%\\GitHub CLI\\hosts.yml` | env-token form | env-keyed | gh CLI |\n| scw \u002F op | `~\u002F.config\u002Fscw\u002Fconfig.yaml` \u002F `~\u002F.op` | provider configs | scw present; op ABSENT this pass | provider CLI |\n\n## Token hygiene (verbatim rules)\n\n- Values in process memory only: secret VALUES never appear in any file,\n  commit, log, transcript, or reply — env-var NAMES, file paths, key SHAPES,\n  lengths, and masks (≤4 chars) only.\n- Reference-not-literal is estate law: configs carry `${ENV}` refs or `op:\u002F\u002F`\n  URIs, resolved at runtime (rotation.py:252-253); the audit gate's\n  REFERENCE_RE whitelist (audit_secret_artifacts.py:34-38) enforces it\n  mechanically.\n- Harvest reads store bytes → process memory → target store's native API. No\n  intermediate temp files, no value-bearing dumps; shape output is\n  names\u002Ftypes\u002Flengths only.\n- Backup-first on every config-file edit: dated `.bak-\u003Cop>-\u003CYYYYMMDD>` copy +\n  JSON\u002FTOML re-validation before and after.\n- Env persistence via winreg SetValueEx to User+Machine with zero shell echo;\n  Machine-scope writes reserved for named client keys on the GROK_LANE_KEY\n  precedent — never replicate the PLAYWRIGHT_MCP_EXTENSION_TOKEN machine-scope\n  exposure pattern blindly.\n- Irreversibility inherited: never rotate `credentialEncryptionKey` after\n  import, never delete `runtime\u002Fdata`, never share one Build credential across\n  bridge instances.\n- Owner-consent gates on every browser lane: device codes entered by the owner;\n  consent-click capture is owner-initiated, owner-visible, own-accounts-only;\n  first per-client extension connect (tab-drag) and first rail sign-in are\n  owner acts. Silent consent automation = OAuth-phishing-kit equivalence →\n  forbidden.\n- Hard capture refusals: no automation of accounts.google.com; no headless\n  OAuth\u002Fcookie capture against Cloudflare\u002FAkamai-fronted IdPs; no profile-file\n  session seeding (Chrome holds the Cookies file under exclusive lock);\n  cdp-endpoint fallback stays OFF.\n- Device-code flows preferred over consent-click automation wherever the IdP\n  offers them — the code is visible to the owner; the automation never sees\n  credentials.\n- No cross-account contamination: never copy auth.json between accounts;\n  per-account isolation via isolated HOME dirs \u002F profiles (grok-fleet\n  GROK_HOME precedent).\n- Refresh is provider-native only: the owning CLI refreshes its own store;\n  never hand-rolled token POSTs against inferred endpoints; unrefreshable\n  stores are marked stale + alerted, not poked.\n- ToS honesty: bridge-backed (cookie\u002Fdevice reverse-engineered) accounts are\n  rate-capped, segregated from primary accounts, and carry research-use\n  disclaimers forward; official API keys preferred wherever one exists.\n- Nightly hygiene gate: audit_secret_artifacts.py with --rotation-manifest over\n  skill trees + state dir; exit 2 blocks\u002Falerts; findings are\n  path+sha256+line+detector+name only — the gate never becomes a leak itself.\n- Vault SSOT honestly gated: until the 9 fleet Login items are CLI-visible,\n  registry remains the materialized cache and roster entries carry\n  `vault_sync: blocked` — no pretending the vault is authoritative while it\n  cannot be read.\n- Password-shaped env vars are never force-rotated or auto-migrated; they are\n  inventoried as op:\u002F\u002F migration candidates with a documented-exception path.\n\n## Demo (target store: gemini) — transcript placeholder\n\nWhy gemini: shape fully known and non-sensitive to parse; the `id_token` JWT\ndemonstrates OFFLINE exp decoding with zero network and zero owner interaction;\nit does NOT disturb the already-wired grok lane (re-importing `.grok\u002Fauth.json`\nto a second bridge would violate the never-share-one-Build-credential rule, and\nits client-key lane is already live — it would prove nothing new); the sibling\n`~\u002F.gemini\u002Fgoogle_accounts.json` gives the account tag for roster registration.\n\nSequence (all unattended, no owner steps):\n\n1. `python SCRIPTS\u002Fharvest.py --store gemini --dry-shape` → expects\n   `gemini: oauth-pair, access len=261, refresh len=103, exp=\u003CISO>,\n   days_to_expiry=N` — never a value.\n2. Pipe step-1 output through the leak-grep (references\u002Fhygiene.md) → 0 hits.\n3. `python SCRIPTS\u002Froster.py sync` → registers the gemini lane\n   (status active + expiry) and emits rotation-manifest.json.\n4. `python SCRIPTS\u002Flifecycle.py ledger build` → ledger gains the\n   gemini entry alongside every other mapped store.\n5. `python ~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py \u003Cboth trees> \u003Cstate dir>\n   --rotation-manifest \u003Cstate>\u002Frotation-manifest.json` → SUCCESS, exit 0.\n6. `--sink env --dry-run` ONLY — a live sink write without the owner present is\n   unnecessary for proof; the grok lane already proved the live sink path\n   end-to-end on 2026-10-21 (grokPattern steps 3-5, real-completion smoke).\n\n```\n\u003C!-- DEMO TRANSCRIPT PLACEHOLDER — paste step outputs here after the first live\n     demo run. Lengths, dates, and statuses ONLY; never values. -->\n```\n\n## Validation (post-build gate — run once the sibling scripts are final)\n\n```bash\n# 1. leak-grep over trees+state → must be 0 hits (grep exit 1)\ngrep -rEn '(github_pat_[A-Za-z0-9_]{20,}|gh[pousr]_[A-Za-z0-9]{20,}|hf_[A-Za-z0-9]{20,}|tvly-[A-Za-z0-9_-]{20,}|fc-[A-Za-z0-9_-]{20,}|-----BEGIN [A-Z ]*PRIVATE KEY-----)' \\\n  ~\u002F.zcode\u002Fskills\u002Fcredential-forge ~\u002F.agents\u002Fskills\u002Fcredential-forge ~\u002F.agents\u002Fstate\u002Fcredential-forge\n# 2. the audit gate itself (exit 0 = clean; exit 2 = a real finding)\npython ~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py \\\n  C:\u002FUsers\u002FPrekzursil\u002F.zcode\u002Fskills\u002Fcredential-forge C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fskills\u002Fcredential-forge \\\n  C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge \\\n  --rotation-manifest C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge\u002Frotation-manifest.json \\\n  --report C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge\u002Flast-audit.json\n# 3. manifest schema round-trip (must print manifest-schema-ok N)\npython -c \"import json;m=json.load(open(r'C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge\u002Frotation-manifest.json'));assert all(isinstance(p.get('environmentVariables'),list) for p in m['providers']);print('manifest-schema-ok', sum(len(p['environmentVariables']) for p in m['providers']))\"\n# 4. dual-tree doc identity\ndiff ~\u002F.zcode\u002Fskills\u002Fcredential-forge\u002FSKILL.md ~\u002F.agents\u002Fskills\u002Fcredential-forge\u002FSKILL.md\ndiff -r ~\u002F.zcode\u002Fskills\u002Fcredential-forge\u002Freferences ~\u002F.agents\u002Fskills\u002Fcredential-forge\u002Freferences\n# 5. mask-width conformance (no wider-than-4 slices anywhere in the trees) → 0 hits\ngrep -rnE '\\[:(8|7)\\]' ~\u002F.zcode\u002Fskills\u002Fcredential-forge ~\u002F.agents\u002Fskills\u002Fcredential-forge\n```\n\n## Troubleshooting\n\n| Symptom | Cause \u002F fix |\n|---|---|\n| harvest `ABSENT \u003Cstore>` | path moved — re-probe per references\u002Fstore-map.md; store-map carries the stores-research locator for cursor-agent |\n| bridge import `authImportFailed` | wrong document shape — use the normalized single-entry doc (grok-lane\u002FSKILL.md:94-104), not the raw issuer map |\n| roster sync finds 0 names | run from a shell with PowerShell available; enumeration is names-only HKCU+HKLM |\n| `forge-run` cannot resolve a ref | ref not in roster and not op:\u002F\u002F-shaped → run `roster.py sync`; check `vault_sync: blocked` (vault item not CLI-visible) |\n| op wrapper yields nothing \u002F Connect errors | `op-personal` bypass missing (OP_CONNECT_* must be unset per-call, never deleted globally); desktop app must be running with CLI integration enabled |\n| ledger shows epoch-zero \u002F 1970 expiry | store lacks a native exp → lifecycle derives from JWT; if the value isn't a JWT either, entry is marked `unknown-expiry`, not guessed |\n| watchdog alerts STALE cursor-agent\u002Fopencode | expected — no refresh owner on this box; owner re-auth via the owning CLI when needed |\n| capture.py refuses a provider | that's a hard wall, not a bug — see references\u002Foauth-flows.md before considering ANY workaround |\n| audit exit 2 on skill\u002Fstate files | a real leak-shaped literal — fix the file; never widen REFERENCE_RE to pass |\n| trees differ | docs: re-mirror (`cp` SKILL.md + references\u002F across); scripts: the .agents tree is canonical while sibling work is in flight — reconcile with skill-tree-reconcile once finalized |\n","# credential-forge — harvest · farm · vault · capture · lifecycle\n\nOne discipline for every credential the owner **already possesses**. It moves the\nowner's existing credentials between the places the owner controls (auth stores ↔\nenv vars ↔ 1Password vault ↔ tool runtimes), inventories them, materializes them\ninto child processes at exec time, captures fresh OAuth grants when the owner\nconsents, and keeps expiries visible. It never creates, cracks, guesses, or\ntouches credentials the owner does not already own.\n\nHonesty about what this is: harvesting credentials from local stores is exactly\nwhat info-stealer malware does. The two differences are **ownership** (owner's own\naccounts, owner-initiated) and **hygiene** (the verbatim rules below — enforced\nmechanically by the nightly audit gate, not by good intentions). Both are\nload-bearing; drop either and this discipline is a stealer.\n\n## The five laws\n\n1. **Values in process memory only.** Secret VALUES never appear in any file,\n   commit, log, transcript, or reply — env-var NAMES, file paths, key SHAPES,\n   lengths, and masks (≤4 chars) only.\n2. **Reference-not-literal.** Configs carry `${ENV}` refs or `op:\u002F\u002F` URIs,\n   resolved at runtime — never literal secrets. The audit gate's\n   REFERENCE_RE whitelist enforces this mechanically.\n3. **Backup-first.** Every config-file edit gets a dated `.bak-\u003Cop>-\u003CYYYYMMDD>`\n   copy plus JSON\u002FTOML re-validation before and after.\n4. **Owner-consent gates.** Every browser lane is owner-initiated and\n   owner-visible; device codes are typed by the owner. Silent consent automation\n   is forbidden (phishing-kit equivalence).\n5. **Provider-native refresh.** The owning CLI refreshes its own store; we never\n   hand-roll token POSTs against inferred endpoints. Unrefreshable stores are\n   marked stale + alerted, not poked.\n\n## Where things live\n\n| What | Where | Rule |\n|---|---|---|\n| Doctrine (this file) + references | `~\u002F.zcode\u002Fskills\u002Fcredential-forge\u002F` AND `~\u002F.agents\u002Fskills\u002Fcredential-forge\u002F` | Dual tree, docs byte-identical (`diff` clean); value-free and committable |\n| Scripts | `~\u002F.agents\u002Fskills\u002Fcredential-forge\u002Fscripts\u002F` — `harvest.py`, `roster.py`, `materialize.py`, `capture.py`, `lifecycle.py`, `telemetry.py`, `_common.py` | Sibling-built (the `.agents` tree is canonical; observed landing there 2026-10-22, mid-write during this doc pass — not mirrored to `.zcode` until finalized). This doc references them by path, never duplicates code. Shorthand below: `SCRIPTS\u002Fx.py` = that dir |\n| Audit gate | `~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py` | Pre-existing estate script — genuinely at `~\u002F.agents\u002Fscripts\u002F` |\n| State | `~\u002F.agents\u002Fstate\u002Fcredential-forge\u002F` → `roster.json`, `ledger.json`, `rotation-manifest.json` | OUTSIDE the skill tree; names, shapes, expiries, liveness ONLY — never values |\n\n## Routing table\n\n| Trigger | Capability | Entry point |\n|---|---|---|\n| \"what's in ~\u002F.grok \u002F .claude \u002F .gemini …\", harvest a store, import a credential somewhere | (1) Harvester | `python SCRIPTS\u002Fharvest.py --store \u003Cid> --dry-shape` then `--sink env\\|bridge\\|vault` → [references\u002Fstore-map.md](references\u002Fstore-map.md) |\n| \"which keys do I have\", env-var inventory, retire a key, rotation manifest | (2) Key-farm roster | `python SCRIPTS\u002Froster.py sync \\| status \\| retire \u003Cname>` → [references\u002Fnaming-spec.md](references\u002Fnaming-spec.md) |\n| \"run X with the key from the vault\", resolve op:\u002F\u002F into a child process | (3) 1P vault SSOT | `python SCRIPTS\u002Fmaterialize.py forge-run -- \u003Ccmd…>` \u002F `vault-sync` |\n| \"log in \u002F re-consent provider Y\", capture a fresh OAuth grant | (4) OAuth capture | `python SCRIPTS\u002Fcapture.py --provider \u003Cid>` → [references\u002Foauth-flows.md](references\u002Foauth-flows.md) |\n| \"when does my … token expire\", stale-store alert, refresh pass | (5a) Lifecycle | `python SCRIPTS\u002Flifecycle.py ledger build \\| show` \u002F `watchdog` |\n| \"key\u002Fexpiry segment for the statusline\" | (5b) Telemetry | `python SCRIPTS\u002Ftelemetry.py` (`forge:\u003Cn>keys exp:\u003Cmin>d`) |\n| Nightly \"are any trees leaking values\" | Hygiene gate | `~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py … --rotation-manifest …` → [references\u002Fhygiene.md](references\u002Fhygiene.md) |\n\n## Capability 1 — store harvester (`harvest.py`)\n\nGeneralizes the proven grok 8-step (estate `grokPattern`, executed live\n2026-10-21) to any store in [references\u002Fstore-map.md](references\u002Fstore-map.md).\nPipeline, per store:\n\n**detect** (path probe + mtime; a store rewritten since the last ledger pass is\nLIVE evidence) → **shape** (the `Temp\\authmap\\shape_json.py` walker: strings →\n`string(len=N)`, numbers → `number`, never values) → **classify**\n(`oauth-pair | api-key | cookie | password-shaped`) → **normalize** in memory to\n`{provider, account, kind, access_len, refresh_len, expires_at, issuer}` — bridge\nsinks get the single-entry doc; the raw issuer-map shape is rejected by the\nbridge (estate-verified) → **sink** (bridge admin API import \u002F winreg env-persist\n\u002F 1P vault write).\n\n```bash\npython SCRIPTS\u002Fharvest.py --store gemini --dry-shape          # names\u002Ftypes\u002Flengths + offline JWT exp\npython SCRIPTS\u002Fharvest.py --store gemini --sink env --dry-run # prints target name+scope only, writes nothing\npython SCRIPTS\u002Fharvest.py --store grok  --sink bridge         # live (already wired — see store-map)\n```\n\nAll prints are statuses\u002Fcounts\u002Flengths (the `grok-lane-import.py` convention).\nIdempotent: re-run reveals rather than re-mints. Per-store irreversibility rules\ninherited from grok-lane: never rotate `credentialEncryptionKey` after import,\nnever delete `runtime\u002Fdata\u002F`, never share one Build credential across bridge\ninstances (grok-lane\u002FSKILL.md:105-107).\n\n## Capability 2 — key-farm roster (`roster.py`)\n\nEnumerates HKCU+HKLM env **names only** (the names-only PowerShell enumeration is\nthe proven safe form; 339 names \u002F 232 secret-ish already mapped in the estate),\nunifies all naming forms to `\u003CBASE>__\u003Caccount>` via the alias map in\n[references\u002Fnaming-spec.md](references\u002Fnaming-spec.md), and emits:\n\n- `state\u002Froster.json` — per key: env name, provider, account tag,\n  `status(active|retired|unknown)`, `vault_ref(op:\u002F\u002F… or null)`, `last_seen`,\n  `vault_sync(synced|blocked)`\n- `state\u002Frotation-manifest.json` — `providers[].environmentVariables`, exactly\n  the schema the audit gate reads (audit_secret_artifacts.py:195-198). This\n  closes the estate gap that NO manifest covered the 232 names.\n\n```bash\npython SCRIPTS\u002Froster.py sync        # names-only env scan → roster + manifest\npython SCRIPTS\u002Froster.py status\npython SCRIPTS\u002Froster.py retire EXA_API_KEY__old1\n```\n\nRotation semantics (adopted verbatim from searchhub `rotation.py`, read\n2026-10-22): **402** → cool until UTC billing reset + rotate-retry-once; **429**\n→ never cool, honor `Retry-After`; **ambiguous** → probe the usage API; manual\nswitch overrides cooldown; never flip a global active pointer. Seeding stores\n`${ENV}` REFERENCES — \"never the literal secret\" (rotation.py:252-253), idempotent\n(:253) — the same doctrine as `op:\u002F\u002F` URIs, proven twice.\n\n## Capability 3 — 1Password vault SSOT (`materialize.py`)\n\n`forge-run` is the estate's `op run`: it resolves `op:\u002F\u002Fvault\u002Fitem\u002Ffield` refs\nAND plain env names (via the roster) into a child process's environment at exec\ntime, then execs. Values exist only in the child's env — never in dotfiles,\nnever in the skill tree.\n\n```bash\npython SCRIPTS\u002Fmaterialize.py forge-run -- .\u002Ftool --flag  # refs+roster → child env\npython SCRIPTS\u002Fmaterialize.py vault-sync                  # push new harvests to 1P (gated, below)\n```\n\nVault access via the `op-personal` wrapper (`~\u002F.local\u002Fbin\u002Fop-personal` —\nConnect-bypass for full vault reads, one Windows Hello per unlock window).\nPython callers strip `OP_CONNECT_*` inline in the env dict (the bash wrapper is\nnot exec-able from Windows python — estate gotcha).\n\n**HONEST LIMIT (baked in):** only the `Shared with Grok Bot` vault is\nCLI-visible; the 9 fleet Login items are NOT (1password-ops\u002FSKILL.md:28,32).\nSo the vault is SSOT-of-record while HKCU registry remains the materialized\ncache; roster entries carry `vault_sync: synced|blocked`, and `vault-sync`\nnever force-migrates password-shaped vars (`INSTITUTIONAL_PASSWORD` etc.) —\nthey are listed as op:\u002F\u002F migration candidates with a documented-exception path.\n\n## Capability 4 — browser-assisted OAuth capture (`capture.py`)\n\nStrict preference ladder, owner-in-the-loop (full verdicts in\n[references\u002Foauth-flows.md](references\u002Foauth-flows.md)):\n\n1. **DEVICE-CODE first** wherever the IdP offers it (Entra devicecode endpoint\n   verified live 2026-10-22: HTTP 200, `expires_in` 900, poll 5 s; owner types\n   the code at login.microsoft.com\u002Fdevicelogin themselves). `az` \u002F\n   `gcloud --no-launch-browser` \u002F `gh` web flows need zero browser automation.\n2. **SSO-COOKIE** via env-held credentials POSTed to the portal\n   (institutional-literature-access recipe, owner-sanctioned, no bot-wall).\n3. **BROWSER-ATTACH consent-click LAST** — only for IdPs with no device flow\n   AND no bot-wall, owner-initiated and owner-visible, driven by shelling out\n   to `python playwright` (attach MCP tools are not mounted in workflow\n   subagents).\n\n**Anti-phishing-equivalence rule (verbatim):** silent consent-click automation\nin a logged-in real profile is functionally an OAuth-phishing kit — owner's\nown-accounts, owner-initiated, owner-visible only. Hard refusals encoded as\nrefuse-paths: never automate accounts.google.com; never headless capture\nagainst Cloudflare\u002FAkamai-fronted IdPs; never extract httpOnly cookies via\nattach (the cookie-bridge phone-side lane owns that); cdp-endpoint fallback\nstays OFF; downloads-throwing flows route to browser-rail.\n\n```bash\npython SCRIPTS\u002Fcapture.py --provider google-oauth  # REFUSES (hard wall)\npython SCRIPTS\u002Fcapture.py --provider entra-device  # prints owner steps; polls only with --owner-present\n```\n\n## Capability 5 — lifecycle (`lifecycle.py` + `telemetry.py`)\n\n- **Expiry ledger:** decodes JWT `exp` claims OFFLINE (base64 payload split, no\n  network). Every store's exp source is known from the store-map (.grok\n  `expires_at` RFC3339, .gemini `expiry_date` unix-ms + id_token JWT, .claude\n  `refreshTokenExpiresAt`, .zcode none → derive from JWT, AWS sso cache\n  `expiresAt`, manifest `expiresAt` for static keys). Emits `days_to_expiry`\n  with `expiring_soon` thresholds at 7 d \u002F 1 d.\n- **Refresh watchdog:** a Scheduled Task runs `lifecycle.py watchdog` — one pass\n  of PROVIDER-NATIVE refresh only (the owning CLI rewrites its own store; CLI\n  mtimes verified live 2026-10-22). Stores this box cannot refresh\n  (cursor-agent STALE since 09-02, opencode STALE since 04-27) are marked stale\n  and alerted, never acted on. Failures auto-quarantine in the roster with an\n  alert — never a 3 a.m. stack trace.\n- **Telemetry:** `telemetry.py` fuses ledger expiry + hub\u002Fbridge usage into\n  statusline segments (`forge:\u003Cn>keys exp:\u003Cmin>d`), extending the existing\n  5h\u002Fwk `rate_limits` statusline pattern.\n- **Hygiene enforcement:** nightly schtask runs\n  `~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py` over both skill trees + the\n  state dir with `--rotation-manifest` (exit 2 = findings\u002Ferrors → alert,\n  audit_secret_artifacts.py:212). Its REFERENCE_RE whitelist (:34-38) is what\n  lets `${ENV}`\u002Fop:\u002F\u002F references pass while literals fail — **the gate IS the\n  doctrine.**\n\n```bash\npython SCRIPTS\u002Flifecycle.py ledger build\npython SCRIPTS\u002Flifecycle.py ledger show --store gemini\npython SCRIPTS\u002Ftelemetry.py\n```\n\n## Auth-store map (summary — full registry in references\u002Fstore-map.md)\n\n| id | Path | Kind | Status 2026-10-22 | Refresh owner |\n|---|---|---|---|---|\n| grok | `~\u002F.grok\u002Fauth.json` | issuer-keyed OAuth | LIVE (mtime 10-22) | grok CLI \u002F bridge |\n| codex | `~\u002F.codex` | env-key only, no auth file | n\u002Fa (roster-relevant) | — |\n| claude | `~\u002F.claude\u002F.credentials.json` | designOauth live, claudeAiOauth EMPTY | LIVE (mtime 10-21) | claude CLI |\n| zcode | `~\u002F.zcode\u002Fv2\u002Fcredentials.json` | flat KV | LIVE (mtime 10-22) | zcode CLI |\n| gemini | `~\u002F.gemini\u002Foauth_creds.json` | standard OIDC pair | LIVE (mtime 10-21) | gemini-cli |\n| cursor | `%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb` (3.01 GB SQLite) | desktop keyring | LIVE desktop \u002F STALE cli | Cursor app |\n| cursor-agent | auth.json (stores-research locator) | OAuth | STALE 2026-09-02 | none on this box |\n| opencode | `~\u002F.local\u002Fshare\u002Fopencode\u002Fauth.json` | OAuth | STALE 2026-04-27 (mtime-confirmed) | none on this box |\n| gcloud | `%APPDATA%\\gcloud\\credentials.db` + `legacy_credentials\u002F` | 6 accounts | LIVE (mtime 10-21) | gcloud CLI |\n| aws | `~\u002F.aws\u002Fsso\u002Fcache\u002F*.json` | SSO | cached | aws sso login |\n| gh | `%APPDATA%\\GitHub CLI\\hosts.yml` | env-token form | env-keyed | gh CLI |\n| scw \u002F op | `~\u002F.config\u002Fscw\u002Fconfig.yaml` \u002F `~\u002F.op` | provider configs | scw present; op ABSENT this pass | provider CLI |\n\n## Token hygiene (verbatim rules)\n\n- Values in process memory only: secret VALUES never appear in any file,\n  commit, log, transcript, or reply — env-var NAMES, file paths, key SHAPES,\n  lengths, and masks (≤4 chars) only.\n- Reference-not-literal is estate law: configs carry `${ENV}` refs or `op:\u002F\u002F`\n  URIs, resolved at runtime (rotation.py:252-253); the audit gate's\n  REFERENCE_RE whitelist (audit_secret_artifacts.py:34-38) enforces it\n  mechanically.\n- Harvest reads store bytes → process memory → target store's native API. No\n  intermediate temp files, no value-bearing dumps; shape output is\n  names\u002Ftypes\u002Flengths only.\n- Backup-first on every config-file edit: dated `.bak-\u003Cop>-\u003CYYYYMMDD>` copy +\n  JSON\u002FTOML re-validation before and after.\n- Env persistence via winreg SetValueEx to User+Machine with zero shell echo;\n  Machine-scope writes reserved for named client keys on the GROK_LANE_KEY\n  precedent — never replicate the PLAYWRIGHT_MCP_EXTENSION_TOKEN machine-scope\n  exposure pattern blindly.\n- Irreversibility inherited: never rotate `credentialEncryptionKey` after\n  import, never delete `runtime\u002Fdata`, never share one Build credential across\n  bridge instances.\n- Owner-consent gates on every browser lane: device codes entered by the owner;\n  consent-click capture is owner-initiated, owner-visible, own-accounts-only;\n  first per-client extension connect (tab-drag) and first rail sign-in are\n  owner acts. Silent consent automation = OAuth-phishing-kit equivalence →\n  forbidden.\n- Hard capture refusals: no automation of accounts.google.com; no headless\n  OAuth\u002Fcookie capture against Cloudflare\u002FAkamai-fronted IdPs; no profile-file\n  session seeding (Chrome holds the Cookies file under exclusive lock);\n  cdp-endpoint fallback stays OFF.\n- Device-code flows preferred over consent-click automation wherever the IdP\n  offers them — the code is visible to the owner; the automation never sees\n  credentials.\n- No cross-account contamination: never copy auth.json between accounts;\n  per-account isolation via isolated HOME dirs \u002F profiles (grok-fleet\n  GROK_HOME precedent).\n- Refresh is provider-native only: the owning CLI refreshes its own store;\n  never hand-rolled token POSTs against inferred endpoints; unrefreshable\n  stores are marked stale + alerted, not poked.\n- ToS honesty: bridge-backed (cookie\u002Fdevice reverse-engineered) accounts are\n  rate-capped, segregated from primary accounts, and carry research-use\n  disclaimers forward; official API keys preferred wherever one exists.\n- Nightly hygiene gate: audit_secret_artifacts.py with --rotation-manifest over\n  skill trees + state dir; exit 2 blocks\u002Falerts; findings are\n  path+sha256+line+detector+name only — the gate never becomes a leak itself.\n- Vault SSOT honestly gated: until the 9 fleet Login items are CLI-visible,\n  registry remains the materialized cache and roster entries carry\n  `vault_sync: blocked` — no pretending the vault is authoritative while it\n  cannot be read.\n- Password-shaped env vars are never force-rotated or auto-migrated; they are\n  inventoried as op:\u002F\u002F migration candidates with a documented-exception path.\n\n## Demo (target store: gemini) — transcript placeholder\n\nWhy gemini: shape fully known and non-sensitive to parse; the `id_token` JWT\ndemonstrates OFFLINE exp decoding with zero network and zero owner interaction;\nit does NOT disturb the already-wired grok lane (re-importing `.grok\u002Fauth.json`\nto a second bridge would violate the never-share-one-Build-credential rule, and\nits client-key lane is already live — it would prove nothing new); the sibling\n`~\u002F.gemini\u002Fgoogle_accounts.json` gives the account tag for roster registration.\n\nSequence (all unattended, no owner steps):\n\n1. `python SCRIPTS\u002Fharvest.py --store gemini --dry-shape` → expects\n   `gemini: oauth-pair, access len=261, refresh len=103, exp=\u003CISO>,\n   days_to_expiry=N` — never a value.\n2. Pipe step-1 output through the leak-grep (references\u002Fhygiene.md) → 0 hits.\n3. `python SCRIPTS\u002Froster.py sync` → registers the gemini lane\n   (status active + expiry) and emits rotation-manifest.json.\n4. `python SCRIPTS\u002Flifecycle.py ledger build` → ledger gains the\n   gemini entry alongside every other mapped store.\n5. `python ~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py \u003Cboth trees> \u003Cstate dir>\n   --rotation-manifest \u003Cstate>\u002Frotation-manifest.json` → SUCCESS, exit 0.\n6. `--sink env --dry-run` ONLY — a live sink write without the owner present is\n   unnecessary for proof; the grok lane already proved the live sink path\n   end-to-end on 2026-10-21 (grokPattern steps 3-5, real-completion smoke).\n\n```\n\u003C!-- DEMO TRANSCRIPT PLACEHOLDER — paste step outputs here after the first live\n     demo run. Lengths, dates, and statuses ONLY; never values. -->\n```\n\n## Validation (post-build gate — run once the sibling scripts are final)\n\n```bash\n# 1. leak-grep over trees+state → must be 0 hits (grep exit 1)\ngrep -rEn '(github_pat_[A-Za-z0-9_]{20,}|gh[pousr]_[A-Za-z0-9]{20,}|hf_[A-Za-z0-9]{20,}|tvly-[A-Za-z0-9_-]{20,}|fc-[A-Za-z0-9_-]{20,}|-----BEGIN [A-Z ]*PRIVATE KEY-----)' \\\n  ~\u002F.zcode\u002Fskills\u002Fcredential-forge ~\u002F.agents\u002Fskills\u002Fcredential-forge ~\u002F.agents\u002Fstate\u002Fcredential-forge\n# 2. the audit gate itself (exit 0 = clean; exit 2 = a real finding)\npython ~\u002F.agents\u002Fscripts\u002Faudit_secret_artifacts.py \\\n  C:\u002FUsers\u002FPrekzursil\u002F.zcode\u002Fskills\u002Fcredential-forge C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fskills\u002Fcredential-forge \\\n  C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge \\\n  --rotation-manifest C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge\u002Frotation-manifest.json \\\n  --report C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge\u002Flast-audit.json\n# 3. manifest schema round-trip (must print manifest-schema-ok N)\npython -c \"import json;m=json.load(open(r'C:\u002FUsers\u002FPrekzursil\u002F.agents\u002Fstate\u002Fcredential-forge\u002Frotation-manifest.json'));assert all(isinstance(p.get('environmentVariables'),list) for p in m['providers']);print('manifest-schema-ok', sum(len(p['environmentVariables']) for p in m['providers']))\"\n# 4. dual-tree doc identity\ndiff ~\u002F.zcode\u002Fskills\u002Fcredential-forge\u002FSKILL.md ~\u002F.agents\u002Fskills\u002Fcredential-forge\u002FSKILL.md\ndiff -r ~\u002F.zcode\u002Fskills\u002Fcredential-forge\u002Freferences ~\u002F.agents\u002Fskills\u002Fcredential-forge\u002Freferences\n# 5. mask-width conformance (no wider-than-4 slices anywhere in the trees) → 0 hits\ngrep -rnE '\\[:(8|7)\\]' ~\u002F.zcode\u002Fskills\u002Fcredential-forge ~\u002F.agents\u002Fskills\u002Fcredential-forge\n```\n\n## Troubleshooting\n\n| Symptom | Cause \u002F fix |\n|---|---|\n| harvest `ABSENT \u003Cstore>` | path moved — re-probe per references\u002Fstore-map.md; store-map carries the stores-research locator for cursor-agent |\n| bridge import `authImportFailed` | wrong document shape — use the normalized single-entry doc (grok-lane\u002FSKILL.md:94-104), not the raw issuer map |\n| roster sync finds 0 names | run from a shell with PowerShell available; enumeration is names-only HKCU+HKLM |\n| `forge-run` cannot resolve a ref | ref not in roster and not op:\u002F\u002F-shaped → run `roster.py sync`; check `vault_sync: blocked` (vault item not CLI-visible) |\n| op wrapper yields nothing \u002F Connect errors | `op-personal` bypass missing (OP_CONNECT_* must be unset per-call, never deleted globally); desktop app must be running with CLI integration enabled |\n| ledger shows epoch-zero \u002F 1970 expiry | store lacks a native exp → lifecycle derives from JWT; if the value isn't a JWT either, entry is marked `unknown-expiry`, not guessed |\n| watchdog alerts STALE cursor-agent\u002Fopencode | expected — no refresh owner on this box; owner re-auth via the owning CLI when needed |\n| capture.py refuses a provider | that's a hard wall, not a bug — see references\u002Foauth-flows.md before considering ANY workaround |\n| audit exit 2 on skill\u002Fstate files | a real leak-shaped literal — fix the file; never widen REFERENCE_RE to pass |\n| trees differ | docs: re-mirror (`cp` SKILL.md + references\u002F across); scripts: the .agents tree is canonical while sibling work is in flight — reconcile with skill-tree-reconcile once finalized |\n",{"name":5,"description":7},"main","a298c929b6cbd662e1fce54302ce520d5ceea1a5","skills\u002Fcredential-forge","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain","https:\u002F\u002Fgithub.com\u002FPrekzursil","2026-11-02 14:30:57",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add Prekzursil\u002Fagent-skills-toolchain --skill credential-forge",{"tool":56,"command":57},"bunx","bunx skills add Prekzursil\u002Fagent-skills-toolchain --skill credential-forge",{"tool":59,"command":60},"pnpm","pnpm dlx skills add Prekzursil\u002Fagent-skills-toolchain --skill credential-forge","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002FSKILL.md",true,[64,70,74,78,82,88,92,96,100,104,108],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fhygiene.md","REFERENCE","参考文档",4265,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Freferences\u002Fhygiene.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fnaming-spec.md",3132,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Freferences\u002Fnaming-spec.md",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Foauth-flows.md",4020,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Freferences\u002Foauth-flows.md",{"path":79,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fstore-map.md",5050,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Freferences\u002Fstore-map.md",{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"scripts\u002F_common.py","SCRIPT","脚本",18133,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002F_common.py",{"path":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"scripts\u002Fcapture.py",14957,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002Fcapture.py",{"path":93,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":94,"sourceHtmlUrl":95},"scripts\u002Fharvest.py",30515,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002Fharvest.py",{"path":97,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":98,"sourceHtmlUrl":99},"scripts\u002Flifecycle.py",19900,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002Flifecycle.py",{"path":101,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":102,"sourceHtmlUrl":103},"scripts\u002Fmaterialize.py",9118,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002Fmaterialize.py",{"path":105,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":106,"sourceHtmlUrl":107},"scripts\u002Froster.py",12047,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002Froster.py",{"path":109,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":110,"sourceHtmlUrl":111},"scripts\u002Ftelemetry.py",3688,"https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-forge\u002Fscripts\u002Ftelemetry.py",[113,135,166,193,207,223],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":39},"01M6DF7D7478R55P46REYH4QAC","clarify-requirements","Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Fworkspace-hooks\u002Fskills\u002Fclarify-requirements\u002FSKILL.md",[],[120,121,122,123,124,125,126,127,128,129,130,131,132,133,134],"clarify requirements","clarify","requirements","risk","options","task","prompts","goal","scanning","use","context","repo","injection","execution","file",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":146,"publishedAt":39},"01M6DF79CA4BHJS66J8EZDBPWJ","openmm-md","Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein \u002F protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Fmcp\u002Fopenmm-md-mcp\u002Fskill\u002Fopenmm-md\u002FSKILL.md",[141],{"categoryNo":142,"categoryName":143,"taxonomyType":144,"taxonomyTypeDesc":145},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[147,148,149,150,151,152,153,154,155,156,157,158,159,160,129,161,162,163,164,165],"openmm md","how","decision","pick","linux","analyze","tool","stack","open","NVIDIA","gpu","license","workflow","windows","free","molecular dynamics","local","do","MCP",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":178,"publishedAt":39},"01M6DF76C1MG85VEWP8VZCBNMN","visual-review","Take screenshots of web pages and UI using Playwright for visual review and iteration","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fvisual-review\u002FSKILL.md",[172,175],{"categoryNo":173,"categoryName":174,"taxonomyType":144,"taxonomyTypeDesc":145},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":176,"categoryName":177,"taxonomyType":144,"taxonomyTypeDesc":145},"01JBSEEDCAT000000000000008","测试与质量",[179,180,181,182,183,184,185,186,187,188,148,189,190,191,192],"review","visual","visual review","pages","web","false","iteration","take","check","slides","ui","screenshot","playwright","screenshots",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":199,"publishedAt":39},"01M6DF73AQVCBZKEN0YXEX9FXP","status","Diagnostic status report — shows metaswarm installation state, project setup, and potential issues","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fstatus\u002FSKILL.md",[],[195,200,201,202,203,204,205,206],"setup","report","project","installation","project setup","issues","state",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":211,"categories":212,"keywords":214,"publishedAt":39},"01M6DF6X6C2XB0P6GX76P7TTYV","start","Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fstart\u002FSKILL.md",[213],{"categoryNo":142,"categoryName":143,"taxonomyType":144,"taxonomyTypeDesc":145},[209,215,125,216,217,218,129,219,220,221,222],"start issue","issue","ready","work on issue","user","work","work on","development",{"skillNo":224,"name":200,"nameZh":6,"description":225,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":226,"categories":227,"keywords":228,"publishedAt":39},"01M6DF6QMJ9AJKFKHHKRT005PQ","Interactive project setup — detects your project, configures metaswarm, writes project-local files","https:\u002F\u002Fgithub.com\u002FPrekzursil\u002Fagent-skills-toolchain\u002Fblob\u002Fmain\u002Ftools\u002Feditor\u002Fmetaswarm\u002Fskills\u002Fsetup\u002FSKILL.md",[],[200,202,163,229,204,230],"files","interactive"]