agentleFS
dmgrokdmgrok/mcp_mother_skills/.github/copilot-instructions.md

mcp_mother_skills

Copilot instructions4 starsChanged 10 months agoMITView on GitHub

Only at the very start of a NEW conversation (when no context exists yet), call setup (for first-time use) or sync_skills (for ongoing updates) to ensure project-relevant skills are loaded. Do NOT call these repeatedly during the same conversation unless explicitly requested by the user. This is an MCP (Model Context Protocol) server that dynamically provisions AI agent skills based on project tech stack detection. It supports both Claude and GitHub Copilot agents.

The file

We split this copilot-instructions.md into the rules it gives an agent

11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All imports must use .js extension: import { X } from './types.js'

    line 42
  2. Very specific:

    All types live in src/types.ts.

    line 46
  3. Very specific:

    Test files mirror source: src/foo.ts → tests/foo.test.ts

    line 81
  4. Very specific:

    Add tool definition to TOOLS array in src/index.ts with inputSchema

    line 91
  5. Very specific:

    Create handler function handleToolName(params: TypedParams)

    line 92
  6. Very specific:

    Add case in CallToolRequestSchema switch statement

    line 93
  7. Very specific:

    Add param types to src/types.ts

    line 94
  8. Distinctive:

    When updating the project version (for new features or bug fixes), ensure version coherency across ALL files:

    line 111
  9. Very specific:

    package.json: - Update "version" field following semantic versioning:

    line 113
  10. Very specific:

    src/index.ts: - Update MCP server version to match package.json:

    line 127
  11. Very specific:

    Documentation: - Update README, docs/index.html, and any version references

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Mother MCP Skills - AI Coding Instructions

Startup

Only at the very start of a NEW conversation (when no context exists yet), call setup (for first-time use) or sync_skills (for ongoing updates) to ensure project-relevant skills are loaded. Do NOT call these repeatedly during the same conversation unless explicitly requested by the user.

Project Overview

This is an MCP (Model Context Protocol) server that dynamically provisions AI agent skills based on project tech stack detection. It supports both Claude and GitHub Copilot agents.

Core Architecture

index.ts               → MCP server entry, tool definitions, request routing
├── agent-detector.ts       → Detects Claude vs Copilot (env vars, client info, project structure)
├── project-detector.ts     → Scans files to detect tech stack (packages, configs, README)
├── enhanced-detector.ts    → Tiered detection: GitHub SBOM → Specfy → Local fallback
├── github-sbom-client.ts   → GitHub SBOM API client with PURL parsing
├── registry-client.ts      → Fetches skills from GitHub registries with caching
├── skill-installer.ts      → Downloads/installs skills to agent-specific paths
├── config-manager.ts       → YAML config handling (.mcp/mother/)
├── agent-profiles.ts       → Agent path configurations (claude → .claude/, copilot → .github/)
└── types.ts                → All shared TypeScript interfaces

Data Flow

  1. sync_skills tool called → EnhancedProjectDetector uses 3-tier detection (GitHub SBOM → Specfy → Local) → matches against RegistryClient skills → SkillInstaller downloads to .github/skills or .claude/skills

Development Commands

npm run build      # TypeScript compilation to dist/
npm run dev        # Run with tsx (no compile step)
npm test           # Vitest test suite
npm run test:watch # Watch mode for TDD

Key Patterns

Module System

  • ESM-only ("type": "module" in package.json)
  • All imports must use .js extension: import { X } from './types.js'
  • Target: ES2022 with NodeNext module resolution

Type Definitions

All types live in src/types.ts. Key interfaces:

  • AgentId: 'claude' | 'copilot' | 'codex' | 'generic'
  • DetectedStack: { languages, frameworks, databases, infrastructure, tools }
  • RegistrySkill: Skill metadata with triggers (packages[], files[])
  • SyncResult: Operation result with added/updated/removed/unchanged

Agent Detection Priority (in agent-detector.ts)

  1. Explicit config override (config.agent.force)
  2. Environment variables (CLAUDE_CODE, GITHUB_COPILOT, CODEX_HOME)
  3. MCP client info string
  4. Project structure (.claude/, .codex/skills/, CLAUDE.md, AGENTS.md, .github/copilot-instructions.md)
  5. Home directory (~/.claude/skills, ~/.copilot/skills, ~/.codex/skills)
  6. Fallback to generic

Codex Compatibility

Skills follow the Open Agent Skills Standard:

  • Codex skills stored in .codex/skills/ per OpenAI spec
  • SKILL.md frontmatter uses name + description (required)
  • Optional: scripts/, references/, assets/ directories

Skill Matching (in skill-installer.ts)

Skills match via triggers defined in registry:

  • packages: Check against package.json dependencies
  • files: Glob patterns in project root
  • readme_keywords: Extracted from README.md

Config Storage

Mother uses .mcp/mother/ directory:

  • config.yaml: User preferences (agent mode, registry sources, include/exclude lists)
  • project-context.yaml: Auto-generated detection results
  • cache/: Registry response cache

Testing Conventions

  • Tests use Vitest with mocked fs/promises
  • Test files mirror source: src/foo.ts → tests/foo.test.ts
  • Mock external dependencies (filesystem, network) at module level with vi.mock()
  • Example pattern in tests/skill-installer.test.ts:
vi.mock('fs/promises');
const mockConfig: MotherConfig = { ...defaultConfig, skills: { always_include: ['react'] } };

Adding New Tools

  1. Add tool definition to TOOLS array in src/index.ts with inputSchema
  2. Create handler function handleToolName(params: TypedParams)
  3. Add case in CallToolRequestSchema switch statement
  4. Add param types to src/types.ts

Skill File Format

Skills use SKILL.md with YAML frontmatter (see examples/skills/example-skill/SKILL.md):

---
name: skill-name
version: "1.0.0"
description: "What this skill does"
dependencies: [other-skill]
---
# Skill instructions in markdown...

Version Management

When updating the project version (for new features or bug fixes), ensure version coherency across ALL files:

  1. package.json - Update "version" field following semantic versioning:
    • Patch (0.2.0 → 0.2.1): Bug fixes, minor changes
    • Minor (0.2.1 → 0.3.0): New features, backwards compatible
    • Major (0.3.0 → 1.0.0): Breaking changes
  2. CHANGELOG.md - Move [Unreleased] to new version section:
    ## [Unreleased]
    
    ## [0.3.0] - YYYY-MM-DD
    ### Added
    - New feature description
  3. src/index.ts - Update MCP server version to match package.json:
    const server = new Server({
      name: 'mcp-mother-skills',
      version: '0.3.0',  // Must match package.json
    })
  4. Documentation - Update README, docs/index.html, and any version references

Always keep these versions synchronized to maintain consistency across the project.

Documentation Updates

Whenever there is a new feature, update:

  • README.md (usage examples, command table)
  • CHANGELOG.md (with version and date)
  • docs/index.html (static docs webpage)
  • Any relevant guide files in docs/

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.