prototype

Xây dựng một bản mẫu dùng một lần để phát triển thiết kế trước khi cam kết thực hiện. Định tuyến giữa hai nhánh — một ứng dụng terminal có thể chạy được để kiểm tra trạng thái/logic nghiệp vụ, hoặc nhiều biến thể giao diện khác nhau có thể chuyển đổi từ một tuyến đường. Sử dụng khi người dùng muốn tạo bản mẫu, kiểm tra tính hợp lý của mô hình dữ liệu hoặc máy trạng thái, phác thảo giao diện, khám phá các lựa chọn thiết kế, hoặc nói "tạo bản mẫu này", "cho tôi thử nghiệm", "thử một vài thiết kế".

npx skills add https://github.com/mattpocock/skills --skill prototype

Prototype

A prototype is throwaway code that answers a question. The question decides the shape.

Pick a branch

Identify which question is being answered — from the user's prompt, the surrounding code, or by asking if the user is around:

  • "Does this logic / state model feel right?"LOGIC.md. Build a tiny interactive terminal app that pushes the state machine through cases that are hard to reason about on paper.
  • "What should this look like?"UI.md. Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.

The two branches produce very different artifacts — getting this wrong wastes the whole prototype. If the question is genuinely ambiguous and the user isn't reachable, default to whichever branch better matches the surrounding code (a backend module → logic; a page or component → UI) and state the assumption at the top of the prototype.

Rules that apply to both

  1. Throwaway from day one, and clearly marked as such. Locate the prototype code close to where it will actually be used (next to the module or page it's prototyping for) so context is obvious — but name it so a casual reader can see it's a prototype, not production. For throwaway UI routes, obey whatever routing convention the project already uses; don't invent a new top-level structure.
  2. One command to run. Whatever the project's existing task runner supports — pnpm <name>, python <path>, bun <path>, etc. The user must be able to start it without thinking.
  3. No persistence by default. State lives in memory. Persistence is the thing the prototype is checking, not something it should depend on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear "PROTOTYPE — wipe me" name.
  4. Skip the polish. No tests, no error handling beyond what makes the prototype runnable, no abstractions. The point is to learn something fast.
  5. Surface the state. After every action (logic) or on every variant switch (UI), print or render the full relevant state so the user can see what changed.
  6. Capture it when done. Fold any validated decision into the real code, then capture the prototype itself as a primary source: commit it to a throwaway branch, out of main, and leave a context pointer to that branch on the implementation issue. Capture the answer too — the verdict and the question it settled — in the issue or a commit. The main branch keeps only the validated decision.

Thêm skills từ mattpocock

improve-codebase-architecture
mattpocock
Tìm cơ hội đào sâu trong một mã nguồn, dựa trên ngôn ngữ miền trong CONTEXT.md và các quyết định trong docs/adr/. Sử dụng khi người dùng muốn cải thiện kiến trúc, tìm cơ hội tái cấu trúc, hợp nhất các mô-đun kết nối chặt chẽ, hoặc làm cho mã nguồn dễ kiểm thử và dễ điều hướng bởi AI hơn.
developmentcode-reviewapi
tdd
mattpocock
Phát triển hướng theo kiểm thử với vòng lặp đỏ-xanh-tái cấu trúc. Sử dụng khi người dùng muốn xây dựng tính năng hoặc sửa lỗi bằng TDD, đề cập đến "đỏ-xanh-tái cấu trúc", muốn kiểm thử tích hợp, hoặc yêu cầu phát triển kiểm thử trước.
developmenttesting
handoff
mattpocock
Nén cuộc hội thoại hiện tại thành một tài liệu bàn giao để một tác nhân khác tiếp nhận.
communicationproject-managementdocument
triage
mattpocock
Phân loại vấn đề thông qua máy trạng thái được điều khiển bởi các vai trò phân loại. Sử dụng khi người dùng muốn tạo vấn đề, phân loại vấn đề, xem xét lỗi mới hoặc yêu cầu tính năng, chuẩn bị vấn đề cho tác nhân AFK, hoặc quản lý quy trình làm việc vấn đề.
developmentproject-managementcommunication
obsidian-vault
mattpocock
Tìm kiếm, tạo và quản lý ghi chú trong kho Obsidian với wikilinks và ghi chú chỉ mục. Sử dụng khi người dùng muốn tìm, tạo hoặc sắp xếp ghi chú trong Obsidian.
productivitydocument
edit-article
mattpocock
Chỉnh sửa và cải thiện bài viết bằng cách tái cấu trúc các phần, nâng cao độ rõ ràng và thắt chặt văn phong. Sử dụng khi người dùng muốn chỉnh sửa, sửa đổi hoặc cải thiện bản nháp bài viết.
documentcreative
writing-great-skills
mattpocock
Tài liệu tham khảo để viết và chỉnh sửa skill tốt — từ vựng và nguyên tắc giúp skill có tính dự đoán được.
documentdevelopment
implement
mattpocock
Triển khai một phần công việc dựa trên PRD ho
developmentcode-reviewproject-management