exchange-github-oauth-code

Guidance for GitHub OAuth helper functions that create and check a temporary state value during sign-in. OAuth is a way for an application to let users sign in through another service such as GitHub.

In plain words
What is it for?
Use it when starting GitHub OAuth and when handling the redirect back from GitHub to validate the returned state.
Why use it?
Checking this state value helps ensure that the callback came from the sign-in flow the application started and helps prevent cross-site request forgery attacks.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jnzader/repoforge/github_oauth
Any agent
npx skills add JNZader/repoforge --skill github_oauth
Clone the repo
git clone --depth 1 https://github.com/JNZader/repoforge

Made for: Claude Code, Codex.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00438
Opus 5 $0.00015 $0.00219
Sonnet 5 $0.00006 $0.00088
Haiku 4.5 $0.00003 $0.00044

Measured 2d ago against content hash 855a2ab8f5ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

exchange-github-oauth-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/backend/github_oauth/SKILL.md · 83 lines

What it actually says

exchange-github-oauth-code

This skill covers the implementation of GitHub OAuth helper functions.

Trigger: Load this skill when handling GitHub OAuth processes.

Quick Reference

Task Pattern
Generate OAuth state generate_state()
Validate OAuth state validate_state()

Critical Patterns (Summary)

  • Generate OAuth state: Create a unique state parameter for OAuth flow.
  • Validate OAuth state: Ensure the state parameter matches the expected value.

Critical Patterns (Detailed)

Generate OAuth state

This function creates a unique state parameter to prevent CSRF attacks during the OAuth flow.

from apps.server.app.services.github_oauth import generate_state

state = generate_state()

Validate OAuth state

This function checks if the provided state matches the expected value to ensure the integrity of the OAuth process.

from apps.server.app.services.github_oauth import validate_state

is_valid = validate_state(received_state, expected_state)

When to Use

  • When initiating the GitHub OAuth flow to generate a state parameter.
  • When validating the state parameter after the user is redirected back from GitHub.

Commands

docker-compose up
python repoforge/cli.py

Anti-Patterns

Don't: Use hardcoded state values

Hardcoding state values can lead to security vulnerabilities and CSRF attacks.

# BAD
state = "fixed_state_value"
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 83 lines · 31 tokens per session scan A 855a2ab8f5ef

Subscribe to this mod's changes

exchange-github-oauth-code is a skill published in the GitHub repository JNZader/repoforge (5 stars, last pushed 8d ago), licensed MIT. It adds 31 tokens to every session and 438 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

html-ppt-zhangzara-neo-grid-bold

A designer's portfolio narrative for a senior interview — three case studies, the craft, and the judgment behind each. Built as a decision-grade career deck for hiring panel.

nexu-io/open-design · 47 tokens

html-ppt-zhangzara-capsule

A year-end self-review for a product manager — the role, the outcomes, the learning, and the ask, all evidence-backed. Built as a decision-grade career deck for manager, review committee.

nexu-io/open-design · 52 tokens

html-ppt-xhs-white-editorial

A staff-engineer promotion packet — scope, the proof moments, the artifacts, and the impact that clears the bar. Built as a decision-grade career deck for manager, calibration committee.

nexu-io/open-design · 46 tokens

multi-program-manager

Manage and compare multiple affiliate programs as a portfolio. Triggers on: "manage my affiliate programs", "compare my programs", "portfolio overview", "which program should I focus on", "diversify my affiliate income", "program switching", "affiliate portfolio", "program comparison", "revenue allocation", "which…

Affitor/affiliate-skills · 82 tokens

tailwind-css-patterns

Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

figueroaignacio/ignaciofigueroa.dev · 62 tokens

criador-de-portfolio

Construção de portfólio profissional digital: seleção e apresentação de projetos, estrutura de cases com problema-solução-resultado, showcase de habilidades e estratégia de distribuição para atrair clientes e recrutadores.

ricneves-ai/flowgrammers-skills · 46 tokens