Add advisory for phases with 31-50 requirements (#10)#14
Conversation
jcmaker
left a comment
There was a problem hiding this comment.
Thanks for this — really solid work! 🙏 I ran everything locally and the feature itself is in great shape:
- ✅ All 19 unit tests pass (
test_validate_prd.py) - ✅
check_skill_structure.pyandcheck_manifests.pyboth pass - ✅ Verified the advisory end-to-end: a phase with 35 requirements keeps exit code 0,
CHECK 5stillPASS, and theADVISORY - Phase "..." has 35 requirements (recommended <= 30)line prints as intended. Nice touch keeping the hard-fail at >50 untouched. - ✅ The Windows
reconfigure(encoding="utf-8")fix is a sensible cross-platform improvement.
One small cleanup before merge 🧹 — in validate_prd.py the imports got duplicated during the patch:
import re
import sys
import re # <- duplicate
import sys # <- duplicate
from pathlib import Path
...
from pathlib import Path # <- duplicate (line 31)Could you collapse those down to a single import re, import sys, and one from pathlib import Path? It's harmless functionally, but let's keep the top of the file clean. (Tiny nit while you're in there: the two test classes lost their blank-line separation — class TestCheck5RequirementsCap and class TestAssumptions are now flush against the previous block; PEP 8 likes 2 blank lines between top-level classes.)
Once the imports are deduped I'll merge. Thanks again! 🚀
|
Cleaned up — imports deduped (single |
What & why
Adds a soft advisory (not a hard fail) when a PRD phase has 31–50
requirements, nudging authors toward the recommended <= 30 per phase without
blocking the build. CHECK 5 in
validate_prd.pystill hard-fails above 50 asbefore — only the 31–50 range now prints an
ADVISORYline while keeping exitcode 0.
Also fixes a pre-existing cross-platform bug surfaced while testing on
Windows:
validate_prd.pycrashed withUnicodeEncodeErrorwhen printingKorean PRD content to a Windows console (cp1252 default encoding). Added
sys.stdout.reconfigure(encoding="utf-8")/sys.stderr.reconfigure(...)atthe top of the script, and set
encoding="utf-8"on thesubprocess.runcallin the test helper so the test suite doesn't hit the same issue capturing
output on Windows.
Closes #10
Checks
python3 skills/prd-maker/scripts/test_validate_prd.pypython3 .github/scripts/check_skill_structure.pypython3 .github/scripts/check_manifests.pyREADME.md/README.ko.md) if usage or behavior changed — not touched; this only changes internal linter output, no user-facing usage change.claude-plugin/plugin.jsonand.codex-plugin/plugin.json— no version bump made, not touchedNotes for reviewers
(an advisory line), not the PRD template or user-facing CLI usage. Happy to
add a note to README if you'd prefer it documented.
check5_requirements_cap()now returns a 3-tuple (passed, detail, advisories) instead of 2. Updated the one caller inrun_checks()accordingly — grep confirms no other callers.
into its own PR — it's unrelated to the advisory feature but I hit it while
running the required local checks and didn't want to leave the linter
broken on Windows.