Repository navigation
docs: add add-tasks skill and link it from add-contest-table-provider #4145
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
Changes from all commits
Commits
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| name: add-tasks | ||
| description: Add tasks of contests that an existing ContestType already covers to prisma/tasks.ts, with classification tests first. Use for "問題を追加しましょう" issues. Hands off to add-contest-table-provider when a new ContestType or provider is needed. | ||
| argument-hint: '<contest_id> [<contest_id> ...]' | ||
| --- | ||
|
|
||
| Add tasks for: $ARGUMENTS | ||
|
|
||
| > When in doubt at any step, use AskUserQuestion before proceeding. | ||
|
|
||
| 1. **Classify** — decide the ContestType and prefix group per [instructions.md §Classify](instructions.md); a new ContestType or provider → stop and switch to `add-contest-table-provider` | ||
| 2. **Collect rows** — grep `prisma/tasks.ts`; ask the user to paste missing rows from problems.json; never fetch it yourself | ||
| 3. **Tests first** — add fixture cases per [instructions.md §Tests](instructions.md); confirm **RED** | ||
| 4. **Implement** — add the contest name to `prefixes.ts` → **GREEN**; insert rows per [instructions.md §Insert](instructions.md) | ||
| 5. **Verify** — `pnpm format` / `pnpm lint` / `pnpm check` / `pnpm test:unit` / `git diff --check` |
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,35 @@ | ||
| # Add Tasks — Checklist | ||
|
|
||
| --- | ||
|
|
||
| ## Classify | ||
|
|
||
| - Groups in `src/lib/contests/utils/prefixes.ts` match differently: | ||
| - `ABC_LIKE` / `ARC_LIKE`: exact match — a sequel (e.g. `diverta2019-2` next to `diverta2019`) needs its own key | ||
| - `AGC_LIKE` / `ATCODER_UNIVERSITIES` / `ATCODER_OTHERS`: prefix match — check an existing key does not already swallow the new id with the wrong type | ||
| - AOJ: regex (`regexForJag`, `regexForAojUniversity`) — no map edit if the id already matches; otherwise widening the regex also affects `getContestNameLabel` and `AojGenerator.canHandle`, so switch to `add-contest-table-provider` | ||
| - Rules are first-match-wins (`CLASSIFICATION_RULES` in `classification.ts`); confirm no earlier rule (`abc\d{3}`, `past`, `joi`, ...) catches the id | ||
| - Use the official contest name; Japanese if one exists | ||
|
|
||
| ## Collect rows | ||
|
|
||
| - Source: `https://kenkoooo.com/atcoder/resources/problems.json` | ||
| - atcoder.jp is unreachable and WebFetch truncates problems.json, so a miss there is not evidence of absence — ask the user to paste the rows | ||
| - Use `id` / `problem_index` / `name` / `title` verbatim; do not derive `id` from contest_id | ||
|
|
||
| ## Tests | ||
|
|
||
| Add cases to the fixtures the contest type exercises (all under `src/lib/contests/fixtures/` unless noted): | ||
|
|
||
| - [ ] `contest_type.ts` — always | ||
| - [ ] `contest_name_labels.ts` — when the type has a label generator (OTHERS, UNIVERSITY, AOJ\_\*); ABC_LIKE / ARC_LIKE fall back to the uppercased id, so skip | ||
| - [ ] `contest_name_and_task_index.ts` — AOJ types | ||
| - [ ] `src/test/lib/utils/test_cases/task_url.ts` — AOJ types | ||
| - [ ] `pnpm test:unit src/lib/contests/` — **RED** | ||
|
|
||
| ## Insert | ||
|
|
||
| - [ ] Place rows after the existing block of the same group in `prisma/tasks.ts` | ||
| - [ ] Contests newest first; tasks within a contest in descending index (F → A) | ||
| - [ ] For more than a few rows, generate the entries with a script instead of hand-typing | ||
| - [ ] `grep -c` the new ids to confirm the count | ||
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 @@ | ||
| ../../.agents/skills/add-tasks |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
完全一致マップも分類手順に含めてください。
提示された
src/lib/contests/utils/classification.tsの Line 42–80 では、classifyContestが順序付きルールより先にCONTEST_TYPES_BY_IDを照合します。この分岐がチェックリストにないため、完全一致マップへの登録が必要なIDを見落とす可能性があります。マップの確認を分類手順に追加してください。🤖 Prompt for AI Agents