ワンクリックで
algorithmic-discipline
Bắt buộc khai báo độ phức tạp Big-O và cấu trúc dữ liệu trước khi viết thuật toán.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Bắt buộc khai báo độ phức tạp Big-O và cấu trúc dữ liệu trước khi viết thuật toán.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
Prevent commits that skip pre-commit hooks (--no-verify, -n). Auto-loads when git commit with bypass flags is attempted. Triggers: commit --no-verify, git commit -n, git push --no-verify.
Explore ideas before implementation, design features, make architecture decisions, and validate approaches. Use when: brainstorm, explore options, design, what approach, how should we, ideas, before building.
Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.
Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines.
Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.
| name | algorithmic-discipline |
| description | Bắt buộc khai báo độ phức tạp Big-O và cấu trúc dữ liệu trước khi viết thuật toán. |
MỤC TIÊU: Ngăn chặn rò rỉ hiệu năng bằng cách ép buộc tư duy thuật toán TRƯỚC KHI sinh ra code.
Mọi tác vụ yêu cầu duyệt mảng, tìm kiếm, sắp xếp, hoặc thao tác trên tập dữ liệu lớn đều phải tuân thủ nghiêm ngặt kỹ năng này.
TRƯỚC KHI bạn viết bất kỳ hàm nào chứa vòng lặp (for, while, map, reduce, filter) hoặc đệ quy, bạn BẮT BUỘC phải chèn một khối bình luận /* ALGO-CHECK ... */ (hoặc docstring tương tự tùy ngôn ngữ) ngay trên đầu hàm đó.
Khối bình luận này phải trả lời 3 câu hỏi sau:
Set thay vì Array.includes?)/* ALGO-CHECK
* Time Complexity: O(N) vì chỉ duyệt mảng một lần. Space Complexity: O(N) để lưu HashSet.
* Data Structure Choice: Sử dụng Set (seen) để tra cứu O(1) thay vì Array.includes O(N).
* Termination Proof: Biến i tăng đều đặn 1 đơn vị mỗi vòng lặp cho đến khi i === arr.length.
*/
function findDuplicates(arr) {
const seen = new Set();
const duplicates = [];
for (let i = 0; i < arr.length; i++) {
if (seen.has(arr[i])) duplicates.push(arr[i]);
seen.add(arr[i]);
}
return duplicates;
}
Nếu bạn viết vòng lặp mà KHÔNG có thẻ ALGO-CHECK, hệ thống quality-gate.js hook sẽ tự động ném ra lỗi và chặn commit của bạn.