Skip to content

aiskillstore/marketplace / skills/aayushbaniya2006/db-handler

db-handler

Verified

Manage database schemas, Drizzle ORM, migrations, and data modeling. Use when creating tables, modifying columns, or planning database changes.

FileKindSize
SKILL.mdskill md1.7 KB
reference.mdmarkdown2.1 KB
skill-report.jsonconfig18.9 KB

skill-report.json

View on GitHub
{
  "schema_version": "2.0",
  "meta": {
    "generated_at": "2026-07-05T00:37:28.642Z",
    "slug": "aayushbaniya2006-db-handler",
    "source_url": "https://github.com/AayushBaniya2006/blinkfund/tree/main/.claude/skills/db-handler",
    "source_ref": "main",
    "model": "codex",
    "analysis_version": "3.0.0",
    "source_type": "community",
    "content_hash": "6e3fdc96c5b22d97d5616ba33b9dafbaca887bdd24eec6467086b25e3baea24a",
    "tree_hash": "524122a410922ea1e7ac175751cdf15111e685ac077fa944f40df795c1621e21",
    "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": "db-handler",
    "description": "Plan and edit Drizzle ORM database schemas, including tables, relations, indexes, JSONB validation, and migration workflows.",
    "summary": "Guides Drizzle ORM schema design, relations, indexes, and safe database change planning.",
    "icon": "📦",
    "version": "1.0.0",
    "author": "AayushBaniya2006",
    "license": "MIT",
    "tags": [
      "database",
      "drizzle",
      "postgresql",
      "schema-design",
      "migrations"
    ],
    "supported_tools": [
      "claude",
      "codex",
      "claude-code"
    ],
    "risk_factors": [
      "external_commands"
    ],
    "category": "data"
  },
  "security_audit": {
    "risk_level": "medium",
    "is_blocked": false,
    "safe_to_publish": true,
    "analysis_status": "ok",
    "summary": "Most static detections are false positives caused by Markdown code spans for file paths, identifiers, and examples. One finding is confirmed because the skill instructs agents to run npx drizzle-kit push, and a semantic concern is direct schema synchronization without migration review. No prompt injection or data exfiltration intent was found.",
    "remediation": [
      {
        "issue": "Direct database schema push",
        "suggestion": "Require explicit user confirmation and environment selection before any drizzle-kit push. Prefer reviewed migration files for production changes.",
        "severity": "medium"
      },
      {
        "issue": "Unpinned npx execution",
        "suggestion": "Use a project-local pinned package script instead of ad hoc npx execution when a schema command is needed.",
        "severity": "medium"
      },
      {
        "issue": "Ambiguous database environment boundaries",
        "suggestion": "State that destructive schema changes must not run against production unless the user names the target database and approves the operation.",
        "severity": "medium"
      }
    ],
    "risk_factor_evidence": [
      {
        "factor": "external_commands",
        "evidence": [
          {
            "file": "SKILL.md",
            "line_start": 13,
            "line_end": 13
          },
          {
            "file": "SKILL.md",
            "line_start": 16,
            "line_end": 16
          },
          {
            "file": "SKILL.md",
            "line_start": 19,
            "line_end": 19
          },
          {
            "file": "SKILL.md",
            "line_start": 20,
            "line_end": 20
          },
          {
            "file": "SKILL.md",
            "line_start": 24,
            "line_end": 24
          },
          {
            "file": "SKILL.md",
            "line_start": 25,
            "line_end": 25
          },
          {
            "file": "SKILL.md",
            "line_start": 26,
            "line_end": 26
          },
          {
            "file": "SKILL.md",
            "line_start": 29,
            "line_end": 29
          },
          {
            "file": "SKILL.md",
            "line_start": 36,
            "line_end": 36
          }
        ]
      }
    ],
    "static_findings": [
      {
        "id": "external_commands:SKILL.md:13:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 13,
        "line_end": 13,
        "snippet": "1.  **Draft**: Create the `pgTable` definition in `src/db/schema/{domain}.ts`."
      },
      {
        "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": 16,
        "snippet": "3.  **Relations**: Define `relations` and Foreign Keys."
      },
      {
        "id": "external_commands:SKILL.md:19:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 19,
        "line_end": 19,
        "snippet": "-   **DO NOT** generate migration files (e.g., `drizzle-kit generate`)."
      },
      {
        "id": "external_commands:SKILL.md:20:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 20,
        "line_end": 20,
        "snippet": "-   **DO** use `npx drizzle-kit push` to sync schema changes directly to the database."
      },
      {
        "id": "external_commands:SKILL.md:24:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 24,
        "line_end": 24,
        "snippet": "- All Foreign Keys (e.g., `userId`, `planId`)."
      },
      {
        "id": "external_commands:SKILL.md:25:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 25,
        "line_end": 25,
        "snippet": "- Columns frequently used in `WHERE` clauses (e.g., `status`, `email`)."
      },
      {
        "id": "external_commands:SKILL.md:26:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 26,
        "line_end": 26,
        "snippet": "- Columns used for sorting (e.g., `createdAt`)."
      },
      {
        "id": "external_commands:SKILL.md:29:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 29,
        "line_end": 29,
        "snippet": "- Use Drizzle's Relational Query API (`with: { ... }`) or explicit `.leftJoin()` to fetch related da"
      },
      {
        "id": "external_commands:SKILL.md:36:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 36,
        "line_end": 36,
        "snippet": "- **Enums**: Export as constants (`export const roleEnum = ...`)."
      },
      {
        "id": "blocker:SKILL.md:33:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 33,
        "line_end": 33,
        "snippet": "- Avoid breaking changes without explicit confirmation."
      }
    ],
    "finding_verdicts": [
      {
        "id": "external_commands:SKILL.md:13:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.92,
        "reason": "The backticks mark a file path in Markdown. There is no instruction to execute this path as a shell command."
      },
      {
        "id": "external_commands:SKILL.md:16:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "The backticks mark the Drizzle helper name relations. It is documentation text, not a command or dynamic execution."
      },
      {
        "id": "external_commands:SKILL.md:19:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.82,
        "reason": "The command is mentioned as an example of what not to run. It does not authorize execution, although the migration workflow is reviewed separately."
      },
      {
        "id": "external_commands:SKILL.md:20:ruby-shell-backtick-execution",
        "verdict": "confirmed",
        "confidence": 0.84,
        "severity": "medium",
        "reason": "The instruction tells the agent to run npx drizzle-kit push, which executes project tooling and can mutate the connected database. This creates integrity and availability risk without explicit safeguards."
      },
      {
        "id": "external_commands:SKILL.md:24:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.95,
        "reason": "The backticks mark example column names in Markdown. These identifiers are not executable commands."
      },
      {
        "id": "external_commands:SKILL.md:25:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.95,
        "reason": "The backticks mark example filter column names. The line gives indexing guidance and does not request command execution."
      },
      {
        "id": "external_commands:SKILL.md:26:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.95,
        "reason": "The backticks mark an example sorting column name. It is schema documentation, not shell execution."
      },
      {
        "id": "external_commands:SKILL.md:29:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.93,
        "reason": "The backticks describe Drizzle query API syntax and a join method. This is code documentation, not an external command."
      },
      {
        "id": "external_commands:SKILL.md:36:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.93,
        "reason": "The backticks show a TypeScript export example. It is not a shell command or dynamic execution path."
      },
      {
        "id": "blocker:SKILL.md:33:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.97,
        "reason": "This line tells the agent to seek confirmation before breaking changes. It contains no reconnaissance request and reduces operational risk."
      }
    ],
    "semantic_findings": [
      {
        "title": "Direct Database Schema Push Without Migration Review",
        "description": "The skill instructs agents to avoid generated migrations and use npx drizzle-kit push to sync schema changes directly. This can alter database structure without an auditable migration file or production review.",
        "severity": "medium",
        "locations": [
          {
            "file": "SKILL.md",
            "line_start": 19,
            "line_end": 20
          }
        ],
        "confidence": 0.88,
        "confidence_reasoning": "The workflow is stated directly in adjacent instructions. It is not evidence of malicious intent, but it is a concrete database integrity risk."
      }
    ],
    "critical_findings": [],
    "high_findings": [],
    "medium_findings": [
      {
        "title": "Ruby/shell backtick execution",
        "description": "-   **DO** use `npx drizzle-kit push` to sync schema changes directly to the database.",
        "locations": [
          {
            "file": "SKILL.md",
            "line_start": 20,
            "line_end": 20
          }
        ],
        "review_kind": "capability",
        "source_category": "external_commands",
        "source_severity": "medium",
        "confidence": 0.84,
        "confidence_reasoning": "The instruction tells the agent to run npx drizzle-kit push, which executes project tooling and can mutate the connected database. This creates integrity and availability risk without explicit safeguards."
      },
      {
        "title": "Direct Database Schema Push Without Migration Review",
        "description": "The skill instructs agents to avoid generated migrations and use npx drizzle-kit push to sync schema changes directly. This can alter database structure without an auditable migration file or production review.",
        "locations": [
          {
            "file": "SKILL.md",
            "line_start": 19,
            "line_end": 20
          }
        ],
        "review_kind": "security",
        "source_category": "semantic",
        "source_severity": "medium",
        "confidence": 0.88,
        "confidence_reasoning": "The workflow is stated directly in adjacent instructions. It is not evidence of malicious intent, but it is a concrete database integrity risk."
      }
    ],
    "low_findings": [],
    "dangerous_patterns": [],
    "files_scanned": 2,
    "total_lines": 116,
    "audit_model": "codex",
    "audited_at": "2026-07-05T00:37:28.642Z",
    "agent_auto_install_policy": "allowed",
    "manual_install_policy": "allowed"
  },
  "content": {
    "user_title": "Manage Drizzle Database Changes",
    "value_statement": "Database schema changes can create data loss, slow queries, or inconsistent Drizzle definitions. This skill guides Claude, Codex, and Claude Code through structured schema design, relations, indexes, and review steps.",
    "seo_keywords": [
      "Claude",
      "Codex",
      "Claude Code",
      "Drizzle ORM",
      "database schema",
      "PostgreSQL",
      "schema migrations",
      "database modeling",
      "JSONB validation",
      "query optimization"
    ],
    "actual_capabilities": [
      "Drafts Drizzle pgTable schemas grouped by domain.",
      "Adds columns, primary keys, timestamps, relations, and foreign keys.",
      "Recommends indexes for joins, filters, and sorting.",
      "Uses Zod typing guidance for JSONB columns.",
      "Explains relational queries and joins to avoid N+1 queries.",
      "Prompts for confirmation before complex or breaking schema changes."
    ],
    "limitations": [
      "Does not inspect a live database unless the agent has separate project access.",
      "May suggest direct schema pushes, which need explicit user review.",
      "Does not replace production migration planning or backup procedures.",
      "Does not validate business data rules without domain requirements."
    ],
    "use_cases": [
      {
        "title": "Create a new domain table",
        "description": "Plan a Drizzle table with fields, relations, indexes, and review questions before implementation.",
        "target_user": "Backend developers"
      },
      {
        "title": "Review schema change safety",
        "description": "Check a planned column or relation change for migration risk, compatibility, and confirmation needs.",
        "target_user": "Technical leads"
      },
      {
        "title": "Improve relational query performance",
        "description": "Identify missing indexes and N+1 query patterns when related data loads slowly.",
        "target_user": "Product engineers"
      }
    ],
    "prompt_templates": [
      {
        "title": "Draft a Table",
        "scenario": "Beginner schema creation",
        "prompt": "Use db-handler to draft a Drizzle table for [entity]. Include UUID IDs, timestamps, relations, and indexes. Ask before any database push."
      },
      {
        "title": "Modify Columns Safely",
        "scenario": "Intermediate schema update",
        "prompt": "Use db-handler to update [table] with [new fields]. Prefer nullable fields or defaults, and identify any breaking change risks."
      },
      {
        "title": "Optimize Related Data Loading",
        "scenario": "Advanced performance review",
        "prompt": "Use db-handler to review [query flow]. Find N+1 patterns, missing indexes, and better relation loading options."
      },
      {
        "title": "Plan Production Migration Review",
        "scenario": "Advanced release planning",
        "prompt": "Use db-handler to evaluate this schema change for production. List data risks, rollback concerns, confirmation steps, and migration review needs."
      }
    ],
    "output_examples": [
      {
        "input": "Create a subscriptions table linked to users and plans.",
        "output": "A proposed table design with key fields, user and plan relations, index recommendations, and a confirmation question before applying changes."
      },
      {
        "input": "Our dashboard loads users and their posts slowly.",
        "output": "A performance review that identifies likely N+1 access, recommends relation loading or joins, and lists indexes for common filters."
      },
      {
        "input": "Add settings to each organization record.",
        "output": "A safe column plan that recommends JSONB validation, nullable rollout options, and checks for production migration risk."
      }
    ],
    "best_practices": [
      "Confirm the target environment before syncing or migrating schema changes.",
      "Index foreign keys, frequent filters, and common sort fields when designing tables.",
      "Define JSONB validation with Zod before storing structured settings."
    ],
    "anti_patterns": [
      "Running schema push commands before the user confirms the table design.",
      "Adding JSONB fields for unrelated data that should be normalized.",
      "Fetching related records inside loops instead of loading them in one query."
    ],
    "faq": [
      {
        "question": "Can this skill change my database automatically?",
        "answer": "It can suggest schema commands, but changes should require explicit user confirmation and project access."
      },
      {
        "question": "Does it support Drizzle ORM?",
        "answer": "Yes. The instructions focus on Drizzle ORM tables, relations, indexes, and relational query patterns."
      },
      {
        "question": "Can Claude Code use this skill?",
        "answer": "Yes. It is described for Claude, Codex, and Claude Code workflows."
      },
      {
        "question": "Does it create migration files?",
        "answer": "The skill discourages generated migrations, so production users should add their own migration review process."
      },
      {
        "question": "Does it handle JSONB columns?",
        "answer": "Yes. It requires Zod schema guidance for JSONB columns before storing structured data."
      },
      {
        "question": "When should I use it?",
        "answer": "Use it when planning tables, relations, indexes, schema updates, or Drizzle query performance improvements."
      }
    ]
  },
  "file_structure": [
    {
      "name": "reference.md",
      "type": "file",
      "path": "reference.md",
      "lines": 75
    },
    {
      "name": "SKILL.md",
      "type": "file",
      "path": "SKILL.md",
      "lines": 41
    }
  ]
}
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: 119kUpdated 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: 119kUpdated 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: 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: 118kUpdated Claude CodeCodexVerifiedInstall