fix: respect GRAPHIFY_OUT env var in skill files and install templates#1054
Open
yeung108 wants to merge 3 commits into
Open
fix: respect GRAPHIFY_OUT env var in skill files and install templates#1054yeung108 wants to merge 3 commits into
yeung108 wants to merge 3 commits into
Conversation
The CLI correctly reads GRAPHIFY_OUT via os.environ.get(), but the skill
files and install templates hardcode graphify-out/ everywhere. When
/graphify runs as a skill, the agent follows the instructions literally
and writes all output to graphify-out/ regardless of the env var.
Skill files (all variants):
- Add a preamble instructing the agent to set
GOUT="${GRAPHIFY_OUT:-graphify-out}" before each bash block
- Replace all ~99 hardcoded graphify-out references with $GOUT
- Cross-repo paths under ~/.graphify/repos/ are kept as-is
Install templates (__main__.py):
- Settings hook: use _GOUT="${GRAPHIFY_OUT:-graphify-out}" instead of
hardcoded path check
- CLAUDE.md, AGENTS.md, GEMINI.md sections: use f-strings with
_GRAPHIFY_OUT so the installed content matches the user's setting
- Cursor, Kiro, Devin, Antigravity rule templates: same f-string fix
- Gemini Python hook: read GRAPHIFY_OUT from os.environ
- OpenCode JS plugin: read process.env.GRAPHIFY_OUT
Follows up on PR safishamsi#758 which fixed the CLI commands but not the skill
templates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the $GOUT shorthand with $GRAPHIFY_OUT everywhere in skill
files. The preamble now self-defaults the env var:
GRAPHIFY_OUT="${GRAPHIFY_OUT:-graphify-out}"
One name across the entire stack — no alias indirection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use GRAPHIFY_OUT consistently in the bash hook and gout (no underscore) in the inline Python hook. No more _GOUT indirection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CLI correctly reads
GRAPHIFY_OUTviaos.environ.get("GRAPHIFY_OUT", "graphify-out"), butgraphify claude installwrites three categories of files that all hardcodegraphify-out/:/graphifyruns, the agent follows these literally and writes all output tographify-out/regardless of the env vargraphify-out/graph.jsoninstead of the configured pathgraphify-out/in all path instructionsUsers who set
GRAPHIFY_OUTto a custom directory (e.g.,.claude/.local.graphify) must manually patch all three after everygraphify claude install.Fix
Uses
GRAPHIFY_OUTconsistently as the single variable name across the entire stack — no aliases, no indirection.Skill files (all 15 variants)
Added a preamble after "Follow these steps in order" that self-defaults the env var:
GRAPHIFY_OUT="${GRAPHIFY_OUT:-graphify-out}"This is a standard bash idiom — if
GRAPHIFY_OUTis already set (from the user's env), it keeps its current value; if unset, it defaults tographify-out. Then replaced all hardcodedgraphify-outwith$GRAPHIFY_OUT. This works because:$GRAPHIFY_OUTexpands normally-c "..."double-quoted strings): bash expands$GRAPHIFY_OUTbefore Python seesPath('$GRAPHIFY_OUT/...')~/.graphify/repos/are kept as-is (CLI-managed)Install templates (
__main__.py)GRAPHIFY_OUT="${GRAPHIFY_OUT:-graphify-out}"for runtime env var resolution_GRAPHIFY_OUT(the existing Python variable on line 19) so the installed content reflects the user's current setting (defaults tographify-outwhen env var is unset)os.environ.get('GRAPHIFY_OUT', 'graphify-out')process.env.GRAPHIFY_OUT || "graphify-out"CLI runtime code, help text, and default fallbacks are unchanged — they already use
_GRAPHIFY_OUTor correctly show the default.Related
query,path,explain) to respectGRAPHIFY_OUT