create-adapter by designnotdrum/brain-jar
npx skills add https://github.com/designnotdrum/brain-jar --skill create-adapter指导用户为 pattern-radar 创建自定义源适配器。
询问用户想要添加什么源
分析源
生成适配器
plugins/pattern-radar/src/adapters/types.ts 中的 SourceAdapter 接口测试适配器
保存到用户配置
~/.config/pattern-radar/adapters/<name>.ts广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
import { SourceAdapter, SourceInstance, InstanceConfig, FetchOptions, HealthStatus, ConfigValidation } from './types.js';
import { Signal } from '../types.js';
interface MyInstanceConfig extends InstanceConfig {
// 在此处添加配置字段
}
class MySourceInstance implements SourceInstance {
id: string;
adapter = 'my-source';
topic: string;
config: MyInstanceConfig;
constructor(topic: string, config: MyInstanceConfig) {
this.topic = topic;
this.config = config;
this.id = `my-source:${topic}`;
}
async fetch(options?: FetchOptions): Promise<Signal[]> {
// 实现获取逻辑
return [];
}
async healthCheck(): Promise<HealthStatus> {
return { healthy: true, lastChecked: new Date() };
}
}
export const mySourceAdapter: SourceAdapter = {
type: 'my-source',
name: 'My Source',
capabilities: ['search'],
requiresAuth: false,
freeTierAvailable: true,
createInstance(topic: string, config: InstanceConfig): SourceInstance {
return new MySourceInstance(topic, config as MyInstanceConfig);
},
validateConfig(config: InstanceConfig): ConfigValidation {
return { valid: true };
}
};
User: /create-adapter
Claude: 您想向 pattern-radar 添加什么源?
User: 有一个韩国棒球统计网站 statiz.co.kr
Claude: 让我查看一下...
[获取网站,分析结构]
我发现 statiz.co.kr 有一个新闻版块,具有类似 RSS 的结构。
我应该创建一个为其新闻源配置的 RSS 适配器吗?
User: 是的
Claude: [生成适配器]
适配器已创建于 ~/.config/pattern-radar/adapters/statiz-kbo.ts
正在测试... 成功获取了 12 篇文章!
适配器已准备就绪。当您添加 "Korean baseball" 作为主题时,将使用它。
每周安装次数
1
仓库
GitHub 星标数
2
首次出现
今天
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
Guide the user through creating a custom source adapter for pattern-radar.
Ask what source they want to add
Analyze the source
Generate the adapter
plugins/pattern-radar/src/adapters/types.tsTest the adapter
Save to user config
~/.config/pattern-radar/adapters/<name>.tsimport { SourceAdapter, SourceInstance, InstanceConfig, FetchOptions, HealthStatus, ConfigValidation } from './types.js';
import { Signal } from '../types.js';
interface MyInstanceConfig extends InstanceConfig {
// Add config fields here
}
class MySourceInstance implements SourceInstance {
id: string;
adapter = 'my-source';
topic: string;
config: MyInstanceConfig;
constructor(topic: string, config: MyInstanceConfig) {
this.topic = topic;
this.config = config;
this.id = `my-source:${topic}`;
}
async fetch(options?: FetchOptions): Promise<Signal[]> {
// Implement fetching
return [];
}
async healthCheck(): Promise<HealthStatus> {
return { healthy: true, lastChecked: new Date() };
}
}
export const mySourceAdapter: SourceAdapter = {
type: 'my-source',
name: 'My Source',
capabilities: ['search'],
requiresAuth: false,
freeTierAvailable: true,
createInstance(topic: string, config: InstanceConfig): SourceInstance {
return new MySourceInstance(topic, config as MyInstanceConfig);
},
validateConfig(config: InstanceConfig): ConfigValidation {
return { valid: true };
}
};
User: /create-adapter
Claude: What source do you want to add to pattern-radar?
User: There's a Korean baseball stats site at statiz.co.kr
Claude: Let me check that out...
[fetches site, analyzes structure]
I found statiz.co.kr has a news section with an RSS-like structure.
Should I create an RSS adapter configured for their news feed?
User: Yes
Claude: [generates adapter]
Created adapter at ~/.config/pattern-radar/adapters/statiz-kbo.ts
Testing... fetched 12 articles successfully!
The adapter is ready. It will be used when you add "Korean baseball" as a topic.
Weekly Installs
1
Repository
GitHub Stars
2
First Seen
Today
Security Audits
Gen Agent Trust HubWarnSocketPassSnykWarn
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装