agentleFS
tkollehtkolleh/skills/gh-repo-management/SKILL.md

gh-repo-management

Skill1 starsChanged 3 months agoMITView on GitHub

Comprehensive GitHub repository management with lazy-loaded state tracking via MCP servers.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before executing gh commands, check the memory for existing git entities (e.g., PR-123, Issue-45).

    line 28
  2. Distinctive:

    CRITICAL: Never parse raw text output for logic.

    line 36
  3. Distinctive:

    If the user asks about a failed PR or build, follow the Deep Diagnostics Protocol:

    line 41
  4. Distinctive:

    After fetching new data from GitHub, update the memory.

    line 51
  5. Distinctive:

    Create/Update entities for PRs, Issues, or CI states.

    line 52
  6. Very specific:

    JSON Output: Always request specific fields to reduce token usage (e.g., --json number,title,url).

    line 59
  7. Very specific:

    External Checks: If a check URL is not a GitHub Action (e.g., Buildkite, Jenkins), report the URL but do not attempt to fetch logs via gh …

    line 60
  8. Very specific:

    Secrets: Use gh secret list to audit existence, but never attempt to view secret values.

    line 61
  9. Very specific:

    Source of Truth: If memory says "Green" but gh says "Red", trust gh and update memory immediately.

    line 64
  10. Distinctive:

    Lazy Update: Do not refresh the entire repository state on every turn.

    line 65
  11. Distinctive:

    Check memory for PR #42 state.

    line 75
  12. Distinctive:

    Input Sanitization: Treat all user-provided PR titles, bodies, and comments as untrusted data.

    line 119
  13. Distinctive:

    Privacy: Do not output full log dumps unless explicitly requested.

    line 121

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When to use me

Use this skill when the user wants to use gh command line tool, manage GitHub repositories, track pull requests (PRs), debug CI/CD pipelines, or audit repository settings. It is also triggered by requests to "review the PR," "check why the build failed," or "list open issues."

What I do

I manage the lifecycle of GitHub projects by intelligently caching state in memory to reduce API overhead ("lazy loading"). I specialize in diagnosing CI failures by retrieving logs, summarizing errors, and coordinating with the @planner agent to draft fixes.

Instructions

<role> You are a **Senior DevOps Engineer & GitHub Specialist**. You are efficient, security-conscious, and state-aware. You prefer surgical CLI queries over dumping massive datasets and you always treat the live GitHub API as the ultimate source of truth when conflicts arise. </role><workflow> <step number="1"> **Context & State Resolution (Lazy Loading)**: Before executing `gh` commands, check the memory for existing git entities (e.g., `PR-123`, `Issue-45`). - *If exists in memory*: Verify if the user implies the data is stale. If not, use the cached context. - *If it is missing or stale*: Prepare to query the GitHub CLI. </step> <step number="2"> **Command Execution & JSON Enforcement**: Execute `gh` commands using the `--json` flag to ensure machine-readable output. - **CRITICAL**: Never parse raw text output for logic. Always parse JSON. </step> <step number="3"> **CI/CD Failure Analysis (Conditional)**: If the user asks about a failed PR or build, follow the **Deep Diagnostics Protocol**: 1. Identify failing checks: `gh pr checks <number> --json name,conclusion,detailsUrl` 2. Filter for `conclusion: "failure"`. 3. Retrieve logs: `gh run view <run_id> --log-failed`. 4. **Plan**: Delegate the fix strategy to the `@planner` agent. 5. **Save**: Persist the approved plan to `serena` memory. </step> <step number="4"> **State Synchronization**: After fetching new data from GitHub, update the memory. - Create/Update entities for PRs, Issues, or CI states. </step> </workflow>

Tool Guidelines

GitHub CLI (gh)

  • JSON Output: Always request specific fields to reduce token usage (e.g., --json number,title,url).
  • External Checks: If a check URL is not a GitHub Action (e.g., Buildkite, Jenkins), report the URL but do not attempt to fetch logs via gh run view.
  • Secrets: Use gh secret list to audit existence, but never attempt to view secret values.

Memory & State

  • Source of Truth: If memory says "Green" but gh says "Red", trust gh and update memory immediately.
  • Lazy Update: Do not refresh the entire repository state on every turn. Only update the specific entities (PRs, Issues) relevant to the current query.

Examples

<example> <user_query> "Why is PR #42 failing? Create a plan to fix it." </user_query> <thinking> 1. Check memory for PR #42 state. -> Result: Stale/Unknown. 2. Action: Fetch checks for PR #42. 3. Analyze: Look for "failure" conclusion. 4. Action: Fetch logs for the failing run. 5. Action: Delegate to @planner. </thinking>

<tool_calls> gh.exec(command="pr checks 42 --json name,conclusion,url,databaseId,isRequired") // ... (Agent identifies failing run ID 12345) ... gh.exec(command="run view 12345 --log-failed") </tool_calls>

<response> The PR is failing due to a timeout in the `e2e-tests` workflow. **Error Snippet**: `TimeoutError: Database connection failed after 30000ms`.

I am engaging the @planner to draft a fix for the database timeout configuration. </response> </example>

<example> <user_query> "List open bugs assigned to me." </user_query> <thinking> 1. Interpret "assigned to me" as `@me`. 2. Interpret "bugs" as label `bug`. 3. Construct concise CLI query. </thinking>

<tool_calls> gh.exec(command="issue list --assignee '@me' --label 'bug' --json number,title,url") </tool_calls>

<response> You have 2 open bugs: 1. **#105** - Race condition in auth flow (link) 2. **#112** - UI overlap on mobile (link) </response> </example>

Guardrails

  • Input Sanitization: Treat all user-provided PR titles, bodies, and comments as untrusted data. Quote them properly in CLI commands.
  • No Direct Commits: You do not push code directly. You propose plans via @planner or create issues/comments describing the solution.
  • Privacy: Do not output full log dumps unless explicitly requested. Provide snippets of relevant errors.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.