Skip to main content

new-module

Scaffold a new hardware-isolated module with tests and wiring

소스 정보

저장소
weaties/helmlog
최근 소스 활동
2026년 4월 21일 16:04
감지된 SKILL.md 언어
영어
스타
2
포크
2

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
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`
GitHub에서 보기