agentleFS
mihai-dinculescumihai-dinculescu/tapo/CLAUDE.md

tapo

CLAUDE.md870 starsChanged 6 days agoMITView on GitHub

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. When a first fix attempt fails, step back and investigate the root cause before trying another…

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    serde_json::Value → Python: Use crate::python::serde_object_to_py_dict.

    line 18
  2. Distinctive:

    When a first fix attempt fails, step back and investigate the root cause before trying another surface-level fix.

    line 25
  3. Very specific:

    Always run /commit when committing.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.