Skip to content

Conversation

@Yo-sure
Copy link
Contributor

@Yo-sure Yo-sure commented Nov 28, 2025

Summary

Closes #506

Moves SkillsMiddleware from deepagents-cli to the core deepagents package.
This improves code reusability and allows the Skills system to be used in various environments.


Changes

File Change
deepagents/middleware/skills.py ✨ New file - logic moved from CLI
deepagents/middleware/__init__.py Added SkillsMiddleware export
deepagents-cli/skills/*.py Re-export from core (backward compatibility)
tests/unit_tests/test_middleware.py Added 17 tests

Usage

from deepagents.middleware import SkillsMiddleware

agent = create_deep_agent(
    model=model,
    middleware=[
        SkillsMiddleware(
            skills_dir="~/.myapp/skills",
            assistant_id="my-agent",
            project_skills_dir="./.skills",  # optional
        )
    ],
)

Design Decisions

Export Scope

  • deepagents/__init__.py: No changes
  • deepagents.middleware: Only SkillsMiddleware exposed
  • deepagents.middleware.skills: Full API (list_skills, SkillMetadata, etc.)

Backward Compatibility

All existing CLI import paths and behaviors are preserved:

from deepagents_cli.skills import SkillsMiddleware  # Still works (re-export)
  • CLI usage: Existing paths (~/.deepagents/{AGENT_NAME}/skills/) unchanged
  • Core direct usage: Paths can be freely specified

Testing

Unit Tests

  • Core Skills tests: 17 added (78 total passed)
  • CLI Skills tests: 25 passed
pytest tests/unit_tests/test_middleware.py  # 78 passed

Integration Tests (Actual Operation Verified)

  • ✅ Core: DeepAgent + SkillsMiddleware + LLM call
  • ✅ Core: User skills + Project skills + Override behavior
  • ✅ CLI: deepagents skills list (User + Project)
  • ✅ CLI: Actual LLM call (User + Project skills recognized)
Pasted image 20251129020831

NO CLI (Core)

Pasted image 20251129020131

CLI

Pasted image 20251129020708

Checklist

Closes langchain-ai#506

- Move SkillsMiddleware from deepagents-cli to core deepagents package
- Add re-exports in CLI for backward compatibility
- Add 17 unit tests for skills functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to use skills in custom agent base on deepagents (non-cli version)

1 participant