mirror of
https://github.com/jnMetaCode/superpowers-zh.git
synced 2026-09-03 07:23:56 +08:00
基于 obra/superpowers (MIT) 完整汉化,新增中国开发者专属 skills: - 中文代码审查:适配国内团队沟通文化 - 中文 Git 工作流:支持 Gitee/Coding/极狐 GitLab - 中文技术文档:中英混排规范、排版标准 - 中文提交规范:Conventional Commits 中文适配 + commitlint 配置 - MCP 服务器构建:生产级 MCP 工具开发方法论 支持工具:CC / Cursor / Codex CLI / Gemini 安装:npx superpowers-zh
2.4 KiB
2.4 KiB
Svelte Todo List - Design
Overview
A simple todo list application built with Svelte. Supports creating, completing, and deleting todos with localStorage persistence.
Features
- Add new todos
- Mark todos as complete/incomplete
- Delete todos
- Filter by: All / Active / Completed
- Clear all completed todos
- Persist to localStorage
- Show count of remaining items
User Interface
┌─────────────────────────────────────────┐
│ Svelte Todos │
├─────────────────────────────────────────┤
│ [________________________] [Add] │
├─────────────────────────────────────────┤
│ [ ] Buy groceries [x] │
│ [✓] Walk the dog [x] │
│ [ ] Write code [x] │
├─────────────────────────────────────────┤
│ 2 items left │
│ [All] [Active] [Completed] [Clear ✓] │
└─────────────────────────────────────────┘
Components
src/
App.svelte # Main app, state management
lib/
TodoInput.svelte # Text input + Add button
TodoList.svelte # List container
TodoItem.svelte # Single todo with checkbox, text, delete
FilterBar.svelte # Filter buttons + clear completed
store.ts # Svelte store for todos
storage.ts # localStorage persistence
Data Model
interface Todo {
id: string; // UUID
text: string; // Todo text
completed: boolean;
}
type Filter = 'all' | 'active' | 'completed';
Acceptance Criteria
- Can add a todo by typing and pressing Enter or clicking Add
- Can toggle todo completion by clicking checkbox
- Can delete a todo by clicking X button
- Filter buttons show correct subset of todos
- "X items left" shows count of incomplete todos
- "Clear completed" removes all completed todos
- Todos persist across page refresh (localStorage)
- Empty state shows helpful message
- All tests pass