スキル一覧に戻る
martimramos

forge-lang-c

by martimramos

0🍴 0📅 2025年12月21日
GitHubで見るManusで実行

SKILL.md


name: forge-lang-c description: C development standards including make, gcc/clang, valgrind, and cppcheck. Use when working with C files, Makefiles, or CMakeLists.txt.

C Development

Building

# With Make
make

# With CMake
mkdir -p build && cd build
cmake ..
make

# Direct compilation
gcc -Wall -Wextra -Werror -o program main.c

Testing

# With Makefile test target
make test

# With CTest (CMake)
cd build && ctest -V

# With Unity or other test frameworks
./run_tests

Static Analysis

# Cppcheck
cppcheck --enable=all --error-exitcode=1 src/

# Clang static analyzer
scan-build make

# GCC warnings as errors
gcc -Wall -Wextra -Werror -pedantic -std=c11

Memory Checking

# Valgrind memory check
valgrind --leak-check=full ./program

# AddressSanitizer (compile with)
gcc -fsanitize=address -g -o program main.c

Formatting

# Format with clang-format
clang-format -i src/*.c src/*.h

# Check without changing
clang-format --dry-run --Werror src/*.c src/*.h

Project Structure

project/
├── src/
│   ├── main.c
│   └── module.c
├── include/
│   └── module.h
├── tests/
│   └── test_module.c
├── Makefile (or CMakeLists.txt)
└── README.md

Makefile Template

CC = gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -pedantic
LDFLAGS =
SRC = src/main.c src/module.c
OBJ = $(SRC:.c=.o)
TARGET = program

all: $(TARGET)

$(TARGET): $(OBJ)
	$(CC) $(LDFLAGS) -o $@ $^

%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<

test: $(TARGET)
	./run_tests

clean:
	rm -f $(OBJ) $(TARGET)

.PHONY: all test clean

TDD Cycle Commands

# RED: Write test, run to see it fail
make test

# GREEN: Implement, run to see it pass
make test

# REFACTOR: Clean up, ensure tests still pass
make clean && make && make test && cppcheck --enable=all src/

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です