From 4097a33c2dfc72bbda1e18f5495184191aaac5d8 Mon Sep 17 00:00:00 2001 From: Danielwangyy <32700482+Danielwangyy@users.noreply.github.com> Date: Sun, 5 Apr 2026 15:14:32 +0800 Subject: [PATCH 1/2] fix(viewer): show session-expired toast when loadConfig gets 401 loadConfig() silently returned on non-200 responses, leaving the settings form with empty/default values. Users saw blank model fields and "Provider and Model are required" errors on test, with no hint that the real issue was an expired session. Other settings functions (doSaveConfig, saveModelsConfig, testModel) already handle 401 correctly via `toast(t('settings.session.expired'))`. This commit applies the same pattern to loadConfig for consistency. Made-with: Cursor --- apps/memos-local-openclaw/src/viewer/html.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/memos-local-openclaw/src/viewer/html.ts b/apps/memos-local-openclaw/src/viewer/html.ts index 14aecc6fc..8491691cb 100644 --- a/apps/memos-local-openclaw/src/viewer/html.ts +++ b/apps/memos-local-openclaw/src/viewer/html.ts @@ -6685,6 +6685,7 @@ function onProviderChange(){} async function loadConfig(){ try{ const r=await fetch('/api/config'); + if(r.status===401){toast(t('settings.session.expired'),'error');return;} if(!r.ok) return; const cfg=await r.json(); const emb=cfg.embedding||{}; From b011e99733d81ed9e78d6599947a9538d3dd2a14 Mon Sep 17 00:00:00 2001 From: kagura-agent Date: Wed, 8 Apr 2026 08:17:50 +0800 Subject: [PATCH 2/2] fix(skill): align generation template with skill-creator best practices - Constrain skill name to 2-4 word kebab-case - Limit frontmatter to name + description only - Add rule against creating extra documentation files - Add 'assume agent is smart' principle - Strengthen trigger condition requirements in description - Clarify metadata as optional OpenClaw extension Fixes #1423 --- .../src/skill/generator.ts | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/memos-local-openclaw/src/skill/generator.ts b/apps/memos-local-openclaw/src/skill/generator.ts index 89cf1e2e6..ffb4ce5c8 100644 --- a/apps/memos-local-openclaw/src/skill/generator.ts +++ b/apps/memos-local-openclaw/src/skill/generator.ts @@ -24,17 +24,24 @@ This Skill is special: it comes from real execution experience — every step wa ## Core principles (follow strictly but do NOT include these in output) +### Assume the agent is smart +The agent consuming this skill is an LLM — it already knows how to use git, write code, read docs, and run commands. +- Only write what the agent CANNOT derive from the codebase or general knowledge: project-specific gotchas, non-obvious config, verified flags/versions, and real pitfalls encountered. +- Do NOT explain basic concepts, standard tool usage, or things any competent developer already knows. + ### Progressive disclosure - The frontmatter description (~100 words) is ALWAYS in the agent's context — it must be self-sufficient for deciding whether to use this skill. - The SKILL.md body loads when triggered — keep it under 400 lines, focused, no fluff. - If the task involved large configs/scripts, mention them but DON'T inline everything — just reference that scripts/ or references/ may contain them. +- If the skill covers multiple variants (e.g. different OS targets, different cloud providers), put variant-specific details in references/ files. The main SKILL.md should cover the common workflow only. ### Description as trigger mechanism -The description field decides whether the agent activates this skill. Write it "proactively": +The description field is the SOLE input the agent uses to decide whether to activate this skill. If the description doesn't match, the body is never read — so put maximum effort here. - Don't just say what it does — list the situations, keywords, and phrasings that should trigger it. - Claude/agents tend to under-trigger skills. Counter this by being explicit about when to use it. +- Include indirect phrasings: users often describe the goal ("make it run anywhere") rather than the tool ("Docker"). - Bad: "How to deploy Node.js to Docker" -- Good: "How to containerize and deploy a Node.js application using Docker. Use when the user mentions Docker deployment, Dockerfile writing, container builds, multi-stage builds, port mapping, .dockerignore, image optimization, CI/CD container pipelines, or any task involving packaging a Node/JS backend into a container — even if they don't say 'Docker' explicitly but describe wanting to 'package the app for production' or 'run it anywhere'." +- Good: "How to containerize and deploy a Node.js application using Docker. TRIGGER when: user mentions Docker deployment, Dockerfile writing, container builds, multi-stage builds, port mapping, .dockerignore, image optimization, CI/CD container pipelines, or any task involving packaging a Node/JS backend into a container — even if they don't say 'Docker' explicitly but describe wanting to 'package the app for production' or 'run it anywhere'." ### Writing style - Use imperative form @@ -43,6 +50,9 @@ The description field decides whether the agent activates this skill. Write it " - Generalize from the specific task so the skill works for similar future scenarios, don't over-fit to this exact project - Keep real commands/code/config from the task record — these are verified to work +### No extra files +- Output ONLY the SKILL.md content. Do NOT create or reference README.md, CHANGELOG.md, INSTALLATION_GUIDE.md, CONTRIBUTING.md, or similar boilerplate files. All information belongs in SKILL.md, scripts/, or references/. + ### Language matching (CRITICAL) You MUST write the ENTIRE skill in the SAME language as the user's messages in the task record. - If the user wrote in Chinese → the skill title, description, all prose sections MUST be in Chinese @@ -57,12 +67,16 @@ DO NOT default to English. Look at the task record below and match its language. Output ONLY the complete SKILL.md content. No extra text before or after. +The frontmatter contains ONLY name and description. Nothing else. +(OpenClaw metadata such as emoji is optional — if desired, add it as a \`\` HTML comment at the very end of the file body, NOT in the frontmatter.) + --- name: "{NAME}" -description: "{A natural, proactive description. 60-120 words. Cover what it does + multiple phrasings/scenarios that should trigger it. Be pushy about triggering — list keywords, alternative descriptions, edge-case phrasings.}" -metadata: {{ "openclaw": {{ "emoji": "{emoji}" }} }} +description: "{A natural, proactive description. 60-120 words. Cover what it does + multiple phrasings/scenarios that should trigger it. Include a TRIGGER line listing keywords and indirect phrasings. Be pushy about triggering.}" --- +Name rules: 2-4 English words, kebab-case, lowercase (e.g. "docker-node-deploy", "aws-s3-backup"). This is a machine identifier. + # {Title — clear, action-oriented} {One sentence: what this skill helps you do and why it's valuable}