henrydiaosi/ai-framework/user

Claude Code and agent skill by henrydiaosi/ai-framework

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install henrydiaosi/ai-framework/user

SKILL.md

User 用户模块

层级:第 3 层(子模块文档)
上层:src/SKILL.md

<!-- @index

keytagsdesc
overview概述,架构模块概述
api:getById查询,ID,获取根据ID获取用户
api:getByEmail查询,邮箱,获取根据邮箱获取用户
api:update更新,修改,编辑更新用户信息
api:delete删除,移除删除用户
deps依赖,引用依赖关系

-->

<!-- @key:overview -->

模块概述

  • 职责:用户信息的增删改查
  • 位置:src/modules/user/
  • 依赖:core/database, core/logger, core/error

模块架构

user/
├── SKILL.md # 本文档
├── index.ts # 模块入口
├── controllers/
│ └── user.controller.ts
├── services/
│ └── user.service.ts
├── models/
│ └── user.model.ts
├── types/
│ ├── user.dto.ts
│ └── update-user.dto.ts
└── __tests__/
└── user.service.test.ts

<!-- @/key:overview -->

API 文档

UserService

<!-- @key:api:getById -->

getById(id: string): Promise<User>

功能说明:根据 ID 获取用户信息

参数:

  • id (string): 用户 ID

返回值:

  • (Promise<User>): 用户对象

抛出异常:

  • NotFoundError: 当用户不存在时

使用示例:

typescript
import { UserService } from '@/modules/user';
const userService = new UserService();
const user = await userService.getById('user-id-123');

<!-- @/key:api:getById -->


<!-- @key:api:getByEmail -->

getByEmail(email: string): Promise<User | null>

功能说明:根据邮箱获取用户信息

参数:

  • email (string): 用户邮箱

返回值:

  • (Promise<User | null>): 用户对象,不存在时返回 null

使用示例:

typescript
import { UserService } from '@/modules/user';
const userService = new UserService();
const user = await userService.getByEmail('user@example.com');
if (user) {
console.log(user.name);
}

<!-- @/key:api:getByEmail -->


<!-- @key:api:update -->

update(id: string, dto: UpdateUserDto): Promise<User>

功能说明:更新用户信息

参数:

  • id (string): 用户 ID
  • dto (UpdateUserDto): 更新数据
  • name (string, 可选): 用户名称
  • avatar (string, 可选): 头像 URL

返回值:

  • (Promise<User>): 更新后的用户对象

抛出异常:

  • NotFoundError: 当用户不存在时
  • ValidationError: 当参数验证失败时

使用示例:

typescript
import { UserService } from '@/modules/user';
const userService = new UserService();
const user = await userService.update('user-id-123', {
name: 'New Name',
});

<!-- @/key:api:update -->


<!-- @key:api:delete -->

delete(id: string): Promise<void>

功能说明:删除用户(软删除)

参数:

  • id (string): 用户 ID

返回值:

  • (Promise<void>)

抛出异常:

  • NotFoundError: 当用户不存在时

<!-- @/key:api:delete -->

<!-- @key:deps -->

依赖关系

内部依赖
  • @/core/database: 数据库操作
  • @/core/logger: 日志记录
  • @/core/error: 错误处理

相关文档

<!-- @/key:deps -->

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
54
Repository forks
11
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/henrydiaosi/ai-framework/user/badge)](https://verified-skill.com/skills/henrydiaosi/ai-framework/user)

Something wrong with this skill or its page? Tell us.