Skip to content

Add native /graphify slash command for OpenCode - #2727

Open
ayushcodes10 wants to merge 4 commits into
Graphify-Labs:v8from
ayushcodes10:fix-2709-opencode-slash-command
Open

ayushcodes10 wants to merge 4 commits into
Graphify-Labs:v8from
ayushcodes10:fix-2709-opencode-slash-command

Conversation

@ayushcodes10

Copy link
Copy Markdown
Contributor

OpenCode skills are loaded on-demand by the agent via description matching; they are not slash commands. Only a markdown file under .opencode/commands/ becomes a /-menu entry, so installing just the skill and reminder plugin left /graphify absent from the TUI command menu even though the skill loaded correctly and the docs told users to type it.

Ship a command-opencode.md template (mirroring the existing Kilo command file) that loads the skill and forwards $ARGUMENTS, and wire it into opencode install/uninstall alongside the existing plugin.

Also drops the .opencode/opencode.json "plugin" array registration: OpenCode already auto-loads every file under .opencode/plugins/, so the registration was redundant, and for a global install it wrote a project-relative path into a project-relative config file that a global setup never reads, leaving a dead entry behind.

Fixes #2709.

@graphify-labs graphify-labs Bot 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.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Formal verification. 2 change(s) tested, no difference found (not proven).


Graphify review — findings

This PR changes the OpenCode integration in graphify/install.py. It removes the logic that registered/deregistered the plugin in .opencode/opencode.json (so install/uninstall no longer touch that config file) and adds installation of a new native /graphify slash command via a new command-opencode.md file copied into .opencode/commands/. Supporting changes include the new command markdown file, a pyproject.toml package-data entry for it, an import rename in __main__.py, and updated/rewritten tests in test_install.py reflecting the config and command behavior.

No blocking issues surfaced. 3 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 479 functions depend on the 293 functions this change touches.

Health — this change adds coupling hotspots:

  • worse: install() — 5 callers, 12 callees
  • worse: _agents_install() — 6 callers, 7 callees
  • worse: _agents_uninstall() — 7 callers, 5 callees
  • worse: uninstall_all() — 2 callers, 14 callees

Verification — 479 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 479 function(s) in the blast radius were not formally verified this run

Formal verification

Could not verify: Could not verify \_agents\_install.

The verifier did not have enough to check \_agents\_install, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 200 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly TypeError — names the real obstacle, not a sampling gap)

No difference found (not proven): No behavior difference found in \_agents\_uninstall (not a proof).

The verifier ran both versions of \_agents\_uninstall on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify install.

The verifier did not have enough to check install, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 23 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)

Could not verify: Could not verify \_install\_opencode\_plugin.

The verifier did not have enough to check \_install\_opencode\_plugin, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `project_dir` is annotated `Path` — outside the synthesizable primitive/collection set

No difference found (not proven): No behavior difference found in uninstall\_all (not a proof).

The verifier ran both versions of uninstall\_all on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify \_uninstall\_opencode\_plugin.

The verifier did not have enough to check \_uninstall\_opencode\_plugin, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `project_dir` is annotated `Path` — outside the synthesizable primitive/collection set

· 4 more finding(s) on lines outside this diff (see the check run).

@ayushcodes10

Copy link
Copy Markdown
Contributor Author

@safishamsi this PR's CI run is waiting on approval (first-time contributor gate) — could you approve the workflow run when you get a chance? Happy to address any review feedback in the meantime.

OpenCode skills are loaded on demand by the agent via description
matching; they are not slash commands. Only a markdown file under
.opencode/commands/ becomes a / menu entry, so installing just the
skill and reminder plugin left /graphify absent from the TUI command
menu even though the skill loaded correctly and the docs told users
to type it.

Ship a command opencode.md template (mirroring the existing Kilo
command file) that loads the skill and forwards $ARGUMENTS, and wire
it into opencode install/uninstall alongside the existing plugin.

Also drops the .opencode/opencode.json "plugin" array registration:
OpenCode already auto loads every file under .opencode/plugins/, so
the registration was redundant, and for a global install it wrote a
project relative path into a project relative config file that a
global setup never reads, leaving a dead entry behind.

Fixes Graphify-Labs#2709.
@ayushcodes10
ayushcodes10 force-pushed the fix-2709-opencode-slash-command branch from 9821c57 to bebd552 Compare September 5, 2026 23:52
@ayushcodes10

Copy link
Copy Markdown
Contributor Author

Rebased onto current v8. The conflict was upstream independently adding a project parameter to _resolve_graphify_exe right at this PR's insertion point, unrelated to the opencode.json cleanup here; resolved by keeping both. No changes beyond the rebase; full suite plus skillgen check green.

@graphify-labs graphify-labs Bot 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.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.

Formal verification. 2 change(s) tested, no difference found (not proven).


Graphify review — findings

Installs a native OpenCode /graphify slash command by copying command-opencode.md into .opencode/commands/ on every OpenCode install path, and removes it on uninstall, so the command actually shows up in the TUI menu the docs point users to. Stops writing to .opencode/opencode.json entirely: _install_opencode_plugin now relies solely on OpenCode auto-loading files under .opencode/plugins/, dropping the redundant (and, for global installs, broken and dead) plugin-array registration, and uninstall leaves any existing opencode.json byte-for-byte untouched (#2709). Missing command-opencode.md in the package aborts install with an error prompting reinstall.

Worth a look

  • Non-project OpenCode install writes slash command to CWD instead of user config — graphify/install.py:707 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 523 functions depend on the 308 functions this change touches.

Health — this change adds coupling hotspots:

  • new: dispatch_command() — 2 callers, 124 callees
  • new: codebuddy_install() — 20 callers, 5 callees
  • new: claude_install() — 19 callers, 4 callees
  • new: gemini_install() — 10 callers, 7 callees
  • new: claude_uninstall() — 17 callers, 4 callees
  • new: _project_uninstall() — 5 callers, 13 callees
  • new: dispatch_install_cli() — 2 callers, 31 callees
  • new: _copy_skill_file() — 12 callers, 5 callees
  • …and 13 more — each is listed as a finding

Verification — 523 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 523 function(s) in the blast radius were not formally verified this run

Formal verification

Could not verify: Could not verify \_agents\_install.

The verifier did not have enough to check \_agents\_install, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 200 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly TypeError — names the real obstacle, not a sampling gap)

No difference found (not proven): No behavior difference found in \_agents\_uninstall (not a proof).

The verifier ran both versions of \_agents\_uninstall on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify install.

The verifier did not have enough to check install, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 23 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)

Could not verify: Could not verify \_install\_opencode\_plugin.

The verifier did not have enough to check \_install\_opencode\_plugin, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `project_dir` is annotated `Path` — outside the synthesizable primitive/collection set

No difference found (not proven): No behavior difference found in uninstall\_all (not a proof).

The verifier ran both versions of uninstall\_all on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify \_uninstall\_opencode\_plugin.

The verifier did not have enough to check \_uninstall\_opencode\_plugin, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `project_dir` is annotated `Path` — outside the synthesizable primitive/collection set

· 21 more finding(s) on lines outside this diff (see the check run).

@ayushcodes10

Copy link
Copy Markdown
Contributor Author

@safishamsi rebased onto the latest v8 and all checks are green now — ready for review whenever you get a chance.

@ayushcodes10

Copy link
Copy Markdown
Contributor Author

Checked this finding, it's real: both _install_opencode_plugin's and _install_opencode_command's docstrings promise ~/.config/opencode/ for a non-project install, but every call site passes Path(".") instead. Confirmed this predates this PR though, _install_opencode_plugin has had the exact same issue since before #2709; _install_opencode_command just inherited the same pattern from its sibling for consistency.

Properly fixing it needs both functions (and their uninstall counterparts) to take an explicit project flag or a pre-resolved base path rather than always joining onto whatever project_dir they're handed, since the global case also needs to drop the extra .opencode/ segment (~/.config/opencode/plugins/graphify.js, not ~/.config/opencode/.opencode/plugins/graphify.js) across several call sites (install, _agents_install, _agents_uninstall, uninstall_all). That's a separate, focused fix rather than something to bundle into "add the missing slash command", filed as #3398.

Resolves three conflicts from an independent, more complete upstream
fix for the same dead opencode.json entry this branch was written
against (Graphify-Labs#3732 landed after this branch diverged). Kept upstream's
full fix, which actually strips a stale entry an older release wrote
on both install and uninstall (plugin/plugins key, comment aware,
non ASCII safe), in place of this branch's narrower version, which
only stopped writing a new one and left an existing stale entry
alone. Reapplied this branch's own distinct contribution, the native
OpenCode slash command, on top: its own constant, install/uninstall
functions, and import, plus the three regression tests that are
unique to it; the tests asserting the old, narrower config behavior
are superseded by upstream's own equivalent and corrected coverage
and are dropped rather than reintroduced.

Also closes a gap an unrelated, newly added upstream regression test
caught in this branch's own feature: the installed slash command file
.opencode/commands/graphify.md was never added to detect.py's list of
files graphify writes whole, so a scan indexed it as ordinary project
content instead of skipping it, the same way its sibling plugin file
already is.
@github-actions github-actions Bot added the needs:title PR title should follow the conventional-commit format label Oct 10, 2026
@github-actions

Copy link
Copy Markdown

Thanks @ayushcodes10! One small thing: our changelog and release notes are built from PR titles, so we use the conventional-commits format, for example:

fix(python): resolve a bare stdlib import correctly

Prefixes we use: feat, fix, docs, chore, refactor, test, perf, build, ci. Editing the PR title clears this automatically. This is just a nudge and does not block review.

Combines this branch's own command opencode doc entry with upstream's
new pi package json and pi index ts entries, added after this branch
diverged for the native Pi guard package. Purely additive, so all
three are kept together with upstream's own explanatory comment.
The actual conflict resolution is in the prior commit; this supplies
the ancestry to upstream v8, since the prior commit's tree is already
the correct, fully tested merge result and needs no further changes
applied on top.
@ayushcodes10
ayushcodes10 force-pushed the fix-2709-opencode-slash-command branch 2 times, most recently from d46f7d3 to 34ed1a6 Compare October 16, 2026 13:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:title PR title should follow the conventional-commit format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/graphify is not an OpenCode command

1 participant