Skip to content

feat: Add ForgeCode command and agent prompt templates#383

Open
ericnoam wants to merge 8 commits into
Egonex-AI:mainfrom
ericnoam:feature/forgecode-support
Open

feat: Add ForgeCode command and agent prompt templates#383
ericnoam wants to merge 8 commits into
Egonex-AI:mainfrom
ericnoam:feature/forgecode-support

Conversation

@ericnoam

@ericnoam ericnoam commented Jun 4, 2026

Copy link
Copy Markdown

Summary

Add first-class ForgeCode integration by installing ForgeCode-native custom commands and agent prompt templates, plus a dedicated forgecode installer target.

Context

ForgeCode supports custom commands (e.g. :understand) and custom agents, but it does not reliably discover skills installed as symlinked directories. This change makes the Understand-Anything workflows usable inside ForgeCode without breaking existing installation targets.

Changes

  • Installers: add a new forgecode platform target.
    • Installs skills via copy-per-skill for ForgeCode (avoids directory-symlink discovery issues).
    • Installs ForgeCode custom commands into <forge-base>/commands.
    • Installs ForgeCode custom agents into <forge-base>/agents.
    • ForgeCode base dir resolution supports FORGE_CONFIG, then ~/forge, then ~/.forge.
  • New ForgeCode command templates:
    • :understand, :understand-chat, :understand-explain, :understand-dashboard, plus command templates for other Understand Anything workflows.
  • New ForgeCode agent prompt templates (ForgeCode agent format):
    • project-scanner, file-analyzer, assemble-reviewer, architecture-analyzer, tour-builder, graph-reviewer, domain-analyzer.

Key Implementation Details

  • All changes are gated behind the forgecode platform in the installers; other platforms continue to use existing install styles.
  • Commands/agents are installed as files under ForgeCode’s config directories so ForgeCode can enumerate them via forge list ... --custom.

Use Cases

  • Use Understand Anything workflows directly inside ForgeCode:
    • :understand ...
    • :understand-chat ...
    • :understand-explain ...
    • :understand-dashboard
  • Run the multi-agent workflow with ForgeCode-native agent definitions instead of “pseudo subagent” instructions.

Testing

pnpm lint
pnpm build
pnpm test

bash -n install.sh
./install.sh --help

# Optional: validate ForgeCode discovery using a temp config
TMPDIR=$(mktemp -d)
mkdir -p "$TMPDIR/commands" "$TMPDIR/agents" "$TMPDIR/skills"
cp understand-anything-plugin/commands/*.md "$TMPDIR/commands/"
cp understand-anything-plugin/forgecode/agents/*.md "$TMPDIR/agents/"
cp -R understand-anything-plugin/skills/* "$TMPDIR/skills/"
FORGE_CONFIG="$TMPDIR" forge list command --custom --porcelain
FORGE_CONFIG="$TMPDIR" forge list agent --custom --porcelain
rm -rf "$TMPDIR"

Notes

  • PowerShell execution validation is not performed in this environment (no pwsh available), but the changes mirror the existing installer patterns.

@heguojiao

heguojiao commented Jun 4, 2026 via email

Copy link
Copy Markdown

@thejesh23 thejesh23 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Symlinked platforms get upstream changes the moment ~/.understand-anything/repo is git pull'd. Copy-per-skill users must re-run the installer to pick up updated skill content. Consider mentioning this in the
"Restart ForgeCode…" message, or have --update re-copy.

…ale copies

Symlinked platforms (Claude, Codex, Gemini, etc.) pick up upstream
changes automatically because their installed files are symlinks into
the repo checkout.  ForgeCode uses physical copies (copy-per-skill) to
work around directory-symlink discovery issues, so a bare git pull left
the installed files stale with no warning.

Two fixes (addressing thejesh23's review comment):
- install success message now notes that ForgeCode files are copies and
  instructs users to run --update to refresh them after upstream changes.
- cmd_update detects an existing ForgeCode install (~/forge/commands or
  ~/forge/agents present) and automatically re-copies commands and agents
  after the git pull, so a single --update keeps everything current.
- --help usage line updated to reflect the new --update behaviour.
@ericnoam

ericnoam commented Jun 5, 2026

Copy link
Copy Markdown
Author

Thanks @thejesh23, good catch! Fixed in 4fc4b61.

Two changes in install.sh:

  1. Install success message — now explicitly notes that ForgeCode files are physical copies and tells users to run ./install.sh --update after upstream changes.
  2. --update re-copies automatically — after the git pull, cmd_update now detects an existing ForgeCode install (by checking whether $FORGE_BASE/commands or $FORGE_BASE/agents exists) and re-runs install_forgecode_commands + install_forgecode_agents, so a single --update keeps everything current without requiring a separate re-install step.

The --help usage line was also updated to reflect the new behaviour.

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.

4 participants