auth-system

auth-system is a skill for Claude Code from aAAaqwq/AGI-Super-Team. It costs 0 tokens per session (1,556 once invoked), scanned A, original, MIT.

A guide and implementation pattern for user authentication and authorisation, meaning checking who a user is and what they may do. It covers password handling, login sessions, JWT tokens, OAuth2 sign-in, and role-based access control.

In plain words
What is it for?
Use it to build sign-up and login flows, connect providers such as Google or GitHub, issue JWTs, manage sessions, hash passwords, and restrict features by role.
Why use it?
It helps developers avoid designing login and permission systems from scratch and addresses common concerns such as password storage, token handling, and access checks.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agi-super-team plugin — 192 skills, 1 agent shipped together

Good fit Use it to build sign-up and login flows, connect providers such as Google or GitHub, issue JWTs, manage sessions, hash passwords, and restrict features by role.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aaaaqwq/agi-super-team/auth-system
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.

Any agent
npx skills add aAAaqwq/AGI-Super-Team --skill auth-system
Clone the repo
git clone --depth 1 https://github.com/aAAaqwq/AGI-Super-Team

Made for: Claude Code.

Or install agi-super-team, the plugin that ships this one along with the rest of its 192 skills, 1 agent.

Wrote 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.

agentmods badge for auth-system

README.md
[![agentmods](https://agentmods.dev/badge/skills/aaaaqwq/agi-super-team/auth-system.svg)](https://agentmods.dev/skills/aaaaqwq/agi-super-team/auth-system)
Your own site
<a href="https://agentmods.dev/skills/aaaaqwq/agi-super-team/auth-system"><img src="https://agentmods.dev/badge/skills/aaaaqwq/agi-super-team/auth-system.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,556 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 225
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
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.1 $0.00000 $0.01556
Opus 5 $0.00000 $0.00778
Sonnet 5 $0.00000 $0.00311
Haiku 4.5 $0.00000 $0.00156

Measured 2d ago against content hash 06e41080e98b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

auth-system 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.

skills/auth-system/SKILL.md · 246 lines

How it starts

The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authentication System

Production-grade authentication and authorization implementation.

Authentication Strategies

1. JWT (Stateless)

const jwt = require('jsonwebtoken');
const bcrypt = require('bcrypt');

// Signup
async function signup(email, password) {
  const hashedPassword = await bcrypt.hash(password, 12);
  const user = await User.create({ email, password: hashedPassword });
  return generateTokens(user);
}

// Login
async function login(email, password) {
  const user = await User.findByEmail(email);
  if (!user || !await bcrypt.compare(password, user.password)) {
    throw new Error('Invalid credentials');
  }
  return generateTokens(user);
}

// Token generation
function generateTokens(user) {
  const accessToken = jwt.sign(
    { userId: user.id, role: user.role },
    process.env.JWT_SECRET,
    { expiresIn: '15m' }
  );
  
  const refreshToken = jwt.sign(
    { userId: user.id, tokenVersion: user.tokenVersion },
    process.env.REFRESH_SECRET,
    { expiresIn: '7d' }
  );
  
  return { accessToken, refreshToken };
}

// Middleware
function authMiddleware(req, res, next) {
  const token = req.headers.authorization?.split(' ')[1];
  if (!token) return res.status(401).json({ error: 'Unauthorized' });
  
  try {
    req.user = jwt.verify(token, process.env.JWT_SECRET);
    next();
  } catch (err) {
    res.status(401).json({ error: 'Invalid token' });
  }
}

2. Session-Based (Stateful)

const session = require('express-session');
const RedisStore = require('connect-redis')(session);

app.use(session({
  store: new RedisStore({ client: redisClient }),
  secret: process.env.SESSION_SECRET,
  resave: false,
  saveUninitialized: false,
  cookie: {
    secure: true, // HTTPS only
    httpOnly: true, // No JS access
    maxAge: 24 * 60 * 60 * 1000, // 24 hours
    sameSite: 'strict'
  }
}));

// Login
app.post('/login', async (req, res) => {
  const user = await validateCredentials(req.body);
  req.session.userId = user.id;
  req.session.role = user.role;
  res.json({ success: true });
});

// Logout
app.post('/logout', (req, res) => {
  req.session.destroy();
  res.json({ success: true });
});

Read the full file on GitHub · 246 lines

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 · 246 lines · 0 tokens per session scan A 06e41080e98b

Subscribe to this mod's changes

auth-system is a skill published in the GitHub repository aAAaqwq/AGI-Super-Team (91 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,556 tokens. 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-05.

Related

Other skills, from other repositories