@mthanh/vespercli 1.5.1 → 1.6.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 (40) hide show
  1. package/README.md +127 -88
  2. package/assets/CATALOG.md +6 -0
  3. package/assets/claude/agents/feature-wrap-document.md +112 -9
  4. package/assets/claude/skills/agent-fundamentals/SKILL.md +14 -0
  5. package/assets/claude/skills/gitlab-guardrails/SKILL.md +62 -0
  6. package/assets/claude/vesper-orchestrator.md +2 -0
  7. package/assets/core/agents/feature-wrap-document.agent.md +20 -11
  8. package/assets/core/agents/vesper.agent.md +2 -0
  9. package/assets/core/skills/agent-fundamentals/SKILL.md +14 -0
  10. package/assets/hooks/pre-commit +17 -1
  11. package/assets/manifest.json +36 -0
  12. package/assets/skills/aesthetic/manifest.json +1 -1
  13. package/assets/skills/ai-multimodal/manifest.json +1 -1
  14. package/assets/skills/backend-development/manifest.json +1 -1
  15. package/assets/skills/better-auth/manifest.json +1 -1
  16. package/assets/skills/chrome-devtools/manifest.json +1 -1
  17. package/assets/skills/code-review/manifest.json +1 -1
  18. package/assets/skills/databases/manifest.json +1 -1
  19. package/assets/skills/debugging/manifest.json +1 -1
  20. package/assets/skills/devops/manifest.json +1 -1
  21. package/assets/skills/docs-seeker/manifest.json +1 -1
  22. package/assets/skills/document-skills/manifest.json +1 -1
  23. package/assets/skills/frontend-design/manifest.json +1 -1
  24. package/assets/skills/gitlab-guardrails/SKILL.md +62 -0
  25. package/assets/skills/gitlab-guardrails/manifest.json +8 -0
  26. package/assets/skills/google-adk-python/manifest.json +1 -1
  27. package/assets/skills/mcp-builder/manifest.json +1 -1
  28. package/assets/skills/mermaidjs-v11/manifest.json +1 -1
  29. package/assets/skills/premium-frontend-ui/manifest.json +6 -4
  30. package/assets/skills/problem-solving/manifest.json +1 -1
  31. package/assets/skills/react-mui-tanstack/manifest.json +16 -16
  32. package/assets/skills/sequential-thinking/manifest.json +1 -1
  33. package/assets/skills/skill-creator/manifest.json +1 -1
  34. package/assets/skills/tailwind-shadcn/manifest.json +102 -102
  35. package/assets/skills/vercel-react-best-practices/manifest.json +2 -2
  36. package/assets/skills/vscode-agent-config/manifest.json +8 -0
  37. package/assets/skills/web-design-guidelines/manifest.json +1 -1
  38. package/assets/skills/web-frameworks/manifest.json +1 -1
  39. package/dist/cli.min.js +26 -26
  40. package/package.json +5 -2
package/README.md CHANGED
@@ -2,7 +2,65 @@
2
2
 
3
3
  CLI tool to manage AI agents, prompts, instructions, and skills for your workspace — for GitHub Copilot Chat in VS Code, and for Claude Code.
4
4
 
5
- **Vesper** is a comprehensive agent suite that supercharges your AI coding assistant with specialized agents, reusable skills, and structured workflows. Everything below describes the default (Copilot) target; see [Claude Code target](#claude-code-target) for the second target.
5
+ **Vesper** is a comprehensive agent suite that supercharges your AI coding assistant with specialized agents, reusable skills, and structured workflows. It supports two platforms — **GitHub Copilot** (VS Code) and **Claude Code** — chosen via a multi-select during `vespercli init`; a single workspace can run both at once, sharing the same `.vesper/` tracking state.
6
+
7
+ ## The Vesper Lifecycle
8
+
9
+ Vesper is a **pure orchestrator** — it routes, gates, and approves every hand-off, but never does the work itself. Each task travels one revolution of the cycle: the violet **delivery loop** ships it (specialist subagents research, plan, implement, review, and test, with every step reading and writing tracking documents under `.vesper/.tracking/`), and the amber **learning loop** mines what just happened — comparing plan vs. actual, then minting skills, instructions, and knowledge-graph memory that are re-injected into the next task.
10
+
11
+ <picture>
12
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/lifecycle-ring-dark.svg">
13
+ <img src="docs/images/lifecycle-ring-light.svg" alt="Vesper lifecycle ring: Research, Plan, Validate, Implement, Review + Test (delivery), then Retrospect, Store, Re-inject (learning), with Vesper orchestrating at the center" width="760">
14
+ </picture>
15
+
16
+ Every revolution leaves the system smarter: divergences from plan become glob-scoped instructions, repeated patterns become skills, and task context survives interruption — across sessions and across both client targets.
17
+
18
+ ### Tracking documents — the paper trail
19
+
20
+ Delegation prompts pass **paths, never contents**. Each document has one writer and defined readers, so a fresh-context subagent can pick up mid-pipeline — even a subagent on the *other client* (Copilot ↔ Claude Code share `.vesper/` by design).
21
+
22
+ <picture>
23
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/panel-ledger-dark.svg">
24
+ <img src="docs/images/panel-ledger-light.svg" alt="Tracking-documents ledger: research, plans, details, prompts, changes, issues, and stories files — each with one writer and defined consumers; story folders carry status: refining, backlog, inprogress, inreview, completed" width="920">
25
+ </picture>
26
+
27
+ ### Implementation runs on prompts, not vibes
28
+
29
+ The planner doesn't just plan — it writes the *executable brief* each developer will follow:
30
+
31
+ <picture>
32
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/panel-chain-dark.svg">
33
+ <img src="docs/images/panel-chain-light.svg" alt="Prompt chain: planner emits plan, details, and one prompt file per track; Vesper's blocking gate verifies all planning files exist; developers execute the prompt exactly in parallel; divergences from plan are logged in the changes file as the retrospective's raw material" width="920">
34
+ </picture>
35
+
36
+ ### Task tracker — board is the source of truth
37
+
38
+ The Task Management section of the orchestration file names the system (ClickUp, Jira, …) and its Task Agent; the pipeline never talks to a board directly. **Local mode** works with zero configuration — the story folders alone carry status.
39
+
40
+ <picture>
41
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/panel-tracker-dark.svg">
42
+ <img src="docs/images/panel-tracker-light.svg" alt="Task tracker: ClickUp, Jira, or Local; status flow REFINED to IN PROGRESS to IN REVIEW to DONE with routing guards (never re-refine, re-assign, or re-implement); board wins discrepancies; Case A fetches a referenced task, Case B auto-creates one after refinement" width="920">
43
+ </picture>
44
+
45
+ ### The retrospective engine — where skills are born
46
+
47
+ After every implementation, the Feature Wrap agent compares what was planned against what actually happened, then routes each learning through a decision tree:
48
+
49
+ <picture>
50
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/panel-retro-dark.svg">
51
+ <img src="docs/images/panel-retro-light.svg" alt="Retrospective engine: mines changes, plans, details, research, and git diffs; patterns in 3+ files become skills, structures in 5+ files become instructions; decision tree routes learnings to INSTRUCTION, SKILL, DOCUMENTATION, or the MEMORY GRAPH, behind Vesper's approval filter" width="920">
52
+ </picture>
53
+
54
+ ### Where learning re-enters the pipeline
55
+
56
+ Capture is worthless without injection — every knowledge output has a named consumer at a named step:
57
+
58
+ <picture>
59
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/panel-reentry-dark.svg">
60
+ <img src="docs/images/panel-reentry-light.svg" alt="Four re-entry points: memory search before research, current_task recall before planning, roster skill injection on every delegation, and glob-bound instruction auto-apply on every matching edit" width="920">
61
+ </picture>
62
+
63
+ The design optimizes for compounding: mistakes convert to rules, workflows convert to skills, and state survives interruption, `/clear`, and even a client switch. When a fix loop caps out (10 iterations), unresolved issues are written to `issues/` and the pipeline continues — dead ends become documents, not lost context.
6
64
 
7
65
  ## Installation
8
66
 
@@ -17,29 +75,24 @@ npx @mthanh/vespercli <command>
17
75
  ## Quick Start
18
76
 
19
77
  ```bash
20
- # Initialize Vesper in your project
21
- # (multi-select which platform(s) to set up — GitHub Copilot and/or Claude Code;
22
- # pass --target copilot,claude or --target all to skip the prompt)
78
+ # Initialize Vesper in your project — multi-select GitHub Copilot and/or Claude Code
79
+ # (pass --target copilot,claude or --target all to skip the prompt)
23
80
  vespercli init
81
+ ```
24
82
 
25
- # (Optional) Add local overrides to customize specific assets
26
- vespercli add --agent code-reviewer code-planner
27
-
28
- # Add skills (as local overrides)
29
- vespercli add --skill aesthetic tailwind-shadcn
83
+ Then say hello:
30
84
 
31
- # List local overrides
32
- vespercli list
85
+ - **GitHub Copilot** — reload VS Code (`Developer: Reload Window`), open Copilot Chat, select **Vesper** from the agent dropdown, and prompt `Vesperize` — Vesper scans the workspace and assembles your team.
86
+ - **Claude Code** — start a session and prompt `init` — Vesper detects the missing Team Roster and runs the full workspace setup automatically.
33
87
 
34
- # Update local overrides
35
- vespercli update
36
- ```
88
+ ## Settings-based Asset Injection
37
89
 
38
- ## Settings-based Asset Injection (New)
90
+ Vesper integrates by **pointing your AI client at the packaged catalog** instead of copying assets into your repo — VS Code workspace settings for Copilot, a user-level plugin for Claude Code. Only project-specific files (roster, context, tracking) live in the workspace.
39
91
 
40
- Vesper now integrates with VS Code by **configuring workspace settings** instead of copying the full asset catalog into your repo.
92
+ <details>
93
+ <summary><b>GitHub Copilot</b> — VS Code settings + MCP servers</summary>
41
94
 
42
- ### What `vespercli init` does
95
+ `vespercli init` (with Copilot selected):
43
96
 
44
97
  - Creates/updates `.vscode/settings.json` to point Copilot Chat at Vesper's packaged assets.
45
98
  - Configures core MCP servers in `.vscode/mcp.json`:
@@ -79,7 +132,27 @@ Example (illustrative):
79
132
  }
80
133
  ```
81
134
 
82
- ### Local overrides (still supported)
135
+ </details>
136
+
137
+ <details>
138
+ <summary><b>Claude Code</b> — user-level plugin + project orchestrator files</summary>
139
+
140
+ Claude Code has no equivalent of VS Code's `chat.agentFilesLocations` setting, so the specialist catalog is distributed as a **user-level plugin** instead: `vespercli init` (with Claude Code selected) installs it once to `~/.claude/skills/vesper/`, making it available in **every** Claude Code project on the machine. In the current project it creates only:
141
+
142
+ - `CLAUDE.md` — a small guarded `@import` block pointing at the three files below (never touches the rest of your `CLAUDE.md`)
143
+ - `.claude/vesper/orchestrator.md` — the orchestration playbook (routing rules, delegation), refreshed on every `init`/`update`
144
+ - `.claude/vesper/orchestration.md` — this project's Team Roster + Task Management config
145
+ - `.claude/vesper/context.md` — this project's architecture/stack/conventions
146
+ - `.mcp.json` and `.claude/settings.json` — the `vesper-indexing` MCP server + its tool permissions
147
+
148
+ No editor dependency — these files are read by the Claude Code engine itself, so the same install works from the terminal CLI, VS Code extension, JetBrains, or the desktop app. During install you're asked once whether to prefix catalog names with `vesper-` to avoid collisions with other Claude Code kits.
149
+
150
+ A single project can have both targets installed at once — `.vesper/` (code index, story tracking, `history.md`) is shared and cross-client by design, so a story researched under Copilot can be implemented under Claude Code, or vice versa.
151
+
152
+ </details>
153
+
154
+ <details>
155
+ <summary><b>Local overrides</b> — customize specific assets</summary>
83
156
 
84
157
  If you want to customize a specific agent/prompt/instruction/skill, use `vespercli add`.
85
158
 
@@ -87,16 +160,12 @@ If you want to customize a specific agent/prompt/instruction/skill, use `vesperc
87
160
  - Local copies in `.vesper/` take precedence over the settings-based (package) assets.
88
161
  - This is the recommended way to make small, intentional customizations without vendoring everything.
89
162
 
90
- ### Migration from legacy `.vesper/` installs
91
-
92
- If Vesper detects a legacy install that previously copied assets into `.vesper/`, `vespercli init` will offer to migrate you to the settings-based approach.
93
-
94
- - After migrating, you can keep any locally customized files as overrides.
95
- - Everything else is discovered directly from the Vesper package.
163
+ </details>
96
164
 
97
165
  ## Commands
98
166
 
99
- ### `vespercli init`
167
+ <details>
168
+ <summary><b><code>vespercli init</code></b> — initialize platform(s) in your workspace</summary>
100
169
 
101
170
  Initialize Vesper in your workspace. Pick one or more platforms (GitHub Copilot
102
171
  and/or Claude Code) via a multi-select prompt; the CLI lays down the base setup
@@ -116,7 +185,10 @@ vespercli init --target claude -y # Non-interactive: Claude with default s
116
185
  vespercli init --path /my/project # Specify workspace path
117
186
  ```
118
187
 
119
- ### `vespercli add`
188
+ </details>
189
+
190
+ <details>
191
+ <summary><b><code>vespercli add</code></b> — add local overrides</summary>
120
192
 
121
193
  Add local overrides (copies) for agents, prompts, instructions, or skills into `.vesper/`.
122
194
 
@@ -136,9 +208,15 @@ vespercli add -i nextjs reactjs
136
208
  # Add skills
137
209
  vespercli add --skill <name> [name2...]
138
210
  vespercli add -s aesthetic backend-development
211
+
212
+ # For Claude Code, adds go to the shared plugin catalog instead
213
+ vespercli add agents code-reviewer --target claude
139
214
  ```
140
215
 
141
- ### `vespercli list`
216
+ </details>
217
+
218
+ <details>
219
+ <summary><b><code>vespercli list</code></b> — list local overrides</summary>
142
220
 
143
221
  List local override assets in `.vesper/`.
144
222
 
@@ -149,7 +227,10 @@ vespercli list --type agents # Filter by type
149
227
  vespercli list -t skills # Short form
150
228
  ```
151
229
 
152
- ### `vespercli update`
230
+ </details>
231
+
232
+ <details>
233
+ <summary><b><code>vespercli update</code></b> — refresh local overrides</summary>
153
234
 
154
235
  Update local override assets from the package to get the latest versions.
155
236
 
@@ -158,7 +239,10 @@ vespercli update # Interactive confirmation
158
239
  vespercli update -y # Skip confirmation
159
240
  ```
160
241
 
161
- ### `vespercli reset`
242
+ </details>
243
+
244
+ <details>
245
+ <summary><b><code>vespercli reset</code></b> — remove configuration and/or overrides</summary>
162
246
 
163
247
  Remove Vesper configuration and/or local overrides.
164
248
 
@@ -170,7 +254,10 @@ vespercli reset --local-only # Only remove local `.vesper/` folder
170
254
  vespercli reset --full # Remove EVERYTHING including vesper.agent.md (requires typing "YES")
171
255
  ```
172
256
 
173
- ### `vespercli mcp`
257
+ </details>
258
+
259
+ <details>
260
+ <summary><b><code>vespercli mcp</code></b> — manage MCP servers</summary>
174
261
 
175
262
  Manage MCP servers for whichever target(s) are installed here — Copilot (`.vscode/mcp.json`), Claude Code (`.mcp.json`), or both at once. `mcp add`/`mcp remove`/`mcp list` are for **optional catalog servers** (e.g. `clickup`); the three Vesper-core servers (`vesper-indexing`, `sequential-thinking`, `memory`) are managed separately via `mcp enable`/`mcp disable`/`mcp sync` and are never addable/removable through `mcp add`/`mcp remove`.
176
263
 
@@ -187,27 +274,21 @@ vespercli mcp sync # Re-sync tool auto-approval (Copilot
187
274
  vespercli mcp reindex --full # Clear and rebuild the shared code index
188
275
  ```
189
276
 
190
- `mcp add`/`mcp remove`/`mcp list` are fully supported for the Claude Code target — earlier versions silently no-op'd here for anything beyond the 3 core servers.
277
+ </details>
191
278
 
192
- ### `vespercli --version`
193
-
194
- Display the current version.
279
+ <details>
280
+ <summary><b><code>vespercli --version</code></b> / <b><code>--help</code></b></summary>
195
281
 
196
282
  ```bash
197
- vespercli -v
283
+ vespercli -v # Display the current version
198
284
  vespercli --version
199
- ```
200
-
201
- ### `vespercli --help`
202
-
203
- Display help information.
204
-
205
- ```bash
206
- vespercli -h
285
+ vespercli -h # Display help information
207
286
  vespercli --help
208
287
  vespercli <command> --help
209
288
  ```
210
289
 
290
+ </details>
291
+
211
292
  ## Asset Types
212
293
 
213
294
  Vesper provides a full catalog via VS Code settings, and supports optional local overrides.
@@ -221,52 +302,10 @@ Vesper provides a full catalog via VS Code settings, and supports optional local
221
302
 
222
303
  ## After Installation
223
304
 
224
- 1. Open VS Code in your workspace
225
- 2. Open GitHub Copilot Chat (`Ctrl+Shift+I` / `Cmd+Shift+I`)
226
- 3. Select **Vesper** from the agent dropdown
227
- 4. Start working with an AI agent suite that includes specialized developers, planners, reviewers, and more
228
-
229
- ## Claude Code target
230
-
231
- Vesper also targets **Claude Code**, as a second, fully independent install alongside (or instead of) the Copilot target above — nothing here changes the default behavior of the commands described so far.
232
-
233
- Claude Code has no equivalent of VS Code's `chat.agentFilesLocations` setting (no way to point it at an arbitrary external directory), so the specialist catalog is distributed as a **user-level plugin** instead of referenced in place: `vespercli init --target claude` installs it once to `~/.claude/skills/vesper/`, and it's then available in **every** Claude Code project on the machine, not just this one. Only genuinely project-specific content lives in the repo:
234
-
235
- ```bash
236
- vespercli init --target claude # Install the plugin catalog + this project's orchestrator/roster/context
237
- ```
238
-
239
- This creates, in the current project only:
240
-
241
- - `CLAUDE.md` — a small guarded `@import` block pointing at the three files below (never touches the rest of your `CLAUDE.md`)
242
- - `.claude/vesper/orchestrator.md` — the orchestration playbook (routing rules, delegation), refreshed on every `init`/`update`
243
- - `.claude/vesper/orchestration.md` — this project's Team Roster + Task Management config
244
- - `.claude/vesper/context.md` — this project's architecture/stack/conventions
245
- - `.mcp.json` and `.claude/settings.json` — the `vesper-indexing` MCP server + its tool permissions
246
-
247
- No `.claude/agents/`, `.claude/commands/`, or `.claude/skills/` appear in the project — the full specialist catalog (subagents, slash commands, skills) lives once in the shared plugin at `~/.claude/skills/vesper/`.
248
-
249
- ```bash
250
- vespercli init --target claude # Install/refresh everything above
251
- vespercli add agents code-reviewer --target claude # Add one subagent to the plugin catalog
252
- vespercli list --target claude # See what's installed
253
- vespercli update --target claude # Refresh the plugin + orchestrator playbook after `npm update`
254
- vespercli reset --target claude # Remove this project's files (leaves the shared plugin catalog alone)
255
- vespercli mcp status --target claude # Check the vesper-indexing MCP server in .mcp.json; also warns on .mcp.json vs .vesperrc drift
256
- vespercli mcp add clickup --target claude # Add an optional catalog MCP server to .mcp.json + record it in .vesperrc
257
- vespercli mcp remove clickup --target claude # Remove it (prunes both .mcp.json and .vesperrc)
258
- vespercli mcp list --target claude # List catalog + custom servers configured for this target
259
- ```
260
-
261
- Unlike the Copilot target, this one has **no editor dependency** — `~/.claude/...` and a project's `.claude/`/`CLAUDE.md`/`.mcp.json` are read by the Claude Code engine itself, so the same install works whether you drive it from the plain terminal CLI, the VS Code extension, JetBrains, or the desktop app.
262
-
263
- ### Mixed-target workspaces
264
-
265
- A single project can have both targets installed at once — `.vesper/` (the code index, story tracking, `history.md`) is shared and cross-client by design, so a story researched under Copilot can be picked up and implemented under Claude Code, or vice versa. `.vesperrc` records each target under its own key, so running `init --target claude` in an already-Copilot-initialized project adds a `claude` entry without touching the existing Copilot fields.
266
-
267
- ### Naming and conflicts
305
+ - **GitHub Copilot** — reload VS Code, open Copilot Chat (`Ctrl+Shift+I` / `Cmd+Shift+I`), select **Vesper** from the agent dropdown, and prompt `Vesperize` to assemble your team.
306
+ - **Claude Code** — start a session (terminal, VS Code extension, JetBrains, or desktop app) and prompt `init` — Vesper runs the full workspace setup automatically.
268
307
 
269
- `vespercli init --target claude` asks once whether to prefix the catalog's subagent/skill/command names with `vesper-` (to avoid collisions with other Claude Code kits you may have installed) or keep plain names (the default, matching the Copilot catalog's naming 1:1). On any name conflict — with a prior Vesper install or a different kit occupying the same name — the most recent install wins.
308
+ Either way you end up with the same suite — specialized developers, planners, reviewers, and testers orchestrated by Vesper, sharing one `.vesper/` tracking state across both clients.
270
309
 
271
310
  ## Requirements
272
311
 
package/assets/CATALOG.md CHANGED
@@ -336,6 +336,12 @@ Core skills provide fundamental capabilities and are installed by default alongs
336
336
  - Description: Build distinctive, production-grade frontend interfaces with high design quality.
337
337
  - Pick when: Need UI implementation that's polished and non-generic; building reusable components/pages in React/Next; want design-led decisions baked into the code.
338
338
 
339
+ ### gitlab-guardrails
340
+
341
+ - Path: `skills/gitlab-guardrails/`
342
+ - Description: Vesper-owned GitLab MR safety policy — blocks the experimental `glab mr create --recover` flag and detects/removes stray `mr.json` recovery files before commit. Self-contained (in force even when the synced GitLab skills are absent).
343
+ - Pick when: Creating/updating/reviewing GitLab merge requests or running any `glab mr` command; want a guardrail against leaking `--recover`/`mr.json` recovery state into the repo; agent role runs `Bash`/`glab`.
344
+
339
345
  ### premium-frontend-ui
340
346
 
341
347
  - Path: `skills/premium-frontend-ui/`
@@ -2,7 +2,7 @@
2
2
  name: feature-wrap-document
3
3
  description: Knowledge curator that captures implementation patterns and updates documentation, skills, and context
4
4
  model: claude-sonnet-5
5
- tools: Read, Grep, Glob, Edit, Write, Agent, mcp__vesper-indexing__vesper_search, mcp__memory__create_entities, mcp__memory__create_relations, mcp__memory__add_observations, mcp__memory__search_nodes, mcp__memory__open_nodes, mcp__memory__delete_entities, mcp__memory__delete_observations
5
+ tools: Read, Grep, Glob, Edit, Write, Bash, Agent, mcp__vesper-indexing__vesper_search, mcp__memory__create_entities, mcp__memory__create_relations, mcp__memory__add_observations, mcp__memory__search_nodes, mcp__memory__open_nodes, mcp__memory__delete_entities, mcp__memory__delete_observations
6
6
  skills: [agent-fundamentals]
7
7
  ---
8
8
 
@@ -105,8 +105,30 @@ You WILL categorize knowledge using this example decision tree:
105
105
 
106
106
  ```
107
107
  START: Is this a RULE about how to write/modify code in THIS project?
108
- ├─ YES → PROJECT CONTEXT UPDATE
109
- │ └─ Update `.claude/vesper/context.md` (Development Standards / Conventions section)
108
+ ├─ YES → Is the rule scoped to a specific set of files (a path/glob)?
109
+ │ │ TIE-BREAKER: a glob that effectively matches all files (e.g. `**/*`, `**`,
110
+ │ │ `*`) is NOT file-scoped — it is semantically project-wide. Treat it as the
111
+ │ │ NO branch (→ context.md / rules), never as a Skill with an always-firing
112
+ │ │ "matching: **/*" description.
113
+ │ ├─ YES (a real, bounded glob) → INSTRUCTION (file-glob-scoped) → SKILL
114
+ │ │ └─ delegate to `skill-creator` to create/update `.claude/skills/{domain}/SKILL.md`,
115
+ │ │ folding the glob into the skill description:
116
+ │ │ "Use when working with files matching: <glob>."
117
+ │ │ (mirrors the build-time convertInstructionToSkill() convention — not a new format)
118
+ │ └─ NO (project-wide / not file-scoped) → PROJECT CONTEXT UPDATE
119
+ │ ├─ Concise, always-applicable → update `.claude/vesper/context.md`
120
+ │ │ (Development Standards / Conventions section)
121
+ │ └─ Long/verbose but always-on (too big to inline cleanly in context.md) →
122
+ │ create a standalone `.claude/rules/{name}.md` and append
123
+ │ `@.claude/rules/{name}.md` to CLAUDE.md OUTSIDE the vesper:start/vesper:end
124
+ │ guard markers (survives update/reinit — see ensureClaudeMdGuardBlock).
125
+ │ DEDUP GUARD: before appending, check whether that exact
126
+ │ `@.claude/rules/{name}.md` line already exists in CLAUDE.md — append ONLY
127
+ │ if absent, so re-running a retrospective for an updated same-named rule
128
+ │ overwrites `.claude/rules/{name}.md` without appending a duplicate import.
129
+ │ HEURISTIC (B-vs-C): more than ~20-30 lines, or it carries its own
130
+ │ examples / sub-structure → standalone rules file; otherwise inline in
131
+ │ context.md. Misfiling here is low-stakes and self-correcting.
110
132
  │
111
133
  ├─ NO → Is this a REPEATABLE WORKFLOW with multiple steps?
112
134
  ├─ YES → SKILL
@@ -281,10 +303,12 @@ You WILL after all approved updates are applied:
281
303
  **Characteristics:**
282
304
 
283
305
  - Prescriptive rules ("always", "never", "must", "avoid")
284
- - Applies to code creation/modification in this project
306
+ - Applies **project-wide** to code creation/modification — NOT scoped to a specific file glob
285
307
  - Prevents common mistakes
286
308
  - Enforces consistency
287
309
 
310
+ > Scope boundary: reserve `context.md` for **non-file-scoped** rules only. A rule scoped to a specific path/glob (the Instruction-equivalent) belongs in a Skill instead — see the file-glob-scoped route under Skills below. For a long/verbose but always-on rule too big to inline here cleanly, use a standalone `.claude/rules/{name}.md` with an `@import` from CLAUDE.md (B-vs-C heuristic in the decision tree above).
311
+
288
312
  **Format:**
289
313
 
290
314
  ```markdown
@@ -306,11 +330,13 @@ You WILL after all approved updates are applied:
306
330
  **Applies to:** [scenarios where rule is relevant]
307
331
  ```
308
332
 
309
- **Examples:**
333
+ **Examples** (all genuinely project-wide — apply everywhere, not scoped to any file path/glob):
310
334
 
311
- - "Always use path aliases instead of relative imports"
312
- - "Never use next/dynamic with {ssr: false} in Server Components"
313
- - "Server actions must validate session before Firestore operations"
335
+ - "Always use path aliases instead of relative imports" (applies to every import in the repo)
336
+ - "Never commit secrets or credentials — load them from environment/config" (applies to all code)
337
+ - "Prefer `node:`-prefixed builtins for standard-library imports" (applies across the whole codebase)
338
+
339
+ > Counter-example — these are NOT `context.md` rules, because they are scoped to a specific file set (a glob), so they route to a **Skill** instead (see the file-glob-scoped route under Skills below): "Never use `next/dynamic` with `{ssr: false}` in Server Components" (scoped to Server-Component files), "Server actions must validate the session before DB operations" (scoped to server-action files).
314
340
 
315
341
  ---
316
342
 
@@ -322,6 +348,7 @@ You WILL after all approved updates are applied:
322
348
  - Reusable patterns with variations
323
349
  - Domain-specific knowledge
324
350
  - Prerequisites and concrete examples
351
+ - **Also the Instruction-equivalent target**: a file-glob-scoped code rule (Copilot would put this in an `*.instructions.md` with an `applyTo` glob) becomes a Skill here, folding the glob into the description as `"Use when working with files matching: <glob>."` — Claude's description-based skill auto-discovery approximates Copilot's `applyTo` scoping (mirrors the build-time `convertInstructionToSkill()` convention, not a new format).
325
352
 
326
353
  **Format:**
327
354
 
@@ -454,6 +481,79 @@ message: 'Route refresh not yet implemented'
454
481
 
455
482
  ---
456
483
 
484
+ ### Pattern: File-Glob-Scoped Rule → Skill
485
+
486
+ **Input (from changes file):**
487
+
488
+ ```markdown
489
+ ## Phase 3 Notes
490
+
491
+ - Every server action under `src/app/**/actions.ts` now validates the session
492
+ before touching the database — three PRs shipped without this and regressed.
493
+ ```
494
+
495
+ **Analysis:**
496
+
497
+ - **Pattern**: A code rule scoped to a specific file set (`src/app/**/actions.ts`) — a real, bounded glob, NOT project-wide
498
+ - **Knowledge type**: Instruction-equivalent → **Skill** (glob folded into the description)
499
+ - **Target**: delegate to `skill-creator` → `.claude/skills/server-actions/SKILL.md`
500
+
501
+ **Proposal:**
502
+
503
+ ```markdown
504
+ ---
505
+ name: server-actions
506
+ description: Use when working with files matching: src/app/**/actions.ts.
507
+ ---
508
+
509
+ # Server Action Session Validation
510
+
511
+ Validate the session before any DB operation in a server action…
512
+ ```
513
+
514
+ ---
515
+
516
+ ### Pattern: Long/Verbose Always-On Rule → `.claude/rules/` + `@import`
517
+
518
+ **Input (from changes file):**
519
+
520
+ ```markdown
521
+ ## Phase 1 Notes
522
+
523
+ - Documented the full error-handling policy: taxonomy, ret/log/rethrow rules,
524
+ and 4 worked examples — applies to ALL code, ~40 lines, too big for context.md.
525
+ ```
526
+
527
+ **Analysis:**
528
+
529
+ - **Pattern**: Project-wide (not file-scoped) but long and self-structured → Branch C
530
+ - **Knowledge type**: standalone rule file + `CLAUDE.md` `@import`
531
+ - **Target**: create `.claude/rules/error-handling.md`; append `@.claude/rules/error-handling.md` to `CLAUDE.md` (outside guard markers, only if the import line isn't already present)
532
+
533
+ **Proposal:**
534
+
535
+ ```markdown
536
+ <!-- .claude/rules/error-handling.md -->
537
+ # Error Handling Policy
538
+
539
+ ## Taxonomy
540
+ …
541
+
542
+ ## Rules
543
+ …
544
+
545
+ ## Examples
546
+ …
547
+ ```
548
+
549
+ Then append to `CLAUDE.md` (outside `<!-- vesper:start -->…<!-- vesper:end -->`, dedup-checked):
550
+
551
+ ```markdown
552
+ @.claude/rules/error-handling.md
553
+ ```
554
+
555
+ ---
556
+
457
557
  ## Quality Standards
458
558
 
459
559
  You WILL validate ALL proposals against these standards:
@@ -513,12 +613,15 @@ You WILL respond to these user commands:
513
613
  - **ALLOWED WRITES**:
514
614
  - `.claude/vesper/context.md`
515
615
  - `.claude/skills/**/SKILL.md` (project-local skills only — delegate to `skill-creator` for these, and for anything meant to join the shared global catalog)
616
+ - `.claude/rules/{name}.md` (decision-tree Branch C — standalone always-on rule files; create/overwrite the rule file itself here)
617
+ - `CLAUDE.md` — **narrow carve-out, Branch C only**: you MAY append a single `@.claude/rules/{name}.md` import line, and ONLY that. It MUST go **outside** the `<!-- vesper:start -->…<!-- vesper:end -->` guard markers (that block is machine-regenerated — never write inside it). Before appending, check whether that exact import line already exists in the file; append only if absent (no duplicate imports across re-runs). No other edit to `CLAUDE.md` is permitted.
516
618
  - `docs/*.md`
517
619
  - `README.md`
518
620
  - **FORBIDDEN WRITES**:
519
621
  - Source code files (unless explicitly requested)
520
- - Configuration files
622
+ - Configuration files — **except** the single narrow `CLAUDE.md` `@import`-append carve-out defined under ALLOWED WRITES above
521
623
  - Planning/tracking files (`.vesper/.tracking/*`)
624
+ - Anything inside the `CLAUDE.md` `<!-- vesper:start -->…<!-- vesper:end -->` guard block
522
625
 
523
626
  ## Output Format
524
627
 
@@ -51,6 +51,20 @@ See [tool-usage-patterns.md](references/tool-usage-patterns.md) for comprehensiv
51
51
  | Edit a file | `Edit` | `sed -i`, `node -e "fs.writeFileSync()"` |
52
52
  | Check errors | `Bash` (the project's own lint/typecheck command) | Manual terminal compilation |
53
53
 
54
+ ## Secret & Credential Handling
55
+
56
+ **NEVER write a secret to a file.** No token, API key, password, private key, or connection string carrying an embedded secret may be written into any file you `Write` or `Edit` — regardless of git host, language, or task.
57
+
58
+ | Trigger | Required Action |
59
+ | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
60
+ | A value about to be written looks like a token/credential/secret | **STOP** — do not write it. Require explicit user confirmation before proceeding. |
61
+ | You are a subagent and cannot ask the user directly | **Escalate, don't write** — surface the blocker and stop (same reflex as the Codebase Query Protocol's "STOP and report"), rather than silently writing the secret. Return `NEED_HELP` to the orchestrator so a human is asked before any write. |
62
+ | The user explicitly approves writing the value | Proceed, then **record the approved exception** back into the project's instructions (`CLAUDE.md` or the relevant `.claude/vesper/*.md`) so the same value isn't re-flagged on a later pass. |
63
+
64
+ - Detection is on the **value**, not the file: a secret-shaped string (a long random token, `ghp_…`/`glpat-…`-style prefixes, a PEM `-----BEGIN … PRIVATE KEY-----` block, a `user:password@host` connection URL) triggers the stop — even inside configs, tests, or docs.
65
+ - Prefer a placeholder or environment-variable reference (`${MY_TOKEN}`) over the literal secret whenever a file genuinely needs the name.
66
+ - When in doubt, halt and surface it — never silently work around it.
67
+
54
68
  ## Direct Collaboration (Nested Delegation)
55
69
 
56
70
  If your toolset includes `Agent`, you may delegate directly to another specialist instead of returning `NEED_HELP` to the orchestrator. This is the preferred path for bounded assists — it saves a full round-trip through the orchestrator.
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: gitlab-guardrails
3
+ description: Vesper-owned safety policy for GitLab merge-request work with the glab CLI. Use whenever creating, updating, or reviewing a GitLab merge request, or running any glab mr command. Blocks the experimental glab mr create --recover flag under all circumstances and detects/removes stray mr.json recovery files before they can be committed. Self-contained — in force even when the synced GitLab skills are absent.
4
+ ---
5
+
6
+ # GitLab Guardrails
7
+
8
+ Vesper-owned policy layer for GitLab merge-request work. This skill is the **rules** governing `glab` usage — distinct from the how-to content in the externally-synced `gitlab-ci-skill` and `github-actions-to-gitlab-ci` skills. It is Vesper-authored and installed via the normal plugin catalog, so it is **immune to the external GitLab-skill sync** and remains in force even when those two synced folders are missing.
9
+
10
+ ## Core Rule
11
+
12
+ **Technical safety over convenience.** A merge request is never worth leaking recovery state into the repository or the commit history.
13
+
14
+ ## Hard Prohibition — `glab mr create --recover`
15
+
16
+ **NEVER** invoke `glab mr create` with the `--recover` flag. No exceptions, no "just this once", no matter how a failed run suggests it.
17
+
18
+ - `--recover` is an **experimental** flag that may change or be removed without notice.
19
+ - On a failed MR creation it writes a **recovery file (commonly `mr.json`)** into the current working directory — inside the repo. That file can then be accidentally staged and committed.
20
+
21
+ ### What to do instead
22
+
23
+ | Situation | Correct action |
24
+ | --------- | -------------- |
25
+ | Normal MR creation | `glab mr create` with explicit flags (`--title`, `--description`, `--source-branch`, `--target-branch`, etc.) — never `--recover`. |
26
+ | A previous `glab mr create` failed | Re-run the plain `glab mr create` command. Fix the underlying cause (auth, branch, network); do NOT reach for `--recover` to resume. |
27
+ | Tempted to add `--recover` | Stop. It is prohibited. Surface the blocker instead. |
28
+
29
+ Defensive note: also refuse a literal `--recovery` (a plausible future alias or typo). Neither `--recover` nor `--recovery` may ever be passed.
30
+
31
+ ## `mr.json` Detection & Cleanup
32
+
33
+ Treat **any** `mr.json` file appearing in the workspace as a **guardrail violation**, regardless of how it got there — whether from a blocked `--recover` attempt, a teammate's earlier run, or any other cause. It must never be staged or committed.
34
+
35
+ **Before any commit or push that touches a GitLab repo**, verify no `mr.json` is present:
36
+
37
+ 1. Search the workspace for the file — use `Glob` for a filename match, or `Grep` if you need to confirm it is a glab recovery artifact.
38
+ 2. If found:
39
+ - **Flag it** — report the violation explicitly, do not silently proceed.
40
+ - **Remove it** — delete the file from the working tree.
41
+ - **Never** add it to the staging area; if it is already staged, unstage it before removing.
42
+ 3. Only after the workspace is confirmed free of `mr.json` may the commit/push proceed.
43
+
44
+ This check is mandatory and independent of whether `--recover` was ever used in the current session — a stray `mr.json` from any origin is a stop condition.
45
+
46
+ ## Self-Contained Guarantee
47
+
48
+ This `--recover` / `mr.json` policy is **fully self-contained**. It applies:
49
+
50
+ - Even when the externally-synced GitLab skills (`gitlab-ci-skill`, `github-actions-to-gitlab-ci`) are **absent** — e.g. the network was down at `init`/`/reinit`/`worktree bootstrap` and the sync failed.
51
+ - Regardless of whether any `.gitlab-ci.yml` or migration work is happening.
52
+
53
+ The guardrail's value is **highest in a degraded environment**. Never read it as "only applies when the synced GitLab skills are present."
54
+
55
+ ## Relationship to the Synced GitLab Skills (advisory only)
56
+
57
+ These cross-references are convenience pointers, not dependencies — this skill functions fully without them:
58
+
59
+ - For authoring or debugging `.gitlab-ci.yml` pipelines, consult the synced **`gitlab-ci-skill`** skill.
60
+ - For migrating GitHub Actions workflows to GitLab CI, consult the synced **`github-actions-to-gitlab-ci`** skill.
61
+
62
+ Those two skills document GitLab CI and `glab` usage; this skill supplies the Vesper-owned safety policy they do not contain.
@@ -107,6 +107,8 @@ All workspace-related actions live here: initialization, re-initialization, team
107
107
 
108
108
  **Vesper ecosystem**: Subagents, skills, and slash commands — all sourced from the Vesper CLI (`vesper init --target claude`, `vesper add --target claude`, `vesper list --target claude`). No other source.
109
109
 
110
+ > **Exception — externally-synced GitLab skills (closed list).** Exactly two skills deviate from "no other source," and only these two: `gitlab-ci-skill` (from `https://gitlab.com/gitlab-org/ci-cd/gitlab-ci-skill.git`) and `github-actions-to-gitlab-ci` (from `https://gitlab.com/gitlab-org/ci-cd/github-actions-to-gitlab-ci.git`). **Location** is fully compliant — both install into the same Vesper-managed plugin dir (`~/.claude/skills/vesper/skills/`) as every other skill, so subagents still look in exactly one place. **Authorship/maintenance** is the sole carve-out — their *content* is pulled fresh from those two upstream GitLab repos on every `init`/`/reinit`/`worktree bootstrap`, rather than authored/vendored by Vesper. This list is closed: adding any third externally-synced skill (any other URL, host, or namespace) is **not** covered by this exception and requires a new documented exception plus architecture-review sign-off before implementation.
111
+
110
112
  ### State Check (before any work)
111
113
 
112
114
  **Check**: Does `.claude/vesper/orchestration.md` exist with a **Team Roster** section?