Token导航 LogoToken导航TokenDH.com
开发规范external-servicegithub未标认证来源可访问许可证需确认审计通过

faasjs-best-practicesfaasjs 最佳实践

Agent Skill

faasjs-best-practices 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

948

周安装

38

GitHub Stars

118

下载量

307
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/faasjs/faasjs --skill faasjs-best-practices

简介

faasjs-best-practices 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 它能辅助 Agent 遵循 faasjs 项目约定,包括应用切片、API 定义和测试规范。
  • 使用时需区分只读查询与写入操作;涉及创建 PR、修改 Issue 或访问私有仓库时,应确认 token 权限和目标范围。
  • 安装前建议核对来源仓库维护状态,并留意是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Start Here

Before changing code, inspect nearby examples and read only the guides needed for the task. Prefer project conventions over generic TypeScript, React, Node, or SQL patterns.

Agent Task Routing

Global Rules

  • Read tsconfig.json and any extended TypeScript config before choosing import paths.
  • Prefer FaasJS TypeScript loader support for direct Node execution, and keep local TypeScript imports extensionless instead of adding .ts or .tsx suffixes.
  • Prefer aliases already defined in TypeScript config over deep relative imports.
  • Keep short relative imports for nearby files in the same feature or directory.
  • Do not invent a new alias in code unless the corresponding tsconfig.json and runtime resolver are configured in the same change.
  • Keep changes minimal and task-scoped: no extra features, drive-by refactors, opportunistic cleanup, feature flags, transition shims, or speculative future-proofing.
  • Keep code direct: validate at system boundaries such as user input and external APIs, fail fast on invalid internal data, and do not add silent fallbacks or impossible-case handling.
  • Extract helpers, hooks, components, or abstractions only when they are reused, create a real boundary, or simplify a large block; keep one-off code inline unless the body is over about 20 lines.
  • Document package public exports with JSDoc. Add JSDoc for shared app exports when the caller contract is not obvious. Do not add comments, docstrings, or type annotations to untouched code.
  • Delete confirmed-dead code directly instead of leaving temporary tricks such as _unused renames, type re-exports, or // removed markers.
  • Keep files under about 500 lines by splitting along real boundaries before they grow too large.
  • Treat vp check --fix and vp test as the default acceptance gates before handoff; if either cannot run, record the reason and the narrower validation that was completed.

Security And Boundary Checklist

Use this checklist whenever code handles users, tenants, permissions, secrets, external input, or persistent data.

  • Validate external input at the boundary with defineApi schemas, HTTP parsing, or the relevant integration adapter.
  • Check whether the API needs current-user, tenant, organization, project, role, or permission scoping before reading or mutating data.
  • Prefer project plugins for auth, tenant, request metadata, and other cross-cutting business context.
  • Return expected client errors with explicit HTTP status codes; reserve unexpected 500 failures for internal failures.
  • Do not log secrets, tokens, passwords, cookies, full sensitive payloads, or unredacted third-party responses.

Definition Of Done

Before handoff, verify the smallest meaningful set for the change:

  • Imports follow the local tsconfig.json, existing aliases, and extensionless local import rules.
  • API changes include schema validation, typed params, narrow response shapes, and tests for success plus meaningful failure paths.
  • Creating, renaming, or moving .api.ts files is followed by faas types or a recorded reason it could not run.
  • Creating, renaming, or moving .job.ts files keeps enqueueJob() paths and worker/scheduler roots aligned.
  • Database shape changes include a migration, table type updates, and PG tests or a recorded reason they are not needed.
  • UI create/update/delete flows provide user feedback and refresh, close, or invalidate the affected surface intentionally.
  • Tests mock only narrow external boundaries and keep FaasJS validation, plugins, and database behavior real when practical.
  • Test files live in the __tests__ folder inside the code, feature, or slice folder they protect. Do not centralize tests under a package-level src/__tests__, including feature-named subfolders inside that centralized directory. If a business unit would otherwise be a single file, convert it to a folder with index.ts or index.tsx and put its tests under that folder's __tests__.
  • Run targeted tests first when available, then vp check --fix and vp test when practical; record any blocked commands and the validation that did run.

Avoid By Default

  • Do not add Rails-style generators, generic CRUD layers, broad repository abstractions, or speculative framework shims for a single slice.
  • Do not bypass FaasJS wrappers with raw React, Ant Design, SQL, fetch, or test mocks when the curated helper fits.
  • Do not add catch-all fallback branches for impossible internal states; fix the upstream invariant or fail fast.
  • Do not introduce a second config, request, logging, or database bootstrap path unless the task explicitly requires it.

Guidelines

  • Curated Stack Guide: Covers the Rails-inspired default stack, official React/Ant Design/PostgreSQL path, plugin extension boundaries, auth/permission scope, and replacement rules.
  • Application Slices Guide: Covers vertical UI/API/database/test slices, recommended file layout, agent workflow, and why FaasJS avoids generator-heavy development.
  • Ant Design Guide: Covers @faasjs/ant-design page structure, routing, CRUD composition, feature-local APIs, and UI feedback patterns.
  • File Conventions: Covers where to place pages, components, hooks, and .api.ts files, plus when separate files are worth creating.
  • Code Comments Guide: Covers package public JSDoc expectations, caller contract conventions, when shared app exports need docs, and how to explain non-standard code without narrating it line by line.
  • Node Utils Guide: Covers Node-only helpers for env/config loading, function and plugin bootstrapping, module loading, and shared logging.
  • Project Config Guide: Covers how to keep tsconfig.json, vite.config.ts, and shared tooling config aligned with FaasJS defaults.
  • Testing Guide: Covers shared testing principles such as choosing test level, keeping mock boundaries narrow, and avoiding unnecessary mocks.
  • React Guide: Covers React component and hook patterns in FaasJS, especially avoiding native useEffect and handling non-primitive dependencies safely.
  • React Data Fetching Guide: Covers when to use useFaas, useFaasStream, faas, or wrapper components, and how to handle loading, error, and retry states.
  • React Testing Guide: Covers request-related React testing with setMock, shared cleanup, jsdom, and common request-flow scenarios on top of the shared Testing Guide.
  • defineApi Guide: Covers building .api.ts endpoints with defineApi, inline schemas, typed params, error handling, and validation expectations.
  • Jobs Guide: Covers .job.ts files, defineJob, enqueueJob, workers, scheduler cron enqueueing, retries, idempotency, and testing.
  • Logger Guide: Covers when to reuse injected loggers versus creating Logger instances, how to choose log levels, and how to time slow operations.
  • Utils Guide: Covers portable helpers from @faasjs/utils for deep merging and converting text or JSON to and from streams.
  • PG Query Builder and Raw SQL Guide: Covers preferring QueryBuilder clauses, choosing raw SQL fallbacks deliberately, keeping client bootstrap consistent, and narrowing row shapes intentionally.
  • PG Table Types Guide: Covers declaration merging on Tables, concrete row shapes, and keeping query inference aligned with table definitions.
  • PG Schema and Migrations Guide: Covers timestamped migrations, SchemaBuilder, TableBuilder, and transactional schema changes.
  • PG Testing Guide: Covers PgVitestPlugin(), shared DATABASE_URL bootstrap, and pairing runtime assertions with expectTypeOf(...).

Specs

Packages

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Claude

33.13%
按下载量换算102

Codex

32.74%
按下载量换算101

Cursor

18.56%
按下载量换算57

Gemini CLI

8.47%
按下载量换算26

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills