Commands and conventions for changing nllclw.
- Zig
0.16.0 - No package dependencies beyond Zig stdlib
Check the package metadata:
cat build.zig.zonzig build
zig build --release=small
zig build --release=small -Dsize-tuned=false
zig build -Dshell-tool=trueCross-target release checks used by the project:
zig build -Dtarget=x86_64-windows --release=small
zig build -Dtarget=x86_64-linux --release=small
zig build -Dtarget=aarch64-linux --release=small
zig build -Dtarget=aarch64-macos --release=small
zig build -Dtarget=wasm32-wasi --release=smallzig fmt --check build.zig build.zig.zon $(rg --files src -g '*.zig')
zig build test --summary all
zig build test --summary all -Dshell-tool=true
zig build --release=small --summary allThe default test step covers:
- the public package module;
- the executable module;
src/all_tests.zig, which imports internal modules for compile and behavior coverage.
Before handing changes back, run the full local gate:
zig fmt build.zig build.zig.zon $(find src -name '*.zig' -type f | sort)
zig build test --summary all
zig build test --summary all -Dshell-tool=true
zig build --release=small
./zig-out/bin/nllclw --help >/dev/null
strings ./zig-out/bin/nllclw | rg 'shell_exec|NLLCLW_SHELL|NLLCLW_TOOL_TIMEOUT_MS|cmd\.exe|sh -c' || true
git diff --checkBinary size, startup, RAM, test counts, source counts, and reproduction commands are documented in benchmarks.md.
Provider presets live in src/providers.zig.
Checklist:
- Add a
ProviderKindenum tag. - Add config parsing in
src/config/resolve.zig. - Resolve endpoint and headers in
src/providers.zig. - Add tests for endpoint, headers, invalid config, and header injection.
- Document the provider in configuration.md.
Keep the request body provider-neutral unless the provider is still compatible with the minimal Chat Completions contract.
Channels belong in src/channels/ when they are user-facing orchestration.
Checklist:
- Keep parsing and I/O in the channel module.
- Use
runtime.Runtimefor config, HTTP, memory, tools, and completions. - Avoid direct provider or filesystem logic in the channel unless it is channel-specific state, such as Telegram offsets.
- Add command/help text in
src/channels/cli.zigif the channel is launched from the main executable. - Put reusable wire parsing/formatting in a sibling protocol module when the
channel has a protocol surface, as WebSocket does in
src/websocket.zig. - Add tests for command recognition, protocol parsing, and error mapping.
- Document the channel in channels.md.
Tools belong in src/tools/ and are registered in src/tools/catalog.zig.
See tools.md for the full tool checklist.
The short version:
- define a
chat.ToolDefinition; - parse arguments with
std.json; - return owned UTF-8 text;
- cap output;
- put local-state capabilities behind explicit config flags;
- test positive and negative behavior.
The memory domain lives in src/memory.zig; concrete storage lives in
src/adapters/.
To add another storage backend:
- Implement
memory.TranscriptStoreand/ormemory.FactStore. - Keep backend-specific file/database/network details out of
memory.zig. - Wire the backend in
runtime.zig. - Add adapter tests for malformed data, bounds, duplicate keys, and deletion.
- Keep
README.mdstructured, practical, and useful for learning. - Keep long-form English docs in
docs/en/. - Keep
docs/README.mdas the language index and list only languages with a real entry point. - Put README translations in separate files such as
README.ru.md. - Preserve the English README section order in translated README files.
- Use Mermaid diagrams so GitHub renders them natively.
- Every new runtime capability needs configuration docs and safety notes.
- Every new command should appear in README or channels.md.
- Every new docs page should be linked from the English docs hub and, when user-facing, the root README.
- Follow localization.md for translation-ready writing.