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,97 +0,0 @@
# Deploy Application Workflow
A simple workflow for deploying new applications or updating existing ones.
## When to use
Use this workflow when:
- Deploying a new application to the cluster
- Updating an existing application's configuration
- Rolling out a new version of an application
## Steps
### 1. Gather Requirements
Ask the user for:
- Application name
- Container image and tag
- Namespace (default: `default`)
- Resource requirements (CPU/memory limits)
- Exposed ports
- Any special requirements (tolerations for Pi 3, etc.)
### 2. Check Existing State
Delegate to **argocd-operator** (haiku):
- Check if application already exists in ArgoCD
- If exists, get current status and version
Delegate to **k8s-diagnostician** (haiku):
- If exists, check current pod status
- Check namespace exists
### 3. Create/Update Manifests
Delegate to **git-operator** (sonnet):
- Create or update deployment manifest
- Create or update service manifest (if ports exposed)
- Create or update kustomization.yaml
- Include appropriate resource limits for Pi cluster:
```yaml
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "200m"
```
- If targeting Pi 3, add tolerations:
```yaml
tolerations:
- key: "node-type"
operator: "Equal"
value: "pi3"
effect: "NoSchedule"
```
### 4. Commit Changes
Delegate to **git-operator** (sonnet):
- Create feature branch: `deploy/<app-name>`
- Commit with message: `feat: deploy <app-name>`
- Push branch to origin
- Create pull request
**[CONFIRM]** User must approve the PR creation.
### 5. Sync Application
After PR is merged:
Delegate to **argocd-operator** (sonnet):
- Create ArgoCD application if new
- Trigger sync for the application
- Wait for sync to complete
**[CONFIRM]** User must approve the sync operation.
### 6. Verify Deployment
Delegate to **k8s-diagnostician** (haiku):
- Check pods are running
- Check no restart loops
- Verify resource usage is within limits
Report final status to user.
## Rollback
If deployment fails:
Delegate to **argocd-operator**:
- Check application history
- Propose rollback to previous version
**[CONFIRM]** User must approve rollback.

View File

@@ -0,0 +1,118 @@
name: deploy-app
description: Deploy new application or update existing one
version: "1.0"
trigger:
- manual: true
inputs:
app_name:
description: Application name
required: true
image:
description: Container image and tag
required: true
namespace:
description: Target namespace
default: "default"
ports:
description: Exposed ports (comma-separated)
required: false
pi3_compatible:
description: Add tolerations for Pi 3 node
default: false
defaults:
model: sonnet
steps:
- name: check-existing
description: Check if application already exists
parallel:
- agent: argocd-operator
model: haiku
task: |
Check if application '{{ inputs.app_name }}' exists in ArgoCD.
If exists, get current status, version, and sync state.
output: argocd_status
- agent: k8s-diagnostician
model: haiku
task: |
Check if namespace '{{ inputs.namespace }}' exists.
If app exists, check current pod status for '{{ inputs.app_name }}'.
output: k8s_status
- name: create-manifests
agent: git-operator
model: sonnet
task: |
Create or update Kubernetes manifests for '{{ inputs.app_name }}':
1. Deployment manifest with:
- Image: {{ inputs.image }}
- Namespace: {{ inputs.namespace }}
- Resource limits (Pi-optimized):
requests: {memory: "64Mi", cpu: "50m"}
limits: {memory: "128Mi", cpu: "200m"}
{% if inputs.pi3_compatible %}
- Tolerations for Pi 3 node
{% endif %}
2. Service manifest (if ports specified: {{ inputs.ports }})
3. Kustomization.yaml
Existing state:
- ArgoCD: {{ steps.check-existing.argocd_status }}
- K8s: {{ steps.check-existing.k8s_status }}
output: manifests
confirm: true
- name: commit-changes
agent: git-operator
model: sonnet
task: |
Commit the manifests to GitOps repository:
1. Create feature branch: deploy/{{ inputs.app_name }}
2. Commit with message: feat: deploy {{ inputs.app_name }}
3. Push branch to origin
4. Create pull request
output: pr_url
confirm: true
- name: sync-application
agent: argocd-operator
model: sonnet
task: |
After PR is merged:
1. Create ArgoCD application if new
2. Trigger sync for '{{ inputs.app_name }}'
3. Wait for sync to complete
4. Report sync result
output: sync_result
confirm: true
depends_on_user: "PR must be merged before continuing"
- name: verify-deployment
agent: k8s-diagnostician
model: haiku
task: |
Verify deployment of '{{ inputs.app_name }}':
- Check pods are running
- Check no restart loops
- Verify resource usage within limits
Report final deployment status.
output: verification
on_failure:
- name: propose-rollback
agent: argocd-operator
task: |
Deployment failed. Check application history and propose rollback.
confirm: true
outputs:
- pr_url
- sync_result
- verification

View File

@@ -0,0 +1,40 @@
name: cluster-daily-summary
description: Lightweight daily cluster status summary
version: "1.0"
trigger:
- schedule: "0 8 * * *" # daily at 8am
- manual: true
defaults:
model: haiku
steps:
- name: quick-status
agent: k8s-diagnostician
model: haiku
task: |
Generate a quick daily cluster status:
1. Node overview:
- kubectl get nodes -o wide
- Any nodes not Ready?
2. Pod health:
- Count of running vs non-running pods
- Any pods in CrashLoopBackOff or Error?
3. ArgoCD sync status:
- argocd app list (if available)
- Any apps OutOfSync?
4. Recent events:
- kubectl get events --sort-by='.lastTimestamp' -A | tail -10
- Any Warning events in last 24h?
Format as a brief daily digest suitable for quick review.
Keep it concise - this is a summary, not a deep dive.
output: daily_summary
outputs:
- daily_summary

View File

@@ -0,0 +1,50 @@
name: sysadmin-health-check
description: Scheduled health check for Arch Linux workstation
version: "1.0.0"
trigger:
schedule:
cron: "0 9 * * *" # Daily at 9 AM
manual: true
agent: linux-sysadmin
model: haiku # Use haiku for cost efficiency
steps:
- name: collect-metrics
description: Gather system metrics
commands:
- df -h
- free -h
- uptime
- top -bn1 | head -20
- name: check-packages
description: Check package status
commands:
- checkupdates 2>/dev/null || echo "No updates"
- yay -Qua 2>/dev/null || echo "No AUR updates"
- pacman -Qtdq 2>/dev/null || echo "No orphans"
- name: check-services
description: Check systemd services
commands:
- systemctl --failed --no-pager
- name: check-logs
description: Review recent errors
commands:
- journalctl -p err --since "24 hours ago" -n 10 --no-pager
- name: generate-report
description: Create health summary
action: summarize
format: markdown
output:
file: ~/.claude/logs/health-reports/$(date +%Y-%m-%d).md
notify:
on_warning: true
on_critical: true
autonomy: read-only # No confirmation needed for read operations

View File

@@ -0,0 +1,83 @@
name: sysadmin-system-update
description: Manual system update workflow for Arch Linux
version: "1.0.0"
trigger:
manual: true
command: /update
agent: linux-sysadmin
model: sonnet # Use sonnet for update decisions
parameters:
- name: scope
type: choice
options: [full, pacman, aur, brew]
default: full
description: Which package managers to update
- name: dry_run
type: boolean
default: false
description: Show updates without installing
steps:
- name: pre-flight
description: Pre-update checks
commands:
- df -h / # Check disk space
- pacman -Qi linux | grep Version # Current kernel version
fail_on_error: true
- name: check-updates
description: List available updates
commands:
- checkupdates
- yay -Qua
- brew outdated
condition: "{{ not dry_run }}"
- name: confirm-updates
description: Get user confirmation
action: confirm
message: "Proceed with {{ scope }} update?"
skip_if: "{{ autonomy == 'trusted' }}"
- name: update-pacman
description: Update pacman packages
commands:
- pacman -Syu --noconfirm
condition: "{{ scope in ['full', 'pacman'] }}"
requires_confirmation: true
- name: update-aur
description: Update AUR packages
commands:
- yay -Sua --noconfirm
condition: "{{ scope in ['full', 'aur'] }}"
requires_confirmation: true
- name: update-brew
description: Update Homebrew packages
commands:
- brew upgrade
condition: "{{ scope in ['full', 'brew'] }}"
requires_confirmation: true
- name: post-update
description: Post-update checks
commands:
- find /etc -name "*.pacnew" 2>/dev/null
- pacman -Qi linux | grep Version # Check if kernel updated
action: summarize
- name: reboot-check
description: Check if reboot needed
action: notify
message: "Kernel updated. Reboot recommended."
condition: "{{ kernel_updated }}"
output:
log: ~/.claude/logs/updates/$(date +%Y-%m-%d_%H%M).log
autonomy: conservative # Always confirm update operations

View File

@@ -0,0 +1,62 @@
name: validate-agent-format
description: Validate YAML frontmatter in all agent definition files
trigger:
- manual
inputs: {}
steps:
- name: scan-agent-files
description: Find all agent definition files
command: ls -1 ~/.claude/agents/*.md
- name: validate-frontmatter
description: Check each agent file for required YAML frontmatter
for_each: "{{ steps.scan-agent-files.output }}"
validation:
- name: has-frontmatter
check: "File starts with '---' delimiter"
required: true
- name: has-name-field
check: "YAML contains 'name:' field"
required: true
- name: has-description-field
check: "YAML contains 'description:' field"
required: true
- name: has-model-field
check: "YAML contains 'model:' field"
required: true
- name: has-tools-field
check: "YAML contains 'tools:' field"
required: true
- name: valid-model-value
check: "model value is one of: haiku, sonnet, opus"
required: true
- name: report-results
description: Generate validation report
output:
format: table
columns:
- file
- has_frontmatter
- has_name
- has_description
- has_model
- has_tools
- valid_model
- status
success_criteria:
- all_files_have_frontmatter: true
- all_required_fields_present: true
- all_model_values_valid: true
on_failure:
- report: List files with missing or invalid frontmatter
- suggest: Provide exact frontmatter template for each failing file