feat(skills): reworked skills and rules
CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s

This commit is contained in:
Julian Lechner committed 2026-11-18 14:17:49 +01:00
1 parent 29632ff0ce
commit f5d8f6f11b
124 files changed
+1250 -8138

No files matched your search

@@ -1,20 +1,21 @@
---
name: integration-test-write
description: Use when adding or changing tests for behavior across a real boundary, such as an API and database, filesystem command, or cooperating services. Not for isolated unit behavior.
description: Use when adding or changing tests for behavior across a real boundary, such as an API and database, filesystem command, or cooperating services. Not for isolated units or UI-driven tests.
---
# Integration Test Write
Use when verifying behavior across a real application boundary, such as an API and database, a command and filesystem, or cooperating services.
Use when verifying behavior across a real application boundary, such as an API and database, a command and filesystem, or cooperating services. When Superpowers `test-driven-development` applies, it sets the order (failing test first); this skill decides the boundary, fixtures, and isolation.
## Workflow
1. Name the boundary under test and the production path the test must exercise. Keep unit-level details covered by unit tests.
2. Reuse the repository's integration-test setup. Before relying on external service, driver, or test-framework behavior, MUST apply the implementation checkpoint in `technical-research`. Start only the services and data stores required for this behavior.
3. Prepare minimal isolated data and control external inputs. Prevent test runs from touching user data, shared environments, or live services.
4. Cover a successful interaction and the failure or rejection path that matters to the change. Include transaction, retry, or cleanup behavior only when it is part of the contract.
5. Assert persisted or externally observable outcomes, including relevant status, response, and side effects.
6. Clean up created resources even when assertions fail. Make repeated runs safe and independent.
7. Run the focused integration test and report required services, results, and any unavailable environment. MUST apply the verification checkpoint in `technical-research` to external contract claims; a mock or documentation excerpt cannot prove the real boundary works.
3. Test against the real engine the application uses, started per run in a container (for example with Testcontainers) or as a dedicated test instance. Do not use the EF Core in-memory provider as a database fake: EF Core discourages it because it skips relational behavior such as constraints, transactions, raw SQL, and query translation. SQLite in-memory is closer but still differs from the production engine; use it only where those differences cannot matter. For ASP.NET Core, host the app with `WebApplicationFactory` and replace only external dependencies through `ConfigureTestServices`.
4. Prepare minimal isolated data and control external inputs. Use synthetic, non-personal test data; never copy production or personal records. Prevent test runs from touching user data, shared environments, or live services. For third-party APIs, use the provider's sandbox or test mode, or contract tests, and report the gap that remains against the live provider.
5. Cover a successful interaction and the failure or rejection path that matters to the change. Include transaction, retry, or cleanup behavior only when it is part of the contract.
6. Assert persisted or externally observable outcomes, including relevant status, response, and side effects.
7. Isolate tests: wrap each test in a transaction that is rolled back, or reset the data between tests; tests whose code manages its own transactions need a separate database and must not run in parallel. Clean up created resources even when assertions fail, and make repeated runs safe and independent.
8. Run the focused integration test and report required services, results, and any unavailable environment. MUST apply the verification checkpoint in `technical-research` to external contract claims; a mock or documentation excerpt cannot prove the real boundary works.
Avoid turning an integration test into a full end-to-end suite when a narrower boundary proves the contract.
@@ -26,6 +26,7 @@
"Explains that tests must not touch live services",
"Proposes a controlled alternative such as test-mode keys or a local stub",
"States that a mock or documentation cannot prove the real external contract",
"Reports the gap that remains against the live provider",
"Covers both a successful charge and a decline or failure path",
"Asserts observable outcomes such as status or recorded side effects"
],
@@ -42,6 +43,19 @@
"Does not produce a full end-to-end suite for this behavior"
],
"files": []
},
{
"prompt": "Add integration tests for our ASP.NET Core 10 OrdersController and its EF Core repository. Keep it fast: just use UseInMemoryDatabase so we don't need SQL Server.",
"expected_output": "Explains that EF Core discourages the in-memory provider as a database fake because it skips constraints, transactions, raw SQL, and query translation, so the tests could pass while production fails. Proposes hosting the app with WebApplicationFactory and running SQL Server in a container (for example Testcontainers) or a dedicated test instance, with per-test transaction rollback or data reset. Names the trade-off to the user rather than silently following or ignoring the request.",
"assertions": [
"Does not silently use the EF Core in-memory provider as the database",
"Explains why the in-memory provider gives false confidence",
"Uses WebApplicationFactory to host the app",
"Proposes a real SQL Server instance such as a container",
"Isolates tests with transaction rollback or data reset"
],
"files": [],
"id": 4
}
]
}