Skip to content

Issue-128: Standardize python3 invocation across skill instructions and scripts - #133

Merged
jodavis merged 3 commits into
mainfrom
dev/claude/Issue-128
Aug 3, 2026
Merged

Issue-128: Standardize python3 invocation across skill instructions and scripts#133
jodavis merged 3 commits into
mainfrom
dev/claude/Issue-128

Conversation

@jodavis-claude

Copy link
Copy Markdown
Collaborator

Work item

Issue-128: Skills and scripts that shell out to Python assumed a bare python command exists, but several real environments (including this devcontainer) only provide python3. This task standardizes all agent-facing invocation examples and generated command strings on python3 / sys.executable.

Changes

  • Replaced bare python with python3 in all Bash invocation examples across plugins/dev-team/skills/*/SKILL.md (concurrent-orchestrate, dev-spec-task-breakdown, ensure-working-branch, get-project-configuration, implement-tdd, monitor-pr, update-project-configuration, use-context-file, workflow-orchestrate, workflow-script), including the top-level orchestrator launch command in workflow-orchestrate/SKILL.md.
  • Updated scripts/dev_team_update.py's usage docstring for consistency.
  • Changed dev_team.py's two generated shell-command strings (_resolve_validation_script() and BuildValidationStep.get_actions()) to use sys.executable instead of hardcoding python, matching the repo's existing pattern for one Python process spawning another.
  • Added unit test coverage asserting the emitted commands start with sys.executable rather than a hardcoded python prefix.

Design decisions

  • Standardized fully on python3/sys.executable rather than adding a python-then-python3 detection/fallback, per the issue author's own comment narrowing scope to "assume python3 is the correct runtime," and consistent with every .py script in the repo already declaring #!/usr/bin/env python3.
  • Did not add a "check python3 exists up front, offer to install" preflight step — the issue comment hedged this as a "maybe," and it is a materially larger, riskier scope (sudo/package-manager access, cross-platform logic) than the rest of this fix.
  • Left _spec_AgentOrchestration.md's illustrative python dev_team.py ... examples unchanged, since it is a historical/superseded design spec rather than the authoritative runtime instructions agents follow.

Closes#128

Testing completed

  • Existing unit tests in test_dev_team.py for _resolve_validation_script and BuildValidationStep.get_actions continue to pass unchanged.
  • Added new unit tests asserting generated commands use sys.executable instead of a bare python prefix.

@github-actions

Copy link
Copy Markdown

build-and-test: Python test results

Status: ✅ Passed

Test log

Comment threadplugins/dev-team/skills/concurrent-orchestrate/SKILL.md
Comment threadplugins/dev-team/skills/workflow-orchestrate/SKILL.md
…mand strings
dev_team.py's _resolve_validation_script() and BuildValidationStep.get_actions() built
subprocess command strings prefixed with a bare 'python', which fails in environments (like
this devcontainer) that only provide python3. Switch both to sys.executable, the repo's
existing pattern for one Python process invoking another, and add a new assertion to each
call site's existing test coverage confirming the emitted command starts with sys.executable.
…nd script docs
Replace bare 'python' with 'python3' in every SKILL.md Bash example that invokes a script
(concurrent-orchestrate, dev-spec-task-breakdown, ensure-working-branch,
get-project-configuration, implement-tdd, monitor-pr, update-project-configuration,
use-context-file, workflow-orchestrate, workflow-script) and in dev_team_update.py's usage
docstring. Every actual .py script in the repo already shebangs #!/usr/bin/env python3; this
sweep brings the illustrative invocation examples agents follow in line with that, since a
bare 'python' command does not exist in every environment (confirmed missing in this
devcontainer, which only has python3).
…workflow-orchestrate
Per PR review, ensure python3 exists up front with a clear failure message before either orchestration loop runs its first script step, rather than relying on a script call to fail with a less obvious error.

@jodavis-claudejodavis-claude left a comment

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Reviewed the diff against Issue-128's exit criteria: standardize all Python invocations on python3/sys.executable.

What's good:

  • All 11 SKILL.md files listed in the task brief were updated; no bare python invocation remains anywhere under plugins/dev-team/ (verified with a repo-wide grep).
  • dev_team.py's two generated command strings (_resolve_validation_script, BuildValidationStep.get_actions) now use sys.executable, matching the repo's existing pattern for one Python process spawning another (sys was already imported).
  • New unit tests (test_validation_list_resolves_to_sys_executable_command, TestBuildValidationStepGetActions::test_run_script_command_uses_sys_executable) assert on the sys.executable prefix. Ran the full suite locally: 143 passed.
  • scripts/dev_team_update.py's usage docstring and workflow-script/SKILL.md's example were updated for consistency.
  • CI (build-and-test, devcontainer-validate, gate) all pass.

Priority 1 — Correctness / missed instance of the exact bug (blocking):

hooks/hooks.json (not touched by this PR) still invokes the SessionStart update script with a bare python:

"command": "python \"${CLAUDE_PLUGIN_ROOT}/scripts/dev_team_update.py\" --data-dir \"${CLAUDE_PLUGIN_DATA}\" --threshold-hours 4"

This is real, automatically-executed configuration (not agent-facing prose) — it runs on every Claude Code SessionStart for this plugin, before any skill or agent logic runs. In an environment with only python3 on PATH (confirmed reproducible in this exact devcontainer per the task brief: which python → not found, exit 127), this hook will fail with the very "command not found: python" error the issue is about — arguably the single highest-impact remaining instance, since it fires unconditionally rather than only when a particular skill happens to be invoked.

Since this runs standalone (no controlling Python process to source sys.executable from), the fix should mirror the rest of this sweep and hardcode python3 here too:

"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/dev_team_update.py\" --data-dir \"${CLAUDE_PLUGIN_DATA}\" --threshold-hours 4"

Recommend adding this file to the PR before merging — it falls squarely within the issue's own scope ("Skills and scripts that shell out to Python...") even though it wasn't enumerated in the task brief's file list.

No other Priority 1-4 issues found. Documentation: no _doc_*.md mentions a python-invocation convention, so nothing there needed updating. CONTRIBUTING.md's "Supported Platforms" section was left without an explicit python3-pinning note (task brief's "Known ambiguity #5") — reasonable to leave as a non-blocking follow-up since the issue didn't require it.

Style (non-blocking): none noted.

@jodavis
jodavis marked this pull request as ready for review August 3, 2026 19:25
@jodavis
jodavis merged commit a4e00bc into mainAug 3, 2026
3 checks passed
@jodavis
jodavis deleted the dev/claude/Issue-128 branch August 3, 2026 19:25
Sign up for freeto 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.

Detect python vs. python3 when invoking scripts

3 participants

@jodavis-claude@jodavis@ElwoodMoves