> validating-a-change
comprehensive validation of a change to ensure it is correct and ready for a pull request
curl "https://skillshub.wtf/stellar/stellar-core/validating-a-change?format=md"Overview
This skill is for validating that a change is correct, complete, and ready for a pull request. It orchestrates several other skills to systematically check formatting, review code, ensure test coverage, and run tests.
This skill involves a lot of work. Consider splitting it into pieces and running each step as a subagent. Keep each subagent focused on a moderate amount of work so it doesn't get lost or wander off track.
Critical principle: Each step must fully resolve its own issues before proceeding to the next step. There is no need to restart from the beginning when issues are found—fix them in place and continue forward.
The ordering prioritizes:
- Code reviews first (catches design and semantic issues early)
- Adding any missing tests
- Running tests
- Multiple configurations (catches config-specific issues)
- Formatting last (mechanical cleanup)
Inputs
Before starting validation, gather the following information (if running as a subagent, the invoking agent should provide these; otherwise, determine them yourself or ask the user):
-
Goal of the change: What is the change trying to accomplish? This is needed for high-level code review.
-
Type of change: Is this a new feature, bug fix, refactor, or performance change? This is needed for the adding-tests step.
-
Bug/issue reference (if applicable): For bug fixes, the issue number.
-
Any specific concerns (optional): Areas wanting extra attention.
If invoking as a subagent, the prompt should include: "Validate change for: <goal>. Change type: <type>. <issue reference if applicable> <specific concerns if any>"
Prerequisites
This skill composes several other skills:
low-level-code-review- for mechanical code reviewhigh-level-code-review- for semantic code reviewadding-tests- for analyzing and adding test coveragerunning-tests- for running tests at all levelsrunning-make-to-build- for building correctlyconfiguring-the-build- for setting up different configurations
Validation Steps
Execute these steps in order. Each step should fully resolve any issues it finds before proceeding to the next step.
Step 1: High-Level Code Review
Consider running as a subagent using the high-level-code-review skill.
Before launching, determine the git range:
- If uncommitted changes exist, use
git diffandgit diff --cached - Otherwise, use
git diff master...HEAD
Launch with prompt: "Review the change for: <goal from inputs>. Get the diff
using <git-command>. <specific concerns if provided>"
This reviews the change for semantic correctness, design consistency, and completeness. The subagent will return a report of issues by severity.
If any Critical or Major issues are found, run a subagent to fix them before proceeding. Minor issues and Suggestions can be addressed or deferred at your discretion.
Step 2: Low-Level Code Review
Consider running as a subagent using the low-level-code-review skill.
Launch with prompt: "Review the diff from <git-command>"
This reviews the diff for small, mechanical coding mistakes that don't require high-level understanding. The subagent will return a worklist of issues.
If any issues are found, run a subagent to fix them before proceeding.
Step 3: Add Tests
Consider running as a subagent using the adding-tests skill.
Launch with prompt: "Analyze and add tests for: <change type from inputs>.
Get the diff using <git-command>. <issue reference if applicable>"
This analyzes the change to determine what tests are needed and adds them. The subagent will return a report of tests added.
Step 4: Run Tests
Consider running as a subagent using the running-tests skill.
Before launching, identify the changed files/modules from the diff.
Launch with prompt: "Run tests through full suite for changes in <files/modules>."
This runs tests at levels 1-3: smoke tests, focused tests, and the full unit test suite. The subagent will return a detailed report of results.
If any tests fail, run a subagent to fix the issues before proceeding.
Step 5: Build and Test with Multiple Configurations
Consider running as a subagent using the running-tests skill with extended levels.
Launch with prompt: "Run tests through sanitizers for changes in <files/modules>. Include fuzz tests if protocol-critical code was changed."
This runs tests at levels 4-6: sanitizer builds (ASan, TSan, UBSan), extra
checks build, and randomized/fuzz tests. See the configuring-the-build skill
for details on configuration options.
Also verify the build succeeds with --disable-tests (the production config).
If any configuration fails to build or any tests fail, run a subagent to fix the issues before proceeding.
Step 6: Format the Code
Run make format to auto-format all source code and verify formatting is clean.
ALWAYS
- ALWAYS consider running long-running steps as subagents to keep them focused
- ALWAYS fully resolve issues within a step before proceeding to the next step
- ALWAYS wait for each subagent to complete before proceeding
- ALWAYS run high-level review before low-level review
NEVER
- NEVER run multiple subagents in parallel (they may conflict)
- NEVER skip any step, even if you think it's unnecessary
- NEVER consider validation complete until all configurations pass
- NEVER skip high-level review just because you want to get to tests faster
Completion
When all steps pass without requiring any code edits, the change is validated and ready for a pull request. Summarize your work as follows:
- Summary of what was validated
- Configurations tested
- Test coverage added (if any)
- Any observations or minor concerns that didn't require changes
If validation cannot be completed (e.g., stuck in a loop), report:
- Which step keeps failing
- What issues keep recurring
- Whether the fundamental approach may need reconsideration
If invoked as a subagent, pass this summary back to the invoking agent.
> related_skills --same-repo
> regenerating a technical summary of stellar-core
Instructions for regenerating the full set of subsystem and whole-system technical summary skill documents for stellar-core
> subsystem-summary-of-work
read this skill for a token-efficient summary of the work subsystem
> subsystem-summary-of-util
read this skill for a token-efficient summary of the util subsystem
> subsystem-summary-of-transactions
read this skill for a token-efficient summary of the transactions subsystem