Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
mushi-health【部署与运维】Pass/fail health check across every Mushi Mushi pipeline component — CLI credentials, API reachability, edge functions, BYOK key pool, QA cron. Use when "is mushi working", "mushi health check", "check mushi pipeline", "mushi deploy check", "pipeline not responding", or right after setup.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Degree of freedom: MIXED. First-red diagnosis [HIGH freedom];
Steps 1–6 in order [LOW freedom — run exactly].
doctor, deploy check, keys, logs, cron — in that orderObserve:
mushi doctorgreen;mushi deploy check✗qa-story-runner;qa_story_runsempty for 2h. Interpret: first red is the runner; empty cron is downstream. Classify: function-down — checkquery_logsforqa-story-runner; do not add keys yet. Verify: stop at Step 2; fix the runner; continue remaining steps only after it is green.
mushi-integration; targeted diagnosis → diagnose_setupRun these checks in order. Stop and fix at the first ❌ before continuing.
| # | Component | How to check |
|---|---|---|
| 1 | CLI credentials | mushi doctor |
| 2 | API + edge functions | mushi deploy check |
| 3 | Project overview | mushi status |
| 4 | BYOK key pool | mushi keys list or MCP list_byok_keys |
| 5 | Supabase logs | Supabase MCP query_logs |
| 6 | QA cron running | DB query on qa_story_runs |
mushi doctor
Expected output — all lines green:
✓ ~/.mushirc found
✓ MUSHI_API_KEY valid (mushi_...)
✓ MUSHI_API_ENDPOINT reachable (200 OK)
✓ MUSHI_PROJECT_ID matches a live project
✓ Feature flags fetched
Fix if red: Re-run mushi login --api-key mushi_... --endpoint https://<ref>.supabase.co/functions/v1/api --project-id <pid>.
mushi deploy check
Probes each edge function with a lightweight ping. Healthy output:
✓ api
✓ classify-report
✓ fix-worker
✓ story-mapper
✓ test-gen-from-story # Mushi edge function, not a pack skill
✓ pdca-runner
✓ qa-story-runner
A ✗ on any line means that function is down. Check its logs in Step 5.
mushi status
Confirm:
autofix_agent shows the expected agent (cursor_cloud, mcp, etc.).billing: quota_exceeded warning.Via CLI:
mushi keys list
Via MCP (if the Mushi MCP server is active in Cursor):
list_byok_keys(projectId)
Healthy: at least one anthropic key with status=active, at least one firecrawl key with status=active.
Fix: Add a missing or exhausted key:
mushi keys add --provider anthropic --key sk-ant-... --label "primary" --priority 100
mushi keys add --provider firecrawl --key fc-... --label "primary" --priority 100
Use the Supabase MCP (requires SUPABASE_ACCESS_TOKEN in MCP config):
query_logs(sql: "select timestamp, log_attributes['function_id'] as function_id, log_attributes['level'] as level, event_message from logs where source = 'function_logs' order by timestamp desc limit 100", iso_timestamp_start: "<ISO 8601, 15 min ago>")
function_logs holds console output from inside each function;
function_edge_logs holds the invocations and their status codes.
function_id is the id that list_edge_functions returns for each slug.
Look for ERROR lines in the last 15 minutes, especially from these
Mushi edge functions (not pack skills):
story-mapper — Firecrawl timeout or Claude quotatest-gen-from-story — LLM key exhaustedpdca-runner — failed PDCA cycleqa-story-runner — Browserbase quota or Firecrawl errorIf the Supabase MCP is not wired in Cursor, use the CLI:
supabase functions logs story-mapper --project-ref <ref>
supabase functions logs qa-story-runner --project-ref <ref>
Verify scheduled tests are executing (requires Supabase MCP):
SELECT status, COUNT(*)
FROM qa_story_runs
WHERE created_at > NOW() - INTERVAL '2 hours'
GROUP BY status;
Healthy output: at least one completed row in the last 2 hours (if you have enabled stories).
If qa_story_runs is empty:
enabled = true and approval_status = 'approved'.SELECT jobname, schedule FROM cron.job WHERE jobname LIKE 'qa%';mushi tdd run <qa-story-id> and re-check.After running all steps, record results:
| Component | Status | Notes |
|---|---|---|
| CLI credentials | ✅ / ❌ | |
| Edge functions | ✅ / ❌ | Which ones failed? |
| Project overview | ✅ / ❌ | Billing ok? |
| BYOK key pool | ✅ / ❌ | Missing providers? |
| Supabase logs | ✅ / ❌ | Any ERRORs? |
| QA cron | ✅ / ❌ | Last run at? |
If all ✅ → pipeline is healthy.
If any ❌ → run the mushi MCP diagnose_setup tool for targeted diagnosis when the Mushi MCP server is configured (the @mushi-mushi/mcp package; this pack does not bundle it). Without it, run mushi doctor and follow debug-error on the failing component.
| Symptom | Likely cause | Fix |
|---|---|---|
mushi doctor can't reach endpoint | Wrong MUSHI_API_ENDPOINT in ~/.mushirc | Re-run mushi login --endpoint https://... |
| All edge functions ❌ | Supabase project paused (free tier) | Restore the project in the Supabase dashboard |
BYOK keys all quota_exhausted | Rate limits hit on all keys | Add a backup key for each provider |
| QA cron never fires | pg_cron job missing | Re-run migration 20260602000003_pdca_qa_improve_cron.sql |