anthropic-skills/skills
Varun Sahni c3d2ee7b0e fix: fix two bugs in run_eval.py causing 0% trigger rates
Bug 1: When the child process exits, the remaining stdout buffer was read
but never parsed. The loop broke immediately after reading the leftover data,
discarding any trigger evidence in the final bytes. Fixed by parsing the
remaining buffer after the read loop exits.

Bug 2: Parallel workers shared a single .claude/commands/ directory, so
each worker saw every other worker's temporary skill files. With N workers,
each had roughly a 1/N chance of being credited for its own trigger. Fixed
by giving each worker a unique subdirectory (eval-worker-N) so workers are
isolated.

Closes #1552

## Changes
- skills/skill-creator/scripts/run_eval.py:
  - Extracted line-parsing logic into _parse_buffer_lines() helper
  - Helper returns None when more data is needed, True/False for definitive verdict
  - Added post-loop buffer parsing to fix Bug 1
  - Added worker_id parameter to run_single_query to fix Bug 2
  - Each worker writes to .claude/commands/eval-worker-N/ subdirectory
  - run_eval() passes worker_idx % num_workers as worker_id
  - Added from __future__ import annotations for Python 3.9 compatibility

## Testing
- Unit tests for _parse_buffer_lines in test_fixes.py: 9 tests covering
  stream events, fallback assistant messages, state continuation, and
  edge cases. All pass.
- Verified AST parsing succeeds on Python 3.9.6
2026-08-14 02:14:39 +05:30
..
algorithmic-art Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
brand-guidelines Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
canvas-design Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
claude-api Update claude-api skill: prompt-audit subcommand (#1557) 2026-08-13 11:09:54 -07:00
doc-coauthoring Add doc-coauthoring skill and update example skills (#134) 2025-12-04 12:01:46 -05:00
docx Update docx, pptx, and xlsx skills (#1447) 2026-07-16 19:47:37 -07:00
frontend-design Update frontend-design skill (#1293) 2026-06-09 12:33:41 -07:00
internal-comms Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
mcp-builder Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
pdf Update skill-creator and make scripts executable (#350) 2026-02-06 13:19:32 -08:00
pptx Update docx, pptx, and xlsx skills (#1447) 2026-07-16 19:47:37 -07:00
skill-creator fix: fix two bugs in run_eval.py causing 0% trigger rates 2026-08-14 02:14:39 +05:30
slack-gif-creator Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
theme-factory Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
web-artifacts-builder Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
webapp-testing Fill in Apache 2.0 copyright notice in claude-api LICENSE.txt (#990) 2026-04-20 14:38:16 -07:00
xlsx Update docx, pptx, and xlsx skills (#1447) 2026-07-16 19:47:37 -07:00