feat: add cmk:test-resources, cmk:rust, cmk:testcontainers; harden cmk:cicd - #7
Merged
Merged
Conversation
…trap A parallel test runner that executes each test as its own process (nextest, for instance) silently defeats in-process "shared resource" singletons — the sharing never happens, but nothing fails to reveal it. cmk:test-resources teaches verifying the runner's real process model before designing sharing, the two valid shapes once it's known, and namespacing a genuinely shared external resource by every scope that can race it. cmk:cicd gains a matching named trap: a multi-part CI speedup gets every part credited unless the win is traced to the mechanism that actually moved it, letting an inert sibling change ride along unverified.
…family shape cmk:rust covers idiomatic Rust inside a crate cmk:project-layout already placed: module boundaries, error-handling shape choice, feature-flag defaults, lint/test wiring, and dependency hygiene, distilled from auditing a real large Rust workspace's actual (not aspirational) conventions. cmk:testcontainers is the Rust-crate-specific mechanics layer under it: retry/backoff around container startup, guard lifetime, host/port readback, mapped onto cmk:test-resources' two sharing shapes. Also gives cmk:test-resources a proper Modes section and cmk:testcontainers a Modes + Verify section, matching every other setup-family skill's shape instead of a bespoke one-off structure. Updates conventions.md's per-skill bookkeeping (version, family membership, references/ roster) accordingly.
…per variant Adds a speed-structure pattern for consolidating N per-variant workspace compiles (one per feature combination, target, or lint pass) into a single grouped pass over the union of what needs checking, cross-linked to cmk:rust's computed feature-union mechanic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmk:test-resources: designing safe, expensive-resource sharing (containers, databases, external services) across a test suite under a parallel runner. Core teaching: verify the runner's real process model (nextest executes each test as its own process) before assuming an in-processstaticsingleton actually shares anything; the two valid shapes once that's known (in-process singleton vs. one externally-started resource namespaced per consumer); namespacing must compose a process-unique discriminator with any per-call counter, since a counter alone only disambiguates within its own process.cmk:rust: apply idiomatic Rust practices inside a crate whose shape the design already decided (cmk:project-layoutowns crate placement; this starts one level in). Five facets, each split into areferences/file: module boundaries (public-surface convention), error handling (three legitimate shapes — typed/propagated, boundary/opaque, plain classification data), feature flags (default-off, whole-subsystem gating, mechanically computed feature union), build/test/lint wiring (toolchain pin, nextest's process-per-test implications, one layer for lint strictness), and dependency hygiene (policy scanner vs. hand-written graph assertions — neither substitutes for the other).cmk:testcontainers: the Rust/testcontainers-crate-specific mechanics layered under both of the above — bounded retry/backoff around container startup, bundling the container guard'sDrop-driven lifetime inside whatever struct carries connection info, always reading back host/port, and treatingcmk:test-resources' two sharing shapes as alternatives, never both at once.cmk:cicd:cmk:test-resources, which is the same principle one layer down.cmk:rust's computed-feature-union mechanic.docs/ai/skills/self-documentation (README roster, family listing,conventions.mdbookkeeping, newtest-resources.md/rust.md/testcontainers.md,cicd.mdrefresh) to match, and every new skill follows the setup-family shape (## Modes+ report-only## Verify).Distilled from a real incident: a session's entire "shared testcontainer per test binary" optimization effort silently contributed zero benefit for two packages, because nextest's process-per-test execution model meant the in-process statics never persisted across tests — the measured CI speedup was real but came entirely from an unrelated, pre-existing mechanism. A second bug (ordinal-only database naming colliding across processes once correctly routed to a real shared server) motivated the namespacing guidance. The Rust-structure and CI-build-grouping content generalizes patterns observed while doing that work, checked against the codebase's actual (not aspirational) practice.
Test plan
bash scripts/skill-lint.shpasses (frontmatter, size budget, reference integrity, citations, cross-package paths)SKILL.mdstays within the 150-line budget (41–104 lines)skills/(kit's genericity bar)## Modesand a report-only## Verifysection