Description
Token-safe prompt assembly with memory orchestration. Use for any agent that needs to construct LLM prompts with memory retrieval. Guarantees no API failure due to token overflow. Implements two-phase context construction, memory safety valve, and hard limits on memory injection.
Usage Guidance
What to check before installing or using this skill:
1) Audit the code before copying it into any agent. The provided script appears truncated in the packaged file (ends with 'return ful…'), which will cause runtime errors and could be a sign of accidental corruption or tampering. Ensure the build() method returns the assembled prompt (e.g., the full_text or assembled string) and run unit tests with representative inputs.
2) Manually inspect SKILL.md for any phrases that try to change system-level prompts or inject instructions beyond assembling prompts. The scanner flagged a 'system-prompt-override' pattern — this may be a false positive, but verify that no text attempts to override or stealthily alter the agent’s system prompt or control flow.
3) Review memory storage policy for privacy implications. The skill explicitly recommends storing PII-like items (name, timezone, preferences). If you will persist memory, ensure your memory backend enforces encryption, access control, and retention/erasure policies appropriate for PII.
4) Resolve inconsistencies in token-safety settings. The SKILL.md and references disagree on recommended safety margins (0.75 vs 0.85), and the token-estimation heuristics are approximate. Decide on a single safety margin for your deployment and, if your application runs near model limits, prefer an exact BPE estimator (tiktoken or equivalent).
5) Test in a sandbox with mocked get_recent_dialog_fn and memory_search_fn to confirm behavior: ensure no unexpected network calls, no logging of sensitive content to external endpoints, and that the safety valve behaves as documented (skips memory but preserves system prompt and user input).
6) If you lack the ability to audit Python code yourself, don't deploy this into agents that handle sensitive data until a trusted reviewer has validated the implementation and fixed the truncated/broken return. After fixes, re-run static analysis and unit tests.
If you want, I can: (a) point out the exact lines in the Python file that look broken and propose a patch to fix the truncated return, (b) search the SKILL.md text for phrases that could be misused to attempt system-prompt changes, or (c) produce a minimal test harness to validate behavior safely.
Capability Analysis
Type: OpenClaw Skill
Name: prompt-assemble
Version: 1.0.4
The OpenClaw AgentSkills bundle 'prompt-assemble' is a utility designed for token-safe prompt assembly and memory orchestration for LLM agents. The `SKILL.md` instructions clearly define the skill's purpose and workflow, without any evidence of prompt injection attempts or malicious instructions for the agent. The core implementation in `scripts/prompt_assemble.py` is well-structured, uses local token estimation heuristics, and relies on functions passed as arguments for memory and dialog retrieval, without making any suspicious external network calls, accessing sensitive files, or executing arbitrary code. All components align with the stated goal of preventing token overflow and ensuring API stability, indicating a benign and well-engineered utility.