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.
npx agentmods add commands/justdvp/claude-code-templates/app-factorygit clone --depth 1 https://github.com/Justdvp/claude-code-templatesWrote 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.
[](https://agentmods.dev/commands/justdvp/claude-code-templates/app-factory)<a href="https://agentmods.dev/commands/justdvp/claude-code-templates/app-factory"><img src="https://agentmods.dev/badge/commands/justdvp/claude-code-templates/app-factory.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02558 |
| Opus 5 | $0.00000 | $0.01279 |
| Sonnet 5 | $0.00000 | $0.00512 |
| Haiku 4.5 | $0.00000 | $0.00256 |
Grade A, and why
app-factory 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- app-factory — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 384 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Flask Application Factory Pattern
Create a scalable Flask application using the factory pattern with blueprints and configuration management.
Purpose
This command helps you set up a Flask application using the application factory pattern, which is the recommended approach for larger Flask applications.
Usage
/app-factory
What this command does
- Creates application factory with proper structure
- Sets up configuration management for different environments
- Implements blueprints for modular design
- Configures extensions (database, auth, etc.)
- Adds error handling and logging
Example Output
# app/__init__.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_wtf.csrf import CSRFProtect
from flask_cors import CORS
import logging
from logging.handlers import RotatingFileHandler
import os
# Initialize extensions
db = SQLAlchemy()
migrate = Migrate()
login = LoginManager()
mail = Mail()
csrf = CSRFProtect()
cors = CORS()
def create_app(config_class=None):
"""Application factory function."""
app = Flask(__name__)
# Load configuration
if config_class is None:
config_class = os.environ.get('FLASK_CONFIG', 'development')
if isinstance(config_class, str):
from app.config import config
app.config.from_object(config[config_class])
else:
app.config.from_object(config_class)
# Initialize extensions
db.init_app(app)
migrate.init_app(app, db)
login.init_app(app)
mail.init_app(app)
csrf.init_app(app)
cors.init_app(app)
# Configure login manager
login.login_view = 'auth.login'
login.login_message = 'Please log in to access this page.'
login.login_message_category = 'info'
# Register blueprints
from app.main import bp as main_bp
app.register_blueprint(main_bp)
from app.auth import bp as auth_bp
app.register_blueprint(auth_bp, url_prefix='/auth')
from app.api import bp as api_bp
app.register_blueprint(api_bp, url_prefix='/api')
from app.admin import bp as admin_bp
app.register_blueprint(admin_bp, url_prefix='/admin')
# Error handlers
from app.errors import bp as errors_bp
app.register_blueprint(errors_bp)
# Configure logging
if not app.debug and not app.testing:
if not os.path.exists('logs'):
os.mkdir('logs')
file_handler = RotatingFileHandler(
'logs/app.log',
maxBytes=10240,
backupCount=10
)
file_handler.setFormatter(logging.Formatter(
'%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
))
file_handler.setLevel(logging.INFO)
app.logger.addHandler(file_handler)
app.logger.setLevel(logging.INFO)
app.logger.info('Flask application startup')
return app
# Import models (avoid circular imports)
from app import models
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.
- 5d ago First seen · 384 lines · 0 tokens per session scan A 2b42862b53d1
app-factory is a command published in the GitHub repository Justdvp/claude-code-templates (7 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,558 tokens. 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.
Other commands, from other repositories
review-python-code
审查 Python 代码的 PEP 8 合规性、类型安全、工程健壮性和宪法一致性.
review-react-code
审查 React/TypeScript 代码的组件架构、Hooks 规范、状态管理、性能表现和宪法一致性.
skill-mcp-server
Padrões DARE para servidores MCP (Model Context Protocol) em TypeScript ou Python. Tools, resources, prompts; transports stdio/SSE/HTTP; validação Zod/Pydantic; autorização por tool; tracing; testes; publicação.
skill-fastapi-api
Padrões DARE para APIs REST em Python + FastAPI + Pydantic v2 + SQLAlchemy 2.0 async. Routers, dependency injection, schemas Pydantic, OAuth2+JWT, slowapi rate limit, pytest+httpx, OpenAPI auto-gerado.
type-coverage
Vérification Couverture des Types Python.
update-python-version
Update the minimum Python version requirement across the entire codebase.