Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides auth patterns for API keys, OAuth, and token management. Use when implementing or reviewing service authentication and credential handling.
.claude/skills/athola-authentication-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 5% | 0% |
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 |
pythonfrom leyline.auth import verify_auth, AuthMethod # 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.
pythondef 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.
pythondef 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.
pythondef 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.
pythondef 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.
yaml# 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:
bash# 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.
modules/auth-methods.md for method detailsmodules/verification-patterns.md for testing patternsmodules/interactive-auth.md for shell-based auth flows| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 23,708 | 11,775 | -50% | 1 | 1 | 0% | 4,814 | 3,701 | -23% | 0 | 0 | — |
case-02 | fail→pass | 13,071 | 5,607 | -57% | 1 | 1 | 0% | 2,429 | 2,180 | -10% | 0 | 0 | — |
case-03 | fail→fail | 21,393 | 16,245 | -24% | 1 | 1 | 0% | 4,265 | 4,418 | +4% | 0 | 0 | — |
case-04 | pass→pass | 17,998 | 7,918 | -56% | 1 | 1 | 0% | 3,347 | 2,498 | -25% | 0 | 0 | — |
case-05 | pass→pass | 15,214 | 13,494 | -11% | 1 | 1 | 0% | 2,772 | 3,690 | +33% | 0 | 0 | — |
case-06 | pass→pass | 14,859 | 13,152 | -11% | 1 | 1 | 0% | 2,908 | 3,877 | +33% | 0 | 0 | — |
case-07 | fail→pass | 8,811 | 2,252 | -74% | 1 | 1 | 0% | 1,584 | 1,492 | -6% | 0 | 0 | — |
case-08 | fail→pass | 7,887 | 3,164 | -60% | 1 | 1 | 0% | 1,475 | 1,551 | +5% | 0 | 0 | — |
case-09 | pass→pass | 14,366 | 9,065 | -37% | 1 | 1 | 0% | 3,139 | 3,030 | -3% | 0 | 0 | — |
case-10 | fail→pass | 18,005 | 7,606 | -58% | 1 | 1 | 0% | 3,284 | 2,753 | -16% | 0 | 0 | — |
case-11 | fail→pass | 8,059 | 1,657 | -79% | 1 | 1 | 0% | 1,351 | 1,413 | +5% | 0 | 0 | — |
case-12 | fail→pass | 10,556 | 1,303 | -88% | 1 | 1 | 0% | 1,752 | 1,308 | -25% | 0 | 0 | — |
case-13 | fail→pass | 9,953 | 3,119 | -69% | 1 | 1 | 0% | 1,856 | 1,630 | -12% | 0 | 0 | — |
case-14 | fail→fail | 9,228 | 11,336 | +23% | 1 | 1 | 0% | 1,839 | 3,520 | +91% | 0 | 0 | — |
case-15 | pass→pass | 6,434 | 4,341 | -33% | 1 | 1 | 0% | 1,105 | 1,988 | +80% | 0 | 0 | — |
case-16 | fail→pass | 15,017 | 1,698 | -89% | 1 | 1 | 0% | 2,516 | 1,410 | -44% | 0 | 0 | — |
case-17 | pass→pass | 17,059 | 2,003 | -88% | 1 | 1 | 0% | 1,434 | 1,449 | +1% | 0 | 0 | — |
case-18 | fail→pass | 8,984 | 1,679 | -81% | 1 | 1 | 0% | 1,478 | 1,391 | -6% | 0 | 0 | — |
case-19 | fail→pass | 8,561 | 2,333 | -73% | 1 | 1 | 0% | 1,522 | 1,508 | -1% | 0 | 0 | — |
case-20 | pass→pass | 12,326 | 4,484 | -64% | 1 | 1 | 0% | 2,096 | 1,843 | -12% | 0 | 0 | — |
case-21 | fail→pass | 11,385 | 3,797 | -67% | 1 | 1 | 0% | 1,865 | 1,768 | -5% | 0 | 0 | — |
case-22 | fail→pass | 8,199 | 1,778 | -78% | 1 | 1 | 0% | 1,392 | 1,430 | +3% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +55 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.