Skip to content

fix(templates): add Shell requirement to all type templates (#345)#412

Open
masa6161 wants to merge 5 commits into
fujibee:mainfrom
masa6161:fix/skill-template-shell-requirement
Open

fix(templates): add Shell requirement to all type templates (#345)#412
masa6161 wants to merge 5 commits into
fujibee:mainfrom
masa6161:fix/skill-template-shell-requirement

Conversation

@masa6161

Copy link
Copy Markdown
Contributor

Background

PR #363 added a Shell requirement paragraph to the root SKILL.md, instructing agents to invoke agmsg scripts via bash rather than PowerShell or cmd. This was part of the #345 fix (Codex phantom DB on Windows), where one root cause was Codex choosing PowerShell to execute agmsg scripts — bypassing MSYS2 automatic path conversion and producing phantom paths like C:\c\Users\....

The fix was reviewed and merged with the maintainer noting:

"this PR also fixes #345 … via the SKILL.md bash-invocation note and the install.sh cygpath conversion"

However, install.sh does not deploy the root SKILL.md. It generates the installed SKILL.md from per-type templates via:

sed "s/__SKILL_NAME__/$SKILL_NAME/g" "$(agmsg_type_template_path "$TPL_TYPE")" > "$SKILL_DIR/SKILL.md"

The templates (scripts/drivers/types/*/template.md) were never updated, so the Shell requirement paragraph was silently dropped on every install.sh / install.sh --update invocation. The issue persists in v1.1.7 and v1.1.8.

What

Add the same Shell requirement paragraph to all nine type templates:

  • antigravity/template.md
  • claude-code/template.md
  • codex/template.md
  • copilot/template.md
  • cursor/template.md
  • gemini/template.md
  • grok-build/template.md
  • hermes/template.md
  • opencode/template.md

The paragraph uses __SKILL_NAME__ so it is correctly substituted by install.sh's sed pass.

Verification (Windows 11 + MSYS2/Git Bash)

  1. Installed v1.1.8 via install.sh --update — confirmed the deployed ~/.agents/skills/agmsg/SKILL.md lacked the Shell requirement line
  2. Applied this patch and re-ran install.sh --update from the local repo
  3. Confirmed the deployed SKILL.md now contains the Shell requirement at line 8, with __SKILL_NAME__ correctly replaced by agmsg:
**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/agmsg/scripts/send.sh myteam alice bob "hello"'`. ...

Test plan

  • install.sh --update produces SKILL.md containing "Shell requirement" for the default (codex) type
  • Fresh install.sh (new skill name) produces SKILL.md with the paragraph and correct __SKILL_NAME__ substitution
  • Existing bats tests pass (no template structure change beyond the added paragraph)

🤖 Generated with Claude Code

masa6161 and others added 5 commits July 6, 2026 11:09
psmux (Windows tmux-compatible multiplexer) hands the split-window /
new-window command token to CreateProcess/ShellExecute. An extensionless
boot script has no file association, so Windows shows an "Open with"
dialog instead of executing it — the agent never starts.

PR fujibee#329 gated the .command rename to Darwin (fujibee#282) but assumed tmux
would honor the shebang ("runs it via its shebang (tmux)"). This holds
for Unix tmux but not psmux: the root cause was left unaddressed and the
symptom changed from Notepad to the "Open with" dialog.

Prefix `bash -l` on Windows (MINGW/MSYS/CYGWIN) in launch_in_tmux(),
matching launch_windows_terminal's existing `wt.exe new-tab bash -l`
pattern. Applied to both new-window and split-window branches.
macOS/Linux unchanged.

Tested on psmux v3.3.4 + Windows 11:
- codex spawn (default-shell=bash): OK
- codex spawn (default-shell=pwsh): OK
- claude-code spawn (default-shell=bash): OK

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
)

PR fujibee#363 added a "Shell requirement" paragraph to the root SKILL.md,
instructing agents to invoke agmsg scripts via bash rather than
PowerShell. However, install.sh generates the deployed SKILL.md from
per-type templates (scripts/drivers/types/*/template.md) via sed, so
the root SKILL.md is never installed — the instruction was silently
lost on every install/update.

Add the same paragraph to all nine type templates so that every
`install.sh --update` produces a SKILL.md that contains the bash
execution requirement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 05:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures the “Shell requirement” guidance (execute agmsg scripts via bash, not PowerShell/cmd) is preserved in the installed SKILL.md by adding the paragraph to every per-type template.md used by install.sh.

Changes:

  • Added the Shell requirement paragraph to all nine agent-type SKILL.md templates.
  • Used __SKILL_NAME__ in the example path so install.sh’s sed substitution produces the correct installed instructions for any skill name.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/drivers/types/antigravity/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/claude-code/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/codex/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/copilot/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/cursor/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/gemini/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/grok-build/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/hermes/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.
scripts/drivers/types/opencode/template.md Adds the Shell requirement paragraph so installed docs retain bash-invocation guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Windows: Codex agents write to phantom DB due to missing bash instruction in SKILL.md and MSYS-format writable_roots

2 participants