Published: https://clawhub.com/skills/token-management
Purpose: Centralize API token management - storage, testing, documentation, expiration tracking.
Triggers:
ALWAYS check ~/Documents/life/.env FIRST before asking for tokens!
cd ~/Documents/life && git add -A && git commit -m "Before updating TOKEN_NAME"~/Documents/life/.env (canonical location)SERVICE_NAME_TOKEN=value # Expires: YYYY-MM-DDWILEY_JIRA_TOKEN=abc123 # Expires: 2027-02-12When: 7 days before expiration (1 week warning)
Event: "⚠️ Renew [SERVICE] API token (expires in 7 days)"
Format: All-day event
Command: bash
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]"
Run test battery to discover what token can do
Script: Use template below (adapt per service)
Document results in connections/ file
Example: python
# 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}")
Create or update ~/Documents/life/connections/SERVICE.md
Include:
Link to .env variable name
Example: markdown
## Token Info
WILEY_JIRA_TOKEN (~/Documents/life/.env)6. **Update token index**
- Maintain list in this SKILL.md (see below)
### When needing API access:
1. **✅ ALWAYS check .env first:** `~/Documents/life/.env`
2. **If not found:** Check connections/ for setup instructions
3. **If still missing:** Ask Nicholas for token
* * *
## Token Index
**Location:** `~/Documents/life/.env`
**Example tokens:**
ServiceVariableScopeExpiresConnection DocFigma`FIGMA_TOKEN`read-writeYYYY-MM-DD[figma.md](/api/v1/skills/token-management/file?path=~%2FDocuments%2Flife%2Fconnections%2Ffigma.md&ownerHandle=nonlinear)Jira`JIRA_TOKEN`read-writeYYYY-MM-DD[jira.md](/api/v1/skills/token-management/file?path=~%2FDocuments%2Flife%2Fconnections%2Fjira.md&ownerHandle=nonlinear)Slack`SLACK_TOKEN`bot permissionsNever[slack.md](/api/v1/skills/token-management/file?path=~%2FDocuments%2Flife%2Fconnections%2Fslack.md&ownerHandle=nonlinear)GitHub`GITHUB_TOKEN`repo, gistYYYY-MM-DD[github.md](/api/v1/skills/token-management/file?path=~%2FDocuments%2Flife%2Fconnections%2Fgithub.md&ownerHandle=nonlinear)
**Your index:** Keep your own list in this section (local copy of skill).
* * *
## Commands
### Add token
bash
```bash
# Append to .env (skill will automate)
echo "SERVICE_TOKEN=value" >> ~/Documents/life/.env
bash
grep SERVICE_TOKEN ~/Documents/life/.env
bash
cat ~/Documents/life/.env
Canonical location: ~/Documents/life/.env
Why here:
Python usage:
python
from dotenv import load_dotenv
load_dotenv('~/Documents/life/.env') # Or absolute path
Shell usage:
bash
source ~/Documents/life/.env
echo $YOUR_TOKEN_NAME
Created: 2026-02-12
Updated: 2026-02-13 (sanitized for publication)