技能 c-pro
📦

c-pro

安全 ⚙️ 外部命令

Expert C Programming Assistant

Writing safe, efficient C code requires deep expertise in memory management and system programming. This skill provides expert guidance on proper malloc/free patterns, pointer arithmetic, POSIX system calls, and embedded systems development.

支持: Claude Codex Code(CC)
📊 71 充足
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“c-pro”。 Write a function to parse a CSV file and return an array of strings

预期结果:

  • A C function that opens the file with fopen, allocates memory for each line using malloc, properly handles fgetsc errors, and includes a cleanup function to free all allocated memory. The function returns NULL on failure with errno set appropriately.

正在使用“c-pro”。 How do I implement a thread-safe counter in C?

预期结果:

  • A pthreads-based implementation showing a mutex-protected counter structure, with initialization, increment with lock/unlock, and destruction functions. Includes example usage demonstrating proper lock acquisition and release patterns.

安全审计

安全
v1 • 2/25/2026

Security review completed. Both static findings are false positives: (1) The backtick syntax on line 28 is markdown code formatting, not shell execution. (2) No cryptographic algorithms exist in the skill content. This is a legitimate C programming assistance skill with no confirmed security risks.

1
已扫描文件
59
分析行数
3
发现项
1
审计总数
低风险问题 (2)
External Commands Pattern (False Positive)
Static analyzer detected backtick syntax at line 28, but this is markdown code formatting (resources/implementation-playbook.md), not shell execution. No actual command execution occurs. The backticks are markdown inline code delimiters.
Weak Cryptographic Algorithm (False Positive)
Static analyzer flagged line 3 for weak crypto, but the content is simply a skill description about C programming. No cryptographic code or algorithms are present in this skill.

风险因素

⚙️ 外部命令 (1)
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
23
社区
100
安全
100
规范符合性

你能构建什么

Systems Programming Projects

Get expert guidance on writing system-level C code with proper memory management, system calls, and error handling for operating systems or driver development.

Embedded Development

Receive assistance with resource-constrained embedded systems programming, including memory pool allocation, stack optimization, and hardware interaction patterns.

Code Review and Optimization

Get detailed review of existing C code with valgrind-clean output, performance benchmarking suggestions, and clang-tidy improvements.

试试这些提示

Basic C Code Generation
Write a C function that [describe the task]. Include proper error handling and memory management.
Memory-Safe Data Structure
Implement a [data structure name] in C with proper memory allocation, deallocation, and boundary checking. Use C99 standard.
POSIX System Call Wrapper
Create a safe wrapper around [system call name] that handles all error conditions, sets errno correctly, and includes proper documentation.
Multi-threaded C Application
Write a multi-threaded C program using pthreads that [describe functionality]. Include mutex locks for shared resources and proper thread cleanup.

最佳实践

  • Always check return values from malloc and system calls - never assume allocation or system operations succeed
  • Use static analysis tools like clang-tidy and valgrind regularly to catch memory leaks and undefined behavior
  • Follow C99/C11 standards and use compiler warnings (-Wall -Wextra -Werror) to catch potential issues at compile time

避免

  • Not checking malloc return value - a NULL return causes undefined behavior when dereferenced
  • Using printf format specifiers incorrectly - mismatched types cause undefined behavior and security vulnerabilities
  • Forgetting to include include guards in headers - causes linker errors with multiple inclusions

常见问题

Does this skill compile code for me?
No, this skill provides guidance and generates code patterns. You will need to compile the code yourself using GCC, Clang, or another C compiler.
Which C standard does this skill use?
The skill focuses on C99 and C11 standards, as these provide modern features like designated initializers and improved type generics.
Can this help with embedded systems programming?
Yes, the skill includes guidance on embedded systems development, including memory pool allocation, stack usage minimization, and hardware interaction patterns.
Does this skill support C++?
No, this skill focuses specifically on C programming. For C++ assistance, a separate C++ skill would be more appropriate.
How does this skill handle memory leaks?
The skill emphasizes proper malloc/free pairing, provides cleanup functions, and recommends using valgrind to verify memory is properly freed.
Can this help with debugging?
Yes, the skill provides guidance on using GDB and Valgrind for debugging memory issues, undefined behavior, and performance problems.

开发者详情

文件结构

📄 SKILL.md