Precommit Checks
SkillDev toolsLets your agent run lint, format, type checks, and tests on the mycelium codebase and auto-fix issues before committing.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the Precommit Checks skill
About this 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.
What this skill tells your AI
The instructions your AI receives, as published by mycelium-io/mycelium in .claude/skills/precommit/SKILL.md and read by ahel’s review.
Run all quality checks on the mycelium codebase. Auto-fix issues where possible.
Steps
-
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: ignoreunless the underlying issue is a typeshed/library bug (CORSMiddleware add_middleware is the canonical example).Stale client signal: if ty reports
unknown-argumentorunresolved-attributeon a type imported frommycelium_backend_client, the generated client is out of date — skip to step 6 and regenerate before re-running ty. -
Backend tests — Run pytest:
cd fastapi-backend && uv run pytest tests/ -x -q -
Frontend — Type-check, test, and build. All three:
tscandnext buildbetween them prove the app compiles, not that it behaves, and the component suite is where the interaction bugs actually get caught.cd mycelium-frontend && npx tsc --noEmit && npx vitest run && npx next buildnpm run lintistsc --noEmit— there's no separate ESLint pass. The suite should come back fully green; a failure that looks environmental (missing DOM API, a global the runtime shapes differently) belongs invitest.setup.tsas a guarded stub next to the others, not left failing for the next person to rediscover. -
CLI docs — If any CLI command files were changed (
mycelium-cli/src/mycelium/commands/):- Ensure new commands have
@doc_refdecorators - Run
/generate-cli-docsto regenerate the HTML CLI reference - If markdown source files changed (
mycelium-cli/src/mycelium/docs/**/*.md), also runcd mycelium-cli && uv run python ../docs/generate_docs.pyto regenerate the docs site (docs/index.html,docs/adapters.html,docs/reference.html, plusdocs/search-index.jsanddocs/llms-full.txt).--page <start|adapters|reference>limits what gets written; every page is still assembled, because the persistent nav and the search index span the whole site. The script reads<!-- keep -->-marked hand-coded sections from the existing HTML — don't delete those files between edits.
- Ensure new commands have
-
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. Ifopenapi.jsonis already current (i.e. you ransnapshot-openapi.shor the spec wasn't updated), no backend is needed:SPEC_FILE=openapi.json ./scripts/gen-mycelium-client.shIf the spec itself needs refreshing from a live backend first:
docker compose -f mycelium-cli/src/mycelium/docker/compose.yml up -d mycelium-backend ./scripts/gen-mycelium-client.shWrites to
mycelium-client/mycelium_backend_client/andmycelium-cli/src/mycelium_backend_client/. CI fails if the committed copy drifts from live/openapi.json.CFN client.
app/services/cfn_negotiation.pyuses the generated typedioc_cfn_svc_api_client(fromfastapi-backend/cfn_swagger.json). If the CFN image was bumped inmycelium-cli/src/mycelium/docker/compose.yml, refresh + regenerate:CFN_URL=http://localhost:9002 ./scripts/gen-cfn-client.sh(or point at the ioc-cfn-svc repo'sdocs/swagger.json), thencd fastapi-backend && uv run ty check .. Type errors at call sites mean the CFN contract changed. The typecheck IS the contract test. (cfn_knowledge.pystays on httpx by design: json.RawMessage payload + graph endpoints absent from swagger.) -
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(Guide),docs/adapters.html,docs/reference.html— main docs site (3 pages, generated), plusdocs/search-index.jsdocs/mycelium-dataflow.html— scrolly presentation deckdocs/demo-script.md— live demo scriptREADME.md— quickstart and overviewmycelium-cli/src/mycelium/docs/— built-in CLI docs- Adapter skills (
mycelium-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 an adapter's shipped assets (mycelium-cli/src/mycelium/integrations/claude_code/assets/,.../cursor/assets/) was changed, runmycelium doctorto verify every check still passes against the current install:mycelium doctorAll 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.pyfollowing the_check_*() -> CheckResultpattern 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.
Signals
- GitHub stars
- 119
- Forks
- 12
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
precommit-mycelium-io- Source
- github.com/mycelium-io/mycelium
github.com/mycelium-io/mycelium
Related picks
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · wshobson
The pick for JavaScriptpython-performance-optimization
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Pythonsetup-ts-deep-modules
Skill · mattpocock
The pick for TypeScripttypescript-pro
Skill · jeffallan
The pick for TypeScript