Harness product spec

From Intense-Visions/harness-engineering · View interactive version

Harness product spec is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > Generate structured product specifications from feature requests, issues, or descriptions. Produces user stories with EARS acceptance criteria, Given-When-Then scenarios, and PRD documents with trac

How to use this skill

Skill file

Harness Product Spec

Generate structured product specifications from feature requests, issues, or descriptions. Produces user stories with EARS acceptance criteria, Given-When-Then scenarios, and PRD documents with traceable requirements.

When to Use

Process

Phase 1: PARSE -- Extract Feature Intent

  1. Resolve input source. Accept one of:
  1. Extract core elements. From the input, identify:
  1. Identify ambiguities. Flag any element that is missing or unclear:
  1. Resolve ambiguities. Use emit_interaction to present questions when critical information is missing:

```

The feature request mentions "user notifications" but does not specify:

1. Notification channel (email, in-app, push, SMS)

2. Whether notifications are configurable by the user

3. Retry behavior for failed deliveries

Please clarify before proceeding.

```

  1. Load project context. Scan the project for existing specs, user stories, or PRDs to maintain consistency in format and terminology:
  1. Classify feature type. Categorize the feature as:

Phase 2: CRAFT -- Generate User Stories and Acceptance Criteria

  1. Write user stories. For each actor-goal pair, produce a story in standard format:

```

As a [actor],

I want to [action],

so that [benefit].

```

Break large features into multiple stories. Each story must be independently deliverable and testable.

  1. Write EARS acceptance criteria. Apply the EARS (Easy Approach to Requirements Syntax) patterns:
  1. Write Given-When-Then scenarios. For each acceptance criterion, produce at least one BDD scenario:

```

Given [precondition],

When [action],

Then [expected outcome].

```

Include:

  1. Define edge cases. For each story, enumerate:
  1. Assign story metadata. For each story:

Phase 3: GENERATE -- Produce PRD Document

  1. Structure the PRD. Generate a document with these sections:
  1. Write the problem statement. Include:
  1. Define success metrics. Every metric must be:
  1. Map requirements to stories. Create a traceability matrix:

```

REQ-001 -> US-001, US-003 (must-have)

REQ-002 -> US-002 (should-have)

REQ-003 -> US-004, US-005 (could-have)

```

  1. Write the PRD to file. Save to the project's spec directory (detected in Phase 1 or defaulting to docs/changes/). Use a filename pattern: YYYY-MM-DD-feature-name-prd.md.

Phase 4: VALIDATE -- Verify Completeness and Testability

  1. Check story independence. Verify each user story can be delivered independently:
  1. Check acceptance criteria testability. Every EARS criterion must be verifiable:

Flag untestable criteria: "Criterion AC-003 says 'the system should be fast' -- this is not testable. Recommend: 'the system shall respond within 200ms for the 95th percentile.'"

  1. Check coverage completeness. Verify all parsed elements from Phase 1 are addressed:
  1. Check format consistency. Verify the output matches existing project conventions:
  1. Output validation summary:

```

Product Spec Validation: [COMPLETE/INCOMPLETE]

Stories: N generated (M must-have, K should-have)

Acceptance criteria: N (all testable: YES/NO)

BDD scenarios: N (covering N criteria)

Coverage: all actors covered, all constraints addressed

Open questions: N remaining

Generated: docs/changes/2026-03-27-notifications-prd.md

```


Harness Integration

Success Criteria

Rationalizations to Reject

| Rationalization | Why It Is Wrong |

| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |

| "The feature request is clear enough -- I can skip the ambiguity check and start writing stories" | The gate: no generating specs from ambiguous input without clarification. Missing actors or undefined triggers lead to untestable acceptance criteria. |

| "This acceptance criterion is understood by the team, so it does not need to be formally testable" | No untestable acceptance criteria is a hard gate. Every criterion must be verifiable by an automated test or specific manual procedure. |

| "The happy path scenarios are enough -- edge cases are unlikely" | The skill requires at least one unwanted-behavior criterion for every user-facing action. Edge cases are where production bugs live. |

| "The existing PRD is outdated, so I will just replace it with a fresh one" | No overwriting existing specs is a gate. Present the diff rather than replacing the file. |

| "We can figure out the success metrics later during implementation" | Every success metric must be measurable, time-bound, and specific at spec time. |

Examples

Example: GitHub Issue to PRD for Team Notifications

Phase 1: PARSE
  Source: gh issue view 234 (title: "Add team notification preferences")
  Actor: team admin, team member
  Goal: control which notifications team members receive
  Ambiguities found:
    - Channel not specified (resolved: email + in-app per comment #3)
    - "Important notifications" undefined (flagged as open question)

Phase 2: CRAFT
  US-001: As a team admin, I want to set default notification preferences for my team,
          so that new members receive appropriate notifications without manual setup.
    AC-001 (Ubiquitous): The system shall apply team-default preferences to new members on join.
    AC-002 (Event-driven): When a team admin updates default preferences, the system shall
            prompt whether to apply to existing members.
    AC-003 (Unwanted): If a team member has custom preferences, then the system shall
            preserve them when team defaults change.

  US-002: As a team member, I want to override team notification defaults,
          so that I receive only notifications relevant to my role.
    Scenario: Given a team member with default preferences,
              When they disable "deployment" notifications,
              Then they shall not receive deployment notifications
              And their other preferences remain unchanged.

Phase 3: GENERATE
  Written: docs/changes/2026-03-27-team-notifications-prd.md
  Sections: problem statement, 4 user stories, 12 acceptance criteria, 8 BDD scenarios
  Traceability: REQ-001 -> US-001, US-002 | REQ-002 -> US-003, US-004

Phase 4: VALIDATE
  Stories: 4 (2 must-have, 1 should-have, 1 could-have)
  Acceptance criteria: 12 (all testable: YES)
  Open questions: 1 ("important notifications" needs product definition)
  Result: COMPLETE

Example: Inline Feature Description for Stripe Webhook Integration

Phase 1: PARSE
  Source: inline text "We need to handle Stripe webhooks for subscription changes"
  Actor: billing system (automated), finance admin (human oversight)
  Constraints: idempotency required, webhook signature verification, 5-second response SLA
  Ambiguities:
    - Which subscription events? (resolved via clarification: created, updated, canceled, past_due)
    - Retry handling? (Stripe retries for 72 hours)

Phase 2: CRAFT
  US-001: As the billing system, I want to process Stripe subscription.updated webhooks,
          so that user plan changes are reflected within 60 seconds.
    AC-001 (Event-driven): When a subscription.updated webhook arrives, the system shall
            update the user's plan within 60 seconds.
    AC-002 (Unwanted): If a duplicate webhook event ID is received, then the system shall
            return 200 OK without reprocessing.
    AC-003 (Unwanted): If webhook signature verification fails, then the system shall
            return 400 and log a security warning.

Phase 3: GENERATE
  Written: docs/changes/2026-03-27-stripe-webhooks-prd.md
  Technical constraints section includes: idempotency keys, signature verification,
    5-second response SLA, Stripe retry behavior documentation

Phase 4: VALIDATE
  All 4 webhook event types have stories: YES
  Idempotency criterion is testable: YES (duplicate event ID -> no side effects)
  Result: COMPLETE

Gates

Escalation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.