重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
12-factor-apps by existential-birds/beagle
npx skills add https://github.com/existential-birds/beagle --skill 12-factor-apps12-Factor App 方法论是一套构建软件即服务(SaaS)应用程序的最佳实践,这些应用程序具有以下特点:
| 参数 | 描述 | 必需性 |
|---|---|---|
codebase_path | 待分析的代码库根路径 | 必需 |
原则: 一个代码库,使用版本控制,多次部署。
搜索模式:
# 检查版本控制
ls -la .git 2>/dev/null || ls -la .hg 2>/dev/null
# 检查是否有多个应用共享代码库
find . -name "package.json" -o -name "pyproject.toml" -o -name "setup.py" | head -20
# 检查环境特定的代码分支
grep -r "if.*production\|if.*development\|if.*staging" --include="*.py" --include="*.js" --include="*.ts"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
文件模式: .git/、package.json、pyproject.toml、部署配置文件
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 单一 Git 仓库,所有环境使用相同代码库,无环境特定代码分支 |
| 部分 | 单一仓库但存在一些环境特定的代码路径 |
| 弱 | 同一应用有多个仓库,或跨环境存在显著的代码重复 |
反模式:
if production: ...)原则: 显式声明并隔离依赖。
搜索模式:
# Python 依赖文件
find . -name "requirements.txt" -o -name "pyproject.toml" -o -name "setup.py" -o -name "Pipfile" -o -name "uv.lock"
# JavaScript/TypeScript 依赖文件
find . -name "package.json" -o -name "package-lock.json" -o -name "yarn.lock" -o -name "pnpm-lock.yaml"
# 检查对系统工具的假设
grep -r "subprocess.*curl\|subprocess.*wget\|os.system.*ffmpeg\|shutil.which" --include="*.py"
grep -r "exec.*curl\|child_process.*curl" --include="*.js" --include="*.ts"
# Docker/容器隔离
find . -name "Dockerfile" -o -name "docker-compose*.yml"
文件模式: **/requirements*.txt、**/package.json、**/*.lock、**/Dockerfile
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 存在锁文件,依赖隔离(虚拟环境/Docker),无隐式系统工具依赖 |
| 部分 | 声明了依赖但无锁文件或隔离 |
| 弱 | 依赖仅存在于文档中,依赖系统安装的包 |
反模式:
原则: 在环境中存储配置。
搜索模式:
# 环境变量使用情况
grep -r "os.environ\|os.getenv\|process.env\|ENV\[" --include="*.py" --include="*.js" --include="*.ts" --include="*.rb"
# 硬编码的凭据(反模式)
grep -r "password.*=.*['\"]" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example"
grep -r "api_key.*=.*['\"]" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example"
grep -r "secret.*=.*['\"]" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example"
# 环境特定的配置文件(反模式)
find . -name "config.dev.*" -o -name "config.prod.*" -o -name "settings.development.*" -o -name "settings.production.*"
# 代码中的数据库 URL
grep -r "postgresql://\|mysql://\|mongodb://\|redis://" --include="*.py" --include="*.js" --include="*.ts" | grep -v ".env\|test\|example"
文件模式: **/.env*、**/config/*.py、**/settings.py、环境文件
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 所有配置通过环境变量,无硬编码的密钥,开源不会泄露信息 |
| 部分 | 大部分配置已外部化,但存在一些硬编码的默认值 |
| 弱 | 硬编码的凭据,环境特定的配置文件 |
反模式:
config/production.yml 与 config/development.ymlif ENV == 'production': ...)原则: 将后端服务视为附加资源。
搜索模式:
# 通过配置连接数据库
grep -r "DATABASE_URL\|DB_HOST\|REDIS_URL\|CACHE_URL" --include="*.py" --include="*.js" --include="*.ts"
# 服务初始化
grep -r "create_engine\|MongoClient\|Redis\|Celery\|boto3" --include="*.py"
grep -r "createPool\|createClient\|new Redis\|S3Client" --include="*.js" --include="*.ts"
# 硬编码的服务位置(反模式)
grep -r "localhost:5432\|localhost:6379\|localhost:27017\|127.0.0.1" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example\|default"
文件模式: **/database/*.py、**/services/*.py、**/db.py、连接配置
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 所有服务通过配置中的 URL/连接字符串,无需更改代码即可替换 |
| 部分 | 大多数服务可配置,但存在一些硬编码的默认值 |
| 弱 | 硬编码的服务位置,每个环境有不同的代码路径 |
反模式:
localhostif USE_S3: ... else: local_storage)原则: 严格分离构建和运行阶段。
搜索模式:
# 构建/部署配置
find . -name "Dockerfile" -o -name "Makefile" -o -name "build.sh" -o -name "deploy.sh"
find . -name ".github/workflows/*.yml" -o -name ".gitlab-ci.yml" -o -name "Jenkinsfile"
# package.json 中的构建脚本
grep -A5 '"scripts"' package.json 2>/dev/null | grep -E "build|start|deploy"
# 检查运行时编译(反模式)
grep -r "compile\|transpile\|webpack" --include="*.py" | grep -v "test\|build"
文件模式: **/Dockerfile、**/Makefile、**/.github/workflows/**、CI/CD 配置
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 不可变发布,清晰的构建/发布/运行阶段,唯一的发布 ID |
| 部分 | 构建和运行已分离,但发布并非不可变 |
| 弱 | 运行时修改代码,启动时编译资源 |
反模式:
原则: 以一个或多个无状态进程运行应用。
搜索模式:
# 会话存储模式
grep -r "session\|Session" --include="*.py" --include="*.js" --include="*.ts" | head -20
# 进程内状态(反模式)
grep -r "global.*cache\|process_local\|instance_cache" --include="*.py"
grep -r "global\..*=\|module\.exports\.cache" --include="*.js" --include="*.ts"
# 外部会话存储(良好模式)
grep -r "redis.*session\|memcached.*session\|session.*redis" --include="*.py" --include="*.js" --include="*.ts"
# 粘性会话配置(反模式)
grep -r "sticky.*session\|session.*affinity" --include="*.yml" --include="*.yaml" --include="*.json"
文件模式: **/middleware/*.py、**/session/*.py、服务器配置
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 无状态进程,所有状态存储在外部数据存储(Redis、数据库) |
| 部分 | 基本无状态,但存在一些进程内缓存 |
| 弱 | 粘性会话,进程内会话存储,共享内存状态 |
反模式:
user_sessions = {})原则: 通过端口绑定导出服务。
搜索模式:
# 自包含的端口绑定
grep -r "app.run\|server.listen\|serve\|uvicorn" --include="*.py"
grep -r "app.listen\|server.listen\|createServer" --include="*.js" --include="*.ts"
# PORT 环境变量
grep -r "PORT\|port" --include="*.py" --include="*.js" --include="*.ts" | grep -i "environ\|process.env"
# 作为依赖的 Web 服务器
grep -r "uvicorn\|gunicorn\|flask\|fastapi\|express\|koa\|hapi" package.json pyproject.toml requirements.txt 2>/dev/null
文件模式: **/main.py、**/server.py、**/app.py、**/index.js
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 自包含的应用绑定到 PORT,Web 服务器是依赖项 |
| 部分 | 端口绑定但不可通过环境配置 |
| 弱 | 依赖外部 Web 服务器容器(Apache、Nginx)提供 HTTP |
反模式:
原则: 通过进程模型进行扩展。
搜索模式:
# 进程定义
find . -name "Procfile" -o -name "process.yml" -o -name ".foreman"
# 多个入口点
find . -name "worker.py" -o -name "scheduler.py" -o -name "web.py"
# 后台作业系统
grep -r "celery\|rq\|sidekiq\|bull\|agenda" --include="*.py" --include="*.js" --include="*.ts"
grep -r "Celery\|Worker\|BackgroundJob" --include="*.py" --include="*.js" --include="*.ts"
文件模式: **/Procfile、**/worker.py、**/scheduler.py、队列配置
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 明确的进程类型(web、worker、scheduler),水平扩展 |
| 部分 | 多种进程类型但不易扩展 |
| 弱 | 单一单体进程,无关注点分离 |
反模式:
原则: 通过快速启动和优雅关闭实现最大化的健壮性。
搜索模式:
# 信号处理器
grep -r "signal.signal\|SIGTERM\|SIGINT\|atexit" --include="*.py"
grep -r "process.on.*SIGTERM\|process.on.*SIGINT" --include="*.js" --include="*.ts"
# 优雅关闭
grep -r "graceful.*shutdown\|shutdown_handler\|cleanup" --include="*.py" --include="*.js" --include="*.ts"
# 启动时间
grep -r "startup\|initialize\|bootstrap" --include="*.py" --include="*.js" --include="*.ts" | head -20
文件模式: **/main.py、**/server.py、生命周期管理代码
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 快速启动(<10 秒),SIGTERM 处理,优雅关闭,作业可返回到队列 |
| 部分 | 优雅关闭但启动缓慢 |
| 弱 | 无信号处理,进程死亡时作业丢失,启动缓慢 |
反模式:
原则: 尽可能保持开发、预发布和生产环境的相似性。
搜索模式:
# 不同环境使用不同服务(反模式)
grep -r "if.*development.*sqlite\|if.*production.*postgres" --include="*.py" --include="*.js" --include="*.ts"
grep -r "development.*SQLite\|production.*PostgreSQL" --include="*.py" --include="*.js" --include="*.ts"
# 用于环境等价的 Docker
find . -name "docker-compose*.yml" -o -name "Dockerfile"
# 环境特定的后端
grep -r "USE_LOCAL_\|LOCAL_STORAGE\|MOCK_" --include="*.py" --include="*.js" --include="*.ts"
文件模式: **/docker-compose*.yml、环境配置
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 所有环境使用相同的服务(开发和生产都用 PostgreSQL),容器化 |
| 部分 | 大部分相同,但存在一些轻量级的开发替代方案 |
| 弱 | 开发用 SQLite,生产用 PostgreSQL;不同的后端服务 |
反模式:
原则: 将日志视为事件流。
搜索模式:
# 标准输出日志
grep -r "print(\|logging.info\|logger.info\|console.log" --include="*.py" --include="*.js" --include="*.ts" | head -20
# 基于文件的日志(反模式)
grep -r "FileHandler\|open.*\.log\|writeFile.*log\|fs.appendFile.*log" --include="*.py" --include="*.js" --include="*.ts"
grep -r "/var/log\|/tmp/.*\.log\|logs/" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|example"
# 结构化日志
grep -r "structlog\|json_logger\|pino\|winston" --include="*.py" --include="*.js" --include="*.ts"
文件模式: **/logging.py、**/logger.py、日志配置
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 仅无缓冲的标准输出,结构化日志(JSON),无文件管理 |
| 部分 | 标准输出日志,但存在一些文件处理器 |
| 弱 | 应用程序写入日志文件,管理轮转 |
反模式:
FileHandler、open('/var/log/app.log'))原则: 将管理/维护任务作为一次性进程运行。
搜索模式:
# 管理命令
find . -name "manage.py" -o -name "Rakefile" -o -name "artisan"
grep -r "@cli.command\|@click.command\|typer.command" --include="*.py"
# 迁移脚本
find . -name "migrations" -type d
find . -name "*migration*.py" -o -name "*migrate*.py"
# 具有适当隔离的管理脚本
grep -r "bundle exec\|source.*venv\|uv run" --include="*.sh" --include="Makefile"
文件模式: **/manage.py、**/cli.py、**/migrations/**、管理脚本
合规性标准:
| 级别 | 标准 |
|---|---|
| 强 | 管理任务使用相同的依赖/配置,适当的隔离,幂等 |
| 部分 | 存在管理任务但与应用程序设置不同 |
| 弱 | 手动数据库操作,无隔离的脚本 |
反模式:
| 要素 | 状态 | 备注 |
|--------|--------|-------|
| I. 代码库 | **强/部分/弱** | [关键发现] |
| II. 依赖 | **强/部分/弱** | [关键发现] |
| III. 配置 | **强/部分/弱** | [关键发现] |
| IV. 后端服务 | **强/部分/弱** | [关键发现] |
| V. 构建/发布/运行 | **强/部分/弱** | [关键发现] |
| VI. 进程 | **强/部分/弱** | [关键发现] |
| VII. 端口绑定 | **强/部分/弱** | [关键发现] |
| VIII. 并发 | **强/部分/弱** | [关键发现] |
| IX. 易处理性 | **强/部分/弱** | [关键发现] |
| X. 开发/生产环境等价 | **强/部分/弱** | [关键发现] |
| XI. 日志 | **强/部分/弱** | [关键发现] |
| XII. 管理进程 | **强/部分/弱** | [关键发现] |
**总计**:X 强,Y 部分,Z 弱
为每个要素提供:
| 评分 | 含义 | 行动 |
|---|---|---|
| 强 | 完全实现了原则 | 保持,进行小优化 |
| 部分 | 部分实现,存在显著差距 | 计划改进 |
| 弱 | 极少或未实现 | 路线图上的高优先级 |
每周安装次数
63
代码仓库
GitHub 星标数
45
首次出现
2026年1月20日
安全审计
安装于
gemini-cli47
codex47
claude-code47
opencode45
cursor40
antigravity38
Reference: The Twelve-Factor App
The 12-Factor App methodology is a set of best practices for building Software-as-a-Service applications that are:
| Parameter | Description | Required |
|---|---|---|
codebase_path | Root path of the codebase to analyze | Required |
Principle: One codebase tracked in revision control, many deploys.
Search Patterns:
# Check for version control
ls -la .git 2>/dev/null || ls -la .hg 2>/dev/null
# Check for multiple apps sharing codebase
find . -name "package.json" -o -name "pyproject.toml" -o -name "setup.py" | head -20
# Check for environment-specific code branches
grep -r "if.*production\|if.*development\|if.*staging" --include="*.py" --include="*.js" --include="*.ts"
File Patterns: .git/, package.json, pyproject.toml, deployment configs
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Single Git repo, same codebase for all environments, no env-specific code branches |
| Partial | Single repo but some environment-specific code paths |
| Weak | Multiple repos for same app or significant code duplication across environments |
Anti-patterns:
if production: ...)Principle: Explicitly declare and isolate dependencies.
Search Patterns:
# Python dependency files
find . -name "requirements.txt" -o -name "pyproject.toml" -o -name "setup.py" -o -name "Pipfile" -o -name "uv.lock"
# JavaScript/TypeScript dependency files
find . -name "package.json" -o -name "package-lock.json" -o -name "yarn.lock" -o -name "pnpm-lock.yaml"
# Check for system tool assumptions
grep -r "subprocess.*curl\|subprocess.*wget\|os.system.*ffmpeg\|shutil.which" --include="*.py"
grep -r "exec.*curl\|child_process.*curl" --include="*.js" --include="*.ts"
# Docker/container isolation
find . -name "Dockerfile" -o -name "docker-compose*.yml"
File Patterns: **/requirements*.txt, **/package.json, **/*.lock, **/Dockerfile
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Lock files present, dependency isolation (venv/Docker), no implicit system tools |
| Partial | Dependencies declared but no lock files or isolation |
| Weak | Dependencies in documentation only, relies on system-installed packages |
Anti-patterns:
Principle: Store config in the environment.
Search Patterns:
# Environment variable usage
grep -r "os.environ\|os.getenv\|process.env\|ENV\[" --include="*.py" --include="*.js" --include="*.ts" --include="*.rb"
# Hardcoded credentials (anti-pattern)
grep -r "password.*=.*['\"]" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example"
grep -r "api_key.*=.*['\"]" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example"
grep -r "secret.*=.*['\"]" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example"
# Environment-specific config files (anti-pattern)
find . -name "config.dev.*" -o -name "config.prod.*" -o -name "settings.development.*" -o -name "settings.production.*"
# Database URLs in code
grep -r "postgresql://\|mysql://\|mongodb://\|redis://" --include="*.py" --include="*.js" --include="*.ts" | grep -v ".env\|test\|example"
File Patterns: **/.env*, **/config/*.py, **/settings.py, environment files
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | All config via environment variables, no hardcoded secrets, could open-source without leaks |
| Partial | Most config externalized but some hardcoded defaults |
| Weak | Hardcoded credentials, environment-specific config files |
Anti-patterns:
config/production.yml vs config/development.ymlif ENV == 'production': ...)Principle: Treat backing services as attached resources.
Search Patterns:
# Database connection via config
grep -r "DATABASE_URL\|DB_HOST\|REDIS_URL\|CACHE_URL" --include="*.py" --include="*.js" --include="*.ts"
# Service initialization
grep -r "create_engine\|MongoClient\|Redis\|Celery\|boto3" --include="*.py"
grep -r "createPool\|createClient\|new Redis\|S3Client" --include="*.js" --include="*.ts"
# Hardcoded service locations (anti-pattern)
grep -r "localhost:5432\|localhost:6379\|localhost:27017\|127.0.0.1" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|spec\|example\|default"
File Patterns: **/database/*.py, **/services/*.py, **/db.py, connection configurations
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | All services via URL/connection string in config, swappable without code changes |
| Partial | Most services configurable but some hardcoded defaults |
| Weak | Hardcoded service locations, different code paths per environment |
Anti-patterns:
localhost for services in production codeif USE_S3: ... else: local_storage)Principle: Strictly separate build and run stages.
Search Patterns:
# Build/deploy configuration
find . -name "Dockerfile" -o -name "Makefile" -o -name "build.sh" -o -name "deploy.sh"
find . -name ".github/workflows/*.yml" -o -name ".gitlab-ci.yml" -o -name "Jenkinsfile"
# Build scripts in package.json
grep -A5 '"scripts"' package.json 2>/dev/null | grep -E "build|start|deploy"
# Check for runtime compilation (anti-pattern)
grep -r "compile\|transpile\|webpack" --include="*.py" | grep -v "test\|build"
File Patterns: **/Dockerfile, **/Makefile, **/.github/workflows/**, CI/CD configs
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Immutable releases, clear build/release/run stages, unique release IDs |
| Partial | Build and run separated but release not immutable |
| Weak | Runtime code modifications, asset compilation at startup |
Anti-patterns:
Principle: Execute the app as one or more stateless processes.
Search Patterns:
# Session storage patterns
grep -r "session\|Session" --include="*.py" --include="*.js" --include="*.ts" | head -20
# In-process state (anti-pattern)
grep -r "global.*cache\|process_local\|instance_cache" --include="*.py"
grep -r "global\..*=\|module\.exports\.cache" --include="*.js" --include="*.ts"
# External session stores (good pattern)
grep -r "redis.*session\|memcached.*session\|session.*redis" --include="*.py" --include="*.js" --include="*.ts"
# Sticky session configuration (anti-pattern)
grep -r "sticky.*session\|session.*affinity" --include="*.yml" --include="*.yaml" --include="*.json"
File Patterns: **/middleware/*.py, **/session/*.py, server configurations
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Stateless processes, all state in external datastores (Redis, DB) |
| Partial | Mostly stateless but some in-process caching |
| Weak | Sticky sessions, in-process session storage, shared memory state |
Anti-patterns:
user_sessions = {})Principle: Export services via port binding.
Search Patterns:
# Self-contained port binding
grep -r "app.run\|server.listen\|serve\|uvicorn" --include="*.py"
grep -r "app.listen\|server.listen\|createServer" --include="*.js" --include="*.ts"
# PORT environment variable
grep -r "PORT\|port" --include="*.py" --include="*.js" --include="*.ts" | grep -i "environ\|process.env"
# Webserver as dependency
grep -r "uvicorn\|gunicorn\|flask\|fastapi\|express\|koa\|hapi" package.json pyproject.toml requirements.txt 2>/dev/null
File Patterns: **/main.py, **/server.py, **/app.py, **/index.js
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Self-contained app binds to PORT, webserver is a dependency |
| Partial | Port binding but not configurable via environment |
| Weak | Relies on external webserver container (Apache, Nginx) to provide HTTP |
Anti-patterns:
Principle: Scale out via the process model.
Search Patterns:
# Process definitions
find . -name "Procfile" -o -name "process.yml" -o -name ".foreman"
# Multiple entry points
find . -name "worker.py" -o -name "scheduler.py" -o -name "web.py"
# Background job systems
grep -r "celery\|rq\|sidekiq\|bull\|agenda" --include="*.py" --include="*.js" --include="*.ts"
grep -r "Celery\|Worker\|BackgroundJob" --include="*.py" --include="*.js" --include="*.ts"
File Patterns: **/Procfile, **/worker.py, **/scheduler.py, queue configurations
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Explicit process types (web, worker, scheduler), horizontal scaling |
| Partial | Multiple process types but not easily scalable |
| Weak | Single monolithic process, no separation of concerns |
Anti-patterns:
Principle: Maximize robustness with fast startup and graceful shutdown.
Search Patterns:
# Signal handlers
grep -r "signal.signal\|SIGTERM\|SIGINT\|atexit" --include="*.py"
grep -r "process.on.*SIGTERM\|process.on.*SIGINT" --include="*.js" --include="*.ts"
# Graceful shutdown
grep -r "graceful.*shutdown\|shutdown_handler\|cleanup" --include="*.py" --include="*.js" --include="*.ts"
# Startup time
grep -r "startup\|initialize\|bootstrap" --include="*.py" --include="*.js" --include="*.ts" | head -20
File Patterns: **/main.py, **/server.py, lifecycle management code
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Fast startup (<10s), SIGTERM handling, graceful shutdown, jobs returnable to queue |
| Partial | Graceful shutdown but slow startup |
| Weak | No signal handling, jobs lost on process death, slow startup |
Anti-patterns:
Principle: Keep development, staging, and production as similar as possible.
Search Patterns:
# Different services per environment (anti-pattern)
grep -r "if.*development.*sqlite\|if.*production.*postgres" --include="*.py" --include="*.js" --include="*.ts"
grep -r "development.*SQLite\|production.*PostgreSQL" --include="*.py" --include="*.js" --include="*.ts"
# Docker for parity
find . -name "docker-compose*.yml" -o -name "Dockerfile"
# Environment-specific backends
grep -r "USE_LOCAL_\|LOCAL_STORAGE\|MOCK_" --include="*.py" --include="*.js" --include="*.ts"
File Patterns: **/docker-compose*.yml, environment configurations
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Same services everywhere (PostgreSQL in dev and prod), containerized |
| Partial | Mostly same but some lightweight dev alternatives |
| Weak | SQLite in dev, PostgreSQL in prod; different backing services |
Anti-patterns:
Principle: Treat logs as event streams.
Search Patterns:
# Stdout logging
grep -r "print(\|logging.info\|logger.info\|console.log" --include="*.py" --include="*.js" --include="*.ts" | head -20
# File-based logging (anti-pattern)
grep -r "FileHandler\|open.*\.log\|writeFile.*log\|fs.appendFile.*log" --include="*.py" --include="*.js" --include="*.ts"
grep -r "/var/log\|/tmp/.*\.log\|logs/" --include="*.py" --include="*.js" --include="*.ts" | grep -v "test\|example"
# Structured logging
grep -r "structlog\|json_logger\|pino\|winston" --include="*.py" --include="*.js" --include="*.ts"
File Patterns: **/logging.py, **/logger.py, logging configurations
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Unbuffered stdout only, structured logging (JSON), no file management |
| Partial | Stdout logging but with some file handlers |
| Weak | Application writes to log files, manages rotation |
Anti-patterns:
FileHandler, open('/var/log/app.log'))Principle: Run admin/management tasks as one-off processes.
Search Patterns:
# Management commands
find . -name "manage.py" -o -name "Rakefile" -o -name "artisan"
grep -r "@cli.command\|@click.command\|typer.command" --include="*.py"
# Migration scripts
find . -name "migrations" -type d
find . -name "*migration*.py" -o -name "*migrate*.py"
# Admin scripts with proper isolation
grep -r "bundle exec\|source.*venv\|uv run" --include="*.sh" --include="Makefile"
File Patterns: **/manage.py, **/cli.py, **/migrations/**, admin scripts
Compliance Criteria:
| Level | Criteria |
|---|---|
| Strong | Admin tasks use same dependencies/config, proper isolation, idempotent |
| Partial | Admin tasks exist but different setup from app |
| Weak | Manual database manipulation, scripts without isolation |
Anti-patterns:
| Factor | Status | Notes |
|--------|--------|-------|
| I. Codebase | **Strong/Partial/Weak** | [Key finding] |
| II. Dependencies | **Strong/Partial/Weak** | [Key finding] |
| III. Config | **Strong/Partial/Weak** | [Key finding] |
| IV. Backing Services | **Strong/Partial/Weak** | [Key finding] |
| V. Build/Release/Run | **Strong/Partial/Weak** | [Key finding] |
| VI. Processes | **Strong/Partial/Weak** | [Key finding] |
| VII. Port Binding | **Strong/Partial/Weak** | [Key finding] |
| VIII. Concurrency | **Strong/Partial/Weak** | [Key finding] |
| IX. Disposability | **Strong/Partial/Weak** | [Key finding] |
| X. Dev/Prod Parity | **Strong/Partial/Weak** | [Key finding] |
| XI. Logs | **Strong/Partial/Weak** | [Key finding] |
| XII. Admin Processes | **Strong/Partial/Weak** | [Key finding] |
**Overall**: X Strong, Y Partial, Z Weak
For each factor, provide:
Current Implementation
Compliance Level
Gaps
Recommendations
Initial Scan
Deep Dive (per factor)
Gap Analysis
Recommendations
Summary
| Score | Meaning | Action |
|---|---|---|
| Strong | Fully implements principle | Maintain, minor optimizations |
| Partial | Some implementation, significant gaps | Planned improvements |
| Weak | Minimal or no implementation | High priority for roadmap |
Weekly Installs
63
Repository
GitHub Stars
45
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
gemini-cli47
codex47
claude-code47
opencode45
cursor40
antigravity38
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
127,000 周安装