feat: add Devin (Cognition AI) as a gstack host (Phase 1 + Phase 2)#1
Draft
louisCalderon888 wants to merge 5 commits into
Draft
feat: add Devin (Cognition AI) as a gstack host (Phase 1 + Phase 2)#1louisCalderon888 wants to merge 5 commits into
louisCalderon888 wants to merge 5 commits into
Conversation
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 EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…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>
Owner
Author
Phase 2 test report — all 6 tests passedDevin session · static CLI generator validation (shell-only). TL;DR — every adversarial assertion held
Leak matrix (Test 3 evidence — 5 skills × 5 hosts)
Out of scope (Phase 3)
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. |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/qaand/design-review) is tracked separately indocs/DEVIN.md.Phase 1 — Host registration + Agent Skills generation
hosts/devin.ts— typedHostConfig. Frontmatter allowlist (name,description,argument-hint,allowed-tools), conditionaltriggers: ["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— registerdevininALL_HOST_CONFIGS+ re-export.setup—--host devinrunsbun run gen:skill-docs --host devinand symlinks~/.cognition/skills/gstack-*for local Devin CLI users.--local --host devinis the canonical flow (commits.cognition/skills/into the user's repo so Devin VM sessions discover them on clone).--host autodetectsdevinon 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 todocs/DEVIN.md..gitignore— exclude.cognition/from the gstack source tree (it's a generated output dir, on par with.agents//.factory//.opencode/).host-config.test.tshost-count assertion 10 → 11 and extended thesetup --hostvalidation regression ingen-skill-docs.test.tsto includedevin.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:
DESIGN_OUTSIDE_VOICESdevin_mcpdevin_session_create(skill-specific prompts for plan-design-review / design-review / design-consultation)ADVERSARIAL_STEPCODEX_SECOND_OPINIONCODEX_PLAN_REVIEWREVIEW_ARMYdevin_session_createcall with N session specs (one per specialist), parent polls each child viadevin_session_interactaction="get", JSON finding schema preservedGBRAIN_CONTEXT_LOADdevin_mcpdevin_knowledge_manageaction="list" withpinned_repofilterGBRAIN_SAVE_RESULTSdevin_knowledge_manageaction="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 prosedevinKnowledgeLoadBlock(p)— pre-skill Knowledge Notes search with skill-specific keyword extractiondevinKnowledgeSaveBlock(p)— post-skill persistence with per-skill metadata mappingdevinPlanReviewBlock(p)— plan-review variant of devinSubSessionBlockisDevinHost(ctx)— convenience helperhosts/devin.ts:suppressedResolversis now[](resolvers branch onctx.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 viageneration.skipSkills. Steps: verifydevin_mcpreachability, derive repo identifier, register/ship+/land-and-deployas Devin Playbooks viadevin_playbook_managecreate (with dedup-check), seedETHOS.md+AGENTS.mdas Knowledge Notes pinned to the repo, optional weekly/healthschedule viadevin_schedule_manage. Replaces/setup-gbrainfor Devin.Skills still skipped on Devin (
generation.skipSkills)/codexcodex exec. Devin uses theCODEX_SECOND_OPINIONresolver branch instead — child Devin session is the second opinion. The/codexslash skill itself stays skipped because it's a Claude → Codex wrapper./pair-agent/setup-gbrain/devin-setup+ Knowledge Notes.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:
hosts/devin.tsagainsthosts/codex.tsandhosts/factory.ts— pathRewrites, frontmatter allowlist, install.linkingStrategy. ConfirmsuppressedResolvers: []is intentional (Phase 2 — resolvers branch onctx.host === 'devin'). Spot-check theif (isDevinHost(ctx))branches inreview.ts,design.ts,gbrain.ts,review-army.ts— they MUST emit prose only (no behavior changes for non-Devin hosts).bun run gen:skill-docs --host devinand confirm 43 skills emit (gstack root + 41 prefixed + 1 newgstack-devin-setup). Then runbun run gen:skill-docs --host claudeand confirmdevin-setup/SKILL.mdis not generated (Devin-only)../setup --host devin --localinside any other project repo and confirm.cognition/skills/gstack-*/SKILL.mdlands with valid Agent Skills frontmatter (novoice triggersarray, onlytriggers: ["user"]on sensitive skills)..cognition/skills/gstack-*/committed and run/devin-setup. Confirmdevin_playbook_managecreate succeeds for/shipand/land-and-deploy(or skip with "already registered" if dedup-check matches), anddevin_knowledge_managecreate succeeds forETHOS.mdandAGENTS.mdpinned to the repo. Then run/office-hourson 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.bun test test/host-config.test.ts test/gen-skill-docs.test.tsshows 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 allgenerate both Codex-formatted and Devin-formatted skills on the same repo without collision. Single-host Devin users can overridelocalSkillRootto.agents/skills/gstackif 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-setupfor Playbook + Knowledge Note seeding. Phase 3 (tracked indocs/DEVIN.md) —enter_test_mode+recording_*integration for/qaand/design-reviewto deliver video as proof-of-test.Link to Devin session: https://app.devin.ai/sessions/2e94641ce54c4170badf46f8d8878727
Requested by: @louisCalderon888