showdar-skills 0.2.3 → 0.4.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 (50) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/MIGRATION.md +75 -0
  3. package/README.md +204 -25
  4. package/bin/showdar.js +30 -7
  5. package/commands/opencode/showdar/skill.md +1 -1
  6. package/package.json +5 -2
  7. package/skills/showdar-bugfix/SKILL.md +115 -0
  8. package/skills/showdar-feature/SKILL.md +119 -0
  9. package/skills/showdar-incident/SKILL.md +119 -0
  10. package/skills/showdar-release/SKILL.md +117 -0
  11. package/src/adapters.js +20 -3
  12. package/src/capabilities.js +93 -0
  13. package/src/capability-score.js +82 -0
  14. package/src/catalog.js +58 -16
  15. package/src/evidence-state.js +526 -0
  16. package/src/intent-resolver/composition.js +1080 -0
  17. package/src/intent-resolver/confidence.js +71 -0
  18. package/src/intent-resolver/constraints.js +138 -0
  19. package/src/intent-resolver/evidence.js +182 -0
  20. package/src/intent-resolver/frame/action-frame.js +380 -0
  21. package/src/intent-resolver/frame/authority/adjudicator.js +104 -0
  22. package/src/intent-resolver/frame/authority/candidate.js +227 -0
  23. package/src/intent-resolver/frame/authority/diagnostics.js +58 -0
  24. package/src/intent-resolver/frame/authority/evidence.js +241 -0
  25. package/src/intent-resolver/frame/authority/index.js +166 -0
  26. package/src/intent-resolver/frame/authority/projectors.js +198 -0
  27. package/src/intent-resolver/frame/authority/relations.js +61 -0
  28. package/src/intent-resolver/frame/authority/shadow.js +51 -0
  29. package/src/intent-resolver/frame/authority/types.js +14 -0
  30. package/src/intent-resolver/frame/clause-frame.js +205 -0
  31. package/src/intent-resolver/frame/projectors/constraints.js +332 -0
  32. package/src/intent-resolver/frame/projectors/metadata.js +514 -0
  33. package/src/intent-resolver/frame/relations.js +242 -0
  34. package/src/intent-resolver/frame/request-frame.js +187 -0
  35. package/src/intent-resolver/frame/surface-map.js +450 -0
  36. package/src/intent-resolver/index.js +476 -0
  37. package/src/intent-resolver/mutation.js +634 -0
  38. package/src/intent-resolver/object.js +191 -0
  39. package/src/intent-resolver/risks.js +202 -0
  40. package/src/intent-resolver/scoring.js +630 -0
  41. package/src/intent-resolver/secondary.js +343 -0
  42. package/src/intent-resolver/segments.js +576 -0
  43. package/src/intent-resolver/signals.js +435 -0
  44. package/src/intent-resolver.js +8 -0
  45. package/src/intent.js +81 -0
  46. package/src/project.js +61 -1
  47. package/src/route-plan.js +100 -0
  48. package/src/validate.js +25 -3
  49. package/src/verification-budget.js +182 -0
  50. package/src/verification-executor.js +515 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.4.0]
10
+
11
+ ### Added
12
+
13
+ - First-class workflow skill model: 15 primitives (`kind: primitive`) plus 4
14
+ workflows (`kind: workflow`) for 19 total installable skills.
15
+ - `showdar-feature`: adaptive end-to-end feature implementation over
16
+ understand, requirements, plan, design, build, test, and review stages.
17
+ - `showdar-bugfix`: adaptive defect resolution over understand, debug, build,
18
+ test, and review stages, including investigation-only mode.
19
+ - `showdar-release`: release readiness versus execution separation over
20
+ quality, security, ship, and authority-gated ops stages.
21
+ - `showdar-incident`: operational incident investigation and recovery over
22
+ understand, debug, recover, verification, and authority-gated ops stages.
23
+ - `showdar add feature|bugfix|release|incident` installs workflows through the
24
+ existing installer; short names normalize like primitives.
25
+ - Workflow composition and safety validation: stage references resolve to
26
+ known primitives, workflows never stage another workflow or themselves,
27
+ and workflow SKILL.md files stay lean by referencing primitives.
28
+
29
+ ### Changed
30
+
31
+ - Catalog distinguishes primitive and workflow skills; `getSkill` and
32
+ `normalizeSkillName` resolve all 19 installable skills.
33
+ - `showdar validate` reports primitive/workflow/total counts
34
+ (`15 primitives, 4 workflows, 19 total`).
35
+ - `showdar add` normalization supports workflow IDs and short names.
36
+ - OpenCode `skill.md` command lists all 19 skills with a whole-task versus
37
+ single-primitive selection guard.
38
+ - AGENTS.md managed routing block includes workflow routes when installed.
39
+
40
+ ## [0.3.0]
41
+
42
+ ### Added
43
+
44
+ - Explicit harness targets for `showdar init` and `showdar add`: `codex`,
45
+ `opencode`, `cursor`, `claude`, `universal`, and `all`.
46
+ - `showdar add <skill>` for installing a single primitive skill without
47
+ re-running a whole profile (for example `showdar add debug`,
48
+ `showdar add security --ai cursor`,
49
+ `showdar add review --scope global --ai claude`).
50
+ - Native Cursor skill roots (`.cursor/skills` for projects,
51
+ `~/.cursor/skills` for global installs).
52
+ - Deny-by-default routing authority coverage for conditional, modal,
53
+ contextual, hypothetical, and negated actions.
54
+
55
+ ### Changed
56
+
57
+ - Each harness target now installs into its native skill directory instead of
58
+ sharing one compatibility root.
59
+ - Routing uses a single authoritative engine: current request → structural
60
+ interpretation → authority classification → primary capability → skill.
61
+ - Context, log, and example text no longer becomes requested work on its own;
62
+ conditional and hypothetical actions stay non-authoritative until current
63
+ request semantics permit them.
64
+ - Risk metadata no longer overrides an explicit governing action.
65
+
66
+ ### Fixed
67
+
68
+ - Conditional, modal, context, and negation authority safety cases.
69
+ - Security-risk ownership cases where risk signals previously stole primary
70
+ ownership from the governing action.
71
+ - Debug, upgrade, build, and test imperative recognition for explicit
72
+ governing requests.
73
+
74
+ ### Removed
75
+
76
+ - The executable legacy 6F authority engine and the old route-scoring path.
77
+
78
+ ## [0.2.3]
79
+
80
+ See git history for changes before the 0.3.0 changelog was started.
package/MIGRATION.md ADDED
@@ -0,0 +1,75 @@
1
+ # Migrating to 0.4.0
2
+
3
+ 0.4.0 adds four optional workflow skills over the unchanged 15 primitives:
4
+
5
+ ```bash
6
+ showdar add feature
7
+ showdar add bugfix
8
+ showdar add release
9
+ showdar add incident
10
+ ```
11
+
12
+ - 0.3.0 `.showdar.json` v2 configs remain valid; no config-version migration
13
+ is required.
14
+ - All 15 primitive IDs remain unchanged.
15
+ - Profile behavior and composition are unchanged: `minimal` (8), `developer`
16
+ (12), `backend` (14), `qa` (9), `product` (6), `full` (15 primitives).
17
+ - Workflows are additive and optional; they complement rather than replace
18
+ primitives. Nothing is removed.
19
+ - No Phase 6G routing migration is required; the authority engine and the
20
+ 15-capability primitive taxonomy are unchanged.
21
+ - Single primitive requests keep resolving to primitives; whole-task or
22
+ lifecycle requests may select a workflow.
23
+
24
+ # Migrating to 0.3.0
25
+
26
+ ## Skill install roots
27
+
28
+ `--ai universal` still installs to `.agents/skills` (project) and
29
+ `~/.agents/skills` (global). Explicit harness targets now use their native
30
+ roots:
31
+
32
+ - OpenCode: `.opencode/skills` / `~/.config/opencode/skills`
33
+ - Cursor: `.cursor/skills` / `~/.cursor/skills`
34
+ - Claude Code: `.claude/skills` / `~/.claude/skills`
35
+ - Codex: `.agents/skills` / `~/.agents/skills`
36
+
37
+ One invocation installs to one resolved root only; no compatibility copies
38
+ are made automatically.
39
+
40
+ ## Existing projects
41
+
42
+ Existing `.showdar.json` v2 configs remain valid. No config-version migration
43
+ is required. Re-running `showdar init` with an explicit `--ai` target moves
44
+ managed skills to the newly requested native root; the previous root is not
45
+ silently deleted unless existing Showdar stale-cleanup semantics apply.
46
+
47
+ ## Profiles
48
+
49
+ Profile names and composition are unchanged:
50
+
51
+ - `minimal` (8), `developer` (12), `backend` (14), `qa` (9), `product` (6),
52
+ `full` (15).
53
+ - `mobile` and `web` remain accepted as deprecated aliases for `developer`;
54
+ manifests store the canonical name.
55
+
56
+ ## Single-skill additions
57
+
58
+ Use `showdar add <skill>` instead of re-running a larger profile to add one
59
+ skill:
60
+
61
+ ```bash
62
+ showdar add debug
63
+ showdar add security --ai cursor
64
+ showdar add review --scope global --ai claude
65
+ ```
66
+
67
+ Additions preserve the configured profile and are idempotent.
68
+
69
+ ## Routing behavior
70
+
71
+ 0.3.0 uses stricter deny-by-default authority semantics. Conditional,
72
+ hypothetical, contextual, and negated actions stay non-authoritative until
73
+ current request semantics permit them, and risk metadata no longer overrides
74
+ an explicit governing action. Do not assume byte-identical routing with older
75
+ releases where behavior intentionally tightened.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/showdar-skills?logo=npm)](https://www.npmjs.com/package/showdar-skills)
4
4
  [![Node >=20](https://img.shields.io/badge/node-%3E%3D20-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
5
5
  [![MIT License](https://img.shields.io/badge/license-MIT-blue?logo=opensourceinitiative&logoColor=white)](./LICENSE)
6
- [![15 skills](https://img.shields.io/badge/skills-15-6f42c1)](#skill-catalog)
6
+ [![19 skills](https://img.shields.io/badge/skills-19-6f42c1)](#skill-catalog)
7
7
 
8
8
  Production-grade software engineering skills for coding agents. Showdar covers
9
9
  the full lifecycle—from requirements and planning through implementation, QA,
@@ -17,10 +17,16 @@ Install the CLI, then install a role-oriented skill profile into your project:
17
17
  ```bash
18
18
  npm install -g showdar-skills
19
19
  cd my-project
20
- showdar init --ai codex --profile developer
20
+ showdar init
21
21
  showdar doctor
22
22
  ```
23
23
 
24
+ ```bash
25
+ showdar init --ai cursor
26
+ showdar init --ai claude --scope global
27
+ showdar init --profile developer --ai opencode
28
+ ```
29
+
24
30
  To install from source instead:
25
31
 
26
32
  ```bash
@@ -29,13 +35,14 @@ cd showdar-skills
29
35
  npm install -g .
30
36
  ```
31
37
 
32
- Showdar works with Codex, OpenCode, Claude Code, and universal agent skill
33
- directories. Choose `backend`, `qa`, or `product` when that gives discovery a
34
- more precise context; use `full` when you want all capabilities available.
38
+ Showdar works with Universal Agent Skills, Codex, OpenCode, Cursor, and
39
+ Claude Code as supported installation targets. Choose `backend`, `qa`, or
40
+ `product` when that gives discovery a more precise context; use `full` when
41
+ you want all capabilities available.
35
42
 
36
43
  ## Why Showdar?
37
44
 
38
- - **15 focused skills** instead of one oversized agent prompt.
45
+ - **15 focused primitive skills** plus 4 adaptive workflow skills (19 installable) instead of one oversized agent prompt.
39
46
  - **Lifecycle coverage** from product rules to implementation, verification,
40
47
  security, operations, release readiness, and Git completion.
41
48
  - **Intent-based discovery** that selects the workflow matching the request.
@@ -65,21 +72,32 @@ SKILL.md
65
72
  only when needed
66
73
  ```
67
74
 
68
- The 15 skills are not eagerly loaded as full prompts. Lightweight descriptions
69
- help the agent choose one skill; that skill then loads its workflow and deeper
70
- knowledge progressively.
75
+ The 15 primitive skills are not eagerly loaded as full prompts. Lightweight
76
+ descriptions help the agent choose one skill; that skill then loads its
77
+ workflow and deeper knowledge progressively. Workflow skills add a portable
78
+ orchestration layer: a workflow selects the lifecycle stages a task actually
79
+ needs and composes primitives one at a time, without duplicating their
80
+ instructions.
71
81
 
72
82
  ## Supported agents
73
83
 
74
- | Target | Project destination | Global destination |
75
- | --- | --- | --- |
76
- | Codex / Universal | `.agents/skills/` | `~/.agents/skills/` |
77
- | OpenCode skills | `.opencode/skills/` | `~/.config/opencode/skills/` |
78
- | OpenCode commands | `.opencode/commands/showdar/` | `~/.config/opencode/commands/showdar/` |
79
- | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
84
+ | Harness | Project path | Global path | Status |
85
+ | --- | --- | --- | --- |
86
+ | Universal Agent Skills | `.agents/skills/` | `~/.agents/skills/` | Supported installation target |
87
+ | Codex | `.agents/skills/` | `~/.agents/skills/` | Supported installation target |
88
+ | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` | Supported installation target |
89
+ | Cursor | `.cursor/skills/` | `~/.cursor/skills/` | Supported installation target |
90
+ | Claude Code | `.claude/skills/` | `~/.claude/skills/` | Supported installation target |
91
+
92
+ Universal uses `.agents/skills/`. Explicit harness targets use their native
93
+ skill directories. Codex and Universal intentionally share `.agents/skills/`.
94
+ OpenCode additionally receives native `/showdar/...` command files in
95
+ `.opencode/commands/showdar/` (project) and
96
+ `~/.config/opencode/commands/showdar/` (global).
80
97
 
81
- Codex and Universal intentionally share `.agents/skills/`. OpenCode receives
82
- both skills and native `/showdar/...` command files.
98
+ "Supported installation target" means skills install to the harness-native
99
+ directory. It does not promise identical implicit invocation, cloud,
100
+ agent/subagent, or MCP behavior across harnesses.
83
101
 
84
102
  ## Project and global installation
85
103
 
@@ -115,8 +133,10 @@ paths are refreshed or removed.
115
133
 
116
134
  ## Profiles
117
135
 
118
- Role-specific profiles improve routing precision. `full` exposes every skill,
119
- but still does not eagerly load every skill body.
136
+ Role-specific profiles improve routing precision. Profiles install primitive
137
+ skill sets; workflow skills are opt-in through `showdar add <workflow>` and
138
+ are not silently included in any profile. `full` exposes every primitive
139
+ skill, but still does not eagerly load every skill body.
120
140
 
121
141
  | Profile | Skills | Best for |
122
142
  | --- | ---: | --- |
@@ -125,7 +145,7 @@ but still does not eagerly load every skill body.
125
145
  | `backend` | 14 | APIs, services, and runtime operations |
126
146
  | `qa` | 9 | Testing and quality workflows |
127
147
  | `product` | 6 | Product, requirements, and design work |
128
- | `full` | 15 | All capabilities |
148
+ | `full` | 15 | All primitive capabilities |
129
149
 
130
150
  Legacy aliases remain compatible:
131
151
 
@@ -138,7 +158,8 @@ New manifests store the canonical `developer` profile.
138
158
 
139
159
  ## Skill catalog
140
160
 
141
- All 15 entries are first-class Showdar skills.
161
+ All 15 primitive entries are first-class Showdar skills. Four workflow skills
162
+ compose them; see [Workflow skills](#workflow-skills).
142
163
 
143
164
  ### Analysis and planning
144
165
 
@@ -180,6 +201,109 @@ All 15 entries are first-class Showdar skills.
180
201
  | `showdar-recover` | Interrupted or partial engineering work must be reconstructed from repository evidence before continuing. |
181
202
  | `showdar-git` | Performing local Git inspection, staging, commits, branch integration, conflicts, cleanup, or explicitly requested remote Git actions. |
182
203
 
204
+ ## Workflow skills
205
+
206
+ Four workflow skills orchestrate primitives adaptively; they are not fixed
207
+ pipelines and they grant no extra authority:
208
+
209
+ | Skill | Use when |
210
+ | --- | --- |
211
+ | `showdar-feature` | Implementing a complete feature end-to-end. |
212
+ | `showdar-bugfix` | Resolving an observed defect end-to-end. |
213
+ | `showdar-release` | Preparing, validating, or executing a release lifecycle. |
214
+ | `showdar-incident` | Investigating or recovering from an active operational incident. |
215
+
216
+ How a workflow runs:
217
+
218
+ ```text
219
+ Workflow
220
+ -> selects needed lifecycle stages
221
+ -> invokes/composes primitive skills one at a time
222
+ -> primitives retain their own semantics
223
+ -> Phase 6G remains the authority source
224
+ ```
225
+
226
+ Properties:
227
+
228
+ - Adaptive, not fixed pipelines: stages marked `?` below are skipped when
229
+ evidence permits.
230
+ - Intended for whole-task and lifecycle requests.
231
+ - Focused primitive requests remain primitive.
232
+ - Workflow identity never grants mutation or deployment authority.
233
+ - Risk and severity never grant production authority.
234
+ - Workflows do not create a second router or authority engine.
235
+
236
+ ### showdar-feature
237
+
238
+ ```bash
239
+ showdar add feature
240
+ ```
241
+
242
+ Typical candidate flow:
243
+
244
+ ```text
245
+ understand -> requirements? -> plan? -> design? -> build -> test -> review
246
+ ```
247
+
248
+ Skip requirements when behavior is already defined, plan for genuinely
249
+ focused work, and design when no architecture or UX decision exists.
250
+ Verification is never skipped to move faster. Ops is not implied.
251
+
252
+ ### showdar-bugfix
253
+
254
+ ```bash
255
+ showdar add bugfix
256
+ ```
257
+
258
+ Typical:
259
+
260
+ ```text
261
+ understand -> debug? -> build -> test -> review
262
+ ```
263
+
264
+ If the root cause is already proven, debug may be skipped. If the request is
265
+ diagnosis only, build is not implied and the workflow stops after
266
+ `showdar-debug`.
267
+
268
+ ### showdar-release
269
+
270
+ ```bash
271
+ showdar add release --scope global --ai claude
272
+ ```
273
+
274
+ Typical:
275
+
276
+ ```text
277
+ quality -> security? -> ship -> ops only with explicit target + authorization
278
+ ```
279
+
280
+ Readiness must not imply deployment. `showdar-ship` stays delivery
281
+ verification; `showdar-ops` loads only with an explicit target plus execution
282
+ authorization.
283
+
284
+ ### showdar-incident
285
+
286
+ ```bash
287
+ showdar add incident
288
+ ```
289
+
290
+ Typical:
291
+
292
+ ```text
293
+ understand -> debug -> recover -> verification -> ops only when explicitly authorized
294
+ ```
295
+
296
+ Diagnose before mutating when the cause is unknown. Severity must not imply
297
+ production mutation. The workflow never auto-deploys or restarts production
298
+ from risk alone.
299
+
300
+ Workflows compose primitives: they select only the stages the evidence
301
+ requires, skip defined or decision-free stages, load one primitive at a time,
302
+ and stop when evidence or authority is missing. Single primitive requests stay
303
+ primitive (`showdar-review`, `showdar-debug`, `showdar-test`). Phase 6G remains
304
+ the authority source; workflows consume it and never mint it. Workflows are
305
+ opt-in through `showdar add <workflow>`; profiles install primitive sets only.
306
+
183
307
  ## A typical software workflow
184
308
 
185
309
  ```text
@@ -238,10 +362,63 @@ OpenCode exposes native commands after initialization with `--ai opencode` or
238
362
  | `showdar-security` | Performs defensive, evidence-based analysis and never exposes secret values. |
239
363
  | `showdar-requirements` | Records assumptions and open decisions instead of inventing business decisions. |
240
364
 
365
+ ## Adding a single skill
366
+
367
+ Install one skill without re-running a whole profile:
368
+
369
+ ```bash
370
+ showdar add debug
371
+ showdar add showdar-security
372
+ showdar add test --ai cursor
373
+ showdar add review --scope global --ai claude
374
+ showdar add feature
375
+ showdar add bugfix --ai cursor
376
+ showdar add release --scope global --ai claude
377
+ showdar add incident
378
+ ```
379
+
380
+ Accepted names are the short form (`debug`, `feature`) or the canonical form
381
+ (`showdar-debug`, `showdar-feature`). The release ships exactly 15 primitive
382
+ skills plus 4 workflow skills (19 installable total); profiles install
383
+ primitive sets only. There is no `showdar workflow ...` command. `showdar add`
384
+ is idempotent, preserves the configured profile, supports `--ai`/`--scope`
385
+ overrides, and refuses to overwrite a foreign same-name skill directory that
386
+ Showdar does not own.
387
+
388
+ ## Routing
389
+
390
+ Showdar routes each request through progressive disclosure: the host discovers
391
+ lightweight skill metadata, loads the relevant skill, and pulls deeper
392
+ guides and data only when needed.
393
+
394
+ ```text
395
+ current request
396
+ |
397
+ v
398
+ structural interpretation
399
+ |
400
+ v
401
+ authority classification
402
+ |
403
+ v
404
+ primary capability
405
+ |
406
+ v
407
+ skill
408
+ ```
409
+
410
+ Product behavior notes:
411
+
412
+ - Context, log, and example text does not automatically become requested work.
413
+ - Conditional and hypothetical actions remain non-authoritative until current
414
+ request semantics permit them.
415
+ - Risk metadata does not override an explicit governing action.
416
+
241
417
  ## CLI reference
242
418
 
243
419
  ```bash
244
420
  showdar init [--scope <project|global>] --ai <target> --profile <profile>
421
+ showdar add <skill> [--ai <target>] [--scope <project|global>]
245
422
  showdar list
246
423
  showdar status [--scope <project|global>]
247
424
  showdar doctor [--scope <project|global>]
@@ -249,10 +426,12 @@ showdar validate
249
426
  showdar remove [--scope <project|global>]
250
427
  ```
251
428
 
252
- Main flags are `--ai`, `--profile`, and `--scope`. `--ai` accepts `codex`,
253
- `opencode`, `claude`, `universal`, or `all`. `--scope` defaults to `project`;
254
- `--profile` accepts the six canonical profiles and the `mobile`/`web` aliases.
255
- Run `showdar --help` or a command's `--help` for current options.
429
+ Main flags are `--ai`, `--profile`, and `--scope`. `--ai` accepts `universal`,
430
+ `codex`, `opencode`, `cursor`, `claude`, or `all` for `init` (single targets
431
+ for `add`). `--scope` accepts `project` or `global` and defaults to `project`;
432
+ `--profile` accepts the six canonical profiles and the deprecated
433
+ `mobile`/`web` aliases. Run `showdar --help` or a command's `--help` for
434
+ current options.
256
435
 
257
436
  `showdar validate` validates the installed Showdar package. `showdar doctor`
258
437
  checks managed files against ownership hashes, while `showdar remove` removes
package/bin/showdar.js CHANGED
@@ -3,8 +3,8 @@ import path from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { readFile } from 'node:fs/promises';
5
5
  import { fileURLToPath } from 'node:url';
6
- import { AI_TARGETS, PROFILE_ALIASES, PROFILES, SKILLS, canonicalProfile, isDeprecatedProfile, resolveProfile } from '../src/catalog.js';
7
- import { globalManifestPath, initGlobal, initProject, inspectGlobal, inspectProject, removeGlobal, removeProject } from '../src/project.js';
6
+ import { AI_TARGETS, PRIMITIVE_COUNT, PROFILE_ALIASES, PROFILES, SKILLS, TOTAL_COUNT, WORKFLOW_COUNT, canonicalProfile, isDeprecatedProfile, resolveProfile } from '../src/catalog.js';
7
+ import { addSkill, globalManifestPath, initGlobal, initProject, inspectGlobal, inspectProject, removeGlobal, removeProject } from '../src/project.js';
8
8
  import { validateRepository } from '../src/validate.js';
9
9
 
10
10
  const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
@@ -32,14 +32,18 @@ function scopeAfter(args) {
32
32
  function printHelp(version, command = null) {
33
33
  const scopeUsage = '[--scope <project|global>]';
34
34
  if (command === 'init') {
35
- console.log(`Showdar Skills ${version}\n\nUsage:\n showdar init ${scopeUsage} [--profile <name>] [--ai <codex|opencode|claude|universal|all>]\n\nDefaults: scope project, profile full, AI target universal.\nProject scope writes native skills and project .showdar.json. Global scope writes verified user skill directories and ~/.showdar/global.json without project files. Codex and universal use .agents/skills in project scope and ~/.agents/skills in global scope; --ai all writes each shared destination once.\n\nProfiles: ${Object.keys(PROFILES).join(', ')}\nDeprecated aliases: ${Object.entries(PROFILE_ALIASES).map(([alias, target]) => `${alias} -> ${target}`).join(', ')}\nAI targets: ${AI_TARGETS.join(', ')}`);
35
+ console.log(`Showdar Skills ${version}\n\nUsage:\n showdar init ${scopeUsage} [--profile <name>] [--ai <universal|codex|opencode|cursor|claude|all>]\n\nDefaults: scope project, profile full, AI target universal.\nProject scope writes native skills and project .showdar.json. Global scope writes verified user skill directories and ~/.showdar/global.json without project files. Codex and universal use .agents/skills in project scope and ~/.agents/skills in global scope; cursor uses .cursor/skills in project scope and ~/.cursor/skills in global scope; --ai all writes each shared destination once.\n\nProfiles: ${Object.keys(PROFILES).join(', ')}\nDeprecated aliases: ${Object.entries(PROFILE_ALIASES).map(([alias, target]) => `${alias} -> ${target}`).join(', ')}\nAI targets: ${AI_TARGETS.join(', ')}`);
36
36
  return;
37
37
  }
38
38
  if (['status', 'doctor', 'remove'].includes(command)) {
39
39
  console.log(`Showdar Skills ${version}\n\nUsage:\n showdar ${command} ${scopeUsage}\n\nDefault scope: project. Use --scope global for the user installation.`);
40
40
  return;
41
41
  }
42
- console.log(`Showdar Skills ${version}\n\nUsage:\n showdar init ${scopeUsage} [--profile <name>] [--ai <codex|opencode|claude|universal|all>]\n showdar status ${scopeUsage}\n showdar doctor ${scopeUsage}\n showdar validate\n showdar list\n showdar remove ${scopeUsage}\n\nDefaults: scope project, profile full, AI target universal.\nProfiles: ${Object.keys(PROFILES).join(', ')}\nDeprecated aliases: ${Object.entries(PROFILE_ALIASES).map(([alias, target]) => `${alias} -> ${target}`).join(', ')}\nAI targets: ${AI_TARGETS.join(', ')}`);
42
+ if (command === 'add') {
43
+ console.log(`Showdar Skills ${version}\n\nUsage:\n showdar add <skill> [--ai <universal|codex|opencode|cursor|claude>] [--scope <project|global>]\n\nExamples:\n showdar add debug\n showdar add showdar-security\n showdar add test --ai cursor\n showdar add review --scope global --ai claude\n\nDefault scope: project. Default AI target: universal, or the configured .showdar.json value when present.`);
44
+ return;
45
+ }
46
+ console.log(`Showdar Skills ${version}\n\nUsage:\n showdar init ${scopeUsage} [--profile <name>] [--ai <universal|codex|opencode|cursor|claude|all>]\n showdar add <skill> [--ai <universal|codex|opencode|cursor|claude>] [--scope <project|global>]\n showdar status ${scopeUsage}\n showdar doctor ${scopeUsage}\n showdar validate\n showdar list\n showdar remove ${scopeUsage}\n\nDefaults: scope project, profile full, AI target universal.\nProfiles: ${Object.keys(PROFILES).join(', ')}\nDeprecated aliases: ${Object.entries(PROFILE_ALIASES).map(([alias, target]) => `${alias} -> ${target}`).join(', ')}\nAI targets: ${AI_TARGETS.join(', ')}`);
43
47
  }
44
48
 
45
49
  async function main() {
@@ -55,7 +59,7 @@ async function main() {
55
59
  }
56
60
  if (args.includes('--help') || args.includes('-h')) return printHelp(version, command);
57
61
 
58
- const scope = ['init', 'status', 'doctor', 'remove'].includes(command) ? scopeAfter(args) : null;
62
+ const scope = ['init', 'status', 'doctor', 'remove', 'add'].includes(command) ? scopeAfter(args) : null;
59
63
 
60
64
  if (command === 'list') {
61
65
  console.log(`Profiles: ${Object.keys(PROFILES).join(', ')}\nDeprecated aliases: ${Object.entries(PROFILE_ALIASES).map(([alias, target]) => `${alias} -> ${target}`).join(', ')}\n\nSkills:`);
@@ -65,7 +69,7 @@ async function main() {
65
69
 
66
70
  if (command === 'validate') {
67
71
  const result = await validateRepository(packageRoot);
68
- if (result.ok) console.log(`Showdar validation OK (${SKILLS.length} skills).`);
72
+ if (result.ok) console.log(`Showdar validation OK (${PRIMITIVE_COUNT} primitives, ${WORKFLOW_COUNT} workflows, ${TOTAL_COUNT} total).`);
69
73
  else {
70
74
  console.log(`Showdar validation FAILED (${result.errors.length} errors).`);
71
75
  for (const error of result.errors) console.log(`- ${error}`);
@@ -76,7 +80,7 @@ async function main() {
76
80
  }
77
81
 
78
82
  if (command === 'init') {
79
- if (args.includes('--agent')) throw new Error('--agent is no longer supported in V0.2. Use --ai <codex|opencode|claude|universal|all>.');
83
+ if (args.includes('--agent')) throw new Error('--agent is no longer supported in V0.2. Use --ai <universal|codex|opencode|cursor|claude|all>.');
80
84
  const requestedProfile = valueAfter(args, '--profile', 'full');
81
85
  const profile = canonicalProfile(requestedProfile);
82
86
  const ai = valueAfter(args, '--ai', 'universal');
@@ -112,6 +116,25 @@ async function main() {
112
116
  return;
113
117
  }
114
118
 
119
+ if (command === 'add') {
120
+ const positional = args.filter((a, i) => i > 0 && !a.startsWith('--') && args[i - 1] !== '--ai' && args[i - 1] !== '--scope');
121
+ const skillArg = positional[0];
122
+ if (!skillArg) throw new Error('Skill name is required. Usage: showdar add <skill> [--ai <target>] [--scope <project|global>]');
123
+ const hasAiFlag = args.includes('--ai');
124
+ const hasScopeFlag = args.includes('--scope');
125
+ const result = await addSkill({
126
+ cwd: projectRoot,
127
+ skill: skillArg,
128
+ ai: hasAiFlag ? valueAfter(args, '--ai', 'universal') : null,
129
+ scope: hasScopeFlag ? scope : null,
130
+ home: homedir(),
131
+ packageRoot,
132
+ packageVersion: version,
133
+ });
134
+ console.log(`Showdar skill ${result.added ? 'added' : 'already installed'}.\nSkill: ${result.skill}\nScope: ${result.scope}\nAI: ${result.ai}\nPath: ${result.destination}`);
135
+ return;
136
+ }
137
+
115
138
  if (command === 'remove') {
116
139
  if (scope === 'global') await removeGlobal();
117
140
  else await removeProject(projectRoot);
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Invoke a specific Showdar flagship skill explicitly
3
3
  ---
4
- Select exactly one requested Showdar skill and follow it: `showdar-understand`, `showdar-plan`, `showdar-design`, `showdar-build`, `showdar-debug`, `showdar-test`, `showdar-review`, `showdar-upgrade`, `showdar-ship`, `showdar-recover`, `showdar-git`, `showdar-requirements`, `showdar-quality`, `showdar-security`, or `showdar-ops`. If the requested name is ambiguous, choose the smallest matching skill from this list and say which one was selected.
4
+ Select exactly one requested Showdar skill and follow it: `showdar-understand`, `showdar-plan`, `showdar-design`, `showdar-build`, `showdar-debug`, `showdar-test`, `showdar-review`, `showdar-upgrade`, `showdar-ship`, `showdar-recover`, `showdar-git`, `showdar-requirements`, `showdar-quality`, `showdar-security`, `showdar-ops`, `showdar-feature`, `showdar-bugfix`, `showdar-release`, or `showdar-incident`. Whole-task intent (complete feature, end-to-end fix, release lifecycle, active incident) selects a workflow; single primitive intent stays primitive. If the requested name is ambiguous, choose the smallest matching skill from this list and say which one was selected.
5
5
 
6
6
  Request: $ARGUMENTS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "showdar-skills",
3
- "version": "0.2.3",
3
+ "version": "0.4.0",
4
4
  "description": "Production-grade software engineering lifecycle skills for coding agents.",
5
5
  "type": "module",
6
6
  "bin": { "showdar": "./bin/showdar.js" },
@@ -14,7 +14,7 @@
14
14
  "release:check": "node scripts/check-release-version.mjs"
15
15
  },
16
16
  "engines": { "node": ">=20" },
17
- "files": ["bin", "src", "skills", "commands", "router", "bundles", "profiles", "engine", "README.md", "LICENSE"],
17
+ "files": ["bin", "src", "skills", "commands", "router", "bundles", "profiles", "engine", "README.md", "LICENSE", "CHANGELOG.md", "MIGRATION.md"],
18
18
  "keywords": ["agent-skills", "coding-agents", "codex", "opencode", "claude-code", "software-engineering", "developer-tools", "requirements", "qa", "security", "devops", "workflow"],
19
19
  "license": "MIT",
20
20
  "repository": {
@@ -24,5 +24,8 @@
24
24
  "homepage": "https://github.com/caongocquy/showdar-skills#readme",
25
25
  "bugs": {
26
26
  "url": "https://github.com/caongocquy/showdar-skills/issues"
27
+ },
28
+ "devDependencies": {
29
+ "ajv": "^8.20.0"
27
30
  }
28
31
  }