Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .claude/agent-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Agent Manager Directory Structure

This directory contains the Agent Manager's configuration, cache, and operational data.

## Directory Structure

```
.claude/agent-manager/
├── cache/
│ ├── repositories/ # Cached repository clones
│ ├── manifests/ # Cached manifest files
│ ├── agent-registry.json # Registry of available agents
│ └── metadata.json # Cache metadata and statistics
├── config/
│ └── (future: agent-specific configs)
├── logs/
│ └── (future: operation logs)
├── repos/
│ └── (future: repository metadata)
├── config.yaml # Main configuration
├── preferences.yaml # User preferences
└── README.md # This file
```

## Configuration Files

### config.yaml
Main configuration file containing:
- Repository definitions
- Update settings
- Cache configuration
- Security settings
- Logging preferences

### preferences.yaml
User-specific preferences including:
- Version preferences for specific agents
- Auto-installation categories
- Update schedules
- Conflict resolution strategies

## Cache Directory

### repositories/
Contains cloned copies of registered agent repositories for offline access and performance.

### manifests/
Cached manifest files from repositories for quick agent discovery.

### agent-registry.json
Central registry tracking:
- Available agents across all repositories
- Version information
- Installation status
- Dependencies

### metadata.json
Cache statistics and operational metadata:
- Cache size and file counts
- Last operation timestamps
- Error logs
- Performance metrics

## Usage

The Agent Manager automatically manages this directory structure. Manual modification is not recommended but the files can be inspected for troubleshooting.

For Agent Manager usage, use:
```bash
/agent:agent-manager <command>
```

See the main Agent Manager documentation for available commands and operations.
49 changes: 49 additions & 0 deletions .claude/agent-manager/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Agent Manager Configuration
# This file configures external agent repository management

repositories: []
# Example repository configurations:
# - name: "company-agents"
# url: "https://github.com/company/claude-agents"
# type: "github"
# branch: "main"
# auth:
# type: "token"
# token_env: "GITHUB_TOKEN"
# priority: 1
# auto_update: true
#
# - name: "community-agents"
# url: "https://github.com/claude-community/agents"
# type: "github"
# branch: "stable"
# auth:
# type: "public"
# priority: 2
# auto_update: false
#
# - name: "local-dev"
# url: "/path/to/local/agents"
# type: "local"
# priority: 3
# auto_update: false

settings:
# Update behavior
auto_update: true
check_interval: "24h"
update_on_startup: true

# Cache settings
cache_ttl: "7d"
max_cache_size: "100MB"
offline_mode: false

# Security settings
verify_checksums: true
allow_unsigned: false
scan_agents: true

# Logging
log_level: "info"
log_retention: "30d"
31 changes: 31 additions & 0 deletions .claude/agent-manager/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Agent Manager Documentation

This directory contains documentation for the Agent Manager sub-agent.

## Structure

```
.claude/agent-manager/
├── cache/ # Local cache for downloaded agents
├── config/ # Configuration files
├── docs/ # Documentation
├── templates/ # Configuration templates
└── tests/ # Agent-specific tests
```

## Main Documentation

The primary usage documentation is located at:
- `/docs/AGENT_MANAGER_USAGE.md` - Comprehensive usage guide

## Agent File

The agent implementation is at:
- `.claude/agents/agent-manager.md` - Main agent file

## Testing

To run agent-manager specific tests:
```bash
python .claude/agent-manager/tests/test_structure.py
```
36 changes: 36 additions & 0 deletions .claude/agent-manager/preferences.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Agent Manager User Preferences
# This file stores user-specific agent management preferences

installation:
# Preferred versions for specific agents
preferred_versions:
# workflow-master: "2.1.0" # Pin to specific version
# code-reviewer: "latest" # Always use latest

# Agent categories to auto-install
auto_install_categories:
- "development"
- "testing"

# Agents to exclude from auto-installation
excluded_agents:
# - "experimental-agent"
# - "deprecated-workflow"

# Conflict resolution preferences
conflict_resolution:
strategy: "prefer_newer" # prefer_newer, prefer_older, prompt

update:
# Update preferences
update_schedule: "daily" # daily, weekly, manual
update_categories:
- "development"
exclude_from_updates:
# - "workflow-master" # Pinned version

# Notification preferences
notifications:
update_available: true
installation_complete: true
errors_only: false
69 changes: 69 additions & 0 deletions .claude/agent-manager/tests/test_structure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env python3
"""
Simple structural tests for Agent Manager sub-agent.

These tests validate that the agent-manager file exists and has proper structure.
"""

import os
import unittest
from pathlib import Path


class TestAgentManagerStructure(unittest.TestCase):
"""Test the Agent Manager sub-agent file structure."""

def setUp(self):
"""Set up test environment."""
self.agent_manager_root = Path(__file__).parent.parent
self.agent_file = self.agent_manager_root.parent / 'agents' / 'agent-manager.md'

def test_agent_manager_file_exists(self):
"""Test that agent-manager.md exists in the correct location."""
self.assertTrue(self.agent_file.exists(),
f"Agent manager file not found at {self.agent_file}")

def test_agent_manager_has_frontmatter(self):
"""Test that agent-manager.md has proper YAML frontmatter."""
with open(self.agent_file, 'r') as f:
content = f.read()

# Check for YAML frontmatter
self.assertTrue(content.startswith('---\n'),
"Agent file should start with YAML frontmatter")

# Find end of frontmatter
frontmatter_end = content.find('\n---\n', 4)
self.assertGreater(frontmatter_end, 0,
"YAML frontmatter should be properly closed")

# Check required fields in frontmatter
frontmatter = content[4:frontmatter_end]
required_fields = ['name:', 'description:', 'required_tools:']

for field in required_fields:
self.assertIn(field, frontmatter,
f"Frontmatter missing required field: {field}")

def test_agent_manager_directory_structure(self):
"""Test that agent-manager directory has expected structure."""
expected_dirs = ['cache', 'config', 'templates', 'tests', 'docs']

for dir_name in expected_dirs:
dir_path = self.agent_manager_root / dir_name
self.assertTrue(dir_path.exists() and dir_path.is_dir(),
f"Expected directory not found: {dir_name}")

def test_configuration_templates_exist(self):
"""Test that configuration template files exist."""
templates_dir = self.agent_manager_root / 'templates'
expected_templates = ['config.yaml.template', 'preferences.yaml.template']

for template in expected_templates:
template_path = templates_dir / template
self.assertTrue(template_path.exists(),
f"Template file not found: {template}")


if __name__ == '__main__':
unittest.main()
Loading