Implement programmer agent system and consolidate agent infrastructure

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>
This commit is contained in:
OpenCode Test
2025-12-29 13:23:42 -08:00
parent 119d2a464e
commit 431e10b449
62 changed files with 3572 additions and 539 deletions

View File

@@ -1,64 +0,0 @@
# Cluster Status
Get a quick health overview of the Raspberry Pi Kubernetes cluster.
## Usage
```
/cluster-status
```
## What it does
Invokes the k8s-orchestrator to provide a comprehensive cluster health overview by delegating to specialized agents.
## Steps
1. **Node Health** (k8s-diagnostician, haiku)
- Get all node statuses
- Check for any conditions (MemoryPressure, DiskPressure)
- Report resource usage per node
2. **Active Alerts** (prometheus-analyst, haiku)
- Query Alertmanager for firing alerts
- List alert names and severity
3. **ArgoCD Status** (argocd-operator, haiku)
- List all applications
- Report sync status (Synced/OutOfSync)
- Report health status (Healthy/Degraded)
4. **Summary** (k8s-orchestrator, sonnet)
- Aggregate findings
- Produce overall health rating
- Recommend actions if issues found
## Output Format
```
Cluster Status: [Healthy/Degraded/Critical]
Nodes:
| Node | Status | CPU | Memory | Conditions |
|--------|--------|------|--------|------------|
| pi5-1 | Ready | 45% | 68% | OK |
| pi5-2 | Ready | 32% | 52% | OK |
| pi3 | Ready | 78% | 89% | MemPressure|
Active Alerts: [count]
- [FIRING] AlertName - description
ArgoCD Apps:
| App | Sync | Health |
|-----------|----------|-----------|
| homepage | Synced | Healthy |
| api | OutOfSync| Degraded |
Recommendations:
- [action if needed]
```
## Options
- `--full` - Run the complete cluster-health-check workflow
- `--quick` - Just node and pod status (faster)

View File

@@ -1,83 +0,0 @@
# Deploy Application
Deploy a new application or update an existing one on the Raspberry Pi Kubernetes cluster.
## Usage
```
/deploy <app-name>
/deploy <app-name> --image <image:tag>
/deploy <app-name> --update
```
## What it does
Guides you through deploying an application using the GitOps workflow with ArgoCD.
## Interactive Mode
When run without full arguments, the skill will ask for:
1. **Application name** - Name for the deployment
2. **Container image** - Full image path with tag
3. **Namespace** - Target namespace (default: default)
4. **Ports** - Exposed ports (comma-separated)
5. **Resources** - Memory/CPU limits (defaults provided for Pi)
6. **Pi 3 compatible?** - Whether to add tolerations for Pi 3 node
## Quick Deploy
```
/deploy myapp --image ghcr.io/user/myapp:latest --namespace apps --port 8080
```
## Steps
1. **Check existing state** - See if app exists, current status
2. **Generate manifests** - Create deployment, service, kustomization
3. **Create PR** - Push to GitOps repo, create PR
4. **Sync** - After PR merge, trigger ArgoCD sync
5. **Verify** - Confirm pods are running
## Resource Defaults (Pi-optimized)
```yaml
# Standard workload
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "200m"
# Lightweight (Pi 3 compatible)
requests:
memory: "32Mi"
cpu: "25m"
limits:
memory: "64Mi"
cpu: "100m"
```
## Examples
### Deploy new app
```
/deploy homepage --image nginx:alpine --port 80 --namespace web
```
### Update existing app
```
/deploy api --update --image api:v2.0.0
```
### Deploy to Pi 3
```
/deploy lightweight-app --image app:latest --pi3
```
## Confirmation Points
- **[CONFIRM]** Creating PR in GitOps repo
- **[CONFIRM]** Syncing ArgoCD application
- **[CONFIRM]** Rollback if deployment fails

View File

@@ -1,124 +0,0 @@
# Diagnose Issue
Investigate and diagnose problems in the Raspberry Pi Kubernetes cluster.
## Usage
```
/diagnose <issue-description>
/diagnose pod <pod-name> -n <namespace>
/diagnose app <argocd-app-name>
/diagnose node <node-name>
```
## What it does
Invokes the k8s-orchestrator to investigate issues by coordinating multiple specialist agents.
## Diagnosis Types
### General Issue
```
/diagnose "my app is returning 503 errors"
```
The orchestrator will:
1. Identify relevant resources
2. Check pod status and logs
3. Query relevant metrics
4. Analyze ArgoCD sync state
5. Provide diagnosis and recommendations
### Pod Diagnosis
```
/diagnose pod myapp-7d9f8b6c5-x2k4m -n production
```
Focuses on:
- Pod status and events
- Container logs (current and previous)
- Resource usage vs limits
- Restart history
- Related alerts
### ArgoCD App Diagnosis
```
/diagnose app homepage
```
Focuses on:
- Sync status and history
- Health status of resources
- Diff between desired and live state
- Recent sync errors
### Node Diagnosis
```
/diagnose node pi5-1
```
Focuses on:
- Node conditions
- Resource pressure
- Running pods count
- System events
- Disk and network status
## Investigation Flow
```
User describes issue
┌─────────────────┐
│ k8s-orchestrator│ ─── Analyze issue, plan investigation
└────────┬────────┘
┌────┼────┬────────┐
▼ ▼ ▼ ▼
┌──────┐┌──────┐┌──────┐┌──────┐
│diag- ││argo- ││prom- ││git- │
│nosti-││cd- ││etheus││opera-│
│cian ││oper- ││analy-││tor │
│ ││ator ││st ││ │
└──┬───┘└──┬───┘└──┬───┘└──┬───┘
│ │ │ │
└───────┴───────┴───────┘
┌─────────────────┐
│ k8s-orchestrator│ ─── Synthesize findings
└────────┬────────┘
Diagnosis + Recommendations
```
## Output Format
```
Diagnosis for: [issue description]
Status: [Investigating/Identified/Resolved]
Findings:
1. [Finding with evidence]
2. [Finding with evidence]
Root Cause:
[Explanation of what's causing the issue]
Evidence:
- [Relevant log lines or metrics]
- [Command outputs]
Recommended Actions:
- [SAFE] Action that can be auto-applied
- [CONFIRM] Action requiring approval
- [INFO] Suggestion for manual follow-up
Severity: [Low/Medium/High/Critical]
```
## Options
- `--verbose` - Include full command outputs
- `--logs` - Focus on log analysis
- `--metrics` - Focus on metrics analysis
- `--quick` - Fast surface-level check only

View File

@@ -0,0 +1,43 @@
---
name: k8s-quick-status
description: Quick cluster health pulse check
model: haiku
---
# K8s Quick Status Skill
Performs a lightweight health pulse check on the Raspberry Pi Kubernetes cluster.
## Checks Performed
### Node Status
- Node readiness (`kubectl get nodes`)
- Node conditions (MemoryPressure, DiskPressure, PIDPressure)
### Pod Health
- Unhealthy pods (`kubectl get pods -A --field-selector=status.phase!=Running`)
- High restart counts (pods with >5 restarts)
### Recent Events
- Warning events in last hour (`kubectl get events -A --field-selector=type=Warning --sort-by='.lastTimestamp'`)
### ArgoCD Status
- Application sync status (`argocd app list`)
- Any OutOfSync or Degraded apps
## Output Format
Report as structured summary with:
- Overall status (healthy/warning/critical)
- Node summary table
- Unhealthy pods list (if any)
- ArgoCD app status
- Immediate concerns (if any)
## Autonomy
This skill is read-only and can run without confirmation.
## When to Use
Use this skill for a quick pulse check. For comprehensive analysis with metrics and detailed recommendations, use the `/cluster-status` command which invokes the full `cluster-health-check` workflow.

View File

@@ -0,0 +1,69 @@
---
name: programmer-add-project
description: Register a new project with the programmer agent system
---
# Add Project to Programmer Agent
Register a new project for context-aware code development.
## Gather Information
Collect from the user:
1. **Project path**: Absolute path to project root
2. **Project name**: Short identifier (used for filename)
3. **Description**: What the project does (1-2 sentences)
4. **Tech stack**: Languages, frameworks, databases
5. **Conventions**: Path to conventions file or brief description
## Validate
Before creating:
1. Verify the path exists: `ls <path>`
2. Check for existing project file: `~/.claude/state/programmer/projects/<name>.json`
3. Look for conventions file if path provided
## Create Project File
Write to `~/.claude/state/programmer/projects/<name>.json`:
```json
{
"path": "/absolute/path/to/project",
"description": "Description of the project",
"stack": ["language", "framework", "database"],
"conventions": "See CONTRIBUTING.md or brief description",
"recentWork": [],
"activeTodos": [],
"created": "YYYY-MM-DD"
}
```
## Output
Confirm to user:
```markdown
## Project Registered
- **Name**: project-name
- **Path**: /path/to/project
- **Stack**: language, framework
- **Config**: `~/.claude/state/programmer/projects/project-name.json`
The programmer agent will now use this context when working in this project.
```
## Example Interaction
User: "Add my inventory-api project"
Agent:
1. Ask for project path
2. Ask for description
3. Ask for tech stack
4. Look for CONTRIBUTING.md or conventions
5. Create project file
6. Confirm registration

View File

@@ -0,0 +1,51 @@
---
name: sysadmin-health
description: Run comprehensive health check on Arch Linux workstation
model: haiku
---
# Sysadmin Health Check Skill
Performs a comprehensive health check on the local Arch Linux workstation.
## Checks Performed
### System Resources
- Disk usage (`df -h`)
- Memory usage (`free -h`)
- Swap usage
- CPU load (`uptime`)
- Top processes by resource usage
### Package Status
- Pending pacman updates (`checkupdates`)
- AUR updates available (`yay -Qua`)
- Orphaned packages (`pacman -Qtdq`)
- Package cache size (`du -sh /var/cache/pacman/pkg`)
### Service Status
- Failed systemd services (`systemctl --failed`)
- Key services status (NetworkManager, sshd, etc.)
### User Timers (Claude Automation)
- Active user timers (`systemctl --user list-timers`)
- Failed user services (`systemctl --user --failed`)
- Recent timer runs (`journalctl --user -u k8s-agent-health-check --since "24 hours ago" -n 5`)
### Security
- Recent failed login attempts (`journalctl -u sshd --since "24 hours ago" | grep -i failed`)
- Last logins (`last -n 5`)
### Logs
- Recent errors in journal (`journalctl -p err --since "24 hours ago" -n 20`)
## Output Format
Report as structured summary with:
- Overall health status (healthy/warning/critical)
- Issues found (if any)
- Recommended actions
## Autonomy
This skill is read-only and can run without confirmation.