Skip to content

feat: add category management with CLI command and MCP tool#43

Merged
ikjeong merged 5 commits intomainfrom
feat/category
Dec 10, 2025
Merged

feat: add category management with CLI command and MCP tool#43
ikjeong merged 5 commits intomainfrom
feat/category

Conversation

@ikjeong
Copy link
Contributor

@ikjeong ikjeong commented Dec 10, 2025

Summary

  • 사용자가 컨벤션 카테고리를 조회하고 관리할 수 있는 기능 추가
  • AI 도구가 MCP를 통해 카테고리 목록을 조회할 수 있도록 list_category 도구 추가
  • sym init 시 7개의 기본 카테고리를 user-policy.json에 자동 생성

Changes

  • CategoryDef 타입 및 UserPolicy.Category 필드 추가 (pkg/schema/types.go)
  • sym category CLI 명령어 추가 (internal/cmd/category.go)
  • list_category MCP 도구 추가 (internal/mcp/server.go)
  • sym init에서 기본 카테고리 7개 생성 (internal/cmd/init.go)
  • TestListCategory 테스트 추가 (internal/mcp/server_test.go)
  • 관련 문서 업데이트

Feature: Category Management

개요

컨벤션 카테고리는 규칙을 분류하는 데 사용됩니다. 이 PR은 사용자와 AI 도구가 사용 가능한 카테고리를 조회할 수 있는 기능을 추가합니다.

기본 카테고리 (7개)

sym init 실행 시 다음 카테고리가 자동 생성됩니다:

카테고리 설명
security Security rules (authentication, authorization, vulnerability prevention, etc.)
style Code style and formatting rules
documentation Documentation rules (comments, docstrings, etc.)
error_handling Error handling and exception management rules
architecture Code structure and architecture rules
performance Performance optimization rules
testing Testing rules (coverage, test patterns, etc.)

사용자 정의 카테고리

사용자는 user-policy.json에서 카테고리를 직접 수정, 추가, 삭제할 수 있습니다:

{
  "category": [
    {"name": "security", "description": "보안 관련 규칙 (한국어 설명으로 변경)"},
    {"name": "naming", "description": "네이밍 컨벤션 규칙 (새로 추가)"}
  ]
}

Endpoints

1. CLI Command: sym category

터미널에서 카테고리 목록을 조회합니다.

Usage:
sym category

Output:
[Convention Categories] 7 categories available

• security
Security rules (authentication, authorization, vulnerability prevention, etc.)

• style
Code style and formatting rules

• documentation
Documentation rules (comments, docstrings, etc.)

...

2. MCP Tool: list_category

AI 코딩 도구(Claude Code, Cursor 등)에서 MCP를 통해 카테고리를 조회합니다.

Tool Name: list_category

Input Schema: 파라미터 없음

Output Example:
Available categories (7):

• security
Security rules (authentication, authorization, vulnerability prevention, etc.)

• style
Code style and formatting rules

...

Use query_conventions with a specific category to get rules for that category.

Use Case - AI 워크플로우:

  1. list_category 호출 → 사용 가능한 카테고리 목록 확인
  2. query_conventions(category: "security") 호출 → 해당 카테고리의 규칙 조회
  3. 코드 작성 시 규칙 적용
  4. validate_code 호출 → 컨벤션 준수 여부 검증

- Add CategoryDef struct with name and description fields
- Add Category field to UserPolicy for user-defined categories
- Add sym category CLI command to list categories
- Add list_category MCP tool for AI tools integration
- Add default categories (7) to sym init
- Update sym category and list_category descriptions
- Add list_category to MCP tool lists
- Add CategoryDef type documentation
@ikjeong ikjeong self-assigned this Dec 10, 2025
@ikjeong ikjeong merged commit eeaf88c into main Dec 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant