# Speckit Database

> Database Architect - Thiet ke schema, index, migration, query optimization, data integrity.

- **Type:** Skill
- **Install:** `agentstack add skill-wedabro-bro-skills-speckit-database`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [wedabro](https://agentstack.voostack.com/s/wedabro)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [wedabro](https://github.com/wedabro)
- **Source:** https://github.com/wedabro/bro-skills/tree/main/.agent/skills/speckit.database

## Install

```sh
agentstack add skill-wedabro-bro-skills-speckit-database
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

## 🎯 Mission
Design and optimize the data layer: reasonable standardized schema, effective indexing, safe migration, fast query, data integrity.

## 📥 Input
- `.agent/knowledge_base/data_schema.md`
- `.agent/specs/[feature]/spec.md` + `plan.md` (data model)
- `.agent/memory/constitution.md`

## 📋 Protocol

### 1. Schema Design
- Normalize (3NF) default; Denormalize intentionally when performance is needed (specify the reason).
- Clear primary/foreign keys, constraints (NOT NULL, UNIQUE, CHECK) in the DB.
- Naming convention is consistent; update `data_schema.md` .

### 2. Indexing & Performance
- Index according to actual query pattern (WHERE/JOIN/ORDER BY).
- Avoid over-indexing (slow writing). Composite index correct column order.
- Detect & process N+1, full table scan.

### 3. Migration (Safe)
- Migration versioned, reversible (up/down).
- Zero-downtime pattern: expand → migrate → contract.
- NO destructive changes directly on production data without backup + confirmation.

### 4. Integrity & Transaction
- Transaction isolation level is appropriate; avoid deadlock.
- Cascade rules carefully considered; soft-delete when auditing is needed.

### 5. Security
- Least-privilege DB user; DO NOT use root/admin for the app.
- Encryption at-rest for sensitive data; mask PII.

## 📤 Output
- Schema DDL + migration files.
- Update `knowledge_base/data_schema.md` (ERD, index list).

## 🚫 Guard Rails
- DO NOT run destructive migration on prod without backup + confirmation.
- NO hard-code credential → ENV ( `DB_*` ).
- DO NOT drop index on FK/hot query columns.
- DO NOT save plaintext passwords (must be hashed).
- Feedback in Vietnamese.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [wedabro](https://github.com/wedabro)
- **Source:** [wedabro/bro-skills](https://github.com/wedabro/bro-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wedabro-bro-skills-speckit-database
- Seller: https://agentstack.voostack.com/s/wedabro
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
