tier-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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/
.

使用本技能前,请确保你已安装:
  • GitHub CLI
    brew install gh && gh auth login
  • Node.js/npx
    brew install node
  • Wrangler
    npm install -g wrangler
  • jq
    brew install jq
    (用于解析JSON)
  • sops
    brew install sops
    (用于解密密钥)
必须在
pollinations
仓库根目录运行,且拥有
enter.pollinations.ai/
的访问权限。

Tier Levels

层级等级

TierEmojiPollen/DayCriteria
microbe🦠0.1Entry tier (auto-upgrades once verified)
spore🍄1Verified accounts
seed🌱3GitHub engagement
flower🌸10Contributor
nectar🍯20Coming soon

层级表情每日花粉量达标条件
microbe🦠0.1入门层级(验证后自动升级)
spore🍄1已验证账户
seed🌱3GitHub互动记录
flower🌸10贡献者
nectar🍯20即将推出

Upgrade Paths

升级路径

🍄 Spore → 🌱 Seed

🍄 Spore层级 → 🌱 Seed层级

  • ⭐ Starred the pollinations repo
  • 💬 Opened an issue or PR
  • 💳 Made a purchase
  • ⭐ 已为pollinations仓库点亮星标
  • 💬 提交过issue或PR
  • 💳 有过购买记录

🌱 Seed → 🌸 Flower

🌱 Seed层级 → 🌸 Flower层级

  • 🛠️ Pushed code to pollinations/pollinations
  • 📦 Has a project in our showcase
  • 🌐 Built something open-source using our API

  • 🛠️ 向pollinations/pollinations仓库推送过代码
  • 📦 项目已收录至我们的展示列表
  • 🌐 基于我们的API开发过开源项目

Evaluate User Tier

评估用户层级

Check for Flower (any ONE qualifies)

检查是否符合Flower层级(满足任意一项即可)

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/
是否向pollinations仓库提交过代码?
bash
gh api 'search/commits?q=repo:pollinations/pollinations+author:USERNAME' --jq '.total_count'
项目是否在我们的列表中?
bash
grep -ri "author.*USERNAME" pollinations.ai/src/config/projects/

Check for Seed (any ONE qualifies)

检查是否符合Seed层级(满足任意一项即可)

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

是否参与过issue/PR?
bash
gh api 'search/issues?q=repo:pollinations/pollinations+involves:USERNAME' --jq '.total_count'
是否为仓库点亮星标?
bash
.claude/skills/tier-management/scripts/fetch-stargazers.sh USERNAME

Update User Tier

更新用户层级

How Tiers Work Now

当前层级机制

  • Tier balance refills daily at midnight UTC via Cloudflare cron trigger
  • No rollover - balance resets to tier amount each day
  • Just update D1 - no external subscription system needed
  • 层级余额每日重置:通过Cloudflare定时触发器在UTC时间午夜重置
  • 不结转:每日余额重置为对应层级的额度
  • 仅需更新D1数据库:无需外部订阅系统

Quick Update

快速更新流程

Step 1: Find user

步骤1:查找用户

bash
cd enter.pollinations.ai
npx wrangler d1 execute DB --remote --env production \
  --command "SELECT id, github_username, email, tier, tier_balance FROM user WHERE LOWER(github_username) LIKE '%USERNAME%';"
bash
cd enter.pollinations.ai
npx wrangler d1 execute DB --remote --env production \
  --command "SELECT id, github_username, email, tier, tier_balance FROM user WHERE LOWER(github_username) LIKE '%USERNAME%';"

Step 2: Update tier

步骤2:更新层级

bash
npx wrangler d1 execute DB --remote --env production \
  --command "UPDATE user SET tier='TIER' WHERE github_username='USERNAME';"
Balance will update automatically at next midnight UTC refill.
bash
npx wrangler d1 execute DB --remote --env production \
  --command "UPDATE user SET tier='TIER' WHERE github_username='USERNAME';"
余额将在下次UTC时间午夜的自动重置时更新。

Step 3 (Optional): Immediate balance update

步骤3(可选):立即更新余额

bash
undefined
bash
undefined

Set balance immediately (e.g., flower = 10 pollen)

立即设置余额(例如,flower层级=10花粉)

npx wrangler d1 execute DB --remote --env production
--command "UPDATE user SET tier='flower', tier_balance=10 WHERE github_username='USERNAME';"
npx wrangler d1 execute DB --remote --env production
--command "UPDATE user SET tier='flower', tier_balance=10 WHERE github_username='USERNAME';"

Step 4: Notify user on GitHub

步骤4:在GitHub通知用户

🎉 **Tier Upgrade!**

Hey @USERNAME! You've been upgraded to **[EMOJI] [TIER] tier**! ✨

Your benefits:
- [POLLEN] pollen/day (refills daily at midnight UTC)
- 🎨 All standard models

Thanks for being part of pollinations.ai! 🚀

🎉 **层级升级通知!**

嗨 @USERNAME!你已升级为 **[表情] [层级名称] 层级**! ✨

你将获得以下权益:
- 每日[花粉量]花粉(UTC时间午夜自动重置)
- 🎨 可使用所有标准模型

感谢你加入pollinations.ai! 🚀

Batch Processing

批量处理

Find Users with Billing Issues

查找存在账单问题的用户

Use the model-debugging skill to find users hitting 402 errors (billing/quota):
bash
undefined
使用model-debugging技能查找遇到402错误(账单/配额问题)的用户:
bash
undefined

Find spore-tier users with >10 402 errors in last 24 hours

查找过去24小时内出现10次以上402错误的spore层级用户

.claude/skills/model-debugging/scripts/find-402-users.sh 24 10 spore
.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).
.claude/skills/model-debugging/scripts/find-402-users.sh 24 10 spore | cut -f1 > /tmp/users.txt

> **注意**:402错误表示账单问题(花粉余额、密钥预算不足)。403错误表示权限问题(模型访问被拒绝)。

Check if User is a Developer

检查用户是否为开发者

bash
undefined
bash
undefined

Check single user

检查单个用户

.claude/skills/tier-management/scripts/check-github-dev.sh OliverCWY
.claude/skills/tier-management/scripts/check-github-dev.sh OliverCWY

Output: dev: repos=12 followers=13 account_year=2017

输出示例:dev: repos=12 followers=13 account_year=2017

undefined
undefined

Batch Upgrade Devs to Seed

批量将开发者升级至Seed层级

bash
undefined
bash
undefined

Dry run first (no changes)

先执行试运行(不实际修改)

.claude/skills/tier-management/scripts/upgrade-devs.sh /tmp/users.txt --dry-run
.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
.claude/skills/tier-management/scripts/upgrade-devs.sh /tmp/users.txt

该脚本功能:
- 检查GitHub资料中的开发者活动(仓库数量、关注者数量、账户注册时长)
- 仅升级当前为spore层级的用户(不会降级)
- GitHub API调用之间有2秒延迟,避免触发速率限制
- 显示升级/跳过用户的汇总信息

Check User Balance

检查用户余额

bash
.claude/skills/tier-management/scripts/check-user-balance.sh username_or_email
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

bash
export ENTER_ADMIN_TOKEN=your_token
export TIER_EVAL_GIST_ID=your_gist_id  # 可选
.claude/skills/tier-management/scripts/batch-evaluate.sh

Key Files

关键文件

FilePurpose
enter.pollinations.ai/src/tier-config.ts
Tier → pollen mapping (source of truth)
enter.pollinations.ai/src/scheduled.ts
Cron handler: daily refill
enter.pollinations.ai/src/auth.ts
Sets tier on new user registration
enter.pollinations.ai/wrangler.toml
Cron schedule:
0 0 * * *

文件用途
enter.pollinations.ai/src/tier-config.ts
层级→花粉量映射(权威配置源)
enter.pollinations.ai/src/scheduled.ts
定时任务处理器:每日余额重置
enter.pollinations.ai/src/auth.ts
新用户注册时设置初始层级
enter.pollinations.ai/wrangler.toml
定时任务调度:
0 0 * * *

Notes

注意事项

  • Tier balance resets daily at midnight UTC (no rollover)
  • New users get
    spore
    tier + 1 pollen immediately
  • Tier upgrades take effect on next refill (or set
    tier_balance
    manually)
  • 层级余额每日重置:UTC时间午夜重置(不结转)
  • 新用户自动获得
    spore
    层级+1花粉额度
  • 层级升级将在下次余额重置时生效(或手动设置
    tier_balance
    立即生效)