Skip to main content

FrootAI Contributor Guide

Everything you need to contribute to FrootAI โ€” from dev setup to PR review.


1. Development Environment Setupโ€‹

1.1 Prerequisitesโ€‹

1.2 Clone & Installโ€‹

# Clone the repository
git clone https://github.com/gitpavleenbali/frootai.git
cd frootai

# Website
cd website && npm install && cd ..

# MCP Server
cd mcp-server && npm install && cd ..

# VS Code Extension
cd vscode-extension && npm install && cd ..

1.3 Build Everythingโ€‹

# Website (Docusaurus)
cd website && npx docusaurus build

# MCP Server (no build step โ€” plain Node.js)

# VS Code Extension
cd vscode-extension && npm run compile

2. Repository Structureโ€‹

frootai/
โ”œโ”€โ”€ docs/ # 18+ knowledge modules (Markdown)
โ”œโ”€โ”€ website/ # Docusaurus site
โ”‚ โ”œโ”€โ”€ src/pages/ # React pages (landing, setup, plays...)
โ”‚ โ”œโ”€โ”€ docusaurus.config.ts # Site config (baseUrl: /frootai/)
โ”‚ โ””โ”€โ”€ sidebars.ts # Docs sidebar structure
โ”œโ”€โ”€ mcp-server/ # MCP Server (Node.js, stdio)
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ index.js # Entry point
โ”‚ โ”‚ โ””โ”€โ”€ tools/ # Tool implementations
โ”‚ โ””โ”€โ”€ package.json
โ”œโ”€โ”€ vscode-extension/ # VS Code Extension
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ extension.ts # Activation entry point
โ”‚ โ”‚ โ”œโ”€โ”€ commands/ # Command implementations
โ”‚ โ”‚ โ””โ”€โ”€ panels/ # Sidebar webview panels
โ”‚ โ””โ”€โ”€ package.json # Extension manifest
โ”œโ”€โ”€ solution-plays/ # 20 solution play directories
โ”‚ โ”œโ”€โ”€ 01-it-ticket-resolution/
โ”‚ โ”œโ”€โ”€ 02-customer-support-agent/
โ”‚ โ””โ”€โ”€ ...
โ”œโ”€โ”€ config/ # Shared configuration
โ”‚ โ”œโ”€โ”€ openai.json
โ”‚ โ”œโ”€โ”€ guardrails.json
โ”‚ โ””โ”€โ”€ routing.json
โ”œโ”€โ”€ CONTRIBUTING.md # Quick contribution guide
โ”œโ”€โ”€ LICENSE # MIT
โ””โ”€โ”€ README.md # Project overview

Key Filesโ€‹

FileRole
docs/*.mdKnowledge modules โ€” the core content
website/docusaurus.config.tsSite configuration, plugins, theme
website/sidebars.tsSidebar navigation tree
mcp-server/src/index.jsMCP Server entry โ€” tool registration
vscode-extension/package.jsonExtension manifest โ€” commands, views, activation
config/guardrails.jsonSafety and content filtering rules

3. Adding a New Solution Playโ€‹

3.1 Step-by-Stepโ€‹

  1. Choose a number and slug: 21-my-new-play

  2. Create the directory structure:

    mkdir -p solution-plays/21-my-new-play/.github/prompts
    mkdir -p solution-plays/21-my-new-play/config
    mkdir -p solution-plays/21-my-new-play/evaluation
  3. Write the README.md โ€” Overview, architecture, value proposition, deployment steps.

  4. Write the agent.md (1500โ€“5000 bytes):

    # Agent Rules: My New Play

    ## Context
    You are an AI agent specializing in [scenario].

    ## Rules
    1. Use Managed Identity (no API keys)
    2. Read config files from config/ for parameters
    3. Follow these behavior rules: [specifics]
    4. Include error handling + logging
  5. Write copilot-instructions.md โ€” Project context for GitHub Copilot.

  6. Add config files:

    • config/agents.json โ€” Model and routing parameters
    • Add other config files as needed
  7. Create evaluation set:

    • evaluation/golden-set.jsonl โ€” At least 5 input/output pairs
    • evaluation/evaluate.py โ€” Scoring script
  8. Add prompts:

    • prompts/init.prompt.md โ€” Bootstrap prompt
    • Additional prompts as needed

3.2 Validation Checklistโ€‹

Before submitting a PR, verify:

  • README.md exists and is >500 bytes
  • agent.md exists and is 1500โ€“5000 bytes
  • copilot-instructions.md exists
  • At least one config file in config/
  • evaluation/golden-set.jsonl has 5+ examples
  • evaluation/evaluate.py runs without errors
  • No API keys or secrets in any file
  • All file names use kebab-case

3.3 CI Validationโ€‹

The validate-plays.yml workflow automatically checks:

  • Required file existence
  • agent.md byte-size range
  • JSON validity of config files
  • JSONL validity of golden sets

4. Improving Existing Contentโ€‹

4.1 Knowledge Modules (docs/)โ€‹

  • Each module is a standalone Markdown file
  • Front matter must include sidebar_position and title
  • Use Mermaid diagrams for architecture visuals
  • Include practical examples, not just theory
  • Target 800โ€“3000 lines per module

4.2 Agent Rules (agent.md)โ€‹

When improving a play's agent.md:

  • Keep it within 1500โ€“5000 bytes
  • Include: context, rules, tool references, error handling
  • Be specific about what the agent should/shouldn't do
  • Reference config files by path

4.3 Config Filesโ€‹

  • All JSON must be valid and formatted
  • Include comments (via _comment fields) for documentation
  • Default values should be production-safe
  • Guardrails should be strict by default

5. MCP Server Developmentโ€‹

5.1 Adding a New Toolโ€‹

  1. Create mcp-server/src/tools/my-new-tool.js:

    module.exports = {
    name: "my_new_tool",
    description: "What this tool does",
    inputSchema: {
    type: "object",
    properties: {
    query: { type: "string", description: "The search query" }
    },
    required: ["query"]
    },
    handler: async ({ query }) => {
    // Implementation
    return { content: [{ type: "text", text: "Result" }] };
    }
    };
  2. Register in mcp-server/src/index.js:

    const myNewTool = require("./tools/my-new-tool");
    server.addTool(myNewTool);
  3. Test locally:

    echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"my_new_tool","arguments":{"query":"test"}}}' | node src/index.js

5.2 Tool Categoriesโ€‹

CategoryConventionNetwork?
StaticReturns bundled dataNo
LiveFetches external dataYes
ChainMulti-step orchestrationDepends
AI EcosystemModel/pattern guidanceNo

5.3 Testingโ€‹

cd mcp-server
npm test # Unit tests
npm run test:integration # Integration tests (requires network for live tools)

6. VS Code Extension Developmentโ€‹

6.1 Running in Dev Modeโ€‹

  1. Open vscode-extension/ in VS Code
  2. Press F5 โ†’ launches Extension Development Host
  3. Changes hot-reload on recompile

6.2 Adding a Commandโ€‹

  1. Register in package.json under contributes.commands:

    {
    "command": "frootai.myCommand",
    "title": "FROOT: My Command",
    "category": "FROOT"
    }
  2. Implement in src/commands/my-command.ts:

    import * as vscode from "vscode";

    export function registerMyCommand(context: vscode.ExtensionContext) {
    context.subscriptions.push(
    vscode.commands.registerCommand("frootai.myCommand", async () => {
    // Implementation
    vscode.window.showInformationMessage("Done!");
    })
    );
    }
  3. Wire up in src/extension.ts:

    import { registerMyCommand } from "./commands/my-command";
    registerMyCommand(context);

6.3 Sidebar Panelsโ€‹

Panels are implemented as webview providers in src/panels/. Each panel:

  • Returns HTML content for the webview
  • Uses message passing for interaction
  • Follows the existing dark theme / green accent pattern

7. Website Developmentโ€‹

7.1 Adding a Pageโ€‹

Create website/src/pages/my-page.tsx:

import React from "react";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import styles from "./index.module.css";

export default function MyPage(): JSX.Element {
return (
<Layout title="My Page" description="Description for SEO">
<div style={{ maxWidth: "900px", margin: "0 auto", padding: "48px 24px 80px" }}>
<h1>My Page</h1>
{/* Content */}
</div>
</Layout>
);
}

The page will be available at /frootai/my-page.

7.2 Docusaurus Conventionsโ€‹

  • Pages โ†’ website/src/pages/*.tsx (React) or .md (Markdown)
  • Docs โ†’ docs/*.md (Markdown with front matter)
  • Styles โ†’ Use existing index.module.css classes (glowCard, glowPill, ctaPrimary)
  • Sidebar โ†’ Edit website/sidebars.ts to add docs to navigation
  • Config โ†’ website/docusaurus.config.ts for site-wide settings

7.3 Local Developmentโ€‹

cd website
npx docusaurus start # Dev server with hot reload
npx docusaurus build # Production build
npx docusaurus serve # Serve production build locally

8. Testing & CIโ€‹

8.1 validate-plays.ymlโ€‹

Runs on every push that touches solution-plays/:

  • Checks required files exist
  • Validates agent.md size (1500โ€“5000 bytes)
  • Validates JSON/JSONL files
  • Reports failures as PR checks

8.2 Manual Testingโ€‹

Before submitting a PR:

# Website builds
cd website && npx docusaurus build

# MCP server starts
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node mcp-server/src/index.js

# Extension compiles
cd vscode-extension && npm run compile

# Play validation passes
python scripts/validate-plays.py

9. PR Review Processโ€‹

9.1 What Reviewers Look Forโ€‹

  • Completeness โ€” All required files present
  • Quality โ€” agent.md is specific, not generic
  • Security โ€” No API keys, secrets, or PII
  • Consistency โ€” Naming follows conventions
  • Testing โ€” Evaluation set covers edge cases
  • Documentation โ€” README explains what and why

9.2 PR Templateโ€‹

Every PR fills out the template with:

  • Summary of changes
  • Type (feature / fix / docs / play)
  • Checklist of validation steps completed

9.3 Review Timelineโ€‹

  • Small fixes: 1โ€“2 days
  • New plays: 3โ€“5 days
  • Architecture changes: require discussion first

10. Code Styleโ€‹

10.1 Namingโ€‹

ItemConventionExample
Directorieskebab-casesolution-plays/01-it-ticket-resolution
Markdown filesPascalCase or kebab-caseRAG-Architecture.md, admin-guide.md
JSON fileskebab-casemodel-comparison.json
TypeScriptcamelCase (vars/functions), PascalCase (types)fetchModule(), ToolConfig
CSS classescamelCase (CSS modules)glowCard, heroTitle

10.2 Commentsโ€‹

  • Use JSDoc for TypeScript functions
  • Use # comments in shell scripts
  • Use // comments in JSON (via _comment fields)
  • Markdown files don't need code comments โ€” the content IS the documentation

10.3 Encodingโ€‹

  • All files: UTF-8
  • Line endings: LF (not CRLF)
  • Indentation: 2 spaces (TypeScript, JSON, YAML), 4 spaces (Python)
  • Max line length: 120 characters (soft limit)

Next: Admin Guide ยท User Guide ยท API Reference