setup-api-keys
Skill2 starsChanged 9 months agoMITView on GitHub
Interactive API key resolution — guides users through fixing missing surgeon API keys with detected options
In this repository22 other files it gives its agents.
- ab-testingSkill
- ab-validateSkill
- architectural-gateSkill
- cardio-reviewSkill
- consensusSkill
- counter-positionSkill
- cross-examinationSkill
- direct-querySkill
- doc-organizerSkill
- integrity-checkSkill
- invariance-healthSkill
- narrate-surgerySkill
- neurologistSkill
- post-implementation-verificationSkill
- pre-implementation-reviewSkill
- probeSkill
- quality-gatesSkill
- researchSkill
- review-loopSkill
- sentinelSkill
- setup-teamSkill
- using-3-surgeonsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Only show options where the tool is actually available.
- Very specific: line 45
If uses_command: true (e.g., aws secretsmanager call in .zshrc):
- Very specific: line 52
If uses_command: false (plain value): The key was likely auto-resolved by diagnose_auth.
- Very specific: line 75
If metadata.exists: false: Ask user for the key value, then store:
- Distinctive: line 91
NEVER ask the user to paste a key in chat: Instead:
- Distinctive: line 102
If still failing, present remaining options
- Distinctive: line 103
If all options exhausted, explain degraded mode (2/3 surgeons)
- Distinctive: line 107
NEVER display or log the actual API key value
- Distinctive: line 108
If user accidentally pastes a key in chat, warn them to rotate it immediately
- Distinctive: line 109
Prefer Keychain/1Password over shell profile for persistence (encrypted at rest)
- Distinctive: line 110
All subprocess commands use 10s timeout
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Setup API Keys
When This Fires
probereturns a surgeon withstatus: "fail"and aremediationfield- Any tool returns an auth error mid-operation
- User asks about API key configuration
Flow
- Read the remediation plan from the probe/tool response
- Present options as a numbered list — only show sources where
available: true - Wait for user choice
- Execute the resolution based on choice
- Persist if requested — offer Keychain storage for future sessions
- Re-run probe to verify the fix worked
Presenting Options
Format the remediation.sources into a clear menu:
🔑 {surgeon} needs {key_name} ({provider}).
{N}. {source.description}
→ `{source.resolve_command}`
{N+1}. Switch to a local model (free, no API key needed)
→ Available: {local_alternatives list}
{N+2}. Paste a key manually
→ I'll store it securely (env var or Keychain)
{N+3}. Skip for now
→ {skip_option}Only show options where the tool is actually available. Don't show AWS if aws CLI isn't installed.
Executing Each Choice
Shell Profile (method: "shell_profile")
If uses_command: true (e.g., aws secretsmanager call in .zshrc):
# Run the export line to load the key
eval '{resolve_command}'Then verify with probe.
If uses_command: false (plain value):
The key was likely auto-resolved by diagnose_auth. Just re-probe.
AWS Secrets Manager (method: "aws_secretsmanager")
# Get the key value
KEY_VALUE=$(aws secretsmanager get-secret-value --secret-id {metadata.secret_id} --query SecretString --output text)
export {key_name}="$KEY_VALUE"Then offer: "Want me to add this to your shell profile for future sessions?"
1Password (method: "1password")
KEY_VALUE=$(op item get "{provider}" --fields credential)
export {key_name}="$KEY_VALUE"macOS Keychain (method: "keychain")
If metadata.exists: true:
KEY_VALUE=$(security find-generic-password -s {metadata.service} -w)
export {key_name}="$KEY_VALUE"If metadata.exists: false: Ask user for the key value, then store:
security add-generic-password -s {metadata.service} -a 3surgeons -w "{key_value}"Switch Provider (local alternative)
Edit ~/.3surgeons/config.yaml to point the surgeon at the local backend:
surgeons:
cardiologist:
provider: {detected.provider}
endpoint: {detected.endpoint}
model: {detected.models[0]}Manual Paste
NEVER ask the user to paste a key in chat. Instead:
# Guide them to set it in their environment
export {key_name}="your-key-here"
# Or store in Keychain
security add-generic-password -s 3surgeons-{surgeon} -a 3surgeons -w "your-key-here"After Resolution
- Re-run
probeto verify - If still failing, present remaining options
- If all options exhausted, explain degraded mode (2/3 surgeons)
Security Rules
- NEVER display or log the actual API key value
- If user accidentally pastes a key in chat, warn them to rotate it immediately
- Prefer Keychain/1Password over shell profile for persistence (encrypted at rest)
- All subprocess commands use 10s timeout
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

