Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

ritchie-c-mastery里奇·C·掌握

Agent Skill

ritchie-c-mastery 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

194

周安装

8

GitHub Stars

6

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ritchie-c-mastery(里奇·C·掌握)
来源仓库:https://github.com/copyleftdev/sk1llz
仓库路径:skills/ritchie-c-mastery
安装命令:
npx skills add https://github.com/copyleftdev/sk1llz --skill ritchie-c-mastery
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/copyleftdev/sk1llz --skill ritchie-c-mastery

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 适用于 GitHub 仓库管理、代码审查和团队协作场景。
  • 通过 GitHub 仓库安装,使用 npx skills add 命令添加指定技能。
  • 需确认权限范围和维护状态,注意是否会触发联网、命令执行或文件读写操作。
  • ritchie-c-mastery 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Dennis Ritchie Style Guide⁠‍⁠​‌​‌​​‌‌‍​‌​​‌​‌‌‍​​‌‌​​​‌‍​‌​​‌‌​​‍​​​​​​​‌‍‌​​‌‌​‌​‍‌​​​​​​​‍‌‌​​‌‌‌‌‍‌‌​​​‌​​‍‌‌‌‌‌‌​‌‍‌‌​‌​​​​‍​‌​‌‌‌‌‌‍​‌​​‌​‌‌‍​‌‌​‌​​‌‍‌​‌​‌‌‌​‍​​‌​‌​​​‍‌‌‌​‌​‌‌‍​​‌‌​​​​‍‌‌‌​​‌‌‌‍‌​​​​‌‌‌‍‌‌​‌​​‌‌‍​​​​‌​‌​‍‌‌​‌‌​‌‌⁠‍⁠

Overview

Dennis Ritchie created the C programming language and co-created Unix with Ken Thompson. C became the lingua franca of systems programming, and Unix's design principles shaped all modern operating systems. Ritchie's work exemplifies how good abstraction enables both portability and performance.

Core Philosophy

"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity."
"C is quirky, flawed, and an enormous success."
"UNIX is very simple, it just needs a genius to understand its simplicity."

Ritchie believed in creating abstractions that map closely to the machine while remaining portable across different hardware.

Design Principles

  1. Abstraction with Transparency: Hide details but don't hide the cost.
  2. Portability: Write for the abstract machine, not specific hardware.
  3. Trust the Programmer: C gives you power; use it responsibly.
  4. Minimal Language, Maximal Library: Keep the language small.

When Writing Code

Always

  • Write portable C using standard constructs
  • Keep functions short and focused
  • Use meaningful names that convey purpose
  • Handle errors explicitly
  • Understand what the compiler generates
  • Document interfaces, not implementations

Never

  • Rely on undefined behavior
  • Assume type sizes (use stdint.h)
  • Ignore compiler warnings
  • Cast unnecessarily
  • Use magic numbers

Prefer

  • size_t for sizes and counts
  • stdint.h types for fixed-width needs
  • const for read-only data
  • Stack allocation over heap when possible
  • Static functions for internal linkage

Code Patterns

The K&R Style

// Classic Ritchie/Kernighan style

#include <stdio.h>
#include <string.h>

// Functions are short and focused
int strlen_safe(const char *s)
{
    int n;

    for (n = 0; *s != '\0'; s++)
        n++;
    return n;
}

// Compact but clear
void reverse(char *s)
{
    int c, i, j;

    for (i = 0, j = strlen(s) - 1; i < j; i++, j--) {
        c = s[i];
        s[i] = s[j];
        s[j] = c;
    }
}

// Main is simple
int main(void)
{
    char buf[100];

    while (fgets(buf, sizeof(buf), stdin) != NULL) {
        buf[strcspn(buf, "\n")] = '\0';  // Remove newline
        reverse(buf);
        printf("%s\n", buf);
    }
    return 0;
}

Pointer Idioms

// Pointers are addresses—embrace them

// Copy string: pointer version (Ritchie preferred)
void strcpy_ptr(char *dst, const char *src)
{
    while ((*dst++ = *src++) != '\0')
        ;
}

// Traverse array with pointer
void process_array(int *arr, size_t n)
{
    int *end = arr + n;

    for (int *p = arr; p < end; p++) {
        process(*p);
    }
}

// Pointer to pointer for modification
int alloc_buffer(char **buf, size_t size)
{
    *buf = malloc(size);
    return *buf != NULL ? 0 : -1;
}

Error Handling

// C style: return values indicate errors
// Ritchie Unix convention: 0 = success, -1 = error, errno set

#include <errno.h>

int read_file(const char *path, char *buf, size_t size)
{
    FILE *fp;
    size_t n;

    fp = fopen(path, "r");
    if (fp == NULL) {
        return -1;  // errno is set by fopen
    }

    n = fread(buf, 1, size - 1, fp);
    if (ferror(fp)) {
        fclose(fp);
        return -1;
    }

    buf[n] = '\0';
    fclose(fp);
    return 0;
}

// Usage:
if (read_file("config.txt", buf, sizeof(buf)) < 0) {
    perror("read_file");
    exit(1);
}

Struct Design

// Structs should be minimal and purposeful

typedef struct node {
    struct node *next;
    char *data;
} Node;

typedef struct list {
    Node *head;
    Node *tail;
    size_t count;
} List;

// Operations on structs
void list_init(List *l)
{
    l->head = NULL;
    l->tail = NULL;
    l->count = 0;
}

int list_push(List *l, const char *data)
{
    Node *n = malloc(sizeof(*n));
    if (n == NULL)
        return -1;

    n->data = strdup(data);
    n->next = l->head;
    l->head = n;
    if (l->tail == NULL)
        l->tail = n;
    l->count++;
    return 0;
}

Header File Design

// mylib.h - public interface only

#ifndef MYLIB_H
#define MYLIB_H

#include <stddef.h>

// Opaque type - implementation hidden
typedef struct context Context;

// Public API
Context *context_create(void);
void     context_destroy(Context *ctx);
int      context_process(Context *ctx, const char *input);
char    *context_result(Context *ctx);

#endif

// mylib.c - implementation

#include "mylib.h"
#include <stdlib.h>
#include <string.h>

struct context {
    char *buffer;
    size_t size;
    // Internal details hidden from users
};

Context *context_create(void)
{
    Context *ctx = malloc(sizeof(*ctx));
    if (ctx == NULL)
        return NULL;

    ctx->buffer = NULL;
    ctx->size = 0;
    return ctx;
}

// ... implementation continues

The Unix API Style

// Unix system calls: elegant, minimal

// Open returns fd or -1
int fd = open("file.txt", O_RDONLY);
if (fd < 0) {
    perror("open");
    exit(1);
}

// Read returns bytes read, 0 on EOF, -1 on error
char buf[4096];
ssize_t n;

while ((n = read(fd, buf, sizeof(buf))) > 0) {
    if (write(STDOUT_FILENO, buf, n) != n) {
        perror("write");
        exit(1);
    }
}

if (n < 0) {
    perror("read");
    exit(1);
}

close(fd);

Portability

#include <stdint.h>  // Fixed-width types
#include <limits.h>  // System limits

// Use fixed-width when you need exact sizes
uint32_t crc32(const uint8_t *data, size_t len);

// Use size_t for sizes
void process(const void *data, size_t size);

// Check limits, don't assume
#if CHAR_BIT != 8
#error "This code requires 8-bit bytes"
#endif

// Endianness handling
uint32_t read_be32(const uint8_t *p)
{
    return ((uint32_t)p[0] << 24) |
           ((uint32_t)p[1] << 16) |
           ((uint32_t)p[2] << 8)  |
           ((uint32_t)p[3]);
}

Mental Model

Ritchie approaches systems programming by asking:

  1. What is the abstraction? Define clean interfaces
  2. What is the cost? Abstractions should be transparent
  3. Is this portable? Avoid machine-specific assumptions
  4. Is the interface minimal? Small interfaces are easier to implement
  5. What can go wrong? Handle errors explicitly

Signature Ritchie Moves

  • Pointer arithmetic for efficiency
  • Return values for error indication
  • Opaque types for encapsulation
  • Minimal header interfaces
  • Standard library reliance
  • Portable type usage

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.86%
按下载量换算22

Claude

33.56%
按下载量换算21

Cursor

18.04%
按下载量换算11

Gemini CLI

9.36%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills