@vocdoni/skills 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,8 +69,8 @@
69
69
  {
70
70
  "name": "vocdoni-contributing",
71
71
  "source": "./plugins/vocdoni-contributing",
72
- "description": "Rules for what the agent posts on the git host: self-introduction, length and structure for PR/MR descriptions, issues and reviews, and posting reviews as reviews. A SessionStart hook applies them in every session, even as one step of a larger task.",
73
- "version": "0.2.0",
72
+ "description": "Rules for what the agent posts on the git host: self-introduction, issue tracking, stacked PRs for epics, length and structure for PR/MR descriptions, issues and reviews, posting reviews as reviews, and resolving the review threads it addresses. A SessionStart hook applies them in every session, even as one step of a larger task.",
73
+ "version": "0.4.0",
74
74
  "category": "engineering",
75
75
  "tags": ["vocdoni", "pull-request", "merge-request", "code-review", "issues", "commits", "git-host"],
76
76
  "license": "AGPL-3.0-or-later",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @vocdoni/skills
2
2
 
3
+ ## 0.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#69](https://github.com/vocdoni/skills/pull/69) [`fb3c5a7`](https://github.com/vocdoni/skills/commit/fb3c5a7a8bac06eda893b8d87c75d8d57210ec04) Thanks [@elboletaire](https://github.com/elboletaire)! - `vocdoni-contributing` 0.4.0: when the agent answers review comments on its own PR, it replies in each thread and resolves it through the API (GitHub GraphQL `resolveReviewThread`, GitLab discussions), whether it made the fix or explained why it won't.
8
+
9
+ - [#72](https://github.com/vocdoni/skills/pull/72) [`62f928e`](https://github.com/vocdoni/skills/commit/62f928ee5a67d43dd1e065bca6aff7ec50f01054) Thanks [@elboletaire](https://github.com/elboletaire)! - `bin/install.js` now exports its helpers for tests and only runs the CLI when executed directly, reads CRLF SKILL.md frontmatter, and no longer scans a plugin's subdirectories for skills when its root has no SKILL.md. New `node:test` suite (`npm test`) and PR CI cover the installer and the pi-subagent server.
10
+
11
+ - [#72](https://github.com/vocdoni/skills/pull/72) [`62f928e`](https://github.com/vocdoni/skills/commit/62f928ee5a67d43dd1e065bca6aff7ec50f01054) Thanks [@elboletaire](https://github.com/elboletaire)! - Bump transitive `hono` and `@hono/node-server` in pi-subagent's lockfile to patched versions.
12
+
13
+ ## 0.5.2
14
+
15
+ ### Patch Changes
16
+
17
+ - [#62](https://github.com/vocdoni/skills/pull/62) [`5fea614`](https://github.com/vocdoni/skills/commit/5fea614c1e92f84a987a1154481554b9a3bb6882) Thanks [@elboletaire](https://github.com/elboletaire)! - `vocdoni-contributing` 0.3.0: the `contributing` skill now covers epics that take several PRs. The agent stacks them, each PR targeting the one before it, and manages the stack with `gh stack`, so a fully reviewed stack is merged in one operation instead of squashing each PR and rebasing the rest.
18
+
3
19
  ## 0.5.1
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -110,7 +110,7 @@ The plugin also installs a **SessionStart hook** so the model loads the skill on
110
110
 
111
111
  | Skill | What it covers |
112
112
  | -------------- | -------------- |
113
- | `contributing` | The rules for everything the agent writes on GitHub or GitLab: an opening line naming the model and the user it acts for, no `Co-authored-by` trailer, every PR linked to an issue (found, or opened before the PR), length limits and structure for PR/MR descriptions and issues, findings of about three sentences in reviews (nits marked "Nit:"), and reviews posted as reviews marked "Approve" or "Request changes". |
113
+ | `contributing` | The rules for everything the agent writes on GitHub or GitLab: an opening line naming the model and the user it acts for, no `Co-authored-by` trailer, every PR linked to an issue (found, or opened before the PR), an epic's PRs stacked on each other with `gh stack` and merged in one go, length limits and structure for PR/MR descriptions and issues, findings of about three sentences in reviews (nits marked "Nit:"), review threads it addresses answered and resolved, and reviews posted as reviews marked "Approve" or "Request changes". |
114
114
 
115
115
  The plugin also installs a **SessionStart hook** that injects the same `contributing` body into every Claude Code session, so the rules hold even when a PR is one step of a larger task and the skill's description never matches. The hook reads `skills/contributing/SKILL.md` directly, so the skill is the only place to edit. The hook is Claude Code-only; an npx install gets the skill, which still triggers from its description.
116
116
 
package/bin/install.js CHANGED
@@ -110,9 +110,9 @@ function readSkillMeta(skillDir) {
110
110
  const meta = { name: '', description: '' };
111
111
  try {
112
112
  const src = fs.readFileSync(path.join(skillDir, 'SKILL.md'), 'utf8');
113
- const m = src.match(/^---\s*\n([\s\S]*?)\n---/);
113
+ const m = src.match(/^---\s*\r?\n([\s\S]*?)\r?\n---/);
114
114
  if (!m) return meta;
115
- for (const line of m[1].split('\n')) {
115
+ for (const line of m[1].split(/\r?\n/)) {
116
116
  const kv = line.match(/^(name|description):\s*(.*)$/);
117
117
  if (kv) meta[kv[1]] = kv[2].replace(/^['"]|['"]$/g, '');
118
118
  }
@@ -185,8 +185,11 @@ function skillsFromManifest(manifest, rootDir) {
185
185
  }
186
186
  } else {
187
187
  add(collectSkillsAtPath(path.join(rootDir, 'skills')));
188
- // Plugin with a single SKILL.md at its root and no skills/ directory.
189
- if (skills.length === 0) add(collectSkillsAtPath(rootDir, manifest.name));
188
+ // Plugin with a single SKILL.md at its root and no skills/ directory. Only
189
+ // the root file counts: scanning the root would also pick up subdirectories.
190
+ if (skills.length === 0 && fs.existsSync(path.join(rootDir, 'SKILL.md'))) {
191
+ add(collectSkillsAtPath(rootDir, manifest.name));
192
+ }
190
193
  }
191
194
 
192
195
  skills.sort((a, b) => a.name.localeCompare(b.name));
@@ -503,4 +506,18 @@ function main(argv) {
503
506
  }
504
507
  }
505
508
 
506
- process.exit(main(process.argv.slice(2)));
509
+ if (require.main === module) {
510
+ process.exit(main(process.argv.slice(2)));
511
+ }
512
+
513
+ module.exports = {
514
+ parseArgs,
515
+ readSkillMeta,
516
+ collectSkillsAtPath,
517
+ skillsFromManifest,
518
+ resolveRemoteSource,
519
+ isRemoteSource,
520
+ resolvePluginName,
521
+ discoverPlugins,
522
+ main,
523
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocdoni/skills",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Vocdoni's curated skills for AI coding assistants (Claude Code, Cursor, Cline, and other Anthropic-skill-compatible clients).",
5
5
  "bin": {
6
6
  "vocdoni-skills": "bin/install.js"
@@ -15,6 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "lint": "node bin/install.js list",
18
+ "test": "node --test test/*.test.js",
18
19
  "changeset": "changeset",
19
20
  "version-packages": "changeset version && npm install --package-lock-only",
20
21
  "release": "node .github/scripts/check-release.mjs && changeset publish"
@@ -465,9 +465,9 @@
465
465
  }
466
466
  },
467
467
  "node_modules/@hono/node-server": {
468
- "version": "2.1.5",
469
- "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.5.tgz",
470
- "integrity": "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q==",
468
+ "version": "2.1.11",
469
+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.11.tgz",
470
+ "integrity": "sha512-KzKz9vl4vvr1vgLHamj+g5uonbrj5NwAdO3yzOS6cd2HjALVeOgTgeZOyAzNxejbkfOOPIcvuf/Tg8l1pEFLog==",
471
471
  "license": "MIT",
472
472
  "engines": {
473
473
  "node": ">=20"
@@ -1982,9 +1982,9 @@
1982
1982
  }
1983
1983
  },
1984
1984
  "node_modules/hono": {
1985
- "version": "4.13.13",
1986
- "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.13.tgz",
1987
- "integrity": "sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA==",
1985
+ "version": "4.13.21",
1986
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.21.tgz",
1987
+ "integrity": "sha512-h9UsguqfVk4kjUwLvQpHOmOaJpW10jz9lp8bvKUUa04wJG/fabKFBqXZ06D6LFaeKQZtUZRVeg0gfkTTEsX7Mw==",
1988
1988
  "license": "MIT",
1989
1989
  "engines": {
1990
1990
  "node": ">=16.9.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vocdoni-contributing",
3
- "version": "0.2.0",
4
- "description": "Vocdoni's rules for what the agent writes on the git host: tying each change to an issue (found, or opened before the PR), who it introduces itself as, length and structure for PR/MR descriptions, issues, reviews and commits, and how to post a review as a review. A SessionStart hook injects the same rules into every Claude Code session, so they apply even when a PR is one step of a larger task.",
3
+ "version": "0.4.0",
4
+ "description": "Vocdoni's rules for what the agent writes on the git host: tying each change to an issue (found, or opened before the PR), stacking an epic's PRs with gh stack, who it introduces itself as, length and structure for PR/MR descriptions, issues, reviews and commits, how to post a review as a review, and how to reply to and resolve the review threads it addresses. A SessionStart hook injects the same rules into every Claude Code session, so they apply even when a PR is one step of a larger task.",
5
5
  "author": {
6
6
  "name": "Vocdoni",
7
7
  "url": "https://vocdoni.io"
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Injects the vocdoni-contributing rules (issue tracking, PR/MR descriptions, issues, reviews, commits) into every session by reading the skill body from SKILL.md",
2
+ "description": "Injects the vocdoni-contributing rules (issue tracking, stacked PRs for epics, PR/MR descriptions, issues, reviews, review threads, commits) into every session by reading the skill body from SKILL.md",
3
3
  "hooks": {
4
4
  "SessionStart": [
5
5
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: contributing
3
- description: Use whenever starting work on a change in a repository, or writing or posting a pull request or merge request description, an issue, a code review, a review comment or a commit message, on GitHub, GitLab or any other git host, through gh, glab or the web, including as one step of a larger task. Sets how to tie the work to an issue (find one, or open one before the PR), how to introduce yourself as the agent acting for the user, length limits and structure for PRs, issues and reviews, and how to post a review.
3
+ description: Use whenever starting work on a change in a repository, or writing or posting a pull request or merge request description, an issue, a code review, a review comment or a commit message, or answering review comments on a pull request, on GitHub, GitLab or any other git host, through gh, glab or the web, including as one step of a larger task, and when an epic issue needs several pull requests. Sets how to tie the work to an issue (find one, or open one before the PR), how to stack an epic's PRs on each other with gh stack instead of opening them all against the base branch, how to introduce yourself as the agent acting for the user, length limits and structure for PRs, issues and reviews, how to post a review, and how to reply to and resolve the review threads you address.
4
4
  ---
5
5
 
6
6
  # Contributing
@@ -23,6 +23,22 @@ Link the issue from the PR description: `Closes #N` when the PR finishes it, `Re
23
23
 
24
24
  Keep descriptions under ~15 lines of markdown, code blocks included: what changed and why, any non-obvious decisions, how it was tested, and **one** usage example if the change has a user-facing surface. Skip anything the diff or README already says.
25
25
 
26
+ ## Epics: stack the PRs
27
+
28
+ When an issue is an epic that takes several PRs, stack them: the first PR targets the base branch (`main`, `develop`) and each later one targets the branch of the PR before it. Don't open them all against the base branch: each then repeats or conflicts with the others' changes, reviewers can't see what is new in each, and every merge forces a rebase of the rest. Keep each PR to one reviewable step, and link the epic from each with `Refs #N`.
29
+
30
+ On GitHub, manage the stack with the `gh stack` extension (`gh extension install github/gh-stack`) rather than chaining bases by hand:
31
+
32
+ ```sh
33
+ gh stack init --base develop epic-1-api # first branch, on the base branch
34
+ gh stack add epic-2-ui # each next branch, on top of the last
35
+ gh stack submit # push all, open or retarget the PRs, link them as a stack
36
+ gh stack rebase # after fixing a lower PR, cascade the change up
37
+ gh stack merge --squash # once the whole stack is approved
38
+ ```
39
+
40
+ `gh stack merge` merges every PR up to the one you pick into the base branch in one all-or-nothing operation, so you never squash one PR and then rebase and retarget each one above it. Merge only once every PR being merged is reviewed. To turn branches already open against the base branch into a stack, `gh stack init --base <base> <branch>...` adopts them bottom to top; then `gh stack rebase` and `gh stack submit`. Without the extension, or on GitLab, set each PR's base to the previous branch (`gh pr create --base <prev>`, `glab mr create --target-branch <prev>`) and merge from the bottom up, rebasing the rest after each merge.
41
+
26
42
  ## Issues
27
43
 
28
44
  Keep issues under ~15 lines of markdown too, code blocks included. Open with the problem in a sentence or two. For a bug, add what happens, what should happen and the shortest way to reproduce it. For a feature, add why it's needed and what "done" looks like. Then add pointers to the relevant code, PRs or issues, and a proposed approach if there's one. Quote only the log lines that matter, label guesses as guesses, and skip anything the title already says.
@@ -32,3 +48,20 @@ Keep issues under ~15 lines of markdown too, code blocks included. Open with the
32
48
  Each finding takes about three sentences: what's wrong, what it breaks, and the fix. Don't walk through every step of the reasoning or restate what the diff shows. Mark nits with "Nit:" and keep them shorter still. The review's summary body follows the same rule.
33
49
 
34
50
  Post a review you were asked to publish as a review, not as a plain comment, and mark it "Approve" or "Request changes" depending on its outcome (on GitLab: approve, or leave the blocking threads unresolved). Write a bare `@name` only for a real login you mean to notify.
51
+
52
+ When you answer review comments on your own PR, close each thread you handled: reply in it with the fix (the commit, or one line on what changed) or with why you are not making the change, then resolve it. Resolve it either way, so the user doesn't have to resolve every thread by hand. Leave threads you didn't handle open, and never resolve threads on a PR you are reviewing. These thread replies skip the introduction line. On GitHub, resolving takes the GraphQL API:
53
+
54
+ ```sh
55
+ # unresolved threads on PR N, with their IDs
56
+ gh api graphql -F owner='{owner}' -F repo='{repo}' -F pr=N -f query='
57
+ query($owner:String!,$repo:String!,$pr:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$pr){
58
+ reviewThreads(first:100){nodes{id isResolved path line comments(first:1){nodes{body}}}}}}}' \
59
+ --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved | not)'
60
+ # reply in a thread, then resolve it
61
+ gh api graphql -F id=PRRT_xxx -f body='Fixed in abc1234.' -f query='
62
+ mutation($id:ID!,$body:String!){addPullRequestReviewThreadReply(input:{pullRequestReviewThreadId:$id,body:$body}){comment{id}}}'
63
+ gh api graphql -F id=PRRT_xxx -f query='
64
+ mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}'
65
+ ```
66
+
67
+ On GitLab, reply with `glab api -X POST "projects/:id/merge_requests/N/discussions/<discussion_id>/notes" -f body='...'`, then resolve with `glab api -X PUT "projects/:id/merge_requests/N/discussions/<discussion_id>?resolved=true"`.