Git and github
Plugin with opinionated set of Claude Code agents nad skills
npx -y skills add lklimek/claudius --skill git-and-githubAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
This skill should be used when running git or gh commands, interacting with GitHub, or resolving git and gh access or permission-denied failures.
SKILL.md
9.2 KB, as published. Nobody here has run it
GitHub Workflow
Tooling: git for repository operations (clone, fetch, commit, push, branch, merge); GitHub MCP tools (mcp__plugin_claudius_github__*) for all GitHub API operations (PRs, issues, reviews, Actions, checks, branches, releases, security alerts). If MCP is unavailable, read gh-cli-fallback.md for gh CLI equivalents. Bare coordinator sessions typically lack these tools and should default directly to the CLI fallback; spawned agents whose frontmatter lists them still prefer MCP.
Attribution: every commit, PR, issue, and comment posted to GitHub must include this footer (blank line before it):
<sub>π€ Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
Before Starting Work
- Verify you're on a base branch β if on an unrelated feature branch, switch to base or confirm with user.
- Pull (fast-forward only). On diverged history, rebase if trivial, otherwise alert user.
- Search open PRs for related fixes β don't duplicate in-progress work.
Committing
Create feature branches. NEVER commit to base branch.
Stage specific files β never git add . or git add -A.
Use conventional commits (feat, fix, docs, refactor, test, chore, perf); append ! for breaking changes.
Commit format (always HEREDOC). Substitute <your-model-name> with your actual current model β never copy a version literally from this doc, it goes stale:
git add <file1> <file2>
git commit -m "$(cat <<'EOF'
<type>: <description>
<optional body>
Co-Authored-By: Claude <your-model-name> <[email protected]>
EOF
)"
Changelog
Edit CHANGELOG.md per Keep a Changelog format.
Pushing
If a push fails with 403 or "Resource not accessible" and ghsudo is installed, retry through it (see Elevated Permissions).
Always ask explicit confirmation before every push, even if the user agreed earlier β see Safety Rules.
Pull Requests
Creating a PR
Check for a PR template first; if one exists, fold its required content into the skeleton linked below rather than replacing it.
The PR body must lead with a plain-language summary before any implementation detail β a technical product manager or external reviewer with no code context must understand everything before Detailed discussion at a glance. Fill in the skeleton from pr-body-template.md (fenced block only, not the page's title or prose).
TL;DR / User story / Scenario are user-facing β plain language only: no specialized terms, internal implementation details, or code identifiers. Describe strictly user-observable behavior (for an API/CLI, the calling developer is the user). User story uses the same "As a <role>..." shape as Issues below, phrased for a change already made. Scenario isn't only for bugs: for a new feature, Actual behavior is what's missing/impossible today, Expected behavior is what becomes possible after this PR β no failure required. For a pure internal change with no user-observable effect, drop User story and Scenario and say so in Detailed discussion. Note blocking relationships (prerequisite for / depends on / stacked atop PR #N) in Detailed discussion.
Detailed discussion is for implementors and AI agents β as technical as needed: problem/rationale, code-level specifics, the sub-sections above.
TL;DR β User story β Scenario β Detailed discussion, in that order. Always create PRs as drafts.
PR descriptions describe net final state only β no development history, changelog, or iteration/debugging narrative; that belongs in commit messages. ### Actual behavior (the pre-existing problem being solved) and concise final ### Testing results describe state, not history, and are expected.
Reviewing a PR
Never submit a final review (approve/request-changes). Always create draft/pending reviews β the user publishes them. With MCP, omit the event field in pull_request_review_write to create a pending review.
See pr-review.md for the full procedure: fetching PR context, deduplication, diff-bounds verification, posting inline comments, and the add_comment_to_pending_review parameter-casing requirement.
Issues
Before creating, search existing issues (open + closed) and PRs for duplicates β if found, show the user and ask before proceeding. If an issue template exists, fold its required content into the skeleton rather than replacing it.
Issue bodies use the same plain-language-first skeleton as PRs (see Β§Creating a PR): fill in issue-body-template.md (fenced block only) β TL;DR β User story β Scenario β Detailed discussion. User story uses the same "As a <role>, I want to ..., to achieve ..." shape as PRs β multiple personas fine, repeat the line. Append the attribution footer last.
Safety Rules
- Always ask before pushing or publishing to GitHub β pushes, PRs, issues, comments, reviews. Commits are local and need no confirmation; pushes always do.
- Never force-push. Never amend commits. Always create new commits. If force-push is needed, ask the user to do it manually.
- Never
git add .orgit add -Aβ stage specific files - Never use interactive flags (
-i) β they require terminal input - Never skip hooks (
--no-verify) unless explicitly requested - Check for
.env, credentials, or secret files before staging β warn if found - Check for PR/issue templates before creating β use them if they exist
- Avoid
gh apiβ prefer MCP tools or high-levelghsubcommands. Usegh apionly for read-only queries with no subcommand/MCP equivalent; never for writes. Exception:gh api graphqlfor mutations with no MCP/CLI equivalent (e.g., thread resolution). - Never fork repositories β on access denied (403/404), use
ghsudoor ask the user. Forking creates a separate repo and breaks the workflow. Applies to bothgh repo forkand thefork_repositoryMCP tool. - Sandbox and
gh/ghsudoCLI β these need network access toapi.github.com. Preferred fix: add"api.github.com"tosandbox.network.allowedDomainsinsettings.jsonβghthen works inside the sandbox. If unconfigured andghfails with network errors, fall back todangerouslyDisableSandbox: trueon the Bash call. MCP tools bypass the sandbox and are unaffected.
Context Management β Large MCP Responses
GitHub MCP tools can return 10k+ tokens (file lists, diffs, review threads, CI logs), polluting the caller's context with briefly-needed data.
Solution: delegate large MCP calls to a disposable subagent (Agent tool) that extracts what's needed and returns a concise summary; its context is discarded after completion.
Delegate these (unbounded/large responses):
pull_request_readwithget_filesβ file lists on large PRspull_request_readwithget_diffβ full PR diffspull_request_readwithget_review_commentsβ PRs with many threadsget_job_logsβ CI logs (10k+ tokens typical)list_*andsearch_*operations with many results
Safe to call directly (bounded data): single PR metadata (get), single issue, branch list, single commit.
Pattern:
Agent(
subagent_type="Explore",
prompt="Fetch changed files for PR #123 in owner/repo using pull_request_read (get_files). Return only: file paths with +/- line counts and total stats."
)
Use Explore for read-only extraction (has MCP tools, no Edit/Write); general-purpose when writes are needed.
Key principle: tell the subagent exactly what to extract and what format to return β not "fetch PR data" but "fetch changed file list, return file paths with +/- line counts, total stats."
Escaping and Formatting
- Use HEREDOCs (
<<'EOF') for multi-line bodies - With
gh api(read-only only), prefer--jqover| jqβ processed internally bygh, avoiding shell expansion issues (!triggers history expansion)
GitHub MCP PR Body Formatting
Pass body to create_pull_request / update_pull_request as an actual multi-line string β NOT \n escapes on a single line. MCP passes the string straight to the API; \n renders as literal backslash-n on GitHub.
Requesting Reviewers
Use gh-request-reviewer.sh for all reviewer requests β supports multiple reviewers and @copilot:
${CLAUDE_SKILL_DIR}/../../scripts/gh-request-reviewer.sh <owner/repo> <pr_number> <reviewer> [reviewer ...]
@copilot requires gh β₯ 2.88.0 β on failure, check gh --version and escalate to the user if an upgrade is needed.
Elevated Permissions (ghsudo) -- Optional Fallback
If a gh or git command fails with 403/404 or "Resource not accessible", retry via ghsudo (pip install ghsudo). Never fork the repository as a workaround. See gh-cli-fallback.md for full usage and exit codes.