AgentSkillsCN

windows15-app-development

在Windows 15桌面环境中构建和修改应用。当创建新应用、修改apps/中的现有应用、处理窗口管理、持久性、热键、通知或UI组件时使用此技能。

SKILL.md
--- frontmatter
name: windows15-app-development
description: Build and modify apps in the Windows 15 desktop environment. Use when creating new apps, modifying existing apps in apps/, working with window management, persistence, hotkeys, notifications, or UI components.

Windows 15 App Development

Use this skill when building or modifying apps under apps/ in the Windows 15 desktop environment.

Quick Navigation

TaskDocumentation
Create a new appguides/creating-simple-app.md
Register an app / app configcore/app-architecture.md
Open/focus/minimize windowscore/window-lifecycle.md
Persist app stateguides/adding-persistence.md
Keyboard shortcutsguides/hotkeys.md
Toast notificationsguides/notifications.md
UI components & stylingguides/styling-patterns.md, reference/ui-components.md
Full API lookupreference/contexts.md, reference/hooks.md
Learn by exampleexamples/calculator-walkthrough.md, examples/notepad-walkthrough.md

Codebase Landmarks

  • App registration: apps/registry.ts (authoritative app registry)
  • Window lifecycle: context/WindowContext.tsx and components/Window.tsx
  • OS wrapper hook: context/OSContext.tsx (useOS())
  • Common hooks: hooks/index.ts
  • UI primitives: components/ui/

Essential Patterns

Creating a New App

  1. Create component in apps/MyApp.tsx:
tsx
import { AppContainer } from '../components/ui/AppContainer';

export function MyApp() {
    return (
        <AppContainer padding>
            <h1>My App</h1>
        </AppContainer>
    );
}
  1. Register in apps/registry.ts:
ts
{
  id: 'myapp',
  title: 'My App',
  icon: 'apps',
  color: 'bg-slate-400',
  component: React.lazy(() => import('./MyApp').then(m => ({ default: m.MyApp }))),
  defaultWidth: 520,
  defaultHeight: 420,
}

Persisting State

Use usePersistedState() (Dexie/IndexedDB-backed):

tsx
const { value, setValue, isLoading } = usePersistedState<Settings>('myapp.settings', defaultSettings);

Window Instance Control

Apps receive windowId as a prop to control their window:

tsx
const MyApp: React.FC<{ windowId: string }> = ({ windowId }) => {
    const { setTitle, setBadge } = useWindowInstance(windowId);
    // ...
};

Toast Notifications

tsx
const notify = useNotification();
notify.success('Saved!');
notify.error('Failed');

Keyboard Shortcuts

tsx
useStandardHotkeys({
    onSave: () => handleSave(),
    onFind: () => handleFind(),
});

Constraints

  • Prefer existing UI primitives in components/ui/
  • Prefer usePersistedState() over useLocalStorage() for persistence
  • Don't invent new global patterns when existing hooks/contexts solve it
  • Keep id in registry stable (used for session restore)

Documentation Index

Core Architecture

Guides

Reference

Examples

API Documentation