token-management
Centralized API token management workflow. Store tokens in .env with expiration dates, test permissions via script battery, document capabilities in connections/, set calendar renewal reminders. Prevents re-asking for credentials, ensures token security, tracks expiration.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- token-management
- type
- public
- author
- nonlinear
- status
- published
- license
- MIT
- version
- 1.0.1
- description
- Centralized API token management workflow. Store tokens in .env with expiration dates, test permissions via script battery, document capabilities in connections/, set calendar renewal reminders. Prevents re-asking for credentials, ensures token security, tracks expiration.
- dependencies
- [ "python3", "requests", "gog (for calendar reminders)" ]
03 SKILL.md 正文
Token Management
Published: https://clawhub.com/skills/token-management
Purpose: Centralize API token management - storage, testing, documentation, expiration tracking.
Triggers:
- "adiciona token X"
- "salva API key pra Y"
- "preciso de token Z"
🔴 CRITICAL RULE
ALWAYS check ~/Documents/life/.env FIRST before asking for tokens!
Workflow
When receiving a new token:
-
Git commit (if applicable)
- If .env is in a git repo:
cd ~/Documents/life && git add -A && git commit -m "Before updating TOKEN_NAME" - Safety first!
- If .env is in a git repo:
-
Ask for expiration date
- "Quando esse token expira?"
- Format: YYYY-MM-DD or "1 year" / "never"
-
Store in .env
- Location:
~/Documents/life/.env(canonical location) - Format:
SERVICE_NAME_TOKEN=value # Expires: YYYY-MM-DD - Example:
WILEY_JIRA_TOKEN=abc123 # Expires: 2027-02-12
- Location:
-
Create calendar reminder (if expires)
- When: 7 days before expiration (1 week warning)
- Event: "⚠️ Renew [SERVICE] API token (expires in 7 days)"
- Format: All-day event
- Command:
gog calendar create primary \ --summary "⚠️ Renew SERVICE token" \ --from "YYYY-MM-DDT00:00:00-05:00" \ --to "YYYY-MM-DDT23:59:59-05:00" \ --description "Token expires YYYY-MM-DD. Renew at: [RENEWAL_URL]"
-
Test token permissions
- Run test battery to discover what token can do
- Script: Use template below (adapt per service)
- Document results in connections/ file
- Example:
# Test Jira token import requests, base64 TOKEN = "..." EMAIL = "user@example.com" auth = base64.b64encode(f"{EMAIL}:{TOKEN}".encode()).decode() tests = [ ("Get user", "GET", "/rest/api/3/myself"), ("List projects", "GET", "/rest/api/3/project"), ("Search issues", "GET", "/rest/api/3/search", {"jql": "assignee=currentUser()"}), ] for name, method, endpoint, *params in tests: r = requests.get(f"https://DOMAIN{endpoint}", headers={'Authorization': f'Basic {auth}'}, params=params[0] if params else None) print(f"{'✅' if r.ok else '❌'} {name}: {r.status_code}")
-
Document in connections/
- Create or update
~/Documents/life/connections/SERVICE.md - Include:
- What token offers (read/write/scope)
- When obtained: YYYY-MM-DD
- Expiry date: YYYY-MM-DD
- Renewal link: URL to get new token
- How to use (code examples)
- Link to .env variable name
- Example:
## Token Info - **Obtained:** 2026-02-12 - **Expires:** 2027-02-12 - **Renew at:** https://id.atlassian.com/manage-profile/security/api-tokens - **Scope:** read-write - **Variable:** `WILEY_JIRA_TOKEN` (~/Documents/life/.env)
- Create or update
-
Update token index
- Maintain list in this SKILL.md (see below)
When needing API access:
- ✅ ALWAYS check .env first:
~/Documents/life/.env - If not found: Check connections/ for setup instructions
- If still missing: Ask Nicholas for token
Token Index
Location: ~/Documents/life/.env
Example tokens:
| Service | Variable | Scope | Expires | Connection Doc |
|---|---|---|---|---|
| Figma | FIGMA_TOKEN |
read-write | YYYY-MM-DD | figma.md |
| Jira | JIRA_TOKEN |
read-write | YYYY-MM-DD | jira.md |
| Slack | SLACK_TOKEN |
bot permissions | Never | slack.md |
| GitHub | GITHUB_TOKEN |
repo, gist | YYYY-MM-DD | github.md |
Your index: Keep your own list in this section (local copy of skill).
Commands
Add token
# Append to .env (skill will automate)
echo "SERVICE_TOKEN=value" >> ~/Documents/life/.env
Check token exists
grep SERVICE_TOKEN ~/Documents/life/.env
List all tokens
cat ~/Documents/life/.env
.env Location
Canonical location: ~/Documents/life/.env
Why here:
- ✅ Life infrastructure (shareable, public)
- ✅ Survives workspace wipes
- ✅ Consistent with connections/ folder
- ✅ Not tied to OpenClaw workspace
Python usage:
from dotenv import load_dotenv
load_dotenv('~/Documents/life/.env') # Or absolute path
Shell usage:
source ~/Documents/life/.env
echo $YOUR_TOKEN_NAME
Created: 2026-02-12
Updated: 2026-02-13 (sanitized for publication)
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.