Operation File Reference

Schema reference for .ai-dlc/{intent}/operations/*.md operation spec files

This is the complete reference for operation spec files — the Markdown files that define operational tasks in AI-DLC.

File Location

.ai-dlc/{intent}/operations/{name}.md

The filename (minus .md) serves as the operation identifier and must match the name field in frontmatter.

Frontmatter Schema

All operation specs use YAML frontmatter with the following fields:

FieldTypeRequiredDescription
namestringyesOperation identifier, must match filename
typeenumyesscheduled, reactive, or process
ownerenumyesagent or human
schedulestringconditionalCron expression (required for scheduled type)
triggerstringconditionalCondition expression (required for reactive type)
frequencystringconditionalHuman-readable cadence (required for process type)
runtimeenumnonode, python, go, or shell — per-operation override of stack default

Type-Specific Required Fields

  • Scheduled operations must have schedule
  • Reactive operations must have trigger
  • Process operations must have frequency

Body Content

The Markdown body serves different purposes depending on ownership:

Agent-owned: Describes what the companion script does — its logic, expected behavior, and any constraints. This serves as documentation and context for the AI when executing.

Human-owned: Contains a checklist that /operate presents to the human. Use standard Markdown task list syntax:

- [ ] Step one
- [ ] Step two
- [ ] Final verification

Companion Files

Agent-owned operations can have companion files in the same directory:

FilePurpose
{name}.tsTypeScript implementation
{name}.pyPython implementation
{name}.goGo implementation
{name}.shShell script implementation
{name}.deploy.yamlGenerated deployment manifest

The runtime (set per-operation or via stack config) determines which companion file is executed. Only one implementation file is expected per operation.

Status Schema

Operation status is tracked in .ai-dlc/{intent}/state/operation-status.json. Each operation has an entry keyed by name:

{
  "operations": {
    "operation-name": {
      "last_run": "2026-03-15T00:00:00Z",
      "last_presented": "2026-03-14T10:30:00Z",
      "status": "on-track",
      "last_exit_code": 0,
      "last_output": "Rotated 3 secrets successfully",
      "deployed": true,
      "deploy_target": "k8s-cronjob"
    }
  }
}

Status Fields

FieldTypeDescription
last_runISO-8601 or nullTimestamp of last execution
last_presentedISO-8601 or nullTimestamp of last time presented to human (process type)
statusenumon-track, needs-attention, failed, pending, or torn-down
last_exit_codenumber or nullExit code from last agent execution
last_outputstring or nullFirst 2000 characters of last execution output
deployedbooleanWhether the operation is currently deployed
deploy_targetenumk8s-cronjob, k8s-deployment, github-actions, docker-compose, systemd, or none

Complete Examples

Scheduled Agent Operation

<!-- .ai-dlc/auth-system/operations/rotate-secrets.md -->
---
name: rotate-secrets
type: scheduled
owner: agent
schedule: "0 0 1 * *"
runtime: node
---

Rotate API keys and database credentials on the first of each month.

1. List all secrets due for rotation from the secrets provider
2. Generate new credentials via provider API
3. Update the secrets store with new values
4. Verify connectivity using the new credentials
5. Revoke the old credentials
6. Log rotation summary to audit trail

With companion script rotate-secrets.ts in the same directory.

Reactive Agent Operation

<!-- .ai-dlc/api-service/operations/scale-on-load.md -->
---
name: scale-on-load
type: reactive
owner: agent
trigger: "p99_latency > 200ms for 5m"
runtime: shell
---

Scale API replicas when sustained high latency is detected.

1. Query current replica count and resource utilization
2. Compute target replicas based on request rate and latency
3. Apply scaling via kubectl (capped at 20 replicas)
4. Wait for rollout to complete
5. Verify latency has returned to acceptable levels

With companion script scale-on-load.sh in the same directory.

Process Human Operation

<!-- .ai-dlc/platform/operations/quarterly-security-review.md -->
---
name: quarterly-security-review
type: process
owner: human
frequency: quarterly
---

- [ ] Run dependency audit (`npm audit` / `pip audit`)
- [ ] Review OWASP top 10 against current endpoints
- [ ] Check certificate expiration dates
- [ ] Review IAM roles and permissions for least privilege
- [ ] Verify backup restoration process
- [ ] Update threat model if architecture changed
- [ ] Document findings and file tickets for remediation

When invoked with /operate platform quarterly-security-review, the checklist is presented for the human to work through. Progress is tracked in the status file.

Next Steps