展示HN:一种确定性中间件,可以将LLM提示压缩50-80%。
Show HN: A deterministic middleware to compress LLM prompts by 50-80%

原始链接: https://github.com/ARPAHLS/skillware

## Skillware:AI 智能体的“应用商店” Skillware 是一个开源 Python 框架,旨在简化和标准化 AI 智能体的技能管理。它将“技能”——包括逻辑、认知、治理和接口——视为可安装的模块,类似于软件包。这使得能力与底层 AI 模型(Gemini、Claude、GPT、Llama)分离,减少了重复开发。 该框架包括核心包、按类别组织的技能注册表、创建新技能的模板以及全面的文档。技能被构建为可执行的 Python 代码,并具有标准化的 LLM 工具调用模式,确保可移植性和安全性。 Skillware 通过处理技能加载、模型适配和智能体循环来简化智能体开发。它与其他方法(如 Anthropic 的 Skills)的不同之处在于,它与模型无关、代码优先,并专注于运行时应用,而不仅仅是 IDE 配方。开发者被鼓励根据 `CONTRIBUTING.md` 文件中概述的指南贡献健壮且安全的技能。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 展示 HN:一种确定性中间件,可以将 LLM 提示压缩 50-80% (github.com/arpahls) 5 分,由 rosspeili 发表于 43 分钟前 | 隐藏 | 过去 | 收藏 | 讨论 大家好, 我正在开发 Skillware,一个将 AI 能力视为可安装、自包含模块的开源框架。 我刚刚添加了一个“提示令牌重写器”技能。它是一种离线启发式中间件,可以在长期的代理循环到达 LLM 之前,去除对话填充和冗余上下文。它可以节省大量的令牌成本和推理时间,并且是 100% 确定性的(没有额外的模型调用)。 我们正在构建一个“代理知识库”(逻辑 + 认知 + 治理)。如果您有 LLM 的专用工具,或者想了解“标准”技能的样子,我很乐意听取您的反馈或 PR:https://github.com/ARPAHLS/skillware help 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文
Skillware Logo

A Python framework for modular, self-contained skill management for machines.




Skillware is an open-source framework and registry for modular, actionable Agent capabilities. It treats Skills as installable content, decoupling capability from intelligence. Just as apt-get installs software and pip installs libraries, skillware installs know-how for AI agents.

"I know Kung Fu." - Neo

The AI ecosystem is fragmented. Developers often re-invent tool definitions, system prompts, and safety rules for every project. Skillware supplies a standard to package capabilities into self-contained units that work across Gemini, Claude, GPT, and Llama.

A Skill in this framework provides everything an Agent needs to master a domain:

  1. Logic: Executable Python code.
  2. Cognition: System instructions and "cognitive maps".
  3. Governance: Constitution and safety boundaries.
  4. Interface: Standardized schemas for LLM tool calling.

This repository is organized into a core framework, a registry of skills, and documentation.

Skillware/
├── skillware/                  # Core Framework Package
│   └── core/
│       ├── base_skill.py       # Abstract Base Class for skills
│       ├── loader.py           # Universal Skill Loader & Model Adapter
│       └── env.py              # Environment Management
├── skills/                     # Skill Registry (Domain-driven)
│   ├── category/               # e.g., finance, optimization, data_engineering
│   │   └── skill_name/         # e.g., prompt_rewriter, wallet_screening
├── templates/                  # New Skill Templates
│   └── python_skill/           # Standard Python Skill Template
├── examples/                   # Reference Implementations
│   ├── gemini_wallet_check.py  # Google Gemini Integration
│   ├── claude_wallet_check.py  # Anthropic Claude Integration
│   ├── gemini_pdf_form_filler.py
│   └── claude_pdf_form_filler.py
├── docs/                       # Comprehensive Documentation
│   ├── introduction.md         # Philosophy & Design
│   ├── usage/                  # Integration Guides
│   └── skills/                 # Skill Reference Cards
└── COMPARISON.md               # Comparison vs. Anthropic Skills / MCP

You can install Skillware directly from PyPI:

Or for development, clone the repository and install in editable mode:

git clone https://github.com/arpahls/skillware.git
cd skillware
pip install -e .

Note: Individual skills may have their own dependencies. The SkillLoader validates manifest.yaml and warns of missing packages (e.g., requests, pandas) upon loading a skill.

Create a .env file with your API keys (e.g., Google Gemini API Key):

GOOGLE_API_KEY="your_key"

3. Usage Example (Gemini)

import google.generativeai as genai
from skillware.core.loader import SkillLoader
from skillware.core.env import load_env_file

# Load Environment
load_env_file()

# 1. Load the Skill from the Registry
# The loader reads the code, manifest, and instructions automatically
skill_bundle = SkillLoader.load_skill("category/skill_name")

# 2. Model & Chat Setup
model = genai.GenerativeModel(
    'gemini-2.5-flash',
    tools=[SkillLoader.to_gemini_tool(skill_bundle)], # The "Adapter"
    system_instruction=skill_bundle['instructions']   # The "Mind"
)
chat = model.start_chat(enable_automatic_function_calling=True)

# 3. Agent Loop
# The SDK handles the loop: model -> tool call -> execution -> result -> model reply.
response = chat.send_message("Screen wallet 0xd8dA... for risks.")
print(response.text)

We are building the "App Store" for Agents and require professional, robust, and safe skills.

Please read CONTRIBUTING.md for guidelines on folder structure, manifest schemas, and safety constitutions.

Skillware differs from the Model Context Protocol (MCP) or Anthropic's Skills repository in the following ways:

  • Model Agnostic: Native adapters for Gemini, Claude, and OpenAI.
  • Code-First: Skills are executable Python packages, not just server specs.
  • Runtime-Focused: Provides tools for the application, not just recipes for an IDE.

Read the full comparison here.

For questions, suggestions, or contributions, please open an issue or reach out to us:


联系我们 contact @ memedata.com