Skip to content
Back to skills

Auth

ASecurity

Authenticate with GitHub via Device Flow — browser-based, no token copy-paste.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
securityshellnodegitapi

Works with

  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add fragcap/plugin --skill auth --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Auth?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Auth
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fragcap-auth/badge)](https://www.skillsdirectory.com/skills/fragcap-auth)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: auth
description: Authenticate with GitHub via Device Flow — browser-based, no token copy-paste.
---

# FragCap Authentication

Authenticate the user with GitHub using the App Device Flow. The entire flow happens in the browser — never ask the user to create or paste a token.

## Script Convention

All FragCap scripts output JSON to stdout and need the data directory. Run them as:

    FRAGCAP_DATA="${CLAUDE_PLUGIN_DATA}" node "${CLAUDE_PLUGIN_ROOT}/scripts/<name>.mjs" [args]

On Windows/PowerShell, use `$env:FRAGCAP_DATA="..."` syntax instead.

If a script exits with a non-zero code or returns `{ error: "..." }`, **stop immediately and surface the error to the user**. Never silently retry with a different command or skip the step.

## When to Activate

- User runs `/fragcap:auth`
- Another skill reports "not authenticated"

## Flow

1. **Check existing auth** — run: `FRAGCAP_DATA="${CLAUDE_PLUGIN_DATA}" node "${CLAUDE_PLUGIN_ROOT}/scripts/auth-status.mjs"`
   - If `authenticated: true` and not expired: tell the user they are already logged in as `@{username}` and stop.
   - If expired with refresh token available: inform the user their token will auto-refresh on next API call — no action needed.
   - Otherwise: proceed to step 2.

2. **Start Device Flow** — run: `FRAGCAP_DATA="${CLAUDE_PLUGIN_DATA}" node "${CLAUDE_PLUGIN_ROOT}/scripts/auth-start.mjs"`
   - This returns **immediately** with `verification_uri` and `user_code`.
   - Display them clearly to the user:
   ```
   Please visit: {verification_uri}
   Enter the code: {user_code}

   Waiting for authorization...
   ```

3. **Stop and wait for the user** — after displaying the URL and code, **do not poll**. Simply tell the user:
   ```
   After you've authorized in the browser, send me any message and I'll check the result.
   ```
   Then **end your turn**. Do not loop, sleep, or call auth-poll.mjs yet.

4. **Poll on user's next message** — when the user sends a follow-up message, run: `FRAGCAP_DATA="${CLAUDE_PLUGIN_DATA}" node "${CLAUDE_PLUGIN_ROOT}/scripts/auth-poll.mjs"` **once**.
   - `success: true` — confirm: "Authenticated as @{username}. You can now use /fragcap:push, /fragcap:list, and other commands."
   - `pending: true` — tell the user authorization hasn't completed yet, ask them to finish in the browser and send another message.
   - `success: false` with `error` — show the error message. If timeout or code expired, suggest running `/fragcap:auth` again.

## Important

- FragCap only requests **Gist read/write** permission — no repo access.
- The user token stays on their machine; it is never sent to any server other than `api.github.com`.
- Access token auto-expires in 8 hours; refresh token (valid 6 months) auto-refreshes it on next API call.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.