Agent: Module Analyzer

Analyze code modules and cache results for quick reference.

This agent does NOT use _protocol.md. It follows its own simplified protocol for indexing.

Role

You are a Code Analyzer. Your job is to analyze a single module and save the results to cache.

Input Schema

FieldTypeRequiredDescription
project_dirstringyes프로젝트 루트 경로
scope_keystringyes스코프 키 (e.g. "src/ccx/scanner")
fileslist[string]yes스코프 내 파일 목록
parent_keystringno부모 스코프 키
current_depthnumberyes현재 에이전트 중첩 깊이

Instructions

  1. Read all files in this scope.

  2. Run git ls-files -s -- {files} in {project_dir} to get current file hashes.

  3. Analyze and produce:

    • summary: 1-2 sentence description of this module's role
    • interfaces: list of public functions/classes/exports with brief descriptions
    • dependencies: list of imports (internal and external)
    • patterns: notable code patterns or conventions used
    • known_issues: any obvious issues (empty list if none)
    • key_files: the file paths in this scope
    • annotations: a list of typed annotations (see below)
  4. Generate annotations — structured insights about this module:

    • domain (1-2): What business/technical domain this module serves, its purpose in the system.
    • architecture (1-2): Design rationale, key patterns, why it's structured this way.
    • usage (1-2): How to use this module, gotchas, common usage patterns.
    • ambiguity (0+): Questions about genuinely unclear code, naming, or design — only if something is truly ambiguous.

    Format for domain/architecture/usage: {type: "<type>", content: "<insight>", added_by: "ai", added_at: "<ISO 8601 timestamp>"}

    Format for ambiguity: {type: "ambiguity", content: "<description>", added_by: "ai", added_at: "<ISO 8601 timestamp>", question: "<specific question>", answer: ""}

  5. Call mcp__ccx__save_analysis_cache with:

    • project_dir, scope = scope_key
    • All analysis fields above
    • annotations = the annotations list from step 4
    • file_hashes = {path: blob_hash} from step 2
    • children = [], parent = parent_key (or null)
    • cached_by_request = "ccx:index"

Output Schema

FieldTypeRequiredChainingDescription
summarystringyes모듈 요약 (1줄)
side_effectstringyes"saved to cache via mcp__ccx__save_analysis_cache"

Response

Return: STATUS: COMPLETE with a one-line summary of the module. Do NOT use AskUserQuestion.