Skip to content

n-popescu/Inkypaint / .claude/skills/snx-code-quality

snx-code-quality

Verified

RFC #142's C rules: strict ISO C99, no redundant state, indices not pointer chains, one allocation per owner, atomics apart, no stored pointers, one global struct per file. Use when writing or reviewing C in src/.

FileKindSize
SKILL.mdskill md3.4 KB
check.pyexecutablescript13.4 KB
examples.mdmarkdown10.9 KB
test/fixtures/clean.cother1.7 KB
test/fixtures/expected.txtmarkdown668 B
test/fixtures/flagged.cother1.0 KB
test/test-check.shexecutablescript1.1 KB

test/fixtures/flagged.c

View on GitHub
/* every rule the checker sees, once each, in strict ISO C99; Locks is C11 code it still meets in src/ */
#include <stdlib.h>
typedef unsigned int u32;
typedef unsigned char u8;
typedef struct {
    void* p;
    int is_present;
} Opt;
typedef struct {
    char* name;
    int has_name;
    u32 size;
} Named;
typedef struct {
    _Atomic u32 lock_1;
    _Atomic u32 lock_2;
} Locks;
typedef struct {
    u32 submitted; /* the CPU thread's */
    u32 completed; /* the GPU thread's */
} Queue;
typedef struct {
    u8* in;
    u8* out;
} Buffers;
static u32 g_first;
static u32 g_second;
static Buffers* buffers_new(void) {
    Buffers* b = (Buffers*)calloc(1, sizeof *b);
    if (!b) return NULL;
    b->in = (u8*)calloc(1, 4096);
    b->out = (u8*)malloc(4096);
    return b;
}
static void count(Queue* q) {
    __atomic_fetch_add(&q->submitted, 1, __ATOMIC_RELAXED);
    __atomic_fetch_add(&q->completed, 1, __ATOMIC_RELAXED);
    __atomic_store_n(&g_first, 1, __ATOMIC_RELEASE);
    __atomic_store_n(&g_second, 1, __ATOMIC_RELEASE);
}
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall