Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@
"Bash(sudo rm:*)",
"Bash(git rm:*)",
"Bash(ln:*)",
"Read(//Users/peter/projects/wheels.dev/tests/Testbox/specs/controllers/**)"
"Read(//Users/peter/projects/wheels.dev/tests/Testbox/specs/controllers/**)",
"Bash(./test-ai-endpoints.sh:*)",
"Bash(python3:*)",
"Read(//private/tmp/wheels-mcp-test/**)",
"Bash(node:*)",
"Bash(npm:*)",
"WebSearch"
],
"deny": []
}
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,35 @@ jobs:
exit 0
fi

docker exec wheels-${{ matrix.cfengine }}-1 box cfpm install image,mail,zip,debugger,caching,mysql,postgresql,sqlserver,oracle
# Install packages with retry logic
MAX_RETRIES=3
RETRY_COUNT=0

while [ "$RETRY_COUNT" -lt "$MAX_RETRIES" ]; do
RETRY_COUNT=$((RETRY_COUNT + 1))
echo "Attempt $RETRY_COUNT of $MAX_RETRIES: Installing CFPM packages..."

# Try to install all packages
if docker exec wheels-${{ matrix.cfengine }}-1 box cfpm install image,mail,zip,debugger,caching,mysql,postgresql,sqlserver,oracle; then
echo "✅ CFPM packages installed successfully"
exit 0
else
echo "❌ CFPM installation failed on attempt $RETRY_COUNT"

if [ "$RETRY_COUNT" -lt "$MAX_RETRIES" ]; then
echo "Waiting 10 seconds before retry..."
sleep 10

# Try to restart the CF service before retry
echo "Attempting to restart ColdFusion service..."
docker exec wheels-${{ matrix.cfengine }}-1 box server restart || true
sleep 10
fi
fi
done

echo "Failed to install CFPM packages after $MAX_RETRIES attempts"
exit 1

- name: Run Tests with Retry
id: run-tests
Expand Down
72 changes: 70 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with a Wheels application.
This file provides guidance to Claude Code (claude.ai/code) and other AI coding assistants when working with a Wheels application.

## AI Documentation Endpoints

When the development server is running, you can access enhanced documentation:
- **Full Documentation**: `/wheels/ai` - Optimized for AI consumption
- **Documentation Manifest**: `/wheels/ai?action=manifest` - Lists available documentation chunks
- **Project Context**: `/wheels/ai?action=project` - Current project structure and configuration
- **Specific Chunks**: `/wheels/ai?action=chunk&id=models` - Get focused documentation (models, controllers, views, etc.)

### Available Documentation Contexts
- `all` - Complete documentation (default)
- `model` - Model-specific documentation
- `controller` - Controller-specific documentation
- `view` - View helpers and templating
- `migration` - Database migration documentation
- `routing` - URL routing and RESTful resources
- `testing` - Testing framework documentation

## Quick Start

Expand Down Expand Up @@ -637,4 +654,55 @@ function onError(exception, eventname) {
return true; // Let ColdFusion handle it
}
}
```
```

## AI Agent Integration

### MCP (Model Context Protocol) Support
Wheels includes an MCP server for integration with AI coding assistants that support the protocol:

1. **Installation**:
```bash
cd /path/to/wheels
npm install @modelcontextprotocol/sdk
```

2. **Configuration**: Use `mcp-server-wheels.json` for Claude Code, Cursor, or Continue
3. **Available Resources**: API docs, guides, project context, patterns
4. **Available Tools**: Generate components, run migrations, manage server

### Best Practices for AI-Assisted Development

1. **Start with Context**: Always check `/wheels/ai?action=project` to understand the current project
2. **Use Focused Documentation**: Request specific chunks (`/wheels/ai?action=chunk&id=models`) for the task at hand
3. **Follow Conventions**: Wheels has strong conventions - models are singular, controllers are plural
4. **Test Generated Code**: Always run `wheels test run` after generating code
5. **Use Generators**: Prefer `wheels g` commands over manual file creation

### Optimizing for Context Windows

When working with limited context windows:
1. Use the manifest endpoint to discover available chunks
2. Load only relevant documentation chunks for your current task
3. The project context endpoint provides a concise overview
4. Common patterns are available separately for quick reference

### Integration with Popular AI Tools

#### Claude Code
- This CLAUDE.md file is automatically loaded
- Use the `/wheels/ai` endpoints when the dev server is running
- MCP server provides deeper integration

#### GitHub Copilot
- Reference this file in your workspace
- Comments referencing Wheels patterns help Copilot suggestions

#### Cursor / Continue
- Configure MCP server using the provided configuration
- Access Wheels tools directly from the AI interface

#### Custom Integration
- All documentation endpoints return JSON
- Use `/wheels/ai?action=manifest` to discover available resources
- Implement your own MCP client using the provided server
4 changes: 3 additions & 1 deletion cli/src/ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ component {
.to("#moduleMapping#.models.helpers");
binder.map("DetailOutputService@wheels-cli")
.to("#moduleMapping#.models.DetailOutputService");

binder.map("MCPService@wheels-cli")
.to("#moduleMapping#.models.MCPService");

log.info('Wheels CLI Module loaded successfully.');
}

Expand Down
115 changes: 115 additions & 0 deletions cli/src/commands/wheels/mcp/remove.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/**
* Remove MCP (Model Context Protocol) integration
* Removes MCP server and configuration files from your project
*
* Examples:
* {code:bash}
* wheels mcp remove
* wheels mcp remove --confirm
* wheels mcp remove --keep-dependencies
* {code}
**/
component extends="../base" {

property name="mcpService" inject="MCPService@wheels-cli";

/**
* @confirm Skip confirmation prompt
* @keepDependencies Keep package.json and node_modules
**/
function run(
boolean confirm = false,
boolean keepDependencies = false
) {
print.line();
print.boldYellowLine("🗑️ Remove MCP Integration");
print.line("=" .repeatString(40));
print.line();

// Check current status
var status = mcpService.getMCPStatus();

if (!status.serverFile && !status.configured) {
print.yellowLine("MCP integration is not installed.");
print.line();
return;
}

// Show what will be removed
print.boldLine("This will remove:");
if (status.serverFile) {
print.indentedLine("• mcp-server.js");
}
if (status.configured && arrayLen(status.configuredIDEs) > 0) {
print.indentedLine("• IDE configurations for: " & arrayToList(status.configuredIDEs, ", "));
}
if (!arguments.keepDependencies) {
print.indentedLine("• package.json (if it only contains MCP dependencies)");
}
print.line();

print.boldLine("This will preserve:");
print.indentedLine("• Your Wheels application code");
print.indentedLine("• Your project configuration");
if (arguments.keepDependencies) {
print.indentedLine("• package.json and node_modules");
} else {
print.indentedLine("• node_modules (remove manually if needed)");
}
print.line();

// Confirm removal
if (!arguments.confirm) {
var response = ask("Are you sure you want to remove MCP integration? (y/N): ");
if (lCase(trim(response)) != "y") {
print.yellowLine("Removal cancelled.");
print.line();
return;
}
}

// Perform removal
print.line("Removing MCP integration...");
print.line();

var removalResult = mcpService.removeMCP();

// Display results
if (arrayLen(removalResult.messages) > 0) {
for (var message in removalResult.messages) {
print.greenLine(message);
}
}

if (arrayLen(removalResult.errors) > 0) {
for (var error in removalResult.errors) {
print.redLine(error);
}
}

print.line();

if (removalResult.success) {
print.boldGreenLine("✅ MCP integration removed successfully!");
print.line();

// Provide next steps
print.boldLine("Optional cleanup:");
print.indentedLine("• Remove node_modules: rm -rf node_modules");
print.indentedLine("• Remove package-lock.json: rm package-lock.json");

if (fileExists(fileSystemUtil.resolvePath("package.json"))) {
print.indentedLine("• Review package.json for other dependencies");
}
print.line();

print.line("To reinstall MCP integration later, run:");
print.indentedYellowLine("wheels mcp setup");
} else {
print.boldRedLine("❌ Some errors occurred during removal");
print.line("Please check the errors above and try again.");
}
print.line();
}

}
Loading