12-factor-agents-analysis

12-factor-agents-analysis is a command for Claude Code from existential-birds/amelia. It costs 12 tokens per session (654 once invoked), scanned A, original, Apache-2.0.

A command for checking a codebase against the 12-Factor Agents methodology, a set of principles for structuring reliable AI-agent software.

In plain words
What is it for?
Use it to assess all 13 listed factors in an agent system and identify areas that may need architectural changes.
Why use it?
It turns broad design principles into a systematic review of how an agent handles tools, prompts, context, state, errors, control flow, and triggers.

Command for Claude Code

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 commands/existential-birds/amelia/12-factor-agents-analysis
Clone the repo
git clone --depth 1 https://github.com/existential-birds/amelia

Made for: Claude Code.

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 12-factor-agents-analysis

README.md
[![agentmods](https://agentmods.dev/badge/commands/existential-birds/amelia/12-factor-agents-analysis.svg)](https://agentmods.dev/commands/existential-birds/amelia/12-factor-agents-analysis)
Your own site
<a href="https://agentmods.dev/commands/existential-birds/amelia/12-factor-agents-analysis"><img src="https://agentmods.dev/badge/commands/existential-birds/amelia/12-factor-agents-analysis.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 654 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 $0.00012 $0.00654
Opus 5 $0.00006 $0.00327
Sonnet 5 $0.00002 $0.00131
Haiku 4.5 $0.00001 $0.00065

Measured 5d ago against content hash 20809c33d7f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

12-factor-agents-analysis 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 5d 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.

.claude/commands/amelia/12-factor-agents-analysis.md · 83 lines

How it starts

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

12-Factor Agents Compliance Analysis

You are performing a comprehensive compliance analysis against the 12-Factor Agents methodology.

Use the agent-architecture-analysis skill to guide this analysis.

Target Codebase

Path: $ARGUMENTS (default: current working directory)

Analysis Scope

Evaluate all 13 factors:

  1. Natural Language → Tool Calls - Schema-validated LLM outputs
  2. Own Your Prompts - Templated, versioned, externalized prompts
  3. Own Your Context Window - Custom context formatting, token optimization
  4. Tools Are Structured Outputs - Deterministic handlers, validated schemas
  5. Unify Execution State - Single source of truth for all state
  6. Launch/Pause/Resume - APIs for workflow control
  7. Contact Humans with Tools - Structured human contact as tool calls
  8. Own Your Control Flow - Custom routing, not framework defaults
  9. Compact Errors into Context - Self-healing with retry thresholds
  10. Small, Focused Agents - Narrow responsibilities, step limits
  11. Trigger from Anywhere - Multi-channel triggers (CLI, REST, webhooks)
  12. Stateless Reducer - Pure functions, no side effects
  13. Pre-fetch Context - Proactive context gathering

Workflow

  1. Use the skill - Read .claude/skills/agent-architecture-analysis/SKILL.md for search patterns
  2. Run searches - Use grep patterns from the skill for each factor
  3. Evaluate compliance - Strong/Partial/Weak per factor
  4. Document evidence - File:line references for findings
  5. Identify gaps - What's missing vs. 12-Factor ideal
  6. Provide recommendations - Actionable improvements

Output Format

Executive Summary

Factor Status Key Finding
F1: Natural Language → Tool Calls Strong/Partial/Weak [Summary]
... ... ...

Overall: X Strong, Y Partial, Z Weak

Detailed Findings

For each factor with gaps:

  • Current State: What exists
  • Evidence: File:line references
  • Gap: What's missing
  • Recommendation: How to improve

Read the full file on GitHub · 83 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. 5d ago First seen · 83 lines · 12 tokens per session scan A 20809c33d7f4

Subscribe to this mod's changes

12-factor-agents-analysis is a command published in the GitHub repository existential-birds/amelia (21 stars, last pushed 25d ago), licensed Apache-2.0. It adds 12 tokens to every session and 654 once invoked, about $0.0001 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-30.