Install any skill in seconds. Free to start, no credit card required.
Get Started Free →tencentblueking/全局状态管理规范 (Pinia)
基于 Pinia 的全局状态管理规范,包含 UserStore、AppStore 的标准定义
Passed 23 of 23 test cases with the skill, and 21 of 23 without it.
2 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
Show the recommended file path and exported function name for a user management Pinia store in a Vue 3 TypeScript project.
| Checked | Without skill | With skill |
|---|---|---|
| The file path is src/store/user.ts. | Missed | Passed |
| The exported store hook function is named useUserStore. | Passed | Passed |
The instructions your model reads when the skill loads.
推荐使用 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 直接调用
test cases passed, vs 21 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.