github-cli-hygiene

Write GitHub CLI pull requests, issues, and reviews via body files with post-write validation.

13|3|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/phrazzld/agent-skills --skill github-cli-hygiene
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-cli-hygiene
Source: https://github.com/phrazzld/agent-skills/tree/main/core/github-cli-hygiene
Command: npx skills add https://github.com/phrazzld/agent-skills --skill github-cli-hygiene

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that all content written to GitHub via the CLI is safe, well-formatted, and adheres to best practices, preventing common errors and improving the quality of AI-generated contributions.

Core Features & Use Cases

  • Enforces Safe Writing: Prevents the use of inline body arguments for Markdown content, always writing to temporary files.
  • Validates Output: Fetches and verifies the formatting quality of posted content, checking for escaped newlines, ANSI artifacts, and empty bullets.
  • Use Case: When an AI needs to create a Pull Request, this skill ensures the PR title is concise, the body is well-structured, and it includes necessary closing keywords like Closes #N.

Quick Start

Use the github-cli-hygiene skill to create a new pull request with the title "feat: Add user authentication" and body content from the file /tmp/pr-body.md.

Frequently Asked Questions about github-cli-hygiene

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

FAQPage Schema
How do I prevent markdown formatting errors when creating GitHub PRs via CLI?

To prevent markdown formatting errors in GitHub PRs, avoid inline body arguments and write content to temporary files instead. This approach ensures proper formatting by validating output to check for escaped newlines, ANSI artifacts, and empty bullets after posting.

What is the best way to validate AI-generated GitHub CLI writes for issues and reviews?

The best way to validate GitHub CLI writes is to fetch and verify content immediately after posting. This post-write validation checks Markdown formatting quality, ensuring AI-generated issues and reviews are free from escaped newlines and ANSI artifacts.

Why does my GitHub CLI PR body contain escaped newlines and ANSI artifacts?

GitHub CLI PR bodies contain escaped newlines and ANSI artifacts when passing markdown content as inline arguments. Writing the body to a temporary file first prevents these formatting artifacts from corrupting your pull request descriptions.

Can I use temporary body files to safely comment on PRs and submit GitHub reviews?

Yes, you can use temporary body files to safely comment on PRs and submit reviews. This canonical write flow enforces safe writing by preventing inline body arguments and verifying formatting quality via post-write validation.

How do I ensure my GitHub CLI PR includes closing keywords like Closes #N?

To ensure your GitHub CLI PR includes closing keywords like Closes #N, write a well-structured body to a temporary file. This method enforces safe writing practices and verifies the final formatting quality of your contribution.