Agent skill
validation-history-schema-initialization
Initialize PostgreSQL schema for validation history tables
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/validation-history-schema-initialization
Metadata
Additional technical details for this skill
- tags
- validation,history,database,schema,postgresql
- version
- 1
- created at
- 2026-01-29T23:36:28.500Z
- difficulty
- intermediate
- updated at
- 2026-01-29T23:36:28.500Z
- compatibility
- 2.1.0+
SKILL.md
Validation History Schema Initialization
This skill provides guidance on initializing PostgreSQL database schema for validation history storage.
When To Use
- Creating new ValidationHistoryStore instance
- Setting up validation history for first time
- Database migration or fresh installation
Procedure
- Create PostgreSQLConnector with valid config
- Initialize ValidationHistoryStore with connector
- Call
initialize_schema()method - Verify tables created with
connector.table_exists()
Example
from vibe_piper.connectors.postgres import PostgreSQLConnector, PostgreSQLConfig
from vibe_piper.validation.history import PostgreSQLValidationHistoryStore
config = PostgreSQLConfig(
host='localhost',
port=5432,
database='vibe_piper',
user='postgres',
password='password'
)
connector = PostgreSQLConnector(config)
connector.connect()
store = PostgreSQLValidationHistoryStore(connector)
store.initialize_schema()
# Tables created:
# - validation_runs
# - validation_check_results
# - validation_metrics
# - Indexes for efficient querying
Tables Created
validation_runs: Stores validation run metadatavalidation_check_results: Stores individual check resultsvalidation_metrics: Stores quality metric measurements
Indexes Created
idx_validation_runs_asset: Query by asset nameidx_validation_runs_status: Query by statusidx_validation_runs_started_at: Query by date (descending)idx_check_results_run: Query check results by runidx_metrics_asset: Query metrics by assetidx_metrics_metric: Query metrics by nameidx_metrics_timestamp: Query metrics by date
Notes
- Schema uses ON DELETE CASCADE for referential integrity
- All tables have created_at timestamp for auditing
- Method is idempotent - safe to call multiple times
- Requires psycopg2 connector with execute_query support
Manual notes
This section is preserved when the skill is updated. Put human notes, caveats, and exceptions here.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?