agentleFS
TJaenichenTJaenichen/claude-code-harness/skills/project/pr/SKILL.md

pr

Skill0 starsChanged 3 months agoMITView on GitHub

Manage Pull Requests - create, update description, add wiki links. Use for all PR operations in Azure DevOps.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Check if branch is pushed to remote, if not push it: git push -u origin {branch}

    line 47
  2. Distinctive:

    Create PR via POST with:

    line 48
  3. Very specific:

    Default/prepend: Add content at beginning

    line 60
  4. Very specific:

    Remove existing ## Documentation section if present

    line 68
  5. Very specific:

    Always use -UseDefaultCredentials for Windows auth

    line 107
  6. Distinctive:

    When updating, preserve existing description content unless explicitly replacing

    line 110
  7. Distinctive:

    Use PowerShell scripts saved to temp files to avoid escaping issues with complex commands

    line 111

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

Pull Request Management

Command: /pr $ARGUMENTS

Commands

CommandDescriptionExample
createCreate new PR from current branch/pr create "My PR Title"
updateUpdate PR description/pr update "New description content"
wikiAdd wiki documentation link to PR/pr wiki "Title|URL" or /pr wiki URL
infoShow current branch's PR info/pr info

Azure DevOps Configuration

  • Server: https://devops.example.com/
  • Project: MyProject (ID: <PROJECT_ID>)
  • Repository: Payments (ID: <REPO_ID>)
  • Auth: Windows Integrated Security (UseDefaultCredentials)

API Endpoints

Base URL: https://devops.example.com/DefaultCollection/MyProject/_apis/git/repositories/<REPO_ID>
OperationMethodEndpoint
Get PR by branchGET/pullrequests?searchCriteria.sourceRefName=refs/heads/{branch}&api-version=6.0
Get PR by IDGET/pullrequests/{id}?api-version=6.0
Create PRPOST/pullrequests?api-version=6.0
Update PRPATCH/pullrequests/{id}?api-version=6.0

Your Task

Parse $ARGUMENTS and execute the appropriate command:

/pr create "Title" or /pr create "Title" "Description"

  1. Get current branch name: git rev-parse --abbrev-ref HEAD
  2. Check if branch is pushed to remote, if not push it: git push -u origin {branch}
  3. Create PR via POST with:
    • sourceRefName: refs/heads/{current-branch}
    • targetRefName: refs/heads/main
    • title: from arguments
    • description: from arguments (optional)
  4. Return PR URL: https://devops.example.com/DefaultCollection/MyProject/_git/Payments/pullrequest/{id}

/pr update "content" or /pr update prepend "content" or /pr update append "content"

  1. Get current branch name
  2. Find PR for current branch via GET search
  3. Get current description
  4. Update description:
    • Default/prepend: Add content at beginning
    • append: Add content at end
    • replace: Replace entire description
  5. PATCH the PR with new description

/pr wiki "Title|URL" or /pr wiki URL

  1. Parse wiki link - if no |, use "Documentation" as title
  2. Find PR for current branch
  3. Remove existing ## Documentation section if present
  4. Prepend new documentation section:
    ## Documentation
    - [Title](URL)
    
  5. PATCH the PR

/pr info

  1. Get current branch name
  2. Find PR for current branch
  3. Display: PR ID, Title, Status, URL, Description preview

PowerShell Template for API Calls

$repoId = "<REPO_ID>"
$baseUrl = "https://devops.example.com/DefaultCollection/MyProject/_apis/git/repositories/$repoId"

# GET request
Invoke-RestMethod -Uri "$baseUrl/pullrequests?searchCriteria.sourceRefName=refs/heads/$branch&api-version=6.0" -UseDefaultCredentials

# PATCH request
$body = @{ description = $newDesc } | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri "$baseUrl/pullrequests/$prId`?api-version=6.0" -Method Patch -Body $body -ContentType "application/json" -UseDefaultCredentials

# POST request (create)
$body = @{
    sourceRefName = "refs/heads/$branch"
    targetRefName = "refs/heads/main"
    title = $title
    description = $description
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri "$baseUrl/pullrequests?api-version=6.0" -Method Post -Body $body -ContentType "application/json" -UseDefaultCredentials

Important

  • Always use -UseDefaultCredentials for Windows auth
  • PR URL format: https://devops.example.com/DefaultCollection/MyProject/_git/Payments/pullrequest/{id}
  • Wiki link format supports both Title|URL and just URL
  • When updating, preserve existing description content unless explicitly replacing
  • Use PowerShell scripts saved to temp files to avoid escaping issues with complex commands

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.