Skip to content

alirezarezvani/claude-skills / agent-launcher/skills/run-without-you

run-without-you

Verified

Use when a graded managed agent should run on a schedule, on an event trigger or on demand ('run it every morning'). Validates cron with cron_validator.py and builds the deployment with deployment_builder.py.

FileKindSize
README.mdmarkdown1.1 KB
SKILL.mdskill md3.6 KB
scripts/cron_validator.pyscript5.2 KB
scripts/deployment_builder.pyscript5.9 KB
scripts/next_directions_writer.pyscript3.9 KB

scripts/deployment_builder.py

View on GitHub
#!/usr/bin/env python3
"""deployment_builder.py — build a POST /v1/deployments payload (the recurring loop).

A scheduled deployment fires a fresh session on a POSIX-cron cadence ("run without
you"). initial_events MUST include a user.message; it MAY also carry a
user.define_outcome so each firing self-grades (the nested loop). Emits the
deployment payload + a BYOK curl snippet to create it and to test it once via the
manual `run` endpoint. Stdlib-only; no network calls and no key handling.

Examples:
  deployment_builder.py --sheet ./my-agent/build-sheet.json --nest-outcome --out ./my-agent/payloads/deployment.json
  deployment_builder.py --name nightly --agent-id agent_123 --env-id env_456 \
     --message "Run the audit" --cron "0 2 * * *" --timezone UTC
  deployment_builder.py --sample
"""
import argparse
import json
import sys
from pathlib import Path

# reuse cron validation from the sibling tool
sys.path.insert(0, str(Path(__file__).resolve().parent))
try:
    import cron_validator  # type: ignore
except ImportError:
    cron_validator = None


def build(name, agent_ref, env_id, message, cron, timezone, outcome):
    initial_events = [{"type": "user.message", "content": message}]
    if outcome:
        initial_events.append(outcome if outcome.get("type") == "user.define_outcome"
                              else {"type": "user.define_outcome", **outcome})
    payload = {
        "name": name,
        "agent": agent_ref,
        "environment_id": env_id,
        "initial_events": initial_events,
        "schedule": {"type": "cron", "expression": cron, "timezone": timezone or "UTC"},
    }
    return payload


def curl_snippet(name):
    return (
        "# Create the deployment (reads $ANTHROPIC_API_KEY from your env; never paste the key):\n"
        "curl -sS -X POST \"$ANTHROPIC_BASE_URL/v1/deployments\" \\\n"
        "  -H \"x-api-key: $ANTHROPIC_API_KEY\" -H \"anthropic-version: 2023-06-01\" \\\n"
        "  -H \"anthropic-beta: managed-agents-2026-04-01\" -H \"content-type: application/json\" \\\n"
        f"  -d @./my-agent/payloads/deployment.json\n"
        "# Test it ONCE before trusting the schedule (manual run):\n"
        "curl -sS -X POST \"$ANTHROPIC_BASE_URL/v1/deployments/$DEPL_ID/run\" \\\n"
        "  -H \"x-api-key: $ANTHROPIC_API_KEY\" -H \"anthropic-version: 2023-06-01\" \\\n"
        "  -H \"anthropic-beta: managed-agents-2026-04-01\"\n"
    )


def main() -> int:
    ap = argparse.ArgumentParser(description="Build a POST /v1/deployments payload (recurring cron loop).")
    ap.add_argument("--sheet", help="build-sheet.json (reads agent_name, goal, outcome, deployment.schedule).")
    ap.add_argument("--name")
    ap.add_argument("--agent-id", help="agent_... id (or use --agent-version to pin).")
    ap.add_argument("--agent-version", type=int, default=None)
    ap.add_argument("--env-id")
    ap.add_argument("--message")
    ap.add_argument("--cron")
    ap.add_argument("--timezone", default="UTC")
    ap.add_argument("--nest-outcome", action="store_true", help="Include the outcome so each firing self-grades.")
    ap.add_argument("--out")
    ap.add_argument("--json", action="store_true")
    ap.add_argument("--sample", action="store_true")
    args = ap.parse_args()

    if args.sample:
        sheet = json.loads((Path(__file__).resolve().parents[3] / "assets" / "example-build-sheet.json").read_text())
        oc = sheet["primitives"].get("outcome")
        sched = sheet["primitives"].get("deployment", {}).get("schedule", {})
        payload = build(sheet["agent_name"] + "-nightly",
                        {"type": "agent", "id": "agent_EXAMPLE"}, "env_EXAMPLE",
                        sheet["goal"], sched.get("expression", "0 9 * * *"),
                        sched.get("timezone", "UTC"),
                        {"type": "user.define_outcome", **oc} if oc else None)
        print(json.dumps(payload, indent=2))
        print("\n" + curl_snippet(payload["name"]), file=sys.stderr)
        return 0

    name = args.name
    message = args.message
    cron = args.cron
    timezone = args.timezone
    outcome = None
    agent_ref = None

    if args.sheet:
        sheet = json.loads(Path(args.sheet).read_text())
        name = name or (sheet.get("agent_name", "agent") + "-scheduled")
        message = message or sheet.get("goal", "Run the task.")
        sched = sheet.get("primitives", {}).get("deployment", {}).get("schedule", {})
        cron = cron or sched.get("expression")
        timezone = timezone if args.timezone != "UTC" else sched.get("timezone", "UTC")
        if args.nest_outcome and sheet.get("primitives", {}).get("outcome"):
            oc = sheet["primitives"]["outcome"]
            outcome = {"type": "user.define_outcome", **oc}

    if args.agent_id:
        agent_ref = {"type": "agent", "id": args.agent_id}
        if args.agent_version is not None:
            agent_ref["version"] = args.agent_version
    elif agent_ref is None:
        agent_ref = {"type": "agent", "id": "${AGENT_ID}"}

    if not (name and message and cron):
        print("Need at least --name/--message/--cron (or a --sheet supplying them).", file=sys.stderr)
        return 2

    # validate cron before emitting
    if cron_validator:
        ok, errs = cron_validator.validate_cron(cron)
        tzok, _ = cron_validator.validate_tz(timezone)
        if not ok:
            print(f"ERROR: invalid cron {cron!r}: {errs}", file=sys.stderr)
            return 1
        if not tzok:
            print(f"WARN: timezone {timezone!r} may be invalid.", file=sys.stderr)

    payload = build(name, agent_ref, args.env_id or "${ENV_ID}", message, cron, timezone, outcome)
    text = json.dumps(payload, indent=2)
    if args.out:
        Path(args.out).parent.mkdir(parents=True, exist_ok=True)
        Path(args.out).write_text(text + "\n")
        print(f"Wrote {args.out}")
        print("\n" + curl_snippet(name), file=sys.stderr)
    if args.json or not args.out:
        print(text)
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall