Add Forge Code as a gstack host#1367
Closed
edbienes wants to merge 6 commits intogarrytan:mainfrom
Closed
Conversation
Co-Authored-By: Forge Code <noreply@forgecode.dev>
Co-Authored-By: Forge Code <noreply@forgecode.dev>
Author
Pre-landing reviewRan a full review (Claude structured + specialist subagents + Claude adversarial + Codex adversarial). Three fixes applied and pushed: Fixed:
No critical issues found beyond the forge detection fix. Pass 1 (SQL, race conditions, LLM trust, shell injection, enum completeness) — clean. Slop scan — no new findings. Informational only (not blocking):
785 tests pass post-fix. |
…sion bump - Change forge auto-detect from `command -v forge` to `forge agent --help` to distinguish Forge Code from Foundry's forge (same binary name) - Remove identity no-op tool rewrites from hosts/forgecode.ts - Bump VERSION/package.json 1.27.1.0 → 1.27.2.0 - Write CHANGELOG entry for this branch - Update test to assert forge agent --help detection pattern
f31ffb0 to
fb1fbac
Compare
CHANGELOG.md, VERSION, and package.json conflicted because upstream landed v1.28.0.0 (browse --proxy/--headed/--navigate + llms.txt) while this branch held v1.27.2.0. Resolution: keep both entries, bump Forge Code to v1.29.0.0 (new host = MINOR bump on top of main).
…covers them Forge Code 2.x discovers user skills from ~/.agents/skills/, not ~/.forgecode/skills/ where 1.29.0.0 installed them. `forge list skill` reported only the 4 built-in skills even after a clean install. Two bugs fixed: 1. Wrong install path. setup now writes to $HOME/.agents/skills/ and hosts/forgecode.ts globalRoot + pathRewrites bake the correct ~/.agents/skills/gstack path into generated SKILL.md files. 2. Symlinked directories aren't discovered. Forge only picks up real top-level directories whose immediate child is SKILL.md. link_forgecode_skill_dirs now mirrors the Claude install pattern: real dir + symlinked SKILL.md inside. Existing installs at the legacy ~/.forgecode/skills/ location are migrated (cleaned up) on the next `./setup --host forgecode` run. Verified: `forge list skill --porcelain | wc -l` went from 6 to 51 (header + 4 builtins + gstack root + 46 gstack-* skills). Bumps to 1.29.1.0.
Other harnesses that share ~/.agents/skills/ (notably pi-coding-agent) reject SKILL.md when the `name:` frontmatter doesn't match the parent directory. With our prefixed install (gstack-autoplan/, gstack-qa/, etc.), every gstack skill triggered a 'Skill conflicts' warning at startup. The install now copies (rather than symlinks) SKILL.md into ~/.agents/skills/gstack-X/ and patches the `name:` field in the copy to match the prefixed parent directory. The build output under .forgecode/skills/ is left untouched so the dry-run freshness check keeps passing. Also: bin/gstack-patch-names now passes --color=never to grep so colorized aliases don't poison the parsed name field on machines where grep aliases color output. Verified: - pi conflict warnings cleared (47 entries fixed) - forge list skill still finds all 47 (gstack-* names, runtime root, builtins) - find-skills (sibling skill) untouched - bun run scripts/gen-skill-docs.ts --host forgecode --dry-run passes - bun test test/gen-skill-docs.test.ts test/host-config.test.ts: 460 pass
Owner
|
Thanks @edbienes — closing as deferred. New host integration (Forge Code) needs focused review separate from a wave. Happy to revisit as a focused PR with the host-add checklist. |
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
Add Forge Code (CLI:
forge) as a first-class gstack host so users can install generated gstack skills with./setup --host forgecodeandbun run gen:skill-docs --host forgecode.Context
The host system is declarative: each supported coding agent is defined by a typed
HostConfig, then registered inhosts/index.ts. This followsdocs/ADDING_A_HOST.mdwithout adding generator, setup, or installer-specific logic.Changes
hosts/forgecode.tswith Forge Code paths, frontmatter handling, tool/path rewrites, suppressed resolvers, runtime assets, install behavior, and co-author trailer..forgecode/skill output../setup --host forgecodesupport, including auto detection viaforge, generation, runtime-root setup, and generated skill linking.skill:checkrespect primary-host skipped skills so Claude-only skipped templates do not fail health checks.Key Implementation Details
Forge Code does not need a custom adapter module. String rewrites cover the relevant semantics: Claude paths are rewritten to
.forgecode/skills/gstack,CLAUDE.mdreferences becomeAGENTS.md, and Claude tool prose is mapped to Forge Code-style tools such asshell,patch,fs_search, andsage.Testing
bun run gen:skill-docs --host forgecodebun run scripts/host-config-export.ts validate→All 11 configs validbun test test/host-config.test.ts→ 73 passbun test test/gen-skill-docs.test.ts→ 387 passbun run build→ passesKnown Notes
Earlier full-suite runs exceeded the 5-minute command window in this environment. The Forge-related host, generator, setup, and build validation pass.
Out of Scope
If Forge Code's tool model diverges further later, a follow-up can add a dedicated
scripts/host-adapters/forgecode-adapter.tsperdocs/ADDING_A_HOST.md.Need help on this PR? Tag
@codesmithwith what you need.