@specpin/cli 0.0.5 → 0.0.7
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.
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -61,11 +61,16 @@ c. **Write `<area>.spec.json`** (one file per page or feature). It has a `group`
|
|
|
61
61
|
e.g. `{ "en": "Log in button" }`. `description` must be non-empty.
|
|
62
62
|
- `businessRules` (optional): array of locale-keyed objects, one rule each.
|
|
63
63
|
- `tags` (optional): plain string array (not localized).
|
|
64
|
+
- `links`, `verifiedBy`, `status` (all optional provenance): `links` are
|
|
65
|
+
ticket/doc/PR refs (`{label,url}`, http/https); `verifiedBy` are repo-relative
|
|
66
|
+
test paths that **declare** the spec (checked to exist, never run — only list
|
|
67
|
+
real files); `status` is `draft` | `approved` | `deprecated` (omit = neutral).
|
|
64
68
|
- `preferredDisplayMode` (optional): `tooltip` | `sidebar` | `modal`
|
|
65
69
|
(`overlay` and `inline-badge` are reserved and fall back to `tooltip`).
|
|
66
70
|
- `fingerprint`: the element link (required). See the fingerprint reference.
|
|
67
71
|
- `meta`: set `"source": "ai-generated"` for specs you author, plus
|
|
68
|
-
`createdBy`, `createdAt`, `updatedAt` (RFC3339).
|
|
72
|
+
`createdBy`, `createdAt`, `updatedAt` (RFC3339). Do NOT author
|
|
73
|
+
`reviewedAt`/`reviewedBy` — a human stamps those via Mark-reviewed.
|
|
69
74
|
|
|
70
75
|
`description` and each `businessRules` item may use a small, safe Markdown
|
|
71
76
|
subset (bold, italic, `[label](url)` links, and lists in `description`).
|
|
@@ -40,16 +40,26 @@ Validate the corpus against the embedded schema, offline. CI-friendly.
|
|
|
40
40
|
```bash
|
|
41
41
|
specpin validate # checks ./.specs
|
|
42
42
|
specpin validate --dir path/to/.specs
|
|
43
|
+
specpin validate --repo-root . # root that verifiedBy paths resolve against
|
|
43
44
|
specpin validate --strict-manifest
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
- `--dir` (default `.specs`), `--strict-manifest` (turn drift warnings into failures).
|
|
48
|
+
- `--repo-root` (default: the parent of `--dir`): the root each `verifiedBy` path
|
|
49
|
+
is resolved against. Set it when `.specs/` is not at `<repo>/.specs` (e.g.
|
|
50
|
+
`./config/specs`).
|
|
51
|
+
- **`verifiedBy` existence check (on by default):** after schema validation, each
|
|
52
|
+
spec's `verifiedBy` path must exist inside the repo root — a broken-link guard,
|
|
53
|
+
NOT a test run. Absolute paths, `..`-escapes, and symlinks leaving the repo are
|
|
54
|
+
rejected. A missing path fails (exit 1) naming the spec id + path. When there is
|
|
55
|
+
no readable working tree (e.g. a piped bundle) the check is skipped with a note.
|
|
47
56
|
- Output: `OK <file>` or `FAIL <file>` plus indented errors per file, then
|
|
48
57
|
`N files checked, M error(s)`. Manifest/disk drift prints `warning:` lines
|
|
49
58
|
(or `FAIL:` under `--strict-manifest`).
|
|
50
59
|
- Exit codes:
|
|
51
60
|
- `0`: all valid.
|
|
52
|
-
- `1`: schema violations
|
|
61
|
+
- `1`: schema violations, an unreadable/symlinked spec file, or a missing/escaping
|
|
62
|
+
`verifiedBy` path (author fixes).
|
|
53
63
|
- `2`: could not run (missing `.specs/`, no `manifest.json`, internal error).
|
|
54
64
|
|
|
55
65
|
## bundle
|
|
@@ -27,6 +27,7 @@ to each file for editor autocomplete.
|
|
|
27
27
|
| `settings.defaultLocale` | string | no | fallback locale |
|
|
28
28
|
| `settings.locales` | string[] | no | BCP-47 locales authored |
|
|
29
29
|
| `settings.matchConfidenceThreshold` | number 0-1 | no | reserved for the deferred hybrid scorer |
|
|
30
|
+
| `settings.stalenessThresholdDays` | number 1-3650 | no | days after a spec's `meta.reviewedAt` before it shows as stale; default 90 |
|
|
30
31
|
| `settings.defaultDisplayMode` | DisplayMode | no | fallback render mode |
|
|
31
32
|
|
|
32
33
|
## SpecFile (`<area>.spec.json`)
|
|
@@ -45,10 +46,23 @@ to each file for editor autocomplete.
|
|
|
45
46
|
| `description` | LocalizedString | yes | locale-keyed object, each value non-empty |
|
|
46
47
|
| `businessRules` | LocalizedString[] | no | one locale-keyed object per rule |
|
|
47
48
|
| `tags` | string[] | no | NOT localized |
|
|
49
|
+
| `links` | Link[] | no | author-declared refs (tickets/docs/PRs); ≤10; see Link below |
|
|
50
|
+
| `verifiedBy` | string[] | no | repo-relative test paths that DECLARE this spec; ≤20, each ≤200 chars. Declarative only (see note) |
|
|
51
|
+
| `status` | SpecStatus | no | `"draft" \| "approved" \| "deprecated"`; omit = neutral (no default) |
|
|
48
52
|
| `preferredDisplayMode` | DisplayMode | no | overrides `settings.defaultDisplayMode` |
|
|
49
53
|
| `fingerprint` | ElementFingerprint | yes | the element link |
|
|
50
54
|
| `meta` | SpecMeta | no | provenance + timestamps |
|
|
51
55
|
|
|
56
|
+
### Link
|
|
57
|
+
|
|
58
|
+
`{ "label": string (1-80), "url": string }`. `url` must be `http`/`https`
|
|
59
|
+
(`^https?://`). Both fields required.
|
|
60
|
+
|
|
61
|
+
**`verifiedBy` is declarative.** It lists tests that *claim* to cover the spec;
|
|
62
|
+
`specpin validate` checks each path **exists** in the repo (a broken-link guard),
|
|
63
|
+
it does NOT run the tests or imply they pass. Only list real files. Never present
|
|
64
|
+
these as "verified"/"passing" — they are "linked".
|
|
65
|
+
|
|
52
66
|
## LocalizedString
|
|
53
67
|
|
|
54
68
|
A locale-keyed object, NOT a flat string:
|
|
@@ -84,6 +98,11 @@ All four required when `meta` is present: `createdBy` (string),
|
|
|
84
98
|
`createdAt` + `updatedAt` (RFC3339 date-time, format-checked by both validators),
|
|
85
99
|
`source` (`"ai-generated" | "manual"`). Use `"ai-generated"` for specs you author.
|
|
86
100
|
|
|
101
|
+
Optional review fields — **do NOT author these**; a human stamps them via the
|
|
102
|
+
extension's Mark-reviewed action: `reviewedAt` (RFC3339 date-time), `reviewedBy`
|
|
103
|
+
(a non-PII token like `createdBy`, e.g. `"agent"`/`"manual"` — never an email or
|
|
104
|
+
identity, since it is committed to `.specs/` and included in export bundles).
|
|
105
|
+
|
|
87
106
|
## DisplayMode
|
|
88
107
|
|
|
89
108
|
`"overlay" | "tooltip" | "sidebar" | "modal" | "inline-badge"`. Implemented:
|