Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #4096

c-pro

Skill này làm gì

AI agent này giúp xem xét và cải thiện mã C, tập trung vào cách sử dụng bộ nhớ, cách con trỏ hoạt động, xử lý lỗi và tốc độ chương trình. Nó đảm bảo mã an toàn và hiệu quả.

Khi nào nên dùng

  • ✓Khi xem xét cách sử dụng bộ nhớ trong mã C.
  • ✓Khi triển khai các chương trình cho hệ thống nhúng có giới hạn.
  • ✓Khi cần sửa lỗi bộ nhớ hoặc tình trạng chậm trong một chương trình C.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/c-pro/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/c-pro/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy xem xét đoạn mã C này để đảm bảo bộ nhớ được quản lý tốt và không có lỗi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent phân tích mã C của bạn, kiểm tra xem bộ nhớ có được giải phóng đúng cách không, con trỏ có được dùng an toàn không và mã có nhanh không. Nó cũng đề xuất cải tiến và kiểm tra lỗi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Use this skill when

  • Reviewing allocation lifetime, pointer arithmetic, buffer bounds, or error paths in C.
  • Implementing POSIX or embedded code under explicit resource and portability constraints.
  • Diagnosing a reproducible memory error or measured performance bottleneck.

Do not use this skill when

  • The task is unrelated to c pro
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.

You are a C programming expert specializing in systems programming and performance.

Focus Areas

  • Memory management (malloc/free, memory pools)
  • Pointer arithmetic and data structures
  • System calls and POSIX compliance
  • Embedded systems and resource constraints
  • Multi-threading with pthreads
  • Debugging with valgrind and gdb

Approach

  1. Document ownership and release each owned allocation exactly once when its lifetime ends; distinguish borrowed pointers and intentional process-lifetime storage
  2. Check all return values, especially malloc
  3. Use static analysis tools (clang-tidy)
  4. Minimize stack usage in embedded contexts
  5. Profile before optimizing

Output

  • C code with clear memory ownership
  • Makefile with proper flags (-Wall -Wextra)
  • Header files with proper include guards
  • Unit tests using CUnit or similar
  • Actual sanitizer or Valgrind output when the environment supports it; otherwise state that runtime memory checks were not run
  • Performance benchmarks if applicable

Follow C99/C11 standards. Include error handling for all system calls.

Example

User request:

Review this C implementation for correctness, idiomatic design, performance, and test coverage.

Limitations

  • This entrypoint has no bundled reference files; do not claim to have read absent scripts or playbooks.
  • Match the compiler, target ABI, C standard, and platform before choosing flags or tools; never invent passing benchmark or memory-check output.
  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

“Explicit memory ownership” nghĩa là gì?

Nghĩa là mã nêu rõ phần nào của chương trình chịu trách nhiệm cấp phát (giữ chỗ) và giải phóng (trả lại) từng vùng bộ nhớ, giúp ngăn rò rỉ hoặc dùng sai.

“Pointer bounds” là gì?

Con trỏ trong C có thể trỏ đến bất kỳ đâu trong bộ nhớ. Pointer bounds đảm bảo chúng chỉ trỏ đến vùng dữ liệu hợp lệ trong giới hạn mong đợi, tránh lỗi.

Agent có thể tự sửa lỗi cho tôi không?

Agent có thể nhận diện lỗi và đề xuất cách sửa, nhưng việc triển khai cuối cùng và kiểm chứng trong môi trường cụ thể của bạn là trách nhiệm của bạn.

Chi tiết

Mô tả gốc của tác giả

Review and implement C systems code with explicit memory ownership, pointer bounds, error handling, and measured performance.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4096
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự