דילוג לתוכן
New

DeepSeek V4.1 Flash free for 7 days: 10M tokens a day after a top-up of $10 or more. Until Nov 30.

How it works
aeondave/c-patternsLinux, ענן וקונטיינרים

c-patterns

⁨C language patterns and best practices for safe, maintainable C: ownership, API contracts, error handling, integer safety, portability, and concurrency boundaries. Use when writing or reviewing C code (C11+), designing module interfaces, refactoring legacy C, or hardening low-level code paths.⁩

v2026.11.13-21cd5683 התקנות⁦+3⁩ ב-7 ימים39 כוכביםMITסונכרן לפני 10 שעות

התקנה

עדיין אין לכם את ה-CLI של NotHoly? התקינו אותו קודם.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install aeondave/c-patterns

נכתב אל ⁦~/.notholy/skills⁩ אחרי בדיקת החתימה וה-SHA-256.

חתימהחתום, ed25519
0v9X9TvSaz…RT62DXBA==ה-CLI בודק את ה-SHA-256 ואת החתימה לפני שהוא כותב קובץ כלשהו.
חבילהb0109b83…268f6460
b0109b832435…6e0b268f64606 קבצים · ⁦7.3 KB⁩
סריקהנמוךממצא אחד
  • קישורים לדומיינים חיצוניים
לסריקה המלאה
מקורgithub.com/AeonDave/malskill/tree/main/coding/c-patterns@21cd568

הפריט הזה עדיין לא נכתב בעברית, ולכן הוא מוצג בשפה אחרת: English.

This skill focuses on safe C: explicit ownership, explicit errors, predictable control flow, and contracts that survive refactors.

If you’re writing tests, use c-testing.

When to activate

  • Writing/refactoring C modules and APIs
  • Reviewing for memory safety and integer safety
  • Designing error-handling conventions and cleanup paths
  • Hardening code for sanitizer/static analysis adoption
  • Porting C code across GCC/Clang/MSVC/MinGW

Core rules (high signal)

  • Make ownership explicit: allocate/free at the same abstraction level.
  • Use a consistent error strategy (return codes, out-params) and document it in headers.
  • Avoid in-band error indicators when possible.
  • Use a single-exit cleanup path for functions managing multiple resources.
  • Treat integer conversions and size calculations as potential bugs.

Phase 1 — Define API contract first

Before coding:

  • Define ownership of every pointer parameter (borrowed, owned, transferred).
  • Define preconditions/postconditions in the header, not only in comments inside .c.
  • Define error domain (enum or code space) and whether errno is used.

Phase 2 — Implement with explicit lifetimes

  • Use create/destroy, init/deinit, or open/close pairs consistently.
  • Keep one cleanup exit path for multi-resource functions.
  • Do not mix allocator families (malloc/free vs custom pool vs Win32 heaps).

Phase 3 — Harden integer and bounds logic

  • Use size_t for sizes/counts and guard all multiplication/addition used in allocation.
  • Validate all signed/unsigned conversions and indexing arithmetic.
  • Reject impossible sizes early (n == 0, n > MAX_ALLOWED, overflow guards).

Phase 4 — Concurrency boundaries

  • Prefer immutable data or message passing where possible.
  • If locks are needed, document lock ownership and lock order in header comments.
  • Use atomics for single-value state; mutexes for compound invariants.

Phase 5 — Toolchain-aware portability

  • Keep warning set strict on all compilers (GCC/Clang/MSVC).
  • Avoid UB-dependent behavior and compiler-specific assumptions.
  • Guard compiler-specific attributes/macros with feature checks.

Quick review checklist

  • Every pointer has clear ownership semantics in the API.
  • Every non-trivial function has deterministic cleanup path.
  • Every allocation arithmetic path has overflow guard.
  • Every error path returns actionable status.
  • Concurrency primitives protect explicitly documented data.
  • Code builds clean with strict warnings on at least two toolchains.

Resources

Load on demand:

  • references/error-handling.md — error policy, return codes, cleanup patterns
  • references/memory-ownership.md — allocation/free rules, zero-length alloc, free-null
  • references/integers.md — overflow, size_t usage, bounds checking
  • references/concurrency.md — pthreads, C11 atomics, Win32 threads, race detection
  • references/tooling.md — warnings, sanitizers, static analysis, binary inspection (MinGW/objdump, MSVC/dumpbin, Linux tools)

הקבצים בגרסה הזו

הרשאות

הרשאההוצהרנמצא בסריקה
קורא קבציםלאלא
כותב קבציםלאלא
מריץ פקודות shellכןכן
משתמש ברשתכןכן
משתמש במחבריםלאלא
שולט בדפדפןלאלא

ממצאי הסריקה

נבדק ב-13 בנוב׳ 2026

  1. מידעקישור · קישורים לדומיינים חיצוניים

סריקה נקייה מורידה את הסיכון, אבל לא מוכיחה שהחבילה בטוחה. כדאי לקרוא מה מתקינים.

גרסהפורסמהCommitSHA-256חתימהשינוי בהרשאות
v2026.11.13-21cd56813 בנוב׳ 202621cd568b0109b83חתומה–

שאלו כל מה שהסקופ מאפשר.

יוצרים חשבון, מוסיפים קרדיטים ושואלים את השאלה הראשונה בצ׳אט או בטרמינל.

  1. 1/3

    יצירת חשבון

    פרטי או חברה. אפשר לעבור לחשבון חברה אחר כך בלי לאבד יתרה או מפתחות.

    פרטיחברה
  2. 2/3

    הוספת קרדיטים

    בכרטיס אשראי. תשלום לפי טוקן, בלי מנוי.

    $5.00טעינה מינימלית
  3. 3/3

    שאלה ראשונה

    בצ׳אט, או להתקין את ה-CLI ולהריץ notholy login בטרמינל.

    $ notholy login