Skip to content

Add CodingBuddy Configuration Schema#24

Merged
JeremyDev87 merged 1 commit into
masterfrom
feat/23
Dec 18, 2025
Merged

Add CodingBuddy Configuration Schema#24
JeremyDev87 merged 1 commit into
masterfrom
feat/23

Conversation

@JeremyDev87

@JeremyDev87 JeremyDev87 commented Dec 18, 2025

Copy link
Copy Markdown
Owner

Add CodingBuddy Configuration Schema

📋 Summary

Introduces a standardized configuration schema for CodingBuddy that allows users to provide project-specific context (tech stack, architecture, conventions, test strategy) to AI assistants. All fields are optional to lower the barrier to entry.

Closes #19

🎯 Problem

Context Gap

AI coding assistants don't know your project context. When developers start using AI assistants, they must repeatedly explain:

  • What language they want responses in
  • What tech stack they're using
  • What architectural patterns they follow
  • What coding conventions their team prefers

This creates a "repetition tax" where developers re-explain project context in every conversation.

Current Limitations

  • No standardized way to communicate project context
  • AI makes assumptions that may not fit the project
  • Inconsistent responses across different AI tools
  • Team members get different AI behavior

✨ Solution

Configuration Schema

A comprehensive, optional configuration schema that provides project context:

  1. Basic Settings

    • language: Response language (ko, en, ja, etc.)
    • projectName: Project name
    • description: Project description
    • repository: Repository URL
  2. Tech Stack (techStack)

    • Languages, frontend, backend, database, infrastructure, tools
    • Optional deep details (version, config, notes)
  3. Architecture (architecture)

    • Pattern (layered, hexagonal, clean, feature-sliced, etc.)
    • Structure (directory paths)
    • Component style (flat, grouped, feature-based)
    • Optional layer definitions
  4. Conventions (conventions)

    • Style guide (airbnb, google, standard, prettier)
    • Naming conventions (files, components, functions, etc.)
    • Import order, line length, semicolons, quotes
    • Optional custom rules
  5. Test Strategy (testStrategy)

    • Approach (tdd, bdd, test-after, mixed)
    • Frameworks, coverage target
    • Unit test pattern, E2E directory
    • Mocking strategy
  6. Additional Context

    • keyFiles: Important files AI should know about
    • avoid: Topics or areas to avoid
    • custom: Freeform custom context

Key Design Principles

  • All fields optional: Start with what you need
  • No rule override: Provides context only; .ai-rules remain unchanged
  • Type-safe: TypeScript types inferred from Zod schemas
  • Validated: Runtime validation with clear error messages
  • Extensible: Easy to add new configuration items

📊 Files Changed

  • New Files (5):
    • docs/config-schema.md (266 lines) - Comprehensive documentation
    • mcp-server/src/config/config.types.ts (43 lines) - TypeScript types
    • mcp-server/src/config/config.schema.ts (202 lines) - Zod validation schema
    • mcp-server/src/config/config.schema.spec.ts (273 lines) - Test suite
    • mcp-server/src/config/index.ts (34 lines) - Public API exports

Total: 5 files changed, +818 insertions

🔑 Key Features

Type Safety

  • TypeScript types inferred from Zod schemas (single source of truth)
  • Full IDE autocomplete support
  • Type guards for runtime validation

Validation

  • Zod schema validation with clear error messages
  • Validates enum values, number ranges, URL formats
  • Provides error paths for nested validation failures

Test Coverage

  • Comprehensive test suite covering:
    • Empty config (all fields optional)
    • Minimal config
    • Full config with all fields
    • Deep optional fields
    • Invalid values and edge cases
    • Type inference verification

Documentation

  • Complete schema reference with examples
  • Quick start guide
  • TypeScript usage examples
  • Validation error examples

✅ Benefits

  1. Consistency: All AI assistants use the same configuration format
  2. Explicitness: AI responds based on clear information rather than guessing
  3. Flexibility: Only specify the settings you need
  4. Extensibility: Structure makes it easy to add new configuration items
  5. Type Safety: Full TypeScript support with autocomplete

📝 Usage Example

// codingbuddy.config.js
module.exports = {
  language: 'ko',
  projectName: 'my-awesome-app',
  techStack: {
    frontend: ['React', 'TypeScript'],
    backend: ['NestJS'],
  },
  architecture: {
    pattern: 'feature-sliced',
    structure: ['src/app', 'src/features', 'src/shared'],
  },
  conventions: {
    style: 'airbnb',
    naming: {
      files: 'kebab-case',
      components: 'PascalCase',
    },
  },
  testStrategy: {
    approach: 'tdd',
    frameworks: ['vitest'],
    coverage: 80,
  },
};

🧪 Testing

  • Empty config validation (all fields optional)
  • Minimal config validation
  • Full config validation
  • Deep optional fields validation
  • Invalid enum values rejection
  • Invalid number ranges rejection
  • Type inference verification
  • Error path reporting

- Add TypeScript types and Zod validation schema
- Add comprehensive test coverage
- Add configuration documentation

close #23
@JeremyDev87 JeremyDev87 self-assigned this Dec 18, 2025
@JeremyDev87 JeremyDev87 marked this pull request as ready for review December 18, 2025 08:42
@JeremyDev87 JeremyDev87 merged commit 5c876ac into master Dec 18, 2025
2 checks passed
@JeremyDev87 JeremyDev87 linked an issue Dec 18, 2025 that may be closed by this pull request
3 tasks
@JeremyDev87 JeremyDev87 deleted the feat/23 branch December 21, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User Configuration Schema Definition

2 participants