axel-setup 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +218 -0
- package/CONTRIBUTING.md +58 -0
- package/LICENSE +21 -0
- package/README.md +518 -0
- package/agents/api-design.md +51 -0
- package/agents/bughunter.md +136 -0
- package/agents/changelog.md +89 -0
- package/agents/cleanup.md +126 -0
- package/agents/compare-branch.md +35 -0
- package/agents/cross-repo.md +97 -0
- package/agents/db-check.md +14 -0
- package/agents/debug.md +47 -0
- package/agents/deploy-check.md +100 -0
- package/agents/draft-message.md +19 -0
- package/agents/excelsior-coordinator.md +75 -0
- package/agents/excelsior-verifier.md +94 -0
- package/agents/feature.md +48 -0
- package/agents/harness-optimizer.md +40 -0
- package/agents/incident.md +48 -0
- package/agents/linear-task.md +18 -0
- package/agents/onboard.md +24 -0
- package/agents/perf.md +44 -0
- package/agents/production-validator.md +96 -0
- package/agents/review.md +113 -0
- package/agents/security-check.md +29 -0
- package/agents/sprint-summary.md +15 -0
- package/agents/tdd-mainder.md +178 -0
- package/agents/test-gen.md +39 -0
- package/axel-manifest.json +129 -0
- package/bin/axel-setup.js +597 -0
- package/bootstrap.sh +1087 -0
- package/commands/create-pr.md +13 -0
- package/commands/daily.md +182 -0
- package/commands/deslop.md +13 -0
- package/commands/draft-message.md +23 -0
- package/commands/eod-review.md +154 -0
- package/commands/execute-prp.md +37 -0
- package/commands/generate-prp.md +75 -0
- package/commands/multi-repo-feature.md +60 -0
- package/commands/roadmap.md +31 -0
- package/commands/sprint-status.md +486 -0
- package/commands/style.md +68 -0
- package/commands/visualize.md +17 -0
- package/docs/roadmap/multi-runtime.md +73 -0
- package/docs/superpowers/plans/2026-06-12-setup-hardening-roadmap.md +61 -0
- package/hooks/desktop-notify.sh +26 -0
- package/hooks/enforce-agent-model.jq +14 -0
- package/hooks/gsd-context-monitor.js +156 -0
- package/hooks/linear-lifecycle-sync.sh +112 -0
- package/hooks/memory-dedup.sh +122 -0
- package/hooks/memory-extractor.sh +218 -0
- package/hooks/post-commit-memory-trigger.sh +16 -0
- package/hooks/post-commit-verify.sh +41 -0
- package/hooks/post-edit-lint.sh +43 -0
- package/hooks/precompact-save-context.sh +124 -0
- package/hooks/priority-map-staleness.sh +29 -0
- package/hooks/proactive-resolver.sh +104 -0
- package/hooks/session-auto-title.sh +165 -0
- package/hooks/session-checkpoint.sh +97 -0
- package/hooks/session-cost-log.sh +77 -0
- package/hooks/session-log-action.sh +36 -0
- package/hooks/session-log-prompt.sh +25 -0
- package/hooks/session-restore.sh +45 -0
- package/hooks/session-save.sh +81 -0
- package/hooks/session-summarize.sh +154 -0
- package/hooks/validate-commit-format.sh +38 -0
- package/hooks/weekly-priority-map-review.sh +143 -0
- package/install.sh +46 -0
- package/package.json +67 -0
- package/scripts/ci/bootstrap-dry-run.sh +40 -0
- package/scripts/ci/check.sh +65 -0
- package/scripts/posthog-snapshot-loader.sh +112 -0
- package/skills/context-budget/SKILL.md +86 -0
- package/skills/memory-review/SKILL.md +100 -0
- package/skills/model-routing/SKILL.md +70 -0
- package/skills/posthog-weekly/SKILL.md +271 -0
- package/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/templates/AGENTS.runtime.md +17 -0
- package/templates/CLAUDE.md +252 -0
- package/templates/claude-monitor.plist +35 -0
- package/templates/keybindings.json +13 -0
- package/templates/merge-settings.jq +53 -0
- package/templates/review-upgrades.md +44 -0
- package/templates/settings.json +255 -0
- package/templates/statusline-command.sh +182 -0
- package/tests/fixtures/hooks/events.json +32 -0
- package/tools/session-costs-view.sh +128 -0
- package/tools/session-dashboard-gen.sh +369 -0
- package/tools/session-live.sh +173 -0
- package/tools/session-server.js +441 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-review
|
|
3
|
+
description: "Review, optimize, and maintain the persistent memory system. Reads all memory files, identifies stale/duplicate/outdated entries, asks the user targeted questions, and produces a clean, optimized memory state. Use when memory feels bloated, after major project changes, or periodically to keep context sharp."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Review & Optimization
|
|
7
|
+
|
|
8
|
+
Interactive memory maintenance skill. When invoked, systematically reviews all memory files and works with the user to keep the memory system clean, relevant, and efficient.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
### Phase 1: Audit
|
|
13
|
+
|
|
14
|
+
1. Read `~/.claude/memory/MEMORY.md` (index)
|
|
15
|
+
2. Read every memory file listed in the index
|
|
16
|
+
3. Detect any orphan files (exist on disk but not in index)
|
|
17
|
+
4. For each memory file, evaluate:
|
|
18
|
+
- **Staleness**: Does the content reference things that may have changed? (team members, tools, architectures)
|
|
19
|
+
- **Redundancy**: Is this duplicated or overlapping with another memory file?
|
|
20
|
+
- **Relevance**: Is this still useful for future conversations?
|
|
21
|
+
- **Accuracy**: Does this match current reality? (verify against code/git if needed)
|
|
22
|
+
- **Size**: Is this too verbose? Can it be trimmed without losing value?
|
|
23
|
+
|
|
24
|
+
### Phase 2: Report
|
|
25
|
+
|
|
26
|
+
Present a structured report to the user:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
## Memory Audit Report
|
|
30
|
+
|
|
31
|
+
### Summary
|
|
32
|
+
- Total files: X
|
|
33
|
+
- Index entries: X
|
|
34
|
+
- Orphan files: X (not in index)
|
|
35
|
+
- Potentially stale: X
|
|
36
|
+
- Candidates for merge: X
|
|
37
|
+
- Candidates for removal: X
|
|
38
|
+
|
|
39
|
+
### Per-File Analysis
|
|
40
|
+
For each file, show:
|
|
41
|
+
- Status: OK / STALE / MERGE_CANDIDATE / REMOVE_CANDIDATE
|
|
42
|
+
- Last modified: date
|
|
43
|
+
- Reason: why this status
|
|
44
|
+
- Suggested action: keep / update / merge with X / remove
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Phase 3: Interactive Q&A
|
|
48
|
+
|
|
49
|
+
Ask the user targeted questions to resolve ambiguities:
|
|
50
|
+
- "Is X still accurate?"
|
|
51
|
+
- "Should I merge A and B since they overlap?"
|
|
52
|
+
- "This mentions Y which seems outdated — remove or update?"
|
|
53
|
+
- "Any new context I should add?"
|
|
54
|
+
|
|
55
|
+
Keep questions grouped and numbered for easy answering. Max 5-7 questions per round.
|
|
56
|
+
|
|
57
|
+
### Phase 4: Execute
|
|
58
|
+
|
|
59
|
+
Based on user answers:
|
|
60
|
+
1. Update stale files with correct information
|
|
61
|
+
2. Merge redundant files
|
|
62
|
+
3. Remove files the user confirms as unnecessary
|
|
63
|
+
4. Add any new memory files the user requests
|
|
64
|
+
5. Rebuild `MEMORY.md` index with accurate one-line descriptions
|
|
65
|
+
6. Sync both memory locations:
|
|
66
|
+
- `~/.claude/memory/` (shared, primary)
|
|
67
|
+
- `~/.claude/projects/` (legacy fallback, path varies by user)
|
|
68
|
+
|
|
69
|
+
### Phase 5: Summary
|
|
70
|
+
|
|
71
|
+
Show final state:
|
|
72
|
+
- Files kept / updated / merged / removed
|
|
73
|
+
- Total memory size before vs after
|
|
74
|
+
- Next review suggestion (based on change velocity)
|
|
75
|
+
|
|
76
|
+
## Rules
|
|
77
|
+
|
|
78
|
+
- NEVER delete a memory file without explicit user confirmation
|
|
79
|
+
- NEVER remove information that is still relevant — when in doubt, ask
|
|
80
|
+
- Prefer updating over removing — information decay is better handled by correction than deletion
|
|
81
|
+
- Keep MEMORY.md index lines under 120 chars
|
|
82
|
+
- Memory files should use the standard frontmatter format (name, description, type)
|
|
83
|
+
- After cleanup, verify all index links point to existing files
|
|
84
|
+
|
|
85
|
+
## Memory Types Reference
|
|
86
|
+
|
|
87
|
+
| Type | Purpose | Decay Rate |
|
|
88
|
+
|------|---------|------------|
|
|
89
|
+
| `user` | Identity, preferences, skills | Low — rarely changes |
|
|
90
|
+
| `feedback` | How to work with user | Low — corrections persist |
|
|
91
|
+
| `project` | Ongoing work, team, goals | High — changes frequently |
|
|
92
|
+
| `reference` | Where to find external info | Medium — tools change |
|
|
93
|
+
|
|
94
|
+
## When to Suggest Running This
|
|
95
|
+
|
|
96
|
+
Suggest `/memory-review` to the user when:
|
|
97
|
+
- More than 30 days since last review
|
|
98
|
+
- After major team/project changes
|
|
99
|
+
- When memory files exceed 20 entries
|
|
100
|
+
- When you notice conflicting information in memory
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: model-routing
|
|
3
|
+
description: Routes each subagent to the right model tier (fable, opus, sonnet, haiku) when orchestrating multi-agent work via the Agent tool or Workflow. Use whenever spawning 2+ agents or activating Coordinator Mode. Keeps judgment on Fable (main thread), delegates token-heavy work to cheaper tiers, and enforces handoff packets plus vetting of subagent reports.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Model Routing for Multi-Agent Orchestration
|
|
7
|
+
|
|
8
|
+
The main thread (Fable) is the orchestrator, architect, synthesizer, and final judge. Cheaper subagents do bounded, token-heavy work. Never delegate judgment.
|
|
9
|
+
|
|
10
|
+
## Reserved for Fable (main thread, never spawn for this)
|
|
11
|
+
|
|
12
|
+
- Decomposing ambiguous work into clean parallel slices.
|
|
13
|
+
- Architecture, product, security, and payment-flow tradeoffs.
|
|
14
|
+
- Reading conflicting subagent reports and deciding what matters.
|
|
15
|
+
- Integrating partial implementations into one coherent plan.
|
|
16
|
+
- Final review, risk assessment, and user-facing synthesis.
|
|
17
|
+
|
|
18
|
+
## Routing Table
|
|
19
|
+
|
|
20
|
+
Set the `model` param explicitly on every Agent call. Default to `sonnet` when a task does not match a row.
|
|
21
|
+
|
|
22
|
+
| Task type | model | Why |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| Broad codebase exploration, file/pattern discovery (Explore agents) | sonnet | High read volume, moderate judgment |
|
|
25
|
+
| Mechanical reduction: log filtering, test output triage, inventories, classification, link checking | haiku | Zero judgment, maximum volume |
|
|
26
|
+
| External docs research, dependency or vendor comparison | sonnet | Needs criteria but not deep tradeoffs |
|
|
27
|
+
| Bounded implementation from a precise, file-scoped spec (1 logical unit) | sonnet | Spec quality carries the work |
|
|
28
|
+
| Complex implementation, risky refactor, DB migrations, security or payment code | opus | Error cost exceeds the price delta |
|
|
29
|
+
| Code review, adversarial verification (excelsior-verifier, refute passes, skeptic agents) | opus | Must independently catch errors from other agents |
|
|
30
|
+
| Sub-coordinators that themselves spawn agents (cross-repo, debug session managers) | opus | Orchestration judgment without Fable price |
|
|
31
|
+
| Synthesis of conflicting findings, final verdicts, anything ambiguous | fable (stay in main thread) | This is the judgment layer |
|
|
32
|
+
|
|
33
|
+
Cost anchors per 1M tokens (input/output): haiku $1/$5, sonnet $3/$15, opus $5/$25, fable $10/$50. Fable's tokenizer also emits roughly 30% more tokens for the same content, so its effective cost is about 2.6x opus. Every token kept out of the main thread is saved at the most expensive rate in the catalog.
|
|
34
|
+
|
|
35
|
+
## Handoff Packets (required for every delegated prompt)
|
|
36
|
+
|
|
37
|
+
Write the prompt as if the subagent has zero chat context. Include:
|
|
38
|
+
|
|
39
|
+
1. Repo path and the exact objective.
|
|
40
|
+
2. Scope: files, packages, or surfaces in scope, and what is explicitly out of scope.
|
|
41
|
+
3. Evidence format to return: file paths with line refs, commands run, diffs, failures, uncertainties, stop conditions hit.
|
|
42
|
+
4. Verification: commands or flows to run, and what success looks like when knowable.
|
|
43
|
+
5. Stop conditions: if live code contradicts the prompt, a command fails twice after a reasonable retry, or the task needs out-of-scope files, stop and report instead of improvising.
|
|
44
|
+
|
|
45
|
+
Prefer parallel subagents (one message, one tool block per agent) when slices are independent. Keep blocking or tightly coupled work local.
|
|
46
|
+
|
|
47
|
+
## Vetting Delegated Work
|
|
48
|
+
|
|
49
|
+
Treat subagent reports as leads, not facts:
|
|
50
|
+
|
|
51
|
+
- Before acting on a high-impact finding, reopen the cited files and confirm the line refs or failures yourself.
|
|
52
|
+
- Before opening a PR or reporting work as done, review the final diff against the task in the main thread.
|
|
53
|
+
- Before accepting dismissals (FP, OUTDATED, MOOT), run an adversarial refute pass: skeptic agents with the inverted instruction (prove the bug is still alive on staging/main today).
|
|
54
|
+
- PR reviewers must read repo state via `git show origin/branch:path`, never the working tree, which may sit on another branch.
|
|
55
|
+
|
|
56
|
+
## Anti-waste Rules
|
|
57
|
+
|
|
58
|
+
- Do not spawn an agent for a single targeted read or an already-known file path: read it directly.
|
|
59
|
+
- Group by file or surface: one finding repeated across 15 lines of one file is 1 agent, not 15.
|
|
60
|
+
- Run long agents with `run_in_background: true` and keep orchestrating; never poll.
|
|
61
|
+
- Verification agents (excelsior-verifier) run in background on opus; do not block reporting structure on them, but do not claim "verified" before they return.
|
|
62
|
+
|
|
63
|
+
## Integration with Coordinator Mode (CLAUDE.md)
|
|
64
|
+
|
|
65
|
+
When Coordinator Mode triggers (3+ files), apply this mapping to its mandatory minimums:
|
|
66
|
+
|
|
67
|
+
- Research: the 2+ parallel Explore agents run on `sonnet` (or `haiku` if purely mechanical inventory).
|
|
68
|
+
- Implement: workers default to `sonnet`; escalate a worker to `opus` when its unit touches migrations, auth, payments, multi-tenant scoping, or cross-repo contracts.
|
|
69
|
+
- Verify: `excelsior-verifier` runs on `opus`, in background.
|
|
70
|
+
- Synthesize and final judgment: never delegated, stays in the main thread.
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: posthog-weekly
|
|
3
|
+
description: Weekly PostHog analytical review. Pulls raw data from your PostHog project, identifies anomalies, regressions, and improvement opportunities, suggests new instrumentation and cohorts, then writes a condensed snapshot that other commands (sprint-status, eod-review, daily) can read for the next 14 days.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PostHog Weekly Review
|
|
7
|
+
|
|
8
|
+
You are a senior product analytics consultant analyzing a PostHog workspace for **{{POSTHOG_PROJECT_CONTEXT}}**.
|
|
9
|
+
|
|
10
|
+
Your job is **NOT** to dump numbers. Your job is to **interpret** the data: find what is broken, what is regressing, what looks weird, what could be improved, and what is missing from the instrumentation. Every finding must be paired with a concrete recommended action.
|
|
11
|
+
|
|
12
|
+
Respond in **{{ASSISTANT_LANGUAGE}}**.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
- Once a week (typical cadence). The skill caches its output for 14 days, so other commands can read the analysis without re-querying PostHog.
|
|
17
|
+
- Whenever the user says "review my PostHog", "check the metrics", "what's going on in PostHog", "weekly product review".
|
|
18
|
+
- After a release, to look for regressions or new error spikes.
|
|
19
|
+
- Before a stakeholder review meeting.
|
|
20
|
+
|
|
21
|
+
## Pre-requisites
|
|
22
|
+
|
|
23
|
+
The PostHog MCP must be authenticated. Verify with `claude mcp list | grep posthog`. Expected output: `posthog: https://mcp.posthog.com/mcp (HTTP) - ✓ Connected`. If you only see `Needs authentication`, ask the user to authenticate via `/mcp` and stop — do not proceed without real data, and never invent metrics.
|
|
24
|
+
|
|
25
|
+
## Step 1 — Gather raw data (parallel calls)
|
|
26
|
+
|
|
27
|
+
Run all of these in **a single parallel batch** to minimize round-trips:
|
|
28
|
+
|
|
29
|
+
1. `mcp__posthog__organizations-get` — confirm the active org
|
|
30
|
+
2. `mcp__posthog__projects-get` — confirm the active project
|
|
31
|
+
3. `mcp__posthog__dashboards-get-all` (limit 50) — focus on `pinned: true`
|
|
32
|
+
4. `mcp__posthog__insights-list` (limit 100) — surface what's already saved
|
|
33
|
+
5. `mcp__posthog__event-definitions-list` (limit 200) — sorted by `last_seen_at` descending. This is **critical** — the `last_seen_at` field is how you detect events that stopped firing.
|
|
34
|
+
6. `mcp__posthog__feature-flag-get-all` (active=true) — what's currently rolled out
|
|
35
|
+
7. `mcp__posthog__experiment-get-all` — running experiments
|
|
36
|
+
8. `mcp__posthog__cohorts-list` — defined segments
|
|
37
|
+
9. `mcp__posthog__error-tracking-issues-list` (limit 50) — active errors
|
|
38
|
+
|
|
39
|
+
**Do not skip events with old `last_seen_at`.** Those are the most analytically interesting — they tell you which features are dead.
|
|
40
|
+
|
|
41
|
+
## Step 2 — Quantitative pass: pull comparison data
|
|
42
|
+
|
|
43
|
+
For the **5–10 most important product events** (identify them from event-definitions-list — events that look like core user actions, not framework noise like `$pageview` or `$autocapture`), run a trends query for the last 14 days, weekly interval, comparing current week to previous week:
|
|
44
|
+
|
|
45
|
+
Use `mcp__posthog__query-run` with a `TrendsQuery` shaped like:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"query": {
|
|
50
|
+
"kind": "InsightVizNode",
|
|
51
|
+
"source": {
|
|
52
|
+
"kind": "TrendsQuery",
|
|
53
|
+
"dateRange": { "date_from": "-14d" },
|
|
54
|
+
"interval": "week",
|
|
55
|
+
"compareFilter": { "compare": true },
|
|
56
|
+
"series": [
|
|
57
|
+
{ "kind": "EventsNode", "event": "<event_name>", "math": "total", "custom_name": "<event_name>" }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Batch 5–10 of these in parallel. From the results, compute the week-over-week delta for each event. **Flag anything with > 30% drop or > 50% spike** — those are the candidates for the regression / anomaly section.
|
|
65
|
+
|
|
66
|
+
## Step 3 — Apply the analytical lens
|
|
67
|
+
|
|
68
|
+
Walk through the data and look specifically for these patterns. For each one, formulate a concrete finding paired with a recommended action.
|
|
69
|
+
|
|
70
|
+
### A) Dead or dying events
|
|
71
|
+
|
|
72
|
+
For each event in `event-definitions-list`:
|
|
73
|
+
|
|
74
|
+
- If `last_seen_at` is **> 7 days ago** for an event that looks like a core user action (not a framework event), this is a **red flag**. Either the feature was removed, the tracking broke, or no user touches it. Distinguish between these three with cross-referencing:
|
|
75
|
+
- Is the feature mentioned in any pinned dashboard insight? → Check insights-list.
|
|
76
|
+
- Is there a related `*_failed` or `*_error` event still firing? → That points to a bug.
|
|
77
|
+
- Is the absence consistent across the entire project? → Likely deprecated.
|
|
78
|
+
- Group dead events by feature area in your output. Don't list 30 dead events one by one — say "the entire `feature_x_*` family hasn't fired in 18 days, last seen 2026-XX-XX, suggests feature deprecation or tracking break".
|
|
79
|
+
|
|
80
|
+
### B) Regressions in active events
|
|
81
|
+
|
|
82
|
+
From the Step 2 trends queries:
|
|
83
|
+
|
|
84
|
+
- Events with **> 30% week-over-week drop** are regression candidates. Cross-reference:
|
|
85
|
+
- Is there a release annotation on the same date? → likely a release bug.
|
|
86
|
+
- Is the drop concentrated in one breakdown (browser, device, plan)? → environment-specific.
|
|
87
|
+
- Is it correlated with a spike in errors? → broken instrumentation or broken feature.
|
|
88
|
+
- Events with **> 50% spike** are also worth flagging. Could be: a new feature launched, a bot, a marketing campaign, or an instrumentation duplication bug. Investigate before celebrating.
|
|
89
|
+
|
|
90
|
+
### C) Funnel friction
|
|
91
|
+
|
|
92
|
+
For each pinned dashboard, identify funnels (look for insights with `FunnelsQuery` shape) and find:
|
|
93
|
+
|
|
94
|
+
- The step with the **largest absolute drop-off**.
|
|
95
|
+
- Cross-reference that step with `$rageclick`, `$dead_click`, `$exception`, and `$autocapture` events on the same page or component, if breakdown by URL is available.
|
|
96
|
+
- The hypothesis: "users drop here because X" — and a recommended action: "investigate the <component> on <page>, check for blocking errors or confusing UX".
|
|
97
|
+
|
|
98
|
+
### D) Error tracking debt
|
|
99
|
+
|
|
100
|
+
From `error-tracking-issues-list`:
|
|
101
|
+
|
|
102
|
+
- Count active issues. Anything > 20 is a backlog signal.
|
|
103
|
+
- Count issues **without an `assignee`** — that's the triage debt.
|
|
104
|
+
- Identify issues with `first_seen` in the last 7 days — those are **new this week** and most likely related to a recent release.
|
|
105
|
+
- Surface the top 5 by recency or frequency with a one-line action: "assign and triage MAI-XXXX before next deploy".
|
|
106
|
+
|
|
107
|
+
### E) Feature adoption gaps
|
|
108
|
+
|
|
109
|
+
For the core product features (identified from event family names like `feature_x_created`, `feature_x_completed`):
|
|
110
|
+
|
|
111
|
+
- Compute the **completion rate**: `feature_x_completed / feature_x_started`. If < 50%, that's a friction point worth flagging.
|
|
112
|
+
- Compute the **user concentration**: how many distinct users fired the event in the last 14 days. If a feature is used by 3 power users and nobody else, it's at risk of being abandoned.
|
|
113
|
+
- Compare adoption across the 3-5 main features and highlight the one with the lowest adoption — that's the candidate for either a UX redesign or deprecation.
|
|
114
|
+
|
|
115
|
+
### F) Quality of instrumentation
|
|
116
|
+
|
|
117
|
+
This is **the most important section for evolving the product analytics**. Look for gaps:
|
|
118
|
+
|
|
119
|
+
- **Auth events**: is there a `signup_completed`, `login_succeeded`, `logout`, `email_verified`? If not, the user cannot measure D1/D7/D30 retention or activation rate. **Recommend instrumenting at the SDK level** (frontend and backend).
|
|
120
|
+
- **Onboarding milestones**: is there a `first_<core_action>` event for first-time users? Without this you can't measure activation.
|
|
121
|
+
- **Billing events**: if the product is SaaS — `subscription_started`, `trial_expired`, `payment_failed`, `upgrade`, `downgrade`, `churn`. Without these the team is blind to revenue funnels.
|
|
122
|
+
- **Backend events**: do you only see frontend `$exception`? If yes, recommend the user push backend errors via the PostHog SDK (Python/Ruby/Node) with the same `distinct_id` as the frontend session. Without it, AI agent timeouts, scraper failures, and 5xx errors are invisible to analytics.
|
|
123
|
+
- **Performance regressions**: if the project has Web Vitals events (`LCP`, `INP`, `CLS`), check if any percentile is degrading week-over-week. These are leading indicators of UX problems.
|
|
124
|
+
|
|
125
|
+
For each gap, **propose the exact event name** and the **expected payload shape** (what properties should it carry). Make it actionable — the user should be able to copy the suggestion into a Jira/Linear ticket.
|
|
126
|
+
|
|
127
|
+
### G) Cohorts that should exist
|
|
128
|
+
|
|
129
|
+
If `cohorts-list` returned 0 or very few cohorts, this is an **opportunity**, not a bug. Suggest 4-6 cohorts that match the product:
|
|
130
|
+
|
|
131
|
+
- **Power users** — fired the core action ≥ N times in last 7 days
|
|
132
|
+
- **Churned users** — no events in last 21 days
|
|
133
|
+
- **Onboarding stuck** — signed up > 7 days ago but never completed the first core action
|
|
134
|
+
- **Trial converts** — once billing is instrumented
|
|
135
|
+
- **Heavy users of feature X** — to compare retention by feature usage
|
|
136
|
+
- **One per main product surface** — to enable per-feature retention curves
|
|
137
|
+
|
|
138
|
+
For each suggested cohort, provide the **exact behavioral filter** so the user (or you, in a follow-up) can create it via `mcp__posthog__cohorts-create`.
|
|
139
|
+
|
|
140
|
+
### H) Feature flags & experiments
|
|
141
|
+
|
|
142
|
+
If both are 0, the team is **leaving capability unused**. Mention it briefly — not as a finding, but as a "you're paying for this, here's how to get value":
|
|
143
|
+
|
|
144
|
+
- "0 feature flags active — consider gating new features behind a flag for safer rollouts and gradual exposure"
|
|
145
|
+
- "0 experiments — consider running an A/B on the lowest-converting funnel step you identified above"
|
|
146
|
+
|
|
147
|
+
Don't lecture. Just plant the seed.
|
|
148
|
+
|
|
149
|
+
## Step 4 — Generate the report
|
|
150
|
+
|
|
151
|
+
The output is a **markdown report**, written in `{{ASSISTANT_LANGUAGE}}`, with this exact structure:
|
|
152
|
+
|
|
153
|
+
```markdown
|
|
154
|
+
# 📊 PostHog Weekly Review — <YYYY-MM-DD>
|
|
155
|
+
|
|
156
|
+
**Project:** <project_name> (<project_url>)
|
|
157
|
+
**Window analyzed:** Last 14 days (current week vs previous)
|
|
158
|
+
**Generated by:** /posthog-weekly
|
|
159
|
+
|
|
160
|
+
## 🚨 Critical findings — act this week
|
|
161
|
+
|
|
162
|
+
[3-7 bullets. Each bullet is one finding + one recommended action. Format:
|
|
163
|
+
**[severity]** Finding sentence. → Action sentence.
|
|
164
|
+
|
|
165
|
+
severity = CRITICAL / HIGH / MEDIUM]
|
|
166
|
+
|
|
167
|
+
## 📉 Regressions & anomalies
|
|
168
|
+
|
|
169
|
+
[Events that dropped >30%, errors growing, funnel breaks, dead events.
|
|
170
|
+
Group by area. Don't dump a list of 30 dead events — synthesize.]
|
|
171
|
+
|
|
172
|
+
## ✅ Wins & positive trends
|
|
173
|
+
|
|
174
|
+
[Things working well. Growing usage, fixed errors, improved funnels, low
|
|
175
|
+
error rates. Keep this short — one or two genuine wins is better than five
|
|
176
|
+
weak ones. If there's nothing genuine to celebrate, write one line saying so.]
|
|
177
|
+
|
|
178
|
+
## 🎯 Improvement opportunities
|
|
179
|
+
|
|
180
|
+
[Funnel friction points + UX hypotheses + concrete next steps.
|
|
181
|
+
Each item: where the friction is, what the data says, what to try next.]
|
|
182
|
+
|
|
183
|
+
## 🔍 Instrumentation gaps & suggested new metrics
|
|
184
|
+
|
|
185
|
+
[What's missing that would be valuable to track. Be specific:
|
|
186
|
+
- Suggested event name (e.g. `signup_completed`)
|
|
187
|
+
- Expected payload (what properties to capture)
|
|
188
|
+
- Why it matters (what question it would answer)
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
## 💡 Suggested cohorts to create
|
|
192
|
+
|
|
193
|
+
[4-6 cohorts with their behavioral filter spec. Write them in a way that's
|
|
194
|
+
ready to be created via mcp__posthog__cohorts-create in a follow-up turn.]
|
|
195
|
+
|
|
196
|
+
## 📋 Raw context (for verification)
|
|
197
|
+
|
|
198
|
+
- Pinned dashboards: <list with URLs>
|
|
199
|
+
- Active error issues: N (X without assignee)
|
|
200
|
+
- Cohorts defined: N
|
|
201
|
+
- Feature flags active: N
|
|
202
|
+
- Experiments running: N
|
|
203
|
+
- Total events tracked: N
|
|
204
|
+
- Top 3 dead event families: <list>
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
_For automated context in other commands, this report's findings are also
|
|
209
|
+
cached at `~/.claude/cache/posthog-snapshot.json` and remain valid for 14 days._
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Step 5 — Persist the snapshot
|
|
213
|
+
|
|
214
|
+
After the report is rendered to the user, **write a condensed JSON snapshot** to `~/.claude/cache/posthog-snapshot.json` with the following shape. This is what `posthog-snapshot-loader.sh` reads for inclusion in `/sprint-status`, `/daily`, and `/eod-review`.
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"timestamp": "<ISO 8601 UTC, e.g. 2026-04-14T22:30:00Z>",
|
|
219
|
+
"project_name": "<project name>",
|
|
220
|
+
"project_url": "<https://eu.posthog.com/project/N>",
|
|
221
|
+
"critical_findings": [
|
|
222
|
+
"<one-line summary, max 120 chars>",
|
|
223
|
+
"..."
|
|
224
|
+
],
|
|
225
|
+
"regressions": [
|
|
226
|
+
"<one-line summary, max 120 chars>",
|
|
227
|
+
"..."
|
|
228
|
+
],
|
|
229
|
+
"wins": [
|
|
230
|
+
"<one-line summary, max 120 chars>"
|
|
231
|
+
],
|
|
232
|
+
"improvements": [
|
|
233
|
+
"<one-line summary, max 120 chars>",
|
|
234
|
+
"..."
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Limits:** at most 5 entries per array. The goal is for the snapshot to be readable in a sprint-status report without dominating it. Each entry is **one line**, no markdown formatting beyond plain text.
|
|
240
|
+
|
|
241
|
+
Use the `Write` tool to create the file. If `~/.claude/cache/` doesn't exist, create it first with `mkdir -p`.
|
|
242
|
+
|
|
243
|
+
After writing, confirm to the user: "Snapshot persisted at `~/.claude/cache/posthog-snapshot.json`. Other commands (sprint-status, daily, eod-review) will read this for the next 14 days."
|
|
244
|
+
|
|
245
|
+
## Step 6 — Optionally apply low-risk fixes
|
|
246
|
+
|
|
247
|
+
If during the analysis you found things that are **clearly low-risk to fix on the spot** and the user has approved general "implement improvements" (this is the case when invoked with no flags or with `--apply-fixes`), you may take the following actions **without further confirmation**:
|
|
248
|
+
|
|
249
|
+
- **Tag deprecated insights**: if you identified a feature as deprecated and there are insights still tracking it, add the `deprecated` tag and prepend `[DEPRECATED]` to their description (use `mcp__posthog__insight-update`).
|
|
250
|
+
- **Create a project-scoped annotation** marking the deprecation date (use `mcp__posthog__annotation-create`), so future analyses anchor against it.
|
|
251
|
+
- **Create suggested cohorts**: if you confidently identified the right behavioral filter, create them via `mcp__posthog__cohorts-create`. Limit yourself to the 5 most useful — don't flood the workspace.
|
|
252
|
+
|
|
253
|
+
For everything else (creating new insights, modifying dashboards, creating feature flags, deleting things, modifying production data) — **always ask first**. The user is the only one who can decide whether the change matches the team's conventions.
|
|
254
|
+
|
|
255
|
+
## Style guide
|
|
256
|
+
|
|
257
|
+
- **Analytical, not metric-dump.** "DAU = 142" is wrong. "DAU dropped 12% week-over-week, coinciding with the deploy on March 27 — investigate the deploy of feature X" is right.
|
|
258
|
+
- **Concrete recommendations.** Every finding ends with a `→ Action:`.
|
|
259
|
+
- **Acknowledge uncertainty.** If you can't tell whether a drop is a bug or intentional, say so explicitly: "this could be either a tracking break or a true usage drop — verify by checking PR merges this week".
|
|
260
|
+
- **No false positives.** If the data is too thin to support a conclusion (e.g. < 7 days of data, very low volume), say "insufficient data to conclude" rather than inventing a story.
|
|
261
|
+
- **Numbers belong in the body, never in the headline.** The headline is the action; the number is the evidence.
|
|
262
|
+
- **Respect the cache.** If a previous snapshot exists at `~/.claude/cache/posthog-snapshot.json` and is < 1 day old, ask the user "the previous snapshot is from <X> hours ago — refresh anyway?" before re-running the full analysis. Saves time and PostHog API calls.
|
|
263
|
+
|
|
264
|
+
## What this skill does NOT do
|
|
265
|
+
|
|
266
|
+
- It does not modify dashboards (only the user does that).
|
|
267
|
+
- It does not delete insights or events.
|
|
268
|
+
- It does not create feature flags or experiments — those affect production.
|
|
269
|
+
- It does not write to Linear, Slack, or any other system.
|
|
270
|
+
- It does not send notifications — the report is for the user only.
|
|
271
|
+
- It does not invent data when the MCP returns errors. If data is missing, the report says so explicitly in a "⚠️ Data gaps" section at the top.
|