claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops;…
Provides auth patterns for API keys, OAuth, and token management. Use when implementing or reviewing service authentication and credential handling.
Claude Code
$ npx -y skills add athola/claude-night-market --skill authentication-patterns --agent claude-code
Codex
$ npx skills add athola/claude-night-market --skill authentication-patterns -a codex -y
Cursor
$ npx skills add athola/claude-night-market --skill authentication-patterns -a cursor -y
Gemini CLI
$ npx skills add athola/claude-night-market --skill authentication-patterns -a gemini-cli -y
GitHub Copilot
$ npx skills add athola/claude-night-market --skill authentication-patterns -a github-copilot -y
OpenCode
$ npx skills add athola/claude-night-market --skill authentication-patterns -a opencode -y
Windsurf
$ npx skills add athola/claude-night-market --skill authentication-patterns -a windsurf -y
name: authentication-patterns description: Provides auth patterns for API keys, OAuth, and token management. Use when implementing or reviewing service authentication and credential handling. alwaysApply: false category: infrastructure tags: - authentication - api-keys - oauth - tokens - security dependencies: - error-patterns provides: infrastructure: - authentication - credential-management - auth-verification patterns: - api-key-auth - oauth-flow - token-refresh usage_patterns: - service-authentication - credential-verification - token-management complexity: beginner estimated_tokens: 400 progressive_loading: true modules: - modules/auth-methods.md - modules/verification-patterns.md - modules/interactive-auth.md
Common authentication patterns for integrating with external services. Provides consistent approaches to credential management, verification, and error handling.
| Method | Best For | Environment Variable | |--------|----------|---------------------| | API Key | Simple integrations | `{SERVICE}_API_KEY` | | OAuth | User-authenticated | Browser-based flow | | Token | Session-based | `{SERVICE}_TOKEN` | | None | Public APIs | N/A |
# Sketch: implement verify_auth and AuthMethod in your plugin.
# leyline ships no auth module.
# API Key verification
status = verify_auth(
service="gemini", method=AuthMethod.API_KEY, env_var="GEMINI_API_KEY"
)
if not status.authenticated:
print(f"Auth failed: {status.message}")
print(f"Action: {status.suggested_action}")**Verification:** Run the command with `--help` flag to verify availability.
def verify_with_smoke_test(service: str) -> bool:
"""Verify auth with simple request."""
result = execute_simple_request(service, "ping")
return result.success**Verification:** Run `pytest -v` to verify tests pass.
def check_credentials(service: str, env_var: str) -> bool:
value = os.getenv(env_var)
if not value:
print(f"Missing {env_var}")
return False
return True**Verification:** Run the command with `--help` flag to verify availability.
def verify_with_service(service: str) -> AuthStatus:
result = subprocess.run([service, "auth", "status"], capture_output=True)
return AuthStatus(
authenticated=(result.returncode == 0), message=result.stdout.decode()
)**Verification:** Run the command with `--help` flag to verify availability.
def handle_auth_failure(service: str, method: AuthMethod) -> str:
actions = {
AuthMethod.API_KEY: f"Set {service.upper()}_API_KEY environment variable",
AuthMethod.OAUTH: f"Run '{service} auth login' for browser auth",
AuthMethod.TOKEN: f"Refresh token with '{service} token refresh'",
}
return actions[method]**Verification:** Run the command with `--help` flag to verify availability.
# In your skill's frontmatter dependencies: [leyline:authentication-patterns]
**Verification:** Run the command with `--help` flag to verify availability.
For workflows requiring interactive authentication with token caching and session management:
# Source the interactive auth script source plugins/leyline/scripts/interactive_auth.sh # Ensure authentication before proceeding ensure_auth github || exit 1 ensure_auth gitlab || exit 1 ensure_auth aws || exit 1 # Continue with authenticated operations gh pr view 123 glab issue list aws s3 ls
**Features:**
See `modules/interactive-auth.md` for complete documentation.
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops;…
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use…
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily…
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use…
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled…
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.