Skip to content

Consolidate agent docs and add LeanSpec MCP server configuration#22

Merged
tikazyq merged 5 commits intomainfrom
claude/investigate-synodic-leanspec-N93y4
Mar 18, 2026
Merged

Consolidate agent docs and add LeanSpec MCP server configuration#22
tikazyq merged 5 commits intomainfrom
claude/investigate-synodic-leanspec-N93y4

Conversation

@tikazyq
Copy link
Contributor

@tikazyq tikazyq commented Mar 18, 2026

Summary

This PR consolidates agent documentation and establishes MCP (Model Context Protocol) integration for spec management. The changes enforce spec creation/mutation through the LeanSpec MCP server rather than direct file writes, ensuring validation rules are applied consistently.

Key Changes

  • Removed AGENTS.md — Consolidated agent instructions into CLAUDE.md as the single source of truth
  • Created new AGENTS.md — Now a redirect file pointing to CLAUDE.md for backward compatibility
  • Added .mcp.json — Registers the LeanSpec MCP server (@leanspec/mcp) for Claude Code integration
  • Expanded CLAUDE.md — Added comprehensive "Spec Management via MCP" section documenting:
    • Requirement to use MCP tools for all spec creation/mutation in specs/
    • Complete reference table of available MCP tools (create, update, validate, view, list, search, relationships, board, stats, etc.)
    • Rationale for MCP enforcement (validation gatekeeper, dependency integrity, scope overlap detection)
    • Clarification that Fractal's internal working artifacts use direct file writes (not MCP-managed)
    • Configuration details (.mcp.json at repo root, no manual setup needed)
  • Updated conventions — Added explicit guidance: "Spec writes via MCP: Always use LeanSpec MCP tools (create, update) — never write spec files directly"

Implementation Details

The MCP server acts as a validation gatekeeper, enforcing rules defined in .lean-spec/config.json (400-line max, 5000-token max, required frontmatter) that cannot be bypassed with direct file writes. This ensures all project-level specs maintain structural integrity and dependency consistency.

https://claude.ai/code/session_01Y967chCVSr6E7ao8oDKJi2

claude added 5 commits March 18, 2026 22:06
Agents were creating/modifying specs via direct file writes, bypassing
the validation rules defined in .lean-spec/config.json (400-line max,
5000-token max, required frontmatter, dependency integrity). The MCP
server makes these rules structural — agents must use create/update
tools which validate before writing to disk.

- Add .mcp.json registering @leanspec/mcp server
- Update CLAUDE.md with MCP tool reference and enforcement rule
- Update AGENTS.md with spec-writes-via-MCP convention
- Update Factory/Fractal skills to reference MCP tools

https://claude.ai/code/session_01Y967chCVSr6E7ao8oDKJi2
Fractal's internal sub-specs (.fractal/{work-id}/tree/**/spec.md) are
ephemeral decomposition nodes — gitignored, structurally different from
project specs, discarded after each run. LeanSpec MCP enforcement only
applies to project-level specs in specs/.

https://claude.ai/code/session_01Y967chCVSr6E7ao8oDKJi2
LeanSpec is for Synodic feature development, not for the execution
skills (Factory, Fractal, etc.) which are pattern-agnostic.

https://claude.ai/code/session_01Y967chCVSr6E7ao8oDKJi2
Single source of truth — no more drift between the two files.

https://claude.ai/code/session_01Y967chCVSr6E7ao8oDKJi2
Tested against live server output. link/unlink don't exist — it's
`relationships` with action param. Added `children` tool. Updated
descriptions to match actual tool schemas.

https://claude.ai/code/session_01Y967chCVSr6E7ao8oDKJi2
Copilot AI review requested due to automatic review settings March 18, 2026 22:17
@tikazyq tikazyq merged commit 1b9ee8f into main Mar 18, 2026
4 checks passed
@tikazyq tikazyq deleted the claude/investigate-synodic-leanspec-N93y4 branch March 18, 2026 22:17
Copy link

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

Consolidates agent-facing documentation into CLAUDE.md and adds an MCP configuration to route specs/ creation/mutation through the LeanSpec MCP server for consistent validation.

Changes:

  • Added “Spec Management via MCP” guidance to CLAUDE.md, including tool references and an explicit “spec writes via MCP” convention.
  • Replaced AGENTS.md with a backward-compatibility pointer to CLAUDE.md.
  • Added root .mcp.json to register the @leanspec/mcp server for Claude Code integration.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
CLAUDE.md Documents MCP-based spec management rules and updates conventions.
AGENTS.md Redirect/pointer to CLAUDE.md for compatibility.
.mcp.json Registers the LeanSpec MCP server via npx.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

"mcpServers": {
"leanspec": {
"command": "npx",
"args": ["-y", "@leanspec/mcp"]
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