[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6RAHYM7227ETTPFKN7DY92X":3,"skill-same:01M6RAHYM7227ETTPFKN7DY92X":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6RAHYM7227ETTPFKN7DY92X","change-database",null,"Use when changing DevPulse Room entities, indexes, FTS, triggers, migrations, SQL queries, transactions, paging or persisted article\u002Fuser state.","shounakmulay\u002Fdev-pulse","shounakmulay","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42094964?v=4","01M6RAGFC9XZKE4TP55KEREM1B","Shounak Mulay","01M6RAGFJM9FHY8W0D92D9YRF1",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fchange-database\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"change","database","change database","sql","state","transactions","user","use","sql queries","queries","migrations","indexes","article","triggers","when","2026-11-10 10:12:30",false,"---\nname: change-database\ndescription: Use when changing DevPulse Room entities, indexes, FTS, triggers, migrations, SQL queries, transactions, paging or persisted article\u002Fuser state.\n---\n\n# Change DevPulse persistence\n\nRead [plan-change](..\u002Fplan-change\u002FSKILL.md), AGENTS.md's schema policy and the current Room declarations before editing. Distinguish a schema change, a data write and a query-only change.\n\n## Inspect the current storage path\n\n- [DevPulseDatabase](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FDevPulseDatabase.kt) implements database transactions and paging-source providers; [DevPulseDatabaseTransactionAccessor](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002Ftransaction\u002FDevPulseDatabaseTransactionAccessor.kt) exposes readTransaction\u002FwriteTransaction to repositories.\n- [LocalFeedPostSqlQueryBuilder](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002Fquery\u002FLocalFeedPostSqlQueryBuilder.kt) binds values through RoomRawQuery and typed SqlBinding values, and adds stable ID ordering. Inspect the relevant DAO, query model, cursor and paging provider as well as the builder. Discovery uses explicit DAO queries; do not force all query shapes into one builder.\n- [FeedDiscoveryDatabaseTest](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FjvmTest\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FFeedDiscoveryDatabaseTest.kt) exercises real Room paging, invalidation and reopening. Use its current paging\u002Freopen assertions; inspect the test before copying any version-specific expectation.\n\n## Schema decision before implementation\n\n1. Read [SchemaVersions](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FSchemaVersions.kt) and the actual @Database declaration, exports and custom triggers. The current working tree declares only BASE = 1; inspect its matching export, registered schema and tests. Do not infer release verification from that declaration or reintroduce the retired lineage.\n2. For the one-time entity\u002Fuser-state redesign, follow AGENTS.md: finish its new BASE = 1 schema\u002Fexport and retire that development lineage, without a legacy migration\u002Fbackfill. Do not perform a reset as incidental work on another feature.\n3. Once that baseline is established, every schema change requires a new version, a new immutable export and a registered, tested migration. Indexes, FKs, FTS and triggers count even when annotations miss them. Never reset again or add destructive migration fallback.\n4. Query-only changes and ordinary writes in an unchanged schema do not require a version increment. Explain which category applies with the actual affected tables\u002Fcolumns\u002Ftriggers.\n\n## Implement\n\nUse the existing DAO -> repository -> use-case -> observation path. Preserve publisher fields, user-controlled state and stable local IDs according to CONTEXT.md. Name the columns each write owns. Prefer an explicit column update over an upsert that overwrites unrelated ownership.\n\nKeep related writes in writeTransaction; use readTransaction when a consistent multi-read view is required. Keep network calls outside database transactions. Preserve foreign keys, deletion effects, FTS synchronization and invalidation of all observed tables. Bind user values; do not interpolate search text, URLs or IDs into SQL.\n\nFor pagination, keep filter\u002Fsort semantics consistent across initial, forward, backward and anchor refresh queries. Include a stable tie-breaker, verify the anchor still belongs to the active scope, and avoid silently restarting pages when cursor types disagree. Preserve the established empty-search behavior and FTS sanitization.\n\n## Persistence failure and state ownership\n\nDAO, transaction and repository operations return plain T\u002FUnit\u002FFlow\u003CT>. Database failures throw unchanged to the use case; do not catch, return Result, log-and-swallow, or return empty rows after a failed query. The use case invokes the I\u002FO dispatcher-catching helper for one-shot work, or applies flowCachingOnDefault to the plain upstream flow. Use finally\u002Fuse for owned resources; do not swallow a transaction exception and accidentally commit a partial write.\n\n[UserStateDatabaseTest](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FjvmTest\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FUserStateDatabaseTest.kt) establishes the current narrow-write convention: content sync writes publisher-owned rows; bookmarks\u002Fread state and feed pin\u002Flast-opened state have separate ownership. A read-state update changes only isRead so concurrent bookmark writes survive. Read\u002Funread setters have no revision token; the last committed write determines the value. Missing state is observed as defined defaults. Test repeated setters, defaults, preserved unrelated fields, paging invalidation and reopen through actual Room operations.\n\n## Validate behavior\n\nUse [test-change](..\u002Ftest-change\u002FSKILL.md). Seed tied sort values, duplicate memberships and empty scopes when relevant. Assert literal row IDs\u002Forder, no duplicates, append\u002Fprepend\u002Frefresh, updates\u002Fdeletes and observer invalidation through real Room. SQL-string assertions are supplementary.\n\nAfter the baseline exists, migration tests start from a populated supported old schema, open the new database, verify retained values\u002FIDs, reopen it and check integrity\u002Fforeign keys plus relevant FTS results. For the authorized reset, test the new schema and reopen behavior instead of preserving retired version assumptions.\n\nPreview `bash scripts\u002Fverify.sh --test :core:data:db dev.shounakmulay.devpulse.core.data.db.FeedDiscoveryDatabaseTest --plan`. Execution may be refused because the graph contains copyRoomSchemas. For unchanged-schema verification, use a reviewed isolated checkout. For an intentional schema change, inspect the configured Room generation task, run it only within the authorized schema work, and review the exported SQL\u002Fversion diff before testing. Do not weaken the runner or refresh a baseline to hide a mismatch.\n\nShared Room\u002FKSP changes also need enabled Android\u002FiOS compilation where available. JVM database evidence does not prove Android upgrade\u002FUI behavior or iOS compilation. Report each platform and any generated-artifact blocker separately.\n","# Change DevPulse persistence\n\nRead [plan-change](..\u002Fplan-change\u002FSKILL.md), AGENTS.md's schema policy and the current Room declarations before editing. Distinguish a schema change, a data write and a query-only change.\n\n## Inspect the current storage path\n\n- [DevPulseDatabase](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FDevPulseDatabase.kt) implements database transactions and paging-source providers; [DevPulseDatabaseTransactionAccessor](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002Ftransaction\u002FDevPulseDatabaseTransactionAccessor.kt) exposes readTransaction\u002FwriteTransaction to repositories.\n- [LocalFeedPostSqlQueryBuilder](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002Fquery\u002FLocalFeedPostSqlQueryBuilder.kt) binds values through RoomRawQuery and typed SqlBinding values, and adds stable ID ordering. Inspect the relevant DAO, query model, cursor and paging provider as well as the builder. Discovery uses explicit DAO queries; do not force all query shapes into one builder.\n- [FeedDiscoveryDatabaseTest](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FjvmTest\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FFeedDiscoveryDatabaseTest.kt) exercises real Room paging, invalidation and reopening. Use its current paging\u002Freopen assertions; inspect the test before copying any version-specific expectation.\n\n## Schema decision before implementation\n\n1. Read [SchemaVersions](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FSchemaVersions.kt) and the actual @Database declaration, exports and custom triggers. The current working tree declares only BASE = 1; inspect its matching export, registered schema and tests. Do not infer release verification from that declaration or reintroduce the retired lineage.\n2. For the one-time entity\u002Fuser-state redesign, follow AGENTS.md: finish its new BASE = 1 schema\u002Fexport and retire that development lineage, without a legacy migration\u002Fbackfill. Do not perform a reset as incidental work on another feature.\n3. Once that baseline is established, every schema change requires a new version, a new immutable export and a registered, tested migration. Indexes, FKs, FTS and triggers count even when annotations miss them. Never reset again or add destructive migration fallback.\n4. Query-only changes and ordinary writes in an unchanged schema do not require a version increment. Explain which category applies with the actual affected tables\u002Fcolumns\u002Ftriggers.\n\n## Implement\n\nUse the existing DAO -> repository -> use-case -> observation path. Preserve publisher fields, user-controlled state and stable local IDs according to CONTEXT.md. Name the columns each write owns. Prefer an explicit column update over an upsert that overwrites unrelated ownership.\n\nKeep related writes in writeTransaction; use readTransaction when a consistent multi-read view is required. Keep network calls outside database transactions. Preserve foreign keys, deletion effects, FTS synchronization and invalidation of all observed tables. Bind user values; do not interpolate search text, URLs or IDs into SQL.\n\nFor pagination, keep filter\u002Fsort semantics consistent across initial, forward, backward and anchor refresh queries. Include a stable tie-breaker, verify the anchor still belongs to the active scope, and avoid silently restarting pages when cursor types disagree. Preserve the established empty-search behavior and FTS sanitization.\n\n## Persistence failure and state ownership\n\nDAO, transaction and repository operations return plain T\u002FUnit\u002FFlow\u003CT>. Database failures throw unchanged to the use case; do not catch, return Result, log-and-swallow, or return empty rows after a failed query. The use case invokes the I\u002FO dispatcher-catching helper for one-shot work, or applies flowCachingOnDefault to the plain upstream flow. Use finally\u002Fuse for owned resources; do not swallow a transaction exception and accidentally commit a partial write.\n\n[UserStateDatabaseTest](..\u002F..\u002F..\u002Fcore\u002Fdata\u002Fdb\u002Fsrc\u002FjvmTest\u002Fkotlin\u002Fdev\u002Fshounakmulay\u002Fdevpulse\u002Fcore\u002Fdata\u002Fdb\u002FUserStateDatabaseTest.kt) establishes the current narrow-write convention: content sync writes publisher-owned rows; bookmarks\u002Fread state and feed pin\u002Flast-opened state have separate ownership. A read-state update changes only isRead so concurrent bookmark writes survive. Read\u002Funread setters have no revision token; the last committed write determines the value. Missing state is observed as defined defaults. Test repeated setters, defaults, preserved unrelated fields, paging invalidation and reopen through actual Room operations.\n\n## Validate behavior\n\nUse [test-change](..\u002Ftest-change\u002FSKILL.md). Seed tied sort values, duplicate memberships and empty scopes when relevant. Assert literal row IDs\u002Forder, no duplicates, append\u002Fprepend\u002Frefresh, updates\u002Fdeletes and observer invalidation through real Room. SQL-string assertions are supplementary.\n\nAfter the baseline exists, migration tests start from a populated supported old schema, open the new database, verify retained values\u002FIDs, reopen it and check integrity\u002Fforeign keys plus relevant FTS results. For the authorized reset, test the new schema and reopen behavior instead of preserving retired version assumptions.\n\nPreview `bash scripts\u002Fverify.sh --test :core:data:db dev.shounakmulay.devpulse.core.data.db.FeedDiscoveryDatabaseTest --plan`. Execution may be refused because the graph contains copyRoomSchemas. For unchanged-schema verification, use a reviewed isolated checkout. For an intentional schema change, inspect the configured Room generation task, run it only within the authorized schema work, and review the exported SQL\u002Fversion diff before testing. Do not weaken the runner or refresh a baseline to hide a mismatch.\n\nShared Room\u002FKSP changes also need enabled Android\u002FiOS compilation where available. JVM database evidence does not prove Android upgrade\u002FUI behavior or iOS compilation. Report each platform and any generated-artifact blocker separately.\n",{"name":5,"description":7},"main","0793a3a80d3c675dc6a6cbba3bf45282f4908ba8",".agents\u002Fskills\u002Fchange-database","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse","https:\u002F\u002Fgithub.com\u002Fshounakmulay","2026-11-14 00:49:28",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add shounakmulay\u002Fdev-pulse --skill change-database",{"tool":56,"command":57},"bunx","bunx skills add shounakmulay\u002Fdev-pulse --skill change-database",{"tool":59,"command":60},"pnpm","pnpm dlx skills add shounakmulay\u002Fdev-pulse --skill change-database","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fchange-database\u002FSKILL.md",true,[],[65,81,101,120,135,150],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":39},"01M6RAQ4Q5AT2M8ZMJCJZAR5SE","verify-change","Use when verifying DevPulse changes, choosing scoped Gradle checks, reviewing database or feed changes, or reporting platform verification gaps.","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fverify-change\u002FSKILL.md",[],[24,72,73,38,74,75,76,77,78,79,31,80,25],"verify","verify change","gaps","scoped","changes","platform","gradle","verification","reporting",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":90,"publishedAt":39},"01M6RAPQ2X544N3R27SE4B05YC","test-change","Use when adding or reviewing behavioral tests for DevPulse features, state\u002Feffects, use cases, network boundaries, paging, persistence or coroutine lifetimes.","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftest-change\u002FSKILL.md",[87],{"categoryNo":88,"categoryName":89,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[91,24,92,93,28,94,31,95,96,97,98,99,100,38],"test","test change","persistence","network","behavioral","tests","lifetimes","for","features","effects",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":39},"01M6RAPKGMDSNA3SGHXHCXTC3F","plan-change","Use when planning a DevPulse feature, bug fix or refactor, clarifying ownership and edge cases, or deciding the implementation and acceptance checks.","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan-change\u002FSKILL.md",[],[108,24,109,31,110,111,112,113,38,114,115,116,117,118,119],"plan","plan change","bug","implementation","feature","ownership","bug fix","refactor","edge","acceptance","planning","fix",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":39},"01M6RAPCNYVAT630PS59NZ5DET","navigation-3","Use when changing DevPulse Navigation3 routes, tab stacks, adaptive list\u002Fdetail metadata or back behavior.","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fnavigation-3\u002FSKILL.md",[],[127,128,129,38,130,131,31,132,133,134],"navigation 3","navigation","back","adaptive","detail","behavior","list","metadata",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":39},"01M6RAP8GK2PND12M3PEE8GB1Q","ktlint-fix","Use when explicitly asked to run the legacy ktlint workflow; first check whether formatting tasks actually exist.","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fktlint-fix\u002FSKILL.md",[],[142,119,143,144,145,146,147,31,38,148,149],"ktlint fix","check","first","run","tasks","workflow","formatting","Legacy",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":39},"01M6RAP50MQZHW4ZBA344H5TTV","implement-change","Use when implementing or refactoring existing DevPulse behavior across screens, state, use cases, repositories or shared utilities after establishing acceptance checks.","https:\u002F\u002Fgithub.com\u002Fshounakmulay\u002Fdev-pulse\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplement-change\u002FSKILL.md",[],[24,157,158,159,38,160,161,162,163,164,31,132,165,117,28],"implement change","implement","implementing","shared utilities","Existing","Utilities","shared","across","refactoring"]