|
| 1 | +# Claude Code Skills |
| 2 | + |
| 3 | +This project includes [Claude Code](https://claude.com/claude-code) configuration to assist with development. |
| 4 | + |
| 5 | +## CLAUDE.md |
| 6 | + |
| 7 | +The `CLAUDE.md` file at the project root provides Claude Code with project context: |
| 8 | + |
| 9 | +- **Project structure** — module layout, key files and their purposes |
| 10 | +- **Plugin API** — span types, instrumentation patterns (method replacement, wrapt proxy, async wrappers, interceptors), tags, component IDs |
| 11 | +- **Context & Carrier API** — `get_context()` signatures, Carrier format, correlation API |
| 12 | +- **Plugin configuration options** — all `SW_AGENT_*` plugin settings |
| 13 | +- **Testing framework** — Docker-based integration tests, expected data format, test patterns |
| 14 | +- **Build commands** — `make env`, `make test`, `make lint`, `make doc-gen`, etc. |
| 15 | +- **CI pipeline** — GitHub Actions matrix, Python version coverage |
| 16 | +- **GitHub Actions allow list** — Apache enforces pinned SHAs for third-party actions |
| 17 | +- **Complete plugin inventory** — all 35 instrumentation plugins by category |
| 18 | + |
| 19 | +## Skills |
| 20 | + |
| 21 | +### `/new-plugin` — Scaffold a New Plugin |
| 22 | + |
| 23 | +Generates all files needed for a new instrumentation plugin: |
| 24 | + |
| 25 | +- **Plugin module** (`skywalking/plugins/sw_<name>.py`) with correct instrumentation pattern based on plugin type (HTTP entry/exit, database, cache, MQ, RPC) |
| 26 | +- **Component enum entry** in `skywalking/__init__.py` |
| 27 | +- **Test directory** (`tests/plugin/{data|http|web}/sw_<name>/`) with: |
| 28 | + - Test file with parametrized versions |
| 29 | + - Docker Compose configuration |
| 30 | + - Provider and consumer services |
| 31 | + - Expected span data YAML |
| 32 | +- Post-generation reminders (component-libraries.yml, UI logo, doc-gen, lint) |
| 33 | + |
| 34 | +Usage: `/new-plugin` and provide the library name, type, and versions to test. |
| 35 | + |
| 36 | +### `/plugin-test` — Run Plugin Tests Locally |
| 37 | + |
| 38 | +Runs the same tests that CI runs, but locally: |
| 39 | + |
| 40 | +- Builds Docker test images for specific Python versions |
| 41 | +- Runs unit tests (no Docker needed) or plugin integration tests |
| 42 | +- Maps plugin names to test paths |
| 43 | +- Supports testing across multiple Python versions by rebuilding the Docker image |
| 44 | +- Includes troubleshooting guidance for common failures (proxy issues, container debugging) |
| 45 | + |
| 46 | +Usage: `/plugin-test` and specify the scope (e.g., `flask`, `redis`, `unit`, `all`) and Python version. |
| 47 | + |
| 48 | +**Important**: If you have `http_proxy`/`https_proxy` set, clear them before running plugin tests — the test HTTP requests must reach Docker containers directly. |
0 commit comments