Add graphify Kilo plugin and documentation for knowledge graph usage
Gitea Actions CI / detect (push) Successful in 3s
Gitea Actions CI / Compose & nginx validation (push) Failing after 7s
Gitea Actions CI / Backend (lint / type / test / build) (push) Failing after 14s
Gitea Actions CI / Frontend (lint / type / test / build) (push) Failing after 22s
Gitea Actions CI / detect (push) Successful in 3s
Gitea Actions CI / Compose & nginx validation (push) Failing after 7s
Gitea Actions CI / Backend (lint / type / test / build) (push) Failing after 14s
Gitea Actions CI / Frontend (lint / type / test / build) (push) Failing after 22s
This commit is contained in:
@@ -210,3 +210,4 @@ cost.json
|
|||||||
graphify-out/cache/
|
graphify-out/cache/
|
||||||
|
|
||||||
examples/
|
examples/
|
||||||
|
.playwright-mcp
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// graphify Kilo 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") {
|
||||||
|
// Separate with ';' not '&&' — Windows PowerShell 5.1 rejects '&&' as a
|
||||||
|
// statement separator ("not a valid statement separator"), which broke
|
||||||
|
// the first bash command in every OpenCode session on Windows (#1646).
|
||||||
|
// ';' works in PowerShell 5.1, Bash, and POSIX shells alike.
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
## graphify
|
||||||
|
|
||||||
|
This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships.
|
||||||
|
|
||||||
|
When the user types `/graphify`, use the installed graphify skill or instructions before doing anything else.
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- For codebase questions, first run `graphify query "<question>"` when graphify-out/graph.json exists. Use `graphify path "<A>" "<B>"` for relationships and `graphify explain "<concept>"` for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output.
|
||||||
|
- Dirty graphify-out/ files are expected after hooks or incremental updates; dirty graph files are not a reason to skip graphify. Only skip graphify if the task is about stale or incorrect graph output, or the user explicitly says not to use it.
|
||||||
|
- If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
|
||||||
|
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
|
||||||
|
- After modifying code, run `graphify update .` to keep the graph current (AST-only, no API cost).
|
||||||
Reference in New Issue
Block a user