Skip to content

Raw python scripts in skills #114

Closed
Closed

Description

@biggates

It is weird that skill.md contains lots of raw python code. Is it better to embed these python scripts into graphify package, maybe a cli subpackage?

e.g.

Replace NODE_A and NODE_B with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant.

After writing the explanation, save it back:

```python
$(cat .graphify_python) -c "
from graphify.ingest import save_query_result
from pathlib import Path
save_query_result(
    question='Path from NODE_A to NODE_B',
    answer='ANSWER',
    memory_dir=Path('graphify-out/memory'),
    query_type='path_query',
    source_nodes=PATH_NODES,  # list of node labels on the path
)
print('Path result saved to graphify-out/memory/')
"
```

can be replaced with:

Replace NODE_A and NODE_B with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant.

After writing the explanation, save it back:

```python
$(cat .graphify_python) -m graphify.cli.ingest save_query_result NODE_A NODE_B
```

which is much shorter for LLM to read.

Activity

  1. safishamsi commented on Apr 9, 2026

    @safishamsi
    Member

    Fixed in v0.3.18. All six skill files have had the inline save_query_result Python blocks replaced with a single graphify save-result CLI call. The new graphify save-result subcommand handles saving Q&A results to the memory directory directly, so the skill files are shorter and easier to maintain.

  2. biggates commented on Apr 10, 2026

    @biggates
    Author

    save-result solves that one problem, but there are still a lot of other raw python scripts in skills. are you going to do all of them? @safishamsi

    The following is a full list of possible cli commands, summarized by gpt:

    Phase/Step Subcommand Main Input(s) Output(s) / File(s) Description
    Step 2: File Detection detect-files INPUT_PATH .graphify_detect.json Detect files in the corpus directory
    Step 3A: AST Extraction extract-ast .graphify_detect.json .graphify_ast.json AST extraction for code files
    Step 3B0: Semantic Cache Check check-semantic-cache .graphify_detect.json (file list) .graphify_cached.json, .graphify_uncached.txt Which files already have semantic cache
    Step 3B3: Save Semantic Cache save-semantic-cache .graphify_semantic_new.json - Save new semantic extraction to cache
    Step 3B3: Merge Semantic Cache merge-semantic-cache .graphify_cached.json, .graphify_semantic_new.json .graphify_semantic.json Merge cached & new semantic extraction
    Step 3C: Merge Extraction merge-extraction .graphify_ast.json, .graphify_semantic.json .graphify_extract.json Merge AST and semantic extraction
    Step 4: Build/Analyze/Report analyze-graph .graphify_extract.json GRAPH_REPORT.md, graph.json, .graphify_analysis.json Build, cluster, analyze, generate report/output
    Step 5: Label Communities label-communities .graphify_analysis.json .graphify_labels.json, GRAPH_REPORT.md (updated) Community labels & report regeneration
    Step 6: Export Obsidian Vault export-obsidian - obsidian/ Write Obsidian vault (if requested)
    Step 6: Export HTML graph export-html - graph.html Write HTML interactive graph
    Step 7: Export Cypher export-cypher .graphify_extract.json cypher.txt Export Neo4j Cypher script
    Step 7: Push Neo4j push-neo4j .graphify_extract.json, .graphify_analysis.json Neo4j DB Push graph directly to Neo4j DB
    Step 7b: Export SVG export-svg .graphify_extract.json, .graphify_analysis.json graph.svg Export SVG
    Step 7c: Export GraphML export-graphml .graphify_extract.json, .graphify_analysis.json graph.graphml Export GraphML for Gephi/yEd
    Step 7d: MCP Server serve-mcp graphify-out/graph.json - Launch MCP stdio agent server
    Step 8: Token Reduction Benchmark bench-tokens graphify-out/graph.json, .graphify_detect.json console printout Run token reduction benchmark
    Step 9: Save manifest/cost save-manifest .graphify_detect.json, .graphify_extract.json cost.json Save analysis manifest, update cost
    --update: Detect changed files detect-incremental INPUT_PATH .graphify_incremental.json Detect changed/new files for incremental run
    --update: Prune ghost nodes prune-ghost-nodes .graphify_incremental.json, graph.json graph.json Remove nodes linked to deleted files
    --update: Merge new graph merge-updated-graph .graphify_extract.json graph.json Merge newly extracted graph to main graph
    --update: Show diff graph-diff .graphify_old.json, .graphify_extract.json console printout Show changes from update
    --cluster-only: Reclustering recluster-existing graph.json .graphify_analysis.json, GRAPH_REPORT.md Re-run clustering and analysis
    query: Query graph query-graph graph.json, question, mode console printout Run question traversal (bfs/dfs)
    query: Save query result save-result --question, --answer, --type, --nodes updates graph cache Store ad-hoc answers in graph
    path: Shortest path query shortest-path graph.json, node A, node B console printout Find & explain shortest path
    explain: Explain node explain-node graph.json, node name console printout Explain node & connections
    add: Add URL to corpus ingest-url URL, author, contributor raw/ (corpus updated) Downloads and ingests remote resource
    --watch: Watch directory watch INPUT_PATH - Watch and auto-update on changes
    git hook: Install hook hook install, uninstall, status - .git/hooks/post-commit Post-commit hook for graphify
    CLAUDE.md: Integrate claude install, uninstall - CLAUDE.md Integrate with Claude code sessions
    Interpreter guard ensure-interpreter - .graphify_python Ensures interpreter config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions