-
Notifications
You must be signed in to change notification settings - Fork 68
feat: add OpenClaw agent adapter (Clawdbot rebrand) #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { existsSync } from 'node:fs'; | ||
| import { join } from 'node:path'; | ||
| import { homedir } from 'node:os'; | ||
| import { ClawdbotAdapter } from './clawdbot.js'; | ||
| import type { AgentType } from '@skillkit/core'; | ||
| import { AGENT_CONFIG } from '@skillkit/core'; | ||
|
|
||
| const config = AGENT_CONFIG.openclaw; | ||
|
|
||
| export class OpenClawAdapter extends ClawdbotAdapter { | ||
| override readonly type: AgentType = 'openclaw'; | ||
| override readonly name = 'OpenClaw'; | ||
| override readonly skillsDir = config.skillsDir; | ||
| override readonly configFile = config.configFile; | ||
|
|
||
| override async isDetected(): Promise<boolean> { | ||
| const globalOpenClaw = join(homedir(), '.openclaw'); | ||
| const openclawConfig = join(process.cwd(), 'openclaw.json'); | ||
|
|
||
| return existsSync(globalOpenClaw) || existsSync(openclawConfig); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ export const AgentType = z.enum([ | |
| "gemini-cli", | ||
| "amp", | ||
| "clawdbot", | ||
| "openclaw", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 New Adding Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| "droid", | ||
| "github-copilot", | ||
| "goose", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: rohitg00/skillkit
Length of output: 5531
🏁 Script executed:
Repository: rohitg00/skillkit
Length of output: 1527
🏁 Script executed:
Repository: rohitg00/skillkit
Length of output: 4291
🏁 Script executed:
Repository: rohitg00/skillkit
Length of output: 43
Tilde paths in
altSkillsDirswill not expand correctly and should be removed or handled separately.The
clawdbotandopenclawconfigurations include tilde paths ('~/.clawdbot/skills'and'~/.openclaw/skills') inaltSkillsDirs. However, indetectInstalledAgents()(line 219 ofpackages/core/src/primer/generator.ts), these paths are joined directly withprojectPathusingjoin(this.projectPath, altDir), which treats the tilde as a literal directory name. This produces invalid paths like/project/path/~/.clawdbot/skillsinstead of expanding to the home directory.Remove the tilde paths from
altSkillsDirsand rely onglobalSkillsDir(which is already defined for both agents) for home directory discovery, or ensure tilde expansion is applied before thejoin()call.🤖 Prompt for AI Agents