agentleFS
conorluddyconorluddy/xclaude-plugin/CLAUDE.md

xclaude-plugin

CLAUDE.md182 starsChanged 13 months agoMITView on GitHub

This file provides essential guidance to Claude Code when working with the xclaude-plugin repository. xclaude-plugin is a production-ready MCP (Model Context Protocol) plugin for iOS development automation. It provides 8 modular, workflow-specific MCP servers that consolidate 23 iOS operations across build, test, simulator control, and UI automation. Status: ✅ Production-ready (v0.4.0) - All operations fully implemented, tested, and with codecov integration. Key Features: Default Load (in .mcp.json): Optional Load (documented in README): Users can customize .mcp.json to load any combination…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    IMPORTANT: Always follow CODESTYLE.md when writing or modifying code.

    line 79
  2. Very specific:

    Zero tolerance for any: - All types explicitly defined (MCP SDK constraint exception documented)

    line 83
  3. Distinctive:

    No silent failures: - Always handle and log errors

    line 84
  4. Very specific:

    Constants over magic numbers: - All config in constants.ts per server

    line 85
  5. Distinctive:

    Progressive disclosure: - Document essentials, details on-demand

    line 86
  6. Distinctive:

    Function size: - Prefer <50 lines, maximum 100 lines

    line 87
  7. Distinctive:

    Security first: - Use spawn (not shell) for command execution

    line 88
  8. Distinctive:

    Comprehensive JSDoc: - All public APIs must be documented

    line 89
  9. Very specific:

    Implement operation: - Add to src/operations/ with JSDoc

    line 103
  10. Distinctive:

    Define types: - Update types in same file or shared types

    line 104
  11. Very specific:

    Add tests: - Create matching .test.ts file with full coverage

    line 105
  12. Distinctive:

    Update README: - Document in server-specific README

    line 106
  13. Very specific:

    Build & validate: - Ensure npm run build && npm run test passes

    line 107
  14. Distinctive:

    All external commands use spawn-based execution:

    line 193

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
CLAUDE.md

CLAUDE.md - AI Assistant Context

This file provides essential guidance to Claude Code when working with the xclaude-plugin repository.

Project Overview

xclaude-plugin is a production-ready MCP (Model Context Protocol) plugin for iOS development automation. It provides 8 modular, workflow-specific MCP servers that consolidate 23 iOS operations across build, test, simulator control, and UI automation.

Status: ✅ Production-ready (v0.4.0) - All operations fully implemented, tested, and with codecov integration.

Key Features:

  • 8 modular MCP servers - Workflow-specific, composable architecture
  • 23 total operations across Xcode, Simulator, and IDB domains
  • 8 procedural Skills (on-demand documentation with examples)
  • 100% TypeScript with zero tolerance for any types
  • Full test coverage with codecov reporting

Repository Structure

xclaude-plugin/
├── README.md                      # User-facing plugin documentation
├── CLAUDE.md                      # This file - AI assistant context
├── CODESTYLE.md                   # Development guidelines
├── .claude-plugin/                # Plugin configuration
│   ├── plugin.json               # Plugin manifest (entry point)
│   └── marketplace.json          # Marketplace configuration
├── mcp-servers/                   # 8 modular MCP servers
│   ├── xc-build/                 # Build, clean, list schemes
│   ├── xc-launch/                # Simulator lifecycle: install and launch
│   ├── xc-interact/              # Simulator + IDB UI automation
│   ├── xc-ai-assist/             # AI-specific workflows
│   ├── xc-setup/                 # Health check, project info
│   ├── xc-testing/               # Test execution, results parsing
│   ├── xc-meta/                  # Metadata and introspection
│   └── xc-all/                   # All-in-one consolidated server
│   └── [each server]/
│       ├── src/
│       │   ├── index.ts          # Server entry point
│       │   └── operations/       # Operation implementations
│       ├── package.json
│       ├── tsconfig.json
│       └── dist/                 # Compiled JavaScript (committed for distribution)
├── skills/                        # 8 procedural Skills (on-demand)
│   ├── xcode-workflows/
│   ├── simulator-workflows/
│   ├── ui-automation-workflows/
│   ├── accessibility-testing/
│   ├── ios-testing-patterns/
│   ├── crash-debugging/
│   ├── performance-profiling/
│   └── state-management/
├── .mcp.json                      # Default MCP configuration (loads xc-setup, xc-build)
├── .mcp.json.example              # Full configuration showing all 8 servers
└── .gitignore                     # Version control exclusions

Default vs Optional Servers

Default Load (in .mcp.json):

  • xc-setup - Environment validation, project introspection
  • xc-build - Build, clean, list schemes

Optional Load (documented in README):

  • xc-launch - Simulator lifecycle: install and launch app
  • xc-testing - Test execution and result analysis
  • xc-interact - Simulator and IDB UI automation
  • xc-ai-assist - AI-specific workflows
  • xc-meta - Metadata and introspection
  • xc-all - All 24 operations in one server

Users can customize .mcp.json to load any combination of servers based on their workflow.

Code Style Principles

IMPORTANT: Always follow CODESTYLE.md when writing or modifying code.

Key principles across all servers:

  • Zero tolerance for any - All types explicitly defined (MCP SDK constraint exception documented)
  • No silent failures - Always handle and log errors
  • Constants over magic numbers - All config in constants.ts per server
  • Progressive disclosure - Document essentials, details on-demand
  • Function size - Prefer <50 lines, maximum 100 lines
  • Security first - Use spawn (not shell) for command execution
  • Comprehensive JSDoc - All public APIs must be documented
  • Consistent error handling - Structured error responses

Pre-commit validation:

npm run build          # TypeScript compilation for all servers
npm run test           # Run test suites for all servers
npm run coverage       # Generate coverage reports

When Adding/Modifying Operations

  1. Add to specific server - Choose appropriate server (or add to xc-all if generic)
  2. Implement operation - Add to src/operations/ with JSDoc
  3. Define types - Update types in same file or shared types
  4. Add tests - Create matching .test.ts file with full coverage
  5. Update README - Document in server-specific README
  6. Build & validate - Ensure npm run build && npm run test passes

Development Commands

# Build all servers
npm run build              # TypeScript compilation

# Testing
npm run test               # Run all tests
npm run coverage           # Generate coverage reports

# Individual server commands (from root)
npm run build --workspace=xc-build      # Build specific server
npm run test --workspace=xc-build       # Test specific server

# Development
npm run clean              # Remove all dist/ directories

Testing Strategy

All servers include:

  • Unit tests for each operation
  • Integration tests for workflows
  • Edge case coverage
  • Error handling validation

Coverage target: >80% (enforced by codecov integration)

Tests run via:

npm run test           # All servers
npm run test --workspace=xc-setup  # Specific server
npm run coverage       # Generate reports for CI

Key Implementation Details

Server Architecture

Each server in mcp-servers/ follows the same pattern:

// src/index.ts - Server entry point
export const server = new Server({
  name: "xc-build",
  version: "0.2.0",
  tools: [
    {
      name: "xc_build",
      description: "Build iOS project",
      inputSchema: {
        /* ... */
      },
    },
    // ... more tools
  ],
});

// Implement handlers for each tool
server.setRequestHandler(CallToolRequestSchema, async (request) => {
  // Route to appropriate operation handler
});

Type Safety

Zero any types in implementation code:

// ❌ Bad - violates zero-any policy
const args = toolInput as any;

// ✅ Good - explicit typing
interface BuildInput {
  scheme: string;
  configuration?: "Debug" | "Release";
}
const args = toolInput as BuildInput;

Command Execution (Safe Spawn)

All external commands use spawn-based execution:

// ❌ Vulnerable to shell injection
await executeCommand(`xcodebuild -scheme ${scheme}`);

// ✅ Safe - arguments as array
const { execAsync } = await import("./exec");
const result = await execAsync("xcodebuild", ["-scheme", scheme]);

Error Handling

Consistent error response format:

interface OperationResult<T> {
  success: boolean;
  data?: T;
  error?: {
    code: string;
    message: string;
    details?: Record<string, unknown>;
  };
}

Resources


xclaude-plugin v0.4.0 - Modular iOS development automation for Claude Code

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.