Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

rockets-crud-generator火箭碎片生成器

Agent Skill

rockets-crud-generator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

329

周安装

14

GitHub Stars

公开资料未说明

下载量

115
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rockets-crud-generator(火箭碎片生成器)
来源仓库:https://github.com/btwld/skills
仓库路径:skills/rockets-crud-generator
安装命令:
npx skills add https://github.com/btwld/skills --skill rockets-crud-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/btwld/skills --skill rockets-crud-generator

简介

rockets-crud-generator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 适用于研究检索类任务,支持基于关键词、任务场景或来源线索进行信息筛选。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和联网需求。
  • 安装前建议核实维护状态及是否会触发文件读写或命令执行操作。
  • 可结合原始 README 和仓库路径进一步验证具体用法和功能边界。

SKILL.md

Rockets SDK CRUD Generator

Generate complete CRUD modules following Rockets SDK patterns with TypeORM, NestJS, and proper DTOs/interfaces.

Quick Start

# Generate files (outputs JSON)
node skills/rockets-crud-generator/scripts/generate.js '{ "entityName": "Product", "fields": [...] }'

# Generate + integrate into project
node skills/rockets-crud-generator/scripts/generate.js '{ ... }' | node skills/rockets-crud-generator/scripts/integrate.js --project ./apps/api

# Validate after generation
node skills/rockets-crud-generator/scripts/validate.js --project ./apps/api --build

Scripts

ScriptPurposeTokens
generate.jsGenerate all files as JSON output0
integrate.jsWrite files + wire into project (entities, modules, ACL, queryServices)0
validate.jsPost-generation checks (structure, build, ACL)0

Configuration

interface Config {
  // Required
  entityName: string;           // PascalCase entity name

  // Optional naming
  pluralName?: string;          // API path plural (auto-pluralized)
  tableName?: string;           // Database table (snake_case)

  // Output paths (configurable per project)
  paths?: {
    entity?: string;            // Default: "src/entities"
    module?: string;            // Default: "src/modules"
    shared?: string;            // Default: "src/shared" (set to null to skip)
  };

  // Shared package import path for generated code
  sharedPackage?: string;       // e.g., "@my-org/shared" (default: relative import)

  // Fields & Relations
  fields: FieldConfig[];
  relations?: RelationConfig[];

  // Operations (default: all)
  operations?: ('readMany' | 'readOne' | 'createOne' | 'updateOne' | 'deleteOne' | 'recoverOne')[];

  // ACL (access control)
  acl?: Record<string, { possession: 'own' | 'any'; operations: ('create'|'read'|'update'|'delete')[] }>;
  ownerField?: string;          // Field for ownership check (default: "userId")

  // Options
  generateModelService?: boolean;
  isJunction?: boolean;
}

Field Configuration

interface FieldConfig {
  name: string;
  type: 'string' | 'text' | 'number' | 'float' | 'boolean' | 'date' | 'uuid' | 'json' | 'enum';
  required?: boolean;           // Default: true
  unique?: boolean;
  maxLength?: number;
  minLength?: number;
  min?: number;
  max?: number;
  precision?: number;           // For float
  scale?: number;               // For float
  default?: any;
  enumValues?: string[];        // Required for enum type
  apiDescription?: string;
  apiExample?: any;
  creatable?: boolean;          // Include in CreateDto (default: true)
  updatable?: boolean;          // Include in UpdateDto (default: true)
}

Relation Configuration

interface RelationConfig {
  name: string;
  type: 'manyToOne' | 'oneToMany' | 'oneToOne';
  targetEntity: string;         // Base name WITHOUT "Entity" suffix (e.g., "User" not "UserEntity")
  foreignKey?: string;          // Default: targetCamelId
  joinType?: 'LEFT' | 'INNER';
  onDelete?: 'CASCADE' | 'SET NULL' | 'RESTRICT';
  nullable?: boolean;
}
Important: targetEntity must be the base entity name (e.g., "User", "Category"). The generator appends Entity automatically. If you pass "UserEntity", the suffix is stripped to prevent double-suffixing (UserEntityEntity).

ACL Configuration

{
  "entityName": "Task",
  "ownerField": "userId",
  "acl": {
    "admin": { "possession": "any", "operations": ["create","read","update","delete"] },
    "user": { "possession": "own", "operations": ["create","read","update","delete"] }
  }
}

When acl is provided:

  • Access query service uses @InjectDynamicRepository for ownership checks
  • Generator outputs wiring snippets for app.acl.ts (resource enum + grants)
  • Generator outputs wiring for queryServices in AccessControlModule

Examples

Basic Entity

{
  "entityName": "Tag",
  "fields": [
    { "name": "name", "type": "string", "required": true, "maxLength": 50, "unique": true },
    { "name": "color", "type": "string", "maxLength": 7, "apiExample": "#FF5733" }
  ]
}

With ACL + Custom Paths (monorepo)

{
  "entityName": "Product",
  "paths": {
    "entity": "apps/api/src/entities",
    "module": "apps/api/src/modules",
    "shared": "packages/shared/src"
  },
  "ownerField": "createdById",
  "acl": {
    "admin": { "possession": "any", "operations": ["create","read","update","delete"] },
    "user": { "possession": "own", "operations": ["create","read","update","delete"] }
  },
  "fields": [
    { "name": "name", "type": "string", "required": true },
    { "name": "price", "type": "float", "precision": 10, "scale": 2 }
  ]
}

Junction Table

{
  "entityName": "ProductTag",
  "tableName": "product_tag",
  "isJunction": true,
  "fields": [],
  "relations": [
    { "name": "product", "type": "manyToOne", "targetEntity": "Product", "onDelete": "CASCADE" },
    { "name": "tag", "type": "manyToOne", "targetEntity": "Tag", "onDelete": "CASCADE" }
  ],
  "operations": ["readMany", "readOne", "createOne", "deleteOne"]
}

Generated Files

For a given entity (e.g. Product) with default paths:

src/
├── entities/
│   └── {entity}.entity.ts
├── modules/{entity}/
│   ├── constants/{entity}.constants.ts
│   ├── {entity}.module.ts
│   ├── {entity}.crud.controller.ts
│   ├── {entity}.crud.service.ts
│   ├── {entity}-typeorm-crud.adapter.ts
│   └── {entity}-access-query.service.ts
└── shared/{entity}/          (if paths.shared is set)
    ├── dtos/
    │   ├── {entity}.dto.ts
    │   ├── {entity}-create.dto.ts
    │   ├── {entity}-update.dto.ts
    │   └── {entity}-paginated.dto.ts
    ├── interfaces/
    │   ├── {entity}.interface.ts
    │   ├── {entity}-creatable.interface.ts
    │   └── {entity}-updatable.interface.ts
    └── index.ts

AccessControl Integration (queryServices pattern)

The generator produces controllers with full ACL decorators (@UseGuards(AccessControlGuard), @AccessControlQuery, @AccessControlReadMany, etc.). These work correctly when the access query service is registered via queryServices in AccessControlModule.forRoot().

How it works

  1. Generator creates the access query service with @InjectDynamicRepository (database-agnostic)
  2. integrate.js registers the service in queryServices of the AccessControlModule config
  3. The AccessControlGuard resolves the service from its own scope (no hack needed)

Access Query Service pattern

@Injectable()
export class TaskAccessQueryService implements CanAccess {
  constructor(
    @InjectDynamicRepository(TASK_MODULE_TASK_ENTITY_KEY)
    private taskRepo: RepositoryInterface<TaskEntity>,
  ) {}

  async canAccess(context: AccessControlContextInterface): Promise<boolean> {
    const query = context.getQuery();
    if (query.possession === 'any') return true;
    if (query.possession === 'own') {
      // Ownership check via dynamic repository (database-agnostic)
      const entity = await this.taskRepo.findOne({ where: { id: entityId } });
      return entity?.userId === user.id;
    }
    return false;
  }
}

Required wiring in app.module.ts

// AccessControlModule config (or via RocketsAuthModule):
accessControl: {
  settings: { rules: acRules },
  queryServices: [TaskAccessQueryService, CategoryAccessQueryService],
}

The integrate.js script handles this automatically.

integrate.js — Auto-wiring

Takes the JSON output from generate.js and wires everything:

node generate.js '{ ... }' | node integrate.js --project ./apps/api

What it does:

  1. Writes all generated files to disk
  2. Adds entity export to entities/index.ts
  3. Adds entity to typeorm.settings.ts entities array
  4. Adds module import to app.module.ts
  5. Adds resource + grants to app.acl.ts (if acl config present)
  6. Adds access query service to queryServices in AccessControlModule config

validate.js — Post-generation Checks

Validates project structure and patterns after generation:

node validate.js --project ./apps/api           # Static checks only
node validate.js --project ./apps/api --build   # Static checks + TypeScript build

Generated Code Checks

  1. @InjectRepository only in *-typeorm-crud.adapter.ts
  2. All entities exported in entities/index.ts
  3. All modules imported in app.module.ts
  4. ACL resources defined in app.acl.ts
  5. Access query services registered in feature module providers
  6. No ACL workaround providers in feature modules
  7. ACL own-scope entities have matching ownerField column in entity
  8. CrudModule.forRoot({}) present when CrudModule.forFeature() is used

Template Integrity Checks (safety nets — should never fire on a correct template)

  1. No imports from internal dist/ paths
  2. No stale template placeholder strings (Music Management, PetAccessQueryService, etc.)
  3. All entity tables have corresponding migrations (severity: error)
  4. No SQLite base classes (*SqliteEntity) in a Postgres project

Output: {passed: boolean, issues: [{severity, rule, message, file, line}]}

Known Limitations — Relations

The generator produces CrudRelations decorators and CrudRelationRegistry providers for modules with relations. These reference the related module's CRUD service (e.g., UserCrudService), which must exist as an importable module. If the related entity is managed by the SDK (e.g., User from RocketsAuthModule) rather than by a standalone module you wrote, the generated relation wiring will fail.

Workaround for SDK-managed entities: Remove the CrudRelations decorator, the CrudRelationRegistry provider, and all references to non-existent related modules/services. Instead, rely on TypeORM @ManyToOne/@JoinColumn decorators on the entity and include the FK column (userId, categoryId) directly in the DTO. The CRUD endpoints will accept and persist the FK; TypeORM handles the join at query time.

Post-Generation (manual steps if not using integrate.js)

  1. Export entity from entities index
  2. Import module in app.module.ts
  3. Add entity to typeorm.settings.ts
  4. Register access query service in queryServices of AccessControlModule config
  5. Add resource + grants to app.acl.ts (if using ACL)
  6. Remove CrudRelations if related entity is SDK-managed (see above)
  7. Export from shared index (if using shared package)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.48%
按下载量换算30

Codex

25.56%
按下载量换算29

Antigravity

19.3%
按下载量换算22

OpenCode

13.1%
按下载量换算15

Gemini CLI

8.72%
按下载量换算10

Cursor

3.4%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills