factory-pitfalls

factory-pitfalls is a skill for Claude Code from nonlinear-xyz/factory-kit. It costs 59 tokens per session (2,134 once invoked), scanned A, original, MIT.

A checklist of common mistakes found across the Factory project's coding guidelines and setup process.

In plain words
What is it for?
It helps at project kickoff, during code review, and after incidents when checking architecture, authentication, testing, and other process pitfalls.
Why use it?
It gives developers one place to check for recurring problems such as missing tests, unclear decisions, mixed API styles, or unsafe authentication choices.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

Part of the factory-kit plugin — 37 skills, 8 commands, 12 agents, 1 MCP server shipped together

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.

agentmods
npx agentmods add skills/nonlinear-xyz/factory-kit/factory-pitfalls
Any agent
npx skills add nonlinear-xyz/factory-kit --skill factory-pitfalls
Clone the repo
git clone --depth 1 https://github.com/nonlinear-xyz/factory-kit

Made for: Claude Code.

Or install factory-kit, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 12 agents, 1 MCP server.

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 factory-pitfalls

README.md
[![agentmods](https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-pitfalls.svg)](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-pitfalls)
Your own site
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-pitfalls"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-pitfalls.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,134 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00059 $0.02134
Opus 5 $0.00030 $0.01067
Sonnet 5 $0.00012 $0.00427
Haiku 4.5 $0.00006 $0.00213

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

Security

Grade A, and why

factory-pitfalls 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 6d 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/factory-pitfalls/SKILL.md · 149 lines

How it starts

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

Factory pitfalls

The skills are now structured Principle → Why → Recipe → Failure mode, with each anti-pattern co-located with the principle it violates. This file is a flat scan across those failure modes plus process-level pitfalls that don't fit any one skill.

How to use this skill

  • At project kickoff. Read this index; ensure the starting setup avoids the top-tier pitfalls (no test coverage, no DECISIONS.md, hardcoded allowlist).
  • In code review. Scan recent diffs for matches; link the relevant skill section in the PR comment.
  • After incidents. Add the failure mode to the skill where its principle lives (not here); if it doesn't fit any skill, add a process pitfall below.

Cross-skill failure index

Each entry: one line, pointing at the skill section that owns it.

Stack / architecture

  • Mixed tRPC + server actionsfactory-api.md §API style — pick one
  • Custom auth adapter when an official one existsfactory-auth.md §Better Auth — plugin composition
  • Triple-fallback auth surface (Clerk → token → header)factory-auth.md §The wrapper interface
  • No auth at all (publicProcedure everywhere)factory-auth.md §Auth from day one
  • Hardcoded email allowlistfactory-auth.md §Hardcoded email allowlists
  • Admin client at module scopefactory-auth.md §Admin client — always wrapped

Forms

  • Monolithic 1,500-line formfactory-forms.md §Modular section files from day one

Testing

  • No tests under src/factory-testing.md §Tests-before-merge — coverage gates, not test-first dogma
  • Mock-only tests passing while prod failsfactory-testing.md §Test the boundaries; trust the framework
  • Snapshot tests as the only coveragefactory-testing.md §E2E owns user flows; unit owns behavior

Frontend

  • Two-way state-DB syncfactory-frontend.md §One direction of truth
  • Currency formatting drift across viewsfactory-frontend.md §Format helpers

Read the full file on GitHub · 149 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. 6d ago First seen · 149 lines · 59 tokens per session scan A c27ef29bb0ed

Subscribe to this mod's changes

factory-pitfalls is a skill published in the GitHub repository nonlinear-xyz/factory-kit (9 stars, last pushed 1mo ago), licensed MIT. It adds 59 tokens to every session and 2,134 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories

hook-template

Generate hook script from template. Use when adding a new hook, wiring a PreToolUse/PostToolUse/Stop/Notification hook, or scaffolding hook config for settings.json.

claude-world/director-mode-lite · 39 tokens

agent-template

Generate custom agent from template. Use when creating a new subagent from scratch, or scaffolding an agent file with correct frontmatter.

claude-world/director-mode-lite · 30 tokens

workflow

Run the complete 5-step development workflow: focus problem → prevent over-development → test-first (TDD) → document → smart commit. Use when starting a new feature, or when the user runs /workflow or asks for the full development flow.

claude-world/director-mode-lite · 52 tokens

check-environment

Verify Claude, Codex, and Grok availability plus Director guidance, relay, agents, and skills. Audit optional hooks only when selected. Use after installation or when a native surface misbehaves.

claude-world/director-mode-lite · 44 tokens

doc-writer

Documentation templates and standards: README structure, API reference format, changelog (Keep a Changelog), and comment guidelines. Use when creating or updating documentation. Loaded automatically by the doc-writer agent.

claude-world/director-mode-lite · 44 tokens

smart-commit

Create clean Conventional Commits: inspect the diff, group related changes, run quality checks, and write type(scope) messages. Use when committing work, or when the user runs /smart-commit or asks to commit changes.

claude-world/director-mode-lite · 49 tokens