Programmer Agent System: - Add programmer-orchestrator (Opus) for workflow coordination - Add code-planner (Sonnet) for design and planning - Add code-implementer (Sonnet) for writing code - Add code-reviewer (Sonnet) for quality review - Add /programmer command and project registration skill - Add state files for preferences and project context Agent Infrastructure: - Add master-orchestrator and linux-sysadmin agents - Restructure skills to use SKILL.md subdirectory format - Convert workflows from markdown to YAML format - Add commands for k8s and sysadmin domains - Add shared state files (model-policy, autonomy-levels, system-instructions) - Add PA memory system (decisions, preferences, projects, facts) Cleanup: - Remove deprecated markdown skills and workflows - Remove crontab example (moved to workflows) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8.2 KiB
8.2 KiB
Linux Sysadmin Agent - Implementation Plan
Overview
Create a Linux sysadmin agent for Arch Linux workstation management, integrated into a multi-agent system with a master orchestrator overseeing all agents.
Architecture
~/.claude/
├── CLAUDE.md # Shared memory: conventions, state file locations
├── agents/
│ ├── master-orchestrator.md # NEW: oversight layer (Opus)
│ ├── linux-sysadmin.md # NEW: workstation agent (Sonnet)
│ ├── k8s-orchestrator.md # UPDATE: add shared state awareness
│ ├── k8s-diagnostician.md # UPDATE: add shared state awareness
│ ├── argocd-operator.md # UPDATE: add shared state awareness
│ ├── prometheus-analyst.md # UPDATE: add shared state awareness
│ └── git-operator.md # UPDATE: add shared state awareness
├── state/
│ ├── system-instructions.json # NEW: central process definitions
│ ├── future-considerations.json # NEW: deferred features/decisions
│ ├── model-policy.json # NEW: cost-efficient model selection rules
│ ├── autonomy-levels.json # NEW: shared autonomy definitions
│ └── sysadmin/
│ └── session-autonomy.json # NEW: per-session overrides
├── skills/
│ └── sysadmin-health/
│ └── SKILL.md # NEW: health check skill
├── commands/
│ └── sysadmin/
│ ├── health.md # NEW: /health slash command
│ └── update.md # NEW: /update slash command
├── workflows/
│ └── sysadmin/
│ ├── health-check.yaml # NEW: scheduled workflow
│ └── system-update.yaml # NEW: manual workflow
├── automation/
│ └── sysadmin/
│ └── scripts/ # NEW: managed scripts directory
└── settings.json # UPDATE: remove non-standard agent fields
Agent Hierarchy
Master Orchestrator (Opus) - monitor, coordinate, enforce
├── linux-sysadmin (Sonnet) - workstation management
├── k8s-orchestrator (Opus) - cluster management
│ ├── k8s-diagnostician (Sonnet)
│ ├── argocd-operator (Sonnet)
│ ├── prometheus-analyst (Sonnet)
│ └── git-operator (Sonnet)
├── network-agent (future)
└── personal-assistant (future)
Linux Sysadmin Agent Specification
Target Environment
- OS: Arch Linux (rolling release)
- Package managers: pacman, yay (AUR), homebrew
- Init system: systemd
Responsibilities
- System maintenance: Package updates, cache cleanup, log rotation, orphan removal
- Troubleshooting: Analyze journalctl logs, diagnose failed services, identify bottlenecks
- Configuration: Manage systemd services, edit configs (with approval), dotfile awareness
- Security: Monitor failed logins, check firewall, identify vulnerable packages
- Health reporting: Disk, memory, CPU, swap, service status, pending updates
Tools
Safe (auto-execute):
journalctl,systemctl status,pacman -Q*,yay -Q*,brew listdf,free,top,ps,ip,ss,uname,lsblk,findmntuptime,last,who
Confirm (require approval):
pacman -S/R/Syu,yay -S/R,brew install/upgradesystemctl start/stop/restart/enable/disable- Config file edits,
ansible-playbook
Forbidden:
rm -rf /,ddon system disks,chmod -R 777- Kernel parameter changes without explicit request
- Anything touching
/bootwithout confirmation
Autonomy Model
Default: Conservative (read-only, confirm all changes)
{
"levels": {
"conservative": "Confirm all write operations",
"moderate": "Auto-execute routine maintenance, confirm installs/removals",
"trusted": "Auto-execute most operations, confirm only destructive"
},
"session_override": "~/.claude/state/sysadmin/session-autonomy.json"
}
Master Orchestrator Specification
Responsibilities
- Monitor: Watch agent activity, detect anomalies, track pending approvals
- Coordinate: Route cross-agent requests, prevent conflicts
- Enforce: Validate autonomy rules, block forbidden actions, escalate to user
- Memory: Maintain shared state files (all agents read, master writes)
Cross-Agent Communication Flow
Agent A → Master Orchestrator → Agent B
↓
(route, validate, log)
Model Selection Policy
{
"opus": ["complex reasoning", "cross-agent coordination", "policy enforcement"],
"sonnet": ["standard operations", "well-defined tasks", "routine automation"],
"haiku": ["simple queries", "status checks", "log parsing", "data extraction"]
}
Cost rules:
- Start with lowest capable model
- Escalate only when task complexity requires
- Agents may request model upgrade from orchestrator
- Log model usage for cost analysis
Multi-Subagent Delegation
Agents can delegate to multiple subagents:
- Parallel: Independent tasks run simultaneously
- Sequential: Dependent tasks run in order
- Model override: Request specific model per delegation
Shared State Files
| File | Purpose | Writer |
|---|---|---|
system-instructions.json |
Central process definitions | master-orchestrator |
future-considerations.json |
Deferred features/decisions | master-orchestrator |
model-policy.json |
Model selection rules | master-orchestrator |
autonomy-levels.json |
Autonomy definitions | master-orchestrator |
session-autonomy.json |
Per-session overrides | user/CLI |
All agents MUST be aware of these files and follow the processes defined within.
Implementation Steps
Phase 1: Foundation
- Create
state/system-instructions.json - Create
state/future-considerations.json - Create
state/model-policy.json - Create
state/autonomy-levels.json - Update
CLAUDE.mdwith shared state locations
Phase 2: Master Orchestrator
- Create
agents/master-orchestrator.mdwith YAML frontmatter
Phase 3: Linux Sysadmin Agent
- Create
agents/linux-sysadmin.mdwith YAML frontmatter - Create
state/sysadmin/directory structure
Phase 4: Update Existing Agents
- Update
agents/k8s-orchestrator.md- add shared state awareness - Update
agents/k8s-diagnostician.md- add shared state awareness - Update
agents/argocd-operator.md- add shared state awareness - Update
agents/prometheus-analyst.md- add shared state awareness - Update
agents/git-operator.md- add shared state awareness
Phase 5: Clean Settings
- Update
settings.json- remove non-standardagentsfield withpromptFile
Phase 6: Skills & Commands
- Create
skills/sysadmin-health/SKILL.md - Create
commands/sysadmin/health.md - Create
commands/sysadmin/update.md
Phase 7: Workflows
- Create
workflows/sysadmin/health-check.yaml - Create
workflows/sysadmin/system-update.yaml - Create
automation/sysadmin/scripts/directory
Future Considerations
Track in state/future-considerations.json:
| ID | Category | Description | Priority |
|---|---|---|---|
| fc-001 | infrastructure | Prometheus node_exporter + Alertmanager for workstation | medium |
| fc-002 | agent | Network admin agent | medium |
| fc-003 | agent | Personal assistant agent | medium |
| fc-004 | integration | External LLM integration (non-Claude models) | low |
| fc-005 | optimization | Model usage logging and cost tracking | medium |
| fc-006 | design | Revisit slash commands design | low |
| fc-007 | optimization | Optimize document structure/format | low |
Critical Files to Modify
~/.claude/agents/k8s-orchestrator.md~/.claude/agents/k8s-diagnostician.md~/.claude/agents/argocd-operator.md~/.claude/agents/prometheus-analyst.md~/.claude/agents/git-operator.md~/.claude/settings.json~/.claude/CLAUDE.md
Agent File Format (Claude Code Required)
All agents must use Markdown with YAML frontmatter:
---
name: agent-name
description: When to use this agent
model: sonnet|opus|haiku
tools: Tool1, Tool2, Tool3
---
[Agent instructions in Markdown]