/maruda:data-validationfrom maruda
Inspects project data for correctness and produces a read-only validation report covering record counts, NULL rates, value distribution, uniqueness, referential integrity, and format validity. Reads only from test fixtures or explicitly configured non-production connections.
Ships in maruda. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You verify that a project's data is what the code assumes it is. Findings are grounded in concrete numbers and sampled rows, never in impressions. Every failed check states the expected value, the actual value, and the evidence that produced it.
This is a read-only inspection. You do not modify data, schema, or code. Remediation is
the job of gh-issue-resolver; this skill only produces the verdict it acts on.
| Mode | Invoked by | File output |
|---|---|---|
| standalone | the user (/maruda:data-validation <path>) | none by default — session output only. Save to docs/data-validation/<target>.YYYYMMDD.md only when the user explicitly asks for a report file |
| verify | gh-issue-resolver Step 8 | never — session output only |
No JSON summary is produced in either mode. This skill is deliberately excluded from the
progress-dashboard data flow so that routine validation does not add commit targets.
testdata/, fixtures/, test/fixtures/, spec/fixtures/,
seeds/, db/seeds/, factory definitions (factories/, *_factory.*),
golden files (*.golden, *.snap), and fixture loaders referenced from the test setup.DATABASE_URL in .env.test / .env.local, a docker-compose.yml service, or a
test container definition. The value must be read from a file in the repository; do not
accept one inferred from shell history, cloud credentials, or a running process.SOURCE: unavailable and list exactly what is missing. Do not guess a
connection, do not scan the network, and do not fall back to a production target.Permitted: SELECT and equivalent reads, EXPLAIN, reading fixture files, running the
project's existing read-only data scripts with an explicit dry-run flag.
Forbidden: INSERT / UPDATE / DELETE / TRUNCATE, any DDL, applying or rolling back
migrations, seeding, cache warming, and any connection to a production environment —
including read-only ones — unless the user names that target in the current request.
If a check cannot be performed without a write, mark it SKIPPED and state why. Never
substitute a write to make a check runnable.
A validation without an expectation is just a statistic. Before checking, derive what the data is supposed to look like, from — in order of authority:
NOT NULL / UNIQUE / FOREIGN KEY,
enum types, CHECK constraints)docs/spec.md if spec-doc has been runRecord which contract each check came from. A check with no contract behind it is a WARN at most — it cannot be a FAIL.
Work through every category. For each check, record: target, expectation, actual value, verdict, and the source of the expectation.
parent_a × parent_b is a defect)For every column, compute the rate of absent values, counting all four forms separately:
| Form | Example |
|---|---|
NULL | NULL |
| empty string | '' |
| zero value | 0, 0000-00-00, 1970-01-01T00:00:00Z |
| sentinel | "N/A", "unknown", "-", "null" (as a string) |
A column declared NOT NULL that is 100% empty strings is a FAIL even though the
constraint technically holds. Report the form, not just the rate.
CHECK constraint's rangecreated_at later
than updated_at; rows outside the period the feature has existedUNIQUE columns / composite unique indexes"true" / "1" / "yes" inconsistently)Every FAIL and WARN carries up to 5 real rows as evidence. A finding with no sample is not reportable.
Mask PII in every sample before it is written anywhere:
| Field | Masked form |
|---|---|
a***@example.com | |
| phone | 090-****-**12 |
| name | first character + *** |
| address | prefecture / city level only |
| ID number, token, card | fully redacted — [REDACTED] |
Show enough of the value to identify the defect and no more. If a defect cannot be shown without exposing PII, describe the shape instead of quoting the value.
Each check resolves to PASS, WARN, FAIL, or SKIPPED. Defaults:
| Check | FAIL when | WARN when |
|---|---|---|
| Table read by the code has zero rows | always | — |
NOT NULL column absent (any of the 4 forms) | > 0% | — |
| Optional column absent | — | > 30% |
| Duplicate PK / unique-constraint violation | ≥ 1 row | — |
| Orphan foreign key | ≥ 1 row | — |
| Value outside the declared enum | ≥ 1 row | — |
| Type mismatch against the schema | ≥ 1 row | — |
| Format violation on a validated field | ≥ 1 row | — |
created_at > updated_at | ≥ 1 row | — |
| Future-dated or epoch-zero timestamp | — | ≥ 1 row |
| Single categorical value dominates | — | > 99% |
| Distinct-value count is 1 where >1 is expected | — | always |
| Numeric outlier beyond median ± 3σ | — | ≥ 1 row |
| Row-count change vs. baseline | — | > ±50% |
Overall RESULT = the worst verdict across all checks (FAIL > WARN > PASS).
SKIPPED never sets the overall result but must be listed.
Contract rule (from 1.3): a check whose expectation came only from inference — not from a schema, type definition, or test assertion — caps at WARN. Autonomous remediation must never be triggered by a guess.
This phase is what makes autonomous remediation safe. Run it whenever a baseline is
available: in verify mode gh-issue-resolver supplies the base ref, and the same checks are
run against the base state before the diff is judged.
Classify every FAIL and WARN into exactly one of:
| Class | Definition | Who fixes it |
|---|---|---|
| regression | Passes on the baseline, fails on the current state | gh-issue-resolver, autonomously, within the agreed plan's impact scope |
| pre-existing | Fails on the baseline too | Nobody, here. Propose an Issue instead |
| environmental | Fixture missing, connection unavailable, tooling absent | Nobody. Report and stop |
When no baseline is available (standalone mode), every finding is unknown — and
unknown is never treated as a regression.
Emit the classification under a stable marker so the caller can parse it without JSON:
<!-- data-validation:attribution -->
| ID | Class | Basis |
|----|-------|-------|
| D-01 | regression | PASS on base `main`; FAIL after `migrations/0012_add_status.sql` |
| D-02 | pre-existing | FAIL on base `main` as well — unrelated to this change |
Before emitting the report, verify:
unknown used when it does notThe header block is fixed — gh-issue-resolver parses it. Keep the marker, the key names,
and the ordering exactly as below.
<!-- data-validation:result -->
RESULT: FAIL
SUMMARY: 12 passed / 3 failed / 2 warned / 1 skipped
SOURCE: fixtures (testdata/seed.sql, factories/user_factory.rb)
SCOPE: db/migrations/, internal/model/
BASELINE: main@a1b2c3d
# Data Validation: [Target] — YYYY-MM-DD
> Read-only inspection — no data, schema, or code was modified.
## Summary
[2–3 sentences: what was checked, the most severe failure, and what it blocks.]
## Check Results
| ID | Check | Category | Expected | Actual | Verdict |
|----|-------|----------|----------|--------|---------|
| D-01 | `orders.status` within enum | Validity | one of `pending,paid,shipped` | 41 rows = `PAID` | FAIL |
| D-02 | `users.email` NOT NULL | Completeness | 0% absent | 3.2% empty string | FAIL |
| D-03 | `order_items.order_id` → `orders.id` | Integrity | 0 orphans | 7 orphans | FAIL |
| D-04 | `users.created_at` range | Distribution | ≤ now | 2 future-dated | WARN |
| D-05 | `payments` row count | Volume | > 0 | 0 rows | SKIPPED |
<!-- data-validation:attribution -->
| ID | Class | Basis |
|----|-------|-------|
| D-01 | regression | PASS on base; the migration added `PAID` without updating the enum |
| D-02 | pre-existing | FAIL on base as well |
| D-03 | regression | PASS on base; cascade removed in this change |
| D-04 | pre-existing | FAIL on base as well |
| D-05 | environmental | fixture `payments.yml` not loaded by the test setup |
## Findings
### D-01 — `orders.status` contains values outside the declared enum
**Verdict**: FAIL | **Category**: Validity | **Class**: regression
**Contract**: `db/migrations/0012_add_status.sql` — `CHECK (status IN ('pending','paid','shipped'))`
**Expected**: every row's `status` is one of `pending` / `paid` / `shipped`
**Actual**: 41 of 512 rows (8.0%) hold `PAID` — correct value, wrong case
**Evidence** (5 of 41):
| id | status | created_at |
|----|--------|-----------|
| 1043 | `PAID` | 2026-07-30T09:12:00Z |
| 1044 | `PAID` | 2026-07-30T09:14:11Z |
| 1051 | `PAID` | 2026-07-30T10:02:47Z |
| 1067 | `PAID` | 2026-07-31T08:30:05Z |
| 1090 | `PAID` | 2026-07-31T14:55:20Z |
**Likely cause**: `internal/model/order.go:88` writes `strings.ToUpper(status)` while the
constraint added in this change expects lower case.
**Remediation direction**: normalise at the writer, not at the constraint — the enum is the
contract. Fix `order.go:88`; leave the migration as authored.
---
### D-02 — `users.email` is empty on 3.2% of rows
**Verdict**: FAIL | **Category**: Completeness | **Class**: pre-existing
**Contract**: `internal/model/user.go` — `Email string \`validate:"required,email"\``
**Expected**: 0% absent on a `NOT NULL` column
**Actual**: 16 of 500 rows hold `''` — the column is `NOT NULL` so the constraint passes
while the value is meaningless
**Evidence** (5 of 16):
| id | email | signup_source |
|----|-------|--------------|
| 88 | `''` | `import-2025` |
| 91 | `''` | `import-2025` |
| 96 | `''` | `import-2025` |
| 104 | `''` | `import-2025` |
| 132 | `''` | `import-2025` |
**Likely cause**: the 2025 bulk import path bypassed validation. Present on the base branch —
**out of scope for this change**.
**Remediation direction**: file as a separate Issue. Add a `CHECK (email <> '')` and backfill
or quarantine the 16 rows.
## Skipped Checks
| ID | Check | Reason |
|----|-------|--------|
| D-05 | `payments` volume | Fixture `payments.yml` exists but is not loaded by the test setup; validating would require seeding, which this skill does not do |
## Recommended Actions
| Class | ID | Action |
|-------|----|--------|
| **regression — fix in this change** | D-01 | Normalise status to lower case in `internal/model/order.go:88` |
| **regression — fix in this change** | D-03 | Restore the cascade on `order_items.order_id` |
| **pre-existing — file an Issue** | D-02 | Backfill or quarantine 16 rows with empty `email` |
| **pre-existing — file an Issue** | D-04 | Investigate 2 future-dated `created_at` values |
| **environmental — report only** | D-05 | Load `payments.yml` in the test setup |
regression is the current change's problem.
pre-existing becomes an Issue; unknown is never auto-fixed.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/dependency-auditAudit third-party dependencies for known vulnerabilities (OWASP A06) without running SAST. Scans lockfiles under a path (plus the owning workspace root lockfile) and explicitly named container images with a pinned Trivy; reports severity, package, version, fixed version, source, and reachability. Records what was scanned and marks what could not be as "not run" with the reason, never as zero. Writes a security-audit-format report for `report-to-issues` and a JSON summary. Only when the user asks, also converts each scanned target into an SBOM (CycloneDX by default, or SPDX) — never by default. Triggers on requests like "依存の脆弱性を調べて", "依存を監査して", "ロックファイルの脆弱性", "ベースイメージの脆弱性", "dependency audit", "check dependencies for CVEs", "scan the lockfile", "scan this image", "SBOMも出して", "generate an SBOM", "CycloneDX", "SPDX", "/maruda:dependency-audit", or when `vulnerability-scan` or `gh-issue-resolver` delegates the dependency audit. Read-only: never upgrades, installs, regenerates a lockfile, or builds an image.
/gh-batch-runnerRun several planned GitHub Issues as one unit: collect them under an Epic Issue with sub-issues, implement each on a shared epic/ branch in dependency order, verify the branch as a whole, and open a single Pull Request into the integration branch. Use when the user wants several Issues fixed, verified and released together. Triggers include requests such as Issue1,2,3をまとめて対応して / まとめて修正してリリースしたい / この3件を一緒に出して, 'batch these issues', 'do issues 1 2 3 together', 'ship these issues as one release'. Prerequisite: every member Issue needs an agreed plan comment from gh-issue-planner. For a single Issue, or for Issues that ship separately, use gh-issue-resolver instead./gh-issue-drafterTurn a rough, hand-written intent into a well-scoped GitHub Issue before planning starts. Takes a loose 'what I want' from the user, proposes the missing structure (Done definition, Out of scope, Design constraints), gets the user's approval, and creates the Issue via the gh CLI with a scoped-issue marker so gh-issue-planner can pick it up. When the intent is too large for one Issue, it proposes splitting it into independent Issues or an Epic with sub-issues. This is the human-authored counterpart to report-to-issues (which registers machine-generated findings). Use when the user wants to file a new Issue from a rough idea, is about to write an Issue by hand, or asks to turn a note/thought into an Issue. Triggers include requests like Issueを起こして / Issueを作って / ざっくり書くのでIssueにして, 'draft an issue', 'create an issue for', 'turn this into an issue', 'file an issue'. Does NOT plan or implement — hand off to gh-issue-planner for the response plan, then gh-issue-resolver for implementation./gh-issue-plannerFetch a GitHub Issue by ID using the gh CLI, investigate related code, propose a structured response plan (policy, impact scope, implementation steps), and post the agreed plan as a comment on the issue. Implementation/PR creation is out of scope — use gh-issue-resolver for that. Use when the user provides a GitHub Issue ID or asks to investigate/analyze/plan a GitHub Issue. Triggers include issue IDs like #42 or 'issue 42', requests such as Issueを調査して / Issueの対応方針を立てて, analyze issue #N, plan issue #N, investigate issue, look at issue. Accepts several Issues at once (e.g. '1,2,3' or 'Issue 1と2を計画して'): it investigates once and posts one agreed-plan comment per Issue./gh-issue-resolverImplement and verify a fix for a GitHub Issue whose response plan has already been posted as a comment by gh-issue-planner. Creates a feature branch, applies the agreed plan, runs tests, and opens a Pull Request. Use when the user asks to implement/fix/resolve a planned GitHub Issue. Triggers include requests such as Issueを実装して / Issueを修正して / Issueを対応して, implement issue #N, fix issue #N, resolve issue #N, work on issue #N. Prerequisite: an agreed plan comment must exist on the issue (run gh-issue-planner first if not)./gh-pr-reviewerReview a diff before it becomes a Pull Request (or an open PR) against the intent it was written for: the agreed plan posted by `gh-issue-planner`, the Issue's Done conditions, or the PR description. Checks that the change stays inside the agreed impact scope, covers every Done condition, keeps what the plan said must not be cut, and does not weaken tests or thresholds; then has the diff read once in a fresh context for bugs. Reports findings with `file:line`, classified Important / Nit / Pre-existing, in a fixed header `gh-issue-resolver` and `gh-batch-runner` read. Triggers on requests like "review this diff", "review the PR", "PRをレビューして", "差分をレビューして", "プラン通りか確認して", "/maruda:gh-pr-reviewer", or when `gh-issue-resolver` reviews its own change, or `gh-batch-runner` a whole epic branch, before opening a PR. Does NOT modify code, Issues or PRs — read-only. Produces no JSON.
npx claudepluginhub northraystudio/maruda --plugin maruda