htmlspec-kit 0.1.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.
- package/README.md +78 -0
- package/bin/htmlspec.ts +9 -0
- package/package.json +33 -0
- package/skills/htmlspec-kit/SKILL.md +584 -0
- package/skills/htmlspec-kit/agents/openai.yaml +4 -0
- package/skills/htmlspec-kit/assets/change-template.html +692 -0
- package/skills/htmlspec-kit/assets/spec.schema.json +155 -0
- package/src/cli.ts +422 -0
- package/src/html-document.ts +56 -0
- package/src/json-patch.ts +177 -0
- package/src/paths.ts +76 -0
- package/src/spec-data.ts +265 -0
- package/src/types.ts +106 -0
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# HTMLSpec Kit
|
|
2
|
+
|
|
3
|
+
HTMLSpec is a lightweight spec-driven workflow for proposal -> specs -> design -> tasks. It stores each change as a browser-rendered HTML dossier. The editable source of truth is the JSON payload inside:
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<script id="SPEC" type="application/json">
|
|
7
|
+
{ "format": "htmlspec" }
|
|
8
|
+
</script>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The default project folder is `spec/`.
|
|
12
|
+
|
|
13
|
+
## Install Skills
|
|
14
|
+
|
|
15
|
+
This repo ships an agent-compatible skill under `skills/htmlspec-kit`.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx skills add . --skill htmlspec-kit --agent '*' --copy -y
|
|
19
|
+
# or
|
|
20
|
+
bunx skills add . --skill htmlspec-kit --agent '*' --copy -y
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## CLI
|
|
24
|
+
|
|
25
|
+
Run from a project root:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx htmlspec-kit init
|
|
29
|
+
npx htmlspec-kit new add-dark-mode --title "Add dark mode"
|
|
30
|
+
npx htmlspec-kit show add-dark-mode --json
|
|
31
|
+
npx htmlspec-kit task start add-dark-mode 2.1
|
|
32
|
+
npx htmlspec-kit task done add-dark-mode 2.1
|
|
33
|
+
npx htmlspec-kit task add add-dark-mode "Add e2e coverage" --group "Validation"
|
|
34
|
+
npx htmlspec-kit spec update add-dark-mode --from /tmp/spec-fragment.html
|
|
35
|
+
npx htmlspec-kit design update add-dark-mode --from /tmp/design-fragment.html
|
|
36
|
+
npx htmlspec-kit patch add-dark-mode --patch '[{"op":"replace","path":"/status","value":"ready"}]'
|
|
37
|
+
npx htmlspec-kit patch add-dark-mode --replace /proposal/whyHtml --string-value '<p>Why now...</p>'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`bunx htmlspec-kit ...` works the same way; pick whichever the project already uses.
|
|
41
|
+
|
|
42
|
+
For local development in this repo, use:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bun bin/htmlspec.ts init
|
|
46
|
+
bun bin/htmlspec.ts new add-dark-mode --title "Add dark mode"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Project Layout
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
spec/
|
|
53
|
+
changes/ active change dossiers
|
|
54
|
+
specs/ canonical specs, if you promote a change
|
|
55
|
+
archive/ archived change dossiers
|
|
56
|
+
templates/
|
|
57
|
+
change-template.html
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Data Model
|
|
61
|
+
|
|
62
|
+
Each dossier contains proposal, spec, design, tasks, and history sections:
|
|
63
|
+
|
|
64
|
+
- `proposal`: why, what changes, capabilities, and impact.
|
|
65
|
+
- `spec`: delta operations (`ADDED`, `MODIFIED`, `REMOVED`, `RENAMED`) with requirements and scenarios.
|
|
66
|
+
- `design`: context, goals/non-goals, decisions, risks/trade-offs, migration plan, and open questions.
|
|
67
|
+
- `tasks`: grouped tasks with `todo`, `in-progress`, or `done`.
|
|
68
|
+
- `history`: CLI-maintained breadcrumbs.
|
|
69
|
+
|
|
70
|
+
Agents should usually read `npx htmlspec-kit show <id> --json` and mutate the SPEC payload through the CLI. Direct HTML edits are allowed when changing the visual template, Alpine rendering, CSS, metadata, or when a scoped manual JSON edit is clearer.
|
|
71
|
+
|
|
72
|
+
## Test
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
bun install
|
|
76
|
+
bun run check
|
|
77
|
+
bun run e2e
|
|
78
|
+
```
|
package/bin/htmlspec.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "htmlspec-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "HTML-backed spec-driven development artifacts and CLI.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"htmlspec": "bin/htmlspec.ts",
|
|
8
|
+
"htmlspec-kit": "bin/htmlspec.ts"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"src",
|
|
13
|
+
"skills/htmlspec-kit",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"check": "bun x tsc --noEmit",
|
|
18
|
+
"test": "bun test",
|
|
19
|
+
"e2e": "bun test e2e",
|
|
20
|
+
"e2e:agent": "bun scripts/agent-e2e.ts"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"commander": "^14.0.2",
|
|
24
|
+
"parse5": "^8.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/bun": "^1.3.3",
|
|
28
|
+
"typescript": "^5.9.3"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"bun": ">=1.2.0"
|
|
32
|
+
}
|
|
33
|
+
}
|