add-integration-test
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Boilerplate (copy from tests/integration/gather_phase.bats): Dispatch mode (for multi-agent phase tests): Single mode (for synthesis tests): Synthesis tests require all findings to exist. Copy fixtures, not raw — dispatch routing needs the three-way identity: Check raw output — integration tests run with `||
1 other project uses a version of this.
Adopted by
Most recently taken up by
- radimsem/remindbtheir own version, first seen May 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- radimsem/remindb★ 125same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/workflows/CLAUDE.mdCLAUDE.md
- lib/CLAUDE.mdCLAUDE.md
- prompts/CLAUDE.mdCLAUDE.md
- schemas/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- add-bats-testSkill
- add-edge-testSkill
- add-gather-agentSkill
- add-synthesis-fixtureSkill
- audit-prompt-schema-syncSkill
- bundle-and-verifySkill
- check-ci-locallySkill
- debug-agent-failureSkill
- fixture-syncSkill
- pre-pr-checklistSkill
- rebuild-test-imageSkill
- release-ultrainitSkill
- run-testsSkill
- tune-synthesis-contextSkill
- validate-generated-artifactSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 138
Check raw output — integration tests run with || true in CI and always show green.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Before You Start
tests/integration/gather_phase.bats— dispatch mode setup pattern, failure gating teststests/integration/synthesize_phase.bats— synthesis retry, ULTRAINIT_MAX_RETRIES usagetests/integration/resume.bats— state.json phase-completion skip patterntests/helpers/test_helper.bash—_common_setup,make_claude_envelopetests/fixtures/findings/— all 8 findings fixtures to use in dispatch
Steps
1. Create the .bats file
touch tests/integration/<phase>_<scenario>.batsBoilerplate (copy from tests/integration/gather_phase.bats):
#!/usr/bin/env bats
# Integration tests for <phase_function>: <scenario>
setup() {
load '../helpers/test_helper'
_common_setup
load '../helpers/mock_claude'
setup_mock_claude
# Set ULTRAINIT_MAX_RETRIES=1 for any test involving synthesis
# (prevents 30s retry delays in error-path tests)
export ULTRAINIT_MAX_RETRIES=1
}
teardown() {
_common_teardown
}2. Choose mock mode
Dispatch mode (for multi-agent phase tests):
@test "gather_evidence: all agents succeed" {
# Create dispatch responses for all 8 core agents
for agent in identity commands git-forensics patterns tooling docs-scanner security-scan structure-scout; do
make_claude_envelope \
"$(cat "$BATS_TEST_DIRNAME/../fixtures/findings/${agent}.json")" \
"0.15" > "$MOCK_CLAUDE_DISPATCH_DIR/${agent}.json"
done
run gather_evidence
assert_success
assert_file_exists "$WORK_DIR/findings/identity.json"
run jq '.gather' "$WORK_DIR/state.json"
refute_output 'null'
}Single mode (for synthesis tests):
@test "synthesize: pass 1 writes CLAUDE.md output" {
# Pre-populate all findings that build_docs_context reads
for agent in identity commands git-forensics patterns tooling docs-scanner security-scan structure-scout; do
cp "$BATS_TEST_DIRNAME/../fixtures/findings/${agent}.json" \
"$WORK_DIR/findings/"
done
cp "$BATS_TEST_DIRNAME/../fixtures/developer-answers.json" \
"$WORK_DIR/developer-answers.json"
make_claude_envelope \
"$(cat "$BATS_TEST_DIRNAME/../fixtures/synthesis/output-docs.json")" \
"2.50" > "$MOCK_CLAUDE_RESPONSE"
run synthesize
assert_success
assert_file_exists "$WORK_DIR/synthesis/output-docs.json"
}3. Write resume/skip tests
@test "gather_evidence: skips when phase already complete" {
# Mark gather complete in state.json
mark_phase_complete "gather"
FORCE=false run gather_evidence
assert_success
# Verify mock was never called
run grep -c 'CALL:' "$MOCK_CLAUDE_LOG"
assert_output "0"
}4. Pre-populate findings for downstream phase tests
Synthesis tests require all findings to exist. Copy fixtures, not raw — dispatch routing needs the three-way identity:
# Correct: copy to $WORK_DIR/findings/ (not synthesis/)
cp "$BATS_TEST_DIRNAME/../fixtures/findings/identity.json" "$WORK_DIR/findings/"
# WRONG: developer-answers.json goes in $WORK_DIR, NOT findings/
cp "$BATS_TEST_DIRNAME/../fixtures/developer-answers.json" "$WORK_DIR/developer-answers.json"5. Assert on phase state and findings
# Phase completion
run is_phase_complete "gather"
assert_success
# Findings file exists and has correct content
assert_file_exists "$WORK_DIR/findings/identity.json"
run jq -e '.name' "$WORK_DIR/findings/identity.json"
assert_successVerify
make test-integrationCheck raw output — integration tests run with || true in CI and always show green.
Common Mistakes
- Forgetting
make_claude_envelopewrapper — raw fixture JSON causesrun_agentto write"null"to findings silently. Every mock response must be envelope-wrapped. - Dispatch name collision — dispatch mode matches by case-insensitive substring of
--json-schemabasename. Ifdocs.jsonappears beforedocs-scanner.jsonin alphabetical order, the wrong fixture is served. Use more specific names. - Systemic failure threshold math —
gather_phase.batspre-creates exactly 4 of 8 findings to test systemic failure (3+ of 8 failed). If you add a 9th core agent, update this test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

