src/skills/x-plan-tests/SKILL.md
Generates a Double-Loop TDD test plan with TPP-ordered acceptance and unit scenarios.
npx skillsauth add edercnj/ia-dev-environment x-plan-testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produces a Double-Loop TDD test plan that drives implementation order. With ≥95% line / ≥90% branch coverage enforced (Rule 05 RULE-005-01), the plan serves as the implementation roadmap — each test scenario maps to one Red-Green-Refactor cycle, ordered by Transformation Priority Premise (TPP).
/x-plan-tests STORY-ID — generate test plan for a specific story| Parameter | Required | Description |
|-----------|----------|-------------|
| STORY-ID | Yes | Story identifier to plan tests for. If not provided, prompt for it. |
| Artifact | Path |
|----------|------|
| Test plan | .aikittools/features/feature-XXXX/plans/tests-story-XXXX-YYYY.md |
| Origin marker | YAML frontmatter (generated-by: x-plan-tests@<sha>, generated-at, story-id) — mandatory per Rule 24 |
| Status side-effect (v2 features only) | Story **Status:** transitions Pendente → Planejada (idempotent) |
Idempotent on staleness: when mtime(plan) >= mtime(story), returns the existing plan without invoking any subagent (RULE-002).
0. PRE-CHECK -> mtime(story) vs mtime(plan); skip generation if plan is fresh
1. GATHER_CONTEXT -> general-purpose subagent (model: opus) reads KPs + story + existing code
2. PLAN_TESTS -> Acceptance Tests (Outer Loop) + Unit Tests in TPP order (Inner Loop) + IT
3. ESTIMATE -> Coverage estimation table + 10-point quality checks
4. WRITE -> Emit Markdown with origin-marker frontmatter; (v2) transition status
Detailed Step 0 mtime algorithm, Step 1 subagent prompt with KP read list and 12-item context output, Step 2 TPP Level 1–6 catalog with transforms, AT/UT/IT field tables, Step 3 quality checks, full Markdown output template, anti-patterns catalog, RULE-012 template fallback, and Planning Status Propagation (Rule 22) live in references/full-protocol.md:
model: "opus" (Rule 23 RULE-002); resolve packs via x-internal-select-context-packs --phase plan --capabilities <test-scoped-capabilities> using anti-inflation rules (baseline qa,testing; add runtime/language, security, architecture only when evidenced by story/repo signals). Treat selector output as canonical (includes hybrid technology assessment internally): load all required, include only scope-relevant recommended, avoid parallel hardcoded lists. Additionally read plan-story-XXXX-YYYY.md > Section 2.6 when the story plan exists — project into 13th context item: "interface contracts and pre/postconditions from Section 2.6 of the story plan (used to anchor AT/UT Spec Ref fields)"; 12+1 item context summary contract (test categories, naming, frameworks, fixture pattern, ACs, business rules, exceptions, layer boundaries, existing patterns, contract/chaos applicability, template sections, spec contracts from Section 2.6).Spec Ref points to the interface/method from Section 2.6.1 (or story Section 5) that the AT scenario validates; write "—" when the story has no structural interface.Spec Ref points to the interface/method from Section 2.6.1 that the UT cycle verifies.EIE_EVIDENCE_MISSING); full Markdown output template._TEMPLATE-TEST-PLAN.md is absent.Pendente → Planejada transition via native **Status:** field rewrite; commit via Skill(x-commit-changes).| Scenario | Action | |----------|--------| | No story ID provided | Prompt user for story identifier | | Story file not found | Abort with file-not-found message | | Existing plan is fresh (RULE-002) | Return existing plan, skip generation | | Template not found (RULE-012) | Log warning, use inline format, continue | | No Gherkin scenarios in story | Generate tests from acceptance criteria text | | No acceptance criteria found | Abort with warning, request story refinement |
| Pack | File | Purpose |
|------|------|---------|
| selector | src/patterns/asset-usage-matrix.csv + x-internal-select-context-packs | Canonical plan-pack selection by phase/capability |
| testing | src/patterns/backend/testing/patterns.md | Non-unit categories (integration, API/E2E, contract, performance), fixture strategy, data uniqueness |
| testing | src/patterns/backend/languages/java/21/patterns.md | Java unit-test frameworks, naming conventions, assertions, and mocking rules |
| testing | src/patterns/backend/testing/patterns.md | Contract and performance playbooks to derive acceptance/integration test plans |
| architecture | src/patterns/backend/software-architecture/hexagonal/patterns.md | Exception hierarchy, layer boundaries |
| security | src/patterns/backend/security/java/patterns.md | Java-specific CWE-mapped anti-patterns to mirror in error-path tests |
Execution note: this table is referential. Effective context loading MUST follow x-internal-select-context-packs output (required plus scope-relevant recommended only).
| Skill | Relationship | Context |
|-------|-------------|---------|
| x-implement-story | called-by | Invoked during Phase 1B |
| x-implement-task | reads | Output consumed as TDD roadmap |
model: "opus" (Rule 23 RULE-002) for deep test planning quality.Minimum viable contract above. Detailed Step 0 idempotency algorithm, Step 1 subagent prompt with 12-item context contract, Step 2 TPP Level 1–6 catalog with transform rules, full AT/UT/IT field tables, Step 3 quality-check checklist, origin-marker frontmatter contract, anti-patterns, template fallback, and Planning Status Propagation procedure live in references/full-protocol.md per ADR-0012 (skill body slim-by-default).
development
Documentation freshness gate: validates 6 dimensions (readme, api, adr, etc.) per PR.
testing
Conditional dep-policy gate: CVEs, licenses, versions, freshness; SARIF + report.
documentation
Incrementally updates the service or system architecture document; never regenerative.
development
Scans code and git history for leaked credentials, API keys, and tokens; SARIF output.