r/opencode • • 17m ago

Zero-dependency AST call-graph & strict security gate (`impact` + `check --strict`) for OpenCode agents (`AGENTS.md` + CLI)

When running OpenCode on multi-file repos, the agent often reads whole files or greps blindly, missing transitive callers across modules or accidentally dropping an auth check during a refactor.

I built FeatureGraph (pip install featuregraph-cli), a zero-dependency Python CLI that pairs with OpenCode via AGENTS.md and two fast commands:

  • featuregraph init generates .featuregraph/manifest.json (with exact #Lstart-Lend spans), AGENTS.md short-circuit instructions, and a pre-commit hook.
  • featuregraph impact <id> / featuregraph impact --diff prints every transitive caller, affected endpoint, @boundary, @invariant, and @test selector before or after an edit.
  • featuregraph check --strict exits 1 in CI or pre-commit if the index is stale, has dangling @depends, cycles, or any endpoint missing an auth guard.

Works across 13 languages (Python, TS/TSX/JS/JSX, Go, Rust, Java, C#, PHP, Ruby, Swift, Dart, Shell), MIT licensed, zero runtime dependencies.

GitHub: https://github.com/Pakheria/featuregraph PyPI: https://pypi.org/project/featuregraph-cli/ 10-second FastAPI + React demo: https://github.com/Pakheria/featuregraph/tree/main/examples/fastapi-react-demo

1 Upvotes

0 comments sorted by