api-review

โดย flutter

ตรวจสอบโค้ดที่ระบุเทียบกับแนวทาง API Design มาตรฐาน ใช้สกิลนี้เมื่อผู้ใช้ขอให้รีวิว API หรือตรวจสอบโค้ดตามแนวทาง API design…

npx skills add https://github.com/flutter/agent-plugins --skill api-review

API review skill

This skill reviews code against the canonical API Design guidelines.

Instructions

  1. Load Guidelines: Read the API design guidelines from references/canonical_api_design.md to ensure they are fully available in the context.
  2. Identify Target: Identify the code to review.
    • If the user specified files (e.g., "review main.dart"), use those.
    • If the user has an open file in their context, assume that is the target.
    • If neither, ask the user to specify the target files.
  3. Analyze: For each target file, perform a deep analysis against the "Foundations of Canonical API Design Principles" (loaded in step 1), specifically looking for:
    • Contract-First: Is the interface clear and decoupled from implementation?
    • KISS/YAGNI: Are there unnecessary parameters or over-generalized features?
    • Ergonomics: Are names intent-revealing? Do they follow the Principle of Least Astonishment?
    • CQS: Are commands and queries separated?
    • Safety: Are types used strictly (Enums vs Strings)? Is validation visible?
    • Explicit Configuration: Are dependencies explicitly injected rather than implicitly resolved via global state, registries, or environment variables?
  4. Report: Generate a structured report:
    • Score: Give a letter grade (A-F) based on alignment.
    • Critical Issues: Violations that must be fixed (e.g., severe strictness or safety issues).
    • Suggestions: Ergonomic improvements (renaming, rearranging).
    • Code Examples: Provide before vs after code blocks for the suggested improvements.
    • Save the report as a markdown artifact in the conversation artifacts directory (e.g., <appDataDir>/brain/<conversation-id>/api_review_results.md).

Skills เพิ่มเติมจาก flutter

adding-release-notes
flutter
เพิ่มคำอธิบายการเปลี่ยนแปลงที่ผู้ใช้เห็นลงในบันทึกประจำรุ่นของ DevTools ใช้เมื่อบันทึกการปรับปรุง การแก้ไข หรือฟีเจอร์ใหม่ในไฟล์ NEXT_RELEASE_NOTES.md
official
dart-modern-features
flutter
เพื่อหาผู้สมัครสำหรับการปรับปรุงให้ทันสมัย:
official
code-documentation
flutter
คู่มือสำหรับการเขียนเอกสารประกอบโค้ดอย่างมีประสิทธิภาพ รวมถึง docstrings, JSDoc, dartdoc และคอมเมนต์การใช้งาน ใช้ทักษะนี้เมื่อเขียนโค้ดใหม่ เพิ่มเติม…
official
dart-add-unit-test
flutter
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains…
official
dart-build-cli-app
flutter
โครงสร้างจุดเริ่มต้น, รหัสออกจากโปรแกรม, สคริปต์ข้ามแพลตฟอร์ม ใช้เมื่อสร้างยูทิลิตี้คำสั่ง, สคริปต์, หรือแอปพลิเคชัน
official
dart-collect-coverage
flutter
เก็บข้อมูลความครอบคลุมโดยใช้แพ็กเกจ coverage และสร้างรายงาน LCOV
official
dart-fix-runtime-errors
flutter
ใช้ get_runtime_errors และ lsp เพื่อดึง stack trace ที่ใช้งานอยู่ ค้นหาบรรทัดที่เกิดข้อผิดพลาด ใช้การแก้ไข และตรวจสอบผลลัพธ์ผ่าน hot_reload
official
dart-generate-test-mocks
flutter
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex…
official