From 297927cbb85640521edce5f1e0c7f9aae87c91ad Mon Sep 17 00:00:00 2001 From: Justin Xu Date: Thu, 25 Sep 2025 13:30:35 -0700 Subject: [PATCH] Create documentation.md --- .augment/commands/code-review.md | 16 +----- .github/workflows/format-check.yml | 55 ------------------ examples/commands/README.md | 46 +++++++++++++++ examples/commands/bug-fix.md | 14 +++++ examples/commands/code-review.md | 15 +++++ examples/commands/documentation.md | 18 ++++++ examples/commands/performance-optimization.md | 18 ++++++ examples/commands/security-review.md | 18 ++++++ examples/commands/tests.md | 18 ++++++ examples/workflows/README.md | 57 +++++++++++++++++++ examples/workflows/describe-pr.yml | 23 ++++++++ examples/workflows/on-demand-description.yml | 49 ++++++++++++++++ examples/workflows/on-demand-review.yml | 49 ++++++++++++++++ examples/workflows/pr-review.yml | 23 ++++++++ {.github => examples}/workflows/release.yml | 0 .../workflows/test-action.yml | 0 16 files changed, 349 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/format-check.yml create mode 100644 examples/commands/README.md create mode 100644 examples/commands/bug-fix.md create mode 100644 examples/commands/code-review.md create mode 100644 examples/commands/documentation.md create mode 100644 examples/commands/performance-optimization.md create mode 100644 examples/commands/security-review.md create mode 100644 examples/commands/tests.md create mode 100644 examples/workflows/README.md create mode 100644 examples/workflows/describe-pr.yml create mode 100644 examples/workflows/on-demand-description.yml create mode 100644 examples/workflows/on-demand-review.yml create mode 100644 examples/workflows/pr-review.yml rename {.github => examples}/workflows/release.yml (100%) rename {.github => examples}/workflows/test-action.yml (100%) diff --git a/.augment/commands/code-review.md b/.augment/commands/code-review.md index 3ca5f17..1becba2 100644 --- a/.augment/commands/code-review.md +++ b/.augment/commands/code-review.md @@ -1,15 +1 @@ ---- -description: Perform a comprehensive code review -argument-hint: [file-path] -model: gpt5 ---- - -Please perform a comprehensive code review of the specified file or current changes, focusing on: - -1. Code Quality: Check for readability, maintainability, and adherence to best practices -2. Security: Look for potential security vulnerabilities -3. Performance: Identify potential performance issues -4. Testing: Suggest areas that need test coverage -5. Documentation: Check if code is properly documented - -$ARGUMENTS +404: Not Found \ No newline at end of file diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml deleted file mode 100644 index 4e18033..0000000 --- a/.github/workflows/format-check.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Format Check - -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize] - branches: - - main - -jobs: - format-check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Probe repository for Bun format check - id: probe - shell: bash - run: | - if [ -f bun.lockb ] && [ -f package.json ] && grep -q '"format:check"' package.json; then - echo "run=true" >> "$GITHUB_OUTPUT" - else - echo "run=false" >> "$GITHUB_OUTPUT" - fi - - - name: Setup Bun - if: steps.probe.outputs.run == 'true' - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 - with: - bun-version: latest - - - name: Install dependencies - if: steps.probe.outputs.run == 'true' - run: bun install --frozen-lockfile - - - name: Check formatting - if: steps.probe.outputs.run == 'true' - run: bun run format:check - - - name: Check if files would change - if: steps.probe.outputs.run == 'true' - run: | - if ! git diff --exit-code; then - echo "❌ Files are not properly formatted. Run 'bun run format' to fix." - exit 1 - else - echo "✅ All files are properly formatted." - fi - - - name: Skip - No Bun format check configured - if: steps.probe.outputs.run != 'true' - run: echo "Skipping format check (no bun.lockb and format:check script)." diff --git a/examples/commands/README.md b/examples/commands/README.md new file mode 100644 index 0000000..a254907 --- /dev/null +++ b/examples/commands/README.md @@ -0,0 +1,46 @@ +# Augment Commands + +Pre-built command templates for common development tasks. Use directly or customize for your needs. + +## Installation + +### Install All Commands +```bash +mkdir -p ~/.augment/commands +cd ~/.augment/commands +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/code-review.md +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/documentation.md +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/tests.md +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/bug-fix.md +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/performance-optimization.md +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/security-review.md +``` + +### Install Specific Commands +```bash +mkdir -p ~/.augment/commands +cd ~/.augment/commands +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/code-review.md +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/commands/documentation.md +``` + +## Usage + +```bash +auggie "/code-review src/main.py" +auggie "/documentation src/utils.py" +auggie "/tests src/api/" +``` + +## Available Commands + +- `code-review.md` - Code quality checks +- `documentation.md` - Documentation generation +- `tests.md` - Test coverage +- `bug-fix.md` - Debugging assistance +- `performance-optimization.md` - Performance improvements +- `security-review.md` - Security analysis + +## Customization + +Edit the `.md` files to modify prompts, change models, or adjust behavior for your needs. \ No newline at end of file diff --git a/examples/commands/bug-fix.md b/examples/commands/bug-fix.md new file mode 100644 index 0000000..364f2bf --- /dev/null +++ b/examples/commands/bug-fix.md @@ -0,0 +1,14 @@ +--- +description: Generate a structured bug fix approach +argument-hint: [bug-description] +model: gpt5 +--- + +Help me fix this bug: $ARGUMENTS + +Please provide: + +1. Root cause analysis +2. Step-by-step fix approach +3. Testing strategy +4. Prevention measures for similar issues diff --git a/examples/commands/code-review.md b/examples/commands/code-review.md new file mode 100644 index 0000000..3ca5f17 --- /dev/null +++ b/examples/commands/code-review.md @@ -0,0 +1,15 @@ +--- +description: Perform a comprehensive code review +argument-hint: [file-path] +model: gpt5 +--- + +Please perform a comprehensive code review of the specified file or current changes, focusing on: + +1. Code Quality: Check for readability, maintainability, and adherence to best practices +2. Security: Look for potential security vulnerabilities +3. Performance: Identify potential performance issues +4. Testing: Suggest areas that need test coverage +5. Documentation: Check if code is properly documented + +$ARGUMENTS diff --git a/examples/commands/documentation.md b/examples/commands/documentation.md new file mode 100644 index 0000000..18d02da --- /dev/null +++ b/examples/commands/documentation.md @@ -0,0 +1,18 @@ +--- +description: Generate comprehensive documentation +argument-hint: [file-or-component] +model: gpt5 +--- + +Generate documentation for: $ARGUMENTS + +Include: + +1. Overview and purpose +2. API reference with parameters and return values +3. Usage examples with code snippets +4. Configuration options if applicable +5. Error handling and troubleshooting +6. Dependencies and requirements + +Format as clear, structured markdown. diff --git a/examples/commands/performance-optimization.md b/examples/commands/performance-optimization.md new file mode 100644 index 0000000..de7b1ab --- /dev/null +++ b/examples/commands/performance-optimization.md @@ -0,0 +1,18 @@ +--- +description: Analyze and optimize code performance +argument-hint: [file-path] +model: gpt5 +--- + +Analyze the performance of: $ARGUMENTS + +Please examine: + +1. Algorithm complexity and efficiency +2. Memory usage patterns +3. Database queries and optimization opportunities +4. Caching strategies +5. Network requests and bundling +6. Rendering performance (for frontend code) + +Suggest specific optimizations with expected impact. diff --git a/examples/commands/security-review.md b/examples/commands/security-review.md new file mode 100644 index 0000000..1d5a636 --- /dev/null +++ b/examples/commands/security-review.md @@ -0,0 +1,18 @@ +--- +description: Perform security analysis on code +argument-hint: [file-path] +model: gpt5 +--- + +Perform a security review of: $ARGUMENTS + +Focus on: + +1. Input validation and sanitization +2. Authentication and authorization checks +3. Data exposure and privacy concerns +4. Injection vulnerabilities (SQL, XSS, etc.) +5. Cryptographic implementations +6. Dependencies with known vulnerabilities + +Provide specific recommendations for any issues found. diff --git a/examples/commands/tests.md b/examples/commands/tests.md new file mode 100644 index 0000000..9872f2a --- /dev/null +++ b/examples/commands/tests.md @@ -0,0 +1,18 @@ +--- +description: Generate comprehensive test cases +argument-hint: [file-or-module] +model: gpt5 +--- + +Generate test cases for: $ARGUMENTS + +Create tests covering: + +1. Happy path scenarios +2. Edge cases and boundary conditions +3. Error handling and exceptions +4. Integration points with other components +5. Performance considerations +6. Security edge cases + +Use appropriate testing framework conventions and include setup/teardown as needed. diff --git a/examples/workflows/README.md b/examples/workflows/README.md new file mode 100644 index 0000000..61dc1df --- /dev/null +++ b/examples/workflows/README.md @@ -0,0 +1,57 @@ +# GitHub Workflows + +GitHub Actions workflows for integrating Augment's AI-powered code review and PR descriptions. + +## Installation + +### Install All Workflows +```bash +mkdir -p .github/workflows +cd .github/workflows +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/describe-pr.yml +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/pr-review.yml +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/on-demand-description.yml +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/on-demand-review.yml +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/release.yml +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/test-action.yml +git add .github/workflows/ +git commit -m "Add Augment AI workflows" +git push +``` + +### Install Specific Workflows +```bash +mkdir -p .github/workflows +cd .github/workflows +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/describe-pr.yml +curl -O https://raw.githubusercontent.com/augmentcode/auggie/main/examples/workflows/pr-review.yml +git add .github/workflows/ +git commit -m "Add Augment AI workflows" +git push +``` + +## Setup + +**Required Secret**: Add `AUGMENT_SESSION_AUTH` to your repository: +1. Go to Settings → Secrets and variables → Actions +2. Click "New repository secret" +3. Name: `AUGMENT_SESSION_AUTH` +4. Value: Your Augment session authentication token + +## Available Workflows + +**Automatic**: +- `describe-pr.yml` - Auto-generates PR descriptions +- `pr-review.yml` - Auto-reviews new PRs + +**On-Demand** (triggered by labels): +- `on-demand-description.yml` - Add `augment_describe` label +- `on-demand-review.yml` - Add `augment_review` label + +**Other**: +- `release.yml` - Automated release notes +- `test-action.yml` - Manual testing + +## Customization + +Edit the `.yml` files to modify triggers, parameters, or add additional steps. diff --git a/examples/workflows/describe-pr.yml b/examples/workflows/describe-pr.yml new file mode 100644 index 0000000..7201648 --- /dev/null +++ b/examples/workflows/describe-pr.yml @@ -0,0 +1,23 @@ +# Basic PR Description Generation +# Automatically generates AI-powered descriptions for new pull requests + +name: Auto-describe PRs +on: + pull_request: + types: [opened] + +jobs: + describe: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Generate PR Description + uses: augmentcode/describe-pr@v0 + with: + augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }} + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_number: ${{ github.event.pull_request.number }} + repo_name: ${{ github.repository }} + diff --git a/examples/workflows/on-demand-description.yml b/examples/workflows/on-demand-description.yml new file mode 100644 index 0000000..c2def13 --- /dev/null +++ b/examples/workflows/on-demand-description.yml @@ -0,0 +1,49 @@ +# On-Demand PR Description +# Generates descriptions when the "augment_describe" label is added to a PR + +name: On-Demand PR Description +on: + pull_request: + types: [labeled] + +jobs: + describe: + # Only run when the specific label is added + if: github.event.label.name == 'augment_describe' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Generate PR Description + uses: augmentcode/describe-pr@v0 + with: + augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }} + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_number: ${{ github.event.pull_request.number }} + repo_name: ${{ github.repository }} + + - name: Remove trigger label + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + with: + script: | + // Remove the trigger label after processing + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: 'augment_describe' + }); + + - name: Add completion label + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + with: + script: | + // Add a label to indicate the description was generated + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['auto-described'] + }); + diff --git a/examples/workflows/on-demand-review.yml b/examples/workflows/on-demand-review.yml new file mode 100644 index 0000000..88a7a42 --- /dev/null +++ b/examples/workflows/on-demand-review.yml @@ -0,0 +1,49 @@ +# On-Demand PR Review +# Generates reviews when the "augment_review" label is added to a PR + +name: On-Demand PR Review +on: + pull_request: + types: [labeled] + +jobs: + review: + # Only run when the specific label is added + if: github.event.label.name == 'augment_review' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Generate PR Review + uses: augmentcode/review-pr@v0 + with: + augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }} + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_number: ${{ github.event.pull_request.number }} + repo_name: ${{ github.repository }} + + - name: Remove trigger label + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + with: + script: | + // Remove the trigger label after processing + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: 'augment_review' + }); + + - name: Add completion label + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + with: + script: | + // Add a label to indicate the review was generated + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['auto-reviewed'] + }); + diff --git a/examples/workflows/pr-review.yml b/examples/workflows/pr-review.yml new file mode 100644 index 0000000..abea29a --- /dev/null +++ b/examples/workflows/pr-review.yml @@ -0,0 +1,23 @@ +# Basic PR Review Generation +# Automatically generates AI-powered reviews for new pull requests + +name: Auto-review PRs +on: + pull_request: + types: [opened] + +jobs: + review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Generate PR Review + uses: augmentcode/review-pr@v0 + with: + augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }} + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_number: ${{ github.event.pull_request.number }} + repo_name: ${{ github.repository }} + diff --git a/.github/workflows/release.yml b/examples/workflows/release.yml similarity index 100% rename from .github/workflows/release.yml rename to examples/workflows/release.yml diff --git a/.github/workflows/test-action.yml b/examples/workflows/test-action.yml similarity index 100% rename from .github/workflows/test-action.yml rename to examples/workflows/test-action.yml