用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill groq-inference-skill命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
LLM token logprobs and calibration. Per-decision confidence, ECE, Brier, reliability diagrams, low-confidence triage.
Analyze LLM token logprobs and calibration. Use for per-decision confidence, ECE, Brier scores, reliability diagrams, and low-confidence triage.
回顾最近 N 天的 Claude Code 使用记录——扫描原始会话数据,按主题分组汇总"我都做了什么",并从个人操作系统视角输出模式、风险与增删建议。当用户说 /recap、"看看我这几天做了什么"、"回顾一下我最近的会话"、"这两天我用 claude 干了啥"、"活动回顾" 时使用。
基于 SOC 职业分类
正在显示 SKILL.md
| name | groq-inference-skill |
| description | Use Groq for fast LLM inference with OpenAI-compatible client |
| when-to-use | AI agent logic, natural language processing |
This skill provides guidance for using Groq's fast LLM inference with an OpenAI-compatible client for AI agent logic and natural language processing.
src/lib/
├── groq.ts # Groq client configuration
├── agents/
│ ├── task-agent.ts # Task management agent
│ ├── planner-agent.ts # Task planning agent
│ └── base-agent.ts # Base agent class
└── prompts/
├── system-prompts.ts # System prompt templates
└── few-shot-examples.ts # Example conversations
// src/lib/groq.ts
import OpenAI from 'openai'
// Groq uses OpenAI-compatible API
export const groqClient = new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: 'https://api.groq.com/openai/v1',
})
// Available Groq models (fast inference)
export const GROQ_MODELS = {
LLAMA3_8B: 'llama3-8b-8192',
LLAMA3_70B: 'llama3-70b-8192',
MIXTRAL: 'mixtral-8x7b-32768',
GEMMA: 'gemma-7b-it',
} as const
export type GroqModel = (typeof GROQ_MODELS)[keyof typeof GROQ_MODELS]
export interface GroqCompletionOptions {
model?: GroqModel
temperature?: number
max_tokens?: number
top_p?: number
stream?: boolean
stop?: string[]
}
// src/lib/groq.ts (continued)
export async function createGroqCompletion(
messages: { role: 'system' | 'user' | 'assistant'; content: string }[],
options: GroqCompletionOptions = {}
) {
const response = await groqClient.chat.completions.create({
model: options.model || GROQ_MODELS.LLAMA3_70B,
messages,
temperature: options.temperature ?? 0.6,
max_tokens: options.max_tokens ?? 1024,
top_p: options.top_p ?? 0.9,
stream: options.stream ?? false,
stop: options.stop,
})
return response
}
export async function createGroqCompletionSimple(
prompt: string,
systemPrompt?: string
) {
const messages: { role: 'system' | 'user'; content: }[] = []
(systemPrompt) {
messages.({ : , : systemPrompt })
}
messages.({ : , : prompt })
response = (messages)
response.[]?.?. ||
}
// src/lib/agents/task-agent.ts
import { createGroqCompletion } from '../groq'
import { GROQ_MODELS } from '../groq'
import type { Task } from '@/types'
// System prompt for task agent
const TASK_AGENT_SYSTEM_PROMPT = `You are a helpful task management assistant.
Your role is to:
1. Parse natural language requests about tasks
2. Extract task details (title, description, due date, priority)
3. Generate appropriate tool calls for task operations
4. Provide helpful summaries and suggestions
When the user asks to create a task, extract and format:
- title: Clear, concise task title
- description: Detailed description if provided
- due_date: ISO date format if specified
- priority: 'low', 'medium', or 'high' if mentioned
Always respond in a helpful, concise manner.`
export interface ParsedTaskIntent {
action: 'create' | 'update' | 'delete' | 'list' | 'complete' | 'query'
task?: Partial<Task>
task_id?: number
natural_response: string
}
export async function parseTaskIntent(userInput: string): Promise<ParsedTaskIntent> {
const prompt =
response = (
[
{ : , : },
{ : , : prompt },
],
{
: .,
: ,
: ,
}
)
{
parsed = .(response.[]?.?. || )
{
: parsed. || ,
: parsed.,
: parsed.,
: parsed. || ,
}
} {
{
: ,
: ,
}
}
}
(): <[]> {
prompt =
response = (
[
{
: ,
: ,
},
{ : , : prompt },
],
{
: .,
: ,
: ,
}
)
{
.(response.[]?.?. || )
} {
[]
}
}
// src/lib/agents/planner-agent.ts
import { createGroqCompletion } from '../groq'
import { GROQ_MODELS } from '../groq'
export interface TaskBreakdown {
steps: {
title: string
description: string
priority: 'must' | 'should' | 'could'
estimated_time?: string
}[]
total_estimate: string
recommendations: string[]
}
export async function breakdownTask(userInput: string): Promise<TaskBreakdown> {
const prompt = `Break down this task/project into actionable steps:
"${userInput}"
Provide a detailed breakdown with:
1. Sequential steps with descriptions
2. Priority levels (must/should/could)
3. Time estimates
4. Recommendations
Respond with JSON:
{
"steps": [
{ "title": "...", "description": "...", "priority": "must|should|could", "estimated_time": "..." }
],
"total_estimate": "...",
"recommendations": ["...", "..."]
}`
const response = await createGroqCompletion(
[
{
role: 'system',
content: 'You are a project planning assistant. Break down complex tasks into clear, actionable steps.',
},
{ : , : prompt },
],
{
: .,
: ,
: ,
}
)
{
.(response.[]?.?. || )
} {
{
: [],
: ,
: [],
}
}
}
(): <[]> {
prompt =
response = (
[
{
: ,
: ,
},
{ : , : prompt },
],
{
: .,
: ,
: ,
}
)
{
prioritized = .(response.[]?.?. || )
tasks.( t.).( prioritized.(id))
} {
tasks.( t.)
}
}
// src/lib/groq.ts (continued)
export async function* streamGroqCompletion(
messages: { role: 'system' | 'user' | 'assistant'; content: string }[],
options: GroqCompletionOptions = {}
): AsyncGenerator<string> {
const stream = await groqClient.chat.completions.create({
model: options.model || GROQ_MODELS.LLAMA3_70B,
messages,
temperature: options.temperature ?? 0.6,
max_tokens: options.max_tokens ?? 2048,
stream: true,
})
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content
if (content) {
yield content
}
}
}
// Usage
export async function streamTaskAdvice(): Promise<string> {
fullResponse =
stream = ([
{
: ,
: ,
},
{
: ,
: ,
},
])
( chunk stream) {
fullResponse += chunk
}
fullResponse
}
// src/lib/agents/task-parser.ts
export async function parseNaturalLanguageTask(input: string) {
const prompt = `Extract task information from this user input:
"${input}"
If this is a task creation request, extract:
- title: Main task title (required)
- description: Additional details (optional)
- due_date: When it should be completed (optional, ISO format)
- priority: urgency level (optional, low/medium/high)
If this is NOT a task creation request, return null for task fields.
Respond in JSON format.`
const response = await createGroqCompletion(
[
{
role: 'system',
content: 'You are a task parsing assistant. Extract structured data from natural language.',
},
{ role: 'user', content: prompt },
],
{ temperature: 0.2 }
)
return JSON.parse(response.choices[0]?.message?.content || '{}')
}
// Example usage:
// parseNaturalLanguageTask("Remind me to call mom on Friday at 5pm")
// Returns: { title: "Call mom", description: "", due_date: "2024-01-05T17:00:00Z", priority: "medium" }
// src/lib/agents/task-search.ts
export async function searchTasksSmart(query: string, tasks: Task[]): Promise<Task[]> {
const taskList = tasks.map(t =>
`ID:${t.id} Title:${t.title} Desc:${t.description || 'none'} Status:${t.completed ? 'done' : 'pending'}`
).join('\n')
const prompt = `Search for tasks matching this query: "${query}"
Available tasks:
${taskList}
Return the IDs of matching tasks as a JSON array. Consider:
- Keywords in title and description
- Task completion status
- Partial matches
- Related concepts`
const response = await createGroqCompletion(
[
{
role: 'system',
content: 'You are a task search assistant. Find relevant matches based on semantic understanding.',
},
{ role: 'user', content: prompt },
],
{ temperature: 0.3, max_tokens: 256 }
)
try {
const ids: number[] = JSON.(response.[]?.?. || )
tasks.( ids.(t.))
} {
lowerQuery = query.()
tasks.(
t..().(lowerQuery) ||
t.?.().(lowerQuery)
)
}
}
// Process multiple tasks in parallel
async function analyzeTaskBatch(tasks: Task[]) {
const batchPrompt = tasks.map((t, i) =>
`${i + 1}. "${t.title}" - ${t.description || 'no description'}`
).join('\n')
const prompt = `Analyze these ${tasks.length} tasks and provide:
1. Estimated effort (1-10) for each
2. Potential blockers
3. Suggested order
Tasks:
${batchPrompt}
Respond with JSON array of analysis results.`
const response = await createGroqCompletion(
[
{
role: 'system',
content: 'You are a project analyst. Assess tasks objectively.',
},
{ role: 'user', content: prompt },
],
{
model: GROQ_MODELS.LLAMA3_70B,
temperature: 0.5,
max_tokens: tasks.length * 200,
}
)
return JSON.parse(response.choices[0]?.message?.content || '[]')
}