Skip to content

Add graphify skill, Graph Researcher agent, and graphify instructions.#1518

Open
TechPreacher wants to merge 2 commits intomicrosoft:mainfrom
TechPreacher:feat/add-graphify
Open

Add graphify skill, Graph Researcher agent, and graphify instructions.#1518
TechPreacher wants to merge 2 commits intomicrosoft:mainfrom
TechPreacher:feat/add-graphify

Conversation

@TechPreacher
Copy link
Copy Markdown

Pull Request

Description

Adds an experimental graphify skill, a Graph Researcher agent, and a graphify instructions file under the experimental collection. The skill wraps the upstream MIT-licensed graphifyy PyPI package (pinned 0.5.4) to build knowledge graphs over a codebase and expose them via MCP. The agent answers structural questions ("what depends on X", "what connects A and B") by querying the resulting graph through mcp_graphify_* tools, with audit-tag (EXTRACTED / INFERRED / AMBIGUOUS) reporting and confidence-score handling. Includes pyproject.toml, Atheris fuzz harness, pytest tests, Docusaurus docs page, cspell allowlist entries, collection manifest updates, and regenerated plugin outputs for experimental and hve-core-all.

Related Issue(s)

N/A.

Type of Change

Code & Documentation:

  • New feature (non-breaking change adding functionality)
  • Documentation update

AI Artifacts:

  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Other:

  • Script/automation (.ps1, .sh, .py) - Python wrapper + tests for the skill

Sample Prompts (for AI Artifact Contributions)

User Request:

"Use the Graph Researcher to tell me which modules are implicitly affected if I change auth_middleware.py."

Execution Flow:

  1. Agent verifies graphify-out/graph.json exists and mcp_graphify_* tools are registered. If missing, surfaces the exact remediation from the skill.
  2. Maps the question shape ("what depends on X") to mcp_graphify_get_neighbors rather than the broader query_graph.
  3. Calls the typed MCP tool, collects neighbours plus edge audit tags and confidence scores.
  4. Reports findings with the tool name, node IDs touched, and per-edge audit tags. EXTRACTED edges are stated as fact; INFERRED are hedged with confidence; AMBIGUOUS are surfaced as open questions.
  5. Suggests one next file to read, picked from the graph result.

Output Artifacts:

The skill generates (under target repo's graphify-out/):

graphify-out/
├── graph.json
├── graph.html
├── GRAPH_REPORT.md
├── wiki/
└── cache/

The agent itself returns chat output, not files.

Success Indicators:

  • Agent names the MCP tool and node IDs used for every load-bearing claim.
  • Audit tags are not collapsed across edges.
  • When the graph is missing, agent stops with the canonical remediation message rather than guessing.
  • npm run validate:skills passes for .github/skills/experimental/graphify/.

Testing

  • npm run validate:skills - skill structure, pyproject.toml, fuzz harness layout.
  • npm run test:py - runs test_graphify_wrapper.py.
  • npm run lint:frontmatter - schema-validates new agent, instructions, skill frontmatter.
  • npm run lint:md + npm run spell-check - markdown + cspell over new docs.
  • npm run plugin:generate + npm run plugin:validate - verify regenerated plugins/experimental/ and plugins/hve-core-all/ outputs match collection manifests.
  • npm run lint:md-links - link integrity across new docs.

Checklist

Required Checks

  • Documentation is updated (docs/agents/graphify/README.md, docs/agents/README.md)
  • Files follow existing naming conventions (*.agent.md, *.instructions.md, SKILL.md, <collection>/<skill>/)
  • Changes are backwards compatible (additive only - new experimental collection entries)
  • Tests added for new functionality (tests/test_graphify_wrapper.py, tests/fuzz_harness.py)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

  • npm run lint:md
  • npm run spell-check
  • npm run lint:frontmatter
  • npm run validate:skills
  • npm run lint:md-links
  • npm run lint:ps
  • npm run plugin:generate
  • npm run docs:test

Security Considerations

  • No sensitive or NDA information committed.
  • New dependency graphifyy==0.5.4 reviewed; upstream is MIT-licensed (Safi Shamsi). Skill orchestrates upstream CLI/MCP server only - no vendored source.
  • Skill documents upload discipline: deep-mode extraction uploads file contents to Claude API; instructions file requires checking for secrets / regulated content before recommending deep rebuilds, and recommending --mode fast (AST-only, no LLM) for sensitive trees.
  • ANTHROPIC_API_KEY consumed via env only; never written to artifacts. graphify-out/ (incl. cache/ of hashed file snapshots) documented as gitignored build output.

Additional Notes

  • All artifacts live under the experimental collection - opt-in for users.
  • Plugin files under plugins/experimental/ and plugins/hve-core-all/ are generated; do not edit by hand. Regenerate via npm run plugin:generate after any artifact or collection manifest change.
  • graphifyy PyPI package name uses double y; CLI binary is single-y graphify. Pin matters - upstream iterates fast.

@TechPreacher TechPreacher requested a review from a team as a code owner May 4, 2026 07:10
@TechPreacher TechPreacher requested a review from Copilot May 4, 2026 07:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an experimental “Graph Research” workflow to the experimental collection, including a graphify skill (wrapping the upstream graphifyy package), a Graph Researcher agent that queries the graph via MCP tools, and supporting instructions/docs/collection + plugin metadata updates.

Changes:

  • Introduces the graphify skill with a Python subprocess wrapper, uv/pyproject config, and pytest + fuzz harness tests.
  • Adds the Graph Researcher agent and graphify-out/** instructions for evidence-tagged reporting conventions.
  • Updates experimental and hve-core-all collection manifests/docs and regenerates plugin README metadata; adds a new docs section under docs/agents/graphify/.

Reviewed changes

Copilot reviewed 33 out of 36 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
plugins/hve-core-all/README.md Generated plugin index updated to include graph-researcher agent, graphify skill, and graphify instructions
plugins/experimental/README.md Generated plugin index updated for the experimental collection additions
docs/agents/graphify/category.json Adds a new Docusaurus sidebar category for Graph Research docs
docs/agents/graphify/README.md New documentation page describing the Graph Research workflow and setup
docs/agents/README.md Adds “Graph Research” section to the agents catalog
collections/hve-core-all.collection.yml Adds new experimental agent/instruction/skill to the all-up collection manifest
collections/hve-core-all.collection.md Documents the new agent/instruction/skill in the all-up collection description
collections/experimental.collection.yml Adds new agent/instruction/skill entries to the experimental manifest
collections/experimental.collection.md Documents the new agent/instruction/skill in the experimental collection description
CLAUDE.md Adds repo guidance for Claude Code sessions (project structure, commands, conventions)
.vscode/settings.json Updates Copilot Chat skill discovery locations (currently has issues)
.markdownlint-cli2.jsonc Ignores .venv/ folders for markdownlint scanning
.github/skills/experimental/graphify/uv.lock Adds locked Python dependency resolution for the new skill
.github/skills/experimental/graphify/tests/test_graphify_wrapper.py Adds pytest coverage for the CLI wrapper behavior
.github/skills/experimental/graphify/tests/fuzz_harness.py Adds a fuzz harness for wrapper validation (currently has issues)
.github/skills/experimental/graphify/scripts/graphify_wrapper.py Implements a thin subprocess wrapper around the graphify CLI
.github/skills/experimental/graphify/pyproject.toml Defines Python project config, dependency groups, ruff/pytest config
.github/skills/experimental/graphify/SKILL.md Skill documentation for building graphs + MCP server registration + operational notes
.github/instructions/experimental/graphify.instructions.md Adds instructions governing graphify-out/** output handling and evidence reporting
.github/agents/experimental/graph-researcher.agent.md Adds agent behavior for MCP tool selection and audit-tagged reporting
.cspell.json Adds allowlist entries for graphify-related terminology

Comment thread .github/instructions/experimental/graphify.instructions.md
Comment thread .github/skills/experimental/graphify/tests/fuzz_harness.py Outdated
Comment thread .github/skills/experimental/graphify/pyproject.toml
Comment thread docs/agents/graphify/README.md
Comment thread .github/skills/experimental/graphify/SKILL.md
Comment thread .github/agents/experimental/graph-researcher.agent.md
Comment thread .vscode/settings.json Outdated
Comment thread .vscode/settings.json Outdated
Comment thread .vscode/settings.json Outdated
Comment thread docs/agents/graphify/README.md
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 4, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.81%. Comparing base (57ea279) to head (9bc799f).

Files with missing lines Patch % Lines
.../experimental/graphify/scripts/graphify_wrapper.py 94.11% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1518      +/-   ##
==========================================
- Coverage   87.44%   84.81%   -2.63%     
==========================================
  Files          68       52      -16     
  Lines       10335     7093    -3242     
==========================================
- Hits         9037     6016    -3021     
+ Misses       1298     1077     -221     
Flag Coverage Δ
pester 84.79% <ø> (-0.02%) ⬇️
pytest 94.11% <94.11%> (+0.96%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../experimental/graphify/scripts/graphify_wrapper.py 94.11% <94.11%> (ø)

... and 18 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This introduces a new agent and supporting skill for structural codebase analysis using knowledge graphs.

The `Graph Researcher` agent answers complex structural questions by querying a `graphify`-built knowledge graph, while the `Graphify` skill provides the capability to build and manage these graphs.

Key changes include:
- Added `Graph Researcher` agent definition and `Graphify` instruction file.
- Introduced `graphify` Python skill, including its wrapper, dependencies (`graphifyy`), and fuzz tests.
- Updated `experimental` and `hve-core-all` collections to include the new agent and skill.
- Added `graphify` and `graphifyy` to the spell check dictionary.
- Expanded `chat.agentSkillsLocations` in `.vscode/settings.json`.
- Updated `CLAUDE.md` with detailed Python skill conventions for testing and packaging.
feat(graphify): document Graph Research agent and workflow

feat(graphify): Add fuzz corpus seeds for mode argument parsing

Introduces a comprehensive set of seed inputs for the Atheris fuzz harness
in `tests/fuzz_harness.py`. These seeds cover various scenarios for the
`mode` argument passed to `graphify_wrapper.build_graph`, enhancing the
robustness and coverage of its mode parsing logic.

The corpus includes seeds for:
- Empty and standard inputs
- Valid modes (`fast`, `standard`, `deep`)
- Unknown modes (expected to raise `ValueError`)
- Edge cases like null bytes, unicode characters, and long inputs
  to test truncation and decoding error paths.

feat(graphify): Add code coverage reporting for tests

Integrates `pytest-cov` and configures `coverage.py` for the
`graphify` experimental skill.

This enables measurement and reporting of code coverage during test runs,
specifically targeting the Python scripts within the `scripts` directory.
The configuration will also show missing lines in the coverage report,
aiding in identifying areas needing more test coverage.

feat(graphify): Improve table formatting in Graph Research README

feat(graphify): Upgrade Python to 3.11 and refine skill development configuration

This commit updates the `graphify` experimental skill to require Python 3.11,
aligning its dependencies and `ruff` target version.

The fuzz harness for the skill is also updated to prevent unintentional execution
by only running when explicitly enabled. Furthermore, `.vscode/settings.json` is
cleaned up to standardize skill directory exclusions, removing outdated and
redundant paths.
This commit regenerates `uv.lock` to fully align the `graphify` skill's
dependencies with the Python 3.11 requirement.

It removes Python 3.10-specific package versions, conditional
dependencies, and packages that are now part of the Python 3.11 standard
library (e.g., `exceptiongroup`, `tomli`, and associated `typing-extensions`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants