一键导入
templates-history-implementation
Implement templates, snapshots, and history for the local-first numpad calculation workspace.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement templates, snapshots, and history for the local-first numpad calculation workspace.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Implement or improve tray, quick popup, global shortcut, single-instance, and restore behavior for the Windows-first Tauri 2 app.
Use this skill for React + TypeScript implementation, refactoring, and review tasks involving components, hooks, props typing, children typing, refs, effects, context, reducers, events, forms, utility functions, async UI state, generic components, type modeling, module/export conventions, and React architecture decisions. Trigger this skill when creating or refactoring React TypeScript code and when choosing the right abstraction boundary for maintainable React applications.
Use this skill for any UI work in numpad — shadcn components, theming, shell layout, feature UI, settings dialogs, inspector panels, or Windows 11-like desktop productivity styling.
Implement or extend optional, review-first AI infrastructure for numpad without compromising deterministic engine authority.
Align docs/ with the real implementation — remove stale claims, add missing details, correct wrong file names, and update contracts.
Refactor and extend the deterministic calculation engine while preserving correctness and explicit domain boundaries.
| name | templates-history-implementation |
| description | Implement templates, snapshots, and history for the local-first numpad calculation workspace. |
Use this skill when implementing: built-in templates, user-saved templates, document snapshots, history/versioning, or restore flows.
src-tauri/src/services/document_repository.rs (SQLite documents table).src/entities/document/document.types.ts — DocumentModel { id, title, content, createdAt, updatedAt, archivedAt }.workspace.store.ts) has: createDocument, selectDocument, deleteDocument, archiveDocument, saveNow.templates table (SQLite):
id TEXT PRIMARY KEY
title TEXT NOT NULL
content TEXT NOT NULL
is_builtin INTEGER DEFAULT 0 (1 = shipped with app, 0 = user-created)
category TEXT (for filtering: "Finance", "Time", "General", etc.)
created_at INTEGER
updated_at INTEGER
src-tauri/src/services/template_repository.rs ← SQL CRUD for templates
src-tauri/src/commands/templates.rs ← list_templates, get_template, save_template, delete_template
src/features/templates/ ← new feature directory
template.types.ts ← TemplateModel DTO
template.native.ts ← typed invoke wrappers
TemplateBrowser.tsx ← template selection UI
template-builtins.ts ← built-in template definitions
document_history table (SQLite):
id TEXT PRIMARY KEY
document_id TEXT NOT NULL (FK → documents.id)
content TEXT NOT NULL (snapshot of rawText)
snapshot_label TEXT (auto: "Autosave", or user-named)
created_at INTEGER
src-tauri/src/services/history_repository.rs ← SQL CRUD for document_history
src-tauri/src/commands/history.rs ← list_history, get_snapshot, restore_snapshot, delete_snapshot
src/features/history/ ← new feature directory
history.types.ts ← DocumentSnapshot DTO
history.native.ts ← typed invoke wrappers
HistoryPanel.tsx ← history list + restore UI
saveDocument in document_service.rs, optionally write a snapshot to document_history.createDocument() in workspace store.restore_snapshot command → updates documents content → selectDocument() reloads.WorkspaceInspectorPane.tsx.src-tauri/src/services/document_repository.rs — understand current SQL patterns.src/entities/document/document.types.ts — understand DocumentModel.src/app/store/workspace.store.ts — understand current document lifecycle.ai/codex/plans/templates-history.md before implementing.src-tauri/src/lib.rs.cargo check && cargo build after Rust changes.npm run typecheck && npm run build after TypeScript changes.docs/DATABASE_SCHEMA.md, docs/ARCHITECTURE.md, docs/IMPLEMENTATION_ROADMAP.md.content snapshots.docs/DATABASE_SCHEMA.md — for new tablesdocs/ARCHITECTURE.md — for new features and file structuredocs/API_CONTRACTS.md — for new Tauri commandsdocs/IMPLEMENTATION_ROADMAP.md — when milestone is completedocs/STATUS_GAP_ANALYSIS.md — when gaps are resolved