fix: harden generated Graphify instructions - #6
andrebrait wants to merge 2 commits into
Conversation
|
@coderabbitai review |
There was a problem hiding this comment.
🟢 Approval recommended
The generator changes are cohesive, the PowerShell translation is updated to preserve argv tails, and the new/updated tests directly cover the intended hardening behavior.
Pull request overview
This PR hardens Graphify’s generated skill/runbook instructions by ensuring user-provided paths (e.g., INPUT_PATH, SPEC_PATH) are passed to embedded Python snippets via argv rather than being embedded inside Python source, and updates the PowerShell translation logic so those argv tails survive when converting POSIX python -c blocks into PowerShell here-strings. It also refreshes transcription guidance to rely on prior analysis artifacts (when available) and regenerates the derived platform artifacts accordingly.
Changes:
- Pass
INPUT_PATH/SPEC_PATHto generated Python snippets as command-line arguments (sys.argv[...]) instead of embedding placeholder strings in Python code. - Update the POSIX→PowerShell bash-block translator to recognize and preserve Python-invocation “close” lines that include argv tails.
- Regenerate and update platform fragments/expected outputs, plus add regression tests covering argv preservation and removal of quoted placeholders.
File summaries
| File | Description |
|---|---|
| tools/skillgen/gen.py | Adds PowerShell close-line translations for argv-bearing Python invocations and sanctions new monolith diff lines. |
| tools/skillgen/fragments/references/shared/update.md | Updates shared update reference snippets to read INPUT_PATH from argv and pass it via shell args. |
| tools/skillgen/fragments/references/shared/transcribe.md | Revises transcription strategy text to prefer prior analysis (when present). |
| tools/skillgen/fragments/core/devin.md | Updates devin monolith instructions to pass INPUT_PATH via argv and adjusts transcription guidance. |
| tools/skillgen/fragments/core/aider.md | Updates aider monolith instructions to pass INPUT_PATH via argv and adjusts transcription guidance. |
| tools/skillgen/expected/graphify__skills__windows__references__update.md | Updates expected Windows update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__windows__references__transcribe.md | Updates expected Windows transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__vscode__references__update.md | Updates expected VS Code update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__vscode__references__transcribe.md | Updates expected VS Code transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__trae__references__update.md | Updates expected Trae update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__trae__references__transcribe.md | Updates expected Trae transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__pi__references__update.md | Updates expected Pi update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__pi__references__transcribe.md | Updates expected Pi transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__opencode__references__update.md | Updates expected OpenCode update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__opencode__references__transcribe.md | Updates expected OpenCode transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__kiro__references__update.md | Updates expected Kiro update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__kiro__references__transcribe.md | Updates expected Kiro transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__kilo__references__update.md | Updates expected Kilo update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__kilo__references__transcribe.md | Updates expected Kilo transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__droid__references__update.md | Updates expected Droid update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__droid__references__transcribe.md | Updates expected Droid transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__copilot__references__update.md | Updates expected Copilot update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__copilot__references__transcribe.md | Updates expected Copilot transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__codex__references__update.md | Updates expected Codex update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__codex__references__transcribe.md | Updates expected Codex transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__claw__references__update.md | Updates expected Claw update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__claw__references__transcribe.md | Updates expected Claw transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__claude__references__update.md | Updates expected Claude update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__claude__references__transcribe.md | Updates expected Claude transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__amp__references__update.md | Updates expected Amp update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__amp__references__transcribe.md | Updates expected Amp transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skills__agents__references__update.md | Updates expected Agents update reference output to argv-based INPUT_PATH. |
| tools/skillgen/expected/graphify__skills__agents__references__transcribe.md | Updates expected Agents transcription reference output to “previous analysis” guidance. |
| tools/skillgen/expected/graphify__skill-devin.md | Updates expected devin monolith output for argv-based path passing and transcription guidance. |
| tools/skillgen/expected/graphify__skill-aider.md | Updates expected aider monolith output for argv-based path passing and transcription guidance. |
| tests/test_skillgen.py | Adds coverage ensuring placeholders aren’t embedded in Python source, argv is preserved in PS translation, and transcription wording is updated. |
| graphify/skills/windows/references/update.md | Updates Windows update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/windows/references/transcribe.md | Updates Windows transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/vscode/references/update.md | Updates VS Code update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/vscode/references/transcribe.md | Updates VS Code transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/trae/references/update.md | Updates Trae update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/trae/references/transcribe.md | Updates Trae transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/pi/references/update.md | Updates Pi update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/pi/references/transcribe.md | Updates Pi transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/opencode/references/update.md | Updates OpenCode update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/opencode/references/transcribe.md | Updates OpenCode transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/kiro/references/update.md | Updates Kiro update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/kiro/references/transcribe.md | Updates Kiro transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/kilo/references/update.md | Updates Kilo update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/kilo/references/transcribe.md | Updates Kilo transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/droid/references/update.md | Updates Droid update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/droid/references/transcribe.md | Updates Droid transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/copilot/references/update.md | Updates Copilot update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/copilot/references/transcribe.md | Updates Copilot transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/codex/references/update.md | Updates Codex update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/codex/references/transcribe.md | Updates Codex transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/claw/references/update.md | Updates Claw update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/claw/references/transcribe.md | Updates Claw transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/claude/references/update.md | Updates Claude update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/claude/references/transcribe.md | Updates Claude transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/amp/references/update.md | Updates Amp update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/amp/references/transcribe.md | Updates Amp transcription reference artifact to “previous analysis” guidance. |
| graphify/skills/agents/references/update.md | Updates Agents update reference artifact to argv-based INPUT_PATH. |
| graphify/skills/agents/references/transcribe.md | Updates Agents transcription reference artifact to “previous analysis” guidance. |
| graphify/skill.md | Updates primary skill instructions to argv-based path passing, PowerShell-neutral terminology (“subagent”), and prompt-file argv passing. |
| graphify/skill-vscode.md | Updates VS Code skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-trae.md | Updates Trae skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-pi.md | Updates Pi skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-opencode.md | Updates OpenCode skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-kilo.md | Updates Kilo skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-droid.md | Updates Droid skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-devin.md | Updates devin skill artifact to argv-based path passing and revised transcription wording. |
| graphify/skill-claw.md | Updates Claw skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-amp.md | Updates Amp skill artifact to argv-based path passing and subagent terminology. |
| graphify/skill-aider.md | Updates aider skill artifact to argv-based path passing and revised transcription wording. |
Review details
- Files reviewed: 95/95 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@coderabbitai review |
|
CodeRabbit did not respond to the initial request or the one permitted retry; the required independent adversarial review and Copilot review completed cleanly on bc043e4. |
|
Landed bc043e4 by signed fast-forward to the integration branch; closing the now-empty PR. |
Summary
Verification
uv run pytest tests/test_skillgen.py -q(67 passed)uv run python -m tools.skillgen --checkuv run python -m tools.skillgen --monolith-roundtripA full
uv run pytest -qreached 5,417 passes / 95 skips with 6 unrelated failures: four missing optionalopenaidependency tests, the pre-existing hidden-fixture path assertion (the worktree path itself is hidden), and a timing-sensitive TypeScript scaling assertion.