| name | validate-build |
| description | Standalone build and test validation โ any language, discovery-driven. Reads .claude/context/language-config.md for the target repo and runs the configured restore, build, and test commands, parsing output via the repo's configured regex patterns. Reports results in a structured format with pass/fail status.
|
| allowed-tools | Bash, Read, Grep, Glob |
| argument-hint | [repo-name-or-path] |
/validate-build โ Build & Test Validation (Language-Agnostic)
Usage: /validate-build [repo-name-or-path]
Runs a full build and test validation cycle against a repo by reading its entry in
.claude/context/language-config.md. No per-language logic lives in this skill โ
everything comes from discovered configuration.
Pre-Flight: Resolve Target Repo
- Read
.claude/context/language-config.md.
- Resolve the target repo:
- If
$ARGUMENTS[0] matches a repo name in the config, use that entry.
- Else if
$ARGUMENTS[0] is a path, match it against each repo's project_root.
- Else, auto-detect from the current working directory by walking up to find a
matching
project_root.
- If no match, report clearly and stop.
- From the matched entry, extract:
project_root
restore_command (optional โ may be empty)
build_command
build_zero_warning_flag (optional)
zero_warning_support (native | linter-based | none)
build_error_pattern (regex)
build_warning_pattern (regex)
build_success_pattern (regex)
test_command
test_summary_pattern (regex)
If any required field is missing, report the missing field and stop โ the user
needs to re-run /init-workspace to regenerate the config.
Arguments
$ARGUMENTS[0] (optional): Repo name (from language-config.md) or a path.
If omitted, auto-detect from the current directory.
Steps
All commands run from project_root unless the configured command already embeds a
cd. Use cd <project_root> && <cmd> when invoking via Bash.
1. Restore Dependencies
If restore_command is set and non-empty, run it:
cd "<project_root>" && <restore_command> 2>&1
If empty, skip this step silently. If the restore command fails, record the error
and continue to the build step so the user gets a complete picture.
2. Build
Compose the build command. If zero_warning_support == "native" and
build_zero_warning_flag is non-empty, append the flag to the build command:
cd "<project_root>" && <build_command> <build_zero_warning_flag> 2>&1
Otherwise, run the build command as-is:
cd "<project_root>" && <build_command> 2>&1
Parse the combined stdout/stderr output:
- Count matches of
build_error_pattern โ error count, capture top 10 for the report.
- Count matches of
build_warning_pattern โ warning count, capture top 10.
- Presence of
build_success_pattern โ success signal (used alongside the error count
and the process exit code).
Zero-warning handling:
3. Run Tests
cd "<project_root>" && <test_command> 2>&1
Parse the output using test_summary_pattern. The regex is expected to capture
named groups where possible: total, passed, failed, skipped. If the regex
is positional, rely on the configured capture order. Combine parsed results with
the process exit code to determine pass/fail.
4. Present Report
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BUILD & TEST VALIDATION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Timestamp: <YYYY-MM-DD HH:MM UTC>
Repo: <repo-name>
Project root: <project_root>
Language: <language> (runtime: <runtime_version>)
โโโ Restore โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Status: SUCCESS | FAILED | SKIPPED (no restore_command configured)
<if failed: error details>
โโโ Build โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Command: <build_command> [<zero_warning_flag>]
Status: SUCCESS (0 errors, 0 warnings)
| FAILED (<N> errors, <M> warnings)
Zero-warning policy: <native | linter-based | none>
<if errors, list top 10 matches of build_error_pattern>
Errors:
<match 1>
...
<if warnings, list top 10 matches of build_warning_pattern>
Warnings:
<match 1>
...
<if zero_warning_support == "none":>
โ ๏ธ Zero-warning enforcement not configured for this repo
(zero_warning_support: none). Reviewer must verify quality manually.
โโโ Tests โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Command: <test_command>
Status: PASSED | FAILED
Total: <count>
Passed: <count>
Failed: <count>
Skipped: <count>
<if failures, list each failing test captured from output (top 5)>
โโโ Summary โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Overall: READY FOR PR | NOT READY
<If not ready, list specific action items>
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
5. Overall Verdict
The build is READY only if ALL of:
- Restore succeeded (or was skipped because no
restore_command is configured)
- Build exited zero AND error count from
build_error_pattern is zero
- For
zero_warning_support == "native", warning count is zero (warnings are errors
under the flag, so this is implied by the error check)
- Tests exited zero AND parsed failure count is zero
Otherwise it is NOT READY with specific action items listed.
Rules
- This skill is read-only analysis โ it does NOT modify code.
- Always run the full pipeline (restore โ build โ test) even if an earlier step fails.
- Never hardcode language-specific commands (
dotnet, mvnw, gradle, pytest, etc.)
in this skill. All commands come from language-config.md.
- If
language-config.md is missing or has no entry for the target repo, report
clearly and instruct the user to run /init-workspace.
- Truncate verbose output (show top 10 errors/warnings, top 5 failed tests). Mention
if more exist.