Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
bb5b2b1
feat: implement hierarchical dispatch model for meta orchestrator
m2ux Apr 8, 2026
0f295cd
chore: update engineering submodule to reflect new workflows branch
m2ux Apr 8, 2026
46deca0
fix(dispatch_workflow): load worker prompt from workflow resources
m2ux Apr 8, 2026
ce3444b
fix(tests): point WORKFLOW_DIR to .engineering/workflows and fix sche…
m2ux Apr 8, 2026
bc2e99d
chore: update engineering submodule pointer
m2ux Apr 8, 2026
b468c67
feat: deprecate executionModel, fix response object in dispatch_workflow
m2ux Apr 8, 2026
5a602b7
feat: complete removal of deprecated executionModel
m2ux Apr 8, 2026
d49e5a5
refactor(tools): remove hardcoded fallback prompt from dispatch_workflow
m2ux Apr 8, 2026
5e2f409
docs: restore Placeholder Reference in worker prompt template
m2ux Apr 8, 2026
614106c
refactor(core): update server and tests for hierarchical roles
m2ux Apr 8, 2026
16521b1
build: update engineering submodule for rule subsumption
m2ux Apr 8, 2026
fe8569d
build: update engineering submodule for documentation fixes
m2ux Apr 8, 2026
c317c9e
build: update engineering submodule for frontmatter fixes
m2ux Apr 8, 2026
cc7cd9d
chore(submodule): update engineering submodule pointer for bootstrap …
m2ux Apr 8, 2026
a6bda86
chore(submodule): update engineering submodule pointer for orchestrat…
m2ux Apr 8, 2026
1675bff
chore(submodule): update engineering pointer for frontmatter fix
m2ux Apr 8, 2026
b858e5e
chore(submodule): update engineering pointer for README diagram
m2ux Apr 8, 2026
98ff6ab
chore(submodule): update engineering pointer for strict checkpoint rules
m2ux Apr 8, 2026
1414d1e
chore(submodule): update engineering pointer and fix mcp test for pro…
m2ux Apr 8, 2026
c96aaad
chore(submodule): update engineering pointer for strict JSON checkpoi…
m2ux Apr 8, 2026
e54ec8c
chore: bump .engineering submodule
m2ux Apr 8, 2026
bb30fbb
chore: add result.json
m2ux Apr 8, 2026
0fc2429
chore: update result.json
m2ux Apr 8, 2026
6d1f2fe
chore: bump .engineering submodule
m2ux Apr 9, 2026
586665c
chore: bump .engineering submodule
m2ux Apr 9, 2026
6187536
Revert "chore: bump .engineering submodule"
m2ux Apr 9, 2026
210091c
Revert "chore: bump .engineering submodule"
m2ux Apr 9, 2026
51be4c2
fix(tests): restore test paths to point to workflows directory
m2ux Apr 9, 2026
eea997b
fix: remove available_workflows from discover tool output
m2ux Apr 9, 2026
2baee57
docs: update workflow submodule pointer to include bootstrap guide ch…
m2ux Apr 9, 2026
9d5dfc2
fix: resolve foreign skill references and prevent unassigned get_skil…
m2ux Apr 9, 2026
fd5e217
Support activity-level skills in get_skill tool
m2ux Apr 9, 2026
304e9a6
feat: Make agent_id required for start_session tool
m2ux Apr 10, 2026
f1123d9
docs: Update start_session references to include required agent_id
m2ux Apr 10, 2026
03771c1
docs: Add dispatch_workflow and get_workflow_status to api-reference
m2ux Apr 10, 2026
3329740
chore: Update engineering submodule to latest planning state
m2ux Apr 10, 2026
0d72caa
docs: Add Returns column to API reference tables
m2ux Apr 10, 2026
c73b55c
docs: Move Returns column before Description in API reference tables
m2ux Apr 10, 2026
78df15c
docs: Clarify dispatch_workflow returns worker_prompt for client sub-…
m2ux Apr 10, 2026
a763035
refactor: Rename worker_prompt to client_prompt for clarity
m2ux Apr 10, 2026
c78eac3
chore: Update engineering submodule
m2ux Apr 10, 2026
a795f83
docs: make step_id optional in get_skill API reference
m2ux Apr 10, 2026
0afc911
refactor: remove redundant activity_id param from get_checkpoint tool
m2ux Apr 10, 2026
eaf136f
chore: bump .engineering submodule pointer
m2ux Apr 10, 2026
c3a5661
Implement JIT checkpoint architecture, trusting worker sequence
m2ux Apr 10, 2026
c0b4e81
Add checkpoint binding to Step schema
m2ux Apr 10, 2026
9af04db
Update submodule for worker skill prompt update
m2ux Apr 10, 2026
0190a8c
feat(workflows): bump engineering submodule for checkpoint binding
m2ux Apr 10, 2026
2e41d6c
docs(meta): bump engineering submodule for workflow-bootstrap restore
m2ux Apr 10, 2026
b7e2820
docs(meta): bump engineering submodule to sync orchestrator skills
m2ux Apr 10, 2026
40852e7
docs(meta): bump engineering submodule for resource re-enumeration
m2ux Apr 10, 2026
367ab0e
docs: remove references to deprecated meta workflow activities
m2ux Apr 10, 2026
3c8b878
chore: update engineering submodule
m2ux Apr 10, 2026
080d8cf
Fix get_skill tool to support workflow skills when no activity is act…
m2ux Apr 10, 2026
a9417d3
Update checkpoint mechanics in meta-orchestrator, workflow-orchestrat…
m2ux Apr 10, 2026
bc62d61
Fix workflow-orchestrator instructions: parent meta-orchestrator call…
m2ux Apr 10, 2026
88356d2
Refactor prompts to rely on skills for redundant rules and protocols
m2ux Apr 10, 2026
485fdfb
Update submodule
m2ux Apr 10, 2026
f960d3b
Remove start_session from activity-worker bootstrap
m2ux Apr 10, 2026
60a4aeb
Manual user changes to meta resources and skills
m2ux Apr 10, 2026
bef5f0d
Remove redundant checkpoint handling protocol from meta-orchestrator …
m2ux Apr 11, 2026
d03ee87
Remove redundant dispatch protocol from meta-orchestrator guide
m2ux Apr 11, 2026
c95d908
Clean up duplicate protocol sections in workflow-orchestrator skill
m2ux Apr 11, 2026
f0a8976
Ensure parameter fidelity for API calls in orchestrator and worker sk…
m2ux Apr 11, 2026
20cf9a0
docs: Add detailed explanations of dispatch and checkpoint models
m2ux Apr 11, 2026
7ec4133
docs: Add models for state management, artifact management, and resou…
m2ux Apr 11, 2026
55b27c5
docs: Add Architecture Overview index and link from README
m2ux Apr 11, 2026
dd2fe51
chore: clean up transient fix and debug scripts
m2ux Apr 11, 2026
b88c386
chore: update engineering submodule
m2ux Apr 11, 2026
1fffcb6
chore: update engineering submodule
m2ux Apr 11, 2026
18ccbe1
chore: update engineering submodule
m2ux Apr 11, 2026
d73b6b8
chore: update engineering submodule
m2ux Apr 11, 2026
574501d
chore: update engineering submodule for version-control consolidation
m2ux Apr 11, 2026
4b6b37b
chore: update engineering submodule
m2ux Apr 11, 2026
997faa5
fix(workflow-loader.test): align tests with explicit meta prefix and …
m2ux Apr 11, 2026
de0a2ff
chore: update engineering submodule
m2ux Apr 11, 2026
37015d8
docs: replace execution model with orchestration model
m2ux Apr 12, 2026
0f45f03
chore: update engineering submodule
m2ux Apr 13, 2026
4d4f59a
chore: update engineering submodule
m2ux Apr 13, 2026
d6d8b0d
chore: update engineering submodule
m2ux Apr 13, 2026
c408a93
wording update
m2ux Apr 13, 2026
c24157f
refactor: remove blocking and required flags from checkpoints
m2ux Apr 13, 2026
6ae18dd
chore: update .engineering submodule pointer for merge resolution
m2ux Apr 14, 2026
d8ce937
fix(schema): add missing sessionToken field to stateSaveFile definition
m2ux Apr 14, 2026
b70fc59
refactor: move schema definitions from get_workflow response to MCP r…
m2ux Apr 15, 2026
e88c82d
style: pretty-print JSON in tool responses
m2ux Apr 15, 2026
a1a9e04
fix: return plain text instead of JSON for text-heavy tool responses
m2ux Apr 15, 2026
27f418f
feat: serve activities, skills, and resources in native TOON format
m2ux Apr 15, 2026
bf30025
Remove orphaned protocolStep definition from skill schema
m2ux Apr 15, 2026
3040393
feat(list_workflows): replace verbose description with tag-list per w…
m2ux Apr 16, 2026
b3117aa
feat: split next_activity/get_activity, add tags to list_workflows, i…
m2ux Apr 16, 2026
95c0d40
fix: improve session/trace token error messages for agent self-correc…
m2ux Apr 16, 2026
ccd043e
feat: token adoption on server restart, session_id in responses, doc …
m2ux Apr 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,441 changes: 2,441 additions & 0 deletions .build-output.txt

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .claude/rules/concept-rag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

---
# Overview

Before using concept-rag MCP tools, fetch the `concept-rag://activities` resource.
45 changes: 45 additions & 0 deletions .claude/rules/workflow-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
description: Workflow server integration for midnight-platform-eng

---

CRITICAL: Parse all rules *before* making *ANY* tool calls

# Trigger Recognition

Activate workflow execution when the user request matches ANY of these patterns:

## Work Package
- "work package", "start work package", "review work package"
- "new feature", "bug fix", "implement", "enhancement", "refactoring"
- "create issue", "create PR", "plan implementation"

## Work Packages (multi-package)
- "roadmap", "multiple features", "work packages", "initiative"
- "plan and coordinate", "related work items"

## Code Review
- "review pr", "review PR", "PR review"
- "review this pull request", "code review"

## Prism Analysis
- "analyze", "structural analysis", "code analysis", "review code"
- "full prism", "deep analysis", "behavioral analysis"
- "evaluate", "audit code quality"

## Security Audit
- "security audit", "audit codebase", "vulnerability scan"
- "CI/CD audit", "pipeline security", "scan github actions"

## Workflow Lifecycle
- "start workflow", "resume workflow", "continue workflow"
- "where were we", "pick up where I left off"
- "finish workflow", "complete workflow"

## Workflow Design
- "create a workflow", "design a workflow", "update workflow"
- "new workflow", "modify workflow", "review workflow design"

# Bootstrap Sequence

For workflow execution requests, call the `discover` tool on the workflow-server MCP server to learn the bootstrap procedure.
82 changes: 82 additions & 0 deletions .claude/skills/gitnexus/gitnexus-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
name: gitnexus-cli
description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
---

# GitNexus CLI Commands

All commands work via `npx` — no global install required.

## Commands

### analyze — Build or refresh the index

```bash
npx gitnexus analyze
```

Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files.

| Flag | Effect |
| -------------- | ---------------------------------------------------------------- |
| `--force` | Force full re-index even if up to date |
| `--embeddings` | Enable embedding generation for semantic search (off by default) |

**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale.

### status — Check index freshness

```bash
npx gitnexus status
```

Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.

### clean — Delete the index

```bash
npx gitnexus clean
```

Deletes the `.gitnexus/` directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.

| Flag | Effect |
| --------- | ------------------------------------------------- |
| `--force` | Skip confirmation prompt |
| `--all` | Clean all indexed repos, not just the current one |

### wiki — Generate documentation from the graph

```bash
npx gitnexus wiki
```

Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).

| Flag | Effect |
| ------------------- | ----------------------------------------- |
| `--force` | Force full regeneration |
| `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
| `--base-url <url>` | LLM API base URL |
| `--api-key <key>` | LLM API key |
| `--concurrency <n>` | Parallel LLM calls (default: 3) |
| `--gist` | Publish wiki as a public GitHub Gist |

### list — Show all indexed repos

```bash
npx gitnexus list
```

Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.

## After Indexing

1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task

## Troubleshooting

- **"Not inside a git repository"**: Run from a directory inside a git repo
- **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
- **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding
89 changes: 89 additions & 0 deletions .claude/skills/gitnexus/gitnexus-debugging/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
name: gitnexus-debugging
description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\""
---

# Debugging with GitNexus

## When to Use

- "Why is this function failing?"
- "Trace where this error comes from"
- "Who calls this method?"
- "This endpoint returns 500"
- Investigating bugs, errors, or unexpected behavior

## Workflow

```
1. gitnexus_query({query: "<error or symptom>"}) → Find related execution flows
2. gitnexus_context({name: "<suspect>"}) → See callers/callees/processes
3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow
4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed
```

> If "Index is stale" → run `npx gitnexus analyze` in terminal.

## Checklist

```
- [ ] Understand the symptom (error message, unexpected behavior)
- [ ] gitnexus_query for error text or related code
- [ ] Identify the suspect function from returned processes
- [ ] gitnexus_context to see callers and callees
- [ ] Trace execution flow via process resource if applicable
- [ ] gitnexus_cypher for custom call chain traces if needed
- [ ] Read source files to confirm root cause
```

## Debugging Patterns

| Symptom | GitNexus Approach |
| -------------------- | ---------------------------------------------------------- |
| Error message | `gitnexus_query` for error text → `context` on throw sites |
| Wrong return value | `context` on the function → trace callees for data flow |
| Intermittent failure | `context` → look for external calls, async deps |
| Performance issue | `context` → find symbols with many callers (hot paths) |
| Recent regression | `detect_changes` to see what your changes affect |

## Tools

**gitnexus_query** — find code related to error:

```
gitnexus_query({query: "payment validation error"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError, PaymentException
```

**gitnexus_context** — full context for a suspect:

```
gitnexus_context({name: "validatePayment"})
→ Incoming calls: processCheckout, webhookHandler
→ Outgoing calls: verifyCard, fetchRates (external API!)
→ Processes: CheckoutFlow (step 3/7)
```

**gitnexus_cypher** — custom call chain traces:

```cypher
MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
RETURN [n IN nodes(path) | n.name] AS chain
```

## Example: "Payment endpoint returns 500 intermittently"

```
1. gitnexus_query({query: "payment error handling"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError

2. gitnexus_context({name: "validatePayment"})
→ Outgoing calls: verifyCard, fetchRates (external API!)

3. READ gitnexus://repo/my-app/process/CheckoutFlow
→ Step 3: validatePayment → calls fetchRates (external)

4. Root cause: fetchRates calls external API without proper timeout
```
78 changes: 78 additions & 0 deletions .claude/skills/gitnexus/gitnexus-exploring/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: gitnexus-exploring
description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
---

# Exploring Codebases with GitNexus

## When to Use

- "How does authentication work?"
- "What's the project structure?"
- "Show me the main components"
- "Where is the database logic?"
- Understanding code you haven't seen before

## Workflow

```
1. READ gitnexus://repos → Discover indexed repos
2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
4. gitnexus_context({name: "<symbol>"}) → Deep dive on specific symbol
5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
```

> If step 2 says "Index is stale" → run `npx gitnexus analyze` in terminal.

## Checklist

```
- [ ] READ gitnexus://repo/{name}/context
- [ ] gitnexus_query for the concept you want to understand
- [ ] Review returned processes (execution flows)
- [ ] gitnexus_context on key symbols for callers/callees
- [ ] READ process resource for full execution traces
- [ ] Read source files for implementation details
```

## Resources

| Resource | What you get |
| --------------------------------------- | ------------------------------------------------------- |
| `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) |
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) |
| `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) |
| `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) |

## Tools

**gitnexus_query** — find execution flows related to a concept:

```
gitnexus_query({query: "payment processing"})
→ Processes: CheckoutFlow, RefundFlow, WebhookHandler
→ Symbols grouped by flow with file locations
```

**gitnexus_context** — 360-degree view of a symbol:

```
gitnexus_context({name: "validateUser"})
→ Incoming calls: loginHandler, apiMiddleware
→ Outgoing calls: checkToken, getUserById
→ Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)
```

## Example: "How does payment processing work?"

```
1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes
2. gitnexus_query({query: "payment processing"})
→ CheckoutFlow: processPayment → validateCard → chargeStripe
→ RefundFlow: initiateRefund → calculateRefund → processRefund
3. gitnexus_context({name: "processPayment"})
→ Incoming: checkoutHandler, webhookHandler
→ Outgoing: validateCard, chargeStripe, saveTransaction
4. Read src/payments/processor.ts for implementation details
```
64 changes: 64 additions & 0 deletions .claude/skills/gitnexus/gitnexus-guide/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: gitnexus-guide
description: "Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\""
---

# GitNexus Guide

Quick reference for all GitNexus MCP tools, resources, and the knowledge graph schema.

## Always Start Here

For any task involving code understanding, debugging, impact analysis, or refactoring:

1. **Read `gitnexus://repo/{name}/context`** — codebase overview + check index freshness
2. **Match your task to a skill below** and **read that skill file**
3. **Follow the skill's workflow and checklist**

> If step 1 warns the index is stale, run `npx gitnexus analyze` in the terminal first.

## Skills

| Task | Skill to read |
| -------------------------------------------- | ------------------- |
| Understand architecture / "How does X work?" | `gitnexus-exploring` |
| Blast radius / "What breaks if I change X?" | `gitnexus-impact-analysis` |
| Trace bugs / "Why is X failing?" | `gitnexus-debugging` |
| Rename / extract / split / refactor | `gitnexus-refactoring` |
| Tools, resources, schema reference | `gitnexus-guide` (this file) |
| Index, status, clean, wiki CLI commands | `gitnexus-cli` |

## Tools Reference

| Tool | What it gives you |
| ---------------- | ------------------------------------------------------------------------ |
| `query` | Process-grouped code intelligence — execution flows related to a concept |
| `context` | 360-degree symbol view — categorized refs, processes it participates in |
| `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence |
| `detect_changes` | Git-diff impact — what do your current changes affect |
| `rename` | Multi-file coordinated rename with confidence-tagged edits |
| `cypher` | Raw graph queries (read `gitnexus://repo/{name}/schema` first) |
| `list_repos` | Discover indexed repos |

## Resources Reference

Lightweight reads (~100-500 tokens) for navigation:

| Resource | Content |
| ---------------------------------------------- | ----------------------------------------- |
| `gitnexus://repo/{name}/context` | Stats, staleness check |
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores |
| `gitnexus://repo/{name}/cluster/{clusterName}` | Area members |
| `gitnexus://repo/{name}/processes` | All execution flows |
| `gitnexus://repo/{name}/process/{processName}` | Step-by-step trace |
| `gitnexus://repo/{name}/schema` | Graph schema for Cypher |

## Graph Schema

**Nodes:** File, Function, Class, Interface, Method, Community, Process
**Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS

```cypher
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
RETURN caller.name, caller.filePath
```
Loading