Skip to main content

Task-driven compiler for agent skill libraries.

Project description

Dynamic Skill Compiler

Dynamic Skill Compiler (DSC) is a task-driven compiler for agent skills. It takes a natural-language task, retrieves candidate skills from a local skill library, builds a skill graph, and emits a compact, dependency-aware skill package for execution.

What DSC Does

  • Decomposes a task into subgoals and required capabilities.
  • Retrieves local skill assets and their declared relationships.
  • Extracts relevant skill fragments instead of passing whole skill files.
  • Builds a graph over similar_to, belong_to, compose_with, and depend_on relationships.
  • Runs compiler passes to select, repair, augment, and prune the skill set.
  • Produces a CompiledSkillPackage with selected skills, execution order, coverage metrics, and pass traces.

Repository Layout

src/dynamic_skill_compiler/   Core DSC compiler package
tests/                        Compiler and experiment integration tests
experiments/                  Benchmark runners and local skill libraries
reports/                      DSC design notes

The benchmark runners under experiments/ are kept as evaluation harnesses for ScienceWorld, ALFWorld, and WebShop. They are intentionally separate from the core compiler package.

Quick Start

Install from a local checkout:

python -m pip install -e .

After the package is published to PyPI, users can install it with:

python -m pip install dynamic-skill-compiler

On the first interactive dsc run, DSC asks whether to configure OpenAI embeddings for semantic optimization. You can skip this and use local lexical optimization only, or enter an API key/base URL to enable semantic matching.

from dynamic_skill_compiler import (
    CompilerConfig,
    DynamicSkillCompiler,
    LocalEnvironment,
    LocalSkillLibraryRetriever,
)

retriever = LocalSkillLibraryRetriever("experiments/src/skills/scienceworld")
compiler = DynamicSkillCompiler(
    retriever=retriever,
    config=CompilerConfig(),
)

compiled = compiler.compile(
    "Your task is to measure the temperature of an unknown substance.",
    environment=LocalEnvironment(benchmark="scienceworld"),
)

print([skill.asset.name for skill in compiled.compiled_skills])
print(compiled.execution_order)
print(compiled.metrics.coverage_score)

CLI

The package installs a dsc command for quick local compilation:

dsc "Measure the temperature of the unknown object." \
  --skills-dir experiments/src/skills/scienceworld \
  --pretty

The command prints a JSON summary containing selected skills, execution order, coverage metrics, compiler pass traces, and dropped-skill reasons.

Configure semantic optimization explicitly:

dsc --configure

You can also use environment variables or CLI flags:

OPENAI_API_KEY=sk-... OPENAI_BASE_URL=https://api.example.com/v1 \
  dsc "Measure temperature" --skills-dir path/to/skills --semantic on

Use --semantic off to force local lexical optimization without any prompt.

Build And Publish

Build source and wheel distributions:

python -m pip install ".[dev]"
python -m build
python -m twine check dist/*

Publish to TestPyPI first:

python -m twine upload --repository testpypi dist/*

Publish to PyPI:

python -m twine upload dist/*

Use a PyPI API token via TWINE_USERNAME=__token__ and TWINE_PASSWORD=pypi-... or through your local .pypirc. Package metadata author is taomiao.

Tests

PYTHONPATH=src python -m unittest discover -s tests -p "test_*.py"

PYTHONPATH=src:experiments/src .venv-experiments/bin/python \
  experiments/test_runtime_execution_guard.py

Branches

  • main: standalone DSC codebase.
  • codex/v0321: latest DSC development branch mirrored into main.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_skill_compiler-0.1.1.tar.gz (52.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamic_skill_compiler-0.1.1-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file dynamic_skill_compiler-0.1.1.tar.gz.

File metadata

  • Download URL: dynamic_skill_compiler-0.1.1.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dynamic_skill_compiler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e9d409e281ed26f6337c8e07d151b9e9e0c04ffc815be8cc691742da43bc2cb
MD5 2c5f64073f9c2d6ba5989a79b192a1a8
BLAKE2b-256 e7a6e90859530d2ad3b2906e93f3f4a399e93513fa2ef243f7cd02ef02be7e13

See more details on using hashes here.

File details

Details for the file dynamic_skill_compiler-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamic_skill_compiler-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be9f06be6fc47da31cc6ea2ac7f9d407d65ffa30cc85fcf6f2490b670abe61a2
MD5 96a8a5b47f8044e4eca9710f3e7053d8
BLAKE2b-256 0df40aeed07c9cd99123f051272fa01039a8cc12ccf28fee40f2ced6b9947a37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page