spec-write-it
Skill1 starsChanged 6 months agoMITView on GitHub
Generate required integration test cases to cover integrations with all external services. These tests will be run in a real env with real services.
In this repository19 other files it gives its agents.
- spec-app-reviewSkill
- spec-blueprintSkill
- spec-dependency-analysisSkill
- spec-evidence-analysisSkill
- spec-failure-domain-analysisSkill
- specifySkill
- spec-integrity-analysisSkill
- spec-matrixSkill
- spec-object-reviewSkill
- spec-reviewSkill
- spec-risk-complexity-analysisSkill
- spec-scope-boundary-analysisSkill
- spec-security-analysisSkill
- spec-to-planSkill
- spec-us-to-frSkill
- spec-write-frSkill
- spec-write-nfrSkill
- spec-write-strSkill
- spec-write-usSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 19 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to specify integration test cases that verify connectivity and behavior with external services.
- Very specific: line 37
Use Template (REQUIRED): assets/integration-test-template.md
- Distinctive: line 42
Test Data: TD-XXX fixtures with rationale
- Distinctive: line 55
No Code Examples: Describe behavior, not implementation
- Distinctive: line 71
Every IT specification MUST include acceptance criteria from BOTH categories:
- Distinctive: line 74
Verify the real, non-mocked environment is correctly established:
- Distinctive: line 77
Test data fixtures are loaded into real stores
- Distinctive: line 81
Verify REAL OUTPUT from REAL SERVICES — not mocked return values:
- Distinctive: line 108
When a mock IS used, the IT MUST state:
- Very specific: line 116
CRUD ITs: MUST POST/GET/PUT/DELETE to real endpoints, verify response codes, body structure, and database state after each operation.
- Distinctive: line 118
Validation ITs: MUST send invalid payloads and verify real 4xx error responses.
- Distinctive: line 119
Auth ITs: MUST send requests with/without credentials, verify real 401/403.
- Distinctive: line 122
Migration ITs: MUST run real Alembic migrations, verify schema state.
- Very specific: line 123
Query ITs: MUST insert/query/update/delete against real PostgreSQL, verify row state.
- Distinctive: line 124
Constraint ITs: MUST violate unique/FK constraints, verify real DB errors propagated.
- Distinctive: line 127
Publish ITs: MUST publish to real Kafka/AMQP topic, consume, verify payload.
- Distinctive: line 128
Consume ITs: MUST produce test event, verify service processes it and side-effects visible.
- Distinctive: line 131
Job ITs: MUST submit real job, verify execution, verify completion state in store.
- Distinctive: line 132
Timeout ITs: MUST submit slow job, verify timeout and cleanup behavior.
- Very specific: line 135
LLM ITs: MUST use a deterministic scripted LLM (e.g., ScenarioChatModel), invoke via real API, verify tool calls executed and results …
- Distinctive: line 137
Tool ITs: MUST execute real tools, verify real file/process state.
- Distinctive: line 138
Streaming ITs: MUST connect real SSE/WS endpoints, verify event sequence.
- Distinctive: line 142
Every IT file MUST begin with YAML frontmatter:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Generate Integration Test Cases
Use this skill to specify integration test cases that verify connectivity and behavior with external services. These tests run in real environments (e.g., KIND cluster) against actual service dependencies.
Scope
- HTTP client integrations (API calls to other services)
- Event bus connections (Kafka, RabbitMQ)
- Database connections (Postgres, Redis)
- External APIs (cloud providers, third-party services)
ID Schema
- IT-XXX: Integration Test identifier
- IT-XXX-SC-XX: Success Criteria within a test
- TD-XXX: Test Data fixture identifier
Each test case is a separate file. Sequential numbering within the service spec.
Cross-Component References
ISO 29148 supports bidirectional traceability across system boundaries. You can reference requirements from other service specs:
catalog-service/FR-001: Reference to another service's functional requirementconfig-service/NFR-002: Reference to another service's non-functional requirement
This is best practice for integration verification where your test validates behavior defined in another service's specification.
Process
- Identify Integration Points: List all external service dependencies from the codebase.
- Select ID: Next available
IT-XXX. - Use Template (REQUIRED):
assets/integration-test-template.md - Document Each Section:
- Dependencies: Other IT-XXX tests and cross-component FR/NFR references
- Target Integration: Service and protocol
- Preconditions: Environment and data state
- Test Data: TD-XXX fixtures with rationale
- Execution Plan: Atomic steps with timeout and criteria
- Expected Outcome: Success condition and failure modes
- Traceability: Link to FR/StR/NFR/TD
- Output: Save to
spec/integration/IT-XXX-description.md
Output Location
- Single Repo:
spec/integration/IT-XXX-description.md - Multi-Repo:
specs/<category>/<component>/spec/integration/IT-XXX-description.md
Rules
- No Code Examples: Describe behavior, not implementation
- Technical Prose: Explain WHY and WHAT data at each step
- Atomic Steps: One action per step with independent success criteria
- Explicit Timeouts: Every action step must have a timeout
- Traceability Required: Every test links to at least one FR/StR/NFR
- Cross-Component OK: Reference requirements from other service specs
IT Reality Testing Rules
[!CAUTION] Integration tests are ALWAYS REAL by default. Nothing is mocked unless the spec explicitly says so. An IT that only checks imports or constructs models without exercising real behavior is a GAP.
Mandatory AC Categories
Every IT specification MUST include acceptance criteria from BOTH categories:
Category 1: Real Setup ACs
Verify the real, non-mocked environment is correctly established:
- Service under test is running and healthy (real health endpoint, real HTTP response)
- Dependencies are available (real database, real message bus, real external service)
- Test data fixtures are loaded into real stores
- Configuration is applied through real config loading paths
Category 2: Real Output ACs
Verify REAL OUTPUT from REAL SERVICES — not mocked return values:
- HTTP responses from real endpoints (status codes, headers, body structure)
- Database state changes from real queries (rows inserted, updated, deleted)
- Event messages published to real event bus topics
- File system state from real tool execution (files created, content correct)
- SSE/WebSocket streams from real connections (event types, data payloads)
- LLM responses through real provider chains (token streaming, tool calls)
What "Real" Means
| Real (Required) | Not Real (GAP) |
| POST to API endpoint, assert response body | assert MyModel is not None |
| Query database after write, verify rows changed | MyModel(field="value") without DB |
| Publish event, consume from real bus, verify payload | assert EventSchema is not None |
| GET /health, verify HTTP 200 with status body | assert app is not None |
| Load config from file, call API, verify behavior | assert config.key == "value" |
| Connect WebSocket, send message, read response | assert MessageType.TEXT exists |
Mocking Policy
- Default: NO MOCKS. ITs exercise real service boundaries.
- Approved mock targets (only when the spec explicitly requires it):
- External third-party APIs (payment, auth, cloud) → use test doubles with real HTTP
- External services outside the test boundary → use contract-faithful stubs
- Never mock: HTTP transport, config loading, database connections, file I/O, session storage, event publishing, health endpoints, WebSocket/SSE connections.
- When a mock IS used, the IT MUST state:
- WHY the real service cannot be used
- WHAT the mock replaces (specific boundary)
- HOW the mock is verified to be faithful (contract tests, schema validation)
Common IT Patterns by Service Type
API Services (FastAPI, REST)
- CRUD ITs MUST POST/GET/PUT/DELETE to real endpoints, verify response codes, body structure, and database state after each operation.
- Validation ITs MUST send invalid payloads and verify real 4xx error responses.
- Auth ITs MUST send requests with/without credentials, verify real 401/403.
Database Services (pg-data-service)
- Migration ITs MUST run real Alembic migrations, verify schema state.
- Query ITs MUST insert/query/update/delete against real PostgreSQL, verify row state.
- Constraint ITs MUST violate unique/FK constraints, verify real DB errors propagated.
Event-Driven Services (FastStream workers)
- Publish ITs MUST publish to real Kafka/AMQP topic, consume, verify payload.
- Consume ITs MUST produce test event, verify service processes it and side-effects visible.
Worker Services (deploy-worker, scenario-runner)
- Job ITs MUST submit real job, verify execution, verify completion state in store.
- Timeout ITs MUST submit slow job, verify timeout and cleanup behavior.
Agent Services (LLM orchestration)
- LLM ITs MUST use a deterministic scripted LLM (e.g.,
ScenarioChatModel), invoke via real API, verify tool calls executed and results returned. - Tool ITs MUST execute real tools, verify real file/process state.
- Streaming ITs MUST connect real SSE/WS endpoints, verify event sequence.
Frontmatter (Required)
Every IT file MUST begin with YAML frontmatter:
---
id: IT-XXX
title: "<Title>"
artifact_type: IT
status: DRAFT # DRAFT | APPROVED | IMPLEMENTED | VERIFIED | DEPRECATED
relationships: # Required: FR/StR/NFR references
- target: "ix://org/repo/FR-XXX"
type: "verifies"
cardinality: "1:1"
---References
- Template: assets/integration-test-template.md
- Example: assets/integration-test-example.md
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.

