Atlas / Skills / tencentblueking / Pinia Setup

Pinia SetupSAFE

skills/tencentblueking/pinia-setup

蓝鲸智云容器管理平台(BlueKing Container Service)

Verdict
SAFE
Grade
B
Trust score
89 /100
Version
—
Hosts
—
License
NOASSERTION
Stars
840
01

Overview

蓝鲸智云容器管理平台(BlueKing Container Service)

Read from source at commit 87a6fdb6f4b4OBSERVED · 2026-10-12
Advertisement
02

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

---
id: eng-state-management
name: 全局状态管理规范 (Pinia)
category: engineering
description: 基于 Pinia 的全局状态管理规范,包含 UserStore、AppStore 的标准定义
tags: [pinia, store, state, vue3]
updated_at: 2026-01-09
---

# 全局状态管理规范 (Pinia)

推荐使用 **Setup Store** 语法(类似 Composition API),比 Options API 更灵活。

## 基础模式

```typescript
// 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 };
});
```

## 组件中使用

```typescript
<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 模板 | `skill://pinia-setup/assets/store-template.ts` |


---
## 📦 可用资源

- `skill://pinia-setup/assets/store-template.ts`

> 根据 SKILL.md 中的 IF-THEN 规则判断是否需要加载
03

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryWARN
L1Static analysis of the codeNA
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (1)

MEDIUMInventory / provenance · inv.symlink · CWE-1104
.codebuddy
.codebuddy
Why it matters. link not followed

Gates applied: no_behavioural_pass.

Audited 2026-10-12 · audit v0.4.1 · source sha 87a6fdb6f4b4full audit observations/trust-audit/skill/tencentblueking__pinia-setup.json · Report an issue / request a re-scan
04

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-1287a6fdb6f4b4SAFEB89first audit
05

Questions

What does the Pinia Setup skill do?

蓝鲸智云容器管理平台(BlueKing Container Service)

Is Pinia Setup safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can Pinia Setup access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

How current is this page?

The grade is for one exact copy of the source (87a6fdb6f4b4), read on 2026-10-12. The repository is watched, and a new audit runs when it changes — this is the first audit.

Advertisement