Skip to content

Automations for Devin: Devin Local hooks (ex-Windsurf) and cloud Automations #248

Backlog

Description

@vsn411

Part of #240. Builds on #242 and #241. Packaging: #227 (Windsurf/Devin rows).

Windsurf's Cascade hooks docs now live under docs.devin.ai. Devin Desktop runs Devin Local, which still imports legacy .windsurf/ rules, skills and config. This issue covers Devin Local hooks (desktop and CLI) and Devin Automations (cloud).

Devin Local hooks (checked against the docs on 2026-12-03)

Sources: Hooks overview, Lifecycle hooks, Cascade hooks.

  • Config:
    • Project: .devin/hooks.v1.json (recommended; the whole file is the hooks object), .devin/config.json / .devin/config.local.json under hooks.
    • User: ~/.config/devin/config.json (%APPDATA%\devin\config.json on Windows).
    • It also reads .claude/settings.json, .claude/settings.local.json, ~/.claude.json and ~/.claude/settings.json.
  • Events: PreToolUse (exit 2 blocks), PostToolUse, PermissionRequest, UserPromptSubmit, Stop (decision: "block" keeps going), PostCompaction, SessionStart (a block refuses the session; local only), SessionEnd.
  • No default timeout is documented, so always set one explicitly. Hooks don't run in Restricted Mode; doctor should say so.
  • Cascade's older event names (pre_write_code, post_write_code, pre_run_command, …) appear in legacy Windsurf docs. Decide whether to support the legacy .windsurf/hooks.json format for users still on older builds, or document the minimum version.

Devin Automations (cloud)

Source: Automations. Scheduled sessions are legacy: since 2026-09-24, POST …/schedules returns 403 for migrated orgs.

  • Triggers:
    • GitHub (PR, PR review, push, check run, issue, …)
    • GitLab (MR, push, pipeline, …)
    • Schedule (recurring or once)
    • Webhook (HTTP POST with a secret)
    • Slack, Teams, Linear, Jira, PagerDuty, …
    • Multiple triggers combine with OR.
  • Created via: UI (create / template / "generate with Devin"), "Schedule Devin" from a session, or Terraform (devin_automation).
  • Secrets are documented only for preflight scripts ("only the selected secrets are injected as environment variables"). MCP integrations are available from Settings → Connections.

Recipe mapping

Recipe Devin Behaviour
commit-guard PreToolUse on the shell tool → exit 2 + reason
turn-review Stop → decision: "block" with findings Loop guard from #242 (no stop_hook_active documented, so rely on secfoo's own diff-hash and count limits)
dependency-watch etc. PostToolUse, background
session-brief SessionStart
scheduled-baseline Automation with a Schedule trigger Preflight script installs secfoo, with the key as a selected secret → SECFOO_API_KEY (#241 item 4). The session runs the baseline
PR review Automation with a GitHub PR trigger Diff-scoped sast + secret-scanning on the PR, with the result as a PR comment. The run reports with trigger.event = "pull_request"

Gotchas

  • Double-firing: Devin reads Claude Code's settings files, so a Claude-format recipe fires in Devin too. Host detection and de-duplication (secfoo hook + secfoo automations: one tested entrypoint for every AI tool, recipes enabled on the fly #242) must cover it, with a fixture.
  • secfoo's devin adapter runs devin -p … --permission-mode auto for nested reviews, so the recursion guard is mandatory.
  • Check whether the secret is visible to the session itself or only to preflight. If only preflight, the preflight step must write ~/.secfoo/cloud.toml with secfoo cloud login, and the docs must say the key then sits on the session VM.

Tasks

  • hosts/devin.py + fixtures for each event (desktop and CLI)
  • enable --tool devin writes .devin/hooks.v1.json. Decide on and document legacy .windsurf support
  • Automation templates (schedule + GitHub PR) with preflight + docs. Terraform example optional
  • Verification row: Devin Desktop/CLI version, Automations run IDs, portal shows trigger.host = "devin"

Done when

The local recipes work with fixtures in CI. Both automation templates run end to end and report to the portal. Double-firing with Claude configs is tested.

Activity

  1. added
    enhancement
    help wanted
    difficulty: medium
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: mediumenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions