ctxpipe: Skill for Claude Code

.agents/skills/two-factor-authentication-best-practices/SKILL.md

two-factor-authentication-best-practices is a skill for Claude Code, Codex from ctxpipe-ai/ctxpipe. It costs 34 tokens per session (2,494 once invoked), scanned A, original, MIT.

Guidance and rules for adding secure two-factor authentication with Better Auth's twoFactor plugin. Two-factor authentication requires a second proof of identity in addition to a password.

In plain words
What is it for?
Use it while implementing or reviewing two-factor authentication in an application that uses Better Auth.
Why use it?
It helps avoid common security mistakes when protecting accounts with an extra login step.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is ctxpipe-ai/ctxpipe's own configuration. It tells Claude Code and Codex how to work on ctxpipe itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ctxpipe configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ctxpipe-ai/ctxpipe. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ctxpipe-ai/ctxpipe/main/.agents/skills/two-factor-authentication-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ctxpipe-ai/ctxpipe

Made for: Claude Code, Codex.

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 two-factor-authentication-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/ctxpipe-ai/ctxpipe/two-factor-authentication-best-practices/github.svg)](https://agentmods.dev/skills/ctxpipe-ai/ctxpipe/two-factor-authentication-best-practices)
Your own site
<a href="https://agentmods.dev/skills/ctxpipe-ai/ctxpipe/two-factor-authentication-best-practices"><img src="https://agentmods.dev/badge/skills/ctxpipe-ai/ctxpipe/two-factor-authentication-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for two-factor-authentication-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/ctxpipe-ai/ctxpipe/two-factor-authentication-best-practices"><img src="https://agentmods.dev/badge/skills/ctxpipe-ai/ctxpipe/two-factor-authentication-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,494 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.
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.00034 $0.02494
Opus 5.5 $0.00014 $0.00998
Sonnet 5.5 $0.00007 $0.00499
Haiku 4.5 $0.00003 $0.00249

Measured 1mo ago against content hash 3cc2649bc89d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

two-factor-authentication-best-practices 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 1mo 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.

.agents/skills/two-factor-authentication-best-practices/SKILL.md · 418 lines

How it starts

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

Setting Up Two-Factor Authentication

When adding 2FA to your application, configure the twoFactor plugin with your app name as the issuer. This name appears in authenticator apps when users scan the QR code.

import { betterAuth } from "better-auth";
import { twoFactor } from "better-auth/plugins";

export const auth = betterAuth({
  appName: "My App", // Used as the default issuer for TOTP
  plugins: [
    twoFactor({
      issuer: "My App", // Optional: override the app name for 2FA specifically
    }),
  ],
});

Note: After adding the plugin, run npx @better-auth/cli migrate to add the required database fields and tables.

Client-Side Setup

Add the client plugin and configure the redirect behavior for 2FA verification:

import { createAuthClient } from "better-auth/client";
import { twoFactorClient } from "better-auth/client/plugins";

export const authClient = createAuthClient({
  plugins: [
    twoFactorClient({
      onTwoFactorRedirect() {
        window.location.href = "/2fa"; // Redirect to your 2FA verification page
      },
    }),
  ],
});

Enabling 2FA for Users

When a user enables 2FA, require their password for verification. The enable endpoint returns a TOTP URI for QR code generation and backup codes for account recovery.

const enable2FA = async (password: string) => {
  const { data, error } = await authClient.twoFactor.enable({
    password,
  });

  if (data) {
    // data.totpURI - Use this to generate a QR code
    // data.backupCodes - Display these to the user for safekeeping
  }
};

Important: The twoFactorEnabled flag on the user is not set to true until the user successfully verifies their first TOTP code. This ensures users have properly configured their authenticator app before 2FA is fully active.

Skipping Initial Verification

If you want to enable 2FA immediately without requiring verification, set skipVerificationOnEnable:

twoFactor({
  skipVerificationOnEnable: true, // Not recommended for most use cases
});

Read the full file on GitHub · 418 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. 1mo ago First seen · 418 lines · 34 tokens per session scan A 3cc2649bc89d

Subscribe to this mod's changes

two-factor-authentication-best-practices is a skill published in the GitHub repository ctxpipe-ai/ctxpipe (27 stars, last pushed today), licensed MIT. It adds 34 tokens to every session and 2,494 once invoked, about $0.0001 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

setup-open-index

Install and configure Open Index as the read/write context layer for a domain-specialized agent. Use when setting up a legal, marketing, customer support, sales, infrastructure, or other domain agent with Open Index over MCP.

DrDroidLab/open-index · 48 tokens

edit-brain

How to add or edit knowledge in this brain — define doctypes, add or update entities, and correlate them with relationships. Use whenever the user asks to add/update knowledge, define a concept, record a learning, or link two things in the brain.

DrDroidLab/open-index · 55 tokens

bcc-plan-spar

BCC align+lock+review PLAN.md for one slice (no product code). Slash: /bcc-plan-spar · chat: bcc:plan-spar · "lock PLAN" · spar the plan. Args: rounds=N (auto-review cap), review=self|subagent|cli|auto|off. Grill until clear enough (no default Q&A quota). Hand off to bcc-clean-cut after human APPROVE.

bo-cao/breaking-coding-chaos · 91 tokens

bcc-throughline

BCC global progress cockpit (plans.md/progress.md/findings.md). Slash: /bcc-throughline · chat: bcc:throughline · "where are we" · reprioritize · resume after /clear. Not for coding or full PLAN grill.

bo-cao/breaking-coding-chaos · 56 tokens

bcc-breaking-coding-chaos

BCC main skill: dual-loop coding workflow (throughline → plan-spar → clean-cut) or quick status+next. Slash: /bcc-breaking-coding-chaos · chat: bcc:breaking-coding-chaos · "run BCC" · "BCC status" · "what next BCC". Needs a real idea (1:1 implement). Args: goal text, or status. May pass plan-spar review budget as…

bo-cao/breaking-coding-chaos · 101 tokens

bcc-clean-cut

BCC minimal implement from locked PLAN.md (ponytail ladder + verify). Slash: /bcc-clean-cut · chat: bcc:clean-cut · "implement PLAN" after human APPROVE. Not for plan grill (use bcc-plan-spar).

bo-cao/breaking-coding-chaos · 55 tokens