---
name: "smolagents-lightweight-python-agents"
description: "Run code-writing agents that execute Python logic directly instead of serial JSON actions."
metadata:
  author: "HuggingFace"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create smolagents codeagent"
  - "run python action agent"
  - "use duckduckgo tool smolagents"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# HuggingFace Smolagents Minimalist Code Agents

Implements HuggingFace smolagents (CodeAgent, ToolCallingAgent): expressing agent actions directly as executable Python code snippets, simplifying complex loops and data transformations.

## When to Invoke
Invoke this skill whenever you need to:
- create smolagents codeagent
- run python action agent
- use duckduckgo tool smolagents

## Execution SOP & Rules
1. Initialize agents using agent = CodeAgent(tools=[...], model=HfApiModel()).
2. Write custom tools as standard Python functions decorated with @tool.
3. Review generated Python code in sandboxed execution environments to maintain security.
4. Inspect execution logs and tool call outputs using agent.run(prompt).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
