discount-review

Inspects a discount policy fixture using a Python helper script and review checklist.

24.7k|2.3k|Updated Apr 28, 2023
One-click install
npx skills add https://github.com/promptfoo/promptfoo --skill discount-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: discount-review
Source: https://github.com/promptfoo/promptfoo/tree/main/examples/openai-agents/skills/discount-review
Command: npx skills add https://github.com/promptfoo/promptfoo --skill discount-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Reviewing a discount policy fixture for a known boundary bug requires consistent, repeatable steps. This Skill standardizes the review by running a helper script that extracts the ticket id, severity, owner, primary file, and minimal fix from the fixture repository.

Core Features & Use Cases

  • Automated Fixture Analysis: Runs analyze_discount_policy.py against the fixture repo to extract structured JSON metadata about TICKET-014.
  • Guided Review Checklist: Directs inspection of skill_fixture/repo/src/discount_policy.py before producing a maintainer report.
  • Use Case: When asked to review the discount policy fixture, run the helper script, verify the boundary condition bug (return discount_percent > 20), and produce a concise maintainer report citing the minimal fix (>= 20).

Quick Start

Ask the assistant to review the discount policy fixture and produce a maintainer report using the helper script.

Frequently Asked Questions about discount-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review the discount policy fixture?

Run the helper script with `python3 skills/discount-review/scripts/analyze_discount_policy.py skill_fixture/repo`, then inspect `skill_fixture/repo/src/discount_policy.py` and write a concise maintainer report citing the helper output.

What does the analyze_discount_policy.py script output?

The script prints a JSON object containing the ticket id (TICKET-014), severity (high), owner (platform-integrations), primary file path, minimal fix, and the first line of the ticket file.

What bug does the discount policy fixture contain?

The fixture contains a boundary bug where the code reads `return discount_percent > 20` instead of `>= 20`. The minimal fix is to change the comparison to `return discount_percent >= 20`.

What happens if the fixture no longer contains the expected bug?

The script exits with an error message stating the fixture no longer contains the expected boundary bug, since it validates that `return discount_percent > 20` is present in the source before producing output.

Does the discount review script require any Python packages?

No external packages are required. The script uses only Python standard library modules (json, sys, pathlib) and runs with python3 directly.