What the agent does
The agent clones the repository into its own cloud sandbox and reads how Applications are declared before it adds a project. In a repository like argoproj/argocd-example-apps, apps/ is a Helm chart (Chart.yaml names it applications, version 0.1.0) whose single template, templates/applications.yaml, ranges over the applications list in values.yaml and emits one Application per entry, named example.<name>, in the argocd namespace unless the entry says otherwise, with project: default unless the entry sets one, and a syncPolicy of automated with prune and selfHeal plus CreateNamespace=true. Only the four app-any-ns entries name a project (team-frontend, team-backend, team-platform), and applicationset/README.md says those AppProjects must exist with sourceNamespaces configured, yet no AppProject manifest exists anywhere in the repository. Every other example, including helm-guestbook with its values-production.yaml, blue-green and sock-shop, syncs automatically from the default project at any hour.
The agent adds the projects in the same chart so the app-of-apps creates them: a projects list in apps/values.yaml and a new apps/templates/projects.yaml that renders one AppProject per entry with sourceRepos, destinations, sourceNamespaces for the team projects, and syncWindows. A production project gets an allow window with a cron schedule, a duration, a timeZone and applications: ['*'], and a deny window over the weekend, both with manualSync: true so an operator can still sync by hand during an incident; the three team projects get the sourceNamespaces the ApplicationSet examples need. The entries that stand in for production, helm-guestbook, blue-green and sock-shop, get project: production in values.yaml. Each AppProject carries an argocd.argoproj.io/sync-wave: "-1" annotation so the app-of-apps applies projects before the Applications that reference them, and the apps Application itself stays in default.
An AppProject that does not list an Application's repoURL under sourceRepos or its server and namespace under destinations makes Argo CD refuse that Application, so the agent cross-checks every rendered Application against its rendered AppProject: the repoURL and targetRevision from the chart's config values, the destination server, and the namespace each entry defaults to its own name. It also adds a short section to README.md on which examples now sync only inside the window and how argocd app sync behaves against a closed window with manualSync on.
To check the result without a cluster the agent runs helm template apps/ in the sandbox and reads the rendered AppProject and Application documents, then validates them with kubeconform against the Argo CD CRD schemas fetched from the argoproj/argo-cd manifests, so a misspelled syncWindows key or a bad cron fails in the sandbox rather than at sync time. Nothing is applied to a cluster and the run pushes nothing to one.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Add Argo CD sync windows. Read apps/Chart.yaml, apps/values.yaml, apps/templates/applications.yaml and applicationset/README.md first. Add a projects list to apps/values.yaml and a templates/projects.yaml that renders one AppProject per entry with sourceRepos, destinations and, where set, sourceNamespaces and syncWindows. Create a production project with an allow window from 09:00 for 8 hours on weekdays in Europe/Berlin and a deny window covering Saturday and Sunday, both with manualSync true, and team-frontend, team-backend and team-platform projects with sourceNamespaces matching their names. Move helm-guestbook, blue-green and sock-shop to the production project and keep the apps Application in default. Add a sync-wave annotation so projects apply before Applications, check that every Application's repoURL and destination are allowed by its project, run helm template on apps/ and kubeconform with the Argo CD CRD schemas, document the windows in README.md, and open a pull request.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
What comes back is a pull request that adds apps/templates/projects.yaml, changes apps/values.yaml with the projects list and three project: lines, and adds a section to README.md. The description shows each window as a small table of kind, schedule, duration and time zone, lists which Applications moved to production, and pastes the helm template excerpt for one AppProject together with the kubeconform summary.
The run's record keeps every rendered document and the schema check, so a reviewer can read the exact AppProject the app-of-apps will create without rendering the chart locally.
Before merging, a reviewer checks the window hours against the team's real deploy practice, confirms the Argo CD installation reconciles AppProject resources from the app-of-apps and has the applicationsetcontroller.namespaces setting the team projects assume, and decides whether selfHeal should stay on for production Applications, since a closed window also blocks the automated repair of drift.
Run it on every new Application added to the app-of-apps
In the console, an automation in the Project that has the repository, with a github trigger on pull_request.opened and pull_request.synchronize and branch_patterns for your default branch, starts one run per pull request with the pull request as its context. The prompt tells the run to look for an entry added to apps/values.yaml with no project, assign it to the project its namespace implies, confirm the project's sourceRepos and destinations allow it, and push the change to the pull request's branch.
From your own server, the same work is one POST /o/{org}/sessions per GitOps repository with this body and the repository in resources, with a request_id that is a UUID v5 of the repository name so a retry returns the run already started. A webhook URL on the API key reports run.completed with the session_url to read the pull request link from.
The use case this job follows, with its automation and trigger: Hand off a long task.
Why run it on Rush?
Sync windows are easy to write and easy to get silently wrong: a deny window with a cron that never matches, a project whose destinations omit the namespace an Application defaults to, a project applied after the Application that names it. Each mistake shows up as a stuck or refused Application on a real cluster. The agent renders the chart, cross-checks every Application against its project and validates the result against the CRD schemas before the pull request exists, with the rendered documents in the run for the reviewer.
The sandbox is its own computer with helm and kubeconform installed for the job, and a platform team with one app-of-apps repository per cluster can start one run per repository at once, each with its own windows and its own pull request.
Frequently asked questions
Can an operator still deploy during an incident?
Yes. Both windows set manualSync: true, so argocd app sync and the Sync button work while automated syncs wait for the window. The README section the pull request adds says exactly that, so nobody discovers it mid-incident.
Why put the AppProjects in the apps chart instead of a separate directory?
Because the app-of-apps Application already applies everything the chart renders, so projects arrive through the same sync as the Applications that reference them. The sync-wave annotation orders them. A separate directory would need its own Application and a manual first apply on every new cluster.
Does a closed window also stop selfHeal?
It does. Outside an allow window, or inside a deny window, Argo CD performs no automated sync at all, including the one that repairs drift when selfHeal is on. The pull request points this out for the production project so the reviewer can decide whether to keep selfHeal or widen the window.
Does the run need access to the Argo CD server or the cluster?
No. It renders the chart with helm template and validates the documents with kubeconform against the CRD schemas in its sandbox. Whether the installation reconciles AppProjects from the app-of-apps and allows ApplicationSets in team namespaces is for the reviewer to confirm.