scaffold
Creates a new suckless-style program or sub-project skeleton with the dl-new tool: POSIX Makefile (all/test/install/uninstall/clean/dist), config.def copied to config on build, man page, LICENSE, README, a .budget file and a passing test.sh, for C, Rust, a Rust terminal UI (dmenu-style picker) or POSIX sh. Use when starting a new program, library or sub-project, or after decompose approves a project map.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- scaffold
- description
- Creates a new suckless-style program or sub-project skeleton with the dl-new tool: POSIX Makefile (all/test/install/uninstall/clean/dist), config.def copied to config on build, man page, LICENSE, README, a .budget file and a passing test.sh, for C, Rust, a Rust terminal UI (dmenu-style picker) or POSIX sh. Use when starting a new program, library or sub-project, or after decompose approves a project map.
- argument-hint
- <c|rust|rust-tui|sh> <name>
02 资源文件 45
- 脚本scripts/dl-new3.1 KB
- 其他templates/c/__NAME__.1440 B
- 其他templates/c/__NAME__.c1.3 KB
- 其他templates/c/.budget49 B
- 其他templates/c/config.def.h133 B
- 其他templates/c/config.mk259 B
- 其他templates/c/gitignore42 B
- 许可证templates/c/LICENSE1.0 KB
- 其他templates/c/Makefile1.1 KB
- 其他templates/c/README731 B
- 脚本templates/c/test.sh1.1 KB
- 其他templates/c/util.c554 B
- 其他templates/c/util.h133 B
- 其他templates/rust-tui/__NAME__.11.1 KB
- 其他templates/rust-tui/.budget49 B
- 其他templates/rust-tui/Cargo.toml185 B
- 其他templates/rust-tui/gitignore41 B
- 许可证templates/rust-tui/LICENSE1.0 KB
- 其他templates/rust-tui/Makefile1.3 KB
- 其他templates/rust-tui/README931 B
- 脚本templates/rust-tui/src/config.def.rs493 B
- 脚本templates/rust-tui/src/main.rs2.7 KB
- 脚本templates/rust-tui/src/term.rs5.2 KB
- 脚本templates/rust-tui/src/ui.rs9.4 KB
- 脚本templates/rust-tui/src/util.rs426 B
- 脚本templates/rust-tui/test.sh2.8 KB
- 其他templates/rust/__NAME__.1440 B
- 其他templates/rust/.budget49 B
- 其他templates/rust/Cargo.toml172 B
- 其他templates/rust/gitignore41 B
- 许可证templates/rust/LICENSE1.0 KB
- 其他templates/rust/Makefile1.3 KB
- 其他templates/rust/README782 B
- 脚本templates/rust/src/config.def.rs200 B
- 脚本templates/rust/src/main.rs2.1 KB
- 脚本templates/rust/src/util.rs426 B
- 脚本templates/rust/test.sh1.1 KB
- 其他templates/sh/__NAME__589 B
- 其他templates/sh/__NAME__.1440 B
- 其他templates/sh/.budget48 B
- 其他templates/sh/gitignore19 B
- 许可证templates/sh/LICENSE1.0 KB
- 其他templates/sh/Makefile999 B
- 其他templates/sh/README619 B
- 脚本templates/sh/test.sh1.1 KB
03 SKILL.md 正文
Scaffold
A new program starts from a skeleton that already builds, tests, installs and
passes its budget. The skeleton is a working cat: replace its behaviour, keep
its layout.
Tool: dl-new
${CLAUDE_SKILL_DIR}/scripts/dl-new LANG NAME [DEST]
LANG:c,rust,rust-tuiorsh(one directory per template undertemplates/).rust-tuiis a dmenu-style picker (std +libc,deps 1;make testneeds tmux): the start for the filter and TUI rungs.NAME:^[a-z][a-z0-9-]{0,31}$. It names the binary, the man page and the package.DEST: defaultprojects/NAME. An existing empty directory, including., is fine.- Silent on success, exit 0. Errors go to stderr with exit 2 and nothing written:
dl-new: usage: dl-new LANG NAME [DEST] dl-new: unknown language go (have: c rust rust-tui sh) dl-new: bad name Foo (want ^[a-z][a-z0-9-]{0,31}$) dl-new: projects/foo/Makefile: exists __NAME__,__YEAR__and__AUTHOR__(fromgit config user.name) are replaced in file names and contents.
Choose the language
Choose LANG with ${CLAUDE_SKILL_DIR}/../suckless-code/references/languages.md.
For other languages, apply the layout checklist from that file by hand.
What every skeleton holds
| File | Purpose |
|---|---|
Makefile |
.POSIX:; targets all test install uninstall clean; honours DESTDIR, PREFIX, MANPREFIX |
dist |
make dist → NAME-VERSION.tar.gz; the release skill uses it |
config.def.h / src/config.def.rs |
defaults, copied to config.h / src/config.rs on the first build (sh: variables at the top of the script) |
NAME.1 |
man page: NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS; VERSION filled in on install |
LICENSE |
MIT/X |
README |
one line, Requirements, Installation, Running, Configuration |
test.sh |
POSIX sh behaviour test of the binary in $BIN; silent on success, FAIL: <what> on failure |
.budget |
sloc N / deps N for dl-budget |
Every program follows ${CLAUDE_SKILL_DIR}/../suckless-code/references/conventions.md
(flags, exit status, stderr, files, versions). C adds config.mk (version, paths,
flags) and util.c with die()/ecalloc(). Rust has an empty [dependencies] table
and a size-tuned release profile; rust-tui adds src/term.rs (raw mode on
/dev/tty, all unsafe) and a pure, unit-tested src/ui.rs.
Procedure
- Generate:
${CLAUDE_SKILL_DIR}/scripts/dl-new <lang> <name>. No shell available → write the same files by hand from${CLAUDE_SKILL_DIR}/templates/<lang>/with the same substitutions (gitignore→.gitignore), and report step 2 as not run. - Prove the skeleton:
Both must exit 0. A failure here is a toolchain problem; fix it before writing code.make -C <DEST> test ${CLAUDE_SKILL_DIR}/../suckless-code/scripts/dl-budget <DEST> - Set
.budgetto the numbers agreed in.dev-docs/system.md(decompose), if any. - Replace the cat behaviour with the real job, test-first: change
test.sh(and unit tests) to the new behaviour, watch it fail, then change the code. Update the man page SYNOPSIS/DESCRIPTION/OPTIONS and the README in the same change. - Re-run step 2 after every change that grows the program.
Monorepo root
With more than one program under projects/, the repo root gets this Makefile;
only the PROJECTS list changes (build order):
.POSIX:
PROJECTS = <names in build order>
all test clean install uninstall:
@for p in $(PROJECTS); do $(MAKE) -C projects/$$p $@ || exit 1; done
.PHONY: all test clean install uninstall
Every program must still build, test and install alone with
make -C projects/<name> <target>.
04 同仓库更多 Skills
write-plan
Turns approved product/design/architecture artifacts or a clear request into plan.md: small ordered tasks, each with exact files, a test written first and a verification command. Use before implementing anything larger than a one-file change.
workflow
Runs the deadlion pipeline (product → design → decompose → architecture → plan → build → review → verify) through plain-text artifacts in .dev-docs/. Use when the user starts a new product, system, feature or multi-step change, or asks what to do next.
verify
Evidence before claims: before saying work is done, fixed or passing, run the proving command fresh, read its output and the git diff, and report VERIFIED and NOT VERIFIED items separately. Use before declaring any task complete and after any subagent reports success.
ux-design
Designs the user interface of a program at the lowest rung that serves the job — CLI, filter (dmenu/fzf style), terminal UI, native GUI or web — with flows, states, a key map, design tokens kept in config.def and numeric gates per rung, so every UI works alone and embeds; avoids generic AI-looking UI. Includes the dl-contrast checker. Writes design.md. Use when building or changing any user interface, screen, TUI, GUI, component or visual style.
unix-design
Designs the internals of one program or sub-project as small single-purpose modules with plain-text interfaces, separated mechanism and policy, and one build/run command each, following the Unix philosophy. Writes arch.md. Use when designing a new feature's architecture inside a program, a CLI, module or data flow; for splitting a system into several programs use decompose.
ui-verify
Verifies a running UI against the gates in design.md — web pages in a real browser via the Playwright MCP (screenshots at 375/768/1280 px, console errors, axe scan, touch targets), terminal programs through dl-tui in a headless tmux (screens at 80×24, 40×12 and 20×5, NO_COLOR, key scripts per state, terminal restore, stdout purity), and token contrast with dl-contrast. Use after implementing or changing any UI, or when the user asks to check how a screen looks or works.