Skip to content

feat: resolve data-designer command path before workflow execution#440

Open
johnnygreco wants to merge 7 commits intomainfrom
feat/skill-resolve-data-designer-cmd
Open

feat: resolve data-designer command path before workflow execution#440
johnnygreco wants to merge 7 commits intomainfrom
feat/skill-resolve-data-designer-cmd

Conversation

@johnnygreco
Copy link
Contributor

Summary

  • Add a command resolution step to the Data Designer skill's "Before You Start" section
  • The skill now checks which data-designer and falls back to .venv/bin/data-designer, ensuring all subsequent commands use the correct path

Test plan

  • Invoke /data-designer and verify the command resolution runs before any workflow steps
  • Test in an environment where data-designer is only in .venv/bin/ (not on PATH) to confirm the fallback works

Ensure the skill locates the data-designer binary (PATH or .venv) up
front so all subsequent commands use the correct path.
@johnnygreco johnnygreco requested a review from a team as a code owner March 19, 2026 23:42
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 19, 2026

Greptile Summary

This PR adds a two-line "Before You Start" instruction to skills/data-designer/SKILL.md that directs the AI model to resolve the data-designer binary path before any workflow step executes. The shell one-liner (which data-designer 2>/dev/null || (test -x .venv/bin/data-designer && realpath .venv/bin/data-designer)) covers three cases: binary on PATH, binary only in .venv/bin/, and binary absent (→ Troubleshooting). This cleanly addresses environments where the virtual environment is not activated at invocation time.

  • The test -x guard (checking existence and executability) is stronger than a plain test -f, and prevents realpath from running on GNU/Linux for a non-existent path.
  • 2>/dev/null on which suppresses the noisy stderr message on systems where which writes to stderr when the binary is missing.
  • All previously flagged issues (relative-vs-absolute path, realpath Linux edge case, YAML frontmatter, backtick formatting) are resolved in the current state of the file.
  • One minor gap: when which data-designer succeeds the instruction is silent about what to do with its output, leaving the "found on PATH" case implicit. The AI can correctly infer it should continue using data-designer normally, but an explicit note would remove any ambiguity.

Confidence Score: 4/5

  • Safe to merge — minimal, focused change with sound shell logic and all prior review issues resolved.
  • The diff is two lines added to a Markdown skill file. The shell one-liner is logically correct: test -x guards against both missing and non-executable files before realpath runs, and 2>/dev/null keeps output clean. All three resolution outcomes (on PATH, venv fallback, neither) are handled. Previously raised issues (relative path, realpath Linux edge case, YAML frontmatter, Markdown formatting) have all been addressed. Score is 4 rather than 5 only because the fallback path is hardcoded to .venv/bin/data-designer, which is a reasonable convention but won't cover every possible virtual-environment layout.
  • No files require special attention.

Important Files Changed

Filename Overview
skills/data-designer/SKILL.md Adds a pre-flight command resolution step to find the data-designer binary via which with a .venv/bin/ fallback using test -x + realpath; logic is sound and previous review issues are addressed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["/data-designer skill invoked"] --> B["Run resolution command:\nwhich data-designer 2>/dev/null\n|| (test -x .venv/bin/data-designer\n&& realpath .venv/bin/data-designer)"]
    B --> C{which succeeds?}
    C -- "Yes → path printed" --> D["data-designer is on PATH\nUse bare 'data-designer' command normally"]
    C -- "No" --> E{test -x .venv/bin/data-designer?}
    E -- "Yes → realpath prints abs path" --> F["Store absolute path\nUse it for ALL subsequent\ndata-designer commands"]
    E -- "No" --> G["Neither path works\n→ Troubleshooting section"]
    D --> H["Load workflow\n(interactive.md or autopilot.md)"]
    F --> H
    H --> I["data-designer agent context\ndata-designer validate ...\ndata-designer preview ...\ndata-designer create ..."]
Loading

Last reviewed commit: "fix: use test -x to ..."

Address review feedback: ls outputs a relative path that breaks if the
working directory changes. Use realpath to get an absolute path instead.
GNU realpath exits 0 for non-existent paths, so add a test -f check
to ensure the fallback only produces output when the file exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant