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.
npx agentmods add commands/sairam0424/mindforge/auth-flowgit clone --depth 1 https://github.com/sairam0424/MindForgeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/sairam0424/mindforge/auth-flow)<a href="https://agentmods.dev/commands/sairam0424/mindforge/auth-flow"><img src="https://agentmods.dev/badge/commands/sairam0424/mindforge/auth-flow.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00039 | $0.01047 |
| Opus 5 | $0.00019 | $0.00524 |
| Sonnet 5 | $0.00008 | $0.00209 |
| Haiku 4.5 | $0.00004 | $0.00105 |
Grade A, and why
auth-flow 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<execution_context> @.mindforge/skills/auth-patterns/SKILL.md </execution_context>
-
Select authn flow: Based on --type flag or client analysis:
- OAuth2 + PKCE (for SPAs/mobile): Authorization Code flow with PKCE, no client secret exposed
- Session-based (for server-rendered): HTTP-only secure cookies, server-side session store
- JWT (for APIs/microservices): Signed tokens with short expiry, refresh token rotation
- For each: document the full flow (request → redirect → callback → token → validation)
- Specify token storage location (httpOnly cookie, secure storage, never localStorage)
- Define logout mechanism (token revocation, session invalidation, cookie clearing)
-
Design token lifecycle: Define the token management:
- Access token: short-lived (15 min), contains minimal claims (sub, scope, exp)
- Refresh token: longer-lived (7 days), rotated on each use (detect theft via reuse)
- ID token: user profile claims, validated once at login
- Token revocation: maintain revocation list or use short expiry + refresh
- Token validation: signature check → expiry check → issuer check → audience check
- Clock skew tolerance: 30 seconds maximum
-
Add MFA if needed: When --mfa flag is set:
- Primary factors: password (argon2id hash), social login (OAuth2)
- Second factors: TOTP (authenticator app), WebAuthn (hardware key), SMS (fallback only)
- Step-up auth: require MFA for sensitive operations (password change, payment, admin)
- Recovery: backup codes (10 single-use), admin override with audit log
- Enrollment flow: optional at signup, required for admin/elevated roles
- Remember device: trust for 30 days with device fingerprint
-
Design authz model: Based on --authz flag:
- RBAC (Role-Based): Define roles (admin, editor, viewer) → map to permissions → assign to users
- ABAC (Attribute-Based): Define policies based on subject attributes, resource attributes, action, and context
- Permission granularity: resource-level (can edit ANY post) vs instance-level (can edit OWN posts)
- Inheritance: role hierarchy (admin inherits editor permissions)
- Deny-by-default: all access denied unless explicitly granted
- Policy evaluation: eager (at login, cache in token) vs lazy (at access time, check service)
- Group-based: assign roles to groups, users inherit from groups
-
Implement: Translate design to code:
- Auth middleware: validate token on every request, attach user context
- Permission check: decorator/middleware pattern at route or controller level
- Service-to-service: mutual TLS or signed JWT with service identity
- Rate limiting: per-user and per-IP on auth endpoints (prevent brute force)
- Audit logging: log every auth event (login, logout, failure, permission denied, MFA challenge)
- Error responses: generic messages (never reveal "user not found" vs "wrong password")
-
Audit: Validate the auth implementation:
- OWASP Authentication Cheat Sheet compliance
- Session fixation protection (regenerate session ID on login)
- CSRF protection on state-changing endpoints (SameSite cookies + CSRF token)
- Credential stuffing protection (rate limiting, CAPTCHA after N failures)
- Token leakage vectors (URL parameters, referrer headers, logs)
- Privilege escalation paths (horizontal: access other user data, vertical: gain admin)
- Output: security assessment report with findings and remediation
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.
- yesterday First seen · 77 lines · 39 tokens per session scan A 7fa4d95ec734
auth-flow is a command published in the GitHub repository sairam0424/MindForge (0 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,047 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-09-03.
Other commands, from other repositories
factory-report
Linear status report across configured repos — queue depth, triage backlog, ready-to-dispatch, blocked/held.
factory-sweep
Find Linear tickets that have gone obsolete (duplicate, already shipped, overtaken by events) and retire them with evidence.
vichu
Start or continue a verified VichuFlow run for a task.
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.