Validate environment before any PM skill runs. Checks sqlite3, database, schema. Hard stop on failure — no fallbacks.
Runs before ANY other PM skill. Validates the environment is ready. If it fails, STOP. No fallbacks. No workarounds.
/pm-preflight
Called automatically by /pm before dispatching. Can also be run standalone to verify setup.
which sqlite3 || python3 -c "import sqlite3; print('python3-sqlite3')"
If neither works:
STOP: sqlite3 is not available on this system.
Install it:
macOS: brew install sqlite3
Ubuntu: sudo apt-get install sqlite3
Alpine: apk add sqlite
Python: sqlite3 module is built-in — use python3 instead of sqlite3 CLI
Cannot proceed without SQLite. PM skills MUST NOT write directly to markdown,
JSON, CSV, or any other format as a workaround.
Present this message to the user and STOP. Do not attempt alternative approaches.
ls .claude/db/ 2>/dev/null || mkdir -p .claude/db
sqlite3 .claude/db/marketing.sqlite ".tables" 2>/dev/null | grep -q epics
If epics table is missing, run the PM schema migration:
our_products, tags). If not, warn user to initialize competitive-intel first.product_features). If not, run feature-tracker schema.sql first.-- Check and add columns to product_features
SELECT COUNT(*) FROM pragma_table_info('product_features') WHERE name = 'epic_id';
-- If 0: ALTER TABLE product_features ADD COLUMN epic_id TEXT REFERENCES epics(id);
SELECT COUNT(*) FROM pragma_table_info('product_features') WHERE name = 'base_version';
-- If 0: ALTER TABLE product_features ADD COLUMN base_version INTEGER NOT NULL DEFAULT 1;
-- Check and add columns to product_feature_tests
SELECT COUNT(*) FROM pragma_table_info('product_feature_tests') WHERE name = 'requirement_id';
-- If 0: ALTER TABLE product_feature_tests ADD COLUMN requirement_id TEXT REFERENCES requirements(id);
SELECT COUNT(*) FROM pragma_table_info('product_feature_tests') WHERE name = 'base_version';
-- If 0: ALTER TABLE product_feature_tests ADD COLUMN base_version INTEGER NOT NULL DEFAULT 1;
SELECT version FROM schema_versions WHERE skill = 'pm';
Compare against expected version. If mismatch, run migration steps for the gap.
PM Preflight: OK
sqlite3: /usr/bin/sqlite3
database: .claude/db/marketing.sqlite
schema: pm v1
tables: epics, requirements, iterators, iterator_values (+ existing)