Implementation:2aronS Duel Agents Skill Asset Copying
| Knowledge Sources | |
|---|---|
| Domains | Developer_Tools, Configuration |
| Last Updated | 2026-10-27 14:00 GMT |
Overview
Concrete tool for resolving integration asset paths and copying skill trees to the correct destination directories for Cursor and OpenClaw, provided by @duel-agents/install.
Description
The Skill Asset Copying group handles the file-asset side of install: locating the packaged integration skill directories and copying them to the tool-specific destination. It comprises three functions:
resolveIntegrationPath— resolves a path underintegrations/by trying three candidate locations: the published npm layout, the monorepo dev layout, and thetsxsource layout. Throws if none exist.copyCursorSkill— copies the Cursor Duel skill to<cwd>/.cursor/skills/duel-agents(project-local)copyOpenClawSkill— copies the OpenClaw Duel skill to~/.openclaw/workspace/skills/duel-agents(user-global)
Both copy functions use fs.cp with recursive: true and force: true, creating parent directories as needed.
Usage
Import these functions when you need to:
- Copy the Duel skill for Cursor or OpenClaw during install
- Resolve the path to a packaged integration asset
- Build a custom install flow that copies skill assets
Code Reference
Source Location
- Repository: Duel-Agents
- File:
packages/cli/src/install.ts(lines 24-43, 136-156)
Signature
/** Resolve a path under integrations/ by trying npm, monorepo, and tsx layouts. */
export function resolveIntegrationPath(...parts: string[]): string;
/** Copy Cursor skill to <cwd>/.cursor/skills/duel-agents. */
async function copyCursorSkill(cwd: string): Promise<void>;
/** Copy OpenClaw skill to ~/.openclaw/workspace/skills/duel-agents. */
async function copyOpenClawSkill(): Promise<void>;
Import
import { resolveIntegrationPath } from "@duel-agents/install";
// copyCursorSkill and copyOpenClawSkill are internal (not exported)
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| parts | string[] |
Yes | Path segments under integrations/
|
| cwd (copyCursorSkill) | string |
Yes | Working dir for Cursor skill destination |
Outputs
| Name | Type | Description |
|---|---|---|
resolveIntegrationPath returns |
string |
Absolute path to the asset; throws if not found |
| side effect | filesystem | Copied skill tree at destination |
Usage Examples
Resolve an Integration Path
import { resolveIntegrationPath } from "@duel-agents/install";
// Finds integrations/openclaw/skills/duel-agents via npm, monorepo, or tsx layout
const skillPath = resolveIntegrationPath("openclaw", "skills", "duel-agents");
console.log(`Skill at: ${skillPath}`);
Copy Cursor Skill (Internal Flow)
import { cp, mkdir } from "node:fs/promises";
import { join, dirname } from "node:path";
// The internal implementation mirrors this:
const src = resolveIntegrationPath("cursor", "skills", "duel-agents");
const dest = join(process.cwd(), ".cursor", "skills", "duel-agents");
await mkdir(dirname(dest), { recursive: true });
await cp(src, dest, { recursive: true, force: true });