Ready-to-use SOP templates for common business processes. Copy any template into your
project's docs/sops/ directory, adapt the inputs and agents, and run it with clos.
Category: Customer Success
Trigger: issue.created event
Agents: founding-engineer, ceo
End-to-end onboarding for a new B2B SaaS customer.
| Step | Agent | What it does | |------|-------|--------------| | Provision account | founding-engineer | Creates workspace/tenant, applies plan limits, generates onboarding token | | Send welcome email | ceo | Personalised email with portal link, walkthrough calendar, quickstart guide | | Schedule walkthrough | ceo | Confirms 30-minute product walkthrough within 3 business days | | Confirm first value | ceo | Verifies customer ran their first SOP or agent heartbeat |
Inputs: customerId (required), customerName (required), contactEmail (required), planTier (default: starter)
clos sop validate customer-onboarding --sop-dir examples/sops
clos sop run customer-onboarding \
--input customerId=acme-123 \
--input customerName="Acme Corp" \
--input contactEmail=cto@acme.com \
--sop-dir examples/sops
Category: Team Cadence Trigger: Schedule — every Monday at 09:00 UTC Agents: ceo, product-manager, founding-engineer
Monday morning sync that keeps the whole team aligned without manual coordination.
| Step | Agent | What it does | |------|-------|--------------| | Review blockers | ceo | Triages blocked items, unblocks where possible | | Roadmap progress | product-manager | Reports completed items, at-risk issues, week priorities | | Build health | founding-engineer | Runs the quality suite, reports pass/fail and coverage | | Weekly summary | ceo | Aggregates all outputs into a team-facing summary |
Inputs: weekStartDate (default: today), teamSize (default: 5)
clos sop validate weekly-team-review --sop-dir examples/sops
clos sop run weekly-team-review \
--input weekStartDate=2024-01-08 \
--sop-dir examples/sops
Category: Reliability / On-Call
Trigger: issue.created event (or manual)
Agents: founding-engineer, ceo
Structured production incident runbook. Reduces MTTR and ensures nothing gets missed under pressure.
| Step | Agent | What it does | |------|-------|--------------| | Acknowledge | founding-engineer | Confirms real incident, declares severity, starts timeline | | Triage | founding-engineer | Assesses blast radius, identifies root cause | | Mitigate | founding-engineer | Executes rollback or hotfix, verifies symptoms resolved | | Customer communication | ceo | Sends honest status update to affected users | | Post-mortem | ceo | Creates post-mortem doc, schedules blameless review in ≤5 days |
Severity levels: p1 (full outage) · p2 (partial outage) · p3 (degraded) · p4 (minor)
Inputs: incidentId (required), severity (default: p2), title (required), affectedService (required), detectedAt (default: {{ env.NOW }}), pointOfContact (default: "on-call")
clos sop validate incident-response --sop-dir examples/sops
clos sop run incident-response \
--input incidentId=INC-2024-001 \
--input severity=p2 \
--input "title=API returning 500s" \
--input affectedService=api \
--sop-dir examples/sops
Category: DevOps
Trigger: Manual (configure repo.push event trigger in YAML for automated runs)
Agents: founding-engineer, qa-engineer, ceo
Full CI/CD pipeline: build → test → deploy to staging → smoke tests → approval gate.
| Step | Agent | What it does | |------|-------|--------------| | Build | founding-engineer | Clone, install deps, run build command, record artifact ref | | Run tests | founding-engineer | Unit + integration tests, coverage metrics | | Deploy | founding-engineer | Run migrations, deploy artifact, wait for rollout | | Smoke tests | qa-engineer | Verify health endpoint, critical-path tests | | Approve/rollback | ceo | Review results, approve or initiate rollback |
Inputs: repo (required), branch (default: main), environment (default: staging), skipSmokeTests (default: false)
# Copy from examples/sops/ci-cd-pipeline.yaml into your project first, then:
clos sop validate ci-cd-pipeline --sop-dir examples/sops
clos sop run ci-cd-pipeline \
--input repo=my-org/my-service \
--input branch=main \
--input environment=staging \
--sop-dir examples/sops
Category: Engineering
Trigger: Manual (configure pr.opened event trigger in YAML for automated runs)
Agents: founding-engineer, qa-engineer, ceo
Structured code review: automated checks → technical review → security review → merge decision.
| Step | Agent | What it does | |------|-------|--------------| | Automated checks | founding-engineer | Lint, type-check, tests, dependency audit | | Technical review | founding-engineer | Architecture, correctness, readability, edge cases | | Security review | qa-engineer | Injection risks, auth, secrets, vulnerabilities | | Merge decision | ceo | Apply rules, post MERGE / REQUEST CHANGES / BLOCK |
Inputs: prUrl (required), prTitle (required), author (required), diffSize (default: medium)
# Copy from examples/sops/code-review.yaml into your project first, then:
clos sop validate code-review --sop-dir examples/sops
clos sop run code-review \
--input prUrl=https://github.com/my-org/my-repo/pull/42 \
--input prTitle="Add user auth" \
--input author=alice \
--sop-dir examples/sops
Category: DevOps
Trigger: issue.status_changed event (or manual)
Agents: founding-engineer, ceo
Pre-deployment readiness checklist: tests → dependency audit → staging health → approval gate.
| Step | Agent | What it does |
|------|-------|--------------|
| Run test suite | founding-engineer | Runs full test suite (skipped if skipTests: true) |
| Check dependencies | founding-engineer | Audit for vulnerabilities, outdated packages |
| Verify staging environment | founding-engineer | Health check, migration status, incident check |
| Approve/block | ceo | Go/no-go based on all checks |
Inputs: service (required), version (required), environment (default: staging), skipTests (default: false)
# Copy from examples/sops/deploy-check.yaml into your project first, then:
clos sop validate deploy-check --sop-dir examples/sops
clos sop run deploy-check \
--input service=api \
--input version=v1.4.2 \
--input environment=production \
--sop-dir examples/sops
Category: Example / Starter Trigger: Manual Agents: ceo
The simplest possible SOP — a single step that logs a greeting. Start here to confirm your CLI and agent setup are working.
| Step | Agent | What it does | |------|-------|--------------| | Log greeting | ceo | Logs the message provided as input (or default) |
Inputs: message (default: "Hello, ClosedLoopOS!")
# Copy from examples/sops/hello-world.yaml into your project first, then:
clos sop validate hello-world --sop-dir examples/sops
clos sop run hello-world --dry-run --sop-dir examples/sops
clos sop run hello-world --input "message=It works!" --sop-dir examples/sops
clos sop validate <sop-id> --sop-dir examples/sops
clos sop init --template scaffolds these four templates directly into your project:
clos sop init --template api-agent docs/sops/api-agent.yaml
clos sop init --template customer-onboarding docs/sops/customer-onboarding.yaml
clos sop init --template incident-response docs/sops/incident-response.yaml
clos sop init --template weekly-team-review docs/sops/weekly-team-review.yaml
For the remaining three SOPs (ci-cd-pipeline, code-review, deploy-check), copy from examples/sops/ manually (see below). The hello-world template is the same as running clos sop init without --template.
All seven SOPs (including the three above) are available as YAML files in the repo's
examples/sops/ directory. Copy the one you want into your project:
# From the repo root, or any directory with examples/sops/
cp examples/sops/<sop-id>.yaml your-project/docs/sops/<sop-id>.yaml
Or configure clos to read from examples/sops/ directly — add to .clos.config.json:
{ "sopDir": "examples/sops" }
Path note:
clos sop init --templaterequires thedocs/sops/prefix. The CLI writes to whatever path you supply; omitting it creates the file in cwd whereclos sop validateandclos sop runwill not find it.
Edit the step actions and agent.role values to match your team and tooling.
See the SOP Authoring Guide for the full YAML schema reference.
clos sop run <sop-id> --input key=value
Have a SOP that would be useful to others? Contributions welcome.
See the SOP Authoring Guide and CONTRIBUTING.md.
Good candidates: