> Sourced from [mihai-dinculescu/tapo](https://github.com/mihai-dinculescu/tapo) โ [MIT](https://github.com/mihai-dinculescu/tapo/blob/8bfa6215805a0104de44fb36796064ad234784d7/CLAUDE.md). # CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Architecture ### Workspace Members - **`tapo`** โ Core Rust library (published to crates.io) - **`tapo-py`** โ Python bindings via PyO3/maturin (published to PyPI) - **`tapo-mcp`** โ MCP server exposing Tapo devices as AI tools/resources ## Cross-Language Bindings When modifying Rust code that has Python bindings (tapo-py), always check if corresponding Python type stubs (.pyi files) need updating. The `debug` feature in `tapo` is **user-facing public API** โ `tapo-py` enables it (`features = ["python", "debug"]`), so all `debug`-gated types are also exposed to Python. Treat changes behind `cfg(feature = "debug")` as public API changes requiring changelog entries for both Rust and Python. ### Exposing Rust Types to Python - **Simple value/result types**: Annotate directly in the `tapo` crate with `#[cfg_attr(feature = "python", pyo3::prelude::pyclass(from_py_object, ...))]` and `#[cfg(feature = "python")] crate::impl_to_dict!(TypeName);`. Do NOT create a redundant wrapper struct in `tapo-py`. - **`serde_json::Value` โ Python**: Use `crate::python::serde_object_to_py_dict`. Do NOT write custom conversion functions โ pyo3's `serde` feature does not auto-implement `IntoPyObject` for `Value`. ### Python Stub Conventions - `Ext` classes in `.pyi` stubs (e.g. `ToDictExt`, `DebugExt`, `OnOffExt`) must use `typing.Protocol` since they describe capabilities of PyO3 classes without real Python-level inheritance. ## Problem Solving When a first fix attempt fails, step back and investigate the root cause before trying another surface-level fix. Explain the diagnosis before proposing the next approach. ## Git Commits Always run `/commit` when committing. It contains the project's commit conventions.
Add to your project
Paste into your project's CLAUDE.md or ~/.claude/CLAUDE.md for global rules.
More for Python
Python FastAPI Expert
by @Claude Rules
Building high-performance REST APIs with FastAPI, Pydantic, and async Python.
Django Web Framework
by @Claude Rules
Full-stack Django development with DRF, proper models, and security best practices.
Rust Systems Programming
by @Claude Rules
Safe, fast Rust code leveraging the ownership system, traits, and zero-cost abstractions.
Mindx CLAUDE.md
by @DotNetAge
ไธไธชๅฏ่ชไธป่ฟๅ็ๆฐๅญๅๅ่บซ
Minimal Second Brain CLAUDE.md
by @gokhanarkan
A minimal, AI-native Obsidian vault template. 3 folders, manifest files for Claude/Copilot, automated maintenance.
Awesome Claude Notes CLAUDE.md
by @loulanyue
๐ ๅธฎๅฉไฝ ๅฟซ้ๆญๅปบ Claude Code ไธ AI Agent ็ไบงๅๅทฅไฝๆต็ๅฎๆไปๅบ ๐ A practical toolkit to help you quickly build high-productivity workflows for Claude Code and AI agents
MCP servers for Python
microsoft/markitdown
๐๏ธ ๐ ๐ - MCP tool access to MarkItDown -- a library that converts many file formats (local or remote) to Markdown for LLM consumption.
mindsdb/mindsdb
Connect and unify data across various platforms and databases with .
FastMCP
๐ - A high-level framework for building MCP servers in Python
Get the Claude Code Starter Pack
Top CLAUDE.md rules for Next.js, TypeScript, Python, Go, and React โ free.
