@chankov/agent-skills 0.1.0 → 0.2.0

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.
Files changed (164) hide show
  1. package/.pi/extensions/agent-skills-update-check/README.md +58 -0
  2. package/.pi/extensions/agent-skills-update-check/index.ts +161 -0
  3. package/.pi/extensions/agent-skills-update-check/package.json +6 -0
  4. package/.versions/0.2.0/.claude/commands/build.md +18 -0
  5. package/.versions/0.2.0/.claude/commands/code-simplify.md +22 -0
  6. package/.versions/0.2.0/.claude/commands/design-agent.md +14 -0
  7. package/.versions/0.2.0/.claude/commands/doctor.md +13 -0
  8. package/.versions/0.2.0/.claude/commands/plan.md +16 -0
  9. package/.versions/0.2.0/.claude/commands/prime.md +22 -0
  10. package/.versions/0.2.0/.claude/commands/review.md +16 -0
  11. package/.versions/0.2.0/.claude/commands/setup.md +19 -0
  12. package/.versions/0.2.0/.claude/commands/ship.md +17 -0
  13. package/.versions/0.2.0/.claude/commands/spec.md +15 -0
  14. package/.versions/0.2.0/.claude/commands/test.md +19 -0
  15. package/.versions/0.2.0/.opencode/commands/as-build.md +17 -0
  16. package/.versions/0.2.0/.opencode/commands/as-code-simplify.md +16 -0
  17. package/.versions/0.2.0/.opencode/commands/as-design-agent.md +15 -0
  18. package/.versions/0.2.0/.opencode/commands/as-doctor.md +11 -0
  19. package/.versions/0.2.0/.opencode/commands/as-plan.md +16 -0
  20. package/.versions/0.2.0/.opencode/commands/as-prime.md +22 -0
  21. package/.versions/0.2.0/.opencode/commands/as-review.md +15 -0
  22. package/.versions/0.2.0/.opencode/commands/as-setup.md +11 -0
  23. package/.versions/0.2.0/.opencode/commands/as-ship.md +16 -0
  24. package/.versions/0.2.0/.opencode/commands/as-spec.md +16 -0
  25. package/.versions/0.2.0/.opencode/commands/as-test.md +21 -0
  26. package/.versions/0.2.0/.pi/agents/agent-chain.yaml +49 -0
  27. package/.versions/0.2.0/.pi/agents/bowser.md +19 -0
  28. package/.versions/0.2.0/.pi/agents/pi-pi/agent-expert.md +98 -0
  29. package/.versions/0.2.0/.pi/agents/pi-pi/cli-expert.md +41 -0
  30. package/.versions/0.2.0/.pi/agents/pi-pi/config-expert.md +63 -0
  31. package/.versions/0.2.0/.pi/agents/pi-pi/ext-expert.md +43 -0
  32. package/.versions/0.2.0/.pi/agents/pi-pi/keybinding-expert.md +134 -0
  33. package/.versions/0.2.0/.pi/agents/pi-pi/pi-orchestrator.md +57 -0
  34. package/.versions/0.2.0/.pi/agents/pi-pi/prompt-expert.md +70 -0
  35. package/.versions/0.2.0/.pi/agents/pi-pi/skill-expert.md +42 -0
  36. package/.versions/0.2.0/.pi/agents/pi-pi/theme-expert.md +40 -0
  37. package/.versions/0.2.0/.pi/agents/pi-pi/tui-expert.md +85 -0
  38. package/.versions/0.2.0/.pi/agents/teams.yaml +31 -0
  39. package/.versions/0.2.0/.pi/damage-control-rules.yaml +278 -0
  40. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/README.md +58 -0
  41. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/index.ts +161 -0
  42. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/package.json +6 -0
  43. package/.versions/0.2.0/.pi/extensions/chrome-devtools-mcp/README.md +39 -0
  44. package/.versions/0.2.0/.pi/extensions/chrome-devtools-mcp/index.ts +61 -0
  45. package/.versions/0.2.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  46. package/.versions/0.2.0/.pi/extensions/compact-and-continue/README.md +42 -0
  47. package/.versions/0.2.0/.pi/extensions/compact-and-continue/index.ts +120 -0
  48. package/.versions/0.2.0/.pi/extensions/compact-and-continue/package.json +6 -0
  49. package/.versions/0.2.0/.pi/extensions/mcp-bridge/README.md +46 -0
  50. package/.versions/0.2.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  51. package/.versions/0.2.0/.pi/extensions/mcp-bridge/package.json +6 -0
  52. package/.versions/0.2.0/.pi/extensions/package-lock.json +1143 -0
  53. package/.versions/0.2.0/.pi/extensions/package.json +9 -0
  54. package/.versions/0.2.0/.pi/harnesses/agent-chain/README.md +37 -0
  55. package/.versions/0.2.0/.pi/harnesses/agent-chain/index.ts +795 -0
  56. package/.versions/0.2.0/.pi/harnesses/agent-chain/package.json +6 -0
  57. package/.versions/0.2.0/.pi/harnesses/agent-team/README.md +38 -0
  58. package/.versions/0.2.0/.pi/harnesses/agent-team/index.ts +732 -0
  59. package/.versions/0.2.0/.pi/harnesses/agent-team/package.json +6 -0
  60. package/.versions/0.2.0/.pi/harnesses/coms/README.md +36 -0
  61. package/.versions/0.2.0/.pi/harnesses/coms/index.ts +1595 -0
  62. package/.versions/0.2.0/.pi/harnesses/coms/package.json +6 -0
  63. package/.versions/0.2.0/.pi/harnesses/coms-net/README.md +46 -0
  64. package/.versions/0.2.0/.pi/harnesses/coms-net/index.ts +1637 -0
  65. package/.versions/0.2.0/.pi/harnesses/coms-net/package.json +6 -0
  66. package/.versions/0.2.0/.pi/harnesses/damage-control/README.md +38 -0
  67. package/.versions/0.2.0/.pi/harnesses/damage-control/index.ts +207 -0
  68. package/.versions/0.2.0/.pi/harnesses/damage-control/package.json +6 -0
  69. package/.versions/0.2.0/.pi/harnesses/damage-control-continue/README.md +37 -0
  70. package/.versions/0.2.0/.pi/harnesses/damage-control-continue/index.ts +234 -0
  71. package/.versions/0.2.0/.pi/harnesses/damage-control-continue/package.json +6 -0
  72. package/.versions/0.2.0/.pi/harnesses/minimal/README.md +27 -0
  73. package/.versions/0.2.0/.pi/harnesses/minimal/index.ts +32 -0
  74. package/.versions/0.2.0/.pi/harnesses/minimal/package.json +6 -0
  75. package/.versions/0.2.0/.pi/harnesses/package-lock.json +35 -0
  76. package/.versions/0.2.0/.pi/harnesses/package.json +9 -0
  77. package/.versions/0.2.0/.pi/harnesses/pi-pi/README.md +39 -0
  78. package/.versions/0.2.0/.pi/harnesses/pi-pi/index.ts +631 -0
  79. package/.versions/0.2.0/.pi/harnesses/pi-pi/package.json +6 -0
  80. package/.versions/0.2.0/.pi/harnesses/purpose-gate/README.md +27 -0
  81. package/.versions/0.2.0/.pi/harnesses/purpose-gate/index.ts +82 -0
  82. package/.versions/0.2.0/.pi/harnesses/purpose-gate/package.json +6 -0
  83. package/.versions/0.2.0/.pi/harnesses/session-replay/README.md +28 -0
  84. package/.versions/0.2.0/.pi/harnesses/session-replay/index.ts +214 -0
  85. package/.versions/0.2.0/.pi/harnesses/session-replay/package.json +6 -0
  86. package/.versions/0.2.0/.pi/harnesses/subagent-widget/README.md +36 -0
  87. package/.versions/0.2.0/.pi/harnesses/subagent-widget/index.ts +479 -0
  88. package/.versions/0.2.0/.pi/harnesses/subagent-widget/package.json +6 -0
  89. package/.versions/0.2.0/.pi/harnesses/system-select/README.md +39 -0
  90. package/.versions/0.2.0/.pi/harnesses/system-select/index.ts +165 -0
  91. package/.versions/0.2.0/.pi/harnesses/system-select/package.json +6 -0
  92. package/.versions/0.2.0/.pi/harnesses/tilldone/README.md +35 -0
  93. package/.versions/0.2.0/.pi/harnesses/tilldone/index.ts +724 -0
  94. package/.versions/0.2.0/.pi/harnesses/tilldone/package.json +6 -0
  95. package/.versions/0.2.0/.pi/harnesses/tool-counter/README.md +31 -0
  96. package/.versions/0.2.0/.pi/harnesses/tool-counter/index.ts +100 -0
  97. package/.versions/0.2.0/.pi/harnesses/tool-counter/package.json +6 -0
  98. package/.versions/0.2.0/.pi/harnesses/tool-counter-widget/README.md +27 -0
  99. package/.versions/0.2.0/.pi/harnesses/tool-counter-widget/index.ts +66 -0
  100. package/.versions/0.2.0/.pi/harnesses/tool-counter-widget/package.json +6 -0
  101. package/.versions/0.2.0/.pi/prompts/build.md +24 -0
  102. package/.versions/0.2.0/.pi/prompts/code-simplify.md +22 -0
  103. package/.versions/0.2.0/.pi/prompts/doctor.md +13 -0
  104. package/.versions/0.2.0/.pi/prompts/plan.md +16 -0
  105. package/.versions/0.2.0/.pi/prompts/review.md +16 -0
  106. package/.versions/0.2.0/.pi/prompts/setup.md +19 -0
  107. package/.versions/0.2.0/.pi/prompts/ship.md +17 -0
  108. package/.versions/0.2.0/.pi/prompts/spec.md +15 -0
  109. package/.versions/0.2.0/.pi/prompts/test.md +19 -0
  110. package/.versions/0.2.0/.pi/skills/bowser/SKILL.md +114 -0
  111. package/.versions/0.2.0/.version +1 -0
  112. package/.versions/0.2.0/agents/builder.md +6 -0
  113. package/.versions/0.2.0/agents/code-reviewer.md +93 -0
  114. package/.versions/0.2.0/agents/documenter.md +6 -0
  115. package/.versions/0.2.0/agents/plan-reviewer.md +22 -0
  116. package/.versions/0.2.0/agents/planner.md +6 -0
  117. package/.versions/0.2.0/agents/scout.md +6 -0
  118. package/.versions/0.2.0/agents/security-auditor.md +97 -0
  119. package/.versions/0.2.0/agents/test-engineer.md +89 -0
  120. package/.versions/0.2.0/hooks/SIMPLIFY-IGNORE.md +90 -0
  121. package/.versions/0.2.0/hooks/hooks.json +14 -0
  122. package/.versions/0.2.0/hooks/session-start.sh +74 -0
  123. package/.versions/0.2.0/hooks/simplify-ignore-test.sh +247 -0
  124. package/.versions/0.2.0/hooks/simplify-ignore.sh +302 -0
  125. package/.versions/0.2.0/references/accessibility-checklist.md +159 -0
  126. package/.versions/0.2.0/references/performance-checklist.md +121 -0
  127. package/.versions/0.2.0/references/prompting-patterns.md +380 -0
  128. package/.versions/0.2.0/references/security-checklist.md +134 -0
  129. package/.versions/0.2.0/references/testing-patterns.md +236 -0
  130. package/.versions/0.2.0/skills/api-and-interface-design/SKILL.md +294 -0
  131. package/.versions/0.2.0/skills/browser-testing-with-devtools/SKILL.md +335 -0
  132. package/.versions/0.2.0/skills/ci-cd-and-automation/SKILL.md +390 -0
  133. package/.versions/0.2.0/skills/code-review-and-quality/SKILL.md +347 -0
  134. package/.versions/0.2.0/skills/code-simplification/SKILL.md +331 -0
  135. package/.versions/0.2.0/skills/context-engineering/SKILL.md +291 -0
  136. package/.versions/0.2.0/skills/debugging-and-error-recovery/SKILL.md +300 -0
  137. package/.versions/0.2.0/skills/deprecation-and-migration/SKILL.md +206 -0
  138. package/.versions/0.2.0/skills/designing-agents/SKILL.md +394 -0
  139. package/.versions/0.2.0/skills/designing-agents/pi-harness-authoring.md +213 -0
  140. package/.versions/0.2.0/skills/documentation-and-adrs/SKILL.md +278 -0
  141. package/.versions/0.2.0/skills/frontend-ui-engineering/SKILL.md +322 -0
  142. package/.versions/0.2.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  143. package/.versions/0.2.0/skills/guided-workspace-setup/SKILL.md +293 -0
  144. package/.versions/0.2.0/skills/idea-refine/SKILL.md +178 -0
  145. package/.versions/0.2.0/skills/idea-refine/examples.md +238 -0
  146. package/.versions/0.2.0/skills/idea-refine/frameworks.md +99 -0
  147. package/.versions/0.2.0/skills/idea-refine/refinement-criteria.md +113 -0
  148. package/.versions/0.2.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  149. package/.versions/0.2.0/skills/incremental-implementation/SKILL.md +279 -0
  150. package/.versions/0.2.0/skills/performance-optimization/SKILL.md +350 -0
  151. package/.versions/0.2.0/skills/planning-and-task-breakdown/SKILL.md +237 -0
  152. package/.versions/0.2.0/skills/security-and-hardening/SKILL.md +349 -0
  153. package/.versions/0.2.0/skills/shipping-and-launch/SKILL.md +309 -0
  154. package/.versions/0.2.0/skills/source-driven-development/SKILL.md +194 -0
  155. package/.versions/0.2.0/skills/spec-driven-development/SKILL.md +237 -0
  156. package/.versions/0.2.0/skills/test-driven-development/SKILL.md +379 -0
  157. package/.versions/0.2.0/skills/using-agent-skills/SKILL.md +176 -0
  158. package/CHANGELOG.md +36 -0
  159. package/bin/cli.js +42 -7
  160. package/bin/lib/update-notifier.js +195 -0
  161. package/docs/npm-install.md +60 -0
  162. package/hooks/session-start.sh +66 -12
  163. package/package.json +1 -1
  164. package/skills/guided-workspace-setup/SKILL.md +1 -1
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: using-agent-skills
3
+ description: Discovers and invokes agent skills. Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
4
+ ---
5
+
6
+ # Using Agent Skills
7
+
8
+ ## Overview
9
+
10
+ Agent Skills is a collection of engineering workflow skills organized by development phase. Each skill encodes a specific process that senior engineers follow. This meta-skill helps you discover and apply the right skill for your current task.
11
+
12
+ ## Skill Discovery
13
+
14
+ When a task arrives, identify the development phase and apply the corresponding skill:
15
+
16
+ ```
17
+ Task arrives
18
+
19
+ ├── Vague idea/need refinement? ──→ idea-refine
20
+ ├── New project/feature/change? ──→ spec-driven-development
21
+ ├── Have a spec, need tasks? ──────→ planning-and-task-breakdown
22
+ ├── Implementing code? ────────────→ incremental-implementation
23
+ │ ├── UI work? ─────────────────→ frontend-ui-engineering
24
+ │ ├── API work? ────────────────→ api-and-interface-design
25
+ │ ├── Need better context? ─────→ context-engineering
26
+ │ └── Need doc-verified code? ───→ source-driven-development
27
+ ├── Writing/running tests? ────────→ test-driven-development
28
+ │ └── Browser-based? ───────────→ browser-testing-with-devtools
29
+ ├── Something broke? ──────────────→ debugging-and-error-recovery
30
+ ├── Reviewing code? ───────────────→ code-review-and-quality
31
+ │ ├── Security concerns? ───────→ security-and-hardening
32
+ │ └── Performance concerns? ────→ performance-optimization
33
+ ├── Committing/branching? ─────────→ git-workflow-and-versioning
34
+ ├── CI/CD pipeline work? ──────────→ ci-cd-and-automation
35
+ ├── Writing docs/ADRs? ───────────→ documentation-and-adrs
36
+ ├── Authoring a new skill/persona? ─→ designing-agents
37
+ └── Deploying/launching? ─────────→ shipping-and-launch
38
+ ```
39
+
40
+ ## Core Operating Behaviors
41
+
42
+ These behaviors apply at all times, across all skills. They are non-negotiable.
43
+
44
+ ### 1. Surface Assumptions
45
+
46
+ Before implementing anything non-trivial, explicitly state your assumptions:
47
+
48
+ ```
49
+ ASSUMPTIONS I'M MAKING:
50
+ 1. [assumption about requirements]
51
+ 2. [assumption about architecture]
52
+ 3. [assumption about scope]
53
+ → Correct me now or I'll proceed with these.
54
+ ```
55
+
56
+ Don't silently fill in ambiguous requirements. The most common failure mode is making wrong assumptions and running with them unchecked. Surface uncertainty early — it's cheaper than rework.
57
+
58
+ ### 2. Manage Confusion Actively
59
+
60
+ When you encounter inconsistencies, conflicting requirements, or unclear specifications:
61
+
62
+ 1. **STOP.** Do not proceed with a guess.
63
+ 2. Name the specific confusion.
64
+ 3. Present the tradeoff or ask the clarifying question.
65
+ 4. Wait for resolution before continuing.
66
+
67
+ **Bad:** Silently picking one interpretation and hoping it's right.
68
+ **Good:** "I see X in the spec but Y in the existing code. Which takes precedence?"
69
+
70
+ ### 3. Push Back When Warranted
71
+
72
+ You are not a yes-machine. When an approach has clear problems:
73
+
74
+ - Point out the issue directly
75
+ - Explain the concrete downside (quantify when possible — "this adds ~200ms latency" not "this might be slower")
76
+ - Propose an alternative
77
+ - Accept the human's decision if they override with full information
78
+
79
+ Sycophancy is a failure mode. "Of course!" followed by implementing a bad idea helps no one. Honest technical disagreement is more valuable than false agreement.
80
+
81
+ ### 4. Enforce Simplicity
82
+
83
+ Your natural tendency is to overcomplicate. Actively resist it.
84
+
85
+ Before finishing any implementation, ask:
86
+ - Can this be done in fewer lines?
87
+ - Are these abstractions earning their complexity?
88
+ - Would a staff engineer look at this and say "why didn't you just..."?
89
+
90
+ If you build 1000 lines and 100 would suffice, you have failed. Prefer the boring, obvious solution. Cleverness is expensive.
91
+
92
+ ### 5. Maintain Scope Discipline
93
+
94
+ Touch only what you're asked to touch.
95
+
96
+ Do NOT:
97
+ - Remove comments you don't understand
98
+ - "Clean up" code orthogonal to the task
99
+ - Refactor adjacent systems as a side effect
100
+ - Delete code that seems unused without explicit approval
101
+ - Add features not in the spec because they "seem useful"
102
+
103
+ Your job is surgical precision, not unsolicited renovation.
104
+
105
+ ### 6. Verify, Don't Assume
106
+
107
+ Every skill includes a verification step. A task is not complete until verification passes. "Seems right" is never sufficient — there must be evidence (passing tests, build output, runtime data).
108
+
109
+ ## Failure Modes to Avoid
110
+
111
+ These are the subtle errors that look like productivity but create problems:
112
+
113
+ 1. Making wrong assumptions without checking
114
+ 2. Not managing your own confusion — plowing ahead when lost
115
+ 3. Not surfacing inconsistencies you notice
116
+ 4. Not presenting tradeoffs on non-obvious decisions
117
+ 5. Being sycophantic ("Of course!") to approaches with clear problems
118
+ 6. Overcomplicating code and APIs
119
+ 7. Modifying code or comments orthogonal to the task
120
+ 8. Removing things you don't fully understand
121
+ 9. Building without a spec because "it's obvious"
122
+ 10. Skipping verification because "it looks right"
123
+
124
+ ## Skill Rules
125
+
126
+ 1. **Check for an applicable skill before starting work.** Skills encode processes that prevent common mistakes.
127
+
128
+ 2. **Skills are workflows, not suggestions.** Follow the steps in order. Don't skip verification steps.
129
+
130
+ 3. **Multiple skills can apply.** A feature implementation might involve `idea-refine` → `spec-driven-development` → `planning-and-task-breakdown` → `incremental-implementation` → `test-driven-development` → `code-review-and-quality` → `shipping-and-launch` in sequence.
131
+
132
+ 4. **When in doubt, start with a spec.** If the task is non-trivial and there's no spec, begin with `spec-driven-development`.
133
+
134
+ ## Lifecycle Sequence
135
+
136
+ For a complete feature, the typical skill sequence is:
137
+
138
+ ```
139
+ 1. idea-refine → Refine vague ideas
140
+ 2. spec-driven-development → Define what we're building
141
+ 3. planning-and-task-breakdown → Break into verifiable chunks
142
+ 4. context-engineering → Load the right context
143
+ 5. source-driven-development → Verify against official docs
144
+ 6. incremental-implementation → Build slice by slice
145
+ 7. test-driven-development → Prove each slice works
146
+ 8. code-review-and-quality → Review before merge
147
+ 9. git-workflow-and-versioning → Clean commit history
148
+ 10. documentation-and-adrs → Document decisions
149
+ 11. shipping-and-launch → Deploy safely
150
+ ```
151
+
152
+ Not every task needs every skill. A bug fix might only need: `debugging-and-error-recovery` → `test-driven-development` → `code-review-and-quality`.
153
+
154
+ ## Quick Reference
155
+
156
+ | Phase | Skill | One-Line Summary |
157
+ |-------|-------|-----------------|
158
+ | Define | idea-refine | Refine ideas through structured divergent and convergent thinking |
159
+ | Define | spec-driven-development | Requirements and acceptance criteria before code |
160
+ | Plan | planning-and-task-breakdown | Decompose into small, verifiable tasks |
161
+ | Build | incremental-implementation | Thin vertical slices, test each before expanding |
162
+ | Build | source-driven-development | Verify against official docs before implementing |
163
+ | Build | context-engineering | Right context at the right time |
164
+ | Build | frontend-ui-engineering | Production-quality UI with accessibility |
165
+ | Build | api-and-interface-design | Stable interfaces with clear contracts |
166
+ | Verify | test-driven-development | Failing test first, then make it pass |
167
+ | Verify | browser-testing-with-devtools | Chrome DevTools MCP for runtime verification |
168
+ | Verify | debugging-and-error-recovery | Reproduce → localize → fix → guard |
169
+ | Review | code-review-and-quality | Five-axis review with quality gates |
170
+ | Review | security-and-hardening | OWASP prevention, input validation, least privilege |
171
+ | Review | performance-optimization | Measure first, optimize only what matters |
172
+ | Ship | git-workflow-and-versioning | Atomic commits, clean history |
173
+ | Ship | ci-cd-and-automation | Automated quality gates on every change |
174
+ | Ship | documentation-and-adrs | Document the why, not just the what |
175
+ | Ship | shipping-and-launch | Pre-launch checklist, monitoring, rollback plan |
176
+ | Author | designing-agents | Author a persona, workflow skill, or pi harness |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # agent-skills changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7f2be04: Initial npm release. Ships the full skills catalog, agent personas, slash
8
+ commands, and pi extensions as an installable package, with a thin CLI
9
+ (`npx agent-skills init`) that hands off to the LLM-driven
10
+ `guided-workspace-setup` skill. Adds version-aware updates: the install record
11
+ now embeds the package version, and re-running `/setup` after a version bump
12
+ surfaces a per-artifact three-way diff (source@recorded vs installed copy vs
13
+ source@current) before touching any file.
14
+ - Add three layered update-notification paths so users are told when a newer
15
+ version is published, without having to remember to check:
16
+
17
+ 1. **CLI update-notifier** (`bin/lib/update-notifier.js`) — every
18
+ `npx @chankov/agent-skills <cmd>` reads a shared 24h cache; if the cached
19
+ latest exceeds the running CLI version, a banner prints to stderr. Stale
20
+ caches are refreshed by a detached background process so the current run
21
+ is never blocked.
22
+ 2. **`check-update` CLI subcommand** — standalone entry point used by hooks
23
+ and extensions; blocks on a single registry fetch (2s timeout) and prints
24
+ the banner to stdout if outdated. Always exits 0.
25
+ 3. **Claude Code session-start hook** (`hooks/session-start.sh`) — extended
26
+ to call `check-update` with a 3s wall-clock cap and inject the banner into
27
+ the session context so Claude can surface it on its first turn.
28
+ 4. **pi extension** (`.pi/extensions/agent-skills-update-check/`) — fires on
29
+ the first `agent_start` event of each pi session, reads the same shared
30
+ cache, emits `ctx.ui.notify` if outdated. Offered as a `★`-recommended
31
+ pick in install-menu Group 10.
32
+
33
+ All three share the cache at `$XDG_CACHE_HOME/agent-skills/latest-version.json`
34
+ so the registry is hit at most once per 24h window across all runtimes.
35
+
36
+ Opt-out via any of `AGENT_SKILLS_NO_UPDATE_CHECK=1`, `NO_UPDATE_NOTIFIER=1`,
37
+ or `CI=true`.
38
+
3
39
  All notable changes to this project are documented here. Format follows
4
40
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versioning follows
5
41
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Entries below 0.1.0
package/bin/cli.js CHANGED
@@ -21,6 +21,7 @@ import { stdin, stdout, exit } from "node:process";
21
21
 
22
22
  import { runDoctor } from "./lib/doctor.js";
23
23
  import { detectAgent, agentLabel, AGENTS } from "./lib/detect-agent.js";
24
+ import { checkAndNotify } from "./lib/update-notifier.js";
24
25
 
25
26
  const __dirname = dirname(fileURLToPath(import.meta.url));
26
27
  const pkgRoot = resolve(__dirname, "..");
@@ -70,11 +71,20 @@ if (opts.help) {
70
71
 
71
72
  // ── dispatch ──────────────────────────────────────────────────────────────
72
73
 
74
+ // Update check runs first — if the cache is fresh and shows an upgrade,
75
+ // the banner prints to stderr before the command output. If the cache is
76
+ // stale, a background fetch refreshes it for the next invocation.
77
+ // `update` skips this since it has its own version-delta reporting.
78
+ if (sub !== "update" && sub !== "check-update") {
79
+ checkAndNotify(pkg.version);
80
+ }
81
+
73
82
  switch (sub) {
74
- case "init": await cmdInit(); break;
75
- case "doctor": await cmdDoctor(); break;
76
- case "update": await cmdUpdate(); break;
77
- default: fail(`unknown command: ${sub}\n\nRun "agent-skills --help" for usage.`);
83
+ case "init": await cmdInit(); break;
84
+ case "doctor": await cmdDoctor(); break;
85
+ case "update": await cmdUpdate(); break;
86
+ case "check-update": await cmdCheckUpdate(); break;
87
+ default: fail(`unknown command: ${sub}\n\nRun "agent-skills --help" for usage.`);
78
88
  }
79
89
 
80
90
  // ── commands ──────────────────────────────────────────────────────────────
@@ -190,6 +200,25 @@ async function cmdUpdate() {
190
200
  console.log("touching any file.");
191
201
  }
192
202
 
203
+ async function cmdCheckUpdate() {
204
+ // Entry point for hook scripts and pi extensions. Blocks on a single
205
+ // registry fetch (short timeout); emits a one-line banner to stdout if an
206
+ // upgrade is available, otherwise prints nothing. Always exits 0 so a
207
+ // failed check never breaks the calling hook.
208
+ const { fetchLatestSync, readCacheStatus, formatBanner, gt } =
209
+ await import("./lib/update-notifier.js");
210
+
211
+ let latest = readCacheStatus();
212
+ if (!latest || latest.stale) {
213
+ const fetched = await fetchLatestSync(2000);
214
+ if (fetched) latest = { latest: fetched };
215
+ }
216
+ if (latest?.latest && gt(latest.latest, pkg.version)) {
217
+ process.stdout.write(formatBanner(pkg.version, latest.latest) + "\n");
218
+ }
219
+ exit(0);
220
+ }
221
+
193
222
  // ── helpers ───────────────────────────────────────────────────────────────
194
223
 
195
224
  async function chooseAgent(supplied) {
@@ -356,9 +385,10 @@ Usage:
356
385
  npx agent-skills <command> [options]
357
386
 
358
387
  Commands:
359
- init Materialize the package + hand off to /setup in your agent
360
- doctor Scan for broken symlinks and stale persona references
361
- update Surface the version delta + hand off to /setup for the refresh
388
+ init Materialize the package + hand off to /setup in your agent
389
+ doctor Scan for broken symlinks and stale persona references
390
+ update Surface the version delta + hand off to /setup for the refresh
391
+ check-update One-line registry check (used by session hooks; safe to script)
362
392
 
363
393
  Options:
364
394
  -v, --version Print the package version
@@ -370,6 +400,11 @@ Examples:
370
400
  npx agent-skills doctor --workspace ~/projects/foo
371
401
  npx agent-skills update
372
402
 
403
+ Environment:
404
+ AGENT_SKILLS_NO_UPDATE_CHECK=1 Disable the background update check
405
+ NO_UPDATE_NOTIFIER=1 Same (conventional opt-out, also honoured)
406
+ CI=true Auto-disables the update check
407
+
373
408
  Docs: https://github.com/chankov/agent-skills#readme
374
409
  `);
375
410
  }
@@ -0,0 +1,195 @@
1
+ // update-notifier — zero-dependency check for newer versions on the npm
2
+ // registry, shared by the CLI, the Claude Code session hook, and the pi
3
+ // extension.
4
+ //
5
+ // Behaviour:
6
+ // - Cache lives at $XDG_CACHE_HOME/agent-skills/latest-version.json
7
+ // (falls back to ~/.cache/agent-skills/) with a 24h TTL.
8
+ // - The CLI invokes checkAndNotify() at the top of every command. If the
9
+ // cache is fresh and shows an upgrade, we print a banner immediately.
10
+ // If the cache is stale or absent, we start a background fetch (detached,
11
+ // non-blocking) and use whatever we have right now.
12
+ // - Network failures, JSON parse errors, and missing cache files are all
13
+ // swallowed silently — update checks must NEVER block the CLI or break
14
+ // a hook.
15
+ // - Opt-out: AGENT_SKILLS_NO_UPDATE_CHECK=1 in the environment disables
16
+ // everything in this module.
17
+
18
+ import { mkdirSync, readFileSync, writeFileSync, existsSync } from "node:fs";
19
+ import { homedir } from "node:os";
20
+ import { join } from "node:path";
21
+ import { request } from "node:https";
22
+ import { spawn } from "node:child_process";
23
+ import { fileURLToPath } from "node:url";
24
+
25
+ const PACKAGE_NAME = "@chankov/agent-skills";
26
+ const REGISTRY = "https://registry.npmjs.org";
27
+ const TTL_MS = 24 * 60 * 60 * 1000;
28
+
29
+ const CACHE_DIR = join(
30
+ process.env.XDG_CACHE_HOME || join(homedir(), ".cache"),
31
+ "agent-skills",
32
+ );
33
+ const CACHE_FILE = join(CACHE_DIR, "latest-version.json");
34
+
35
+ // ── Public surface ───────────────────────────────────────────────────────
36
+
37
+ /**
38
+ * Run the standard check + banner flow used by the CLI.
39
+ *
40
+ * @param {string} currentVersion The version of the running CLI
41
+ * @param {object} [opts]
42
+ * @param {boolean} [opts.silent] If true, return the banner string instead of printing
43
+ * @returns {string|null} The banner that would be (or was) printed
44
+ */
45
+ export function checkAndNotify(currentVersion, opts = {}) {
46
+ if (isDisabled()) return null;
47
+
48
+ const cached = readCache();
49
+ const fresh = cached && Date.now() - cached.checkedAt < TTL_MS;
50
+
51
+ if (!fresh) startBackgroundFetch();
52
+
53
+ const latest = cached?.latest;
54
+ if (!latest || !gt(latest, currentVersion)) return null;
55
+
56
+ const banner = formatBanner(currentVersion, latest);
57
+ if (!opts.silent) process.stderr.write(banner + "\n");
58
+ return banner;
59
+ }
60
+
61
+ /**
62
+ * Synchronously fetch the latest version, write the cache, and return it.
63
+ * Used by the standalone check-update entry point (hooks block on this
64
+ * intentionally — they need the answer before the session continues).
65
+ *
66
+ * @param {number} [timeoutMs] Default 2000ms — hooks must not stall the UI
67
+ * @returns {Promise<string|null>}
68
+ */
69
+ export async function fetchLatestSync(timeoutMs = 2000) {
70
+ if (isDisabled()) return null;
71
+ try {
72
+ const latest = await fetchLatest(timeoutMs);
73
+ writeCache({ latest, checkedAt: Date.now() });
74
+ return latest;
75
+ } catch {
76
+ return null;
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Read the cached latest version without touching the network. Hook scripts
82
+ * use this on the fast path — if the cache is fresh, no fetch is needed.
83
+ *
84
+ * @returns {{latest:string, checkedAt:number, stale:boolean}|null}
85
+ */
86
+ export function readCacheStatus() {
87
+ const c = readCache();
88
+ if (!c) return null;
89
+ return { ...c, stale: Date.now() - c.checkedAt >= TTL_MS };
90
+ }
91
+
92
+ export function formatBanner(current, latest) {
93
+ const lines = [
94
+ `agent-skills update available: ${current} → ${latest}`,
95
+ ` Run: npx ${PACKAGE_NAME}@latest update`,
96
+ ` Releases: https://github.com/chankov/agent-skills/releases`,
97
+ ];
98
+ const w = Math.max(...lines.map((l) => l.length)) + 2;
99
+ const bar = "─".repeat(w);
100
+ return [
101
+ `┌${bar}┐`,
102
+ ...lines.map((l) => `│ ${l.padEnd(w - 1)}│`),
103
+ `└${bar}┘`,
104
+ ].join("\n");
105
+ }
106
+
107
+ // ── Internals ────────────────────────────────────────────────────────────
108
+
109
+ function isDisabled() {
110
+ return process.env.AGENT_SKILLS_NO_UPDATE_CHECK === "1"
111
+ || process.env.CI === "true" // never spam CI logs
112
+ || process.env.NO_UPDATE_NOTIFIER === "1"; // honour the common convention
113
+ }
114
+
115
+ function readCache() {
116
+ try {
117
+ if (!existsSync(CACHE_FILE)) return null;
118
+ return JSON.parse(readFileSync(CACHE_FILE, "utf8"));
119
+ } catch {
120
+ return null;
121
+ }
122
+ }
123
+
124
+ function writeCache(payload) {
125
+ try {
126
+ mkdirSync(CACHE_DIR, { recursive: true });
127
+ writeFileSync(CACHE_FILE, JSON.stringify(payload, null, 2), "utf8");
128
+ } catch {
129
+ // Read-only home dir, full disk, etc. — caching is best-effort.
130
+ }
131
+ }
132
+
133
+ function fetchLatest(timeoutMs) {
134
+ return new Promise((resolve, reject) => {
135
+ const url = `${REGISTRY}/${encodeURIComponent(PACKAGE_NAME).replace("%40", "@")}/latest`;
136
+ const req = request(url, { method: "GET", headers: { accept: "application/json" } }, (res) => {
137
+ if (res.statusCode !== 200) {
138
+ reject(new Error(`registry returned ${res.statusCode}`));
139
+ res.resume();
140
+ return;
141
+ }
142
+ let body = "";
143
+ res.setEncoding("utf8");
144
+ res.on("data", (chunk) => { body += chunk; });
145
+ res.on("end", () => {
146
+ try {
147
+ const parsed = JSON.parse(body);
148
+ if (typeof parsed.version !== "string") throw new Error("missing version field");
149
+ resolve(parsed.version);
150
+ } catch (err) { reject(err); }
151
+ });
152
+ });
153
+ req.on("error", reject);
154
+ req.setTimeout(timeoutMs, () => {
155
+ req.destroy(new Error("timeout"));
156
+ });
157
+ req.end();
158
+ });
159
+ }
160
+
161
+ function startBackgroundFetch() {
162
+ // Detached worker: never blocks the CLI, never inherits stdio.
163
+ // We re-enter this module via dynamic import in a fresh node process and
164
+ // run fetchLatestSync there — keeps the parent CLI exit unaffected.
165
+ try {
166
+ const modPath = fileURLToPath(import.meta.url);
167
+ const child = spawn(process.execPath, [
168
+ "-e",
169
+ `import(${JSON.stringify(modPath)}).then(m => m.fetchLatestSync(8000)).catch(() => {})`,
170
+ ], { detached: true, stdio: "ignore" });
171
+ child.unref();
172
+ } catch {
173
+ // If spawn fails (e.g. restricted env), skip — the next CLI run will retry.
174
+ }
175
+ }
176
+
177
+ // ── Tiny semver-gt comparator ────────────────────────────────────────────
178
+ // Enough for X.Y.Z comparisons; anything pre-release falls back to string
179
+ // compare on the suffix, which is good enough for "is the user behind?"
180
+
181
+ export function gt(a, b) {
182
+ const [aMain, aPre = ""] = a.split("-", 2);
183
+ const [bMain, bPre = ""] = b.split("-", 2);
184
+ const aParts = aMain.split(".").map(Number);
185
+ const bParts = bMain.split(".").map(Number);
186
+ for (let i = 0; i < 3; i++) {
187
+ const ai = aParts[i] ?? 0;
188
+ const bi = bParts[i] ?? 0;
189
+ if (ai !== bi) return ai > bi;
190
+ }
191
+ // Equal main versions: a release (no prerelease) outranks a prerelease.
192
+ if (!aPre && bPre) return true;
193
+ if (aPre && !bPre) return false;
194
+ return aPre > bPre;
195
+ }
@@ -156,6 +156,66 @@ npx --yes @chankov/agent-skills@latest init --agent claude-code --method copy --
156
156
  LLM-driven `/setup` flow is not CI-runnable by design — confirmation gates
157
157
  exist precisely so a human approves every write.
158
158
 
159
+ ## Receiving update notifications
160
+
161
+ Three independent mechanisms surface "a new version is published" without
162
+ you having to remember to check. All three share a single cache at
163
+ `$XDG_CACHE_HOME/agent-skills/latest-version.json` (24h TTL) so the
164
+ registry is hit at most once per day.
165
+
166
+ ### 1. CLI update-notifier (always on)
167
+
168
+ Every `npx @chankov/agent-skills <cmd>` invocation runs a fast cache read
169
+ on entry. If the cached latest version exceeds the running CLI version, a
170
+ banner prints to stderr before the command output:
171
+
172
+ ```
173
+ ┌──────────────────────────────────────────────────────────────┐
174
+ │ agent-skills update available: 0.1.0 → 0.2.0 │
175
+ │ Run: npx @chankov/agent-skills@latest update │
176
+ │ Releases: https://github.com/chankov/agent-skills/releases │
177
+ └──────────────────────────────────────────────────────────────┘
178
+ ```
179
+
180
+ If the cache is stale, a detached background process refreshes it for the
181
+ *next* invocation — the current run is never blocked.
182
+
183
+ ### 2. Claude Code session-start hook
184
+
185
+ When `hooks/session-start.sh` is installed (offered in Group 18 of `/setup`),
186
+ every new Claude Code session runs the check with a 3-second wall-clock cap.
187
+ If an upgrade is available, the banner is injected into the session context
188
+ so Claude can mention it on its first turn — e.g. *"Note: agent-skills 0.2.0
189
+ is available; want me to apply it via `/setup`?"*
190
+
191
+ ### 3. pi extension (`agent-skills-update-check`)
192
+
193
+ When installed (offered in Group 10 of `/setup`), the extension fires on the
194
+ first `agent_start` event of each pi session and emits a `ctx.ui.notify`
195
+ message in the pi UI if a newer version is published. Reads the same cache
196
+ as the CLI — no double-fetching.
197
+
198
+ ### Opting out
199
+
200
+ Any of these environment variables disables all three:
201
+
202
+ ```bash
203
+ export AGENT_SKILLS_NO_UPDATE_CHECK=1 # agent-skills-specific
204
+ export NO_UPDATE_NOTIFIER=1 # conventional, also honoured
205
+ # CI=true is auto-detected — banners never appear in CI logs
206
+ ```
207
+
208
+ ### Forcing a manual check
209
+
210
+ ```bash
211
+ # Block on a single registry fetch; print the banner if outdated
212
+ npx @chankov/agent-skills check-update
213
+
214
+ # Bypass the cache entirely
215
+ rm ~/.cache/agent-skills/latest-version.json
216
+ npx @chankov/agent-skills check-update
217
+ ```
218
+
159
219
  ## Troubleshooting
160
220
 
161
221
  - **"Could not auto-detect your coding agent."** Pass `--agent` or run
@@ -1,20 +1,74 @@
1
1
  #!/bin/bash
2
- # agent-skills session start hook
3
- # Injects the using-agent-skills meta-skill into every new session
2
+ # agent-skills session start hook (Claude Code).
3
+ #
4
+ # Two responsibilities:
5
+ # 1. Inject the using-agent-skills meta-skill into the session context so
6
+ # Claude can route tasks to the right skill.
7
+ # 2. Surface a one-line "update available" banner when the installed
8
+ # package is behind the published version on npm.
9
+ #
10
+ # Both are best-effort. Network errors, missing files, and missing tools
11
+ # never block session start — the hook always exits 0 and prints a valid
12
+ # JSON object on stdout.
4
13
 
5
14
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
- SKILLS_DIR="$(dirname "$SCRIPT_DIR")/skills"
15
+ PACKAGE_ROOT="$(dirname "$SCRIPT_DIR")"
16
+ SKILLS_DIR="$PACKAGE_ROOT/skills"
7
17
  META_SKILL="$SKILLS_DIR/using-agent-skills/SKILL.md"
18
+ CHECK_SCRIPT="$PACKAGE_ROOT/bin/cli.js"
8
19
 
20
+ # ── 1. Meta-skill content ────────────────────────────────────────────────
9
21
  if [ -f "$META_SKILL" ]; then
10
- CONTENT=$(cat "$META_SKILL")
11
- # Output as JSON for Claude Code hook consumption
12
- cat <<EOF
13
- {
14
- "priority": "IMPORTANT",
15
- "message": "agent-skills loaded. Use the skill discovery flowchart to find the right skill for your task.\n\n$CONTENT"
16
- }
17
- EOF
22
+ META_CONTENT=$(cat "$META_SKILL")
23
+ PRIORITY="IMPORTANT"
24
+ BASE_MESSAGE="agent-skills loaded. Use the skill discovery flowchart to find the right skill for your task."
18
25
  else
19
- echo '{"priority": "INFO", "message": "agent-skills: using-agent-skills meta-skill not found. Skills may still be available individually."}'
26
+ META_CONTENT=""
27
+ PRIORITY="INFO"
28
+ BASE_MESSAGE="agent-skills: using-agent-skills meta-skill not found. Skills may still be available individually."
29
+ fi
30
+
31
+ # ── 2. Update banner (silent on any error) ───────────────────────────────
32
+ UPDATE_BANNER=""
33
+ if [ "$AGENT_SKILLS_NO_UPDATE_CHECK" != "1" ] \
34
+ && [ "$NO_UPDATE_NOTIFIER" != "1" ] \
35
+ && [ "$CI" != "true" ] \
36
+ && command -v node >/dev/null 2>&1 \
37
+ && [ -f "$CHECK_SCRIPT" ]; then
38
+ # Run with a 3-second wall-clock cap so a hung registry never stalls the
39
+ # session. The check-update subcommand emits the banner on stdout when an
40
+ # upgrade is available, nothing otherwise. Errors go to /dev/null.
41
+ if command -v timeout >/dev/null 2>&1; then
42
+ UPDATE_BANNER=$(timeout 3 node "$CHECK_SCRIPT" check-update 2>/dev/null || true)
43
+ else
44
+ UPDATE_BANNER=$(node "$CHECK_SCRIPT" check-update 2>/dev/null || true)
45
+ fi
46
+ fi
47
+
48
+ # ── Compose the message ──────────────────────────────────────────────────
49
+ FULL_MESSAGE="$BASE_MESSAGE"
50
+ if [ -n "$UPDATE_BANNER" ]; then
51
+ FULL_MESSAGE=$(printf '%s\n\n%s' "$FULL_MESSAGE" "$UPDATE_BANNER")
52
+ fi
53
+ if [ -n "$META_CONTENT" ]; then
54
+ FULL_MESSAGE=$(printf '%s\n\n%s' "$FULL_MESSAGE" "$META_CONTENT")
55
+ fi
56
+
57
+ # ── Emit JSON (node handles escaping correctly) ──────────────────────────
58
+ if command -v node >/dev/null 2>&1; then
59
+ printf '%s' "$FULL_MESSAGE" | node -e '
60
+ let msg = "";
61
+ process.stdin.setEncoding("utf8");
62
+ process.stdin.on("data", c => { msg += c; });
63
+ process.stdin.on("end", () => {
64
+ process.stdout.write(JSON.stringify({
65
+ priority: process.env.PRIORITY || "INFO",
66
+ message: msg,
67
+ }) + "\n");
68
+ });
69
+ '
70
+ else
71
+ # Fallback: ship just the base message with minimal escaping.
72
+ SAFE_MSG=$(printf '%s' "$BASE_MESSAGE" | sed 's/\\/\\\\/g; s/"/\\"/g')
73
+ printf '{"priority": "%s", "message": "%s"}\n' "$PRIORITY" "$SAFE_MSG"
20
74
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chankov/agent-skills",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Production-grade engineering skills for AI coding agents. Ships skills, agent personas, slash commands, and pi extensions, with a thin CLI that hands off to the LLM-driven guided setup.",
5
5
  "keywords": [
6
6
  "ai",
@@ -168,7 +168,7 @@ Groups, in order:
168
168
  7. **Agent personas — writeable** — `builder`, `documenter`
169
169
  8. **Agent personas — read-only** (carry `tools: read,bash,grep,find,ls` and an explicit "Do NOT modify files." rule) — `code-reviewer` ★, `test-engineer` ★, `security-auditor`, `planner`, `plan-reviewer`, `scout`
170
170
  9. **Commands / prompts** (mapped to the chosen agent — items without a per-agent source are filtered out, no cross-tool substitution) — full candidate list: `spec` ★, `plan` ★, `build` ★, `test` ★, `review` ★, `code-simplify`, `ship`, `design-agent`, `prime`. The actual menu shows only items whose per-agent source file exists — for example, `.pi/prompts/design-agent.md` and `.pi/prompts/prime.md` are absent, so neither is offered when the agent is `pi`. *(`setup` and `doctor` are installer-only — never offered, since they live in the source agent-skills repo and act on target workspaces from there.)*
171
- 10. **pi extensions** *(pi only — always-on once installed)* — `mcp-bridge`, `chrome-devtools-mcp`, `compact-and-continue`
171
+ 10. **pi extensions** *(pi only — always-on once installed)* — `mcp-bridge`, `chrome-devtools-mcp`, `compact-and-continue`, `agent-skills-update-check` ★
172
172
  11. **pi harnesses — UI / status** *(pi only, mutually exclusive at runtime — install many, load one)* — `minimal`, `tool-counter`, `tool-counter-widget`, `session-replay`, `subagent-widget`
173
173
  12. **pi harnesses — discipline / focus** *(pi only)* — `purpose-gate`, `tilldone`, `system-select`
174
174
  13. **pi harnesses — safety** *(pi only)* — `damage-control`, `damage-control-continue`