tonyandrewmeyer/cantrip/charm-improvement
Claude Code and agent skill by tonyandrewmeyer/cantrip
- community
Checking that the SKILL.md file is still in the repository.
Auditing and improving existing charms to modern standards
Install
npx vskill@latest install tonyandrewmeyer/cantrip/charm-improvementSKILL.md
The same SKILL.md was published earlier as tonyandrewmeyer/cantrip/charm-improvement.
Charm Improvement
Use this skill when improving an existing charm — auditing it against best practices, filling gaps, modernising code, and preparing it for Charmhub listing.
Workflow
- Audit — run
charm_auditon the charm directory to get a structured report - Review — present findings to the user, categorised as must-fix / should-fix / nice-to-have
- Fix — address each category in a separate commit (observability, tests, code, listing)
- Validate — run
charm_validateand the full test suite to verify everything works
Observability Gap Fill
COS Relations Checklist
Every production charm should have these relations in charmcraft.yaml:
ops-tracing Setup
Add to requirements.txt:
Add to src/charm.py:
The relation name passed to Tracing must match the tracing: entry under requires: in charmcraft.yaml. Do not use the legacy ops_tracing.setup(self) shorthand — it has been removed from ops-tracing.
ops-tracing instruments hooks, Pebble interactions, relations, status changes, and secrets automatically. Only add manual spans for long-running operations, external API calls, and fallback decision logic.
Test Gap Fill
Unit Tests (Scenario)
Use ops.testing (Scenario), not the deprecated Harness.
Key patterns:
Cover:
- Every observed event (install, config-changed, pebble-ready, relation-changed)
- Missing relations → BlockedStatus
- Invalid config → error handling
- Pebble not ready → WaitingStatus
Integration Tests (Jubilant)
Harness Migration
If existing tests use from ops.testing import Harness, load the harness-migration skill for the full per-file workflow, the detector script that enumerates remaining Harness hits, and event-specific recipes. The short form:
Harness(MyCharm)→ops.testing.Context(MyCharm)harness.begin()→ not neededharness.charm.on.install.emit()→ctx.run(ctx.on.install(), state)harness.add_relation()→ops.testing.Relation(endpoint="db", interface="pgsql")
Deprecated API Migration
| Deprecated | Replacement | Notes | |
|---|---|---|---|
StoredState | Instance attributes, Juju secrets | StoredState has subtle persistence bugs | |
Harness | ops.testing (Scenario) | Harness is deprecated since ops 2.x | |
charmcraft fetch-libs | PyPI packages | PyPI versions are versioned and tested | |
framework.breakpoint | Removed | Use standard Python debugging |
Listing Readiness
Required charmcraft.yaml Fields
README Structure
A good README includes:
- Title and badges
- Description (what the charm does)
- Deployment instructions
- Configuration reference
- Integrations (what it relates to)
- Actions reference
- Contributing guide
Other Checks
- LICENSE — Apache-2.0 is standard for charms
- icon.svg — required for Charmhub listing; run
generate_iconto create a placeholder (coloured circle with the charm's initial) if missing - Documentation — run
generate_docsto create adocs/directory with Diátaxis-structured documentation (tutorial, how-to, reference, explanation) using the Canonical starter pack; build locally withcd docs && make html - Clean pack —
charmcraft packshould succeed with no warnings
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/cantrip/skills/charm-improvement/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tonyandrewmeyer/cantrip/charm-improvement)