agentic-swe

agentic-swe

Small GitHub Actions for agent-assisted software development.

Setup guide for repository maintainers

PR Agent

  1. In Settings → Secrets and variables → Actions, add OPENROUTER_API_KEY and PR_AGENT_TOKEN. Use a fine-grained PAT or GitHub App token with Contents: write and Pull requests: write. Do not use GITHUB_TOKEN; its pushes normally do not trigger another CI run.
  2. Add the workflow below. Replace npm test with your repository's deterministic validation command.
  3. Enable Allow auto-merge and configure required branch checks. PR Agent skips fork pull requests and does not bypass branch protection.
name: PR Agent

on:
  pull_request:
    types: [opened, synchronize, reopened]

permissions:
  contents: write
  pull-requests: write

jobs:
  agent:
    uses: zc6600/agentic-swe/.github/workflows/pr-agent.yml@main
    with:
      validation-command: npm test
    secrets:
      OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
      PR_AGENT_TOKEN: ${{ secrets.PR_AGENT_TOKEN }}

Documentation Guard

Add this step to your CI workflow. It checks Markdown files and reports actionable GitHub annotations when a limit is exceeded. It requires no secrets.

- name: Check documentation length
  uses: zc6600/agentic-swe@main

Integration instructions for coding agents

Copy these instructions into your coding agent. It can inspect the repository, choose the relevant action, and prepare the configuration. A maintainer must add PR Agent secrets in GitHub settings.

Integrate the appropriate agentic-swe GitHub Action into this repository.

1. Inspect the repository's language, package manager, default branch, existing CI, and real deterministic validation command.
2. Documentation Guard: if Markdown length checks are useful, add this step to the existing CI job:
   - name: Check documentation length
     uses: zc6600/agentic-swe@main
   It checks README.md against 2,000 words and other .md/.mdx files against 4,000 words.
3. PR Agent: if automatic conflict repair is wanted, create `.github/workflows/pr-agent.yml` with this pattern. Replace `npm test` with the detected command:
   name: PR Agent
   on:
     pull_request:
       types: [opened, synchronize, reopened]
   permissions:
     contents: write
     pull-requests: write
   jobs:
     agent:
       uses: zc6600/agentic-swe/.github/workflows/pr-agent.yml@main
       with:
         validation-command: npm test
       secrets:
         OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
         PR_AGENT_TOKEN: ${{ secrets.PR_AGENT_TOKEN }}
4. Do not ask for, read, or write secret values. Tell the maintainer to add OPENROUTER_API_KEY and PR_AGENT_TOKEN in repository Actions settings. PR_AGENT_TOKEN needs Contents: write and Pull requests: write.
5. Tell the maintainer to enable GitHub auto-merge and required branch checks. Fork PRs are skipped.
6. Validate the workflow configuration and report files changed, validation command, and remaining maintainer actions.

Never replace the repository's test command with `true`. For production, pin action references to a reviewed release or commit SHA.

Source: GitHub repository · PR Agent workflow · Documentation Guard action