Skip to content

Commit 2271aa4

Browse files
author
brand
committed
Squashed commit of deep-test-final:
commit 452a9f8363c151bf440d405de195614307b3ca4f Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 16:43:52 2026 +0000 restore commit 55dbe9d4a57884ec5065ef6ba41704c2aac9f462 Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 16:38:56 2026 +0000 feat(skill/slack): include groups/main CLAUDE.md in package modifies with Slack formatting guidance commit 846c6dbd6aca5ee57fda83c94f5afd1c5f7bf69d Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 16:26:22 2026 +0000 docs(contributing): document nanorepo package-based skill format alongside instruction-based format commit 1e024930d9dc93955939dc2581da860a050fc74c Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 16:25:53 2026 +0000 fix(skill-pr): revert src/container-runner.ts to main baseline; ANTHROPIC_BASE_URL fix moved to fix/anthropic-base-url-passthrough branch commit b651b3f0ac459afadde5d302e55074587f0dec38 Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 16:24:46 2026 +0000 feat(slack): downgrade skill version from 1.0.0 to 0.1.2 for pre-release alignment commit ce81959f2e2b8adb2d32ade429b1f334086836f6 Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 16:04:52 2026 +0000 docs(slack): 更新技术债务文档至 v1.4,重新分类债务项并调整优先级 - 版本号 1.3 → 1.4,更新日期 2026-02-25 - 全局优先级"中等"改为"见各项优先级" - 新增"Part I: 核心代码架构债务"分类标题,明确债务项需修改 `src/` 主代码库 - 债务项 #1 新增"优先级:中等 — 第二通道集成前必须解决"标签 - 开发决策声明中"Part I 项"替代"所有债务项",限定范围更精确 - 修正"Post-Application Revision"措 commit 6ce563117813ade0b9474ead36c0d7e172993bc0 Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 15:41:55 2026 +0000 docs(slack): 移除技术债务文档,已通过 Path C 实现解决 - 删除 slack-technical-debt-zh.md(413 行) - 债务项 #1-qwibitai#4(*_ONLY 标志、路由增强、IPC 扩展、配置统一)已通过 skill-first Path C 实现(getChatName + IPC auto-resolve + resolveChannelName) - 债务项 qwibitai#5(核心文件修改)已在 W6 审计中确认为通用基础设施改进,无需回退 - 文档版本 1.3,最后更新 2026-02-25,标记为"中等优先级" commit a14d55f7885370673d095b0a376c7ab3cff68b58 Author: brand <gialovcompotrds@gmail.com> Date: Wed Feb 25 15:34:25 2026 +0000 docs(slack): 更新用户指南术语和结构,新增 API 恢复章节 - 标题改为"用户指南"(原"用户手册") - 统一术语:App→应用、Token→令牌、Main Channel→主频道、故障排查→故障排除、运维与监控→操作与监控 - 新增第 10 节"API 恢复与弹性",说明 AI API 宕机时的失败消息丢弃和恢复后处理新消息机制 - 概述部分新增自动 API 恢复功能说明 - 前置条件表格标题"条件"改为"要求" - 简化描
1 parent 2b038d0 commit 2271aa4

27 files changed

Lines changed: 723 additions & 6755 deletions

.claude/skills/add-slack/manifest.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
skill: slack
2-
version: 1.0.0
2+
version: 0.1.2
33
description: 'Slack Bot (Socket Mode) integration via @slack/bolt — ported from claudecode-slackbot'
44
core_version: 0.1.0
55
adds:
@@ -17,6 +17,7 @@ modifies:
1717
- src/routing.test.ts
1818
- src/db.ts
1919
- src/ipc.ts
20+
- groups/main/CLAUDE.md
2021
structured:
2122
npm_dependencies:
2223
'@slack/bolt': '^4.6.0'
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# Andy
2+
3+
You are Andy, a personal assistant. You help with tasks, answer questions, and can schedule reminders.
4+
5+
## What You Can Do
6+
7+
- Answer questions and have conversations
8+
- Search the web and fetch content from URLs
9+
- **Browse the web** with `agent-browser` — open pages, click, fill forms, take screenshots, extract data (run `agent-browser open <url>` to start, then `agent-browser snapshot -i` to see interactive elements)
10+
- Read and write files in your workspace
11+
- Run bash commands in your sandbox
12+
- Schedule tasks to run later or on a recurring basis
13+
- Send messages back to the chat
14+
15+
## Communication
16+
17+
Your output is sent to the user or group.
18+
19+
You also have `mcp__nanoclaw__send_message` which sends a message immediately while you're still working. This is useful when you want to acknowledge a request before starting longer work.
20+
21+
### Internal thoughts
22+
23+
If part of your output is internal reasoning rather than something for the user, wrap it in `<internal>` tags:
24+
25+
```
26+
<internal>Compiled all three reports, ready to summarize.</internal>
27+
28+
Here are the key findings from the research...
29+
```
30+
31+
Text inside `<internal>` tags is logged but not sent to the user. If you've already sent the key information via `send_message`, you can wrap the recap in `<internal>` to avoid sending it again.
32+
33+
### Sub-agents and teammates
34+
35+
When working as a sub-agent or teammate, only use `send_message` if instructed to by the main agent.
36+
37+
## Memory
38+
39+
The `conversations/` folder contains searchable history of past conversations. Use this to recall context from previous sessions.
40+
41+
When you learn something important:
42+
- Create files for structured data (e.g., `customers.md`, `preferences.md`)
43+
- Split files larger than 500 lines into folders
44+
- Keep an index in your memory for the files you create
45+
46+
## Slack Message Formatting
47+
48+
When replying in Slack, use standard Slack/Markdown formatting:
49+
- **Bold** (double asterisks)
50+
- _Italic_ (underscores)
51+
- • Bullets (bullet points)
52+
- ```Code blocks``` (triple backticks)
53+
- Links in markdown format, e.g. `[title](https://example.com)`
54+
55+
Keep messages clean and readable for Slack.
56+
57+
---
58+
59+
## Admin Context
60+
61+
This is the **main channel**, which has elevated privileges.
62+
63+
## Container Mounts
64+
65+
Main has access to the entire project:
66+
67+
| Container Path | Host Path | Access |
68+
|----------------|-----------|--------|
69+
| `/workspace/project` | Project root | read-write |
70+
| `/workspace/group` | `groups/main/` | read-write |
71+
72+
Key paths inside the container:
73+
- `/workspace/project/store/messages.db` - SQLite database
74+
- `/workspace/project/store/messages.db` (registered_groups table) - Group config
75+
- `/workspace/project/groups/` - All group folders
76+
77+
---
78+
79+
## Managing Groups
80+
81+
### Finding Available Groups
82+
83+
Available groups are provided in `/workspace/ipc/available_groups.json`:
84+
85+
```json
86+
{
87+
"groups": [
88+
{
89+
"jid": "120363336345536173@g.us",
90+
"name": "Family Chat",
91+
"lastActivity": "2026-01-31T12:00:00.000Z",
92+
"isRegistered": false
93+
}
94+
],
95+
"lastSync": "2026-01-31T12:00:00.000Z"
96+
}
97+
```
98+
99+
Groups are ordered by most recent activity. The list is synced from WhatsApp daily.
100+
101+
If a group the user mentions isn't in the list, request a fresh sync:
102+
103+
```bash
104+
echo '{"type": "refresh_groups"}' > /workspace/ipc/tasks/refresh_$(date +%s).json
105+
```
106+
107+
Then wait a moment and re-read `available_groups.json`.
108+
109+
**Fallback**: Query the SQLite database directly:
110+
111+
```bash
112+
sqlite3 /workspace/project/store/messages.db "
113+
SELECT jid, name, last_message_time
114+
FROM chats
115+
WHERE jid LIKE '%@g.us' AND jid != '__group_sync__'
116+
ORDER BY last_message_time DESC
117+
LIMIT 10;
118+
"
119+
```
120+
121+
### Registered Groups Config
122+
123+
Groups are registered in `/workspace/project/data/registered_groups.json`:
124+
125+
```json
126+
{
127+
"1234567890-1234567890@g.us": {
128+
"name": "Family Chat",
129+
"folder": "family-chat",
130+
"trigger": "@Andy",
131+
"added_at": "2024-01-31T12:00:00.000Z"
132+
}
133+
}
134+
```
135+
136+
Fields:
137+
- **Key**: The chat JID (unique identifier — WhatsApp: `xxx@g.us`, Slack: `slack:Cxxxxxxx`)
138+
- **name**: Display name for the group (optional for Slack — auto-resolved from Slack API if omitted)
139+
- **folder**: Folder name under `groups/` for this group's files and memory
140+
- **trigger**: The trigger word (usually same as global, but could differ)
141+
- **requiresTrigger**: Whether `@trigger` prefix is needed (default: `true`). Set to `false` for solo/personal chats where all messages should be processed
142+
- **added_at**: ISO timestamp when registered
143+
144+
### Trigger Behavior
145+
146+
- **Main group**: No trigger needed — all messages are processed automatically
147+
- **Groups with `requiresTrigger: false`**: No trigger needed — all messages processed (use for 1-on-1 or solo chats)
148+
- **Other groups** (default): Messages must start with `@AssistantName` to be processed
149+
150+
### Adding a Group
151+
152+
Write an IPC task file to `/workspace/ipc/tasks/` with type `register_group`:
153+
154+
```json
155+
{
156+
"type": "register_group",
157+
"jid": "slack:C093KP9PCVA",
158+
"folder": "my-channel",
159+
"trigger": "@Andy",
160+
"requiresTrigger": true
161+
}
162+
```
163+
164+
Required fields: `jid`, `folder`, `trigger`. The `name` field is optional — for Slack channels it is auto-resolved from the Slack API. For WhatsApp groups, include `name` explicitly.
165+
166+
Folder name conventions:
167+
- Use lowercase, hyphens instead of spaces
168+
- "general" → `general`, "Dev Team" → `dev-team`
169+
170+
#### Adding Additional Directories for a Group
171+
172+
Groups can have extra directories mounted. Add `containerConfig` to their entry:
173+
174+
```json
175+
{
176+
"1234567890@g.us": {
177+
"name": "Dev Team",
178+
"folder": "dev-team",
179+
"trigger": "@Andy",
180+
"added_at": "2026-01-31T12:00:00Z",
181+
"containerConfig": {
182+
"additionalMounts": [
183+
{
184+
"hostPath": "~/projects/webapp",
185+
"containerPath": "webapp",
186+
"readonly": false
187+
}
188+
]
189+
}
190+
}
191+
}
192+
```
193+
194+
The directory will appear at `/workspace/extra/webapp` in that group's container.
195+
196+
### Removing a Group
197+
198+
1. Read `/workspace/project/data/registered_groups.json`
199+
2. Remove the entry for that group
200+
3. Write the updated JSON back
201+
4. The group folder and its files remain (don't delete them)
202+
203+
### Listing Groups
204+
205+
Read `/workspace/project/data/registered_groups.json` and format it nicely.
206+
207+
---
208+
209+
## Global Memory
210+
211+
You can read and write to `/workspace/project/groups/global/CLAUDE.md` for facts that should apply to all groups. Only update global memory when explicitly asked to "remember this globally" or similar.
212+
213+
---
214+
215+
## Scheduling for Other Groups
216+
217+
When scheduling tasks for other groups, use the `target_group_jid` parameter with the group's JID from `registered_groups.json`:
218+
- `schedule_task(prompt: "...", schedule_type: "cron", schedule_value: "0 9 * * 1", target_group_jid: "120363336345536173@g.us")`
219+
220+
The task will run in that group's context with access to their files and memory.

CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@
88

99
## Skills
1010

11-
A [skill](https://code.claude.com/docs/en/skills) is a markdown file in `.claude/skills/` that teaches Claude Code how to transform a NanoClaw installation.
11+
A skill lives in `.claude/skills/<name>/` and teaches Claude Code how to transform a NanoClaw installation. A PR that contributes a skill should not modify any source files outside `.claude/skills/`.
1212

13-
A PR that contributes a skill should not modify any source files.
13+
Two formats are accepted:
1414

15-
Your skill should contain the **instructions** Claude follows to add the feature—not pre-built code. See `/add-telegram` for a good example.
15+
**Instruction-based (simple):** A `SKILL.md` that contains the steps Claude follows to add the feature. Claude reads the instructions and applies changes manually. See `/add-telegram` for a good example.
16+
17+
**Package-based (nanorepo):** A `SKILL.md` + `manifest.yaml` + pre-built code package that the [skills-engine](skills-engine/) applies deterministically via three-way merge. Use this format when the skill modifies multiple source files and needs to compose safely with other skills. The manifest declares `adds:`, `modifies:`, `structured:` sections; pre-built files go in `add/` and `modify/` subdirectories.
18+
19+
When in doubt, start with the instruction-based format. Upgrade to package-based if the skill becomes complex or if deterministic replayability matters.
1620

1721
### Why?
1822

1923
Every user should have clean and minimal code that does exactly what they need. Skills let users selectively add features to their fork without inheriting code for features they don't want.
2024

2125
### Testing
2226

23-
Test your skill by running it on a fresh clone before submitting.
27+
Test your skill by running it on a fresh clone before submitting. For package-based skills, also run `npx tsx scripts/apply-skill.ts --skill <name>` and verify the applied result passes tests.

0 commit comments

Comments
 (0)