agents-squad list_skills ignores the standard ~/.agents/skills layout and only sees the 7 bundled skills

Đang mở
#242 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

Start in index.ts at BUNDLED_SKILLS_DIR, GLOBAL_SKILLS_DIR, and readMarkdownDir, then compare this discovery logic with the standard paths resolved by @cline/core. Exercise list_skills with both flat Markdown files and nested SKILL.md directories, including invalid frontmatter. Done means standard global and project roots are discovered, existing precedence and deduplication still work, parse failures are surfaced, and the rules are documented in plugins/agents-squad/README.md.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

list_skills (and run_skill) can only see skills that live as flat <dir>/<name>.md inside three plugin-private roots. Skills installed in the standard agents layout — ~/.agents/skills/<name>/SKILL.md, which cline skill writes and which @cline/core already resolves — are invisible.

In a Cline Desktop session the tool returned exactly the 7 bundled skills while 35 user skills were installed, so the agent reports that skills it is otherwise offered "do not exist".

Environment
  • Cline Desktop 0.0.51, CLI 3.0.76, @cline/core 0.2.2, Bun 1.4.2, Windows 11 10.0.26300
  • agents-squad installed via cline plugin install agents-squad → ~/.cline/plugins/_installed/official/agents-squad-1ae2facb94f9, plugin itself loads fine
  • ~/.agents/skills: 35 skills, 22 of them ship extra files (scripts/, references/); 43.5 MB / 411 files
What the tool reports
list_skills → 7 entries, all source: "bundled"
api-design, code-review, debugging, documentation, migration, refactoring, test-generation

~/.agents/skills/squad-token-saver, duckduckgo-web-search, archive-7z, … are all absent.

Minimal reproduction
# 1. any standard skill
mkdir ~/.agents/skills/foo
#    write ~/.agents/skills/foo/SKILL.md with `name`/`description` frontmatter + body

# 2. call list_skills  -> `foo` is NOT listed

# 3. move it to the plugin-private flat layout
mkdir ~/.cline/data/settings/skills
copy ~/.agents/skills/foo/SKILL.md ~/.cline/data/settings/skills/foo.md

# 4. call list_skills again -> `foo` IS listed (source: "global")
Root cause (index.ts on main)
// :41
const BUNDLED_SKILLS_DIR = join(MODULE_DIR, "skills");

// :86
const GLOBAL_SKILLS_DIR = join(resolveClineDataDirPath(), "settings", "skills");

// :253-258
const dirs = [
  { path: BUNDLED_SKILLS_DIR, source: "bundled" },
  { path: GLOBAL_SKILLS_DIR,  source: "global" },
  { path: join(baseCwd, ".cline", "skills"), source: "project" },
];

Two problems:

  1. Wrong roots. ~/.agents/skills (global) and <baseCwd>/.agents/skills (project) are missing — those are the paths the host uses.
  2. Wrong shape. readMarkdownDir (:199) only accepts top-level entries where entry.isFile() && entry.name.endsWith(".md") (:215-216), so a directory-shaped skill (<name>/SKILL.md) is skipped even if a root were added.

Meanwhile @cline/core 0.2.2 already resolves the standard layout:

// core dist
function rg(n){ return [
  join(dataRoot, "skills", n, "SKILL.md"),
  join(homeDir,  ".agents", "skills", n, "SKILL.md"),
].filter(dedupe) }

and the CLI's own cline skill installs globally into ~/.agents/skills (its error text is literally
Cannot install skill globally because ~/.agents/skills is not writable).

Result: the host mounts/offers one inventory, while the agent-facing tool reports a different, much smaller one.

Secondary bug: invalid frontmatter makes a skill vanish silently

readMarkdownDir wraps each parse in try { … } catch {} (:217-224). One of my skills had

compatibility: Cline SDK (@cline/sdk); plugins: agents-squad, goal; 兼容 r9k-subagent-routing。

which throws YAMLParseError: Nested mappings are not allowed in compact mappings at line 3, column 16.
The skill is then silently dropped — no entry, no warning, no way to tell a typo from a missing file.
(Quoting the value fixes it; the field itself is allowed — core's allowlist is
name, description, license, compatibility, metadata, allowed-tools.)

Suggested fixes
  1. Read the standard layout: for each root accept both <name>.md and <name>/SKILL.md (the latter by descending one level for SKILL.md).
  2. Add the standard roots: ~/.agents/skills and <baseCwd>/.agents/skills, honouring CLINE_DIR / CLINE_DATA_DIR the same way the rest of the file does. Keep today's precedence (bundled → global → project, last wins by name) so overrides still work; dedupe by name as now.
  3. Surface failures: collect parse/validation errors and return them (warnings / failures array in the tool result) instead of catch {}.
  4. Document the discovery rules in plugins/agents-squad/README.md: which directories are read, which shape, which frontmatter fields are allowed.
Workaround (verified)

Materialise the standard tree into a root the plugin does read: for every ~/.agents/skills/<name>/SKILL.md
write <CLINE_DATA_DIR>/settings/skills/<name>.md, and mirror the whole skill directory to
<CLINE_DATA_DIR>/settings/skills/<name>/ so relative asset paths (./scripts/…) keep resolving
(readMarkdownDir only looks at top-level .md files, so the mirrored directory is inert for listing).
With that, list_skills returned the bundled 7 plus the 35 user skills.
Happy to paste the ~40-line PowerShell sync script if it is useful for the README.

Why this matters

Skills are the main "how the agent should do X" surface. When the inventory mounted by the host and the inventory reported by this tool disagree, the model is actively misled: it will tell the user a skill does not exist, or fall back to generic behaviour, even though the skill is right there in ~/.agents/skills.

Ngôn ngữ chính
TypeScript
Star
38
Fork
18
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cline/plugins

Tất cả issue của cline/plugins

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.