feat: add graphify plugin and documentation
Build and Push Docker Image / build (push) Failing after 1m35s
Build and Push Docker Image / build (push) Failing after 1m35s
- Introduced a new graphify OpenCode plugin to remind users about the knowledge graph before executing bash commands. - Added AGENTS.md for agent guidance, including development commands, environment setup, Docker deployment, code structure, conventions, and testing instructions. - Created opencode.json to configure the graphify plugin and superpowers. - Updated tests to improve type safety and added missing imports in test files. - Added .graphify_uncached.txt to track relevant files for graphify.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// graphify OpenCode plugin
|
||||
// Injects a knowledge graph reminder before bash tool calls when the graph exists.
|
||||
import { existsSync } from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
export const GraphifyPlugin = async ({ directory }) => {
|
||||
let reminded = false;
|
||||
|
||||
return {
|
||||
"tool.execute.before": async (input, output) => {
|
||||
if (reminded) return;
|
||||
if (!existsSync(join(directory, "graphify-out", "graph.json"))) return;
|
||||
|
||||
if (input.tool === "bash") {
|
||||
output.args.command =
|
||||
'echo "[graphify] Knowledge graph available. Read graphify-out/GRAPH_REPORT.md for god nodes and architecture context before searching files." && ' +
|
||||
output.args.command;
|
||||
reminded = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user