/pepe-operator-craft:oauth-callback-resiliencefrom pepe-operator-craft
When integrating with services that use OAuth callbacks, handle the failure modes that aren't in the happy-path docs — state mismatch, expired authorization codes, network interruption mid-callback — and persist enough state to recover. Use when wiring any third-party OAuth flow into an agent-managed pipeline.
Ships in pepe-operator-craft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Principle: When you spin up a temporary local web server to receive an OAuth callback, it must survive being hit by random crawlers, probes, and redirects without dying.
OAuth flows commonly work like this:
localhost:<port>http://localhost:<port>/callback?code=...The fragile spot is step 2-3: between starting the server and the user clicking approve, the server is publicly reachable (kind of — at least for the duration). Things that can hit it:
If your server crashes, closes early, or 500's on these probes, the actual callback never lands and the user gets stuck.
process.exit() or close on the first request. Wait for the request that actually contains a valid code parameter and the matching state value.// ❌ DON'T DO THIS
const server = http.createServer((req, res) => {
const code = url.parse(req.url).query.code
exchange(code).then(...)
res.end('done')
server.close() // first request closes the server
})
// ✅ DO THIS
const server = http.createServer((req, res) => {
const parsed = url.parse(req.url, true)
if (!parsed.query.code || parsed.query.state !== expectedState) {
res.writeHead(400)
res.end('Not the callback. Try again.')
return // don't close
}
exchange(parsed.query.code).then(...)
res.end('Success! You can close this tab.')
server.close() // close only after the real callback
})
Built X (Twitter) integration on 2026-05-05. Initial naive callback server crashed when a probe hit it before the user clicked approve, killing the entire OAuth flow. Pattern fixed in integrations/x/lib/oauth.js.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub helmut-hoffer-von-ankershoffen/helmguild-plugins --plugin pepe-operator-craft12 skills in this plugin
/bilingual-language-defaultsRespond in the language the operator wrote in; mirror their register; never auto-switch languages mid-thread. Use when serving an operator who works in two or more languages, to avoid the friction of an unexpected language flip./compartmentalizationKnowledge picked up while serving one human stays with that human; never surface it to another operator, even by accident, even when both are working on related problems. Use whenever you serve more than one human across the same runtime — the privacy invariant is load-bearing./messaging-buffer-limitsOutbound messages on Telegram, WhatsApp, iMessage etc. have per-message size limits (~4096 chars on Telegram, ~1000 on iMessage threads); split long responses into coherent chunks at sentence boundaries, never mid-word, and indicate continuation. Use when you have a long response to send over a messaging surface./obsidian-tasks-formatWhen writing tasks into an Obsidian vault, use the Obsidian Tasks plugin's emoji-coded format ( 📅 due, 🛫 start, ✅ done, 🔁 recurrence) so queries and reviews work without manual reformatting. Use when capturing a follow-up, deadline, or recurring chore into the operator's vault./platform-mention-handlesWhen mentioning a human or brand on a publishing surface (Instagram, X, LinkedIn, blog), always use that platform's canonical handle (`@helmuthva` on X, the link on LinkedIn, etc.); never the bare name or a wrong-platform handle. Use when drafting any cross-channel post that mentions a person or brand./push-back-honestlyWhen the operator asks for something that's wrong, infeasible, or carries hidden cost, say so plainly and propose an alternative — never silently comply, never softball the disagreement. Use when an instruction collides with a known constraint, a project rule, or your own honest read of the trade-off.