ShtukbaseStandard

Standard: The Twelve-Factor App

std-twelve-factor · version 0.1.0
Industry standards4 norms3 checks

The Twelve-Factor App: dependencies declared and pinned by a lock file, config in the environment, logs to stdout; what cannot be seen in files is left to a judge for the other factors.

About the package

What the standard is. The Twelve-Factor App is twelve rules for an application that runs as a service: https://12factor.net/ (the text has no version number; the package relies on the edition on the site as of 28.11.2026). The factors: I Codebase, II Dependencies, III Config, IV Backing services, V Build, release, run, VI Processes, VII Port binding, VIII Concurrency, IX Disposability, X Dev/prod parity, XI Logs, XII Admin processes.

When to install. The project is a service or a web application deployed in several environments (development, staging, production). For a desktop application, a library or a set of scripts the standard fits partly: install it and switch off the norms you do not need (status: paused).

How to configure. The page /norms/standards/twelve-factor.md: what not to look at (exclude; by default tests, fixtures, archives, vendor, docs), which extensions count as code (code). A line where a hardcoded value is needed on purpose can be marked 12factor:allow.

What is checked

  • TF-R01 (SHOULD, observe): factor III, config: the code has no address of a database, queue or cache (postgres://…, redis://…), no login with a password in an address, no DATABASE_URL = "https://…" as a literal. A line that reads the environment (process.env, os.environ, env::var …) is not a finding: a default value next to an environment read is acceptable. Example hosts (localhost, example.com, .test, .invalid) are skipped. It is a heuristic, so it observes. The config check.
  • TF-R02 (MUST, enforce): factor II, dependencies: a manifest with dependencies has a lock file in git next to it or above it (the workspace root). package.json: bun.lock, package-lock.json, yarn.lock, pnpm-lock.yaml; Cargo.toml: Cargo.lock; pyproject.toml: uv.lock, poetry.lock, pdm.lock, Pipfile.lock, pylock.toml or requirements.txt; requirements*.txt: every line with == (or the file is built from .in); Pipfile, Gemfile, go.mod, composer.json: their own lock. The lock check.
  • TF-R03 (SHOULD, observe): factor XI, logs: the application does not write logs to files itself (Python logging file handlers, winston/pino/log4js transports, tracing/log4rs/zap file appenders, appending to *.log). It is a heuristic, so it observes. The logs check.
  • TF-R04 (SHOULD, observe): the other factors (I, IV–X, XII) and what the heuristics do not see in II, III and XI. The judge is judges/twelve-factor.md.

What is not checked

  • Factors I, IV–X, XII are not checked by a machine: they are about how deployment is arranged, not about files. A judge looks at them.
  • Whether the lock file is fresh and matches the manifest: that is the package manager's job (bun install --frozen-lockfile, cargo build --locked).
  • Config hardcoded not as an address string (a port number, an environment flag if prod), and secrets: the std-owasp-secrets package looks for them.

The package only reads files. It writes nothing.

Norms 4

"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.

Actions 3

NameWhat it doesFileWhen
configIII. Service addresses and passwords are not hardcoded in code (observes)
norm TF-R01
checks/tf01_config.ts
check
lockII. Dependencies are pinned by a lock file in git
norm TF-R02
checks/tf02_lock.ts
check
logsXI. Logs are a stream to stdout, not files (observes)
norm TF-R03
checks/tf03_logs.ts
check

shtuk check runs the checks; shtuk run std-twelve-factor <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.

Pages 5

They go into the project at these paths.

Package files 7

They go into .shtukbase/packages/std-twelve-factor/; actions run from there.