Skip to content

feat(skills): add v2 data refactoring skills (migrator, data-api, renderer)#13298

Merged
0xfullex merged 1 commit intov2from
DeJeune/redux-to-sqlite-skill
Mar 8, 2026
Merged

feat(skills): add v2 data refactoring skills (migrator, data-api, renderer)#13298
0xfullex merged 1 commit intov2from
DeJeune/redux-to-sqlite-skill

Conversation

@DeJeune
Copy link
Collaborator

@DeJeune DeJeune commented Mar 8, 2026

What this PR does

Before this PR:

No structured guidance existed for Claude agents working on the v2 data layer migration. Each migration task required re-explaining the architecture, patterns, and constraints from scratch.

After this PR:

Three new skills guide the full v2 data refactoring lifecycle:

  • v2-migrator (Phase 1): Moving legacy Redux/Dexie/ElectronStore data into SQLite — covers source classification, migrator contract, cross-domain references & FK design, orphan handling, and streaming patterns
  • v2-data-api (Phase 2): Building Main-process services — covers Handler→Service→Repository layered architecture, API schema design, preference schema, and database patterns
  • v2-renderer (Phase 3): Wiring up Renderer-process hooks — covers useQuery/useMutation (DataApi), usePreference (settings), and useCache/useSharedCache/usePersistCache (temporary data) with cache tier selection guidance and multi-window sync considerations

All three skills enforce strict TDD (red-green-refactor).

Why we need it and why it was done in this way

The v2 data refactoring involves migrating ~391 classified data items across Redux, Dexie, and ElectronStore into a unified SQLite + Preference + Cache architecture. Without structured skills, agents repeatedly make mistakes around:

  • Cross-domain references: Redux stores full object copies (e.g., Model, KnowledgeBase[]) instead of IDs, leading to stale phantom data when originals are deleted. Skills document the FK-IDs-only pattern and orphan reference handling.
  • Cross-category migration: Some preferences live in domain slices (memory.embedderModel, websearch.compressionConfig.embeddingModel) rather than settings. Skills guide correct reclassification.
  • Cache tier selection: Three cache tiers (memory/shared/persist) have different scope, sync, and persistence characteristics. Skills provide a decision flow.

The following tradeoffs were made:

Skills are split into 3 phases (migrator → data-api → renderer) matching the natural dependency order, rather than one monolithic skill.

The following alternatives were considered:

A single combined skill was considered but rejected — each phase has distinct concerns, file locations, and testing strategies.

Breaking changes

None. This PR only adds new skill files and updates .gitignore/public-skills.txt.

Special notes for your reviewer

  • All skills passed pnpm skills:check (8 public skills validated)
  • The skills reference existing documentation in docs/en/references/data/ and existing migration code in src/main/data/migration/v2/
  • The cross-domain reference tables in v2-migrator were built from actual Redux store analysis (src/renderer/src/store/)

Checklist

Release note

NONE

…derer)

Add three skills to guide the v2 data layer migration lifecycle:
- v2-migrator: Redux/Dexie/ElectronStore → SQLite migration with TDD
- v2-data-api: Main-process Handler→Service→Repository architecture
- v2-renderer: Renderer hooks (useQuery, usePreference, useCache)

Includes cross-domain reference guidance, FK design patterns,
cache tier selection, and cross-category migration examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DeJeune DeJeune requested review from a team, 0xfullex, EurFelux and GeorgeDong32 March 8, 2026 03:03
@DeJeune DeJeune added this to the v2.0.0 milestone Mar 8, 2026
@DeJeune DeJeune added the v2 label Mar 8, 2026
@0xfullex
Copy link
Collaborator

0xfullex commented Mar 8, 2026

Note

This issue/comment/review was translated by Claude.

Pay attention to regular maintenance


Original Content 注意定期维护

@0xfullex 0xfullex merged commit def2b79 into v2 Mar 8, 2026
8 checks passed
@0xfullex 0xfullex deleted the DeJeune/redux-to-sqlite-skill branch March 8, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants