From article-writer
Validates and repairs SQLite database records (.article_writer/article_writer.db) against schemas for authors, settings, and articles tables. Supports --check, --fix, and interactive modes.
npx claudepluginhub mwguerra/claude-code-plugins --plugin article-writer--check | --fix | --interactive# Doctor - Database Validation & Repair
Validate and repair records in the SQLite database (`.article_writer/article_writer.db`).
**Tables validated:**
- `authors` - Author profiles
- `settings` - Global configuration
- `articles` - Article queue
**Documentation:** [docs/COMMANDS.md](../docs/COMMANDS.md#article-writerdoctor)
## Usage
Runs: `bun run "${CLAUDE_PLUGIN_ROOT}"/scripts/doctor.ts [--check | --fix]`
## What It Checks
### Database Integrity
- SQLite `PRAGMA integrity_check`
- `PRAGMA foreign_key_check` for referential integrity
### Articles Table
- All required fields pres.../database-reviewAnalyzes database schemas, queries, and architecture in codebase or scoped changes/PRs, generating prioritized optimization plan as markdown report.
/databaseGuides interactive database design, schema review, migration planning, and query optimization. Produces plans, scripts, and suggestions with confirmation stops.
/design-database-schemaDesigns optimized database schemas from business requirements, modeling entities, relationships, data types, constraints, and generating SQL DDL examples like user management and e-commerce.
/doctorRuns environment diagnostics across 12 categories, identifies issues, and offers interactive fixes for providers, auth, RTK, hooks, and token optimization. Also supports category-specific checks.
/doctorDiagnoses pro-workflow and Claude Code setup health by checking installations, hooks functionality, git safety, context usage, CLAUDE.md size, git status, and settings.
/doctorDiagnoses babysitter run health (optional run-id uses most recent), checking 10 areas: journal integrity, state cache, effects, locks, sessions, logs, disk usage, and more. Produces structured report with PASS/WARN/FAIL statuses.
Share bugs, ideas, or general feedback.
Validate and repair records in the SQLite database (.article_writer/article_writer.db).
Tables validated:
authors - Author profilessettings - Global configurationarticles - Article queueDocumentation: docs/COMMANDS.md
# Interactive mode (default) - ask for each issue
/article-writer:doctor
# Check only - report issues without fixing
/article-writer:doctor --check
# Auto-fix - fix with defaults, no prompts
/article-writer:doctor --fix
Runs: bun run "${CLAUDE_PLUGIN_ROOT}"/scripts/doctor.ts [--check | --fix]
PRAGMA integrity_checkPRAGMA foreign_key_check for referential integrity| Issue | Auto-Fix Action |
|---|---|
| Missing required string | Set to "" or ask user |
| Missing required array | Set to [] |
| Missing status | Set to "pending" |
| Missing created_at | Set to current timestamp |
| Invalid enum value | Ask user to select valid option |
| Wrong field type | Attempt conversion or ask user |
| Unknown fields | Report (keep by default) |
| Missing author reference | Use default author or ask |
When issues require user input:
π Article Writer Doctor
========================
Checking database integrity...
β Database integrity: OK
β Foreign key constraints: OK
Validating authors...
β 2 authors valid
Validating settings...
β Settings valid
Validating articles...
Article #3: Missing 'created_at' field
β Auto-fix: Set to "2025-01-15T10:00:00Z"? [Y/n]
Article #5: Invalid status "wip"
β Valid options: pending, in_progress, draft, review, published, archived
β Select replacement: [1-6]
Summary:
Checked: 10 articles, 2 authors, settings
Issues found: 3
Fixed: 2
β
Database has been repaired
.article_writer/schemas/