lab-agent-skills-design

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

Claude AI Agent with Skills Architecture

A demonstration of modern AI agent design patterns using Claude API with a modular skills system, persistent memory, and security-first principles.

🎯 Purpose

This project showcases:

  • Agentic AI Design: Modular skill system with progressive disclosure
  • Production Patterns: Structured prompts, memory management, and error handling
  • Security Best Practices: Least privilege, context minimization, and input validation
  • Clean Architecture: Separation of concerns between agent core, skills, and memory

🏗️ Architecture

agent.py              # Main agent loop with Claude integration
├── prompts/
│   └── system.txt    # System prompt with skill discovery
├── skills/
│   ├── powershell.py # PowerShell execution skill
│   └── examples/
│       ├── SKILL.md      # Skill metadata & instructions
│       ├── reference.md  # Technical reference (loaded on-demand)
│       └── security.md   # Security boundaries
└── memory/
    └── short_term.json   # Conversation history & context

🚀 Quick Start

  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Configure API key:

    cp .env.example .env
    # Add your ANTHROPIC_API_KEY to .env
    
  3. Run the agent:

    python agent.py
    

💡 Key Features

Modular Skills System

  • Skills are self-contained Python modules
  • Progressive disclosure: Load detailed context only when needed
  • Clear metadata (name, description, parameters)

Memory Management

  • Short-term memory for conversation context
  • Persistent storage between sessions
  • Automatic memory pruning to stay within token limits

Security-First Design

  • Explicit security boundaries per skill
  • Input validation and sanitization
  • Audit logging for sensitive operations
  • Principle of least privilege

📚 Skills Overview

PowerShell Skill

Execute PowerShell commands with safety guardrails:

  • Whitelist of allowed commands
  • Output sanitization
  • Execution timeout
  • Error handling and logging

🎓 Learning Outcomes

This project demonstrates:

  • ✅ Working with Claude API (Anthropic SDK)
  • ✅ Prompt engineering with tool use
  • ✅ Modular software architecture
  • ✅ Security considerations in AI systems
  • ✅ Production-ready error handling
  • ✅ Documentation best practices

🔒 Security Considerations

  • Skills operate with minimal permissions
  • No external network access unless explicitly authorized
  • All user inputs are validated
  • Sensitive data is never logged
  • Skills include security.md defining boundaries

📝 License

MIT License - Free for learning and demonstration purposes

👤 Author

Created as a portfolio demonstration of AI agent architecture and Python best practices.


This is a demonstration project designed to showcase technical skills for potential employers.

Security Focus

  • Least privilege
  • Context minimization
  • Trusted content only

Resources

f52fbcd677b74b19ed210fb411f6b1469fba8da5