From 5d9c78c00982ff2471ba4447811dd1d88a41c0c3 Mon Sep 17 00:00:00 2001 From: "k.hiro1818" Date: Sat, 12 Sep 2026 21:08:21 +0000 Subject: [PATCH 01/14] chore: restructure agent skills/rules and add Codex support Move skills from .claude/skills/ to .agents/skills/ (symlinked back), split path-specific rules into docs/guides/agent-rules/ as the source of truth for both Claude Code and Codex, and add .codex/config.toml plus docs/guides/codex.md for Codex devcontainer setup. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01DprF7egyj1qx45rozLt3kG --- .../add-contest-table-provider/SKILL.md | 0 .../instructions.md | 0 .../skills/dep-upgrade/SKILL.md | 0 .../skills/dep-upgrade/instructions.md | 14 +- .agents/skills/extract-approach/SKILL.md | 19 + .../skills/verify-test-strength/SKILL.md | 0 .../verify-test-strength/instructions.md | 2 +- .claude/rules/accessibility.md | 46 +-- .claude/rules/auth.md | 61 +-- .claude/rules/coding-style.md | 97 +---- .claude/rules/github-actions.md | 14 +- .claude/rules/prisma-db.md | 164 +------- .claude/rules/server-cache.md | 99 +---- .claude/rules/svelte-components.md | 112 +----- .claude/rules/svelte-runes.md | 65 +--- .claude/rules/sveltekit.md | 139 +------ .claude/rules/testing-e2e.md | 153 +------- .claude/rules/testing.md | 166 +-------- .claude/settings.json | 13 +- .claude/skills/add-contest-table-provider | 1 + .claude/skills/dep-upgrade | 1 + .claude/skills/extract-approach | 1 + .claude/skills/refactor-plan/SKILL.md | 13 - .claude/skills/refactor-plan/instructions.md | 66 ---- .claude/skills/session-close/SKILL.md | 10 - .claude/skills/session-close/instructions.md | 60 --- .claude/skills/verify-test-strength | 1 + .codex/config.toml | 20 + .devcontainer/devcontainer.json | 11 +- .devcontainer/setup-devcontainer.sh | 14 +- .dockerignore | 7 +- .github/workflows/ci.yml | 3 + AGENTS.md | 197 +++++----- CLAUDE.md | 4 +- CONTRIBUTING.md | 60 ++- Dockerfile | 3 +- .../codex-devcontainer-setup/plan.md | 349 ++++++++++++++++++ docs/guides/agent-rules/accessibility.md | 38 ++ docs/guides/agent-rules/auth.md | 60 +++ docs/guides/agent-rules/coding-style.md | 94 +++++ docs/guides/agent-rules/github-actions.md | 13 + docs/guides/agent-rules/prisma-db.md | 160 ++++++++ docs/guides/agent-rules/server-cache.md | 98 +++++ docs/guides/agent-rules/svelte-components.md | 111 ++++++ docs/guides/agent-rules/svelte-runes.md | 64 ++++ docs/guides/agent-rules/sveltekit.md | 133 +++++++ docs/guides/agent-rules/testing-e2e.md | 152 ++++++++ docs/guides/agent-rules/testing.md | 163 ++++++++ docs/guides/architecture.md | 313 ++++++---------- docs/guides/claude-code.md | 179 +-------- docs/guides/codex.md | 41 ++ .../how-to-add-contest-table-provider.md | 2 +- 52 files changed, 1849 insertions(+), 1757 deletions(-) rename {.claude => .agents}/skills/add-contest-table-provider/SKILL.md (100%) rename {.claude => .agents}/skills/add-contest-table-provider/instructions.md (100%) rename {.claude => .agents}/skills/dep-upgrade/SKILL.md (100%) rename {.claude => .agents}/skills/dep-upgrade/instructions.md (80%) create mode 100644 .agents/skills/extract-approach/SKILL.md rename {.claude => .agents}/skills/verify-test-strength/SKILL.md (100%) rename {.claude => .agents}/skills/verify-test-strength/instructions.md (94%) mode change 100644 => 120000 .claude/rules/accessibility.md mode change 100644 => 120000 .claude/rules/auth.md mode change 100644 => 120000 .claude/rules/coding-style.md mode change 100644 => 120000 .claude/rules/github-actions.md mode change 100644 => 120000 .claude/rules/prisma-db.md mode change 100644 => 120000 .claude/rules/server-cache.md mode change 100644 => 120000 .claude/rules/svelte-components.md mode change 100644 => 120000 .claude/rules/svelte-runes.md mode change 100644 => 120000 .claude/rules/sveltekit.md mode change 100644 => 120000 .claude/rules/testing-e2e.md mode change 100644 => 120000 .claude/rules/testing.md create mode 120000 .claude/skills/add-contest-table-provider create mode 120000 .claude/skills/dep-upgrade create mode 120000 .claude/skills/extract-approach delete mode 100644 .claude/skills/refactor-plan/SKILL.md delete mode 100644 .claude/skills/refactor-plan/instructions.md delete mode 100644 .claude/skills/session-close/SKILL.md delete mode 100644 .claude/skills/session-close/instructions.md create mode 120000 .claude/skills/verify-test-strength create mode 100644 .codex/config.toml create mode 100644 docs/dev-notes/2026-09-06/codex-devcontainer-setup/plan.md create mode 100644 docs/guides/agent-rules/accessibility.md create mode 100644 docs/guides/agent-rules/auth.md create mode 100644 docs/guides/agent-rules/coding-style.md create mode 100644 docs/guides/agent-rules/github-actions.md create mode 100644 docs/guides/agent-rules/prisma-db.md create mode 100644 docs/guides/agent-rules/server-cache.md create mode 100644 docs/guides/agent-rules/svelte-components.md create mode 100644 docs/guides/agent-rules/svelte-runes.md create mode 100644 docs/guides/agent-rules/sveltekit.md create mode 100644 docs/guides/agent-rules/testing-e2e.md create mode 100644 docs/guides/agent-rules/testing.md create mode 100644 docs/guides/codex.md diff --git a/.claude/skills/add-contest-table-provider/SKILL.md b/.agents/skills/add-contest-table-provider/SKILL.md similarity index 100% rename from .claude/skills/add-contest-table-provider/SKILL.md rename to .agents/skills/add-contest-table-provider/SKILL.md diff --git a/.claude/skills/add-contest-table-provider/instructions.md b/.agents/skills/add-contest-table-provider/instructions.md similarity index 100% rename from .claude/skills/add-contest-table-provider/instructions.md rename to .agents/skills/add-contest-table-provider/instructions.md diff --git a/.claude/skills/dep-upgrade/SKILL.md b/.agents/skills/dep-upgrade/SKILL.md similarity index 100% rename from .claude/skills/dep-upgrade/SKILL.md rename to .agents/skills/dep-upgrade/SKILL.md diff --git a/.claude/skills/dep-upgrade/instructions.md b/.agents/skills/dep-upgrade/instructions.md similarity index 80% rename from .claude/skills/dep-upgrade/instructions.md rename to .agents/skills/dep-upgrade/instructions.md index 8b3ea9343..c73cb98a4 100644 --- a/.claude/skills/dep-upgrade/instructions.md +++ b/.agents/skills/dep-upgrade/instructions.md @@ -2,8 +2,7 @@ ## 1. Breaking Changes Analysis -Fetch the official migration guide via WebFetch. For each breaking change, grep `src/`, config files, -and `package.json` to determine applicability. Produce two tables: +Fetch the official migration guide via WebFetch. For each breaking change, grep `src/`, config files, and `package.json` to determine applicability. Produce two tables: **問題なし(対応不要)** @@ -26,14 +25,12 @@ Key areas to check: ## 2. Companion Package Check -Some packages must be upgraded together in the same commit to avoid version mismatch. -Check `package.json` for known companion pairs: +Some packages must be upgraded together in the same commit to avoid version mismatch. Check `package.json` for known companion pairs: - `@sveltejs/kit` + `@sveltejs/vite-plugin-svelte` - `eslint` + `@eslint/js` -Also verify peer dependency compatibility (`"eslint": "^8 || ^9 || ^10"` style) for all -related packages already installed. +Also verify peer dependency compatibility (`"eslint": "^8 || ^9 || ^10"` style) for all related packages already installed. If companion packages are found, include them in the upgrade scope. @@ -66,9 +63,6 @@ pnpm check pnpm test:unit ``` -> **`pnpm check` tip:** If type errors appear and you have uncommitted changes, run -> `git stash && pnpm check 2>&1 | tail -5` to confirm whether errors are pre-existing. -> Restore with `git stash pop`. If there is nothing to stash, skip this check — without -> a baseline to compare against, it gives no useful signal. +> **`pnpm check` tip:** If type errors appear and you have uncommitted changes, run `git stash && pnpm check 2>&1 | tail -5` to confirm whether errors are pre-existing. Restore with `git stash pop`. If there is nothing to stash, skip this check — without a baseline to compare against, it gives no useful signal. Update the plan.md `- [ ]` checklist and add a verification results table when done. diff --git a/.agents/skills/extract-approach/SKILL.md b/.agents/skills/extract-approach/SKILL.md new file mode 100644 index 000000000..ceb858001 --- /dev/null +++ b/.agents/skills/extract-approach/SKILL.md @@ -0,0 +1,19 @@ +--- +name: extract-approach +description: Use when a non-trivial problem has just been solved (bug fixed after debugging, tricky implementation completed, blocker resolved) and the session is about to move on. A solution without its learnings note is unfinished work. +argument-hint: '[task-name-en]' +--- + +Extract the approach from the just-solved problem into a learnings note. + +**Skip when:** trivial fixes (typo, rename, config tweak), dependency bumps, or the insight is already covered by `docs/guides/agent-rules/` or the task's `plan.md`. + +1. **Identify the problem** — from the current session: the symptom and what made it non-trivial. Multiple candidates → confirm which one with AskUserQuestion. +2. **Extract, don't narrate** — no session log, no timestamps; record only what changes future behavior: + - 問題: symptom and root cause, one line each + - 有効だったアプローチ: what worked and why it worked + - 行き詰まり: dead ends tried and why they failed + - 教訓: reusable rules for next time +3. **Align abstraction (抽象度を揃える)** — state every 教訓 at the same level of generality: one general rule per bullet, optionally followed by a single concrete example from this session. Never mix operational steps and principles in the same list. +4. **Write the note** — `docs/dev-notes/YYYY-MM-DD/{task-name-en}/learning.md`, today's date. Directory name: `$ARGUMENTS` if given; else the plan.md directory name of the task this problem belongs to (when the session is executing one); else a short kebab-case name. Japanese prose, English code identifiers, ≤ 30 lines. If the file already exists, append a `---`-separated entry. +5. **Escalate durable rules** — if a 教訓 is a project-wide convention, propose the target file and exact wording; do not apply without user confirmation. diff --git a/.claude/skills/verify-test-strength/SKILL.md b/.agents/skills/verify-test-strength/SKILL.md similarity index 100% rename from .claude/skills/verify-test-strength/SKILL.md rename to .agents/skills/verify-test-strength/SKILL.md diff --git a/.claude/skills/verify-test-strength/instructions.md b/.agents/skills/verify-test-strength/instructions.md similarity index 94% rename from .claude/skills/verify-test-strength/instructions.md rename to .agents/skills/verify-test-strength/instructions.md index e531e8305..acd9a135b 100644 --- a/.claude/skills/verify-test-strength/instructions.md +++ b/.agents/skills/verify-test-strength/instructions.md @@ -36,4 +36,4 @@ Read stdout from `--reporter=default` / `--reporter=verbose`. **Never read a cac - **A test catching nothing that other tests miss** — a deletion candidate. Confirm by re-running the full mutant set without it. - **N tests failing on one mutant** — not N times the value. Parameterized cases over one fixture usually report the same fact N times; the count is a proxy, not evidence. -Record the matrix in the commit message or `plan.md` when it justifies removing tests — it is the evidence `.claude/rules/testing.md` requires for a deliberate test-count drop. +Record the matrix in the commit message or `plan.md` when it justifies removing tests — it is the evidence `docs/guides/agent-rules/testing.md` requires for a deliberate test-count drop. diff --git a/.claude/rules/accessibility.md b/.claude/rules/accessibility.md deleted file mode 100644 index 8d386c757..000000000 --- a/.claude/rules/accessibility.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -description: Accessibility rules for UI components -paths: - - 'src/**/*.svelte' - - 'src/lib/components/**' - - 'src/features/**/components/**' ---- - -# Accessibility - -## Tables - -Always declare header scope: - -```html -Grade -abc001 -``` - -## Color - -Never use color as the sole indicator of meaning. Grade badges and status icons must -include a visible text label or `aria-label` — screen readers and users with color -vision differences depend on it. - -## Interactive Elements - -Every `