agentleFS
weselbenweselben/RooForge/skills/12-factor-app/SKILL.md

12-factor-app

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Load when designing, building, or reviewing SaaS, cloud-native apps, microservices, containerized workloads, or serverless functions — or when the user mentions 12-factor, config in env, stateless processes, or dev/prod parity.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check each factor systematically against the checklist above

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

12-Factor App

Heroku's methodology for building portable, scalable, maintainable SaaS apps. Language-agnostic. Modern extensions: observability, API-first, security, progressive delivery, auth, sustainability.

The 12 Factors (Original)

#FactorCore RuleAgent Check
ICodebaseOne repo per app, many deploysSingle source of truth; IaC in same repo
IIDependenciesExplicitly declare and isolateManifest + lockfile; no system-wide deps; exact Docker base image versions
IIIConfigStore in environmentEnv vars / config systems; secrets in Vault/K8s Secrets; never in code
IVBacking ServicesTreat as attached resourcesURL-based config; swappable local → managed; circuit breakers + retries
VBuild, Release, RunStrictly separate stagesImmutable releases tagged with unique ID; no builds in production
VIProcessesStateless, share-nothingNo in-memory sessions; no local persistent writes; multiple instances concurrent
VIIPort BindingSelf-contained, export via portConfigurable port; standalone without external web server
VIIIConcurrencyScale out via process modelHorizontal scaling; separate web/worker process types; no single points of failure
IXDisposabilityFast startup, graceful shutdown<30s startup (ideally <10s); SIGTERM handling; cattle, not pets
XDev/Prod ParityKeep environments similarSame DB type/version; Docker/IaC for parity; one-command local dev
XILogsTreat as event streamsstdout only; structured (JSON); no log file management in app code
XIIAdmin ProcessesRun as one-off processesSame codebase/config as app; never inside web/worker processes

Modern Extensions

#FactorCore Rule
XIIIObservabilityOpenTelemetry, metrics, traces, structured logs, SLIs/SLOs
XIVAPI-FirstContract-first design (OpenAPI/gRPC); consumers generate from spec
XVSecuritySBOM, image signing, zero-trust, secrets rotation, dependency scanning
XVIProgressive DeliveryFeature flags, canary releases, blue/green deployments
XVIIAuth/AuthZExternalized identity (OIDC/OAuth2), RBAC/ABAC, service-to-service mTLS
XVIIISustainabilityFinOps, right-sizing, carbon-aware computing

Agent Evaluation Flow

  1. Identify deployment model (VM, container, serverless, edge)
  2. Check each factor systematically against the checklist above
  3. Distinguish violations from mitigations
  4. Prioritize by impact: Config, Processes, Build/Release/Run are most critical
  5. Suggest concrete fixes: "replace X with Y using Z approach"

Common Mistakes

MistakeFix
Secrets in .env committed to gitUse Vault, K8s Secrets, or cloud provider secret managers
const sessions = {} in memoryRedis or database for session storage
npm install && npm build && npm start in DockerfileMulti-stage Docker build; compile in stage 1, run pre-built artifact in stage 2
Hardcoded DB URLsos.environ.get("DATABASE_URL")
File-based loggingConsoleHandler() → stdout
2+ minute startup timesLazy-load heavy resources; defer to background workers

Related Principles

  • KISS — simplicity in design and implementation
  • Unix Philosophy — do one thing well, compose with text streams
  • Infrastructure as Code — declarative infrastructure management
  • DRY — eliminate duplication without over-abstraction
  • YAGNI — defer unnecessary features

Source

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.