supabase
Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...
iterative-retrieval
为了解决子智能体(Sub-agent)的上下文问题,逐步优化上下文获取的模式
Full skill instructions
解决多智能体工作流(Multi-agent Workflow)中的“上下文问题”。子智能体在开始工作之前,通常不知道需要哪些上下文。
子智能体(Sub-agent)在启动时上下文有限。它们通常不知道:
标准方法往往会失败:
分为 4 个阶段的循环,逐步优化上下文:
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISPATCH │─────▶│ EVALUATE │ │
│ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ LOOP │◀─────│ REFINE │ │
│ └──────────┘ └──────────┘ │
│ │
│ 最大 3 个循环,之后继续执行 │
└─────────────────────────────────────────────┘
收集候选文件的初始宽泛查询:
// 从高层意图开始
const initialQuery = {
patterns: ['src/**/*.ts', 'lib/**/*.ts'],
keywords: ['authentication', 'user', 'session'],
excludes: ['*.test.ts', '*.spec.ts']
};
// 派发给检索智能体
const candidates = await retrieveFiles(initialQuery);
评估获取内容的关联性(Relevance):
function evaluateRelevance(files, task) {
return files.map(file => ({
path: file.path,
relevance: scoreRelevance(file.content, task),
reason: explainRelevance(file.content, task),
missingContext: identifyGaps(file.content, task)
}));
}
评分标准:
根据评估更新检索标准:
function refineQuery(evaluation, previousQuery) {
return {
// 添加在高关联性文件中发现的新模式
patterns: [...previousQuery.patterns, ...extractPatterns(evaluation)],
// 添加在代码库中发现的术语
keywords: [...previousQuery.keywords, ...extractKeywords(evaluation)],
// 排除已确认的无关路径
excludes: [...previousQuery.excludes, ...evaluation
.filter(e => e.relevance < 0.2)
.map(e => e.path)
],
// 针对特定的缺口 (Gaps)
focusAreas: evaluation
.flatMap(e => e.missingContext)
.filter(unique)
};
}
使用优化后的标准重复执行(最多 3 个循环):
async function iterativeRetrieve(task, maxCycles = 3) {
let query = createInitialQuery(task);
let bestContext = [];
for (let cycle = 0; cycle < maxCycles; cycle++) {
const candidates = await retrieveFiles(query);
const evaluation = evaluateRelevance(candidates, task);
// 检查是否有足够的上下文
const highRelevance = evaluation.filter(e => e.relevance >= 0.7);
if (highRelevance.length >= 3 && !hasCriticalGaps(evaluation)) {
return highRelevance;
}
// 优化并继续
query = refineQuery(evaluation, query);
bestContext = mergeContext(bestContext, highRelevance);
}
return bestContext;
}
任务:"修复认证令牌过期 Bug"
循环 1:
DISPATCH: 在 src/** 中搜索 "token"、"auth"、"expiry"
EVALUATE: 发现 auth.ts(0.9)、tokens.ts(0.8)、user.ts(0.3)
REFINE: 添加 "refresh"、"jwt" 关键词;排除 user.ts
循环 2:
DISPATCH: 使用优化后的术语搜索
EVALUATE: 发现 session-manager.ts(0.95)、jwt-utils.ts(0.85)
REFINE: 已获得足够上下文(2 个极高关联性文件)
结果: auth.ts, tokens.ts, session-manager.ts, jwt-utils.ts
任务:"在 API 端点添加速率限制"
循环 1:
DISPATCH: 在 routes/** 中搜索 "rate"、"limit"、"api"
EVALUATE: 未匹配 - 代码库使用的是 "throttle" 术语
REFINE: 添加 "throttle"、"middleware" 关键词
循环 2:
DISPATCH: 使用优化后的术语搜索
EVALUATE: 发现 throttle.ts(0.9)、middleware/index.ts(0.7)
REFINE: 需要路由器模式(Router Pattern)
循环 3:
DISPATCH: 搜索 "router"、"express" 模式
EVALUATE: 发现 router-setup.ts(0.8)
REFINE: 已获得足够上下文
结果: throttle.ts, middleware/index.ts, router-setup.ts
在智能体提示词(Prompt)中使用:
在获取此任务的上下文时:
1. 从宽泛的关键词搜索开始
2. 评估每个文件的关联性(0-1 刻度)
3. 识别仍缺失的上下文
4. 优化检索标准并重复(最多 3 个循环)
5. 返回关联性在 0.7 以上的文件
continuous-learning 技能 - 用于随时间改进的模式~/.claude/agents/ 中的智能体定义Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...
Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.
A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.
Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.
Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
Send, read, and manage Gmail messages, drafts, labels, and account settings.
Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.
Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.
Discover your celebrity doppelgänger with StarByFace!
GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams
Detect AI-generated voices to protect against audio fraud.
Ensure Your Content's Originality with AI Plagiarism Checker
Upscale images by 400% without quality loss
Protect your social media from copyright disputes
Accurately Detect AI-Generated Content with TheChecker.AI
Chrome extension that detects and flags AI-generated content