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
35 changes: 35 additions & 0 deletions .claude/agent-manager/config/gadugi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Agent Manager Configuration for Gadugi Repository

repositories:
- name: "gadugi"
url: "https://github.com/rysweet/gadugi"
type: "github"
branch: "main"
auth:
type: "public"
priority: 1
auto_update: true
description: "Community-driven collection of reusable Claude Code agents"

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

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

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

# Agent selection
install_all_on_init: false
auto_install_categories:
- "workflow"
- "quality"
- "infrastructure"
144 changes: 125 additions & 19 deletions .claude/agents/agent-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,32 +517,138 @@ check_and_update_agents() {
setup_startup_hooks() {
echo "πŸ”— Setting up Agent Manager startup hooks..."

# Create or update Claude Code hooks configuration
local hooks_config=".claude/hooks.json"
local settings_file=".claude/settings.json"
local backup_file=".claude/settings.json.backup.$(date +%s)"

cat > "$hooks_config" << 'EOF'
# Create backup if settings.json exists
if [ -f "$settings_file" ]; then
echo "πŸ’Ύ Creating backup of existing settings.json..."
cp "$settings_file" "$backup_file"
fi

# Create default settings if file doesn't exist
if [ ! -f "$settings_file" ]; then
echo "πŸ“„ Creating new settings.json file..."
mkdir -p ".claude"
echo "{}" > "$settings_file"
fi

# Read existing settings
local existing_settings
if ! existing_settings=$(cat "$settings_file" 2>/dev/null); then
echo "⚠️ Failed to read existing settings, creating new file..."
echo "{}" > "$settings_file"
existing_settings="{}"
fi

# Validate JSON syntax
if ! echo "$existing_settings" | python3 -m json.tool >/dev/null 2>&1; then
echo "⚠️ Invalid JSON in settings.json, creating backup and recreating..."
cp "$settings_file" "$backup_file.invalid"
existing_settings="{}"
fi

# Create agent-manager hook configuration
local agent_manager_hook=$(cat << 'EOH'
{
"on_session_start": [
"matchers": {
"sessionType": ["startup", "resume"]
},
"hooks": [
{
"name": "agent-manager-check",
"command": "/agent:agent-manager",
"args": "check-and-update-agents",
"async": true,
"timeout": "60s"
}
],
"on_session_end": [
{
"name": "agent-manager-cleanup",
"command": "/agent:agent-manager",
"args": "cleanup-cache",
"async": true
"type": "command",
"command": "echo 'Checking for agent updates...' && /agent:agent-manager check-and-update-agents"
}
]
}
EOF
EOH
)

# Use Python to merge JSON preserving existing settings
python3 << PYTHON_SCRIPT
import json
import sys

try:
# Read existing settings
with open('$settings_file', 'r') as f:
settings = json.load(f)

# Ensure hooks section exists
if 'hooks' not in settings:
settings['hooks'] = {}

# Ensure SessionStart section exists
if 'SessionStart' not in settings['hooks']:
settings['hooks']['SessionStart'] = []

# Create agent-manager hook
agent_manager_hook = $agent_manager_hook

# Check if agent-manager hook already exists and remove it
settings['hooks']['SessionStart'] = [
hook for hook in settings['hooks']['SessionStart']
if not (isinstance(hook.get('hooks'), list) and
any('agent-manager check-and-update-agents' in h.get('command', '')
for h in hook.get('hooks', [])))
]

# Add the new agent-manager hook
settings['hooks']['SessionStart'].append(agent_manager_hook)

# Write updated settings
with open('$settings_file', 'w') as f:
json.dump(settings, f, indent=2)

print("βœ… Successfully updated settings.json with agent-manager hooks")

except Exception as e:
print(f"❌ Error updating settings.json: {e}")
sys.exit(1)
PYTHON_SCRIPT

local python_exit_code=$?

if [ $python_exit_code -ne 0 ]; then
echo "❌ Failed to update settings.json with Python"

# Fallback: restore backup if it exists
if [ -f "$backup_file" ]; then
echo "πŸ”„ Restoring backup..."
cp "$backup_file" "$settings_file"
fi

return 1
fi

# Validate the final JSON
if ! python3 -m json.tool "$settings_file" >/dev/null 2>&1; then
echo "❌ Generated invalid JSON, restoring backup..."
if [ -f "$backup_file" ]; then
cp "$backup_file" "$settings_file"
fi
return 1
fi

echo "βœ… Startup hooks configured"
echo "βœ… Startup hooks configured in $settings_file"
echo "πŸ’‘ Backup created at: $backup_file"

# Show the hooks section for verification
echo "πŸ“‹ Current SessionStart hooks:"
python3 -c "
import json
try:
with open('$settings_file', 'r') as f:
settings = json.load(f)
hooks = settings.get('hooks', {}).get('SessionStart', [])
if hooks:
for i, hook in enumerate(hooks):
print(f' {i+1}. {hook}')
else:
print(' No SessionStart hooks found')
except Exception as e:
print(f' Error reading hooks: {e}')
"
}
```

Expand Down
21 changes: 21 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"permissions": {
"additionalDirectories": [
"/tmp"
],
"allow": [
"Bash(awk:*)",
"Bash(cat:*)",
Expand Down Expand Up @@ -86,5 +89,23 @@
"WebFetch(domain:github.com)"
],
"deny": []
},
"hooks": {
"SessionStart": [
{
"matchers": {
"sessionType": [
"startup",
"resume"
]
},
"hooks": [
{
"type": "command",
"command": "echo 'Checking for agent updates...' && /agent:agent-manager check-and-update-agents"
}
]
}
]
}
}
91 changes: 91 additions & 0 deletions .claude/settings.json.backup.1754053101
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"permissions": {
"additionalDirectories": ["/tmp"],
"allow": [
"Bash(awk:*)",
"Bash(cat:*)",
"Bash(chmod:*)",
"Bash(cp:*)",
"Bash(curl:*)",
"Bash(diff:*)",
"Bash(echo:*)",
"Bash(find:*)",
"Bash(gh api:*)",
"Bash(gh issue create:*)",
"Bash(gh issue edit:*)",
"Bash(gh issue list:*)",
"Bash(gh issue status:*)",
"Bash(gh issue view:*)",
"Bash(gh pr checkout:*)",
"Bash(gh pr checks:*)",
"Bash(gh pr close:*)",
"Bash(gh pr comment:*)",
"Bash(gh pr create:*)",
"Bash(gh pr diff:*)",
"Bash(gh pr edit:*)",
"Bash(gh pr list:*)",
"Bash(gh pr merge:*)",
"Bash(gh pr review:*)",
"Bash(gh pr view:*)",
"Bash(gh run list:*)",
"Bash(gh run view:*)",
"Bash(gh run watch:*)",
"Bash(gh workflow run:*)",
"Bash(git add:*)",
"Bash(git branch:*)",
"Bash(git checkout:*)",
"Bash(git cherry-pick:*)",
"Bash(git commit:*)",
"Bash(git config:*)",
"Bash(git diff:*)",
"Bash(git fetch:*)",
"Bash(git log:*)",
"Bash(git ls-tree:*)",
"Bash(git merge:*)",
"Bash(git mv:*)",
"Bash(git pull:*)",
"Bash(git push:*)",
"Bash(git rebase:*)",
"Bash(git remote remove:*)",
"Bash(git reset:*)",
"Bash(git restore:*)",
"Bash(git revert:*)",
"Bash(git rm:*)",
"Bash(git status:*)",
"Bash(grep:*)",
"Bash(head:*)",
"Bash(ls:*)",
"Bash(mkdir:*)",
"Bash(mv:*)",
"Bash(node:*)",
"Bash(npm:*)",
"Bash(npx:*)",
"Bash(patch:*)",
"Bash(pip install:*)",
"Bash(pip3 install:*)",
"Bash(pipenv:*)",
"Bash(poetry install:*)",
"Bash(poetry lock:*)",
"Bash(poetry run pytest:*)",
"Bash(poetry run python3:*)",
"Bash(poetry:*)",
"Bash(pytest:*)",
"Bash(python3:*)",
"Bash(python:*)",
"Bash(sed:*)",
"Bash(sort:*)",
"Bash(tail:*)",
"Bash(tar:*)",
"Bash(touch:*)",
"Bash(uniq:*)",
"Bash(unset:*)",
"Bash(unzip:*)",
"Bash(wget:*)",
"Bash(yarn:*)",
"Bash(zip:*)",
"WebFetch(domain:docs.anthropic.com)",
"WebFetch(domain:github.com)"
],
"deny": []
}
}
25 changes: 23 additions & 2 deletions .github/Memory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AI Assistant Memory
Last Updated: 2025-08-01T14:00:00Z
Last Updated: 2025-08-01T20:30:00Z

## Current Goals
- βœ… Improve test coverage for Blarify codebase to >80% (ACHIEVED 3x improvement: 20.76% β†’ 63.76%)
Expand Down Expand Up @@ -43,7 +43,28 @@ Last Updated: 2025-08-01T14:00:00Z
- [ ] Improve tests for concept_extractor.py (currently 53.33%)
- [ ] Improve tests for documentation_graph_generator.py (currently 62.50%)

## Recent Accomplishments
## Recent Accomplishments

### Agent Manager Gadugi Sync Update (2025-08-01 20:30)
- **Successfully updated agent-manager from gadugi repository** - Agent Manager PR #39 has been merged with significant improvements
- **Enhanced agent-manager features** include:
- Improved startup hooks with robust JSON merging
- Better error handling and state persistence
- Enhanced Memory.md integration with atomic updates
- Comprehensive session integration system
- **Updated all agents** from gadugi with latest versions and enhancements
- **Registry metadata updated** to reflect latest sync timestamp (2025-08-01T20:30:00Z)
- **All workflow agents now at latest versions** ensuring optimal compatibility and features
- **Agent ecosystem fully synchronized** with centralized gadugi repository

### Agent Manager Gadugi Sync Completed (2025-08-01 16:30)
- **Successfully synced all agents from gadugi repository**
- **Cloned gadugi repository** to `.claude/agent-manager/cache/repositories/gadugi/`
- **Updated agent registry** with 8 agents from gadugi (workflow-master, orchestrator-agent, code-reviewer, code-review-response, prompt-writer, task-analyzer, worktree-manager, execution-monitor)
- **Installed all gadugi agents** to local `.claude/agents/` directory
- **Preserved local agent-manager** to maintain synchronization capabilities
- **Agent ecosystem now complete** with all workflow, quality, and productivity agents available
- **Registry tracks versions and sources** for proper dependency management

### Agent Manager PR #39 Code Review Response (2025-08-01 16:00)
- **Processed positive review feedback** for comprehensive Agent Manager implementation
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ easy/
# Important workflow checkpoints (committed for recovery)
!.github/workflow-checkpoints/

# Agent Manager cache
.claude/agent-manager/cache/repositories/
.claude/agent-manager/cache/downloaded/

Loading