shell-rules

Write gh CLI PR and issue bodies via temp files in sandboxed shells.

1|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/matteobortolazzo/claude-tools --skill shell-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-rules
Source: https://github.com/matteobortolazzo/claude-tools/tree/main/ccflow/skills/shell-rules
Command: npx skills add https://github.com/matteobortolazzo/claude-tools --skill shell-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Shared shell rules for sandbox compatibility. Read before running gh CLI commands, when encountering heredoc sandbox errors, sandbox write errors, or when creating PR bodies or issue descriptions via CLI.

Core Features & Use Cases

  • Safe handling of heredoc in sandboxed environments when using gh issue/pr commands.
  • Temp-file pattern: write content to a temporary file, read it back into a variable, and pass it to gh commands.
  • Guardrails to avoid interactive mode to prevent hangs and ensure reliable automation.

Quick Start

Create a temp file with your message, read it back into a variable, and pass it to gh issue edit or gh pr create.

Frequently Asked Questions about shell-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does gh CLI hang or fail with sandbox write errors when using heredoc for PR bodies?

Sandbox write errors and hangs occur because sandboxed shells restrict heredoc input and interactive mode for gh CLI commands. To fix this, write content to a temp file, read it back into a variable, and pass it to the gh command.

How do I pass a multi-line PR body or issue description to gh CLI in a sandboxed shell?

To pass a multi-line PR body in a sandboxed shell, write your text to a temporary file, read the file content into a shell variable, and pass that variable to gh issue edit or gh pr create using the appropriate flag.

What is the safe temp-file pattern for automating gh issue creation in sandboxed environments?

The safe temp-file pattern for sandboxed gh automation involves writing the message to a temporary file, reading that file back into a variable, and passing the variable to the gh command. This prevents fragile heredoc handling and avoids interactive prompts.

Can I use interactive mode for gh CLI commands in automated DevOps workflows?

No, you should not use interactive mode for gh CLI commands in automated workflows. Interactive mode causes hangs and breaks reliable automation, so you must enforce guardrails that provide explicit steps and non-interactive flags like --body or --description.

How do sandboxed environments prevent prompt injections when executing shell automation?

Sandboxed environments prevent prompt injections by enforcing safe, non-exfiltrating usage rules. These rules provide explicit steps and guardrails, ensuring shell automation reads from temp files rather than fragile heredocs and avoids interactive mode entirely.