원클릭으로
ai-foundation
Implement or extend optional, review-first AI infrastructure for numpad without compromising deterministic engine authority.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Implement or extend optional, review-first AI infrastructure for numpad without compromising deterministic engine authority.
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.
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.
Audit the numpad repository — implementation state, docs drift, architecture health, and next priorities.
| name | ai-foundation |
| description | Implement or extend optional, review-first AI infrastructure for numpad without compromising deterministic engine authority. |
Use this skill for work in src/features/ai/, src-tauri/src/services/ai_*.rs, src-tauri/src/commands/ai.rs, or any AI settings/provider/streaming work.
.codex/skills/ai-foundation/ai-file-map.md — every AI file with its role and key typesaiEnabled in settings.store.ts gates all AI features.validateAiNumpadDraft() must run before any AI text is inserted.User triggers AI request (AiAssistantPanel)
→ build AiRequestContext (ai.context.ts)
→ build AiProviderMessage[] (ai.prompts.ts)
→ call streamAiAssistant() (ai.native.ts)
→ Tauri: stream_ai_assistant command (commands/ai.rs)
→ ai_service.rs: enabled check → model check → key resolution → provider
→ openrouter_provider.rs: SSE stream to OpenRouter
→ emits AiStreamEvent { type: "token" | "done" | "error" }
→ Tauri events received in AiAssistantPanel
→ accumulate streaming text
→ parseAiAssistantOutput() (ai.response.ts) → { responseText, draft }
→ validateAiNumpadDraft() (ai.validation.ts) → { status, issues }
→ user reviews → clicks "Insert" → applyAiDraftToNote() (ai.validation.ts)
→ onRawTextChange() callback → workspace store → engine projection
| File | Role |
|---|---|
src/features/ai/ai.types.ts | All types: AiAssistantAction, AiContextScope, AiThinkingMode, AiSettingsSnapshot, AiStreamEvent, AiModelSummary, AiDraftValidationResult, etc. |
src/features/ai/ai.constants.ts | AI_ACTIONS, AI_CONTEXT_SCOPES, AI_THINKING_OPTIONS arrays |
src/features/ai/ai.native.ts | Typed invoke wrappers: getAiSettings(), saveAiSettings(), listAiModels(), streamAiAssistant(), etc. |
src/features/ai/ai.context.ts | buildAiRequestContext() — packages editor state into context payload |
src/features/ai/ai.prompts.ts | buildAiMessages() — constructs system + user messages for OpenRouter |
src/features/ai/ai.response.ts | parseAiAssistantOutput() — splits AI response into responseText + draft |
src/features/ai/ai.validation.ts | validateAiNumpadDraft(), applyAiDraftToNote() |
src/features/ai/AiAssistantSheet.tsx | Chat panel UI — review-first, streaming display, Insert button |
src/features/settings/SettingsDialog.tsx | Global settings dialog — AI section owns API key, model, temperature, etc. |
| File | Role |
|---|---|
src-tauri/src/commands/ai.rs | Thin command handlers for all AI IPC |
src-tauri/src/services/ai_service.rs | Orchestration: enable check → key → provider → stream |
src-tauri/src/services/ai_settings_service.rs | Load/save AI settings from SQLite |
src-tauri/src/services/ai_secret_service.rs | OS keychain for OpenRouter API key |
src-tauri/src/services/ai_key_resolution.rs | Key precedence: user → env var → error |
src-tauri/src/services/ai_provider.rs | AiProvider trait |
src-tauri/src/services/openrouter_provider.rs | OpenRouter HTTP + SSE client |
ai-file-map.md for the complete type and file inventory.docs/AI_SPEC.md for the current declared AI contracts.AI_ACTIONS in ai.constants.ts, add type to AiAssistantAction in ai.types.ts, handle in ai.prompts.ts and ai.context.ts.SaveAiSettingsInput + AiSettingsSnapshot in ai.types.ts, update Rust structs, update settings dialog.npm run typecheck && npm run build.docs/AI_SPEC.md and docs/API_CONTRACTS.md.validateAiNumpadDraft() before inserting.aiEnabled settings flag.docs/AI_SPEC.md — for any AI command, type, or behavior changesdocs/API_CONTRACTS.md — for new or changed Tauri AI commandsdocs/ARCHITECTURE.md — for structural changes to the AI layer