Fix #676 #678 #681: graphifyignore negation, Antigravity slash command, Gemini hook Windows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Safi
2026-05-03 13:22:17 +01:00
co-authored by Claude Sonnet 4.6
parent 893acb19df
commit f065933391
2 changed files with 16 additions and 7 deletions
+12 -6
View File
@@ -252,9 +252,13 @@ _GEMINI_HOOK = {
{
"type": "command",
"command": (
"[ -f graphify-out/graph.json ] && "
r"""echo '{"decision":"allow","additionalContext":"graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files."}' """
r"""|| echo '{"decision":"allow"}'"""
'python -c "'
"import sys,pathlib,json;"
"e=pathlib.Path('graphify-out/graph.json').exists();"
"d={'decision':'allow'};"
"e and d.update({'additionalContext':'graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files.'});"
"sys.stdout.write(json.dumps(d))"
'"'
),
}
],
@@ -448,11 +452,13 @@ Rules:
"""
_ANTIGRAVITY_WORKFLOW = """\
---
name: graphify
description: Turn any folder of files into a navigable knowledge graph
---
# Workflow: graphify
**Command:** /graphify
**Description:** Turn any folder of files into a navigable knowledge graph
## Steps
Follow the graphify skill installed at ~/.agents/skills/graphify/SKILL.md to run the full pipeline.
If no path argument is given, use `.` (current directory).
+4 -1
View File
@@ -656,11 +656,14 @@ def detect(root: Path, *, follow_symlinks: bool = False) -> dict:
# Prune noise dirs in-place so os.walk never descends into them.
# Hidden dirs are allowed through if they could contain an
# explicitly included path (.graphifyinclude allowlist).
# When negation patterns (!) exist, skip directory-level ignore
# pruning so negated files inside can still be reached.
has_negation = any(p.startswith("!") for _, p in ignore_patterns)
dirnames[:] = [
d for d in dirnames
if (not d.startswith(".") or _could_contain_included_path(dp / d, root, include_patterns))
and not _is_noise_dir(d)
and not _is_ignored(dp / d, root, ignore_patterns)
and (has_negation or not _is_ignored(dp / d, root, ignore_patterns))
]
for fname in filenames:
if fname in _SKIP_FILES: