بنقرة واحدة
بنقرة واحدة
检查 API 代码实现、YAML 网关资源定义、API 文档三者是否一致。当用户请求检查 API 一致性、校验代码和文档匹配、check api consistency、check yaml matches code、openapi 一致性检查、网关资源定义检查、API 文档对齐、检查 operationId 一致性、检查 backend 路径、grant_permissions 检查、MCP Server 配置检查、鉴权配置检查时使用。Actions: validate, check, analyze, fix. Triggers: api-consistency-check, 检查 API 一致性, 检查代码和文档匹配, check api consistency, check yaml matches code, openapi 检查, 网关资源检查, 文档对齐检查, operationId 检查, backend 路径检查, 三层一致性, YAML 代码文档一致性.
Generate executable Playwright test scripts from BDD case files by exploring a live BlueKing API Gateway environment. TRIGGER when: user says 'bdd-test-gen', 'generate test scripts', 'generate scripts from bdd', 'convert bdd to scripts'. DO NOT TRIGGER for: running tests (use make test-bdd), editing BDD cases, unit tests.
| id | pinia-setup |
| name | pinia-setup |
| description | 基于 Pinia 的全局状态管理规范,包含 UserStore、AppStore 的标准定义 |
推荐使用 Setup Store 语法(类似 Composition API),比 Options API 更灵活。
// src/store/user.ts
import { defineStore } from 'pinia';
import { ref } from 'vue';
export const useUserStore = defineStore('user', () => {
const userInfo = ref(null);
const loading = ref(false);
const fetchUserInfo = async () => {
if (userInfo.value) return userInfo.value;
loading.value = true;
try {
userInfo.value = await http.get('/user/info');
} finally {
loading.value = false;
}
};
return { userInfo, loading, fetchUserInfo };
});
<script setup lang="ts">
import { useUserStore } from '@/store/user';
import { storeToRefs } from 'pinia';
const userStore = useUserStore();
// 使用 storeToRefs 保持响应性
const { userInfo, loading } = storeToRefs(userStore);
// Action 直接调用
userStore.fetchUserInfo();
</script>
| 错误 | 解决 |
|---|---|
| 解构丢失响应性 | 用 storeToRefs() |
| 多次实例化 | Store 单例,直接 useXxxStore() |
| 资源 | URI |
|---|---|
| 完整 Store 模板 | ./assets/store-template.ts |
./assets/store-template.ts根据 SKILL.md 中的 IF-THEN 规则判断是否需要加载