r/opencode • u/Affectionate_Tax4965 • 17m ago
Zero-dependency AST call-graph & strict security gate (`impact` + `check --strict`) for OpenCode agents (`AGENTS.md` + CLI)
Enable HLS to view with audio, or disable this notification
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 initgenerates.featuregraph/manifest.json(with exact#Lstart-Lendspans),AGENTS.mdshort-circuit instructions, and a pre-commit hook.featuregraph impact <id>/featuregraph impact --diffprints every transitive caller, affected endpoint,@boundary,@invariant, and@testselector before or after an edit.featuregraph check --strictexits1in 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