Files
jiangnan 80bc100625 superpowers 中文社区版:14 个翻译 + 5 个中国特色原创 skills
基于 obra/superpowers (MIT) 完整汉化,新增中国开发者专属 skills:
- 中文代码审查:适配国内团队沟通文化
- 中文 Git 工作流:支持 Gitee/Coding/极狐 GitLab
- 中文技术文档:中英混排规范、排版标准
- 中文提交规范:Conventional Commits 中文适配 + commitlint 配置
- MCP 服务器构建:生产级 MCP 工具开发方法论

支持工具:CC / Cursor / Codex CLI / Gemini
安装:npx superpowers-zh
2026-03-20 11:32:25 +08:00

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

  1. Can add a todo by typing and pressing Enter or clicking Add
  2. Can toggle todo completion by clicking checkbox
  3. Can delete a todo by clicking X button
  4. Filter buttons show correct subset of todos
  5. "X items left" shows count of incomplete todos
  6. "Clear completed" removes all completed todos
  7. Todos persist across page refresh (localStorage)
  8. Empty state shows helpful message
  9. All tests pass