Skip to content

aiskillstore/marketplace / skills/0xdarkmatter/python-database-patterns

python-database-patterns

Verified

SQLAlchemy and database patterns for Python. Triggers on: sqlalchemy, database, orm, migration, alembic, async database, connection pool, repository pattern, unit of work.

skill-report.json

View on GitHub
{
  "schema_version": "2.0",
  "meta": {
    "generated_at": "2026-07-06T01:58:49.765Z",
    "slug": "0xdarkmatter-python-database-patterns",
    "source_url": "https://github.com/0xDarkMatter/claude-mods/tree/main/skills/python-database-patterns",
    "source_ref": "main",
    "model": "codex",
    "analysis_version": "3.0.0",
    "source_type": "community",
    "content_hash": "08f9de3f2eab4deb16e7529a2dd41f0b5d26f60267b8c27b046edacd2ad46b9b",
    "tree_hash": "b4d6203318885639da9c683a1b253e7fc2680ae793abeccbb66348e30229c0cd",
    "provenance": {
      "model_requested": "gpt-5.5:high",
      "model_effective": "codex:gpt-5.5:high",
      "fallback_chain": [
        {
          "agent": "codex",
          "model": "gpt-5.5",
          "effort": "high",
          "outcome": "success"
        }
      ],
      "analysis_version": "3.0.0"
    }
  },
  "skill": {
    "name": "python-database-patterns",
    "description": "SQLAlchemy 2.0 guidance for Python projects, including async sessions, migrations, pooling, transactions, and repository patterns.",
    "summary": "Build reliable SQLAlchemy database layers for Python applications.",
    "icon": "📦",
    "version": "1.0.0",
    "author": "0xDarkMatter",
    "license": "MIT",
    "tags": [
      "python",
      "sqlalchemy",
      "database",
      "alembic",
      "async"
    ],
    "supported_tools": [
      "claude",
      "codex",
      "claude-code"
    ],
    "risk_factors": [
      "env_access",
      "scripts",
      "external_commands"
    ],
    "category": "coding"
  },
  "security_audit": {
    "risk_level": "safe",
    "is_blocked": false,
    "safe_to_publish": true,
    "analysis_status": "ok",
    "summary": "All static findings appear to be false positives from Markdown examples, SQLAlchemy imports, Alembic configuration, or local ORM query snippets. I found no prompt injection, data exfiltration intent, malware behavior, or unsafe executable skill logic in the reviewed files.",
    "remediation": [],
    "risk_factor_evidence": [
      {
        "factor": "env_access",
        "evidence": [
          {
            "file": "references/connection-pooling.md",
            "line_start": 68,
            "line_end": 68
          },
          {
            "file": "references/connection-pooling.md",
            "line_start": 68,
            "line_end": 68
          },
          {
            "file": "references/migrations.md",
            "line_start": 41,
            "line_end": 41
          },
          {
            "file": "references/migrations.md",
            "line_start": 61,
            "line_end": 61
          },
          {
            "file": "references/migrations.md",
            "line_start": 34,
            "line_end": 34
          }
        ]
      },
      {
        "factor": "scripts",
        "evidence": [
          {
            "file": "references/sqlalchemy-async.md",
            "line_start": 8,
            "line_end": 13
          },
          {
            "file": "SKILL.md",
            "line_start": 44,
            "line_end": 48
          }
        ]
      },
      {
        "factor": "external_commands",
        "evidence": [
          {
            "file": "SKILL.md",
            "line_start": 16,
            "line_end": 39
          },
          {
            "file": "SKILL.md",
            "line_start": 39,
            "line_end": 43
          },
          {
            "file": "SKILL.md",
            "line_start": 43,
            "line_end": 66
          },
          {
            "file": "SKILL.md",
            "line_start": 66,
            "line_end": 70
          },
          {
            "file": "SKILL.md",
            "line_start": 70,
            "line_end": 92
          },
          {
            "file": "SKILL.md",
            "line_start": 92,
            "line_end": 96
          },
          {
            "file": "SKILL.md",
            "line_start": 96,
            "line_end": 127
          },
          {
            "file": "SKILL.md",
            "line_start": 127,
            "line_end": 131
          },
          {
            "file": "SKILL.md",
            "line_start": 131,
            "line_end": 149
          },
          {
            "file": "SKILL.md",
            "line_start": 149,
            "line_end": 155
          },
          {
            "file": "SKILL.md",
            "line_start": 155,
            "line_end": 156
          },
          {
            "file": "SKILL.md",
            "line_start": 156,
            "line_end": 157
          },
          {
            "file": "SKILL.md",
            "line_start": 157,
            "line_end": 158
          },
          {
            "file": "SKILL.md",
            "line_start": 158,
            "line_end": 159
          },
          {
            "file": "SKILL.md",
            "line_start": 159,
            "line_end": 160
          },
          {
            "file": "SKILL.md",
            "line_start": 160,
            "line_end": 161
          },
          {
            "file": "SKILL.md",
            "line_start": 161,
            "line_end": 165
          },
          {
            "file": "SKILL.md",
            "line_start": 165,
            "line_end": 166
          },
          {
            "file": "SKILL.md",
            "line_start": 166,
            "line_end": 167
          },
          {
            "file": "SKILL.md",
            "line_start": 167,
            "line_end": 168
          },
          {
            "file": "SKILL.md",
            "line_start": 168,
            "line_end": 172
          },
          {
            "file": "SKILL.md",
            "line_start": 172,
            "line_end": 179
          },
          {
            "file": "SKILL.md",
            "line_start": 179,
            "line_end": 180
          },
          {
            "file": "SKILL.md",
            "line_start": 180,
            "line_end": 183
          },
          {
            "file": "SKILL.md",
            "line_start": 183,
            "line_end": 184
          }
        ]
      }
    ],
    "static_findings": [
      {
        "id": "env_access:references/connection-pooling.md:68:python-getenv-function",
        "category": "env_access",
        "severity": "low",
        "pattern": "Python getenv function",
        "file": "references/connection-pooling.md",
        "line_start": 68,
        "line_end": 68,
        "snippet": "if os.getenv(\"ENV\") == \"production\":"
      },
      {
        "id": "env_access:references/connection-pooling.md:68:getenv-function-call",
        "category": "env_access",
        "severity": "low",
        "pattern": "getenv function call",
        "file": "references/connection-pooling.md",
        "line_start": 68,
        "line_end": 68,
        "snippet": "if os.getenv(\"ENV\") == \"production\":"
      },
      {
        "id": "env_access:references/migrations.md:41:configuration-library",
        "category": "env_access",
        "severity": "low",
        "pattern": "Configuration library",
        "file": "references/migrations.md",
        "line_start": 41,
        "line_end": 41,
        "snippet": "url = config.get_main_option(\"sqlalchemy.url\")"
      },
      {
        "id": "env_access:references/migrations.md:61:configuration-library",
        "category": "env_access",
        "severity": "low",
        "pattern": "Configuration library",
        "file": "references/migrations.md",
        "line_start": 61,
        "line_end": 61,
        "snippet": "config.get_section(config.config_ini_section, {}),"
      },
      {
        "id": "env_access:references/migrations.md:34:database-connection-strings",
        "category": "env_access",
        "severity": "high",
        "pattern": "Database connection strings",
        "file": "references/migrations.md",
        "line_start": 34,
        "line_end": 34,
        "snippet": "config.set_main_option(\"sqlalchemy.url\", settings.database_url)"
      },
      {
        "id": "blocker:references/migrations.md:188:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "references/migrations.md",
        "line_start": 188,
        "line_end": 188,
        "snippet": "sa.text(\"UPDATE users SET name = :name WHERE id = :id\"),"
      },
      {
        "id": "scripts:references/sqlalchemy-async.md:8:dynamic-import-expression",
        "category": "scripts",
        "severity": "medium",
        "pattern": "Dynamic import() expression",
        "file": "references/sqlalchemy-async.md",
        "line_start": 8,
        "line_end": 13,
        "snippet": "from sqlalchemy.ext.asyncio import ("
      },
      {
        "id": "blocker:references/sqlalchemy-async.md:283:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "references/sqlalchemy-async.md",
        "line_start": 283,
        "line_end": 283,
        "snippet": "assert user.id is not None"
      },
      {
        "id": "blocker:references/transactions.md:49:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "references/transactions.md",
        "line_start": 49,
        "line_end": 51,
        "snippet": "await session.flush()  # Get user.id"
      },
      {
        "id": "scripts:SKILL.md:44:dynamic-import-expression",
        "category": "scripts",
        "severity": "medium",
        "pattern": "Dynamic import() expression",
        "file": "SKILL.md",
        "line_start": 44,
        "line_end": 48,
        "snippet": "from sqlalchemy.ext.asyncio import ("
      },
      {
        "id": "external_commands:SKILL.md:16:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 16,
        "line_end": 39,
        "snippet": "```python"
      },
      {
        "id": "external_commands:SKILL.md:39:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 39,
        "line_end": 43,
        "snippet": "```"
      },
      {
        "id": "external_commands:SKILL.md:43:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 43,
        "line_end": 66,
        "snippet": "```python"
      },
      {
        "id": "external_commands:SKILL.md:66:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 66,
        "line_end": 70,
        "snippet": "```"
      },
      {
        "id": "external_commands:SKILL.md:70:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 70,
        "line_end": 92,
        "snippet": "```python"
      },
      {
        "id": "external_commands:SKILL.md:92:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 92,
        "line_end": 96,
        "snippet": "```"
      },
      {
        "id": "external_commands:SKILL.md:96:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 96,
        "line_end": 127,
        "snippet": "```python"
      },
      {
        "id": "external_commands:SKILL.md:127:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 127,
        "line_end": 131,
        "snippet": "```"
      },
      {
        "id": "external_commands:SKILL.md:131:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 131,
        "line_end": 149,
        "snippet": "```python"
      },
      {
        "id": "external_commands:SKILL.md:149:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 149,
        "line_end": 155,
        "snippet": "```"
      },
      {
        "id": "external_commands:SKILL.md:155:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 155,
        "line_end": 156,
        "snippet": "| Select all | `select(User)` |"
      },
      {
        "id": "external_commands:SKILL.md:156:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 156,
        "line_end": 157,
        "snippet": "| Filter | `.where(User.id == 1)` |"
      },
      {
        "id": "external_commands:SKILL.md:157:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 157,
        "line_end": 158,
        "snippet": "| First | `.scalar_one_or_none()` |"
      },
      {
        "id": "external_commands:SKILL.md:158:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 158,
        "line_end": 159,
        "snippet": "| All | `.scalars().all()` |"
      },
      {
        "id": "external_commands:SKILL.md:159:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 159,
        "line_end": 160,
        "snippet": "| Count | `select(func.count(User.id))` |"
      },
      {
        "id": "external_commands:SKILL.md:160:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 160,
        "line_end": 161,
        "snippet": "| Join | `.join(Post)` |"
      },
      {
        "id": "external_commands:SKILL.md:161:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 161,
        "line_end": 165,
        "snippet": "| Eager load | `.options(selectinload(User.posts))` |"
      },
      {
        "id": "external_commands:SKILL.md:165:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 165,
        "line_end": 166,
        "snippet": "- `./references/sqlalchemy-async.md` - Async patterns, session management"
      },
      {
        "id": "external_commands:SKILL.md:166:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 166,
        "line_end": 167,
        "snippet": "- `./references/connection-pooling.md` - Pool configuration, health checks"
      },
      {
        "id": "external_commands:SKILL.md:167:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 167,
        "line_end": 168,
        "snippet": "- `./references/transactions.md` - Transaction patterns, isolation levels"
      },
      {
        "id": "external_commands:SKILL.md:168:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 168,
        "line_end": 172,
        "snippet": "- `./references/migrations.md` - Alembic setup, migration strategies"
      },
      {
        "id": "external_commands:SKILL.md:172:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 172,
        "line_end": 179,
        "snippet": "- `./assets/alembic.ini.template` - Alembic configuration template"
      },
      {
        "id": "external_commands:SKILL.md:179:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 179,
        "line_end": 180,
        "snippet": "- `python-typing-patterns` - Mapped types and annotations"
      },
      {
        "id": "external_commands:SKILL.md:180:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 180,
        "line_end": 183,
        "snippet": "- `python-async-patterns` - Async database sessions"
      },
      {
        "id": "external_commands:SKILL.md:183:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 183,
        "line_end": 184,
        "snippet": "- `python-fastapi-patterns` - Dependency injection for DB sessions"
      },
      {
        "id": "blocker:SKILL.md:64:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 64,
        "line_end": 64,
        "snippet": "result = await session.execute(select(User).where(User.id == 1))"
      },
      {
        "id": "blocker:SKILL.md:122:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 122,
        "line_end": 122,
        "snippet": "stmt = select(User, Post).join(Post, User.id == Post.author_id)"
      },
      {
        "id": "blocker:SKILL.md:144:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 144,
        "line_end": 144,
        "snippet": "result = await db.execute(select(User).where(User.id == user_id))"
      },
      {
        "id": "blocker:SKILL.md:156:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 156,
        "line_end": 156,
        "snippet": "| Filter | `.where(User.id == 1)` |"
      }
    ],
    "finding_verdicts": [
      {
        "id": "env_access:references/connection-pooling.md:68:python-getenv-function",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "This is a documentation example that reads the non-secret ENV variable to choose pool sizing. It does not expose credentials or send data outside the process."
      },
      {
        "id": "env_access:references/connection-pooling.md:68:getenv-function-call",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "This is a documentation example that reads the non-secret ENV variable to choose pool sizing. It does not expose credentials or send data outside the process."
      },
      {
        "id": "env_access:references/migrations.md:41:configuration-library",
        "verdict": "false_positive",
        "confidence": 0.91,
        "reason": "This is normal Alembic configuration code that reads migration settings inside env.py. There is no evidence of secret disclosure, network exfiltration, or unsafe command execution."
      },
      {
        "id": "env_access:references/migrations.md:61:configuration-library",
        "verdict": "false_positive",
        "confidence": 0.91,
        "reason": "This is normal Alembic configuration code that reads migration settings inside env.py. There is no evidence of secret disclosure, network exfiltration, or unsafe command execution."
      },
      {
        "id": "env_access:references/migrations.md:34:database-connection-strings",
        "verdict": "false_positive",
        "confidence": 0.86,
        "reason": "The database URL is assigned to Alembic from application settings for legitimate migration configuration. It may contain credentials, but the example does not log, transmit, or otherwise expose the value."
      },
      {
        "id": "blocker:references/migrations.md:188:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.93,
        "reason": "The flagged line is a SQLAlchemy documentation example, not system reconnaissance. It uses parameter binding or local ORM identifiers and does not inspect the host system."
      },
      {
        "id": "scripts:references/sqlalchemy-async.md:8:dynamic-import-expression",
        "verdict": "false_positive",
        "confidence": 0.97,
        "reason": "The snippet is a normal Python from-import statement for SQLAlchemy async classes. It is not JavaScript dynamic import or runtime code loading."
      },
      {
        "id": "blocker:references/sqlalchemy-async.md:283:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "The flagged assertion checks a test user id after flushing an in-memory test fixture. It does not gather system information or access sensitive host data."
      },
      {
        "id": "blocker:references/transactions.md:49:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "The flagged flush comment explains obtaining a database row id inside a transaction example. It is not host reconnaissance or sensitive data collection."
      },
      {
        "id": "scripts:SKILL.md:44:dynamic-import-expression",
        "verdict": "false_positive",
        "confidence": 0.97,
        "reason": "The snippet is a normal Python from-import statement for SQLAlchemy async classes. It is not JavaScript dynamic import or runtime code loading."
      },
      {
        "id": "external_commands:SKILL.md:16:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:39:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:43:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:66:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:70:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:92:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:96:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:127:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:131:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:149:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:155:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:156:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:157:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:158:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:159:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:160:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:161:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:165:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:166:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:167:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:168:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:172:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:179:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:180:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "external_commands:SKILL.md:183:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.98,
        "reason": "The flagged content is Markdown formatting or inline SQLAlchemy example text. It is not shell backtick execution and contains no executable command invocation by the skill."
      },
      {
        "id": "blocker:SKILL.md:64:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "The flagged line is a SQLAlchemy documentation example, not system reconnaissance. It uses parameter binding or local ORM identifiers and does not inspect the host system."
      },
      {
        "id": "blocker:SKILL.md:122:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "The flagged line is a SQLAlchemy documentation example, not system reconnaissance. It uses parameter binding or local ORM identifiers and does not inspect the host system."
      },
      {
        "id": "blocker:SKILL.md:144:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "The flagged line is a SQLAlchemy documentation example, not system reconnaissance. It uses parameter binding or local ORM identifiers and does not inspect the host system."
      },
      {
        "id": "blocker:SKILL.md:156:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.97,
        "reason": "The flagged line is an inline SQLAlchemy filter example in a Markdown quick reference table. It does not perform system reconnaissance."
      }
    ],
    "semantic_findings": [],
    "critical_findings": [],
    "high_findings": [],
    "medium_findings": [],
    "low_findings": [],
    "dangerous_patterns": [],
    "files_scanned": 6,
    "total_lines": 1473,
    "audit_model": "codex",
    "audited_at": "2026-07-06T01:58:49.765Z",
    "agent_auto_install_policy": "allowed",
    "manual_install_policy": "allowed"
  },
  "content": {
    "user_title": "Build Reliable Python Database Layers",
    "value_statement": "Python database code can fail through poor session, transaction, or migration patterns. This skill provides practical SQLAlchemy 2.0 patterns for robust applications.",
    "seo_keywords": [
      "Claude",
      "Codex",
      "Claude Code",
      "SQLAlchemy",
      "Python database patterns",
      "Alembic migrations",
      "async SQLAlchemy",
      "connection pooling",
      "unit of work",
      "repository pattern"
    ],
    "actual_capabilities": [
      "Explains SQLAlchemy 2.0 model, query, and relationship patterns.",
      "Shows async engine, session factory, and FastAPI dependency patterns.",
      "Provides Alembic setup guidance and migration command examples.",
      "Describes connection pool sizing, health checks, and monitoring hooks.",
      "Covers transaction scopes, savepoints, isolation levels, and locking.",
      "Includes repository and unit of work patterns for service layers."
    ],
    "limitations": [
      "Does not connect to live databases or inspect production schemas by itself.",
      "Examples use placeholder database URLs that must be replaced safely.",
      "Does not validate every database vendor behavior or SQLAlchemy extension.",
      "Requires users to adapt patterns to their application architecture."
    ],
    "use_cases": [
      {
        "title": "Design Async Database Access",
        "description": "Create clear SQLAlchemy async session patterns for web requests and background tasks.",
        "target_user": "Backend engineers"
      },
      {
        "title": "Plan Safer Migrations",
        "description": "Structure Alembic migrations for schema changes, data backfills, and production rollout steps.",
        "target_user": "Platform engineers"
      },
      {
        "title": "Improve Transaction Boundaries",
        "description": "Choose transaction, savepoint, and locking patterns for consistency in business workflows.",
        "target_user": "Application architects"
      }
    ],
    "prompt_templates": [
      {
        "title": "Create a Basic Model",
        "scenario": "Beginner request for SQLAlchemy model structure.",
        "prompt": "Use this skill to draft SQLAlchemy 2.0 models for these tables: [describe tables]. Include relationships and simple query examples."
      },
      {
        "title": "Add Async Sessions",
        "scenario": "Intermediate request for async application setup.",
        "prompt": "Use this skill to design async SQLAlchemy engine and session handling for my FastAPI app. My database is [database] and my request pattern is [details]."
      },
      {
        "title": "Review Migration Strategy",
        "scenario": "Advanced request for production migration planning.",
        "prompt": "Use this skill to review my Alembic migration plan for [change]. Identify lock risks, rollback limits, and safer rollout steps."
      },
      {
        "title": "Refactor Data Layer",
        "scenario": "Advanced request for architecture improvements.",
        "prompt": "Use this skill to refactor my database code toward repository and unit of work patterns. Explain transaction boundaries and testing impacts."
      }
    ],
    "output_examples": [
      {
        "input": "Design async SQLAlchemy access for a FastAPI users service.",
        "output": [
          "A session factory design with per-request lifecycle guidance.",
          "A dependency pattern that commits, rolls back, and closes sessions consistently.",
          "Notes about eager loading and avoiding async lazy loading failures."
        ]
      },
      {
        "input": "Plan a migration that adds a required phone column to users.",
        "output": [
          "A staged migration plan that starts with a nullable column.",
          "A separate backfill step for existing rows.",
          "A later constraint change after data quality is verified."
        ]
      },
      {
        "input": "Improve transaction safety for an order creation workflow.",
        "output": [
          "A transaction boundary around related repository operations.",
          "Savepoint guidance for optional steps that may fail independently.",
          "Retry guidance for serialization conflicts and deadlocks."
        ]
      }
    ],
    "best_practices": [
      "Use SQLAlchemy 2.0 style queries and typed mapped columns for new code.",
      "Keep session lifetime explicit and tied to request, task, or unit of work boundaries.",
      "Stage production migrations to reduce table locks and rollback risk."
    ],
    "anti_patterns": [
      "Do not keep long-lived sessions shared across unrelated requests or tasks.",
      "Do not rely on async lazy loading for relationships in request handlers.",
      "Do not place real credentials in example code, logs, or migration files."
    ],
    "faq": [
      {
        "question": "Does this skill support SQLAlchemy 2.0?",
        "answer": "Yes. The examples focus on SQLAlchemy 2.0 style models, sessions, and queries."
      },
      {
        "question": "Can it help with async database code?",
        "answer": "Yes. It covers async engines, session factories, FastAPI dependencies, and async testing patterns."
      },
      {
        "question": "Does it generate Alembic migrations?",
        "answer": "It provides patterns and examples for Alembic setup, migration scripts, and safer production changes."
      },
      {
        "question": "Does it run database commands automatically?",
        "answer": "No. It is documentation guidance. Users must decide whether to run commands in their own environment."
      },
      {
        "question": "Can it review transaction safety?",
        "answer": "Yes. It explains commit, rollback, savepoint, isolation, and locking choices for database workflows."
      },
      {
        "question": "Is it tied to PostgreSQL only?",
        "answer": "No. Many patterns are general, but several examples use PostgreSQL and asyncpg placeholders."
      }
    ]
  },
  "file_structure": [
    {
      "name": "assets",
      "type": "dir",
      "path": "assets",
      "children": [
        {
          "name": "alembic.ini.template",
          "type": "file",
          "path": "assets/alembic.ini.template",
          "lines": 60
        }
      ]
    },
    {
      "name": "references",
      "type": "dir",
      "path": "references",
      "children": [
        {
          "name": "connection-pooling.md",
          "type": "file",
          "path": "references/connection-pooling.md",
          "lines": 298
        },
        {
          "name": "migrations.md",
          "type": "file",
          "path": "references/migrations.md",
          "lines": 343
        },
        {
          "name": "sqlalchemy-async.md",
          "type": "file",
          "path": "references/sqlalchemy-async.md",
          "lines": 300
        },
        {
          "name": "transactions.md",
          "type": "file",
          "path": "references/transactions.md",
          "lines": 287
        }
      ]
    },
    {
      "name": "SKILL.md",
      "type": "file",
      "path": "SKILL.md",
      "lines": 185
    }
  ]
}
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 117kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 117kUpdated Claude CodeCodexVerifiedInstall