@planview/pvds-skills 0.0.1 → 0.0.5

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 (4) hide show
  1. package/README.md +49 -49
  2. package/dist/cli.js +1603 -15327
  3. package/package.json +46 -23
  4. package/dist/cli.js.map +0 -1
package/README.md CHANGED
@@ -4,25 +4,26 @@ Skills and reference knowledge for building with the Planview Design System (PVD
4
4
 
5
5
  ## Installation
6
6
 
7
- The recommended path is the `@planview/pvds-skills` CLI, which auto-detects your project's skills root, records a `.pvds-skills/config.json` marker, and installs all three skills in one step:
7
+ The recommended path is the `@planview/pvds-skills` CLI, which auto-detects your project's skills root, records a `.pvds-skills/config.json` marker, and installs all four skills in one step:
8
8
 
9
9
  ```bash
10
10
  pnpm dlx @planview/pvds-skills init
11
11
  ```
12
12
 
13
- For npm / yarn / bun, substitute the equivalent runner (`npx --yes`, `yarn dlx`, `bunx`). The CLI is a zero-dependency ~100 KB tarball — no lockfile changes, no peer deps.
13
+ For npm / yarn / bun, substitute the equivalent runner (`npx --yes`, `yarn dlx`, `bunx`). The CLI is a zero-dependency ~160 KB tarball — no lockfile changes, no peer deps.
14
14
 
15
- Either path installs the skills into your project's `.claude/skills/` directory (or your home directory if you install globally).
15
+ Either path installs the skills into the skills directory of each coding agent you have installed (`.claude/skills/` for Claude Code, `.agents/skills/` for Codex, Cursor, and Copilot, and so on — or your home directory if you install globally). Use `--agent` to target specific agents; see [`--agent` (init)](#--agent-init).
16
16
 
17
17
  ## Available Skills
18
18
 
19
- | Skill | Purpose |
20
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
21
- | `pvds-knowledge` | Shared reference knowledge base — API docs, code recipes, gotchas, architecture guides. Not a standalone skill; other skills load data from it. |
22
- | `pvds-builder` | Generate React code using PVDS packages correctly. Loads knowledge on demand to produce correct, performant, accessible code. |
23
- | `pvds-peer-review` | Expert-level peer review of code consuming PVDS packages. Checks coding style, accessibility, performance, theming, and more. |
19
+ | Skill | Purpose |
20
+ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | `pvds-knowledge` | Shared reference knowledge base — API docs, code recipes, gotchas, architecture guides. Not a standalone skill; other skills load data from it. |
22
+ | `pvds-builder` | Generate React code using PVDS packages correctly. Loads knowledge on demand to produce correct, performant, accessible code. |
23
+ | `pvds-peer-review` | Expert-level peer review of code consuming PVDS packages. Checks coding style, accessibility, performance, theming, and more. |
24
+ | `pvds-test-builder` | Write tests for code consuming PVDS packages: sets up the PVDS test providers, queries by role, label and text, and tests your integration rather than PVDS internals. |
24
25
 
25
- ## CLI reference
26
+ ## CLI
26
27
 
27
28
  ```bash
28
29
  pnpm dlx @planview/pvds-skills init # one-time setup + install skill markdown
@@ -30,8 +31,9 @@ pnpm dlx @planview/pvds-skills upgrade # refresh skill markdown; bump config v
30
31
  pnpm dlx @planview/pvds-skills check # run all deterministic PVDS audits
31
32
  pnpm dlx @planview/pvds-skills doctor # verify config + skills presence
32
33
  pnpm dlx @planview/pvds-skills versions # compare bundled PVDS reference data vs. installed pv-* versions
33
- pnpm dlx @planview/pvds-skills props <Component> # look up a component's own-declared props from the manifest
34
- pnpm dlx @planview/pvds-skills fix # no-op (parked for future auto-fixable checks)
34
+ pnpm dlx @planview/pvds-skills props <Component> # look up components', hooks' or styling namespaces' APIs
35
+ pnpm dlx @planview/pvds-skills components # list the manifest's exports (filter by --package / --grep)
36
+ pnpm dlx @planview/pvds-skills tokens # list color, spacing and size tokens, or find which hold a value
35
37
  pnpm dlx @planview/pvds-skills --help
36
38
  ```
37
39
 
@@ -44,62 +46,40 @@ For npm / yarn / bun projects, substitute the equivalent runner:
44
46
  | yarn | `yarn dlx @planview/pvds-skills …` |
45
47
  | bun | `bunx @planview/pvds-skills …` |
46
48
 
47
- The CLI auto-detects your project's package manager (via `packageManager` in `package.json`, then lockfile) and uses the matching runner for the downstream `skills add` invocation. Override with `--package-manager=<pnpm|npm|yarn|bun>` if detection is wrong.
49
+ ### Quick start
48
50
 
49
- ### `check` — deterministic PVDS audits
50
-
51
- `check` walks the repo (skipping `node_modules`, `dist`, etc.) and runs a set of zero-heuristic checks against `@planview/pv-*` usage: version drift, subpath imports, orphan/undeclared dependencies (including `.less`/`.scss`/`.sass`/`.css` references), deprecated-export imports, hardcoded colors/spacing in CSS-in-JS, invalid enum prop literals, unknown/typo'd JSX props, and manifest-vs-installed version drift.
51
+ Audit your code. `check` is deterministic and offline; it exits `1` on error-level findings (warnings don't block by default) and `2` when it couldn't run:
52
52
 
53
53
  ```bash
54
54
  pnpm dlx @planview/pvds-skills check
55
- pnpm dlx @planview/pvds-skills check --verbose # list every scanned file
56
- pnpm dlx @planview/pvds-skills check --only=hardcoded-colors,hardcoded-spacing
55
+ pnpm dlx @planview/pvds-skills check --preset=self-review --changed # only what you've touched
56
+ pnpm dlx @planview/pvds-skills check --only=hardcoded-colors,unknown-props
57
+ pnpm dlx @planview/pvds-skills check --fail-on=warning # strict CI
57
58
  pnpm dlx @planview/pvds-skills check --format=json --output=./pvds-report.json
58
59
  ```
59
60
 
60
- Every run prints a scan summary per category so a "0 issues" result is trustworthy. Exit code is `1` when any error-level issue is found; suitable for CI. Output formats: `human` (default), `json`, `sarif`.
61
-
62
- By default `check` walks the entire directory tree. Scope it to a specific file set instead with:
61
+ Look things up before writing code:
63
62
 
64
63
  ```bash
65
- pnpm dlx @planview/pvds-skills check --files=src/components/Button.tsx,src/components/Input.tsx
66
- pnpm dlx @planview/pvds-skills check --changed # uncommitted changes (tracked + untracked), vs HEAD
67
- pnpm dlx @planview/pvds-skills check --staged # staged files only (git diff --cached)
68
- pnpm dlx @planview/pvds-skills check --since=main # files changed since diverging from a ref
64
+ pnpm dlx @planview/pvds-skills props Grid Toolbar # a component's props
65
+ pnpm dlx @planview/pvds-skills props ContentLayout.Left # a composite's sub-component
66
+ pnpm dlx @planview/pvds-skills components --grep=button # what is it actually called?
67
+ pnpm dlx @planview/pvds-skills tokens colors --grep=error # color tokens by name
68
+ pnpm dlx @planview/pvds-skills tokens --value '#d41616' # which tokens hold this value?
69
69
  ```
70
70
 
71
- These are additive — combine `--files` with a git flag to union both sets. Scoping only applies to the per-file checks (`subpath-imports`, `deprecated-imports`, `hardcoded-colors`, `hardcoded-spacing`, `literal-size-props`, `unknown-props`, and the source side of `undeclared-imports`); `orphan-deps`, `versions`, and `manifest-drift` always need whole-repo visibility to be correct and ignore it.
72
-
73
- `--changed`, `--staged`, and `--since` shell out to the `git` binary (the only external process the CLI invokes) and require the target directory to be inside a git repository — `--files` has no such requirement.
74
-
75
- ### `versions` — reference-data freshness
76
-
77
- The manifest baked into the CLI (deprecations, enum props, style-token hints) is generated once per release against one fixed version of each `@planview/pv-*` package — it does not track a consumer's installs over time. `versions` shows what the bundled manifest was generated against next to what's actually installed in your project, and flags major-version gaps. The same comparison runs as part of `check` under the `manifest-drift` category (warning-level, never blocks CI on its own).
71
+ Choose which agents get the skills:
78
72
 
79
73
  ```bash
80
- pnpm dlx @planview/pvds-skills versions
81
- pnpm dlx @planview/pvds-skills versions --format=json
74
+ pnpm dlx @planview/pvds-skills init # auto-detect installed agents
75
+ pnpm dlx @planview/pvds-skills init --agent claude-code # or name them; repeatable, '*' for all
82
76
  ```
83
77
 
84
- ### `props` — component prop lookup
85
-
86
- Looks up a component's own-declared props (name, type, enum values, deprecation) directly from the bundled manifest — no source scanning, no network call beyond the initial `dlx` fetch. Intended for agents (or humans) that need an authoritative prop list before writing or reviewing code, without loading the full `api-reference.md`.
87
-
88
- ```bash
89
- pnpm dlx @planview/pvds-skills props Grid
90
- pnpm dlx @planview/pvds-skills props Button --package=@planview/pv-uikit
91
- pnpm dlx @planview/pvds-skills props FilterPanel --format=json
92
- ```
93
-
94
- Only _own-declared_ props are tracked (see Architecture below) — a component with zero own props (fully inherited from HTML/React) won't appear, and that's not an error. Standard HTML/React/ARIA attributes (`className`, `onClick`, `style`, `data-*`, `aria-*`, ...) are always valid regardless of manifest presence; every response repeats this caveat. Exit code is `1` when the component isn't found in the manifest.
95
-
96
- ### `--yes` (init)
97
-
98
- `pvds-skills init` itself is non-interactive. `--yes` forwards `-y` to the downstream `skills add` command so it skips its own prompts. Use it in CI or headless runs.
78
+ **[CLI-REFERENCE.md](CLI-REFERENCE.md)** has everything else: every command and flag, exit codes, JSON output shapes, the rule catalogue (each `ruleId`, its severity, and what it ignores), how `props` resolves a name, and the manifest schema.
99
79
 
100
80
  ### Architecture
101
81
 
102
- Single bundled ESM entry (`dist/cli.js`). Every dependency (currently just `citty`) is inlined at build time via tsup's `noExternal: /.*/`. No runtime deps, no peer deps, no post-install hooks. The consumer-facing manifest (deprecations, enum props, style-token reverse-lookups) is generated from the installed `@planview/pv-*` `.d.ts` files via `pnpm refresh-manifest` and bundled inline — no runtime dependency on those packages.
82
+ Single bundled ESM entry (`dist/cli.js`). Every dependency (`citty` and `cross-spawn`) is inlined at build time via tsdown's `deps.alwaysBundle: /.*/`. No runtime deps, no peer deps, no post-install hooks. The consumer-facing manifest (deprecations, enum props, style-token reverse-lookups) is generated from the installed `@planview/pv-*` `.d.ts` files via `pnpm refresh-manifest` and bundled inline — no runtime dependency on those packages.
103
83
 
104
84
  ## Usage
105
85
 
@@ -133,6 +113,26 @@ Or ask for a review of commits not yet pushed to a PR:
133
113
  /pvds-peer-review can you please review the last three commits in my branch? The intent with the changes are....
134
114
  ```
135
115
 
116
+ You can also do a quick, only mechanical review of your code by asking for a quick review. This will run the deterministic CLI checks and return the results to you.
117
+
118
+ ```
119
+ /pvds-peer-review can you please do a quick review of the changes done in my branch?
120
+ ```
121
+
122
+ ### Testing PVDS code
123
+
124
+ Invoke the test builder skill to write tests for code that uses PVDS components. It sets up the PVDS test providers, queries by accessible role, label and text, and covers how your code uses the components rather than what PVDS does internally:
125
+
126
+ ```
127
+ /pvds-test-builder add tests for the filter panel: changing a filter should narrow the grid
128
+ ```
129
+
130
+ Or point it at existing code:
131
+
132
+ ```
133
+ /pvds-test-builder write tests for src/features/tasks/TaskDetails.tsx, including selecting a card and opening the details panel
134
+ ```
135
+
136
136
  ## Knowledge Base Coverage
137
137
 
138
138
  | Package | Status |