skills/forge-automation/SKILL.md
[writes] Manage event-driven pipeline automations. Use when you want to set up automatic pipeline triggers — run Forge on CI failures, PR events, cron schedules, or file changes. List, add, remove, and test automations. Trigger: /forge-automation, automate pipeline, run on schedule, trigger on CI failure, auto-run on push
npx skillsauth add quantumbitcz/dev-pipeline forge-automationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manage event-driven pipeline automations configured in forge-config.md. Full contract: shared/automations.md.
See shared/skill-contract.md for the standard exit-code table.
Before any action, verify:
git rev-parse --show-toplevel 2>/dev/null. If fails: report "Not a git repository." and STOP..claude/forge.local.md exists. If not: report "Forge not initialized. Run /forge-init first." and STOP..claude/forge-config.md exists. If not: report "No forge-config.md found. Run /forge-init to generate." and STOP.Parse $ARGUMENTS for subcommand:
list (default if no argument) — show all configured automationsadd — interactive wizard to create a new automationremove — select and remove an existing automationtest <name> — simulate a trigger for the named automationlog — show recent automation log entriesRead .claude/forge-config.md and parse the automations: YAML array.
If the array is empty or missing: report "No automations configured. Use /forge-automation add to create one." and STOP.
Display as a table:
## Configured Automations
| # | Name | Trigger | Action | Filter | Cooldown | Enabled |
|---|------|---------|--------|--------|----------|---------|
| 1 | ci-failure-fix | ci_failure | forge-fix | branch: main | 30m | yes |
| 2 | pr-review | pr_opened | forge-review | base_branch: main | 5m | yes |
| 3 | scheduled-health | cron | codebase-health | cron: 0 3 * * 1 | 1440m | yes |
For each automation, show the filter as a compact key: value summary (multiple filters comma-separated). Show enabled as "yes" or "no" (default "yes" if field is absent).
Use AskUserQuestion for each required field in sequence:
Step 1 — Trigger type:
Ask: "What event should trigger this automation?"
Options:
cron — Run on a schedule (cron expression)ci_failure — Run when CI fails (requires GitHub Actions workflow)pr_opened — Run when a PR is opened (requires GitHub Actions workflow)dependabot_pr — Run when Dependabot opens a PR (requires GitHub Actions workflow)linear_status — Run when a Linear ticket changes status (requires Linear MCP)file_changed — Run when a file matching a pattern is edited (PostToolUse hook)Step 2 — Action:
Ask: "Which forge skill should this automation invoke?"
Options (list the most common, allow free text):
forge-fix — Auto-fix the issueforge-review — Review changed filescodebase-health — Full codebase analysis (read-only)security-audit — Run security scannersforge-run — Full pipelineforge-recover diagnose — Read-only diagnosticStep 3 — Filter:
Based on the selected trigger type, ask for the relevant filter fields per shared/automations.md Filter Fields by Trigger table:
| Trigger | Prompt |
|---------|--------|
| cron | "Enter cron expression (5-field, e.g. 0 3 * * 1 for Monday 3 AM):" |
| ci_failure | "Filter to branch (glob, e.g. main, release/*; leave blank for all):" then "Filter to workflow filename (e.g. ci.yml; leave blank for all):" |
| pr_opened | "Filter to base branch (e.g. main; leave blank for all):" then "Exclude authors (comma-separated logins, e.g. dependabot[bot]; leave blank for none):" |
| dependabot_pr | "Filter to base branch (leave blank for all):" then "Dependency type (production or development; leave blank for all):" |
| linear_status | "From status (e.g. In Progress; leave blank for any):" then "To status (e.g. Done):" |
| file_changed | "File glob pattern (e.g. src/**/*.ts):" then "Exclusion glob (leave blank for none):" |
Step 4 — Cooldown:
Ask: "Cooldown in minutes between consecutive firings (minimum 1):"
Default suggestion based on trigger type: cron = 1440, ci_failure = 30, pr_opened = 5, dependabot_pr = 10, linear_status = 15, file_changed = 5.
Step 5 — Name:
Ask: "Automation name (unique identifier, e.g. nightly-health, ci-fix-main):"
Validate: name must be unique among existing automations. If duplicate, ask again.
Step 6 — Confirm:
Display the complete automation definition as YAML and ask: "Add this automation to forge-config.md?"
On confirmation, append the new entry to the automations: array in .claude/forge-config.md. If the automations: key does not exist, create it with the new entry. Preserve all other content in the file.
If the trigger is cron, also register it via CronCreate with the cron expression. Report success.
If the trigger is ci_failure, pr_opened, or dependabot_pr, remind the user: "This trigger requires a GitHub Actions workflow. See shared/automations.md CI Integration section for the workflow template."
AskUserQuestion: "Which automation do you want to remove?" with each automation name as an option.automations: array in .claude/forge-config.md. Preserve all other content.cron, note: "If a cron job was registered for this automation, it remains active until the session ends. Use /schedule to manage active cron jobs."Simulate what would happen if a trigger fires for the named automation, without actually dispatching the skill.
$ARGUMENTS (e.g. /forge-automation test ci-failure-fix).forge-config.md. If not found: report "Automation '{name}' not found." and STOP.enabled: false: report "Automation '{name}' is disabled. It would not fire." and STOP..forge/automation-log.jsonl (if it exists) for the most recent entry with automation == name and result in (success, failure). Compute elapsed time since ts.
cooldown_minutes: report "COOLDOWN ACTIVE. {remaining} minutes remaining. Trigger would be dropped with result: skipped_cooldown."cooldown_minutes: report "Cooldown clear.".forge/automation-log.jsonl with result == "success" and no corresponding completion (heuristic: entries within the last 10 minutes without a subsequent entry for the same automation). If >= 3: report "CONCURRENT LIMIT. 3 automations already running. Trigger would queue."forge-run, forge-fix, deep-health, migration), note: "This is a destructive action. Would pause for user confirmation before executing."## Trigger Simulation: {name}
| Check | Result |
|-------|--------|
| Enabled | yes/no |
| Cooldown | clear / active ({remaining}m remaining) |
| Concurrency | ok / queued (3/3 slots in use) |
| Safety gate | none / would require confirmation |
**Would execute:** `{action}` with trigger context from `{trigger}` type.
**Would NOT actually dispatch.** Use the real trigger mechanism to execute.
Read .forge/automation-log.jsonl. If missing or empty: report "No automation log entries. Automations have not fired yet." and STOP.
Parse each line as JSON. Display the most recent 20 entries (newest first):
## Automation Log (last 20 entries)
| Timestamp | Automation | Trigger | Action | Result | Duration |
|-----------|------------|---------|--------|--------|----------|
| 2026-04-12 03:00 | scheduled-health | cron | codebase-health | success | 45.2s |
| 2026-04-12 02:15 | ci-failure-fix | ci_failure | forge-fix | skipped_cooldown | - |
Format duration_ms as seconds with one decimal. Omit duration for skipped entries (show -). Truncate timestamp to minutes.
If entries have error field (non-null), append a section:
### Recent Errors
- **{automation}** ({ts}): {error}
/schedule to manage cron jobs manually."add and remove modify forge-config.md. All other subcommands are read-only.test subcommand simulates only. Actual dispatch is handled by the automation engine (hooks/automation_trigger.py)..forge/automation-log.jsonl. That file is append-only, written by the automation engine.forge-config.md, only modify the automations: section. Never alter other configuration./forge-run -- The pipeline that automations typically invoke/forge-fix -- Common action for CI failure automations/forge-review -- Common action for PR opened automations/forge-review -- Common action for scheduled health check automations/forge-verify --config -- Validate forge-config.md after modifying automationsdevelopment
[writes] Build, fix, deploy, review, or modify code in this project. Universal entry for the forge pipeline. Auto-bootstraps on first run; brainstorms before planning when given a feature description. Use when you want to take any productive action: implementing features, fixing bugs, reviewing branches, deploying, committing, running migrations.
tools
[writes] Manage forge state and configuration: recovery, abort, config edits, session handoff, automations, playbooks, output compression, knowledge graph maintenance. Use when you need to recover from broken pipeline state, edit settings, or manage long-lived state.
development
[writes] Create, list, show, resume, or search forge session handoffs. Use when context is getting heavy and you want to transfer a forge run or conversation into a fresh Claude Code session, or to resume from a prior handoff artefact. Subcommands - no args (write), list, show, resume, search.
development
[writes] Manage the Neo4j knowledge graph. Subcommands: init, rebuild (writes); status, query <cypher>, debug (read-only). Requires Docker. No default — an explicit subcommand is required. Use when setting up the graph for the first time, rebuilding after major refactors, checking graph health, or running ad-hoc Cypher diagnostics.