AGENT SKILL

add-lib

Use when code is about to go into root lib/ or lib/fixtures/: a helper two plugins both wrote, a test fixture several tests copy, a new export of the shared kit. Triggers: add to lib, shared helper, two plugins need the same function, move this to lib, new fixture for tests, add a lib module, pridej do lib, sdileny helper, vytahni to do lib. Decides whether the code is shared at all and how it lands; a whole new capability is add-plugin, a CLI verb is add-tool, a hook is add-hook.

License 许可
GPL-3.0
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
add-lib
description
Use when code is about to go into root lib/ or lib/fixtures/: a helper two plugins both wrote, a test fixture several tests copy, a new export of the shared kit. Triggers: add to lib, shared helper, two plugins need the same function, move this to lib, new fixture for tests, add a lib module, pridej do lib, sdileny helper, vytahni to do lib. Decides whether the code is shared at all and how it lands; a whole new capability is add-plugin, a CLI verb is add-tool, a hook is add-hook.

03 SKILL.md 正文

Add Lib

Root lib/ is the layer-0 kit every plugin builds on, so each export is a cost all plugins pay. Code reaches lib/ only to delete copies that already exist; code with one consumer stays in its plugin. This skill writes no plugin features and never parks code in lib/ for later.

Steps

  1. Grep lib/ and lib/fixtures/ for the thing. A close export is changed slightly to serve both uses, not duplicated.
  2. Count the copies in plugins/. Two or more: it goes to lib/. One: stop.
  3. Put it in the module whose job it is (fs.ts, paths.ts, outcome.ts), or a new module named for its job. Test-only code goes in lib/fixtures/.
  4. Write the export and lib/<module>.test.ts beside it, running it for real in a sandboxDir.
  5. Replace every plugin copy with an import and delete the copy in the same change.
  6. If a plugin could copy the export, add its name to HELPERS in .gates/validate-no-private-helpers.ts and to the lib/ line of the Layout block in AGENTS.md.

Hard rules

  1. A new export lands in the change that deletes at least two plugin copies, because a helper with one consumer is a guess. Gate: review.
  2. A plugin never defines a HELPERS export (isRecord, messageOf, onPath, binPath, readStdin, claudeDir, writeAtomic), because a fix must change one place. Gate: validate-no-private-helpers.
  3. lib/ imports lib/ only, because layer 0 cannot depend on layer 1. Gate: validate-no-cross-plugin-import.
  4. lib/ imports no npm package, because each plugin pins its own. Gate: validate-npm-packages.
  5. lib/ never names a plugin, because the core works alone. Gate: review.
  6. lib/fixtures is imported by tests only, and a fixture makes its temp dirs with sandboxDir, because that is the one place that removes them. Gate: validate-test-temp. How a test uses the kit is add-tool.

Errors, environment reads and the hooks sandbox apply here as add-tool and add-hook say.

Done means

mise exec -- bun run validate
mise exec -- bun run lint
mise exec -- bun run typecheck
mise exec -- bun test ./ ./.gates
mise exec -- git diff --shortstat     # deletions exceed additions

Then hand the diff to the qsm-review strict-reviewer agent with the hard rules as the checklist. Done is every command passing and no blocker from the review.

Red flags

  • The change adds to lib/ and deletes nothing: the copies are still there.
  • A plugin says "it differs a little": change the shared export slightly, not a second one.

Say it in the reply

The export, the plugin copies it deleted (the shortstat), each command with pass or fail, and the reviewer's verdict.

04 同仓库更多 Skills

qsmark-labs
qsmark-labs/qsm-marketplace

worktrunk

Use when working with git worktrees or wt (worktrunk): creating, switching, merging or removing a branch workspace, configuring wt (project or personal config, workflow hooks around switch, commit and merge, commit-message generation, hook approvals), or a wt command that failed. Triggers: make a worktree for this branch, wt merge, wt remove, configure wt, .config/wt.toml, run tests before merge, install deps when a worktree is created, wt hook, wt switch does not cd, nastav wt, wt nefunguje.

★ 0
qsmark-labs
qsmark-labs/qsm-marketplace

web-ladder

Use when a task needs something the internet holds: look something up, search the web, find which page answers a question, read a page, check a library's current docs, a page that needs a browser or shows a captcha. Runs one research loop: searxng search, keywords, cases, search again up to three times, Context7 for a library, Tavily when the keywords will not come, one page in a browser, the person on a wall. Triggers: look this up, search the web, find out online, read this page, check the docs, the page is blocked, captcha, najdi na webu, otevri tu stranku. A multi-round question goes to the qsm-web:web-research agent; one tool's commands are its own skill (searxng, browserbox, opensrc).

★ 0
qsmark-labs
qsmark-labs/qsm-marketplace

searxng

Use when running a web search through the person's own SearXNG instance with qsm-web searxng: choosing a search profile or engines, the instance, time range or language, reading its JSON, a suspended engine. Triggers: search with searxng, qsm-web searxng, search profile, niche search, academic search, IT search, vyhledavaci profil, searxng is down, which engines. The research loop around it is the web-ladder skill.

★ 0
qsmark-labs
qsmark-labs/qsm-marketplace

opensrc

Use when the source code of an open-source library or repository is needed on disk to read: the docs are silent, the behaviour must be checked in code, the version the project pins. Runs qsm-web opensrc get with a package spec or a repository address. Triggers: get the source of this package, clone this library, read the library's code, qsm-web opensrc, stahni zdrojak knihovny. Library docs are the Context7 skill; the research loop is the web-ladder skill.

★ 0
qsmark-labs
qsmark-labs/qsm-marketplace

browserbox

Use when one page needs a real browser through qsm-web browserbox: content built by script, a page that blocks plain fetching, a captcha to solve or hand to the person, a scripted sequence of clicks, a login the person is present for. Triggers: open it in a browser, the page is empty without JavaScript, captcha, take over the browser, run these steps on the page, log in to this site, browserbox. When to reach for a browser at all is the web-ladder skill.

★ 0
qsmark-labs
qsmark-labs/qsm-marketplace

usage

Use when the user wants a review of how they use Claude Code, or setup hands over after a first install: review my Claude Code usage, audit my setup, what does my setup cost, where did my tokens go, clean up my Claude Code, usage report, zkontroluj moje pouzivani. One walkthrough of four stages (machine, work, habits, extensions), questions after each, then one plan. A question about one topic (which hooks are slow) goes to that topic's skill; this session's tokens alone is `/qsm-usage`.

★ 0