# OpenSpec-lite: 项目级规格（轻量版）
# 目的：用“可机读约束”引导 AI 在不改动现有代码的情况下复用资源。

project:
  name: admin-plus-template
  intent: "公司内部模板库/基础库（轻量化，优先文档约束）"
  stack:
    framework: "Vue 3"
    build: "Vue CLI 5"
    language: "TypeScript"
    state: "Pinia"
    router: "Vue Router"
    ui: "Element Plus"

constraints:
  no_code_changes_by_default: true
  prefer_docs_over_refactor: true
  extraction_style:
    - "copy-module"   # 优先整目录搬运再裁剪
    - "copy-snippet"  # 仅在模块过大或依赖不清晰时使用

  required_output_sections:
    - "changed_files"         # 变更文件清单
    - "extracted_modules"     # 抽取模块清单（来源->目标）
    - "dependency_closure"    # 依赖闭包（imports/运行时/类型/alias）
    - "acceptance_commands"   # 验收命令
    - "risks"                 # 风险说明

  forbidden_by_default:
    - "changing runtime behavior in production"   # 禁止默认更改生产行为
    - "introducing new global side effects"       # 禁止新增全局副作用
    - "deep-importing internal paths of modules"  # 禁止消费者深层路径引用

acceptance:
  minimum_commands:
    - "pnpm run serve"
  recommended_commands:
    - "pnpm run lint"
    - "pnpm run test:unit"
    - "pnpm run build"

repository:
  entrypoints:
    - "src/main.ts"
    - "library/index.ts"
    - "src/router/index.ts"
    - "src/store/index.ts"
    - "src/i18n/index.ts"
    - "mock/index.js"

module_roots:
  ui_components_dir: "library/components"
  layouts_dir: "library/layouts"
  plugins_dir: "library/plugins"
  styles_dir: "library/styles"
  store_modules_dir: "src/store/modules"
  api_dir: "src/api"
  utils_dir: "src/utils"
  config_dir: "src/config"
  icons_dir: "src/icon"

notes:
  - "配置读取来自 src/config/index.js（被 vue.config.js require）"
  - "library/index.ts 存在插件自动全量加载；抽取时需显式列出依赖闭包"
