100xprism 2.3.1

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.
Files changed (207) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +196 -0
  3. package/VERSION +1 -0
  4. package/adapters/antigravity.sh +14 -0
  5. package/adapters/claude-code.sh +160 -0
  6. package/adapters/codex.sh +13 -0
  7. package/adapters/copilot.sh +13 -0
  8. package/adapters/cursor.sh +13 -0
  9. package/adapters/gemini.sh +13 -0
  10. package/adapters/lib/__pycache__/modules.cpython-312.pyc +0 -0
  11. package/adapters/lib/modules.py +592 -0
  12. package/adapters/lib/shared.sh +83 -0
  13. package/adapters/lib/sync_plugins.py +113 -0
  14. package/adapters/windsurf.sh +15 -0
  15. package/bin/100xprism.js +29 -0
  16. package/get.sh +24 -0
  17. package/install-project.sh +82 -0
  18. package/install.sh +281 -0
  19. package/lib/adapters/windows.js +429 -0
  20. package/lib/bootstrap.js +33 -0
  21. package/lib/init.js +19 -0
  22. package/lib/install.js +18 -0
  23. package/lib/migrate.js +52 -0
  24. package/lib/platform.js +22 -0
  25. package/lib/update.js +29 -0
  26. package/modules/_lib/reference.md +77 -0
  27. package/modules/a11y-auditor/SKILL.md +151 -0
  28. package/modules/ab-test-setup/SKILL.md +266 -0
  29. package/modules/ab-test-setup/evals/evals.json +105 -0
  30. package/modules/ab-test-setup/references/sample-size-guide.md +263 -0
  31. package/modules/ab-test-setup/references/test-templates.md +277 -0
  32. package/modules/ad-creative/SKILL.md +362 -0
  33. package/modules/ad-creative/evals/evals.json +90 -0
  34. package/modules/ad-creative/references/generative-tools.md +637 -0
  35. package/modules/ad-creative/references/platform-specs.md +213 -0
  36. package/modules/ai-seo/SKILL.md +398 -0
  37. package/modules/ai-seo/evals/evals.json +90 -0
  38. package/modules/ai-seo/references/content-patterns.md +285 -0
  39. package/modules/ai-seo/references/platform-ranking-factors.md +152 -0
  40. package/modules/analytics-tracking/SKILL.md +309 -0
  41. package/modules/analytics-tracking/evals/evals.json +90 -0
  42. package/modules/analytics-tracking/references/event-library.md +260 -0
  43. package/modules/analytics-tracking/references/ga4-implementation.md +300 -0
  44. package/modules/analytics-tracking/references/gtm-implementation.md +390 -0
  45. package/modules/architect/SKILL.md +282 -0
  46. package/modules/branch/SKILL.md +105 -0
  47. package/modules/churn-prevention/SKILL.md +424 -0
  48. package/modules/churn-prevention/evals/evals.json +93 -0
  49. package/modules/churn-prevention/references/cancel-flow-patterns.md +316 -0
  50. package/modules/churn-prevention/references/dunning-playbook.md +408 -0
  51. package/modules/cloud-security/SKILL.md +240 -0
  52. package/modules/cold-email/SKILL.md +178 -0
  53. package/modules/cold-email/evals/evals.json +94 -0
  54. package/modules/cold-email/references/benchmarks.md +83 -0
  55. package/modules/cold-email/references/follow-up-sequences.md +81 -0
  56. package/modules/cold-email/references/frameworks.md +90 -0
  57. package/modules/cold-email/references/personalization.md +79 -0
  58. package/modules/cold-email/references/subject-lines.md +53 -0
  59. package/modules/commit/SKILL.md +195 -0
  60. package/modules/competitor-alternatives/SKILL.md +256 -0
  61. package/modules/competitor-alternatives/evals/evals.json +93 -0
  62. package/modules/competitor-alternatives/references/content-architecture.md +271 -0
  63. package/modules/competitor-alternatives/references/templates.md +223 -0
  64. package/modules/connect/SKILL.md +894 -0
  65. package/modules/content-strategy/SKILL.md +359 -0
  66. package/modules/content-strategy/evals/evals.json +90 -0
  67. package/modules/context-dump/SKILL.md +67 -0
  68. package/modules/copy-editing/SKILL.md +447 -0
  69. package/modules/copy-editing/evals/evals.json +89 -0
  70. package/modules/copy-editing/references/plain-english-alternatives.md +394 -0
  71. package/modules/copywriting/SKILL.md +271 -0
  72. package/modules/copywriting/evals/evals.json +111 -0
  73. package/modules/copywriting/references/cold-email-benchmarks.md +83 -0
  74. package/modules/copywriting/references/cold-email-follow-ups.md +81 -0
  75. package/modules/copywriting/references/cold-email-frameworks.md +90 -0
  76. package/modules/copywriting/references/cold-email-personalization.md +79 -0
  77. package/modules/copywriting/references/cold-email-subject-lines.md +53 -0
  78. package/modules/copywriting/references/copy-frameworks.md +344 -0
  79. package/modules/copywriting/references/email-copy-guidelines.md +113 -0
  80. package/modules/copywriting/references/email-types.md +515 -0
  81. package/modules/copywriting/references/natural-transitions.md +272 -0
  82. package/modules/copywriting/references/sequence-templates.md +168 -0
  83. package/modules/data-query/SKILL.md +58 -0
  84. package/modules/data-viz/SKILL.md +225 -0
  85. package/modules/db/SKILL.md +205 -0
  86. package/modules/db/db-engines/_router.md +24 -0
  87. package/modules/db/db-engines/athena.md +16 -0
  88. package/modules/db/db-engines/cloud-sql.md +16 -0
  89. package/modules/db/db-engines/databricks.md +14 -0
  90. package/modules/db/db-engines/oracle.md +14 -0
  91. package/modules/db/db-engines/postgres.md +15 -0
  92. package/modules/db/db-engines/presto.md +14 -0
  93. package/modules/db/db-engines/snowflake.md +14 -0
  94. package/modules/docs/SKILL.md +100 -0
  95. package/modules/email-sequence/SKILL.md +309 -0
  96. package/modules/email-sequence/evals/evals.json +93 -0
  97. package/modules/email-sequence/references/copy-guidelines.md +113 -0
  98. package/modules/email-sequence/references/email-types.md +515 -0
  99. package/modules/email-sequence/references/sequence-templates.md +168 -0
  100. package/modules/enterprise-design/SKILL.md +75 -0
  101. package/modules/eval/SKILL.md +105 -0
  102. package/modules/figma-translator/SKILL.md +49 -0
  103. package/modules/fix-bugs/SKILL.md +104 -0
  104. package/modules/form-cro/SKILL.md +429 -0
  105. package/modules/form-cro/evals/evals.json +90 -0
  106. package/modules/free-tool-strategy/SKILL.md +178 -0
  107. package/modules/free-tool-strategy/evals/evals.json +90 -0
  108. package/modules/free-tool-strategy/references/tool-types.md +217 -0
  109. package/modules/gate/SKILL.md +232 -0
  110. package/modules/grill-me/SKILL.md +59 -0
  111. package/modules/interaction-engineer/SKILL.md +49 -0
  112. package/modules/issue/SKILL.md +272 -0
  113. package/modules/launch/SKILL.md +345 -0
  114. package/modules/launch-strategy/SKILL.md +353 -0
  115. package/modules/launch-strategy/evals/evals.json +91 -0
  116. package/modules/lint/SKILL.md +126 -0
  117. package/modules/marketing-ideas/SKILL.md +167 -0
  118. package/modules/marketing-ideas/evals/evals.json +90 -0
  119. package/modules/marketing-ideas/references/ideas-by-category.md +366 -0
  120. package/modules/marketing-psychology/SKILL.md +455 -0
  121. package/modules/marketing-psychology/evals/evals.json +88 -0
  122. package/modules/motion-designer/SKILL.md +214 -0
  123. package/modules/onboarding-cro/SKILL.md +220 -0
  124. package/modules/onboarding-cro/evals/evals.json +92 -0
  125. package/modules/onboarding-cro/references/experiments.md +258 -0
  126. package/modules/orchestrate/SKILL.md +77 -0
  127. package/modules/page-cro/SKILL.md +182 -0
  128. package/modules/page-cro/evals/evals.json +111 -0
  129. package/modules/page-cro/references/experiments.md +248 -0
  130. package/modules/page-cro/references/paywall-experiments.md +164 -0
  131. package/modules/paid-ads/SKILL.md +315 -0
  132. package/modules/paid-ads/evals/evals.json +90 -0
  133. package/modules/paid-ads/references/ad-copy-templates.md +207 -0
  134. package/modules/paid-ads/references/audience-targeting.md +243 -0
  135. package/modules/paid-ads/references/platform-setup-checklists.md +277 -0
  136. package/modules/paywall-upgrade-cro/SKILL.md +227 -0
  137. package/modules/paywall-upgrade-cro/evals/evals.json +93 -0
  138. package/modules/paywall-upgrade-cro/references/experiments.md +164 -0
  139. package/modules/popup-cro/SKILL.md +453 -0
  140. package/modules/popup-cro/evals/evals.json +94 -0
  141. package/modules/pr/SKILL.md +203 -0
  142. package/modules/pricing-strategy/SKILL.md +231 -0
  143. package/modules/pricing-strategy/evals/evals.json +90 -0
  144. package/modules/pricing-strategy/references/research-methods.md +152 -0
  145. package/modules/pricing-strategy/references/tier-structure.md +232 -0
  146. package/modules/product-marketing-context/SKILL.md +241 -0
  147. package/modules/product-marketing-context/evals/evals.json +85 -0
  148. package/modules/programmatic-seo/SKILL.md +238 -0
  149. package/modules/programmatic-seo/evals/evals.json +94 -0
  150. package/modules/programmatic-seo/references/playbooks.md +308 -0
  151. package/modules/push/SKILL.md +202 -0
  152. package/modules/referral-program/SKILL.md +255 -0
  153. package/modules/referral-program/evals/evals.json +89 -0
  154. package/modules/referral-program/references/affiliate-programs.md +164 -0
  155. package/modules/referral-program/references/program-examples.md +143 -0
  156. package/modules/release/SKILL.md +293 -0
  157. package/modules/revops/SKILL.md +343 -0
  158. package/modules/revops/evals/evals.json +91 -0
  159. package/modules/revops/references/automation-playbooks.md +290 -0
  160. package/modules/revops/references/lifecycle-definitions.md +278 -0
  161. package/modules/revops/references/routing-rules.md +203 -0
  162. package/modules/revops/references/scoring-models.md +247 -0
  163. package/modules/sales-enablement/SKILL.md +349 -0
  164. package/modules/sales-enablement/evals/evals.json +91 -0
  165. package/modules/sales-enablement/references/deck-frameworks.md +263 -0
  166. package/modules/sales-enablement/references/demo-scripts.md +355 -0
  167. package/modules/sales-enablement/references/objection-library.md +270 -0
  168. package/modules/sales-enablement/references/one-pager-templates.md +208 -0
  169. package/modules/schema-markup/SKILL.md +179 -0
  170. package/modules/schema-markup/evals/evals.json +87 -0
  171. package/modules/schema-markup/references/schema-examples.md +398 -0
  172. package/modules/security/SKILL.md +138 -0
  173. package/modules/seo-audit/SKILL.md +412 -0
  174. package/modules/seo-audit/evals/evals.json +136 -0
  175. package/modules/seo-audit/references/ai-writing-detection.md +200 -0
  176. package/modules/seo-audit/references/content-patterns.md +285 -0
  177. package/modules/seo-audit/references/platform-ranking-factors.md +152 -0
  178. package/modules/signup-flow-cro/SKILL.md +359 -0
  179. package/modules/signup-flow-cro/evals/evals.json +88 -0
  180. package/modules/site-architecture/SKILL.md +357 -0
  181. package/modules/site-architecture/evals/evals.json +88 -0
  182. package/modules/site-architecture/references/mermaid-templates.md +216 -0
  183. package/modules/site-architecture/references/navigation-patterns.md +305 -0
  184. package/modules/site-architecture/references/site-type-templates.md +293 -0
  185. package/modules/social-content/SKILL.md +278 -0
  186. package/modules/social-content/evals/evals.json +92 -0
  187. package/modules/social-content/references/platforms.md +170 -0
  188. package/modules/social-content/references/post-templates.md +177 -0
  189. package/modules/social-content/references/reverse-engineering.md +195 -0
  190. package/modules/spec/SKILL.md +81 -0
  191. package/modules/subagents/SKILL.md +123 -0
  192. package/modules/techdebt/SKILL.md +71 -0
  193. package/modules/terminal-setup/SKILL.md +49 -0
  194. package/modules/test/SKILL.md +493 -0
  195. package/modules/test/references/e2e-patterns.md +294 -0
  196. package/modules/update-claude-md/SKILL.md +52 -0
  197. package/modules/visual-system-architect/SKILL.md +53 -0
  198. package/package.json +44 -0
  199. package/plugins/plugins.json +43 -0
  200. package/shell/aliases.sh +24 -0
  201. package/shell/check-update.sh +212 -0
  202. package/templates/.env.example +199 -0
  203. package/templates/docker-compose.md +46 -0
  204. package/templates/node-frontend.md +56 -0
  205. package/templates/node-fullstack.md +59 -0
  206. package/templates/python-api.md +57 -0
  207. package/update.sh +231 -0
@@ -0,0 +1,164 @@
1
+ # Affiliate Program Design
2
+
3
+ Detailed guidance for building and managing affiliate programs.
4
+
5
+ ## Contents
6
+ - Commission Structures
7
+ - Cookie Duration
8
+ - Affiliate Recruitment
9
+ - Affiliate Enablement
10
+ - Tools & Platforms (Referral Program Tools, Affiliate Program Tools, Choosing a Tool)
11
+ - Fraud Prevention (Common Referral Fraud, Prevention Measures)
12
+
13
+ ## Commission Structures
14
+
15
+ **Percentage of sale:**
16
+ - Standard: 10-30% of first sale or first year
17
+ - Works for: E-commerce, SaaS with clear pricing
18
+ - Example: "Earn 25% of every sale you refer"
19
+
20
+ **Flat fee per action:**
21
+ - Standard: $5-500 depending on value
22
+ - Works for: Lead gen, trials, freemium
23
+ - Example: "$50 for every qualified demo"
24
+
25
+ **Recurring commission:**
26
+ - Standard: 10-25% of recurring revenue
27
+ - Works for: Subscription products
28
+ - Example: "20% of subscription for 12 months"
29
+
30
+ **Tiered commission:**
31
+ - Works for: Motivating high performers
32
+ - Example: "20% for 1-10 sales, 25% for 11-25, 30% for 26+"
33
+
34
+ ---
35
+
36
+ ## Cookie Duration
37
+
38
+ How long after click does affiliate get credit?
39
+
40
+ | Duration | Use Case |
41
+ |----------|----------|
42
+ | 24 hours | High-volume, low-consideration purchases |
43
+ | 7-14 days | Standard e-commerce |
44
+ | 30 days | Standard SaaS/B2B |
45
+ | 60-90 days | Long sales cycles, enterprise |
46
+ | Lifetime | Premium affiliate relationships |
47
+
48
+ ---
49
+
50
+ ## Affiliate Recruitment
51
+
52
+ ### Where to find affiliates:
53
+ - Existing customers who create content
54
+ - Industry bloggers and reviewers
55
+ - YouTubers in your niche
56
+ - Newsletter writers
57
+ - Complementary tool companies
58
+ - Consultants and agencies
59
+
60
+ ### Outreach template:
61
+ ```
62
+ Subject: Partnership opportunity — [Your Product]
63
+
64
+ Hi [Name],
65
+
66
+ I've been following your content on [topic] — particularly [specific piece] — and think there could be a great fit for a partnership.
67
+
68
+ [Your Product] helps [audience] [achieve outcome], and I think your audience would find it valuable.
69
+
70
+ We offer [commission structure] for partners, plus [additional benefits: early access, co-marketing, etc.].
71
+
72
+ Would you be open to learning more?
73
+
74
+ [Your name]
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Affiliate Enablement
80
+
81
+ Provide affiliates with:
82
+ - [ ] Unique tracking links/codes
83
+ - [ ] Product overview and key benefits
84
+ - [ ] Target audience description
85
+ - [ ] Comparison to competitors
86
+ - [ ] Creative assets (logos, banners, images)
87
+ - [ ] Sample copy and talking points
88
+ - [ ] Case studies and testimonials
89
+ - [ ] Demo access or free account
90
+ - [ ] FAQ and objection handling
91
+ - [ ] Payment terms and schedule
92
+
93
+ ---
94
+
95
+ ## Tools & Platforms
96
+
97
+ ### Referral Program Tools
98
+
99
+ **Full-featured platforms:**
100
+ - ReferralCandy — E-commerce focused
101
+ - Ambassador — Enterprise referral programs
102
+ - Friendbuy — E-commerce and subscription
103
+ - GrowSurf — SaaS and tech companies
104
+ - Mention Me — AI-powered referral marketing
105
+ - Viral Loops — Template-based campaigns
106
+
107
+ **Built-in options:**
108
+ - Stripe (basic referral tracking)
109
+ - HubSpot (CRM-integrated)
110
+ - Segment (tracking and analytics)
111
+
112
+ ### Affiliate Program Tools
113
+
114
+ **Affiliate networks:**
115
+ - ShareASale — Large merchant network
116
+ - Impact — Enterprise partnerships
117
+ - PartnerStack — SaaS focused
118
+ - Tapfiliate — Simple SaaS affiliate tracking
119
+ - FirstPromoter — SaaS affiliate management
120
+
121
+ **Self-hosted:**
122
+ - Rewardful — Stripe-integrated affiliates
123
+ - Refersion — E-commerce affiliates
124
+
125
+ ### Choosing a Tool
126
+
127
+ Consider:
128
+ - Integration with your payment system
129
+ - Fraud detection capabilities
130
+ - Payout management
131
+ - Reporting and analytics
132
+ - Customization options
133
+ - Price vs. program scale
134
+
135
+ ---
136
+
137
+ ## Fraud Prevention
138
+
139
+ ### Common Referral Fraud
140
+ - Self-referrals (creating fake accounts)
141
+ - Referral rings (groups referring each other)
142
+ - Coupon sites posting referral codes
143
+ - Fake email addresses
144
+ - VPN/device spoofing
145
+
146
+ ### Prevention Measures
147
+
148
+ **Technical:**
149
+ - Email verification required
150
+ - Device fingerprinting
151
+ - IP address monitoring
152
+ - Delayed reward payout (after activation)
153
+ - Minimum activity threshold
154
+
155
+ **Policy:**
156
+ - Clear terms of service
157
+ - Maximum referrals per period
158
+ - Reward clawback for refunds/chargebacks
159
+ - Manual review for suspicious patterns
160
+
161
+ **Structural:**
162
+ - Require referred user to take meaningful action
163
+ - Cap lifetime rewards
164
+ - Pay rewards in product credit (less attractive to fraudsters)
@@ -0,0 +1,143 @@
1
+ # Referral Program Examples
2
+
3
+ Real-world examples of successful referral programs.
4
+
5
+ ## Contents
6
+ - Dropbox (Classic)
7
+ - Uber/Lyft
8
+ - Morning Brew
9
+ - Notion
10
+ - Incentive Types Comparison
11
+ - Incentive Sizing Framework
12
+ - Viral Coefficient & Metrics (Key Metrics, Calculating Referral Program ROI)
13
+
14
+ ## Dropbox (Classic)
15
+
16
+ **Program:** Give 500MB storage, get 500MB storage
17
+
18
+ **Why it worked:**
19
+ - Reward directly tied to product value
20
+ - Low friction (just an email)
21
+ - Both parties benefit equally
22
+ - Gamified with progress tracking
23
+
24
+ ---
25
+
26
+ ## Uber/Lyft
27
+
28
+ **Program:** Give $10 ride credit, get $10 when they ride
29
+
30
+ **Why it worked:**
31
+ - Immediate, clear value
32
+ - Double-sided incentive
33
+ - Easy to share (code/link)
34
+ - Triggered at natural moments
35
+
36
+ ---
37
+
38
+ ## Morning Brew
39
+
40
+ **Program:** Tiered rewards for subscriber referrals
41
+ - 3 referrals: Newsletter stickers
42
+ - 5 referrals: T-shirt
43
+ - 10 referrals: Mug
44
+ - 25 referrals: Hoodie
45
+
46
+ **Why it worked:**
47
+ - Gamification drives ongoing engagement
48
+ - Physical rewards are shareable (more referrals)
49
+ - Low cost relative to subscriber value
50
+ - Built status/identity
51
+
52
+ ---
53
+
54
+ ## Notion
55
+
56
+ **Program:** $10 credit per referral (education)
57
+
58
+ **Why it worked:**
59
+ - Targeted high-sharing audience (students)
60
+ - Product naturally spreads in teams
61
+ - Credit keeps users engaged
62
+
63
+ ---
64
+
65
+ ## Incentive Types Comparison
66
+
67
+ | Type | Pros | Cons | Best For |
68
+ |------|------|------|----------|
69
+ | Cash/credit | Universally valued | Feels transactional | Marketplaces, fintech |
70
+ | Product credit | Drives usage | Only valuable if they'll use it | SaaS, subscriptions |
71
+ | Free months | Clear value | May attract freebie-seekers | Subscription products |
72
+ | Feature unlock | Low cost to you | Only works for gated features | Freemium products |
73
+ | Swag/gifts | Memorable, shareable | Logistics complexity | Brand-focused companies |
74
+ | Charity donation | Feel-good | Lower personal motivation | Mission-driven brands |
75
+
76
+ ---
77
+
78
+ ## Incentive Sizing Framework
79
+
80
+ **Calculate your maximum incentive:**
81
+ ```
82
+ Max Referral Reward = (Customer LTV × Gross Margin) - Target CAC
83
+ ```
84
+
85
+ **Example:**
86
+ - LTV: $1,200
87
+ - Gross margin: 70%
88
+ - Target CAC: $200
89
+ - Max reward: ($1,200 × 0.70) - $200 = $640
90
+
91
+ **Typical referral rewards:**
92
+ - B2C: $10-50 or 10-25% of first purchase
93
+ - B2B SaaS: $50-500 or 1-3 months free
94
+ - Enterprise: Higher, often custom
95
+
96
+ ---
97
+
98
+ ## Viral Coefficient & Metrics
99
+
100
+ ### Key Metrics
101
+
102
+ **Viral coefficient (K-factor):**
103
+ ```
104
+ K = Invitations × Conversion Rate
105
+
106
+ K > 1 = Viral growth (each user brings more than 1 new user)
107
+ K < 1 = Amplified growth (referrals supplement other acquisition)
108
+ ```
109
+
110
+ **Example:**
111
+ - Average customer sends 3 invitations
112
+ - 15% of invitations convert
113
+ - K = 3 × 0.15 = 0.45
114
+
115
+ **Referral rate:**
116
+ ```
117
+ Referral Rate = (Customers who refer) / (Total customers)
118
+ ```
119
+
120
+ Benchmarks:
121
+ - Good: 10-25% of customers refer
122
+ - Great: 25-50%
123
+ - Exceptional: 50%+
124
+
125
+ **Referrals per referrer:**
126
+
127
+ Benchmarks:
128
+ - Average: 1-2 referrals per referrer
129
+ - Good: 2-5
130
+ - Exceptional: 5+
131
+
132
+ ### Calculating Referral Program ROI
133
+
134
+ ```
135
+ Referral Program ROI = (Revenue from referred customers - Program costs) / Program costs
136
+
137
+ Program costs = Rewards paid + Tool costs + Management time
138
+ ```
139
+
140
+ **Track separately:**
141
+ - Cost per referred customer (CAC via referral)
142
+ - LTV of referred customers (often higher than average)
143
+ - Payback period for referral rewards
@@ -0,0 +1,293 @@
1
+ ---
2
+ name: release
3
+ description: You are a release engineer. Execute each phase in order. Each must fully complete before advancing. Do NOT ask for permission. Do NOT skip phases.
4
+ category: lifecycle
5
+ tier: core
6
+ slash_command: /release
7
+ ---
8
+
9
+ # Release — Local Gate → Install Test → Version Bump → Tag → Publish → Verify
10
+
11
+ You are a release engineer. Execute each phase in order. Each must fully complete before advancing. Do NOT ask for permission. Do NOT skip phases.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /release patch # 1.2.3 → 1.2.4
17
+ /release minor # 1.2.3 → 1.3.0
18
+ /release major # 1.2.3 → 2.0.0
19
+ /release 1.4.0 # explicit version
20
+ ```
21
+
22
+ If no argument is given, ask: `patch, minor, or major?`
23
+
24
+ ---
25
+
26
+ ## Phase 0 — Detect registries
27
+
28
+ ```bash
29
+ PROJECT_ROOT=$(git rev-parse --show-toplevel)
30
+ cd "$PROJECT_ROOT"
31
+
32
+ { [ -f pyproject.toml ] || [ -f setup.py ]; } && PYPI=true || PYPI=false
33
+ [ -f package.json ] && node -e "const d=require('./package.json'); process.exit(d.private ? 1 : 0)" 2>/dev/null && NPM=true || NPM=false
34
+ [ -f Dockerfile ] && DOCKER=true || DOCKER=false
35
+ ```
36
+
37
+ Print detected registries before continuing:
38
+
39
+ ```
40
+ Detected registries:
41
+ PyPI: true | false
42
+ npm: true | false
43
+ Docker: true | false
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Phase 1 — Quality Gate (MANDATORY)
49
+
50
+ Run the **gate** workflow. Do NOT continue until it reports `✅ ALL GATES PASSED`.
51
+
52
+ ---
53
+
54
+ ## Phase 2 — Confirm current version
55
+
56
+ Print current → new version before proceeding. Do not proceed without confirming the version transition is correct.
57
+
58
+ ```bash
59
+ python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])" 2>/dev/null || true
60
+ node -e "console.log(require('./package.json').version)" 2>/dev/null || true
61
+ ```
62
+
63
+ Print:
64
+ ```
65
+ Current version: X.Y.Z
66
+ New version: A.B.C
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Phase 3 — Build packages locally
72
+
73
+ ### PyPI (if PYPI=true)
74
+
75
+ ```bash
76
+ pip install build twine --quiet
77
+ python -m build
78
+ twine check dist/*
79
+ ```
80
+
81
+ GATE: `twine check` must report PASSED for all distributions. If it fails → STOP.
82
+
83
+ ### npm (if NPM=true)
84
+
85
+ ```bash
86
+ npm pack --dry-run
87
+ ```
88
+
89
+ GATE: must complete with no errors. If it fails → STOP.
90
+
91
+ ### Docker (if DOCKER=true)
92
+
93
+ ```bash
94
+ docker build -t "$(basename "$PROJECT_ROOT"):release-candidate" .
95
+ ```
96
+
97
+ GATE: build must succeed. If it fails → STOP.
98
+
99
+ ---
100
+
101
+ ## Phase 4 — Local install smoke test (BEFORE tagging)
102
+
103
+ This is the most important phase. It catches broken imports, missing files, and broken CLI entrypoints BEFORE anything is published.
104
+
105
+ ### PyPI smoke test (if PYPI=true)
106
+
107
+ ```bash
108
+ python3 -m venv /tmp/release-test-venv
109
+ /tmp/release-test-venv/bin/pip install dist/*.whl --quiet
110
+ PACKAGE_NAME=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['name'].replace('-','_'))")
111
+ /tmp/release-test-venv/bin/python -c "import $PACKAGE_NAME; print('Import OK')"
112
+ CLI_CMD=$(python3 -c "import tomllib; scripts=tomllib.load(open('pyproject.toml','rb')).get('project',{}).get('scripts',{}); print(list(scripts.keys())[0] if scripts else '')" 2>/dev/null)
113
+ [ -n "$CLI_CMD" ] && /tmp/release-test-venv/bin/$CLI_CMD --version || echo "No CLI entrypoint"
114
+ rm -rf /tmp/release-test-venv
115
+ ```
116
+
117
+ ### Docker smoke test (if DOCKER=true)
118
+
119
+ ```bash
120
+ IMAGE="$(basename "$PROJECT_ROOT"):release-candidate"
121
+ docker run --rm "$IMAGE" --version 2>/dev/null || \
122
+ docker run --rm "$IMAGE" --help 2>/dev/null || \
123
+ docker run --rm "$IMAGE" echo "container starts OK"
124
+ ```
125
+
126
+ **GATE: All smoke tests must pass. If any fail → STOP. Fix the package, re-run from Phase 3.**
127
+
128
+ Print summary:
129
+
130
+ ```
131
+ Phase 4 Smoke Tests:
132
+ PyPI install: ✅ PASSED | ❌ FAILED
133
+ Docker run: ✅ PASSED | ❌ FAILED | ⬜ skipped
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Phase 5 — Bump version
139
+
140
+ ### pyproject.toml (if PYPI=true)
141
+
142
+ ```bash
143
+ OLD_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
144
+ sed -i.bak "s/^version = \"$OLD_VERSION\"/version = \"$NEW_VERSION\"/" pyproject.toml && rm pyproject.toml.bak
145
+ ```
146
+
147
+ ### package.json (if NPM=true)
148
+
149
+ ```bash
150
+ npm version $NEW_VERSION --no-git-tag-version
151
+ ```
152
+
153
+ Verify the bump applied by printing the new version from each file.
154
+
155
+ ---
156
+
157
+ ## Phase 6 — Update CHANGELOG
158
+
159
+ ```bash
160
+ if [ -f CHANGELOG.md ]; then
161
+ TODAY=$(date +%Y-%m-%d)
162
+ sed -i.bak "s/^## \[Unreleased\]/## [$NEW_VERSION] - $TODAY/" CHANGELOG.md && rm -f CHANGELOG.md.bak
163
+ python3 -c "
164
+ content = open('CHANGELOG.md').read()
165
+ content = content.replace('## [$NEW_VERSION]', '## [Unreleased]\n\n## [$NEW_VERSION]', 1)
166
+ open('CHANGELOG.md', 'w').write(content)
167
+ "
168
+ echo "CHANGELOG.md updated for v$NEW_VERSION"
169
+ else
170
+ echo "No CHANGELOG.md — skipping"
171
+ fi
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Phase 7 — Commit version bump + tag
177
+
178
+ ```bash
179
+ git add pyproject.toml package.json CHANGELOG.md 2>/dev/null || true
180
+ git add -u
181
+ git commit -m "$(cat <<EOF
182
+ chore(release): bump version to $NEW_VERSION
183
+
184
+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
185
+ EOF
186
+ )"
187
+ git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
188
+ git log --oneline -2
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Phase 8 — Push tag
194
+
195
+ ```bash
196
+ DEFAULT_BRANCH=$(git symbolic-ref --short HEAD)
197
+ git push origin "$DEFAULT_BRANCH"
198
+ git push origin "v$NEW_VERSION"
199
+ ```
200
+
201
+ Print: `Tag v$NEW_VERSION pushed → CI release pipeline triggered`
202
+
203
+ ---
204
+
205
+ ## Phase 9 — Watch CI release run
206
+
207
+ ```bash
208
+ sleep 10
209
+ RUN_ID=$(gh run list --workflow=release.yml --limit 1 --json databaseId -q '.[0].databaseId' 2>/dev/null)
210
+ [ -n "$RUN_ID" ] && gh run watch "$RUN_ID" || echo "No release.yml found — check manually: gh run list --limit 5"
211
+ ```
212
+
213
+ If CI fails: read logs with `gh run view "$RUN_ID" --log | tail -100`, fix locally, push fix to main (do NOT re-tag). Max 3 attempts, then escalate with full diagnosis.
214
+
215
+ ```
216
+ CI FAILED — Attempt N/3
217
+ Failure: [error summary]
218
+ Fix: [what was done]
219
+ Action: Committing fix, pushing to main...
220
+ ```
221
+
222
+ After 3 failed attempts → STOP and escalate:
223
+
224
+ ```
225
+ ╔══════════════════════════════════════════════════════╗
226
+ ║ CI RELEASE FAILED — ESCALATING TO HUMAN ║
227
+ ╠══════════════════════════════════════════════════════╣
228
+ ║ Attempts: N/3 exhausted ║
229
+ ║ Last error: [error summary] ║
230
+ ║ Diagnosis: [root cause analysis] ║
231
+ ║ Suggestion: [recommended fix] ║
232
+ ╠══════════════════════════════════════════════════════╣
233
+ ║ This requires human judgment. Auto-fix not possible. ║
234
+ ╚══════════════════════════════════════════════════════╝
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Phase 10 — Post-release verification (from live registry)
240
+
241
+ After CI passes, verify packages are installable from the live registry.
242
+
243
+ ### PyPI (if PYPI=true)
244
+
245
+ ```bash
246
+ python3 -m venv /tmp/pypi-verify-venv
247
+ echo "Waiting for PyPI propagation..."
248
+ for i in 1 2 3 4 5; do
249
+ sleep 20
250
+ /tmp/pypi-verify-venv/bin/pip install "$PACKAGE_NAME==$NEW_VERSION" --quiet 2>/dev/null && break
251
+ echo "Attempt $i/5 — not yet available, retrying..."
252
+ done
253
+ /tmp/pypi-verify-venv/bin/python -c "import $PACKAGE_NAME; print('PyPI install verified OK')"
254
+ rm -rf /tmp/pypi-verify-venv
255
+ ```
256
+
257
+ ### Docker Hub (if DOCKER=true)
258
+
259
+ ```bash
260
+ DOCKER_REPO=$(grep -m1 'DOCKERHUB_REPO' .env.release 2>/dev/null | cut -d= -f2 || echo "")
261
+ [ -n "$DOCKER_REPO" ] && docker pull "$DOCKER_REPO:$NEW_VERSION" && docker run --rm "$DOCKER_REPO:$NEW_VERSION" --version || echo "Docker Hub verify skipped — set DOCKERHUB_REPO in .env.release"
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Output
267
+
268
+ ```
269
+ === Release Complete ===
270
+ Version: v$NEW_VERSION
271
+ Tag: ✅ pushed
272
+ CI: ✅ release.yml passed
273
+
274
+ Registries:
275
+ PyPI: ✅ verified installable | ⬜ skipped
276
+ npm: ✅ verified | ⬜ skipped
277
+ Docker Hub: ✅ verified | ⬜ skipped
278
+
279
+ Status: RELEASED ✅
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Troubleshooting
285
+
286
+ | Problem | Fix |
287
+ |---|---|
288
+ | `twine check` fails | Fix metadata in `pyproject.toml` |
289
+ | PyPI smoke test fails (ImportError) | Missing file in `[tool.setuptools] packages` |
290
+ | Docker smoke test fails | Add `CMD ["--version"]` to Dockerfile |
291
+ | Version already exists on PyPI | PyPI versions are immutable — bump again, create new tag |
292
+ | CI release run not found | Workflow must be named `release.yml` triggered on `push: tags: ["v*.*.*"]` |
293
+ | Homebrew update fails | `HOMEBREW_TAP_TOKEN` secret not set |