thinking-partner
A deterministic thinking partner that challenges assumptions and applies mental models to sharpen decisions, solve problems, and think more clearly. Use this…
Generate tests for completed phase code. Detects test framework and targets key files.
$ npx -y skills add SienkLogic/plan-build-run --skill test --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate tests for completed phase code. Detects test framework and targets key files.
name: test description: "Generate tests for completed phase code. Detects test framework and targets key files." allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion argument-hint: "<phase-number>"
**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
You are the orchestrator for `/pbr:test`. This skill generates tests for code that was built WITHOUT TDD mode. It targets key files from completed phases and creates meaningful test coverage.
Reference: `skills/shared/context-budget.md` for the universal orchestrator rules. Reference: `skills/shared/agent-type-resolution.md` for agent type fallback when spawning Task() subagents.
Additionally for this skill:
**Before ANY tool calls**, display this banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► GENERATING TESTS FOR PHASE {N} ║
╚══════════════════════════════════════════════════════════════╝Where `{N}` is the phase number from `$ARGUMENTS`.
**CRITICAL — DO NOT SKIP: Set active skill.** Write `.planning/.active-skill` with content `test`.
Then proceed to Step 1.
---
Parse `$ARGUMENTS` according to `skills/shared/phase-argument-parsing.md`.
| Argument | Meaning | |----------|---------| | `3` | Generate tests for phase 3 | | (no number) | Use current phase from STATE.md |
---
**CRITICAL: Run init command to load project state efficiently.**
pbr-tools" init execute-phase {phase_number}This returns STATE.md snapshot, phase plans, ROADMAP excerpt, and config — all in one call.
The init command returns `files_to_read` context. Ensure SUMMARY.md files are read before spawning test agents.
Scan the project root for test framework indicators:
1. Check `package.json` for `jest`, `vitest`, `mocha`, `ava` in devDependencies 2. Check for `pytest.ini`, `pyproject.toml` (with `[tool.pytest]`), `setup.cfg` (with `[tool:pytest]`) 3. Check for `jest.config.*`, `vitest.config.*`, `.mocharc.*` 4. Check for existing test directories: `tests/`, `test/`, `__tests__/`, `spec/` 5. Check for existing test file patterns: `*.test.*`, `*.spec.*`, `test_*.py`
If no test framework is detected, ask the user:
Use AskUserQuestion: question: "No test framework detected. Which should I use?" header: "Framework" options:
multiSelect: false
Read SUMMARY.md frontmatter from each plan in the phase to extract `key_files`:
pbr-tools" frontmatter .planning/phases/{NN}-{slug}/SUMMARY.mdCollect all `key_files` across all plans in the phase. Filter to only source files (exclude config, docs, assets). Group by:
Present the file list to the user:
Use AskUserQuestion: question: "Found {N} source files from phase {P}. Generate tests for which?" header: "Scope" options:
multiSelect: false
For each target file, create a lightweight test plan (NOT a full PBR PLAN.md — just a task list):
File: src/auth/login.js Tests to generate: - Happy path: valid credentials return token - Error: invalid password returns 401 - Error: missing email returns 400 - Edge: expired session handling Framework: jest Output: tests/auth/login.test.js
**CRITICAL: Delegate ALL test writing to subagents. Do NOT write test code in the main context.**
For each target file (or batch of related files), spawn an executor agent:
Spawn subagent_type: "pbr:executor"
Task: Generate tests for the following file(s):
<files_to_test>
{file_path}: {brief description from SUMMARY}
</files_to_test>
<test_framework>
{detected framework name and version}
Existing test directory: {path}
Test file naming: {pattern, e.g., *.test.js}
</test_framework>
<test_plan>
{test plan from Step 4}
</test_plan>
Instructions:
1. Read each source file to understand the implementation
2. Write test files following the project's existing test patterns
3. Each test file should cover: happy path, error cases, edge cases
4. Use the project's existing mocking patterns if any exist
5. Run the tests to verify they pass: {test command}
6. Commit with format: test({phase}-tests): add tests for {file}Spawn up to `parallelization.max_concurrent_agents` agents in parallel for independent files.
After all agents
Plan it. Build it. Run it. A Claude Code plugin for structured development with context-engineered agents.
Repo: SienkLogic/plan-build-run
A deterministic thinking partner that challenges assumptions and applies mental models to sharpen decisions, solve problems, and think more clearly. Use this…
Run audit, prioritize findings, auto-fix via quick tasks, test, and commit.
Review past Claude Code sessions for PBR workflow compliance and UX quality.
Run multiple phases hands-free. Chains discuss, plan, build, and verify automatically.
Manage backlog items — ideas not ready for active planning. Add, review, promote, or remove.
Start a new project. Deep questioning, research, requirements, and roadmap.