Skip to content

Commit c5cd588

Browse files
wu-shengclaude
andcommitted
docs: add Claude Code Skills documentation
Add docs/en/contribution/Claude-Code-Skills.md covering: - CLAUDE.md scope (project context for Claude Code) - /new-plugin skill (scaffold new instrumentation plugins) - /plugin-test skill (run CI tests locally) Link from Developer.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1027f22 commit c5cd588

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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.

docs/en/contribution/Developer.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ automatically follow environment.
4949

5050
# Next
5151
Refer to the [Plugin Development Guide](How-to-develop-plugin.md) to learn how to build a new plugin for a library.
52+
53+
## Claude Code Skills
54+
This project includes Claude Code configuration for AI-assisted development. See [Claude Code Skills](Claude-Code-Skills.md) for available skills (`/new-plugin`, `/plugin-test`) and what `CLAUDE.md` covers.

0 commit comments

Comments
 (0)