feat: 提交多个新UI组件模块spec和相关属性设定,包括卡片封装、渐变卡片、列式布局组件等,重写了readme.md,用于AI Coding
Some checks are pending
Call HTTPS API / build (push) Waiting to run
Some checks are pending
Call HTTPS API / build (push) Waiting to run
This commit is contained in:
25
AI-Coding/openspec-lite/tasks/add-api-and-mock.yaml
Normal file
25
AI-Coding/openspec-lite/tasks/add-api-and-mock.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
# Task Template: 新增 API + Mock(轻量版)
|
||||
|
||||
task:
|
||||
id: add-api-and-mock
|
||||
intent: "新增一个 API 调用函数,并同步补一个 Mock 路由(用于开发联调)"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- domain
|
||||
- function_name
|
||||
- method # get/post/...
|
||||
- path # 例如 /router/getList
|
||||
|
||||
outputs:
|
||||
files_to_change:
|
||||
- "src/api/<domain>.ts"
|
||||
- "mock/controller/<domain>.js"
|
||||
|
||||
rules:
|
||||
- "API path 与 Mock path 必须一致"
|
||||
- "Mock 路由对象必须包含 url/type/response"
|
||||
|
||||
acceptance:
|
||||
- "开发环境请求能命中 mock"
|
||||
- "API 函数能被页面调用且类型不报错(若涉及类型需补 types/)"
|
||||
28
AI-Coding/openspec-lite/tasks/add-page.yaml
Normal file
28
AI-Coding/openspec-lite/tasks/add-page.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
# Task Template: 新增页面 + 路由(轻量版)
|
||||
# 目标:约束 AI 在本仓库(或迁移后的新仓库)新增页面时的输出与验收。
|
||||
|
||||
task:
|
||||
id: add-page
|
||||
intent: "新增一个页面,并把路由挂载到 Layout(如需要,同步 meta 供菜单/面包屑使用)"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- module # 例如 goods / userManagement
|
||||
- page_name # 例如 list / detail
|
||||
- route_path # 例如 /goods/list
|
||||
- route_name # 例如 GoodsList
|
||||
|
||||
outputs:
|
||||
files_to_change:
|
||||
- "src/views/<module>/<page>.vue"
|
||||
- "src/router/index.ts"
|
||||
|
||||
rules:
|
||||
- "页面文件必须位于 src/views/<module>/ 下"
|
||||
- "路由必须挂载到 asyncRoutes 的 Layout children(除非明确说明是 constantRoutes)"
|
||||
- "如需要菜单展示,必须填写 meta.title;如需要图标,必须填写 meta.icon"
|
||||
|
||||
acceptance:
|
||||
- "访问 route_path 能渲染页面"
|
||||
- "刷新后仍可访问(路由可恢复)"
|
||||
- "若配置 meta,菜单/面包屑能展示正确标题"
|
||||
37
AI-Coding/openspec-lite/tasks/extract-component.yaml
Normal file
37
AI-Coding/openspec-lite/tasks/extract-component.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
# Task Template: 抽取组件(library/components/Vab*)
|
||||
|
||||
task:
|
||||
id: extract-component
|
||||
intent: "从本仓库抽取一个或多个 Vab 组件到目标项目,确保依赖闭包完整"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- components # 例如 ["VabTabs", "VabMenu"]
|
||||
- target_project_type
|
||||
- extraction_style
|
||||
|
||||
scope:
|
||||
base_dir: "library/components"
|
||||
|
||||
dependency_closure_checklist:
|
||||
runtime:
|
||||
- "Element Plus 组件是否使用(el-*)"
|
||||
- "icons:vab-icons 与 @element-plus/icons-vue 是否需要"
|
||||
- "全局样式:library/styles/vab.scss 是否是前置依赖"
|
||||
app_wiring:
|
||||
- "是否依赖 setupVab 的全局注册(VabIcon / 图标注册 / 插件自动加载)"
|
||||
alias:
|
||||
- "@ -> src"
|
||||
- "@vab -> library"
|
||||
|
||||
outputs:
|
||||
required_sections:
|
||||
- changed_files
|
||||
- extracted_modules
|
||||
- dependency_closure
|
||||
- acceptance_commands
|
||||
- risks
|
||||
|
||||
acceptance:
|
||||
- "目标项目可渲染组件"
|
||||
- "关键交互可用(按组件规格中的验收点)"
|
||||
44
AI-Coding/openspec-lite/tasks/extract-layout.yaml
Normal file
44
AI-Coding/openspec-lite/tasks/extract-layout.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
# Task Template: 抽取布局体系(library/layouts)
|
||||
|
||||
task:
|
||||
id: extract-layout
|
||||
intent: "从本仓库抽取布局体系到目标项目,最小闭包迁移,尽量不改动原仓库代码"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- target_project_type # vue-cli | vite | other
|
||||
- extraction_style # copy-module | copy-snippet
|
||||
|
||||
scope:
|
||||
entrypoints:
|
||||
- library/layouts/index.vue
|
||||
- library/layouts/VabLayoutVertical/
|
||||
- library/layouts/VabLayoutHorizontal/
|
||||
- library/layouts/VabLayoutCommon/
|
||||
- library/layouts/VabLayoutComprehensive/
|
||||
- library/layouts/VabLayoutFloat/
|
||||
- library/layouts/VabLayoutColumn/
|
||||
|
||||
dependency_closure_checklist:
|
||||
runtime:
|
||||
- "Element Plus(el-backtop 等)"
|
||||
- "Theme 组件(library/components/VabTheme)是否随闭包迁移"
|
||||
- "事件总线注入(library/plugins/vab.ts:$pub/$sub/$unsub)是否可用"
|
||||
- "Pinia settings store:src/store/modules/settings(theme/layout/collapse/device)"
|
||||
- "全局样式变量:library/styles/variables/(布局 SCSS 使用的变量)"
|
||||
- "Theme 变量:library/styles/variables/vab-*-variables.module.scss(settings.updateTheme() 依赖)"
|
||||
alias:
|
||||
- "@ -> src"
|
||||
- "@vab -> library"
|
||||
|
||||
outputs:
|
||||
required_sections:
|
||||
- changed_files
|
||||
- extracted_modules
|
||||
- dependency_closure
|
||||
- acceptance_commands
|
||||
- risks
|
||||
|
||||
acceptance:
|
||||
- "Layout 能渲染"
|
||||
- "切换移动端/桌面端时不崩溃(resize/watch 逻辑生效)"
|
||||
30
AI-Coding/openspec-lite/tasks/extract-module.yaml
Normal file
30
AI-Coding/openspec-lite/tasks/extract-module.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
# Task Template: 抽取/复用模块(轻量版)
|
||||
|
||||
task:
|
||||
id: extract-module
|
||||
intent: "从本仓库抽取模块到目标项目,尽量不改动原仓库代码"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- module_id
|
||||
- target_project_type # vue-cli | vite | other
|
||||
- extraction_style # copy-module | copy-snippet
|
||||
|
||||
outputs:
|
||||
required_sections:
|
||||
- changed_files
|
||||
- extracted_modules
|
||||
- dependency_closure
|
||||
- acceptance_commands
|
||||
- risks
|
||||
|
||||
procedure:
|
||||
- step: "从 openspec-lite/manifest.yaml 选择 module_id 并列出 entrypoints"
|
||||
- step: "读取入口文件,分析 import 依赖与运行时依赖(样式、插件、types、alias)"
|
||||
- step: "按 extraction_style 抽取(优先 copy-module)"
|
||||
- step: "在目标项目补齐依赖(package.json、alias、types include)"
|
||||
- step: "给出最小验收命令并说明风险"
|
||||
|
||||
acceptance:
|
||||
- "目标项目可启动(serve)"
|
||||
- "模块能力可用(根据 module_id 的验收点)"
|
||||
35
AI-Coding/openspec-lite/tasks/extract-plugin.yaml
Normal file
35
AI-Coding/openspec-lite/tasks/extract-plugin.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
# Task Template: 抽取插件(library/plugins/*)
|
||||
|
||||
task:
|
||||
id: extract-plugin
|
||||
intent: "从本仓库抽取一个或多个插件到目标项目,确保注入点与依赖闭包完整"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- plugins # 例如 ["vab", "directive", "errorLog", "support"]
|
||||
- target_project_type
|
||||
- extraction_style
|
||||
|
||||
scope:
|
||||
base_dir: "library/plugins"
|
||||
|
||||
dependency_closure_checklist:
|
||||
runtime:
|
||||
- "vab:Element Plus 的 ElMessage/ElLoading/ElMessageBox/ElNotification 是否全局可用"
|
||||
- "directive:src/utils/permission 与权限数据来源是否齐全"
|
||||
- "errorLog:src/store/modules/errorLog 与 config/errorLog 是否齐全"
|
||||
- "support:__APP_INFO__ 注入方式是否一致"
|
||||
wiring:
|
||||
- "是否通过 setupVab(library/index.ts) 自动 app.use() 安装;若非自动,需要在入口手动 app.use()"
|
||||
|
||||
outputs:
|
||||
required_sections:
|
||||
- changed_files
|
||||
- extracted_modules
|
||||
- dependency_closure
|
||||
- acceptance_commands
|
||||
- risks
|
||||
|
||||
acceptance:
|
||||
- "插件安装后,不影响应用启动"
|
||||
- "涉及的注入能力/指令/错误捕获按模块规格验收"
|
||||
41
AI-Coding/openspec-lite/tasks/extract-theme.yaml
Normal file
41
AI-Coding/openspec-lite/tasks/extract-theme.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
# Task Template: 抽取主题系统(VabTheme + settings 主题闭包)
|
||||
|
||||
task:
|
||||
id: extract-theme
|
||||
intent: "从本仓库抽取 Theme 系统到目标项目,确保事件总线 + settings theme 闭包完整"
|
||||
|
||||
inputs:
|
||||
required:
|
||||
- target_project_type # vue-cli | vite | other
|
||||
- extraction_style # copy-module | copy-snippet
|
||||
|
||||
scope:
|
||||
entrypoints:
|
||||
- library/components/VabTheme/
|
||||
- src/store/modules/settings.ts
|
||||
- library/plugins/vab.ts
|
||||
- library/styles/variables/
|
||||
|
||||
dependency_closure_checklist:
|
||||
runtime:
|
||||
- "Pinia settings store 是否存在并已在入口初始化"
|
||||
- "vab 插件是否安装($pub/$sub/$baseLoading 注入)"
|
||||
- "i18n translate 是否可用"
|
||||
- "Element Plus Drawer/表单控件是否可用"
|
||||
bundler:
|
||||
- "settings.updateTheme() 的 require('@vab/styles/variables/vab-*-variables.module.scss') 在目标构建器中是否可用"
|
||||
alias:
|
||||
- "@ -> src"
|
||||
- "@vab -> library"
|
||||
|
||||
outputs:
|
||||
required_sections:
|
||||
- changed_files
|
||||
- extracted_modules
|
||||
- dependency_closure
|
||||
- acceptance_commands
|
||||
- risks
|
||||
|
||||
acceptance:
|
||||
- "触发 $pub('theme') 能打开 Theme Drawer"
|
||||
- "修改主题并保存后,刷新页面主题持久化且样式变量生效"
|
||||
Reference in New Issue
Block a user