Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .agents/skills/address-pr-feedback/SKILL.md
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.
4 changes: 4 additions & 0 deletions .agents/skills/address-pr-feedback/agents/openai.yaml
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."
12 changes: 12 additions & 0 deletions .agents/skills/implement-issue/SKILL.md
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.
4 changes: 4 additions & 0 deletions .agents/skills/implement-issue/agents/openai.yaml
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."
14 changes: 14 additions & 0 deletions .agents/skills/sync-repos/SKILL.md
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.
4 changes: 4 additions & 0 deletions .agents/skills/sync-repos/agents/openai.yaml
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."
9 changes: 9 additions & 0 deletions .codex/config.toml
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",
]
Comment thread
codemonkey85 marked this conversation as resolved.

[features]
hooks = true
18 changes: 18 additions & 0 deletions .codex/hooks.json
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..."
}
]
}
]
}
}
86 changes: 86 additions & 0 deletions .codex/hooks/regen-data.py
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()
161 changes: 0 additions & 161 deletions .github/workflows/claude.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .sync-repos
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - absolute path e.g. C:\Code\PKHeX or ~/Code/codemonkey85/PKHeX
# - relative path e.g. ../PKHeX (resolved relative to this file's directory)
#
# First existing git directory wins. See ~/.claude/skills/sync-repos/SKILL.md for the full resolution order.
# First existing git directory wins. See .agents/skills/sync-repos/SKILL.md for the full resolution order.

PKHeX
pokemon-showdown
Expand Down
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ Prefer reading local source over fetching from GitHub or relying solely on docs:
- **Tests**: Do not run `dotnet test` locally — leave it to the CI GitHub Actions workflow (`.github/workflows/buildandtest.yml`). Run only `dotnet format` and `dotnet build -c Debug` to verify changes locally.
- **PR review feedback**: (1) Review all comments and plan the response; (2) reply to each individual comment on the PR explaining what you're doing and why; (3) make code changes, commit, and push; (4) mark all addressed comments as resolved on the PR.

## Codex repository workflows

- Use the repository skill `$address-pr-feedback` whenever addressing pull request review comments.
- Use the repository skill `$implement-issue` whenever implementing a GitHub issue.
- Use the repository skill `$sync-repos` before work that depends on the current state of PKHeX or the other repositories listed in `.sync-repos`.
- For new UI or substantial visual redesigns, use the `frontend-design` skill when it is available.
- Codex project tooling lives in `.codex/`: `config.toml` configures the Playwright MCP server, while `hooks.json` regenerates derived data when its generator source changes. Project hooks must be reviewed and trusted with `/hooks` before Codex will run them.

## User-facing advice — protect user data

When suggesting troubleshooting steps to users (in issue comments, emails, or docs),
Expand Down
Loading