AI & Agentslow risk

metagit-graph-maintain

Discover, suggest, promote, validate, and ingest cross-repo graph.relationships in .metagit.yml for GitNexus overlay and dependency maps. Use for first-time graph bootstrap or ongoing workspace graph maintenance.

metagit-ai/metagit-cli·skills/metagit-graph-maintain/SKILL.md
34/ 100Recommendation

Install this skill

Choose your coding agent and copy a project or personal installation command.

Pinned to the indexed commit
Project installation.agents/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a codex -y
Personal installation~/.agents/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a codex -g -y
Manual folder.agents/skills/metagit-graph-maintainOfficial docs ↗
Project installation.claude/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a claude-code -y
Personal installation~/.claude/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a claude-code -g -y
Manual folder.claude/skills/metagit-graph-maintainOfficial docs ↗
Project installation.agents/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a github-copilot -y
Personal installation~/.copilot/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a github-copilot -g -y
Manual folder.agents/skills/metagit-graph-maintainOfficial docs ↗
Project installation.agents/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a cursor -y
Personal installation~/.cursor/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a cursor -g -y
Manual folder.agents/skills/metagit-graph-maintainOfficial docs ↗
Project installation.agents/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a gemini-cli -y
Personal installation~/.gemini/skills/metagit-graph-maintain
npx skills add https://github.com/metagit-ai/metagit-cli/tree/482dfb3b7a407ca5e541657a6fcc9af619818243/skills/metagit-graph-maintain -a gemini-cli -g -y
Native Gemini CLIgemini skills install https://github.com/metagit-ai/metagit-cli.git --scope workspace --path skills/metagit-graph-maintain
Manual folder.agents/skills/metagit-graph-maintainOfficial docs ↗
⚠ Installation uses the open-source skills CLI. Inspect the source and permissions before running the command.

Skill instructions

View source on GitHub ↗
# Workspace graph maintenance

Use this skill to discover and keep durable cross-repo edges in `.metagit.yml` `graph.relationships`, then sync them into GitNexus.

## When to use

| Phase | Trigger |
|-------|---------|
| **Discover** | New umbrella workspace, empty `graph.relationships`, or first graph authoring pass |
| **Maintain** | After adding repos, promoting inferred deps, or refreshing GitNexus overlay |

## First-time discovery (report only)

Do **not** apply until the operator approves the discovery report.

```bash
export METAGIT_AGENT_MODE=true
metagit prompt workspace -c .metagit.yml -k graph-discover --text-only
metagit workspace list -c .metagit.yml --json
metagit config graph suggest -c .metagit.yml --json --include-declared --min-confidence all
```

Deliver a **Graph Discovery Report**:

- inferred edges grouped by confidence (`high` / `medium` / `low`)
- gap pairs with no machine path (need operator interview)
- `proposed_manual_edges[]` from interview answers
- `operations_preview` JSON — **not applied**

After sign-off, continue with the maintenance workflow below (or `metagit prompt workspace -k graph-maintain`).

## Maintenance workflow

### 1. Bootstrap context

```bash
export METAGIT_AGENT_MODE=true
metagit prompt workspace -c .metagit.yml -k graph-maintain --text-only
metagit workspace list -c .metagit.yml --json
```

### 2. Suggest candidates

```bash
metagit config graph suggest -c .metagit.yml --json
metagit config graph suggest -c .metagit.yml --min-confidence high --json
```

MCP: `metagit_suggest_graph_relationships`

Review `candidates[]` for `confidence`, `evidence`, and `source_edge_type`. Skip low-confidence edges unless the operator approves.

### 3. Preview and apply

```bash
# Save operations from suggest JSON to ops.json, then:
metagit config preview -c .metagit.yml --file ops.json

# Apply all suggested candidates (medium+ confidence by default)
metagit config graph suggest -c .metagit.yml --apply

# Apply selected ids only
metagit config graph suggest -c .metagit.yml --apply \
  --candidate-id alpha-api-to-beta-worker-depends_on

metagit config validate -c .metagit.yml
```

MCP: `metagit_apply_graph_relationships` (`dry_run: true` to preview, `save: true` to persist)

### 4. Export and ingest GitNexus overlay

```bash
./skills/metagit-gitnexus/scripts/ingest-workspace-graph.sh -c .metagit.yml
```

Or manually:

```bash
metagit config graph export -c .metagit.yml --format tool-calls --output /tmp/graph-tool-calls.json
```

Then run each `gitnexus_cypher` call (or use the ingest script).

### 5. Refresh per-repo indexes

```bash
./skills/metagit-gitnexus/scripts/analyze-targets.sh <workspace_root> <project>
```

### 6. Sync GitNexus group (cross-index)

After repos are indexed, align the workspace with a GitNexus group:

```bash
./skills/metagit-gitnexus/scripts/sync-group.sh -c .metagit.yml
# MCP: metagit_gitnexus_group_sync
```

Enables `gitnexus group query` / `group impact` across member repos.

## Output contract

Return:

- candidate count and applied count
- validation result after apply
- GitNexus ingest status (schema + statement count)
- repos still stale/missing in GitNexus registry

## Safety

- Default `--min-confidence medium`; require operator approval for `--min-confidence all`
- Never remove or rewrite existing manual relationships
- Use `--dry-run` / `dry_run: true` before first apply in a workspace
- Do not ingest Cypher until `metagit config validate` passes