agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites,…
Guidelines for implementing LLM (Language Model) functionality in the application
$ npx -y skills add elie222/inbox-zero --skill llm --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/llmContext preview
The summary Claude sees to decide when to auto-load this skill.
Guidelines for implementing LLM (Language Model) functionality in the application
name: llm description: Guidelines for implementing LLM (Language Model) functionality in the application
LLM-related code is organized in specific directories:
For product features with a static model choice, use `getModelForUseCase(emailAccount.user, LlmUseCase.FeatureName)` from `utils/llms/use-cases.ts`. Keep direct `getModel(user, modelType)` calls for generic helpers where the model role is intentionally passed from upstream. When adding or changing a use case, update `utils/llms/use-cases.test.ts`.
Follow this standard structure for LLM-related functions:
import { z } from "zod";
import { createScopedLogger } from "@/utils/logger";
import { chatCompletionObject } from "@/utils/llms";
import type { EmailAccountWithAI } from "@/utils/llms/types";
import { createGenerateObject } from "@/utils/llms";
import { getModelForUseCase, LlmUseCase } from "@/utils/llms/use-cases";
export async function featureFunction(options: {
inputData: InputType;
emailAccount: EmailAccountWithAI;
}) {
const { inputData, user } = options;
if (!inputData || [other validation conditions]) {
logger.warn("Invalid input for feature function");
return null;
}
const system = `[Detailed system prompt that defines the LLM's role and task]`;
const prompt = `[User prompt with context and specific instructions]
<data>
...
</data>
${emailAccount.about ? `<user_info>${emailAccount.about}</user_info>` : ""}`;
const modelOptions = getModelForUseCase(
emailAccount.user,
LlmUseCase.FeatureName,
);
const generateObject = createGenerateObject({
userEmail: emailAccount.email,
label: "Feature Name",
modelOptions,
});
const result = await generateObject({
...modelOptions,
system,
prompt,
schema: z.object({
field1: z.string(),
field2: z.number(),
nested: z.object({
subfield: z.string(),
}),
array_field: z.array(z.string()),
}),
});
return result.object;
}1. **System and User Prompts**:
2. **Schema Validation**:
3. **Logging**:
4. **Error Handling**:
5. **Input Formatting**:
6. **Type Safety**:
7. **Code Organization**:
8. **AI-First Behavior**:
9. **Draft Attribution Versioning**:
See [llm-test.mdc](mdc:.cursor/rules/llm-test.mdc)
The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Repo: elie222/inbox-zero
Browser automation CLI for AI agents. Use when the user needs to interact with websites,…
Cursor Cloud VM setup and service startup instructions for local development
Simplify and refine recently modified code for clarity, consistency, and maintainability…
Review the working tree, commit it safely, and open a GitHub pull request. Use when the user…