You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,26 +29,27 @@ Every user should have clean and minimal code that does exactly what they need.
29
29
30
30
### Skill types
31
31
32
-
#### 1. Feature skills (branch-based)
32
+
#### 1. Channel and provider skills (registry branches)
33
33
34
-
Add capabilities to NanoClaw by merging a git branch. The SKILL.md contains setup instructions; the actual code lives on a `skill/*` branch.
34
+
Add a messaging channel or an agent provider. The SKILL.md contains the install steps; the actual code lives on a long-lived registry branch (`channels` or `providers`) that we keep in sync with `main`.
35
35
36
-
**Location:**`.claude/skills/` on `main` (instructions only), code on `skill/*` branch
36
+
**Location:**`.claude/skills/` on `main` (instructions only), code on the `channels` or `providers` branch
2. Claude follows the SKILL.md: fetches and merges the `skill/telegram` branch
43
-
3. Claude walks through interactive setup (env vars, bot creation, etc.)
42
+
2. Claude follows the SKILL.md: `git fetch origin channels`, then copies each file in with `git show origin/channels:<path> > <path>`. Install is an additive fetch, never a `git merge`.
43
+
3. The adapter's registration test is fetched the same way and run as verification
44
+
4. Claude walks through interactive setup (tokens, bot creation, etc.)
44
45
45
-
**Contributing a feature skill:**
46
+
**Contributing a channel or provider skill:**
46
47
1. Fork `nanocoai/nanoclaw` and branch from `main`
47
-
2.Make the code changes (new files, modified source, updated `package.json`, etc.)
48
-
3. Add a SKILL.md in `.claude/skills/<name>/` with setup instructions — step 1 should be merging the branch
49
-
4. Open a PR. We'll create the `skill/<name>` branch from your work
48
+
2.Build the adapter following [docs/skill-guidelines.md](docs/skill-guidelines.md): a self-registering module, one appended barrel import, and a registration test that imports the real barrel
49
+
3. Add a SKILL.md in `.claude/skills/<name>/` with the fetch-and-copy steps, and a REMOVE.md that reverses every change
50
+
4. Open a PR. We'll land the code on the registry branch from your work
50
51
51
-
See `/add-telegram` for a good example. See [docs/skills-as-branches.md](docs/skills-as-branches.md) for the full system design.
52
+
See `/add-slack` for a good example. See [docs/skills-model.md](docs/skills-model.md) for why install is a fetch, never a merge.
52
53
53
54
#### 2. Utility skills (with code files)
54
55
@@ -58,7 +59,7 @@ Standalone tools that ship code files alongside the SKILL.md. The SKILL.md tells
58
59
59
60
**Examples:** a self-contained CLI or helper shipped in a `scripts/` subfolder of the skill.
60
61
61
-
**Key difference from feature skills:**No branch merge needed. The code is self-contained in the skill directory and gets copied into place during installation.
62
+
**Key difference from channel/provider skills:**the code is self-contained in the skill directory and gets copied into place during installation; nothing is fetched from a registry branch.
62
63
63
64
**Guidelines:**
64
65
- Put code in separate files, not inline in the SKILL.md
@@ -93,6 +94,10 @@ Skills that run inside the agent container, not on the host. These teach the con
93
94
- Use `allowed-tools` frontmatter to scope tool permissions
94
95
- Keep them focused — the agent's context window is shared across all container skills
95
96
97
+
### Writing a good skill
98
+
99
+
The authoring bar is [docs/skill-guidelines.md](docs/skill-guidelines.md): mostly adds, minimal reach-ins into existing code, a test for every functional integration point, and a REMOVE.md whenever apply leaves anything behind. [docs/skills-model.md](docs/skills-model.md) explains the model behind it.
100
+
96
101
### SKILL.md format
97
102
98
103
All skills use the [Claude Code skills standard](https://code.claude.com/docs/en/skills):
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,7 @@ If a step fails, `nanoclaw.sh` hands off to Claude Code to diagnose and resume.
200
200
201
201
Only security fixes, bug fixes, and clear improvements will be accepted to the base configuration. That's all.
202
202
203
-
Everything else (new capabilities, OS compatibility, hardware support, enhancements) should be contributed as skillson the `channels` or `providers`branch.
203
+
Everything else (new capabilities, OS compatibility, hardware support, enhancements) should be contributed as skills: channel and provider code on the `channels`/`providers`registry branches, everything else as a self-contained skill. See [docs/customizing.md](docs/customizing.md) and [CONTRIBUTING.md](CONTRIBUTING.md).
204
204
205
205
This keeps the base system minimal and lets every user customize their installation without inheriting features they don't want.
NanoClaw is made to be forked and changed. The catch with most projects is that once you edit the code, every upstream update turns into a merge fight, and the more you customized, the worse it gets.
4
+
5
+
NanoClaw avoids that with one simple idea: **every change you make is a skill.**
6
+
7
+
## The idea in a minute
8
+
9
+
- A **skill** is a small, self-contained add-on. It brings its own code and knows how to install itself.
10
+
- Your **fork is just a list of skills**, plus one "recipe" that says which skills you have and how they fit together.
11
+
- Because your changes live beside the core instead of tangled into it, **pulling in updates stays easy**.
12
+
13
+
## What makes it work
14
+
15
+
A good skill mostly **adds** things: new files, a line appended to an existing file, a dependency. It avoids rewriting existing code in place.
16
+
17
+
And it ships a test for each spot where it touches the rest of the system. When an update moves something your skill depends on, that test fails and points at the fix, instead of you finding out when things break in production.
18
+
19
+
## How you actually work
20
+
21
+
You don't have to think in skills while you're building. **Edit the code directly, get it working, then turn your changes into skills afterward.** A coding agent does the conversion for you, following [skill-guidelines.md](skill-guidelines.md).
22
+
23
+
The only rule worth remembering: **a change isn't really part of your fork until it's a skill**, because that's the form that survives an upgrade.
24
+
25
+
## Upgrading
26
+
27
+
Always upgrade by running `/update-nanoclaw`. **Don't just `git pull`.** The command sets a rollback point, pulls the upstream changes, runs your tests, and walks you through anything that needs fixing, usually a small, local fix in one skill.
28
+
29
+
## The deal
30
+
31
+
We keep the core small and stable, and every breaking change ships with its migration. You keep your changes as skills, with tests. Do that, and upgrades won't break you. Changes edited directly into the core are the one thing the model can't protect.
32
+
33
+
## Go deeper
34
+
35
+
-**[The skills model in full](skills-model.md)**: how skills, recipes, tests, and upgrades work under the hood.
36
+
-**[Skill guidelines](skill-guidelines.md)**: the authoritative checklist for writing one.
0 commit comments