展示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` 文件中概述的指南贡献健壮且安全的技能。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 工作 | 提交 登录 [标记] rosspeili 1天前 | 隐藏 | 过去的 | 收藏 mikkupikku 1天前 | 下一个 [–] 只要它不删除我所有的请和谢谢,这些对我妈妈教我的很重要。 eclipticplane 1天前 | 父级 | 下一个 [–] https://github.com/ARPAHLS/skillware/blob/main/skills/optimi... 讽刺的是,它做的就只有这些。删除一些填充类型并压缩额外的空白。根本没有新意。 jmalicki 1天前 | 上一个 | 下一个 [–] README.md 并没有真正解释它是什么或我为什么需要它,只是目录结构和安装方法。 Mr_P 1天前 | 父级 | 下一个 [–] 我查看了仓库,看起来它只是 3 个正则表达式,用于删除空格或填充词:https://github.com/ARPAHLS/skillware/blob/main/skills/optimi... 指南 | 常见问题 | 列表 | 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