-
Notifications
You must be signed in to change notification settings - Fork 0
Fix agentry CI workflows and add feature-implement #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,36 @@ | ||
| name: 'Agentry: bug-fix' | ||
| name: 'Agentry: Bug Fix' | ||
| on: | ||
| issues: | ||
| types: [labeled] | ||
| permissions: | ||
| contents: write | ||
| contents: write # needed for pr:create to push branches | ||
| pull-requests: write | ||
| issues: write | ||
| concurrency: | ||
| group: agentry-bug-fix-${{ github.event.issue.number }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| agentry: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.label.name == 'bug' | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install Claude Code | ||
| run: npm install -g @anthropic-ai/claude-code | ||
| - name: Install agentry | ||
| run: pip install "agentry @ git+https://github.com/norrietaylor/agentry.git" | ||
| - name: Diagnose and fix bug | ||
| run: agentry run workflows/bug-fix.yaml --binder github-actions | ||
| run: > | ||
| agentry --output-format json run workflows/bug-fix.yaml | ||
| --input repository-ref=. | ||
| --binder github-actions | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,36 @@ | ||
| name: 'Agentry: code-review' | ||
| name: 'Agentry: Code Review' | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| concurrency: | ||
| group: agentry-code-review-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| agentry: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.pull_request.draft == false | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install Claude Code | ||
| run: npm install -g @anthropic-ai/claude-code | ||
| - name: Install agentry | ||
| run: pip install "agentry @ git+https://github.com/norrietaylor/agentry.git" | ||
| - name: Run code review | ||
| run: agentry run workflows/code-review.yaml --binder github-actions | ||
| run: > | ||
| agentry --output-format json run workflows/code-review.yaml | ||
| --input diff=${{ github.event.pull_request.head.sha }}~1 | ||
| --input codebase=. | ||
| --binder github-actions | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: 'Agentry: Feature Implement' | ||
| on: | ||
| issues: | ||
| types: [labeled] | ||
| permissions: | ||
| contents: write # needed for pr:create to push branches | ||
| issues: write | ||
| pull-requests: write | ||
| concurrency: | ||
| group: agentry-feature-implement-${{ github.event.issue.number }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| agentry: | ||
| if: github.event.label.name == 'feature' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install Claude Code | ||
| run: npm install -g @anthropic-ai/claude-code | ||
| - name: Install agentry | ||
| run: pip install "agentry @ git+https://github.com/norrietaylor/agentry.git" | ||
| - name: Implement feature | ||
| run: > | ||
| agentry --output-format json run workflows/feature-implement.yaml | ||
| --input repository-ref=. | ||
| --binder github-actions | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,32 @@ | ||
| name: 'Agentry: triage' | ||
| name: 'Agentry: Planning Pipeline' | ||
| on: | ||
| issues: | ||
| types: [opened, reopened] | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| concurrency: | ||
| group: agentry-triage-${{ github.event.issue.number }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| agentry: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install Claude Code | ||
| run: npm install -g @anthropic-ai/claude-code | ||
| - name: Install agentry | ||
| run: pip install "agentry @ git+https://github.com/norrietaylor/agentry.git" | ||
| - name: Triage issue | ||
| run: agentry run workflows/triage.yaml --binder github-actions | ||
| - name: Run planning pipeline | ||
| run: > | ||
| agentry --output-format json run workflows/planning-pipeline.yaml | ||
| --input repository-ref=. | ||
| --binder github-actions | ||
| env: | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| identity: | ||
| name: feature-implement | ||
| version: 1.0.0 | ||
| description: Implement a feature or decompose it into sub-issues if too large. | ||
|
|
||
| inputs: | ||
| issue-description: | ||
| type: string | ||
| required: true | ||
| description: The feature request to implement. | ||
| source: issue.body | ||
| fallback: issue.title | ||
| repository-ref: | ||
| type: repository-ref | ||
| required: true | ||
| description: The repository in which to implement the feature. | ||
|
|
||
| tools: | ||
| capabilities: | ||
| - repository:read | ||
| - shell:execute | ||
| - pr:create | ||
| - issue:comment | ||
| - issue:label | ||
| - issue:create | ||
|
|
||
| agent: | ||
| runtime: claude-code | ||
| model: claude-sonnet-4-20250514 | ||
| system_prompt: prompts/feature-implement.md | ||
| max_iterations: 10 | ||
|
|
||
| safety: | ||
| trust: elevated | ||
| resources: | ||
| timeout: 600 | ||
|
|
||
| output: | ||
| schema: | ||
| type: object | ||
| required: [action, reasoning] | ||
| properties: | ||
| action: | ||
| type: string | ||
| enum: [implemented, decomposed] | ||
| pr_url: | ||
| type: string | ||
| sub_issues: | ||
| type: array | ||
| items: | ||
| type: string | ||
| reasoning: | ||
| type: string | ||
| side_effects: | ||
| - type: terminal | ||
| description: Print implementation or decomposition summary to stdout | ||
| output_paths: | ||
| - feature-implement-result.json | ||
|
|
||
| composition: | ||
| steps: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Feature Implement Agent — Elasticstack Ansible Collection | ||
|
|
||
| You are an expert Ansible developer implementing features for a collection that | ||
| deploys the Elastic Stack (Elasticsearch, Kibana, Logstash, Beats). | ||
|
|
||
| ## Decision: Implement or Decompose | ||
|
|
||
| **Implement directly** if the change touches 5 or fewer files and requires 500 or | ||
| fewer lines of new or modified code. | ||
|
|
||
| **Decompose** if the change spans more than 5 files, more than 500 lines, or | ||
| requires coordinated changes across multiple roles that would be risky in one PR. | ||
|
|
||
| When in doubt, prefer decomposition to keep PRs reviewable. | ||
|
|
||
| ## If Implementing | ||
|
|
||
| 1. Read the relevant role files to understand existing patterns and conventions. | ||
| 2. Implement the feature with appropriate molecule test coverage. | ||
| 3. Follow the fix workflow from CLAUDE.md: prefer extending existing molecule | ||
| scenarios over creating new ones (each adds ~10 min CI). | ||
| 4. Commit with a message referencing the issue number. | ||
| 5. Open a PR with label `agent-proposed`. | ||
| 6. Comment on the original issue linking to the PR. | ||
|
|
||
| ## If Decomposing | ||
|
|
||
| 1. Break the feature into sub-tasks, each implementable in a single PR. | ||
| 2. Respect role boundaries — separate tasks per role when possible. | ||
| 3. Create a GitHub issue for each sub-task with label `agent-decomposed`. | ||
| 4. Apply `agent-decomposed` label to the parent issue. | ||
| 5. Comment on the parent issue listing the sub-issues. | ||
|
|
||
| ## Project Conventions | ||
|
|
||
| - Roles: elasticsearch, kibana, logstash, beats, repos | ||
| - Templates in `roles/*/templates/`, defaults in `roles/*/defaults/main.yml` | ||
| - Molecule scenarios in `molecule/` — prefer extending existing verify.yml | ||
| - CI runs scenarios across Debian 11/12, Ubuntu 22.04/24.04, Rocky 9 | ||
| - Rolling upgrade plays must use `serial: 1` | ||
| - New variables need defaults in `defaults/main.yml` | ||
|
|
||
| ## Output | ||
|
|
||
| JSON object with `action` ("implemented" or "decomposed"), `reasoning`, and | ||
| either `pr_url` or `sub_issues` array. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.