Add beta testers for Pixy on Android and iOS. Use when a user asks to test a new version.
中文简介正在准备中。当前显示原文说明。
Use when writing, reviewing, or refactoring TypeScript
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
✅ Use
getUsers({ pageSize, pageIndex });
const tool = stripPrefix({
value: ctx.toolName,
prefix: prefix,
});
❌ Avoid
getUsers(pageSize, pageIndex);
stripPrefix(ctx.toolName, prefix);
Avoid ternaries that stand in for a branch. Oxlint rejects nested ternaries; simple ternaries still need judgment.
Every real error path must use the project's structured error helper. This includes thrown errors, returned HTTP/OAuth/JSON errors, and error logs.
Structured errors must include:
statusmessagewhyfixThe fields must be specific enough for an operator or developer to understand what happened, why it happened, and what action resolves it.
✅ Use
throw createError({
status: 502,
message: "OAuth metadata request failed",
why: `The provider returned status ${response.status} while loading OAuth metadata`,
fix: "Verify the OAuth provider is reachable and the issuer configuration is correct",
});
❌ Avoid
throw new Error(`OAuth metadata request failed with ${response.status}`);
Boolean-returning functions must be prefixed with a boolean-style verb.
Use prefixes like:
ishascanshouldwaswill✅ Use
function isAllowed({ userId }: { userId: string }): boolean {
return userId.length > 0;
}
❌ Avoid ambiguous boolean names
function allowed(userId: string): boolean {
return userId.length > 0;
}
Function names should be short and start with an action verb. Prefer verb + subject.
Use verbs like:
getsetcreateupdatedeletefetchloadparseformatincreasedecrease✅ Use
getAttrs();
increaseRetries();
formatName();
❌ Avoid noun-only or abbreviated names when the function performs an action
baseAttr();
retryCount();
displayName();
✅ Use one-word function names when the word is the complete, intentional API and reads clearly at the call site, especially for small DSL-style helpers or result builders
success();
error();
text();
Use the file name as naming context. Do not repeat the domain already supplied by the file path or file name unless it removes ambiguity at the call site.
✅ Use
// data-analysis.ts
export function getSandbox() {
// ...
}
❌ Avoid
// data-analysis.ts
export function getDataAnalysisSandbox() {
// ...
}
✅ Use
const DATABASE_URL = process.env.DATABASE_URL;
if (!DATABASE_URL) {
throw createError({
status: 500,
message: "DATABASE_URL is required",
why: "DATABASE_URL was not set in the environment",
fix: "Set DATABASE_URL before starting the service",
});
}
❌ Avoid
const DATABASE_URL =
process.env.DATABASE_URL ??
process.env.LEGACY_DATABASE_URL ??
"postgres://localhost:5432/app";
✅ Use
async function readOnlyQuery({ db, query }) {
const result = await db.explainQuery({ query });
if (result.statementType !== "SELECT") {
// throw structured error
}
return query;
}
❌ Avoid
function readOnlyQuery(query) {
const sql = String(query).trim().replace(/;+\s*$/, "");
if (!/^(select|with|explain)\b/i.test(sql)) throw new Error("read only only");
if (/\b(insert|update|delete|drop|alter|create)\b/i.test(sql)) throw new Error("mutating sql");
return sql;
}
@inheritDoc or @inherit.@returns tag, write the typed errors that the function can return. These errors include Result types and tagged errors.@throws tag only if one of these is true:
notYetImplemented path.✅ Good
/**
* Parse an email address from untrusted input.
*
* The input is trimmed and lower-cased before validation. Construct values
* only through this function; the brand makes raw strings unusable where an
* {@link EmailAddress} is required.
*
* @param input - The untrusted string to parse.
* @returns A parsed {@link EmailAddress}, or {@link InvalidEmailAddress} when
* the input is invalid.
*/
export function parse(input: string): Result<EmailAddress, InvalidEmailAddress> {
// ...
}
/** Input required to evaluate a boolean flag for a single user. */
export type BooleanFlagInput = {
/** The feature flag key to evaluate. */
readonly flagKey: string;
/** The user's email, used as both context key and email attribute. */
readonly userEmail: string;
/** The value returned when the flag cannot be evaluated. */
readonly defaultValue: boolean;
};
❌ Bad
/**
* Parses input.
*
* @inheritDoc
* @param input - string
* @returns Result<EmailAddress, InvalidEmailAddress>
*/
export function parse(input: string): Result<EmailAddress, InvalidEmailAddress> {
// ...
}
export type BooleanFlagInput = {
readonly flagKey: string;
readonly userEmail: string;
readonly defaultValue: boolean;
};
✅ Good
/**
* Context window of {@link MODEL_ID}. Declared here because this model is
* unlisted in the gateway catalog, so the build cannot resolve compaction
* metadata. Keep it in sync when the model changes.
* See https://example.com/docs/agent-config
*/
export const MODEL_CONTEXT_WINDOW_TOKENS = 1_000_000;
❌ Bad
export const MODEL_CONTEXT_WINDOW_TOKENS = 1_000_000;
✅ Good
/**
* Terminal assistant message held until the turn ends.
*
* `message.completed` fires inside the step that produced it, before that
* step's `step.completed` reports usage. Posting there would render a footer
* whose cost is always missing on a single-step turn, so delivery waits for
* `turn.completed`. See https://example.com/docs/sessions
*/
const pendingChannelResponse = defineState<PendingChannelResponse | null>(
"my-agent.pending-channel-response",
() => null,
);
❌ Bad
const pendingChannelResponse = defineState<PendingChannelResponse | null>(
"my-agent.pending-channel-response",
() => null,
);
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Add beta testers for Pixy on Android and iOS. Use when a user asks to test a new version.
中文简介正在准备中。当前显示原文说明。
Monitor a pull request until review comments and CI are handled. Use when the user asks to monitor, babysit, or watch a PR.
中文简介正在准备中。当前显示原文说明。
Competitor analysis for Pixy (or any mobile app) from public App Store and Google Play data, no API keys. Use when asked who competes with Pixy, how competitors price or position themselves, what users love or hate in rival apps, which keywords competitors win, or to refresh a competitor report.
中文简介正在准备中。当前显示原文说明。
Use whenever creating, opening, or updating a pull request ("create PR", "open PR", "make a PR", "gh pr create", "gh pr edit"), or when writing or rewriting a PR title or body. Load before running any PR command.
中文简介正在准备中。当前显示原文说明。
Upload screenshots or videos to a PR body. Required for every PR with a visual change. Use also when asked for screenshots, video, before/after, or visual proof.
中文简介正在准备中。当前显示原文说明。
Build, install, and run the app on a device. Use when asked to run the app, run it with Metro for hot reload, install a build on a phone, simulator, or emulator, or time a native build.
中文简介正在准备中。当前显示原文说明。