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