chore: refactor agent to skill-first; structured skills dirs; enhance ReAct and tool logs

This commit is contained in:
whlaoding
2026-02-21 23:29:27 +08:00
parent c2bebb3457
commit e1c7822ed4
9 changed files with 333 additions and 107 deletions

View File

@@ -26,6 +26,7 @@ Now supports mutually exclusive message channels:
- If `telegram`: set `TELEGRAM_BOT_TOKEN`, keep `FEISHU_*` empty.
- If `feishu`: set `FEISHU_APP_ID` and `FEISHU_APP_SECRET`, keep `TELEGRAM_BOT_TOKEN` empty.
3. Set log level with `LOG_LEVEL=debug|info|warn|error`.
- To inspect full skill/tool execution content and detailed ReAct step traces, use `LOG_LEVEL=debug`.
4. Configure knowledge and reasoning:
- `SOUL_PATH` for bot personality markdown.
- `SKILLS_DIR` for skills markdown directory.
@@ -45,22 +46,13 @@ go run ./cmd/bot
## Telegram Usage
- Normal text: forwarded to LLM with compressed recent memory.
- Agent uses ReAct loop and may call tools automatically before final answer.
- Tool call command:
```text
/tool <name> <input>
```
Examples:
```text
/tool shell pwd
/tool file read ./workspace/note.txt
/tool file write ./workspace/note.txt
hello world
```
- Normal text enters unified agent pipeline:
1. Receive message and load recent memory context
2. Match relevant skill(s) from `skills/`
3. If no skill matched, respond via direct LLM
4. If skill matched, run ReAct and call tools (`shell` / `file`) only when needed
5. Return final answer
- No `/tool ...` command is required for normal use.
## Feishu Usage
@@ -71,7 +63,7 @@ hello world
- Soul file default path: `bot_context/soul.md`
- Skills directory default path: `skills/`
- Add new markdown files into `skills/` to describe capabilities; they are loaded at startup.
- Skill format uses subdirectories: `skills/<skill_name>/skill.md`
## Security Notes