Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:14:34 +08:00
commit c969105f3f
6 changed files with 445 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
---
description: Analyze user behavior patterns and cohorts using PostHog
category: analytics
tools: Task, TodoWrite
model: inherit
version: 1.0.0
---
# Analyze User Behavior
Query PostHog to understand user behavior patterns, cohorts, and product usage.
## Prerequisites
- PostHog MCP must be enabled (this plugin should be enabled)
- `POSTHOG_AUTH_HEADER` environment variable configured
- Access to PostHog project
## Usage
```bash
/analyze-user-behavior <query>
Examples:
/analyze-user-behavior "checkout abandonment last 30 days"
/analyze-user-behavior "feature adoption for new dashboard"
/analyze-user-behavior "user retention cohorts by signup month"
```
## What This Command Does
Uses PostHog MCP tools to:
1. Query user events and properties
2. Analyze cohorts and segments
3. Calculate conversion metrics
4. Identify behavior patterns
5. Generate insights with charts/data
## Available PostHog Capabilities
When this plugin is enabled, you have access to ~43 PostHog tools:
**User Analysis**:
- Query user properties and events
- Segment users by behavior
- Track user journeys
- Analyze cohort retention
**Product Metrics**:
- Feature usage tracking
- Conversion funnel analysis
- A/B test results
- Session replay analysis
**Trends & Insights**:
- Event trends over time
- User engagement metrics
- Feature adoption rates
- Custom dashboard queries
## Example Queries
### Conversion Analysis
```bash
/analyze-user-behavior "Show conversion rate from signup to first purchase, broken down by traffic source"
```
### Feature Adoption
```bash
/analyze-user-behavior "How many users adopted the new search feature in the last week?"
```
### Retention Cohorts
```bash
/analyze-user-behavior "Show weekly retention for users who signed up in December 2024"
```
### User Journey
```bash
/analyze-user-behavior "What's the typical path users take before upgrading to paid plan?"
```
## Output Format
The command will:
1. Translate your natural language query to PostHog API calls
2. Fetch relevant data
3. Present findings with:
- Key metrics and numbers
- Trends and patterns
- Visualizations (when possible)
- Actionable insights
## Tips
- Be specific about time ranges ("last 30 days", "this quarter")
- Mention specific events or features by name
- Ask for comparisons ("vs last month", "broken down by...")
- Request segmentation ("by country", "by plan type")
## Context Cost
**This plugin adds ~40,645 tokens** to your context window. Disable when not analyzing metrics:
```bash
/plugin disable catalyst-analytics
```
---
**See also**: `/product-metrics`, `/segment-analysis`

118
commands/product_metrics.md Normal file
View File

@@ -0,0 +1,118 @@
---
description: View key product metrics, KPIs, and conversion rates from PostHog
category: analytics
tools: Task, TodoWrite
model: inherit
version: 1.0.0
---
# Product Metrics Dashboard
Query PostHog for key product metrics, KPIs, and performance indicators.
## Usage
```bash
/product-metrics [metric-type] [time-range]
Examples:
/product-metrics "overall KPIs last 30 days"
/product-metrics "conversion rates this quarter"
/product-metrics "feature usage breakdown this week"
```
## Available Metrics
### Conversion Metrics
- Signup conversion rate
- Trial to paid conversion
- Checkout completion rate
- Feature activation rate
### Engagement Metrics
- Daily/Weekly/Monthly Active Users (DAU/WAU/MAU)
- Session duration
- Feature usage frequency
- User retention rates
### Business Metrics
- Revenue per user
- Customer acquisition cost
- Lifetime value
- Churn rate
### Feature Metrics
- Feature adoption rate
- Time to first use
- Feature retention
- Power user identification
## Example Queries
### Overall Dashboard
```bash
/product-metrics "Show me our key metrics for last month: MAU, conversion rates, and top features"
```
### Conversion Funnel
```bash
/product-metrics "Breakdown of our signup to paid funnel with drop-off rates at each step"
```
### Feature Performance
```bash
/product-metrics "Compare usage of our top 5 features over the last quarter"
```
### Cohort Performance
```bash
/product-metrics "How do our December signups compare to November in terms of activation and retention?"
```
## Output Format
Results typically include:
- **Metric values** with trend indicators (↑↓)
- **Comparisons** to previous periods
- **Breakdowns** by segment when relevant
- **Top performers** and bottom performers
- **Recommendations** based on data
## Time Range Options
- `today`, `yesterday`
- `last 7 days`, `last 30 days`, `last 90 days`
- `this week`, `last week`
- `this month`, `last month`, `this quarter`
- Custom: `2024-01-01 to 2024-03-31`
## Segmentation
Add segmentation to any query:
```bash
/product-metrics "MAU by country"
/product-metrics "conversion rates by traffic source"
/product-metrics "feature usage by plan type"
```
## Context Management
This plugin consumes ~40k tokens. Disable after viewing metrics:
```bash
/plugin disable catalyst-analytics
```
---
**See also**: `/analyze-user-behavior`, `/segment-analysis`

View File

@@ -0,0 +1,138 @@
---
description: Analyze user segments and cohorts for targeted insights
category: analytics
tools: Task, TodoWrite
model: inherit
version: 1.0.0
---
# Segment Analysis
Deep-dive into specific user segments, cohorts, or customer groups using PostHog data.
## Usage
```bash
/segment-analysis <segment-description>
Examples:
/segment-analysis "users from paid plans vs free plans"
/segment-analysis "power users who use feature X daily"
/segment-analysis "users who churned in last 30 days"
/segment-analysis "cohort: signed up in Q4 2024"
```
## What This Analyzes
### User Segments
- By plan type (free, pro, enterprise)
- By geography (country, region)
- By acquisition source (organic, paid, referral)
- By behavior (power users, casual users, at-risk)
### Cohort Analysis
- By signup date (monthly, weekly cohorts)
- By first feature used
- By activation milestone reached
- By engagement level
### Comparison Analysis
- Segment A vs Segment B
- Before/after feature launch
- Treatment vs control (A/B tests)
- Time period comparisons
## Example Analyses
### Plan Comparison
```bash
/segment-analysis "Compare engagement patterns between free and paid users: session frequency, feature usage, retention"
```
### Power User Identification
```bash
/segment-analysis "Identify our power users: who are they, what features do they use, what's their profile?"
```
### Churn Analysis
```bash
/segment-analysis "Analyze users who churned: what were their last actions, which features didn't they use?"
```
### Geographic Performance
```bash
/segment-analysis "Compare conversion rates and engagement across our top 5 countries"
```
### Cohort Retention
```bash
/segment-analysis "Show retention curves for each monthly signup cohort in 2024"
```
## Output Format
Analysis typically includes:
- **Segment characteristics** (size, demographics, behavior)
- **Key metrics** for each segment
- **Comparative insights** between segments
- **Behavior patterns** unique to segment
- **Recommendations** for targeting or improvement
## Segmentation Criteria
You can segment by:
- **Demographics**: Country, language, device type
- **Behavior**: Feature usage, session frequency, engagement score
- **Business**: Plan type, payment history, LTV
- **Temporal**: Signup date, last active, tenure
- **Custom**: Any event or property in PostHog
## Advanced Analysis
### Multi-dimensional Segmentation
```bash
/segment-analysis "Power users (5+ sessions/week) from enterprise plans who use feature X"
```
### Funnel by Segment
```bash
/segment-analysis "Compare signup to activation funnel for organic vs paid traffic"
```
### Retention by Segment
```bash
/segment-analysis "30-day retention by initial feature used"
```
## Tips for Better Analysis
1. **Be specific** - Define your segment clearly
2. **Ask for comparisons** - "vs" between segments reveals insights
3. **Look for patterns** - What makes segments different?
4. **Consider time** - Trends over time matter
5. **Combine criteria** - Multi-dimensional segments can be revealing
## Context Cost
Plugin uses ~40k tokens. Disable when analysis is complete:
```bash
/plugin disable catalyst-analytics
```
---
**See also**: `/analyze-user-behavior`, `/product-metrics`