Skip to content

feat: add Devin (Cognition AI) as a gstack host (Phase 1 + Phase 2)#1

Draft
louisCalderon888 wants to merge 5 commits into
mainfrom
devin/1777864006-add-devin-host
Draft

feat: add Devin (Cognition AI) as a gstack host (Phase 1 + Phase 2)#1
louisCalderon888 wants to merge 5 commits into
mainfrom
devin/1777864006-add-devin-host

Conversation

@louisCalderon888
Copy link
Copy Markdown
Owner

@louisCalderon888 louisCalderon888 commented May 4, 2026

Summary

Adds Devin (Cognition AI) as a first-class gstack host — same drop-in pattern as Codex, Factory, OpenCode. After this lands, any project that commits a .cognition/skills/gstack-*/ directory gets the full gstack skill set (review, qa, ship, investigate, office-hours, design-shotgun, …) discoverable from any Devin session as /review, /qa, /ship, @skills:office-hours, etc.

This PR contains Phase 1 (host registration + skill regeneration) and Phase 2 (devin_mcp sub-sessions + Knowledge Notes for gbrain). Phase 3 (enter_test_mode + recording_* integration for /qa and /design-review) is tracked separately in docs/DEVIN.md.

Phase 1 — Host registration + Agent Skills generation

  • hosts/devin.ts — typed HostConfig. Frontmatter allowlist (name, description, argument-hint, allowed-tools), conditional triggers: ["user"] for sensitive skills (careful, freeze, guard, unfreeze), Devin co-author trailer (devin-ai-integration[bot]@users.noreply.github.com), Devin-tuned boundary instruction naming the seven scanned dirs explicitly.
  • hosts/index.ts — register devin in ALL_HOST_CONFIGS + re-export.
  • setup--host devin runs bun run gen:skill-docs --host devin and symlinks ~/.cognition/skills/gstack-* for local Devin CLI users. --local --host devin is the canonical flow (commits .cognition/skills/ into the user's repo so Devin VM sessions discover them on clone). --host auto detects devin on PATH alongside claude/codex/factory/opencode/kiro.
  • docs/DEVIN.md (new) — full architecture walkthrough, generated-skill table, list of skipped skills with rationale, phased roadmap.
  • AGENTS.md — multi-agent support table now lists Devin alongside Codex/Factory/etc with a pointer to docs/DEVIN.md.
  • .gitignore — exclude .cognition/ from the gstack source tree (it's a generated output dir, on par with .agents/ / .factory/ / .opencode/).
  • Tests — bumped host-config.test.ts host-count assertion 10 → 11 and extended the setup --host validation regression in gen-skill-docs.test.ts to include devin.

42 of the existing skills regenerate cleanly for Devin (root + 41 sub-skills with gstack- prefix). Phase 2 adds a 43rd Devin-only skill (/devin-setup).

Phase 2 — devin_mcp sub-sessions + Knowledge Notes (NEW)

Re-enables the 7 resolvers Phase 1 left suppressed and ports them to Devin's primitives:

Resolver Phase 1 on Devin Phase 2 on Devin
DESIGN_OUTSIDE_VOICES suppressed spawn child Devin session via devin_mcp devin_session_create (skill-specific prompts for plan-design-review / design-review / design-consultation)
ADVERSARIAL_STEP suppressed spawn child Devin session as adversarial reviewer; findings flow back into the same Fix-First pipeline
CODEX_SECOND_OPINION suppressed spawn child Devin session as second-opinion advisor (office-hours Startup/Builder mode preserved verbatim)
CODEX_PLAN_REVIEW suppressed spawn child Devin session as outside-voice plan reviewer with cross-model tension handling
REVIEW_ARMY suppressed parallel dispatch via single devin_session_create call with N session specs (one per specialist), parent polls each child via devin_session_interact action="get", JSON finding schema preserved
GBRAIN_CONTEXT_LOAD suppressed search Knowledge Notes via devin_mcp devin_knowledge_manage action="list" with pinned_repo filter
GBRAIN_SAVE_RESULTS suppressed persist results via devin_knowledge_manage action="create" with per-skill triggers (office-hours, investigate, plan-ceo-review, retro, plan-eng-review, ship, cso, design-consultation)

Helpers live in scripts/resolvers/devin-helpers.ts:

  • devinSubSessionBlock(p) — generic child-session orchestration prose
  • devinKnowledgeLoadBlock(p) — pre-skill Knowledge Notes search with skill-specific keyword extraction
  • devinKnowledgeSaveBlock(p) — post-skill persistence with per-skill metadata mapping
  • devinPlanReviewBlock(p) — plan-review variant of devinSubSessionBlock
  • isDevinHost(ctx) — convenience helper

hosts/devin.ts: suppressedResolvers is now [] (resolvers branch on ctx.host === 'devin'). The comment block documents how to re-suppress an individual resolver if a future Devin variant lacks sub-session permissions.

New skill: /devin-setup (Devin-only). One-shot workspace wiring (run once per repo). Skipped from all other hosts via generation.skipSkills. Steps: verify devin_mcp reachability, derive repo identifier, register /ship + /land-and-deploy as Devin Playbooks via devin_playbook_manage create (with dedup-check), seed ETHOS.md + AGENTS.md as Knowledge Notes pinned to the repo, optional weekly /health schedule via devin_schedule_manage. Replaces /setup-gbrain for Devin.

Skills still skipped on Devin (generation.skipSkills)

Skill Why Status
/codex Wraps codex exec. Devin uses the CODEX_SECOND_OPINION resolver branch instead — child Devin session is the second opinion. The /codex slash skill itself stays skipped because it's a Claude → Codex wrapper. covered by Phase 2 resolver
/pair-agent Pairs OpenClaw/Codex with the gstack browser sidebar over an ngrok tunnel. Devin already has a native browser/computer tool. out of scope
/setup-gbrain Cross-machine memory sync. Replaced by /devin-setup + Knowledge Notes. replaced

Review & Testing Checklist for Human

This PR is yellow (host adaptation, no behavior changes to Claude/Codex/Factory). 5 items to verify end-to-end:

  • Sanity-check hosts/devin.ts against hosts/codex.ts and hosts/factory.ts — pathRewrites, frontmatter allowlist, install.linkingStrategy. Confirm suppressedResolvers: [] is intentional (Phase 2 — resolvers branch on ctx.host === 'devin'). Spot-check the if (isDevinHost(ctx)) branches in review.ts, design.ts, gbrain.ts, review-army.ts — they MUST emit prose only (no behavior changes for non-Devin hosts).
  • From a fresh clone, run bun run gen:skill-docs --host devin and confirm 43 skills emit (gstack root + 41 prefixed + 1 new gstack-devin-setup). Then run bun run gen:skill-docs --host claude and confirm devin-setup/SKILL.md is not generated (Devin-only).
  • Run ./setup --host devin --local inside any other project repo and confirm .cognition/skills/gstack-*/SKILL.md lands with valid Agent Skills frontmatter (no voice triggers array, only triggers: ["user"] on sensitive skills).
  • Open a Devin session against a repo with .cognition/skills/gstack-*/ committed and run /devin-setup. Confirm devin_playbook_manage create succeeds for /ship and /land-and-deploy (or skip with "already registered" if dedup-check matches), and devin_knowledge_manage create succeeds for ETHOS.md and AGENTS.md pinned to the repo. Then run /office-hours on a real product idea — confirm pre-skill Knowledge Notes search runs, outside voice spawns a child Devin session, and post-skill Knowledge Note is created with the documented trigger.
  • Verify bun test test/host-config.test.ts test/gen-skill-docs.test.ts shows no new failures vs. main. 449 pass / 4 fail — the 4 failures are pre-existing baseline issues (golden-file regression > Claude ship, golden-file regression > Factory ship, gen-skill-docs > plan-review preamble budget, host-config-export.ts CLI > detect finds claude — fails when claude is not on PATH).

Notes

Why a separate scan path (.cognition/) instead of .agents/? Devin scans seven dirs at session start: .agents/, .github/, .claude/, .cursor/, .codex/, .cognition/, .windsurf/ (each as <dir>/skills/<name>/SKILL.md). gstack already writes to .agents/skills/ for the Codex sidecar. Writing Devin output to .cognition/skills/ lets --host all generate both Codex-formatted and Devin-formatted skills on the same repo without collision. Single-host Devin users can override localSkillRoot to .agents/skills/gstack if they prefer.

Phased rollout: Phase 1 (this PR) — host registration, skill regeneration, setup integration, docs. Phase 2 (this PR) — devin_mcp sub-sessions for cross-model resolvers, Knowledge Notes for gbrain memory, /devin-setup for Playbook + Knowledge Note seeding. Phase 3 (tracked in docs/DEVIN.md) — enter_test_mode + recording_* integration for /qa and /design-review to deliver video as proof-of-test.

Link to Devin session: https://app.devin.ai/sessions/2e94641ce54c4170badf46f8d8878727
Requested by: @louisCalderon888

Phase 1 (MVP) — registers Devin as a typed host so 'bun run gen:skill-docs --host devin'
emits Agent Skills-compatible SKILL.md files into .cognition/skills/gstack-*/, the
canonical scan path for Devin's remote VM session bootstrap.

What landed:
- hosts/devin.ts — frontmatter allowlist (name, description, argument-hint,
  allowed-tools), conditional triggers: ["user"] for sensitive skills (careful,
  freeze, guard, unfreeze), Devin co-author trailer, Devin-tuned boundary
  instruction, suppressors for claude -p / gbrain / codex-second-opinion resolvers.
- hosts/index.ts — register devin in ALL_HOST_CONFIGS and re-export.
- setup — accept --host devin, generate .cognition/skills via gen:skill-docs,
  --local --host devin emits skills directly into the user's repo (the canonical
  install pattern for a Devin VM workflow), --host auto detects 'devin' on PATH.
- docs/DEVIN.md — full architecture walkthrough, phased roadmap, skill table.
- AGENTS.md — multi-agent support table now lists Devin alongside Codex/Factory/etc.
- .gitignore — exclude .cognition/ from the gstack source tree (it's a generated
  output dir, on par with .agents/ / .factory/ / .opencode/).
- test/host-config.test.ts — bump host count assertion from 10 to 11.
- test/gen-skill-docs.test.ts — extend --host validation regression to include devin.

Skills skipped on Devin via generation.skipSkills:
- /codex (claude -p wrapper around Codex CLI; Phase 2 reintroduces via devin_mcp
  sub-sessions)
- /pair-agent (browser sidebar over ngrok; Devin has its own browser/computer tool)
- /setup-gbrain (cross-machine memory sync; Devin uses Knowledge Notes — Phase 2)

42 of the existing skills regenerate cleanly for Devin. Full bun test suite shows
no new failures introduced by this change (3 pre-existing failures verified by
stash-test-pop on baseline).
@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…owledge Notes + Playbooks

Phase 2 of the Devin host adaptation. Re-enables 7 resolvers that Phase 1
suppressed and ports them to Devin's primitives:

- DESIGN_OUTSIDE_VOICES, ADVERSARIAL_STEP, CODEX_SECOND_OPINION,
  CODEX_PLAN_REVIEW, REVIEW_ARMY -> spawn child Devin sessions via
  `devin_mcp` `devin_session_create` (parallel dispatch via single call
  with multiple session specs, polling at 60s intervals, terminate with
  archive_on_terminate=true).
- GBRAIN_CONTEXT_LOAD, GBRAIN_SAVE_RESULTS -> search/create Knowledge
  Notes via `devin_mcp` `devin_knowledge_manage` (per-skill save
  triggers preserved: office-hours, investigate, plan-ceo-review, retro,
  plan-eng-review, ship, cso, design-consultation).

Each resolver now branches on `ctx.host === 'devin'`. Helpers live in
`scripts/resolvers/devin-helpers.ts` (devinSubSessionBlock,
devinKnowledgeLoadBlock, devinKnowledgeSaveBlock, devinPlanReviewBlock).

New skill: `/devin-setup` (Devin-only). One-shot workspace wiring that
verifies devin_mcp reachability, registers /ship + /land-and-deploy as
Devin Playbooks (`devin_playbook_manage create`), and seeds ETHOS.md +
AGENTS.md as Knowledge Notes pinned to the repo. Skipped from all other
hosts via `generation.skipSkills`.

`hosts/devin.ts`: clears `suppressedResolvers` (now [] — the resolvers
themselves handle Devin via the conditional branch). Comment documents
how to re-suppress an individual resolver if a future Devin variant
lacks sub-session permissions.

Tests: 449 pass / 4 fail. The 4 fails are all pre-existing baseline
failures (golden-file regression, plan-review preamble budget,
host-config-export.ts CLI claude detection in non-Claude env). 0 new
regressions.

Refs: PR #1 (Phase 1).
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@louisCalderon888 louisCalderon888 changed the title feat: add Devin (Cognition AI) as a gstack host (Phase 1 / MVP) feat: add Devin (Cognition AI) as a gstack host (Phase 1 + Phase 2) May 4, 2026
@louisCalderon888
Copy link
Copy Markdown
Owner Author

Phase 2 test report — all 6 tests passed

Devin session · static CLI generator validation (shell-only).

TL;DR — every adversarial assertion held
# Test Result
1 Devin office-hours/review emit devin_session_create (sub-session prose) PASSED — 2x and 4x respectively
2 Devin memory-using skills emit devin_knowledge_manage (Knowledge Notes prose) PASSED — 4x in all 8 skills (office-hours, investigate, cso, plan-ceo-review, retro, plan-eng-review, ship, design-consultation)
3 No leak — non-Devin hosts (Codex, Factory, OpenCode, Cursor, Claude in-tree) have 0 occurrences of Devin prose PASSED — 20 leak checks, all 0
4 /devin-setup skill is Devin-only PASSED — present in .cognition/skills/gstack-devin-setup/, absent from 7 other host paths and Claude in-tree, contains 4x devin_playbook_manage
5 review-army renders parallel sessions: array (Devin REST v3 concurrent dispatch) PASSED — verbatim prose plus per-spec schema and Red Team sub-session block
6 Test suite baseline preserved PASSED — 449 pass / 4 fail (matches documented pre-existing baseline; 0 new regressions)
Leak matrix (Test 3 evidence — 5 skills × 5 hosts)
.cognition/skills/gstack-office-hours/SKILL.md          leak=6   <-- Devin (intentional)
.cognition/skills/gstack-review/SKILL.md                leak=4   <-- Devin (intentional)
.cognition/skills/gstack-investigate/SKILL.md           leak=4   <-- Devin (intentional)
.cognition/skills/gstack-cso/SKILL.md                   leak=4   <-- Devin (intentional)
.cognition/skills/gstack-ship/SKILL.md                  leak=8   <-- Devin (intentional)
.agents/skills/gstack-{office-hours,review,investigate,cso,ship}/SKILL.md     all leak=0
.factory/skills/gstack-{office-hours,review,investigate,cso,ship}/SKILL.md    all leak=0
.opencode/skills/gstack-{office-hours,review,investigate,cso,ship}/SKILL.md   all leak=0
.cursor/skills/gstack-{office-hours,review,investigate,cso,ship}/SKILL.md     all leak=0

leak = count of devin_session_create | devin_knowledge_manage matches per file. The if (isDevinHost(ctx)) branch in scripts/resolvers/{review,design,gbrain,review-army}.ts is correctly host-scoped: Devin row is feature-correct, all 4 other hosts × 5 skills = 20 cells are 0.

Out of scope (Phase 3)
  • Live Devin sub-session spawning at runtime
  • Live Knowledge Notes API calls
  • Live /qa browser flow

Phase 2 emits the prose that instructs a future Devin parent session to call those tools. Runtime behavior of the prose is Phase 3.

Full report attached in the Devin session. Ready for review.

louisCalderon888 and others added 3 commits May 4, 2026 12:39
The previous Phase 1 host config wrote skills to .cognition/skills/ based on
an inaccurate assumption about where Devin scans for SKILL.md files. The
official Devin for Terminal docs (https://cli.devin.ai/docs/extensibility/skills)
clearly state the correct paths:

  - .devin/skills/<name>/SKILL.md          (project-local, committed)
  - ~/.config/devin/skills/<name>/SKILL.md (global, XDG)
  - .agents/skills/<name>/SKILL.md         (also scanned, Codex sidecar)
  - .windsurf/skills/<name>/SKILL.md       (also scanned)

Skills written to .cognition/skills/ are NOT discovered by the CLI, which is
why the slash-command dropdown never showed gstack-* entries even after a
successful setup run.

Changes:

- hosts/devin.ts: globalRoot, localSkillRoot, hostSubdir → .devin/skills/
- hosts/devin.ts: pathRewrites and sidecar.path updated to .devin/skills/
- hosts/devin.ts: boundaryInstruction lists .devin/skills/ first, calls out
  legacy .cognition/skills/ in the ignore list
- setup: DEVIN_SKILLS path $HOME/.cognition/skills → $HOME/.config/devin/skills
- setup: comments and log messages updated for the new path
- devin-setup/SKILL.md.tmpl: scan order is .devin > .agents > .github,
  with .cognition/ kept as a legacy fallback for repos still using the old path
- docs/DEVIN.md: documents both CLI and remote-VM surfaces, links to
  cli.devin.ai/docs, explains why .devin/skills/ over .cognition/skills/
- AGENTS.md: 'Skill location' column updated to .devin/skills/gstack-*/
- .gitignore: .devin/ added alongside .cognition/

Tests: 449 pass / 4 fail (exact baseline, 0 new regressions). The 4
failures are pre-existing on main (golden-file regression on Claude/Factory
ship, plan-review preamble budget, claude-not-in-PATH detect).

Manual test (Luis's Ubuntu 26.04 + Devin for Terminal v2026.5.1-1):
- ./setup --host devin generates 43 skills to .devin/skills/
- Symlink to ~/.config/devin/skills/ exposes them globally
- /gstack-* slash commands now appear in Devin CLI completion dropdown

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…rade gracefully on Linux

Playwright's playwright install command fails on very-new Linux distros
(e.g. Ubuntu 26.04) with:

  ERROR: Playwright does not support chromium on ubuntu26.04-x64

This is the host-OS allowlist check, not a binary incompatibility \u2014 the
Chromium build itself is forward-compatible and runs fine on the new
release. The official escape hatch is the env var
PLAYWRIGHT_BROWSERS_VALIDATE_HOST_REQUIREMENTS=0, which disables the
pre-download check while still pulling the same binary.

Changes:

- setup: pass PLAYWRIGHT_BROWSERS_VALIDATE_HOST_REQUIREMENTS=0 when
  running 'bunx playwright install chromium', so the install succeeds
  on Ubuntu 26.04 and any future Linux release before its build is
  added to Playwright's allowlist.
- setup: degrade gracefully on Linux/macOS when the post-install launch
  check still fails. Browser-dependent skills (/qa, /browse, /canary,
  /design-review, /setup-browser-cookies) will appear in the
  slash-command menu and explain workarounds at runtime; the rest of
  gstack continues to install. This is critical for the Devin host \u2014
  CLI skill discovery should succeed even when the local Chromium
  build isn't available for the host OS yet.
- setup: print actionable workaround commands (env-var retry + system
  Chromium install) before continuing, so users always know how to
  recover the browser-skill capability.
- setup: Windows path remains fatal (Bun pipe-handling bug in
  oven-sh/bun#4253 has no graceful fallback today).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
curl -fsSL <raw>/scripts/install-devin.sh | bash now does the full flow:
checks/installs Bun, ensures Node ≥14 via nvm, clones or pulls the fork to
~/dev/gstack on the Devin branch, scrubs stale symlinks from earlier
attempts (~/.cognition/skills + dangling ~/.config/devin/skills entries),
runs ./setup --host devin (which itself degrades gracefully on Ubuntu 26.04
when Playwright Chromium can't install), verifies skill count + spot-checks
five named skills, and runs an optional browser smoke test.

Safe to re-run; every step is idempotent.

docs/DEVIN.md TL;DR now leads with the one-liner so users can paste a
single command and walk away.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant