一键导入
precommit
Run precommit checks (lint, format, tests) on the mycelium codebase. Use when the user says /precommit or wants to check code quality before committing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run precommit checks (lint, format, tests) on the mycelium codebase. Use when the user says /precommit or wants to check code quality before committing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run end-to-end smoke tests for the Mycelium stack. Verifies install, memory, search, coordination, and OpenClaw integration. Use when validating a release, after a deploy, or when something feels broken.
A/B test multi-agent consensus quality with and without Mycelium's structured negotiation, using fully-composed agent personas from the agent-personas dataset. Pick a named scenario (e.g. ex07_investment_portfolio) and the skill fetches the right personas, builds SOUL.md for each agent, then runs the standard before/after flow.
Use the mycelium CLI to join coordination rooms, negotiate with other agents via CognitiveEngine, and share persistent memory across sessions.
Multi-agent coordination layer with persistent memory. Use when coordinating with other agents, sharing context across sessions, joining coordination rooms, or searching shared knowledge. Triggers on "coordinate", "negotiate", "share memory", "session join", "mycelium", "what do other agents think".
Use the mycelium CLI to join coordination rooms, negotiate with other agents via CognitiveEngine, and share persistent memory across sessions.
Run end-to-end smoke tests for the Mycelium claude_code adapter. Verifies claude CLI prereqs, daemon installation, single-host cold-spawn dispatch, multi-room ownership semantics, notes persistence across spawns, control verbs (status/abort), budget gating, concurrent dispatch serialization, and (with funded API credits) autonomous coordination via mycelium-daemon coordination_tick handling. Use when validating the claude_code adapter after changes to `integrations/claude_code/**`, the daemon, or after upgrading the `claude` CLI itself.
| name | precommit |
| description | Run precommit checks (lint, format, tests) on the mycelium codebase. Use when the user says /precommit or wants to check code quality before committing. |
Run all quality checks on the mycelium codebase. Auto-fix issues where possible.
Lint + format — Fix lint and format issues automatically:
cd fastapi-backend && uv run ruff check --fix . && uv run ruff format .
cd mycelium-cli && uv run ruff check --fix . && uv run ruff format .
Type check (ty) — Both backend and CLI must come back clean. CI gates on this:
cd fastapi-backend && uv run ty check .
cd mycelium-cli && uv run ty check .
Generated client (mycelium-cli/src/mycelium_backend_client/) is excluded via [tool.ty.src] since openapi-python-client templates produce diagnostics we can't fix without forking the generator. New diagnostics outside that path must be resolved before commit — don't paper over with # ty: ignore unless the underlying issue is a typeshed/library bug (CORSMiddleware add_middleware is the canonical example).
Tests — Run pytest:
cd fastapi-backend && uv run pytest tests/ -x -q
Frontend — Type-check and build:
cd mycelium-frontend && npx tsc --noEmit && npx next build
OpenClaw plugin tests — If any file under mycelium-cli/src/mycelium/integrations/openclaw/assets/mycelium/plugin/ was changed (source, test, or config), run the plugin's vitest suite:
cd mycelium-cli/src/mycelium/integrations/openclaw/assets/mycelium/plugin && npm test
If node_modules/ is missing, run npm install --silent first. Tests cover the pure routing logic (mentions, session-key format, channel config parsing, route decisions). Adding new message types or routing rules should come with tests in test/route.test.ts.
CLI docs — If any CLI command files were changed (mycelium-cli/src/mycelium/commands/):
@doc_ref decorators/generate-cli-docs to regenerate the HTML CLI referencemycelium-cli/src/mycelium/docs/*.md), also run cd mycelium-cli && uv run python ../docs/generate_docs.py to regenerate the docs site (docs/index.html, docs/adapters.html, docs/reference.html). Use --page <learn|adapters|reference> to rebuild a single page. The script reads <!-- keep -->-marked hand-coded sections from the existing HTML — don't delete those files between edits.Generated OpenAPI clients — Two clients are vendored from live OpenAPI specs. CI gates on the mycelium one being current; the CFN one is regenerated by hand when we bump the image.
Mycelium backend → CLI client. If any backend schemas or routes changed (fastapi-backend/app/schemas.py, fastapi-backend/app/routes/), regenerate. The backend must be running locally first.
docker compose -f mycelium-cli/src/mycelium/docker/compose.yml up -d mycelium-backend
./scripts/gen-mycelium-client.sh
Writes to mycelium-client/mycelium_backend_client/ and mycelium-cli/src/mycelium_backend_client/. CI fails if the committed copy drifts from live /openapi.json.
CFN client. If mycelium-cli/src/mycelium/docker/compose.yml was bumped to a new ioc-cognition-fabric-node-svc version, regenerate. The CFN stack must be running.
docker compose -f mycelium-cli/src/mycelium/docker/compose.yml --profile cfn up -d
./scripts/gen-cfn-client.sh
Writes to fastapi-backend/ioc_cfn_svc_api_client/. After regen, run cd fastapi-backend && uv run ty check . — type errors at CFN call sites in app/services/cfn_negotiation.py or app/services/cfn_knowledge.py mean CFN renamed/dropped a field and the call needs updating. The typecheck IS the contract test.
Docs consistency — If any user-facing behavior changed (commands renamed, new features, API changes), grep for stale references and fix them in:
docs/index.html (Learn), docs/adapters.html, docs/reference.html — main docs site (3 pages, generated)docs/mycelium-dataflow.html — scrolly presentation deckdocs/demo-script.md — live demo scriptREADME.md — quickstart and overviewmycelium-cli/src/mycelium/docs/ — built-in CLI docsmycelium-cli/src/mycelium/integrations/*/assets/skills/)Doctor sanity check — If any file under mycelium-cli/src/mycelium/commands/doctor.py, mycelium-cli/src/mycelium/commands/adapter.py, or mycelium-cli/src/mycelium/integrations/openclaw/assets/ was changed, run mycelium doctor to verify every check still passes against the current install:
mycelium doctor
All checks should be green (✓). If any come back as warnings (~) or errors (✗), act on them before committing — doctor is the fastest way to catch adapter-install regressions (stale manifests, drift between installed vs packaged plugin, channel config issues).
If you added new failure modes that doctor should catch, add a new check function to doctor.py following the _check_*() -> CheckResult pattern and register it in _run_all_checks(). Doctor is the user's first debugging tool — new silent-failure classes should land here alongside their fix.
Report — Summarize what was fixed and any remaining issues.