Skill站外收录 @skilllib/skill-2117939930272414779
tier-management
负责评估和调整用户等级,根据 GitHub 贡献、项目展示、购买行为等维度自动识别符合条件的开发者,并支持单个或批量升级用户至对应等级,同步更新数据库权限与 Polar 订阅状态,同时提供余额查询和异常用户筛选能力。
效率工具 AI 技能
Skills.MD
# Requirements
Before using this skill, ensure you have:
- **GitHub CLI**: `brew install gh && gh auth login`
- **Node.js/npx**: `brew install node`
- **Wrangler**: `npm install -g wrangler`
- **jq**: `brew install jq` (for parsing JSON)
- **sops**: `brew install sops` (for decrypting secrets)
Must run from the `pollinations` repo root with access to `enter.pollinations.ai/`.
---
# Tier Levels
| Tier | Emoji | Pollen/Day | Criteria |
|------|-------|------------|----------|
| spore | 🍄 | 1 | Default (new signups) |
| seed | 🌱 | 3 | GitHub engagement |
| flower | 🌸 | 10 | Contributed code/project |
| nectar | 🍯 | 20 | Strategic partners |
| router | 🔌 | 100 | Infrastructure partners |
---
# Upgrade Paths
## 🍄 Spore → 🌱 Seed
- ⭐ Starred the pollinations repo
- 💬 Opened an issue or PR
- 💳 Made a purchase
## 🌱 Seed → 🌸 Flower
- 🛠️ Pushed code to pollinations/pollinations
- 📦 Has a project in our showcase
- 🌐 Built something open-source using our API
---
# Evaluate User Tier
## Check for Flower (any ONE qualifies)
**Has commits to pollinations?**
```bash
gh api 'search/commits?q=repo:pollinations/pollinations+author:USERNAME' --jq '.total_count'
```
**Has a project in our lists?**
```bash
grep -ri "author.*USERNAME" pollinations.ai/src/config/projects/
```
## Check for Seed (any ONE qualifies)
**Involved in issues/PRs?**
```bash
gh api 'search/issues?q=repo:pollinations/pollinations+involves:USERNAME' --jq '.total_count'
```
**Starred repo?**
```bash
.claude/skills/tier-management/scripts/fetch-stargazers.sh USERNAME
```
---
# Update User Tier
> ⚠️ **IMPORTANT**: You MUST update BOTH the database AND Polar subscription.
> The DB tier controls what tier the user CAN activate. The Polar subscription is what they HAVE activated.
## Recommended: Use the Script
```bash
.claude/skills/tier-management/scripts/update-tier.sh USERNAME TIER
```
**Example:**
```bash
.claude/skills/tier-management/scripts/update-tier.sh s0974092 flower
```
This script automatically:
1. Finds the user by username or email
2. Updates the database tier
3. Updates the Polar subscription (via sops for auth)
4. Verifies the change
## Manual Method
### Step 1: Find user
```bash
cd enter.pollinations.ai
npx wrangler d1 execute DB --remote --env production \
--command "SELECT id, github_username, email, tier FROM user WHERE LOWER(github_username) LIKE '%USERNAME%';"
```
### Step 2: Update database
```bash
npx wrangler d1 execute DB --remote --env production \
--command "UPDATE user SET tier='TIER' WHERE github_username='USERNAME';"
```
### Step 3: Update Polar subscription
```bash
export POLAR_ACCESS_TOKEN=$(sops -d secrets/prod.vars.json | grep POLAR_ACCESS_TOKEN | cut -d'"' -f4)
npx tsx scripts/manage-polar.ts user update-tier --email USER_EMAIL --tier TIER
```
Add `--dryRun` to preview changes without applying.
## Step 4: Notify user on GitHub
```
🎉 **Tier Upgrade Complete!**
Hey @USERNAME! You've been upgraded to **[EMOJI] [TIER] tier**! ✨
Your benefits:
- [POLLEN] pollen/day
- ⚡ Priority queue
- 🎨 All standard models
Thanks for being part of Pollinations! 🚀
```
---
# Batch Processing
## Find Users with Billing Issues
Use the model-debugging skill to find users hitting 402 errors (billing/quota):
```bash
# Find spore-tier users with >10 402 errors in last 24 hours
.claude/skills/model-debugging/scripts/find-402-users.sh 24 10 spore
# Save to file for batch processing
.claude/skills/model-debugging/scripts/find-402-users.sh 24 10 spore | cut -f1 > /tmp/users.txt
```
> **Note**: 402 = billing issues (pollen balance, key budget). 403 = permission issues (model access denied).
## Check if User is a Developer
```bash
# Check single user
.claude/skills/tier-management/scripts/check-github-dev.sh OliverCWY
# Output: dev: repos=12 followers=13 account_year=2017
```
## Batch Upgrade Devs to Seed
```bash
# Dry run first (no changes)
.claude/skills/tier-management/scripts/upgrade-devs.sh /tmp/users.txt --dry-run
# Apply upgrades
.claude/skills/tier-management/scripts/upgrade-devs.sh /tmp/users.txt
```
The script:
- Checks GitHub profile for dev activity (repos, followers, account age)
- Only upgrades users currently on spore tier (won't downgrade)
- Has 2s delay between GitHub API calls to avoid rate limiting
- Shows summary of upgraded/skipped users
## Check User Balance
```bash
.claude/skills/tier-management/scripts/check-user-balance.sh username_or_email
```
## Legacy Batch Evaluate
```bash
export ENTER_ADMIN_TOKEN=your_token
export TIER_EVAL_GIST_ID=your_gist_id # optional
.claude/skills/tier-management/scripts/batch-evaluate.sh
```
---
# Polar Product IDs (Production)
| Tier | Product ID |
|------|------------|
| Spore | `01a31c1a-7af7-4958-9b73-c10e2fac5f70` |
| Seed | `fe32ee28-c7c4-4e7a-87fa-6ffc062e3658` |
| Flower | `dfb4c4f6-2004-4205-a358-b1f7bb3b310e` |
| Nectar | `066f91a4-8ed1-4329-b5f7-3f71e992ed28` |
| Router | `0286ea62-540f-4b19-954f-b8edb9095c43` |
---
# Notes
- DB tier = what user CAN activate
- Polar subscription = what user HAS activated
- If no Polar subscription, user must click "Activate" at enter.pollinations.ai
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「tier-management」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次