AgentStack
SKILL verified MIT Self-run

Factory Pitfalls

skill-nonlinear-xyz-factory-kit-factory-pitfalls · by nonlinear-xyz

Cross-skill index of observed failure modes. Each skill carries its own Failure mode blocks under the Principle they violated; this file is the flat scan across all of them, plus process-level pitfalls that don't have a skill home. Read at project kickoff and during code review.

No reviews yet
0 installs
1 views
0.0% view→install

Install

$ agentstack add skill-nonlinear-xyz-factory-kit-factory-pitfalls

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Factory Pitfalls? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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

Design system

  • Palette-position token names (primary / base-100)factory-design.md §Token vocabulary — name intent, not palette position
  • Hex literal in a component filefactory-design.md §Token source — CSS variables, bridged into Tailwind
  • dark: variants sprinkled on individual elementsfactory-design.md §Mode is a variable swap, not a parallel palette
  • Spacing tokens (--space-section-y-md) that duplicate Tailwind's scalefactory-design.md §What gets a token, what stays a utility
  • Components referencing primitive-layer names (bg-blue-500) instead of semanticfactory-design.md §One layer or two
  • "I'll lift this later" inline componentfactory-design.md §Promote drift into a primitive
  • Token sprawl (60+ tokens, role names diluted into palette-noise)factory-design.md §Hold the line on vocabulary size
  • Half-replaced theme library coexisting with new tokensfactory-design.md §When the existing surface is daisyUI / Bootstrap / Material

Data

  • Querying inside JSONB at app speedfactory-data-layer.md §Custom attributes as JSONB
  • Raw SQL with hand-mapped row→objectfactory-data-layer.md §ORM pick
  • Mixed migration-file namingfactory-data-layer.md §Migration file naming

Database migrations (destructive prod writes)

  • Silently coercing historical data to fit a wrong constraintfactory-db-migration.md §The data is ground truth
  • Single-file migration mixing preflight + mutate + verifyfactory-db-migration.md §Three-stage write contract
  • Untested rollback shipped to prodfactory-db-migration.md §Three-stage write contract
  • Idempotency claim asserted in a comment, not proven by re-runfactory-db-migration.md §Idempotency via natural keys
  • Natural key with bare = on nullable columnsfactory-db-migration.md §Idempotency via natural keys
  • Two-branch CASE that conflates NULL with FALSE in tri-state UPDATEfactory-db-migration.md §Bidirectional update semantics
  • Constraint error with no row index — parser didn't validatefactory-db-migration.md §Validate at parse, not at constraint
  • Prod destructive write with no Layer C snapshot takenfactory-db-migration.md §Layered backup independence
  • LLM auto-runs runbook commands "because they're safe"factory-db-migration.md §Human gate at every step
  • Constraint dropped without auditing downstream layers (server actions, RPC filters, dashboard rollups)factory-db-migration.md §Defense in depth
  • Local-cycle-then-prod, skipping ephemeral stagingfactory-db-migration.md §Migration testing protocol

Pipelines

  • Pre-built libs/py-libs/ before second consumerfactory-data-pipelines.md §Don't pre-build shared libs
  • Pydantic models copy-pasted across entry pointsfactory-data-pipelines.md §Three-entry-point pattern

LLM workflows

  • Pydantic state for LangGraphfactory-llm-workflows.md §State shape
  • No versioning on editable content (chat vs claims)factory-llm-workflows.md §Version anything editable later

Security

  • In-memory rate limiter on serverlessfactory-security.md §Rate limiting
  • PHI in email without runtime BAA checkfactory-security.md §PHI in email/SMS
  • AI-generated code without a review queuefactory-security.md §AI-generated code — read-only by default

Deployment

  • Migrations at runtime (in Cloud Run CMD)factory-deployment.md §Migrations — CI, never runtime

CI

  • Claude reviewer wired as advisory, not requiredfactory-ci.md §Claude Code reviewer is a required check, not an advisory bot
  • Required-checks list drifts from workflow jobsfactory-ci.md §Branch protection — short list, load-bearing
  • Pre-push hook treated as the merge gatefactory-ci.md §Pre-push hooks — fast feedback, not the gate

Verification

  • Verification theater (green checks approved without comprehension)factory-verification.md §Guardrails at the boundary, never the inner loop
  • Silent verification gap (pitfall documented but enforced by nothing)factory-verification.md §Guardrails at the boundary, never the inner loop
  • Gating a PR on the absolute score instead of the deltafactory-verification.md §Gate the delta, contextualize the absolute
  • A precise score (87.3/100) over a heuristic instrumentfactory-verification.md §Score the codebase, disclose the instrument

Observability

  • Regenerated trace IDs at service hopsfactory-observability.md §Trace ID — propagate, don't regenerate

Commits

  • Commits with no Linear linkagefactory-commits.md §Tie every commit to a Linear issue

Process pitfalls — no skill home

These are kit-shape and project-shape failures that don't fit any one skill's domain. They live here.

Three competing solutions for the same problem

Legacy applicationProgress.ts, intermediate sectionProgress.ts, and unified progress-calculator.ts all live in the same repo. The newer file is the source of truth but the older ones never got deleted.

Right move: when you write a unifier, delete the inputs in the same PR. Half-finished refactors are worse than untouched code — they imply the newer file is the truth while leaving the older ones as plausible alternatives that future contributors will pull from.

No DECISIONS.md per project

Decision-criteria choices (which auth, which UI lib, which API style) get relitigated each session. The kit's factory-stack.md documents the criteria; the project's DECISIONS.md records the picks.

Right move: every new project starts with a DECISIONS.md containing one-line entries per decision-criteria choice from factory-stack.md. Update on every architectural call.

Empty .claude/ or .agents/ directories

Implies intent without value. New contributors interpret the empty directory as "this is where convention lives" and put unrelated things there.

Right move: delete empty stubs. If intent matters, write the placeholder explicitly with TODO: so future-you knows what was planned.

Aspirational docs

CLAUDE.md describing the architecture you wish you had, not the one the code actually has. New contributors get the wrong mental model. AI agents read it and propose work against a fiction.

Right move: treat CLAUDE.md as code. Update in the same PR as the refactor. If you write an AGENTS.md or CLAUDE.md, make it load-bearing or delete it.

Inconsistent CLAUDE.md formats across repos

Each new project relitigates the format. The kit's template (see CLAUDE.md in the kit's root) is the canonical shape — extend it per project, don't reinvent.

Right move: copy the kit's CLAUDE.md template into the project's root, fill in the project-specific bits (domain, decisions, layout). Same shape every time.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.