Commit 1fcbcbe
YET-1269: /manage-mac skill — CLI-first MaC YAML authoring (#88)
## Summary
Adds the `/manage-mac` skill for Monitors-as-Code YAML authoring —
create, edit, validate, and import MaC YAML files from any
MCP-compatible editor (Claude Code, Cursor, etc.).
**CLI-first, 3-tier approach:**
| Tier | Tool | Used for |
|---|---|---|
| 1 — CLI | `montecarlo` binary | Validate (`compile`), apply, import
(`convert-to-mac`, `export`) |
| 2 — MCP | Monte Carlo MCP server | Author YAML shapes via
`dry_run=True`, resolve table metadata |
| 3 — Manual | No external tools | Validate field names/enums/types as
last resort |
The skill checks CLI availability at startup and prompts the user to
install/configure if missing, then gracefully falls back through tiers.
**Four workflows:**
- **Create** — gather context, resolve table metadata via MCP, author
YAML blocks via `dry_run=True`, compile + apply
- **Edit** — add/modify/remove monitors; name-based identity (no UUID);
deprecated field migration with confirmation
- **Validate** — `montecarlo monitors compile` first; manual schema
validation as fallback
- **Import** — `montecarlo monitors export` / `convert-to-mac` first;
`get_monitors` MCP as fallback
**Deprecated type handling:** skill actively declines `field_health`,
`dimension_tracking`, `field_quality`, `comparison`, `freshness`,
`volume` and suggests the correct modern alternative.
**Schema validation gates in `monitoring-advisor` and `tune-monitor`:**
- Both skills now validate generated YAML against the published schema
(`clidocs.getmontecarlo.com/mac/schema.json`) before presenting it to
the user
- `tune-monitor` also detects MaC-managed monitors and offers to hand
off to `/manage-mac` to keep the YAML file as the source of truth
**Follow-up:** YET-1310 — publish a clean schema without deprecated
fields.
## Test plan
- [ ] CLI available: create a metric monitor end-to-end — compile
passes, apply command shown
- [ ] CLI unavailable: validate falls back to manual tier, schema
fetched via curl
- [ ] Request deprecated type (`freshness`) — skill declines and
suggests `metric`
- [ ] Edit existing file — name preserved, no UUID lookup, diff shown
- [ ] Import with `convert-to-mac` CLI path
- [ ] Co-located dbt `schema.yml` — extra top-level keys not flagged
- [ ] tune-monitor: generates YAML → schema validation runs before
presenting to user
- [ ] tune-monitor: MaC-managed monitor detected → offers to hand off to
`/manage-mac`
🤖 Generated with [Claude Code](https://claude.ai/claude-code)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent dfdcdc1 commit 1fcbcbe
20 files changed
Lines changed: 474 additions & 5 deletions
File tree
- plugins
- claude-code
- .claude-plugin
- skills
- codex
- .codex-plugin
- skills
- copilot
- skills
- cursor
- .cursor-plugin
- skills
- opencode
- skills
- skills
- manage-mac
- monitoring-advisor/references
- tune-monitor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments