Skip to main content

new-module

Scaffold a new hardware-isolated module with tests and wiring

Ir a la instalación

Datos de origen

Repositorio
weaties/helmlog
Última actividad en el origen
21 de abril de 2026 a las 16:04
Idioma detectado de SKILL.md
inglés
Estrellas
2
Forks
2

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
new-module
description
Scaffold a new hardware-isolated module with tests and wiring
disable-model-invocation
true
# New Module: `$ARGUMENTS` Follow this checklist to create a new hardware-isolated module. Use TDD (`/tdd`) for each step that involves code. ## Checklist ### 0. Enter a worktree Before any file edits, make sure the session is in a git worktree. Check `git worktree list` — reuse an existing one via `EnterWorktree(path=...)` if it matches this task, otherwise create a new one via `EnterWorktree(name=...)`. Scaffolding touches `tests/`, `src/logger/`, `main.py`, and often `web.py` and `storage.py` — exactly the kind of multi-file change that collides with other agents sharing the repo. See CLAUDE.md for the full rule. ### 1. Write tests first Create `tests/test_$ARGUMENTS.py` with tests for the module's public API. Use the `storage` fixture from `conftest.py` and mock any external I/O. ### 2. Create the module Create `src/logger/$ARGUMENTS.py`: - Single-purpose, under ~200 lines - All external I/O (HTTP, serial, USB, etc.) isolated in this module - Use dataclasses for structured data - Use `loguru` for logging (never `print()`) - Full type annotations on all functions ### 3. Schema migration (if needed) If the module needs database tables: - Bump `_CURRENT_VERSION` in `storage.py` - Add migration SQL to `_MIGRATIONS` dict - Add async storage methods (CRUD) - Test with the in-memory `storage` fixture ### 4. Web routes (if needed) If the module needs API endpoints or admin UI: - Add to `web.py` following existing patterns - Admin pages: require `require_auth("admin")` - Add nav link in `_nav_html()` - Add web route tests in `test_web.py` ### 5. Wire into main.py - Import the module **only in `main.py`** (hardware isolation principle) - Parse config from env vars - Pass to `_web_loop()` / `create_app()` if needed - Add CLI subcommand if applicable ### 6. Sync dependencies If the module requires new packages: - Add with `uv add <package>` (never edit pyproject.toml manually for deps) - Run `uv sync` and verify the import works - Never use `uv pip install` — it bypasses the lockfile and won't persist ### 7. Update config - Add new env vars to `.env.example` with comments - Update `CLAUDE.md` project structure tree ### 8. Run `/pr-checklist`
Ver en GitHub