agentleFS
opendatahub-ioopendatahub-io/docs-skills/skills/docs-workflow-pr-analysis/SKILL.md

docs-workflow-pr-analysis

Skill4 starsChanged 4 months agoApache-2.0View on GitHub

Run PR/MR analysis for the docs orchestrator workflow. Dispatches a subagent to run understand-pull-request, keeping the heavy orchestration out of the main context. Produces a structured PR-ANALYSIS.md. Conditional on has_pr — skipped when no PR URL is available.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Verify --pr is a valid GitHub or GitLab PR/MR URL

    line 25
  2. Very specific:

    Verify --repo directory exists

    line 26
  3. Very specific:

    Create --output-dir if needed

    line 27
  4. Distinctive:

    Check if learn-code output exists from a prior code-analysis step:

    line 33
  5. Distinctive:

    After the agent completes, copy the PR analysis output to the step's output directory:

    line 58
  6. Very specific:

    If PR-*-ANALYSIS.md is not found after the agent completes, mark the step as failed and report the error.

    line 70

≈ “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

docs-workflow-pr-analysis

Orchestrator step skill that wraps understand-pull-request to analyze a specific PR/MR and produce change-specific documentation context.

Arguments

FlagRequiredDescription
--prYesPR/MR URL (GitHub or GitLab)
--repoYesPath to the cloned source repository
--ticketYesJIRA ticket ID
--output-dirYesBase output directory (.agent_workspace/<ticket>/pr-analysis/)

Execution

1. Validate inputs

  • Verify --pr is a valid GitHub or GitLab PR/MR URL
  • Verify --repo directory exists
  • Create --output-dir if needed

2. Dispatch understand-pull-request subagent

You MUST use the Agent tool to run understand-pull-request in an isolated subagent. Do NOT invoke Skill: understand-pull-request inline — that would load 570+ lines of skill text plus all intermediate orchestration into the main context.

Check if learn-code output exists from a prior code-analysis step:

CODE_ANALYSIS_DIR="$(dirname "${OUTPUT_DIR}")/code-analysis"
ls "${CODE_ANALYSIS_DIR}/ONBOARDING.md" 2>/dev/null

Build the agent prompt with or without learn-code context:

Agent:
  description: "Analyze PR: <PR_URL>"
  prompt: |
    Run the understand-pull-request skill to analyze this PR/MR.

    Skill: understand-pull-request, args: "<PR_URL> --repo <REPO>"

    [If learn-code analysis exists at CODE_ANALYSIS_DIR:]
    Learn-code analysis is available at <CODE_ANALYSIS_DIR>. The skill
    will use it for richer module-level context.

    After the skill completes, report the location of the output files
    (PR-*-ANALYSIS.md and any pr-context.json).

After the agent completes, copy the PR analysis output to the step's output directory:

# Find the understand-pull-request output — it writes to .work/ or the repo's .agent_workspace/
# Look for PR-*-ANALYSIS.md in the agent's output locations
find "${REPO}" -name "PR-*-ANALYSIS.md" -newer "${OUTPUT_DIR}" 2>/dev/null | head -1

Copy the found files:

  • PR-<N>-ANALYSIS.md — Structured change analysis document
  • pr-context.json — PR metadata and per-module change data (if produced)

If PR-*-ANALYSIS.md is not found after the agent completes, mark the step as failed and report the error.

3. Write step-result.json

{
  "schema_version": 1,
  "step": "pr-analysis",
  "ticket": "<TICKET>",
  "completed_at": "<ISO 8601>",
  "pr_number": "<N>",
  "pr_url": "<PR URL>",
  "modules_affected": "<count>",
  "platform": "github|gitlab"
}

4. Report completion

Print summary:

PR analysis complete:
- PR: <url>
- Modules affected: <N>
- Platform: <github|gitlab>
- Output: <output-dir>

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.