# Docs Workflow Pr Analysis

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-opendatahub-io-docs-skills-docs-workflow-pr-analysis`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [opendatahub-io](https://agentstack.voostack.com/s/opendatahub-io)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [opendatahub-io](https://github.com/opendatahub-io)
- **Source:** https://github.com/opendatahub-io/docs-skills/tree/main/skills/docs-workflow-pr-analysis

## Install

```sh
agentstack add skill-opendatahub-io-docs-skills-docs-workflow-pr-analysis
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

| Flag | Required | Description |
|---|---|---|
| `--pr` | Yes | PR/MR URL (GitHub or GitLab) |
| `--repo` | Yes | Path to the cloned source repository |
| `--ticket` | Yes | JIRA ticket ID |
| `--output-dir` | Yes | Base output directory (`.agent_workspace//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:

```bash
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: "
  prompt: |
    Run the understand-pull-request skill to analyze this PR/MR.

    Skill: understand-pull-request, args: " --repo "

    [If learn-code analysis exists at CODE_ANALYSIS_DIR:]
    Learn-code analysis is available at . 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:

```bash
# 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--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

```json
{
  "schema_version": 1,
  "step": "pr-analysis",
  "ticket": "",
  "completed_at": "",
  "pr_number": "",
  "pr_url": "",
  "modules_affected": "",
  "platform": "github|gitlab"
}
```

### 4. Report completion

Print summary:
```
PR analysis complete:
- PR: 
- Modules affected: 
- Platform: 
- Output: 
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [opendatahub-io](https://github.com/opendatahub-io)
- **Source:** [opendatahub-io/docs-skills](https://github.com/opendatahub-io/docs-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-opendatahub-io-docs-skills-docs-workflow-pr-analysis
- Seller: https://agentstack.voostack.com/s/opendatahub-io
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
