feat: add skills system with weather, daily-briefing, and skill-creator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-09 01:25:56 +08:00
committed by Bo
parent 85e595a141
commit 31a88b53c0
6 changed files with 305 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
#include "context_builder.h"
#include "mimi_config.h"
#include "memory/memory_store.h"
#include "skills/skill_loader.h"
#include <stdio.h>
#include <string.h>
@@ -59,11 +60,10 @@ esp_err_t context_build_system_prompt(char *buf, size_t size)
"- Use get_current_time to know today's date before writing daily notes.\n"
"- Keep MEMORY.md concise and organized — summarize, don't dump raw conversation.\n"
"- You should proactively save memory without being asked. If the user tells you their name, preferences, or important facts, persist them immediately.\n\n"
"## Heartbeat\n"
"The file /spiffs/config/HEARTBEAT.md contains periodic tasks.\n"
"When triggered by heartbeat, read the file and execute any pending tasks.\n"
"If nothing needs attention, reply with just: HEARTBEAT_OK\n"
"You can also write to HEARTBEAT.md to schedule tasks for yourself.\n");
"## Skills\n"
"Skills are specialized instruction files stored in /spiffs/skills/.\n"
"When a task matches a skill, read the full skill file for detailed instructions.\n"
"You can create new skills using write_file to /spiffs/skills/<name>.md.\n");
/* Bootstrap files */
off = append_file(buf, size, off, MIMI_SOUL_FILE, "Personality");
@@ -81,6 +81,16 @@ esp_err_t context_build_system_prompt(char *buf, size_t size)
off += snprintf(buf + off, size - off, "\n## Recent Notes\n\n%s\n", recent_buf);
}
/* Skills */
char skills_buf[2048];
size_t skills_len = skill_loader_build_summary(skills_buf, sizeof(skills_buf));
if (skills_len > 0) {
off += snprintf(buf + off, size - off,
"\n## Available Skills\n\n"
"Available skills (use read_file to load full instructions):\n%s\n",
skills_buf);
}
ESP_LOGI(TAG, "System prompt built: %d bytes", (int)off);
return ESP_OK;
}