chore: clean up skill_loader comments and extract_title signature

Signed-off-by: Asklv <boironic@gmail.com>
This commit is contained in:
Asklv
2026-02-27 14:00:00 +08:00
parent fc17355640
commit 77fb31d6bd
2 changed files with 6 additions and 7 deletions

View File

@@ -9,8 +9,8 @@
static const char *TAG = "skills";
/*
* Built-in skills are now stored as markdown files in spiffs_data/skills/
* and pre-flashed into the SPIFFS partition at build time.
* Skills are stored as markdown files in spiffs_data/skills/
* and flashed into the SPIFFS partition at build time.
*/
esp_err_t skill_loader_init(void)
@@ -42,10 +42,10 @@ esp_err_t skill_loader_init(void)
/* ── Build skills summary for system prompt ──────────────────── */
/**
* Parse first line as title: expects "# Title"
* Returns pointer past "# " or the line itself if no prefix.
* Parse first line as title: expects "# Title".
* Writes the title (without "# " prefix) into out.
*/
static const char *extract_title(const char *line, size_t len, char *out, size_t out_size)
static void extract_title(const char *line, size_t len, char *out, size_t out_size)
{
const char *start = line;
if (len >= 2 && line[0] == '#' && line[1] == ' ') {
@@ -61,7 +61,6 @@ static const char *extract_title(const char *line, size_t len, char *out, size_t
size_t copy = len < out_size - 1 ? len : out_size - 1;
memcpy(out, start, copy);
out[copy] = '\0';
return out;
}
/**

View File

@@ -5,7 +5,7 @@
/**
* Initialize skills system.
* Installs built-in skill files to SPIFFS if they don't already exist.
* Scans SPIFFS for available skill markdown files.
*/
esp_err_t skill_loader_init(void);