{
  "description": "文件组织和归档配置 - 定义了代码和文档的自动归类规则",
  "version": "1.0.0",
  "last_updated": "2025-11-15",

  "directories": {
    "archives": {
      "bug_fixes": {
        "path": "archives/bug_fixes",
        "pattern": "{date}_{bug_name}",
        "subdirs": ["code", "docs", "tests"],
        "description": "Bug修复归档目录"
      },
      "updates": {
        "path": "archives/updates",
        "pattern": "{date}_{feature_name}",
        "subdirs": ["code", "docs", "tests"],
        "description": "功能更新归档目录"
      },
      "versions": {
        "path": "archives/versions",
        "pattern": "v{major}.{minor}.{patch}",
        "subdirs": ["backup"],
        "description": "版本归档目录"
      }
    },
    "docs": {
      "fixes": {
        "path": "docs/fixes",
        "description": "Bug修复文档（当前活跃）"
      },
      "updates": {
        "path": "docs/updates",
        "description": "功能更新文档（当前活跃）"
      },
      "guides": {
        "path": "docs/guides",
        "description": "使用指南和教程"
      },
      "protocol": {
        "path": "docs/protocol",
        "description": "通信协议文档"
      }
    },
    "source": {
      "src": {
        "path": "src",
        "description": "源代码主目录"
      },
      "include": {
        "path": "include",
        "description": "头文件目录"
      },
      "examples": {
        "path": "examples",
        "description": "示例代码"
      }
    }
  },

  "file_types": {
    "code": {
      "extensions": [".cpp", ".c", ".h", ".hpp", ".py"],
      "default_location": "src",
      "description": "代码文件"
    },
    "headers": {
      "extensions": [".h", ".hpp"],
      "default_location": "include",
      "description": "头文件"
    },
    "docs": {
      "extensions": [".md", ".txt", ".pdf"],
      "default_location": "docs",
      "description": "文档文件"
    },
    "configs": {
      "extensions": [".json", ".yaml", ".yml", ".ini", ".conf"],
      "default_location": ".",
      "description": "配置文件"
    }
  },

  "naming_conventions": {
    "bug_fix": {
      "folder": "{YYYYMMDD}_{bug_description}",
      "doc": "BUG_{bug_description}_{YYYYMMDD}.md",
      "example": "20251115_fix_path_tracking / BUG_path_tracking_20251115.md"
    },
    "feature_update": {
      "folder": "{YYYYMMDD}_{feature_name}",
      "doc": "UPDATE_{feature_name}_{YYYYMMDD}.md",
      "example": "20251115_adaptive_lookahead / UPDATE_adaptive_lookahead_20251115.md"
    },
    "version": {
      "folder": "v{major}.{minor}.{patch}",
      "doc": "release_notes.md",
      "example": "v1.2.0 / release_notes.md"
    }
  },

  "workflow_rules": {
    "bug_fix": {
      "steps": [
        "1. 在主代码目录 (src/, include/) 进行修复",
        "2. 提交 git commit",
        "3. 创建归档目录: archives/bug_fixes/{date}_{name}/{code,docs,tests}",
        "4. 复制修复的代码到归档目录",
        "5. 创建修复文档到归档目录",
        "6. 复制文档副本到 docs/fixes/ 供快速查阅"
      ],
      "archive_to": "archives/bug_fixes",
      "doc_copy_to": "docs/fixes"
    },
    "feature_update": {
      "steps": [
        "1. 在主代码目录 (src/, include/) 开发新功能",
        "2. 提交 git commit",
        "3. 创建归档目录: archives/updates/{date}_{name}/{code,docs,tests}",
        "4. 复制新增/修改的代码到归档目录",
        "5. 创建更新文档到归档目录",
        "6. 复制文档副本到 docs/updates/ 供快速查阅"
      ],
      "archive_to": "archives/updates",
      "doc_copy_to": "docs/updates"
    },
    "version_release": {
      "steps": [
        "1. 更新版本号",
        "2. 编写 release_notes.md",
        "3. 创建版本目录: archives/versions/vX.Y.Z/",
        "4. 可选：备份完整代码到 backup/ 子目录",
        "5. 创建 git tag"
      ],
      "archive_to": "archives/versions"
    }
  },

  "auto_categorization_rules": {
    "enabled": true,
    "rules": [
      {
        "type": "bug_fix",
        "trigger_keywords": ["bug", "fix", "修复", "错误", "问题"],
        "target_dir": "archives/bug_fixes",
        "doc_dir": "docs/fixes"
      },
      {
        "type": "feature",
        "trigger_keywords": ["feature", "update", "新增", "功能", "更新", "add", "implement"],
        "target_dir": "archives/updates",
        "doc_dir": "docs/updates"
      },
      {
        "type": "version",
        "trigger_keywords": ["version", "release", "版本", "发布"],
        "target_dir": "archives/versions"
      }
    ]
  },

  "templates": {
    "bug_fix_doc": ".claude/templates/bug_fix_template.md",
    "feature_update_doc": ".claude/templates/feature_update_template.md",
    "release_notes": ".claude/templates/release_notes_template.md"
  },

  "scripts": {
    "archive_bug_fix": "scripts/archive_bug_fix.sh",
    "archive_feature": "scripts/archive_feature.sh",
    "create_release": "scripts/create_release.sh"
  }
}
