-
-
Notifications
You must be signed in to change notification settings - Fork 28
Migrate repository agent tooling to Codex #1102
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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| name: address-pr-feedback | ||
| description: Address unresolved GitHub pull request review feedback in PKMDS-Blazor. Use when asked to handle PR comments, review threads, requested changes, or reviewer follow-up. | ||
| --- | ||
|
|
||
| 1. Read every unresolved review thread and relevant PR comment before changing code. Ignore already-resolved feedback unless it supplies necessary context. | ||
| 2. Break the feedback into concrete tasks and identify any comments that conflict or need clarification. | ||
| 3. Reply to each unresolved comment individually, explaining what you will change and why. | ||
| 4. Implement the smallest coherent changes that address the feedback. Preserve unrelated work and follow `AGENTS.md`. | ||
| 5. Run the repository-approved formatting and build checks. Do not run `dotnet test` locally; leave tests to GitHub Actions. | ||
| 6. Review the resulting diff, commit it, and push it when the user has asked for the PR feedback workflow to be completed. | ||
| 7. Reply with the result where useful and resolve each thread only after its change has landed. |
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,4 @@ | ||
| interface: | ||
| display_name: "Address PR Feedback" | ||
| short_description: "Address unresolved PR review feedback" | ||
| default_prompt: "Use $address-pr-feedback to address the unresolved review feedback on this pull request." |
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,12 @@ | ||
| --- | ||
| name: implement-issue | ||
| description: Implement a PKMDS-Blazor GitHub issue end to end. Use when asked to investigate and implement an issue, bug, feature request, or feature-parity item and prepare it for review. | ||
| --- | ||
|
|
||
| 1. Read the full issue and its comments. Extract the current requirements, corrections, acceptance criteria, and unresolved questions. | ||
| 2. Break the work into concrete tasks and inspect the real code and data paths before deciding on an implementation. | ||
| 3. For PKHeX behavior, inspect the local PKHeX source checkout described in `AGENTS.md` and follow the production API patterns used there. | ||
| 4. Implement a focused, maintainable change that follows the repository architecture and coding conventions. | ||
| 5. Add or update appropriate automated coverage, then run only the local validation allowed by `AGENTS.md`. Do not run `dotnet test` locally. | ||
| 6. Update documentation and the PKHeX feature-parity roadmap when the issue changes documented behavior or parity status. | ||
| 7. Review the final diff and, when the user asks for the complete issue workflow, commit, push, and open a pull request with a clear summary and validation notes. |
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,4 @@ | ||
| interface: | ||
| display_name: "Implement Issue" | ||
| short_description: "Implement repository issues end to end" | ||
| default_prompt: "Use $implement-issue to implement this repository issue and prepare it for review." |
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,14 @@ | ||
| --- | ||
| name: sync-repos | ||
| description: Synchronize external repositories used by PKMDS-Blazor. Use when asked to sync, get latest, refresh related repos, inspect upstream changes, or prepare work that depends on current PKHeX, PokeAPI, Pokemon Showdown, sprites, or plugin sources. | ||
| --- | ||
|
|
||
| 1. Read `.sync-repos` from the repository root. Ignore blank lines and comments. | ||
| 2. Resolve each entry without guessing destructively: | ||
| - Resolve relative paths from the PKMDS-Blazor repository root. | ||
| - Use absolute paths as written after expanding the user's home directory. | ||
| - For bare names or `owner/repo`, check the current repository's parent, `$CODE_ROOT` when set, `~/Code/codemonkey85`, `~/Code`, and `C:\Code`; use the first existing Git repository. | ||
| 3. Inspect each repository's status, branch, upstream, and remotes before changing it. Never discard, stash, or overwrite local work. | ||
| 4. Fetch repositories in parallel when practical. Fast-forward the checked-out branch with `git pull --ff-only` only when its worktree state makes that safe; otherwise fetch and report why it was not updated. | ||
| 5. Obtain any required approval for network access or writes outside the current workspace. | ||
| 6. Report the resolved path, branch, previous and current commit, update result, and any repositories that were missing, dirty, divergent, or lacked an upstream. |
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,4 @@ | ||
| interface: | ||
| display_name: "Sync Related Repositories" | ||
| short_description: "Update repositories used by PKMDS-Blazor" | ||
| default_prompt: "Use $sync-repos to update the repositories that PKMDS-Blazor depends on for this task." |
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,9 @@ | ||
| [mcp_servers.playwright] | ||
| command = "npx" | ||
| args = [ | ||
| "-y", | ||
| "@playwright/mcp@0.0.78", | ||
| ] | ||
|
|
||
| [features] | ||
| hooks = true | ||
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,18 @@ | ||
| { | ||
| "description": "Regenerate derived data after its generator source changes.", | ||
| "hooks": { | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": "Write|Edit", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "python3 \"$(git rev-parse --show-toplevel)/.codex/hooks/regen-data.py\"", | ||
| "timeout": 120, | ||
| "statusMessage": "Regenerating data files..." | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
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,86 @@ | ||
| #!/usr/bin/env python3 | ||
| """Regenerate derived data after Codex edits a data generator.""" | ||
|
|
||
| import json | ||
| import re | ||
| import subprocess | ||
| import sys | ||
| from pathlib import Path | ||
| from typing import Any, Iterable | ||
|
|
||
|
|
||
| def strings(value: Any) -> Iterable[str]: | ||
| if isinstance(value, str): | ||
| yield value | ||
| elif isinstance(value, dict): | ||
| for child in value.values(): | ||
| yield from strings(child) | ||
| elif isinstance(value, list): | ||
| for child in value: | ||
| yield from strings(child) | ||
|
|
||
|
|
||
| def changed_paths(payload: dict[str, Any]) -> set[str]: | ||
| paths: set[str] = set() | ||
| for container_name in ("tool_input", "tool_response"): | ||
| container = payload.get(container_name) or {} | ||
| if isinstance(container, dict): | ||
| for key in ("file_path", "filePath", "path"): | ||
| value = container.get(key) | ||
| if isinstance(value, str): | ||
| paths.add(value.replace("\\", "/")) | ||
|
|
||
| for value in strings(container): | ||
| for match in re.finditer( | ||
| r"^\*\*\* (?:Add|Update|Delete) File: (.+)$", value, re.MULTILINE | ||
| ): | ||
| paths.add(match.group(1).strip().replace("\\", "/")) | ||
| for match in re.finditer(r"^diff --git a/(.+?) b/(.+)$", value, re.MULTILINE): | ||
| paths.add(match.group(2).strip().replace("\\", "/")) | ||
| return paths | ||
|
|
||
|
|
||
| def run(command: list[str], repo: Path) -> None: | ||
| result = subprocess.run(command, cwd=repo, check=False) | ||
| if result.returncode: | ||
| raise SystemExit(result.returncode) | ||
|
|
||
|
|
||
| def main() -> None: | ||
| payload = json.load(sys.stdin) | ||
| paths = changed_paths(payload) | ||
| repo = Path(__file__).resolve().parents[2] | ||
|
|
||
| if any(Path(path).name == "generate-descriptions.cs" for path in paths): | ||
| pokeapi = repo.parent / "pokeapi" | ||
| showdown = repo.parent / "pokemon-showdown" | ||
| missing = [str(path) for path in (pokeapi, showdown) if not path.is_dir()] | ||
| if missing: | ||
| print( | ||
| "Skipped description regeneration; missing source checkout(s): " | ||
| + ", ".join(missing), | ||
| flush=True, | ||
| ) | ||
| return | ||
|
|
||
| print("Regenerating ability, move, and item data...", flush=True) | ||
| run( | ||
| [ | ||
| "dotnet", | ||
| "run", | ||
| "tools/generate-descriptions.cs", | ||
| "--", | ||
| "--pokeapi", | ||
| str(pokeapi), | ||
| "--showdown", | ||
| str(showdown), | ||
| ], | ||
| repo, | ||
| ) | ||
| elif any(Path(path).name == "generate-tm-data.cs" for path in paths): | ||
| print("Regenerating TM data...", flush=True) | ||
| run(["dotnet", "run", "tools/generate-tm-data.cs"], repo) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
This file was deleted.
Oops, something went wrong.
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
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
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.