[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77MNGZPZ9MFVXHM768BSN2E":3,"skill-same:01M77MNGZPZ9MFVXHM768BSN2E":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M77MNGZPZ9MFVXHM768BSN2E","jplearn-backend-invariants",null,"JPLearn backend invariants and traps moved from root CLAUDE.md - the two SQLite DBs, where mastery lives (SQLite, with a localStorage snapshot), the strictly serial Python bridge and dedicated runtimes, hand-allocated card id offsets, Japanese text normalization on writes, the mastered threshold, load_states default fabrication, and the bridge-payload dataclass \u002F generate_ts_types rule. Use when touching persistence or SQLite, progress\u002Fmastery\u002Freview state, scripts\u002Fdesktop_bridge.py or any bridge command or payload, electron\u002F*_runtime.cjs or a new long-running backend operation, decks or card ids (domain\u002Fdecks.py), or data\u002F write paths.","NeedMeSomeAnimeTiddy\u002FJPLearn","NeedMeSomeAnimeTiddy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F65688796?v=4","01M77MNDFMSFZ826E75M3TTACH","01M77MNDGCFNGCPA4K13ETXDDS",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fjplearn-backend-invariants\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: jplearn-backend-invariants\ndescription: JPLearn backend invariants and traps moved from root CLAUDE.md - the two SQLite DBs, where mastery lives (SQLite, with a localStorage snapshot), the strictly serial Python bridge and dedicated runtimes, hand-allocated card id offsets, Japanese text normalization on writes, the mastered threshold, load_states default fabrication, and the bridge-payload dataclass \u002F generate_ts_types rule. Use when touching persistence or SQLite, progress\u002Fmastery\u002Freview state, scripts\u002Fdesktop_bridge.py or any bridge command or payload, electron\u002F*_runtime.cjs or a new long-running backend operation, decks or card ids (domain\u002Fdecks.py), or data\u002F write paths.\n---\n\n# JPLearn backend invariants\n\nMoved verbatim from the root `CLAUDE.md` (\"Architecture\" and \"Key conventions\"). See\n`ARCHITECTURE.md` for the full design reference.\n\n## Architecture invariants\n\n**Two SQLite DBs, not equivalent**: `data\u002Fjplearn.db` (via `database.py`) is the real,\nlive-written database — review\u002Fprogress\u002Fgamification\u002Fassistant state. `data\u002Fapp.db` (via\n`SRSRepository` in `srs_repository.py`) is a dev\u002Freplay fixture used only by\n`scripts\u002Fsrs_apply.py`\u002F`srs_check.py`\u002F`srs_replay.py`\u002F`db_check.py` and one test — no runtime\napp path touches it, despite FEATURES.md describing it as live persistence.\n\n**Mastery lives in SQLite.** The counter is `card_mastery_scores`, keyed `(deck_slug, card_id)` and\nwritten on the same bridge call as the review; `review_states` (keyed by deck *name*) holds the FSRS\nschedule. The renderer's `localStorage` `cardScores` is a warm-start snapshot only (#66). Any new\nprogress-related feature should know which one it is reading. See `ARCHITECTURE.md` §4.\n\n**Bridge is strictly serial**: the Python child process handles one request at a time, so a slow\nrequest blocks everything queued behind it; three timeouts in a row restart it and reject what was\nqueued on it (`electron\u002Fbridge_worker.cjs`). Never route a new\nlong-running backend operation through the shared worker — give it a dedicated child process\nor a poll\u002Fprogress channel instead. Four dedicated runtimes already exist to copy from:\n`llm_runtime.cjs` and `voice_runtime.cjs` (HTTP to a spawned server), `speech_runtime.cjs` and\n`ocr_runtime.cjs` (newline-JSON over stdin\u002Fstdout to `scripts\u002Fspeech_recognition_server.py` \u002F\n`scripts\u002Focr_server.py`). See ARCHITECTURE.md §2 \"Dedicated runtimes\" for the lifecycle rules\n(single-flight queue, kill-on-timeout, unload only between requests). Copy `ocr_runtime.cjs` or\n`speech_runtime.cjs`, which follow all three (speech since audit 5); the tutor runtime talks HTTP\nto one llama-server and voice to a VOICEVOX it may not own, so neither is a template for a\nstdin\u002Fstdout runtime.\n\n**Card ids are hand-allocated by offset** (`domain\u002Fdecks.py`, e.g. kanji N5→N1 at 0\u002F1000\u002F2000\u002F…).\nAdding a deck means picking a verified-disjoint `id_offset`; `tests\u002Ftest_deck_id_uniqueness.py`\nfails on a collision (ARCH §8 A1), which would otherwise silently corrupt SRS\u002Fmastery state.\n\n## Data and bridge conventions\n\n- `data\u002F` normalizes Japanese text (NFC + dash\u002Fpunctuation variants, `data\u002Ftext_normalization.py`)\n  before every write — new write paths must go through it or lookups silently miss.\n- Mastered threshold: `repetitions >= 3` AND `interval >= 21` (days).\n- `data\u002Fdatabase.load_states()` may fabricate a default `ReviewState` for unseen cards — only\n  persist after an actual review, not on load.\n- Any new bridge payload should be a `@dataclass`, either in `desktop_bridge.py` or in a `data\u002F`\n  repository module the bridge imports from (e.g. `data\u002Fdictionary_repository.py`) — never\n  duplicated in both. `scripts\u002Fgenerate_ts_types.py` AST-walks the files listed in its\n  `SOURCE_FILES` tuple and generates `electron-frontend\u002Fsrc\u002Fgenerated\u002Ftypes.ts` from every\n  `@dataclass` it finds (`--check` mode detects drift). Adding a payload dataclass to a new\n  source file means adding that file to `SOURCE_FILES` too. Don't hand-write renderer types that\n  duplicate one of these dataclasses.\n","# JPLearn backend invariants\n\nMoved verbatim from the root `CLAUDE.md` (\"Architecture\" and \"Key conventions\"). See\n`ARCHITECTURE.md` for the full design reference.\n\n## Architecture invariants\n\n**Two SQLite DBs, not equivalent**: `data\u002Fjplearn.db` (via `database.py`) is the real,\nlive-written database — review\u002Fprogress\u002Fgamification\u002Fassistant state. `data\u002Fapp.db` (via\n`SRSRepository` in `srs_repository.py`) is a dev\u002Freplay fixture used only by\n`scripts\u002Fsrs_apply.py`\u002F`srs_check.py`\u002F`srs_replay.py`\u002F`db_check.py` and one test — no runtime\napp path touches it, despite FEATURES.md describing it as live persistence.\n\n**Mastery lives in SQLite.** The counter is `card_mastery_scores`, keyed `(deck_slug, card_id)` and\nwritten on the same bridge call as the review; `review_states` (keyed by deck *name*) holds the FSRS\nschedule. The renderer's `localStorage` `cardScores` is a warm-start snapshot only (#66). Any new\nprogress-related feature should know which one it is reading. See `ARCHITECTURE.md` §4.\n\n**Bridge is strictly serial**: the Python child process handles one request at a time, so a slow\nrequest blocks everything queued behind it; three timeouts in a row restart it and reject what was\nqueued on it (`electron\u002Fbridge_worker.cjs`). Never route a new\nlong-running backend operation through the shared worker — give it a dedicated child process\nor a poll\u002Fprogress channel instead. Four dedicated runtimes already exist to copy from:\n`llm_runtime.cjs` and `voice_runtime.cjs` (HTTP to a spawned server), `speech_runtime.cjs` and\n`ocr_runtime.cjs` (newline-JSON over stdin\u002Fstdout to `scripts\u002Fspeech_recognition_server.py` \u002F\n`scripts\u002Focr_server.py`). See ARCHITECTURE.md §2 \"Dedicated runtimes\" for the lifecycle rules\n(single-flight queue, kill-on-timeout, unload only between requests). Copy `ocr_runtime.cjs` or\n`speech_runtime.cjs`, which follow all three (speech since audit 5); the tutor runtime talks HTTP\nto one llama-server and voice to a VOICEVOX it may not own, so neither is a template for a\nstdin\u002Fstdout runtime.\n\n**Card ids are hand-allocated by offset** (`domain\u002Fdecks.py`, e.g. kanji N5→N1 at 0\u002F1000\u002F2000\u002F…).\nAdding a deck means picking a verified-disjoint `id_offset`; `tests\u002Ftest_deck_id_uniqueness.py`\nfails on a collision (ARCH §8 A1), which would otherwise silently corrupt SRS\u002Fmastery state.\n\n## Data and bridge conventions\n\n- `data\u002F` normalizes Japanese text (NFC + dash\u002Fpunctuation variants, `data\u002Ftext_normalization.py`)\n  before every write — new write paths must go through it or lookups silently miss.\n- Mastered threshold: `repetitions >= 3` AND `interval >= 21` (days).\n- `data\u002Fdatabase.load_states()` may fabricate a default `ReviewState` for unseen cards — only\n  persist after an actual review, not on load.\n- Any new bridge payload should be a `@dataclass`, either in `desktop_bridge.py` or in a `data\u002F`\n  repository module the bridge imports from (e.g. `data\u002Fdictionary_repository.py`) — never\n  duplicated in both. `scripts\u002Fgenerate_ts_types.py` AST-walks the files listed in its\n  `SOURCE_FILES` tuple and generates `electron-frontend\u002Fsrc\u002Fgenerated\u002Ftypes.ts` from every\n  `@dataclass` it finds (`--check` mode detects drift). Adding a payload dataclass to a new\n  source file means adding that file to `SOURCE_FILES` too. Don't hand-write renderer types that\n  duplicate one of these dataclasses.\n",{"name":5,"description":7},"main","c60a5c6aad4fabaac7300182992946a4b30a8f58",".claude\u002Fskills\u002Fjplearn-backend-invariants",0,"https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy","2026-10-30 14:31:51",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add NeedMeSomeAnimeTiddy\u002FJPLearn --skill jplearn-backend-invariants",{"tool":36,"command":37},"bunx","bunx skills add NeedMeSomeAnimeTiddy\u002FJPLearn --skill jplearn-backend-invariants",{"tool":39,"command":40},"pnpm","pnpm dlx skills add NeedMeSomeAnimeTiddy\u002FJPLearn --skill jplearn-backend-invariants","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fjplearn-backend-invariants\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M77MQ8TRFNJX7FDSJEGSZYJ0","validate-system-integrity","Runs system integrity checks across Domain and Data layers — tests, arch, SRS, and DB checks.","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvalidate-system-integrity\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M77MQ7H0TANHN7N8G3TC19XA","simulate-srs-path","Simulates SRS interval progression for a learning item using deterministic logic.","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fsimulate-srs-path\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M77MQ63TFA6WM8FDYNTCE2QM","run-study-session","Executes a full study session using due items from the system and applies SRS logic.","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Frun-study-session\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M77MQ3XB7S1SAAVY3WTKN661","reset-database","Resets the SQLite database schema to a clean state for development or testing.","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Freset-database\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M77MQ0AWX5N57W1AS4R1N0K8","playwright-browser","Persistent browser automation protocol — 3-attempt rule, verified target selectors, and debug checklist.","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fplaywright-browser\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M77MPWA9MY1W1MST7M55DAP3","import-vocabulary","Imports a batch of Japanese vocabulary into the learning system from CSV or raw text.","https:\u002F\u002Fgithub.com\u002FNeedMeSomeAnimeTiddy\u002FJPLearn\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fimport-vocabulary\u002FSKILL.md",[],[]]