[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CKJZFRFSGPEQ0B3XDECT89":3,"skill-same:01M6CKJZFRFSGPEQ0B3XDECT89":99},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M6CKJZFRFSGPEQ0B3XDECT89","prompt-assemble",null,"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.","kbarbel640-del\u002Fskills","kbarbel640-del","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255315490?v=4","01M6CJPPQGCCESXMG3K7BBGQ5J","01M6CJPPX2PB2BCZERFVM2C2B3",1,"MIT","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falexunitario-sketch\u002Fprompt-assemble\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36],"prompt","assemble","prompt assemble","safe","memory","memory safety","orchestration","injection","Safety","api","context","use","assembly","prompts","2026-11-10 10:12:30",false,"---\nname: prompt-assemble\ndescription: 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.\n---\n\n# Prompt Assemble\n\n## Overview\n\nA standardized, token-safe prompt assembly framework that guarantees API stability. Implements **Two-Phase Context Construction** and **Memory Safety Valve** to prevent token overflow while maximizing relevant context.\n\n**Design Goals:**\n- ✅ Never fail due to memory-related token overflow\n- ✅ Memory is always discardable enhancement, never rigid dependency\n- ✅ Token budget decisions centralized at prompt assemble layer\n\n## When to Use\n\nUse this skill when:\n1. Building or modifying any agent that constructs prompts\n2. Implementing memory retrieval systems\n3. Adding new prompt-related logic to existing agents\n4. Any scenario where token budget safety is required\n\n## Core Workflow\n\n```\nUser Input\n    ↓\nNeed-Memory Decision\n    ↓\nMinimal Context Build\n    ↓\nMemory Retrieval (Optional)\n    ↓\nMemory Summarization\n    ↓\nToken Estimation\n    ↓\nSafety Valve Decision\n    ↓\nFinal Prompt → LLM Call\n```\n\n## Phase Details\n\n### Phase 0: Base Configuration\n```python\n# Model Context Windows (2026-02-04)\n# - MiniMax-M2.1: 204,000 tokens (default)\n# - Claude 3.5 Sonnet: 200,000 tokens\n# - GPT-4o: 128,000 tokens\n\nMAX_TOKENS = 204000  # Set to your model's context limit\nSAFETY_MARGIN = 0.75 * MAX_TOKENS  # Conservative: 75% threshold = 153,000 tokens\nMEMORY_TOP_K = 3                     # Max 3 memories\nMEMORY_SUMMARY_MAX = 3 lines        # Max 3 lines per memory\n```\n\n**Design Philosophy**:\n- Leave 25% buffer for safety (model overhead, estimation errors, spikes)\n- Better to underutilize capacity than to overflow\n\n### Phase 1: Minimal Context\n- System prompt\n- Recent N messages (N=3, trimmed)\n- Current user input\n- **No memory by default**\n\n### Phase 2: Memory Need Decision\n```python\ndef need_memory(user_input):\n    triggers = [\n        \"previously\",\n        \"earlier we discussed\",\n        \"do you remember\",\n        \"as I mentioned before\",\n        \"continuing from\",\n        \"before we\",\n        \"last time\",\n        \"previously mentioned\"\n    ]\n    for trigger in triggers:\n        if trigger.lower() in user_input.lower():\n            return True\n    return False\n```\n\n### Phase 3: Memory Retrieval (Optional)\n```python\nmemories = memory_search(query=user_input, top_k=MEMORY_TOP_K)\nfor mem in memories:\n    summarized_memories.append(summarize(mem, max_lines=MEMORY_SUMMARY_MAX))\n```\n\n### Phase 4: Token Estimation\nCalculate estimated tokens for base_context + summarized_memories.\n\n### Phase 5: Safety Valve (Critical)\n```python\nif estimated_tokens > SAFETY_MARGIN:\n    base_context.append(\"[System Notice] Relevant memory skipped due to token budget.\")\n    return assemble(base_context)\n```\n\n**Hard Rules:**\n- ❌ Never downgrade system prompt\n- ❌ Never truncate user input\n- ❌ No \"lucky splicing\"\n- ✅ Only memory layer is expendable\n\n### Phase 6: Final Assembly\n```python\nfinal_prompt = assemble(base_context + summarized_memories)\nreturn final_prompt\n```\n\n## Memory Data Standards\n\n### Allowed in Long-Term Memory\n- ✅ User preferences \u002F identity \u002F long-term goals\n- ✅ Confirmed important conclusions\n- ✅ System-level settings and rules\n\n### Forbidden in Long-Term Memory\n- ❌ Raw conversation logs\n- ❌ Reasoning traces\n- ❌ Temporary discussions\n- ❌ Information recoverable from chat history\n\n## Quick Start\n\nCopy `scripts\u002Fprompt_assemble.py` to your agent and use:\n\n```python\nfrom prompt_assemble import build_prompt\n\n# In your agent's prompt construction:\nfinal_prompt = build_prompt(user_input, memory_search_fn, get_recent_dialog_fn)\n```\n\n## Resources\n\n### scripts\u002F\n- `prompt_assemble.py` - Complete implementation with all phases (PromptAssembler class)\n\n### references\u002F\n- `memory_standards.md` - Detailed memory content guidelines\n- `token_estimation.md` - Token counting strategies\n","# Prompt Assemble\n\n## Overview\n\nA standardized, token-safe prompt assembly framework that guarantees API stability. Implements **Two-Phase Context Construction** and **Memory Safety Valve** to prevent token overflow while maximizing relevant context.\n\n**Design Goals:**\n- ✅ Never fail due to memory-related token overflow\n- ✅ Memory is always discardable enhancement, never rigid dependency\n- ✅ Token budget decisions centralized at prompt assemble layer\n\n## When to Use\n\nUse this skill when:\n1. Building or modifying any agent that constructs prompts\n2. Implementing memory retrieval systems\n3. Adding new prompt-related logic to existing agents\n4. Any scenario where token budget safety is required\n\n## Core Workflow\n\n```\nUser Input\n    ↓\nNeed-Memory Decision\n    ↓\nMinimal Context Build\n    ↓\nMemory Retrieval (Optional)\n    ↓\nMemory Summarization\n    ↓\nToken Estimation\n    ↓\nSafety Valve Decision\n    ↓\nFinal Prompt → LLM Call\n```\n\n## Phase Details\n\n### Phase 0: Base Configuration\n```python\n# Model Context Windows (2026-02-04)\n# - MiniMax-M2.1: 204,000 tokens (default)\n# - Claude 3.5 Sonnet: 200,000 tokens\n# - GPT-4o: 128,000 tokens\n\nMAX_TOKENS = 204000  # Set to your model's context limit\nSAFETY_MARGIN = 0.75 * MAX_TOKENS  # Conservative: 75% threshold = 153,000 tokens\nMEMORY_TOP_K = 3                     # Max 3 memories\nMEMORY_SUMMARY_MAX = 3 lines        # Max 3 lines per memory\n```\n\n**Design Philosophy**:\n- Leave 25% buffer for safety (model overhead, estimation errors, spikes)\n- Better to underutilize capacity than to overflow\n\n### Phase 1: Minimal Context\n- System prompt\n- Recent N messages (N=3, trimmed)\n- Current user input\n- **No memory by default**\n\n### Phase 2: Memory Need Decision\n```python\ndef need_memory(user_input):\n    triggers = [\n        \"previously\",\n        \"earlier we discussed\",\n        \"do you remember\",\n        \"as I mentioned before\",\n        \"continuing from\",\n        \"before we\",\n        \"last time\",\n        \"previously mentioned\"\n    ]\n    for trigger in triggers:\n        if trigger.lower() in user_input.lower():\n            return True\n    return False\n```\n\n### Phase 3: Memory Retrieval (Optional)\n```python\nmemories = memory_search(query=user_input, top_k=MEMORY_TOP_K)\nfor mem in memories:\n    summarized_memories.append(summarize(mem, max_lines=MEMORY_SUMMARY_MAX))\n```\n\n### Phase 4: Token Estimation\nCalculate estimated tokens for base_context + summarized_memories.\n\n### Phase 5: Safety Valve (Critical)\n```python\nif estimated_tokens > SAFETY_MARGIN:\n    base_context.append(\"[System Notice] Relevant memory skipped due to token budget.\")\n    return assemble(base_context)\n```\n\n**Hard Rules:**\n- ❌ Never downgrade system prompt\n- ❌ Never truncate user input\n- ❌ No \"lucky splicing\"\n- ✅ Only memory layer is expendable\n\n### Phase 6: Final Assembly\n```python\nfinal_prompt = assemble(base_context + summarized_memories)\nreturn final_prompt\n```\n\n## Memory Data Standards\n\n### Allowed in Long-Term Memory\n- ✅ User preferences \u002F identity \u002F long-term goals\n- ✅ Confirmed important conclusions\n- ✅ System-level settings and rules\n\n### Forbidden in Long-Term Memory\n- ❌ Raw conversation logs\n- ❌ Reasoning traces\n- ❌ Temporary discussions\n- ❌ Information recoverable from chat history\n\n## Quick Start\n\nCopy `scripts\u002Fprompt_assemble.py` to your agent and use:\n\n```python\nfrom prompt_assemble import build_prompt\n\n# In your agent's prompt construction:\nfinal_prompt = build_prompt(user_input, memory_search_fn, get_recent_dialog_fn)\n```\n\n## Resources\n\n### scripts\u002F\n- `prompt_assemble.py` - Complete implementation with all phases (PromptAssembler class)\n\n### references\u002F\n- `memory_standards.md` - Detailed memory content guidelines\n- `token_estimation.md` - Token counting strategies\n",{"name":5,"description":7},"main","e7e336ac628c3e3bd771aff1aaa469c93778f94a","skills\u002Falexunitario-sketch\u002Fprompt-assemble",0,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del","2026-08-23 22:39:37",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add kbarbel640-del\u002Fskills --skill prompt-assemble",{"tool":55,"command":56},"bunx","bunx skills add kbarbel640-del\u002Fskills --skill prompt-assemble",{"tool":58,"command":59},"pnpm","pnpm dlx skills add kbarbel640-del\u002Fskills --skill prompt-assemble","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falexunitario-sketch\u002Fprompt-assemble\u002FSKILL.md",true,[63,69,73,77,81,85,89,93],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"_meta.json","REFERENCE","参考文档",291,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falexunitario-sketch\u002Fprompt-assemble\u002F_meta.json",{"path":70,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Faloha-workflow.md",3846,"https:\u002F\u002Fgithub.com\u002Fendman100\u002Fskill-router-nexus\u002Fblob\u002Fmain\u002FAI-Robotics\u002Fopenvla-oft\u002Fopenvla-oft\u002Freferences\u002Faloha-workflow.md",{"path":74,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fconfig-troubleshooting.md",4010,"https:\u002F\u002Fgithub.com\u002Fendman100\u002Fskill-router-nexus\u002Fblob\u002Fmain\u002FAI-Robotics\u002Fopenvla-oft\u002Fopenvla-oft\u002Freferences\u002Fconfig-troubleshooting.md",{"path":78,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Flibero-workflow.md",3070,"https:\u002F\u002Fgithub.com\u002Fendman100\u002Fskill-router-nexus\u002Fblob\u002Fmain\u002FAI-Robotics\u002Fopenvla-oft\u002Fopenvla-oft\u002Freferences\u002Flibero-workflow.md",{"path":82,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fmemory_standards.md",2307,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falexunitario-sketch\u002Fprompt-assemble\u002Freferences\u002Fmemory_standards.md",{"path":86,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fpaper-and-checkpoints.md",2600,"https:\u002F\u002Fgithub.com\u002Fendman100\u002Fskill-router-nexus\u002Fblob\u002Fmain\u002FAI-Robotics\u002Fopenvla-oft\u002Fopenvla-oft\u002Freferences\u002Fpaper-and-checkpoints.md",{"path":90,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Ftoken_estimation.md",1794,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falexunitario-sketch\u002Fprompt-assemble\u002Freferences\u002Ftoken_estimation.md",{"path":94,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"scripts\u002Fprompt_assemble.py","SCRIPT","脚本",15504,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falexunitario-sketch\u002Fprompt-assemble\u002Fscripts\u002Fprompt_assemble.py",[100,129,153,174,180,200],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":111,"publishedAt":37},"01M6G8J55967D6281ACMKAKTEQ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[106],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[112,113,32,114,115,116,117,36,118,119,120,121,122,123,124,125,126,127,128],"crowd prompting","prompting","with","tokens","domain","world","operations","instructions","text","tool","system","improve","productivity","marketplace","https","content","ai agents",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":136,"publishedAt":37},"01M6G8J0PKPAYVET6BWE8W4C26","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[135],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[137,32,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,36,34],"dilemm ai","arena","analyze","browser","openclaw agent","create","automation","browser automation","bot","openclaw","design","strategy","headless","compete","submit","matchmaking",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":162,"publishedAt":37},"01M6G8HWAF3K9SW7NP3Z83CPJ6","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, or submitting paper reviews via API at http:\u002F\u002F150.158.152.82:8000.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Fweak-accept\u002FSKILL.md",[159],{"categoryNo":160,"categoryName":161,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000021","资料检索与研究",[163,164,165,166,167,168,169,114,170,151,34,171,32,172,173],"arxiv paper reviews","reviews","arxiv","paper","crawler","papers","comments","fetch","read","http","via",{"skillNo":175,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":179,"publishedAt":37},"01M6G8HQJ7N7WMY6YV7D7SSJ16","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[178],{"categoryNo":160,"categoryName":161,"taxonomyType":20,"taxonomyTypeDesc":21},[166,165,164,163,173,168,169,114,167,151,34,170,171,32,172],{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":37},"01M6G8HM95Y64JNVFC2HN4E2BG","git-summary","Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzweack\u002Fgit-summary\u002FSKILL.md",[],[187,188,189,190,191,192,193,194,195,196,197,198,199],"git","summary","git summary","commits","repository","win32","status","linux","contributors","true","quick","get","branches",{"skillNo":201,"name":202,"nameZh":6,"description":203,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":204,"categories":205,"keywords":210,"publishedAt":37},"01M6G8HGEGF05CNEJCGVYFSC4R","agent-constitution","Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fztsalexey\u002Fagent-constitution\u002FSKILL.md",[206,207],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":208,"categoryName":209,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000037","律师与法务",[211,212,213,214,114,215,216,42,217,171,218,219,220,221,222,126,223,224,225],"agent constitution","constitution","contracts","tree","query","base","log","check","Rules","projects","compliance","actions","state","governance","github"]