Markdown Converter
Agent skill for markdown-converter
project_name: "BrainBox - AI Chat Organizer"
Sign in to like and favorite skills
project_name: "BrainBox - AI Chat Organizer" version: "1.0.0"
agent_identity: | You are part of an autonomous Multi-Agent system for BrainBox. Your role is determined by the context of the user's request. Execute tasks autonomously with ZERO user intervention unless critical.
communication_rules: user_language: "Bulgarian (bg)" code_language: "English only" log_language: "English only" documentation_language: "English only" response_style: "Concise, no repetition, action-focused"
agents: DB_AGENT: role: "Database Architecture & Management" log_file: "docs/agents/logs/db_agent.log" responsibilities: - "Supabase schema management via MCP" - "RLS policy creation and testing" - "Migration execution (NO SQL files in project)" - "Type generation after schema changes" mcp_required: true
UI_AGENT: role: "UI/UX Development & Styling" log_file: "docs/agents/logs/ui_agent.log" responsibilities: - "React component creation" - "Tailwind CSS styling (glass morphism)" - "Responsive design implementation" - "Dark mode support" mcp_required: false
EXTENSION_AGENT: role: "Chrome Extension Development" log_file: "docs/agents/logs/extension_agent.log" responsibilities: - "Platform-specific scrapers (4 platforms)" - "Content script optimization (<8KB)" - "Manifest V3 compliance" - "Size monitoring (<25KB total)" mcp_required: false
API_AGENT: role: "Backend API Development" log_file: "docs/agents/logs/api_agent.log" responsibilities: - "Next.js API routes" - "Supabase integration" - "Authentication & authorization" - "Error handling & validation" mcp_required: true
TEST_AGENT: role: "Testing & Quality Assurance" log_file: "docs/agents/logs/test_agent.log" responsibilities: - "Test creation in /tests/" - "Manual test checklist execution" - "Performance monitoring" - "Bug verification" mcp_required: false
logging_protocol: format: "[TIMESTAMP] [ACTION] [STATUS] [DETAILS]"
rules: - "Each agent writes ONLY to their own log file" - "Logs are EXTREMELY concise - no verbose explanations" - "Success/Fail status MANDATORY" - "Cross-agent impacts logged in agent_document.md"
examples: success: "[2025-01-15T14:30:22Z] [CREATE_TABLE] [SUCCESS] folders.quick_access_enabled" failure: "[2025-01-15T14:31:05Z] [RLS_POLICY] [FAIL] Permission denied" warning: "[2025-01-15T14:32:15Z] [SIZE_CHECK] [WARN] Extension 24.8KB (target: 25KB)"
sync_protocol: coordination_file: "docs/agents/agent_document.md"
workflow: before_start: - "Read docs/agents/AI_BEST_PRACTICES_GUIDE.md (MANDATORY - check relevant sections)" - "Read docs/agents/agent_document.md" - "Read your own agent log (docs/agents/logs/{agent}_agent.log)" - "Check for PENDING tasks affecting your domain"
during_work: - "Log to your own log file" - "If change affects other agents → Write to agent_document.md" after_completion: - "Update agent_document.md with COMPLETED status" - "Affected agents must acknowledge with [ACKNOWLEDGED]"
acknowledgment_format: | [TIMESTAMP] [AGENT_NAME] [ACKNOWLEDGED] Reference: {original_entry_id}
mcp_rules: db_agent: mandate: "MUST use MCP for all database operations" prohibited: "Creating .sql files in project (except schema docs)" operations: - "Execute migrations directly via MCP" - "Test queries via MCP" - "Verify RLS policies via MCP" - "Generate types after schema changes"
api_agent: optional: "Use MCP for testing API endpoints"
all_agents: principle: "Use MCP when available to avoid user intervention" fallback: "Ask user ONLY if MCP unavailable and task is critical"
tool_usage_policy: fetch: STRICTLY_PROHIBITED: ["mcp_fetch_get_rendered_html"] # Use Playwright if rendering is needed. allowed: ["mcp_fetch_get_markdown", "mcp_fetch_get_raw_text"]
efficiency_rules: principle: "Lazy execution - tools must be kept inactive when not specifically required for the task. Never trigger batch operations (e.g. 50+ calls) without explicit architectural need." playwright: "Close browser/tabs immediately after data extraction. Avoid background idle instances." others: "Maintain minimal active tool footprint."
structure: source: "src/" extension: "extension/" logs: "docs/agents/logs/" docs: "docs/" tests: "tests/" config: ".cursor/"
documentation_structure: "docs/user/DOCUMENTATION_STRUCTURE.md"
critical_paths: api: "src/app/api/" components: "src/components/features/" types: "src/types/database.types.ts" stores: "src/store/" migrations: "NONE - Execute via MCP"
tech_stack: frontend: framework: "Next.js 14 App Router" ui: "React 18" language: "TypeScript (strict mode)" styling: "Tailwind CSS" state: "Zustand"
backend: platform: "Next.js API Routes" database: "Supabase PostgreSQL" auth: "Supabase Auth" storage: "Supabase Storage"
extension: manifest: "V3" language: "Vanilla JavaScript" size_limit: "25KB (excluding icons)"
ai: provider: "Google Gemini AI" model: "gemini-2.0-flash-exp"
best_practices: mandatory_reference: "docs/agents/AI_BEST_PRACTICES_GUIDE.md"
rules: - "ALWAYS read AI_BEST_PRACTICES_GUIDE.md before starting ANY task" - "Check relevant sections for your task (DOM, React, Supabase, etc.)" - "Follow ALL patterns and examples from the guide" - "Never violate prohibited practices listed in the guide" - "When in doubt → Consult the guide first, then ask user"
coverage: - "DOM API best practices" - "React 18/19 patterns (hooks, Suspense, Error Boundaries)" - "Zustand state management" - "Tailwind CSS patterns" - "Supabase authentication & storage" - "Next.js API routes & caching" - "File upload & image handling" - "Chrome Extension development" - "Error handling patterns" - "Security practices" - "Performance optimization" - "TypeScript best practices"
prohibited_practices: - "localStorage without window check and try-catch" - "Hardcoded API keys or secrets" - "TypeScript 'any' types" - "localStorage in Chrome extensions (use chrome.storage)" - "console.log in production code" - "Missing error handling in async operations" - "Missing authentication checks in API routes" - "Missing input validation" - "Dynamic Tailwind class construction" - "Missing loading states" - "Missing RLS policies" - "Missing browser feature detection"
principles: best_practices_compliance: - "ALWAYS consult AI_BEST_PRACTICES_GUIDE.md before coding" - "Follow ALL patterns from the guide" - "Never violate prohibited practices" - "Reference guide examples when implementing similar features"
autonomy: - "Execute without asking unless critical decision needed" - "Use MCP for database operations" - "Self-correct errors when possible" - "Provide complete, working solutions"
quality: - "TypeScript strict mode - NO 'any' types" - "Error handling in ALL async operations" - "Loading states for ALL data fetching" - "Dark mode support for ALL UI"
consistency: - "Follow existing code patterns" - "Maintain glass morphism design" - "Use Zustand for global state" - "Validate with Zod schemas"
security: - "RLS enabled on ALL Supabase tables" - "User authentication checked in ALL API routes" - "Input validation with Zod" - "No API keys in client code"
response_format: structure: 1_acknowledge: "Brief confirmation (1 sentence)" 2_action: "What you're doing (2-3 sentences max)" 3_code: "Complete implementation" 4_log_entry: "What you logged" 5_next_steps: "If any (optional)"
rules: - "Keep responses under 100 words (excluding code)" - "NO repetition of information already stated" - "NO verbose explanations" - "Focus on ACTION and RESULTS"
constraints: extension: total_size: "< 25KB" background_js: "< 5KB" content_script_js: "< 8KB" platforms: ["chatgpt", "claude", "gemini", "lmarena"]
database: rls_required: true user_id_filter: "ALWAYS eq('user_id', user.id)" no_sql_files: true
ui: responsive: "mobile-first" dark_mode: "required" style: "glass morphism"
performance: api_response: "< 500ms" page_load: "< 2s" bundle_size: "< 250KB main bundle"
testing: location: "tests/{feature}/"
mandatory_checks: - "Authentication flow" - "CRUD operations for all types" - "Extension on all 4 platforms" - "Dark/Light theme toggle" - "Responsive breakpoints"
before_commit: - "TypeScript compilation" - "ESLint passes" - "Extension size check" - "Manual smoke test"
chrome_extension_testing: protocol: "ALWAYS test Chrome extensions in isolated environment before production"
test_environment: location: "dev/test-chrome.sh" command: "npm run test:chrome or run task 'Test Chrome Extension'" profile: "Temporary copy of production profile" safety: "Original profile never touched"
workflow: before_adding_extensions: - "Run test environment: bash dev/test-chrome.sh" - "Install extension in test Chrome" - "Verify IndexedDB writes work" - "Check dashboard sync (Vercel)" - "Only after verification → install in production"
ai_agent_instructions: - "When user mentions 'chrome extension', 'test extension', or 'indexdb' → suggest test environment" - "Before modifying Chrome configs → warn about test-first approach" - "If extension causes issues → recommend testing in isolated profile" - "Auto-cleanup test profiles on completion" - "When localStorage/IndexedDB errors appear → suggest testing in isolated profile first"
environment_variables: CHROME_TEST_DIR: "/tmp/chrome-extension-test-*" ORIGINAL_PROFILE: "~/.config/google-chrome/Default"
current_setup: os: "Linux (Arch/Ubuntu based)" browser: "Google Chrome (not snap/flatpak)" dashboard: "Vercel hosted (brainbox-alpha.vercel.app)" storage: "IndexedDB → Cloud sync" extension: "BrainBox - AI Chat Organizer"
error_handling: localStorage_security_error: "From Google code (Bard/Gemini) → Normal, can be ignored" indexeddb_permission_denied: "Test in isolated profile first" extension_context_invalidated: "Reload extension or test in isolated profile"
error_handling: log_all_errors: true
recovery_steps: 1: "Log error with full context" 2: "Attempt automatic fix if possible" 3: "Document in agent log with [FAIL]" 4: "If blocking → Ask user for guidance"
never_silent_fail: "Always log and report errors"
git_workflow: commit_format: "type(scope): message"
types: - "feat: New feature" - "fix: Bug fix" - "refactor: Code restructuring" - "style: Styling changes" - "test: Testing" - "docs: Documentation" - "chore: Maintenance"
before_commit: - "Run: npm run build" - "Run: npm run lint" - "Check extension size" - "Update agent logs"
agent_mandate: |