growth-engineering
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGrowth Engineering Skill
增长工程技能
Infrastructure and patterns for product-led growth, experimentation, and conversion optimization.
面向产品驱动增长(PLG)、实验与转化优化的基础设施及模式。
Feature Flag Systems
功能标志系统
Implementation Pattern
实现模式
typescript
// lib/feature-flags.ts
import { PostHog } from 'posthog-node';
const posthog = new PostHog(process.env.POSTHOG_API_KEY!);
interface FeatureFlags {
'new-onboarding-flow': boolean;
'pricing-experiment': 'control' | 'variant-a' | 'variant-b';
'ai-suggestions': boolean;
}
export async function getFlag<K extends keyof FeatureFlags>(
key: K,
userId: string,
): Promise<FeatureFlags[K]> {
const value = await posthog.getFeatureFlag(key, userId);
return value as FeatureFlags[K];
}
// Usage in component
const showNewOnboarding = await getFlag('new-onboarding-flow', user.id);typescript
// lib/feature-flags.ts
import { PostHog } from 'posthog-node';
const posthog = new PostHog(process.env.POSTHOG_API_KEY!);
interface FeatureFlags {
'new-onboarding-flow': boolean;
'pricing-experiment': 'control' | 'variant-a' | 'variant-b';
'ai-suggestions': boolean;
}
export async function getFlag<K extends keyof FeatureFlags>(
key: K,
userId: string,
): Promise<FeatureFlags[K]> {
const value = await posthog.getFeatureFlag(key, userId);
return value as FeatureFlags[K];
}
// 组件中的用法
const showNewOnboarding = await getFlag('new-onboarding-flow', user.id);Feature Flag Best Practices
功能标志最佳实践
- Short-lived flags: Remove after experiment concludes (< 2 weeks)
- Long-lived flags: Ops toggles for gradual rollouts, kill switches
- Never nest feature flags (creates exponential complexity)
- Clean up stale flags monthly
- Log flag evaluations for debugging
- 短期标志:实验结束后移除(<2周)
- 长期标志:用于逐步发布的运维开关、应急关停开关
- 切勿嵌套功能标志(会导致指数级复杂度)
- 每月清理过期标志
- 记录标志评估结果以便调试
A/B Testing Infrastructure
A/B测试基础设施
Experiment Design
实验设计
typescript
// lib/experiments.ts
interface Experiment {
id: string;
name: string;
variants: {
id: string;
weight: number; // 0-100, must sum to 100
}[];
targetAudience: {
percentage: number; // % of users included
filters?: Record<string, unknown>;
};
primaryMetric: string;
secondaryMetrics: string[];
minimumSampleSize: number;
startDate: Date;
endDate?: Date;
}
// Track experiment exposure
function trackExposure(experimentId: string, variantId: string, userId: string) {
analytics.capture({
event: '$experiment_started',
distinctId: userId,
properties: {
$experiment_id: experimentId,
$variant_id: variantId,
},
});
}typescript
// lib/experiments.ts
interface Experiment {
id: string;
name: string;
variants: {
id: string;
weight: number; // 0-100,总和必须为100
}[];
targetAudience: {
percentage: number; // 纳入实验的用户占比
filters?: Record<string, unknown>;
};
primaryMetric: string;
secondaryMetrics: string[];
minimumSampleSize: number;
startDate: Date;
endDate?: Date;
}
// 追踪实验曝光
function trackExposure(experimentId: string, variantId: string, userId: string) {
analytics.capture({
event: '$experiment_started',
distinctId: userId,
properties: {
$experiment_id: experimentId,
$variant_id: variantId,
},
});
}Statistical Significance
统计显著性
- Minimum sample size: Calculate before starting (use Evan Miller calculator)
- Don't peek: Set duration upfront, don't stop early on promising results
- Sequential testing: Use if you must check early (adjusts p-values)
- Minimum detectable effect: Define what improvement matters (e.g., 5% lift)
- 最小样本量:实验开始前计算(使用Evan Miller计算器)
- 不要中途偷看:提前设置实验时长,不要因初步利好结果提前终止
- 序贯测试:如果必须提前检查则使用(会调整p值)
- 最小可检测效果:定义有意义的提升幅度(例如5%的增长)
Product-Led Growth Patterns
产品驱动增长(PLG)模式
Activation Metrics
激活指标
| Stage | Metric | Example |
|---|---|---|
| Sign up | Registration complete | User creates account |
| Setup | Profile complete | Fills required fields |
| Aha moment | Core value experienced | Creates first project |
| Habit | Repeated engagement | 3 sessions in first week |
| Revenue | Conversion to paid | Subscribes to plan |
| 阶段 | 指标 | 示例 |
|---|---|---|
| 注册 | 完成注册 | 用户创建账户 |
| 设置 | 完成资料填写 | 填写必填字段 |
| 顿悟时刻 | 体验核心价值 | 创建首个项目 |
| 习惯养成 | 重复参与 | 首周内完成3次会话 |
| 营收 | 转化为付费用户 | 订阅付费方案 |
Viral Loops
病毒循环
typescript
// Referral system pattern
interface Referral {
referrerId: string;
referredEmail: string;
status: 'pending' | 'signed_up' | 'activated' | 'converted';
rewardGranted: boolean;
}
// Track referral funnel
function trackReferralStep(referralId: string, step: Referral['status']) {
analytics.capture({
event: 'referral_step',
properties: { referralId, step },
});
}typescript
// 推荐系统模式
interface Referral {
referrerId: string;
referredEmail: string;
status: 'pending' | 'signed_up' | 'activated' | 'converted';
rewardGranted: boolean;
}
// 追踪推荐漏斗
function trackReferralStep(referralId: string, step: Referral['status']) {
analytics.capture({
event: 'referral_step',
properties: { referralId, step },
});
}Conversion Optimization
转化优化
- Reduce friction: Minimize form fields, enable social login
- Social proof: Show user counts, testimonials, logos
- Urgency: Trial countdown, limited-time offers (use sparingly)
- Value demonstration: Interactive demos, free tier with clear upgrade path
- Personalization: Onboarding flow based on use case selection
- 降低摩擦:减少表单字段数量,支持社交账号登录
- 社交证明:展示用户数量、客户 testimonial、合作品牌标志
- 紧迫感:试用倒计时、限时优惠(谨慎使用)
- 价值展示:交互式演示、带有清晰升级路径的免费版
- 个性化:根据用户选择的使用场景定制引导流程
Growth Metrics
增长指标
| Metric | Formula | Target |
|---|---|---|
| Activation rate | Activated / Signed up | > 40% |
| Trial-to-paid | Paid / Trial started | > 15% |
| Net revenue retention | (Start MRR + Expansion - Contraction - Churn) / Start MRR | > 110% |
| Viral coefficient | Invites sent * Conversion rate | > 0.5 |
| Time to value | Median time from signup to aha moment | < 5 min |
| DAU/MAU ratio | Daily active / Monthly active | > 20% |
| 指标 | 计算公式 | 目标值 |
|---|---|---|
| 激活率 | 激活用户数 / 注册用户数 | >40% |
| 试用转付费 | 付费用户数 / 开始试用用户数 | >15% |
| 净收入留存率 | (期初MRR + 扩容收入 - 缩容收入 - 流失收入)/ 期初MRR | >110% |
| 病毒系数 | 发出邀请数 * 转化率 | >0.5 |
| 价值实现时间 | 从注册到顿悟时刻的中位时长 | <5分钟 |
| DAU/MAU比率 | 日活跃用户数 / 月活跃用户数 | >20% |
Experimentation Platforms
实验平台
| Platform | Type | Best For |
|---|---|---|
| PostHog | Self-hosted/cloud | Full-stack, open source |
| LaunchDarkly | Cloud | Feature flags at scale |
| Statsig | Cloud | Auto-stats, warehouse-native |
| Growthbook | Self-hosted/cloud | Open source, Bayesian stats |
| Optimizely | Cloud | Enterprise, multi-channel |
| 平台 | 类型 | 适用场景 |
|---|---|---|
| PostHog | 自托管/云服务 | 全栈、开源 |
| LaunchDarkly | 云服务 | 大规模功能标志管理 |
| Statsig | 云服务 | 自动统计、数据仓库原生 |
| Growthbook | 自托管/云服务 | 开源、贝叶斯统计 |
| Optimizely | 云服务 | 企业级、多渠道 |
Related Resources
相关资源
- - Analytics and tracking
~/.claude/skills/product-analytics/SKILL.md - - Analytics agent
~/.claude/agents/product-analytics-specialist.md - - Auth for PLG
~/.claude/skills/authentication-patterns/SKILL.md
Measure everything. Experiment constantly. Remove what doesn't work.
- - 分析与追踪
~/.claude/skills/product-analytics/SKILL.md - - 分析Agent
~/.claude/agents/product-analytics-specialist.md - - PLG场景下的身份验证
~/.claude/skills/authentication-patterns/SKILL.md
Measure everything. Experiment constantly. Remove what doesn't work.