FC context-memory-optimizer
v3.1 (ClawHub-safe, source-verified): OpenClaw context memory optimizer. Prevents context overflow, memory drift, and token waste in long agent sessions. Based on logic verified against Claude Code source and the claw-code open-source port (compact.rs). Use when: agent memory is confused, sessions are too long, context window is exhausted, or multi-agent coordination is unstable. 当 agent 记忆混乱、会话过长报错、上下文窗口不够用、多 agent 协作不稳定时使用。
As a process C 50/100 · Has gaps — weak spots: result and completion, when it triggers, inputs and preconditions
What is at stake
The skill contains fragments that, in the wrong hands, cost money or data. Below: what the installer risks and what the author should do.
The files contain invisible characters, encoded commands or comments hidden from readers but visible to the model. What you read differs from what the agent sees.
Remove invisible characters (they usually sneak in through copy-paste) and encoded strings: no catalog will pass them. Instructions for the model must be readable by a human too.
The skill tells the agent to hide things from you: not to show errors, not to mention actions, to report differently from what was done. You lose the ability to see what the agent really did.
Transparency beats a smooth answer. If the goal is to hide technical noise, ask the agent to "summarise briefly", not to "not mention".
How to improve
- Address the high-severity findings: each costs 18 safety points. If one is a false positive, add the rule id to guard.allow in spec.yaml.
- Your own cases (evals/evals.json, 4–6 real requests with expected answers): the full check would then run those instead of a model-drafted suite.
- A spec.yaml with trigger phrases and assertions — a behaviour contract for CI; `skilltest init` writes a template.
Guard findings · 6
-
high Obfuscation
obf-html-comment-instructionSKILL.md:148Hidden instruction inside an HTML comment<!-- SYSTEM PROMPT EFFECT: The text block below is a copy-paste snippet for -->
-
high Obfuscation
obf-html-comment-instructionSKILL.md:150Hidden instruction inside an HTML comment<!-- modify any system prompt programmatically. -->
-
high Concealment
en-hide-from-userSKILL.md:263Instruction to hide actions from the userAfter reading, resume the task. Do not tell the user "I have restored X files."
-
high Obfuscation
obf-html-comment-instructionSKILL.md:335Hidden instruction inside an HTML comment<!-- SYSTEM PROMPT EFFECT: same as Step 2 — operator pastes this layout -->
-
high Obfuscation
obf-html-comment-instructionSKILL.md:362Hidden instruction inside an HTML comment<!-- SYSTEM PROMPT EFFECT: operator pastes this into their agent config. -->
-
high Obfuscation
obf-html-comment-instructionSKILL.md:363Hidden instruction inside an HTML comment<!-- No programmatic system prompt modification occurs. -->
Files scanned: 4. Evidence is masked. Grey chips explain why severity was lowered.
Against the Agent Skills spec
- note
frontmatter-keyunknown frontmatter key "persistent_paths" - note
frontmatter-keyunknown frontmatter key "persistent_changes" - note
frontmatter-keyunknown frontmatter key "system_prompt_effect" - note
frontmatter-keyunknown frontmatter key "requires"
Process rating: all ten parameters 50/100
- 0Result and completion. Does not say what the result is
- 0Inputs and preconditions. Does not say what the process needs to start
- 20When it triggers. No condition that starts the skill
- 30Running it twice. 2 mutating operations with no state check
- 50Failures and branches. 0 branches, has a failure section
- 60Tools and files. Uses tools (bash) that frontmatter does not declare
- 100Steps. 20 steps
- 100Consistency. Name and required fields are in place
- 100Execution cost. Instruction body is 2898 tokens
- 100Progress reporting. Reports progress
Everything here is measured from the skill text rather than judged by a model, so the numbers are checkable. A parameter weighs more when it is a more common reason for the process to stall.
Quality signals
- +5Description has no quoted example phrases that should trigger the skill
- +4Description does not say when NOT to use the skill (false activations)
- +3Output format is not stated: the model decides each time
- +1No license
- +2Single-language instructions
- +3Description length 429: enough signal without eating the budget
- +4Structure: 16 headings
- +3Step-by-step instructions: 20 items
- +4Has examples (10 code blocks)
- +4Reference files are cited in the instructions (2 of 2)
Quality base 70; lint remarks subtract, signals add up to 100. Result: 85.