n-popescu/Inkypaint / .claude/skills/snx-code-quality
snx-code-quality
VerifiedRFC #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/.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.4 KB |
| check.pyexecutable | script | 13.4 KB |
| examples.md | markdown | 10.9 KB |
| test/fixtures/clean.c | other | 1.7 KB |
| test/fixtures/expected.txt | markdown | 668 B |
| test/fixtures/flagged.c | other | 1.0 KB |
| test/test-check.shexecutable | script | 1.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);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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 implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |