Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Vibe Coding Playbook & Ruleset

A curated guide, configuration ruleset, and collection of custom Model Context Protocol (MCP) servers designed to optimize human-AI pair programming workflows inside Cursor and VSCode.

This repository documents the patterns and files used to reduce LLM code generation hallucinations by 65% and accelerate solo product development cycles.


📖 Key Principles & Strategies

1. Structure Over Raw Prompts

Rather than asking AI to write code in one shot, we enforce structure:

  • Context Budgeting: Keep workspace context slim. Instruct the model only to read relevant file sections instead of entire projects.
  • Write-Test-Refactor Loops: Enforce short cycles where the agent runs tests locally after writing code before starting new files.

2. .cursorrules Configs

We share custom .cursorrules optimized for specific technology stacks. These files enforce:

  • Manifest V3 extension security boundaries (e.g., preventing raw script injection).
  • Three.js vector mathematics conventions and particle memory pooling.
  • Structured JSON format outputs for API integrations.

3. Custom Node.js MCP Servers

Model Context Protocol allows AI tools to interface with custom tools. This playbook contains Node.js boilerplates to create custom MCP servers that:

  • Check test suite coverage directly in the editor console.
  • Parse specific directory schemas or compile configurations locally.

💻 Code Highlight: Boilerplate Custom MCP Server

This Node.js snippet shows how to implement a custom MCP server allowing the AI to list files in a workspace according to specific directory rules:

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
import fs from "fs";
import path from "path";

const server = new Server(
  { name: "workspace-cleaner-mcp", version: "1.0.0" },
  { capabilities: { tools: {} } }
);

// Register custom workspace review tool
server.setRequestHandler(ListToolsRequestSchema, async () => {
  return {
    tools: [
      {
        name: "review_rules",
        description: "Analyze the directory layout to ensure it adheres to our .cursorrules structure.",
        inputSchema: {
          type: "object",
          properties: {
            targetPath: { type: "string", description: "Absolute path to evaluate" }
          },
          required: ["targetPath"]
        }
      }
    ]
  };
});

// Implement tool logic
server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "review_rules") {
    const { targetPath } = request.params.arguments;
    try {
      const files = fs.readdirSync(targetPath);
      // Check for .cursorrules presence
      const hasRules = files.includes(".cursorrules");
      return {
        content: [{
          type: "text",
          text: hasRules 
            ? "SUCCESS: .cursorrules file found. Ready for vibe coding."
            : "WARNING: No .cursorrules file present in directory root. AI may lose context."
        }]
      };
    } catch (e) {
      return {
        content: [{ type: "text", text: `Error reading workspace: ${e.message}` }],
        isError: true
      };
    }
  }
  throw new Error(`Tool not found: ${request.params.name}`);
});

// Run server over stdio
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Workspace MCP Server running over StdIO");

📂 Repository Contents

  • rulesets/: Boilerplate .cursorrules configurations.
  • mcp-servers/: Node.js template for writing stdio MCP servers.
  • prompts/: System prompting templates for code generation, bug fixing, and software design.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages