Skip to content

Planner must validate TDD test specs with Glob/Grep before writing them #11

Description

@nickmaglowsch

Problem

The prd-task-planner writes ## TDD Mode sections with test file paths, framework names, and test commands (prd-task-planner.md:163-184), but it has no Bash access and never validates these specs against reality. It can write:

  • Wrong test file paths (don't match project conventions)
  • Wrong framework imports (jest when the project uses vitest)
  • Wrong test commands

The planner already has Glob and Grep tools — it just lacks the instruction to validate.

Proposed Fix

Add to prd-task-planner.md after line 102 (testing patterns discovery):

- **Validate before writing TDD specs**: Before writing `## TDD Mode` sections, verify with Glob/Grep:
  - Test file paths follow the actual project convention (don't guess — check existing test files)
  - The test framework import pattern matches what exists (e.g., `import { describe } from 'vitest'` not `from 'jest'`)
  - The test command works (check package.json scripts or equivalent)
  - If you can't confirm these, omit the `## TDD Mode` section and note in the task
    that the implementer should discover test infrastructure independently

This is the "sprint contract" pattern — only write specs you can verify.

Effort

~10 minutes — prompt addition in 1 file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumprompt-calibrationPrompt wording fixes for better agent behaviortddTest-driven development pipeline improvements

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions