@webwriter/guidance 1.0.0 → 1.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/LICENSE +21 -179
- package/cli.mjs +32 -2
- package/dist/widget-docs.json +1 -1
- package/docs.mjs +8 -2
- package/package.json +3 -3
- package/skills/webwriter-guidance/SKILL.md +5 -1
- package/skills/webwriter-guidance/references/widget-rework.md +40 -0
package/docs.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import {join, relative, sep} from "node:path"
|
|
|
3
3
|
import {fileURLToPath, pathToFileURL} from "node:url"
|
|
4
4
|
|
|
5
5
|
const checkoutDocs = fileURLToPath(new URL("../domeditor/docs/widgets/", import.meta.url))
|
|
6
|
+
const checkoutKeywords = new URL("../domeditor/src/widget-keywords.json", import.meta.url)
|
|
6
7
|
const snapshot = new URL("./dist/widget-docs.json", import.meta.url)
|
|
8
|
+
const readJSON = file => JSON.parse(readFileSync(file, "utf8"))
|
|
7
9
|
|
|
8
10
|
function readWidgetDocs(directory = checkoutDocs) {
|
|
9
11
|
return readdirSync(directory, {withFileTypes: true}).flatMap(entry => {
|
|
@@ -16,11 +18,15 @@ function readWidgetDocs(directory = checkoutDocs) {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export function loadWidgetDocs() {
|
|
19
|
-
return existsSync(checkoutDocs) ? readWidgetDocs() :
|
|
21
|
+
return existsSync(checkoutDocs) ? readWidgetDocs() : readJSON(snapshot).docs
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function loadWidgetKeywords() {
|
|
25
|
+
return existsSync(checkoutKeywords) ? readJSON(checkoutKeywords) : readJSON(snapshot).widgetKeywords
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
if(process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) {
|
|
23
29
|
const docs = readWidgetDocs().sort((a, b) => a.id.localeCompare(b.id))
|
|
24
30
|
mkdirSync(new URL(".", snapshot), {recursive: true})
|
|
25
|
-
writeFileSync(snapshot, JSON.stringify(docs) + "\n")
|
|
31
|
+
writeFileSync(snapshot, JSON.stringify({docs, widgetKeywords: readJSON(checkoutKeywords)}) + "\n")
|
|
26
32
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webwriter/guidance",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "WebWriter widget documentation search and coding agent skill",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/webwriter-app/webwriter.git",
|
|
9
|
+
"url": "git+https://github.com/webwriter-app/webwriter.git",
|
|
10
10
|
"directory": "@webwriter/guidance"
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"node": ">=22.20.0"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"webwriter-guidance": "
|
|
19
|
+
"webwriter-guidance": "cli.mjs"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"cli.mjs",
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: webwriter-guidance
|
|
3
|
-
description: Search and retrieve WebWriter's widget documentation. Use
|
|
3
|
+
description: Search and retrieve WebWriter's widget documentation and audit or rework existing widgets using their capability badges. Use for WebWriter widget questions and changes involving documented widget interfaces, including package exports, framework adapters, editing controls, state, styling, and live sessions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# WebWriter Guidance
|
|
7
7
|
|
|
8
8
|
Use the WebWriter widget guides, tutorials, and interface reference through the `@webwriter/guidance` CLI. Run it with Node.js 22.20 or newer.
|
|
9
9
|
|
|
10
|
+
## Rework an existing widget
|
|
11
|
+
|
|
12
|
+
For a widget audit, modernization, or rework, use the [widget rework checklist](references/widget-rework.md). Resolve the manifest's badges to their guides, verify the claims in scope, and ask the user to decide open design questions while continuing independent fixes.
|
|
13
|
+
|
|
10
14
|
## Search
|
|
11
15
|
|
|
12
16
|
Search for one capability or API at a time. Use WebWriter terminology and exact identifiers when known.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Widget rework
|
|
2
|
+
|
|
3
|
+
## Establish the current behavior
|
|
4
|
+
|
|
5
|
+
Identify the target widget exports, their package manifest, existing tests and fixtures, and the author and reader tasks affected by the request. Start with the declared badges and add checks for capabilities the request affects. Use the whole catalog for a broad review and mark unrelated capabilities out of scope.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx -y @webwriter/guidance badges ./package.json
|
|
9
|
+
npx -y @webwriter/guidance badges
|
|
10
|
+
npx -y @webwriter/guidance retrieve "reference/keywords,guides/focus,guides/sharing"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`badges` uses the documentation's badge-to-guide mapping and reports guide IDs for `retrieve`. With a manifest path it resolves declared keywords, retaining specific language tags, formats, and migration versions. Check the keyword reference for valid values. Retrieve the guides for the checks in scope. For a package with several widget exports, verify which exports support each relevant package-level claim.
|
|
14
|
+
|
|
15
|
+
Keep an audit row for each relevant badge and each declared value. Record the affected export, expected behavior, observed behavior and evidence, and status. Use `Verified`, `Gap`, `Needs decision`, `Out of scope`, or `Unverified` when evidence is unavailable. A manifest entry alone is a claim. Verify it against behavior.
|
|
16
|
+
|
|
17
|
+
## Work through the capabilities
|
|
18
|
+
|
|
19
|
+
| Badges | Evidence to collect | Decisions for the human when open |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Editable, Configurable, Has content | Exercise author controls in edit mode and reader controls in read mode. Save and reopen authored text and nested widgets. Check option defaults, actions, and undo. | What authors can change, which controls to expose, and accepted content. |
|
|
22
|
+
| Pointer, Keyboard, Touch input | Complete the primary task with each claimed input method. Check activation, focus order, visible focus, and interaction with editor selection. | Interaction changes such as new controls, gestures, or a different task flow. |
|
|
23
|
+
| Responsive, Themeable, Printable, Content languages | Check narrow and wide document widths, inherited theme or documented styling hooks, print preview, and each claimed language. | What gets priority in a narrow layout, what appears in print, public styling hooks, and supported languages. |
|
|
24
|
+
| Stateful, Reactive | Check saved state after reopening and undo, temporary state during interaction, and updates between connected widgets. | What persists or resets and which signals form a public interface. |
|
|
25
|
+
| Shareable, Distributable | Exercise the claimed scopes with participants in distinct roles or groups. Check permissions, submission, and what the host can see. | Default sharing scope, participation permissions, and what participants and hosts can see. |
|
|
26
|
+
| Converts from, Converts to, Migrates from | Use a fixture per claimed format or version. Inspect what survives conversion or migration and how invalid imports are handled. | Supported formats and versions and acceptable data loss. |
|
|
27
|
+
| Online variants, Dynamic loading, Shared dependencies, Standalone | Exercise the claimed modes online and offline. Check optional imports, dependency sharing, and standalone use on a plain page as applicable. | Network requirements, offline behavior, and where standalone results are stored. |
|
|
28
|
+
| Testable, Widget, purpose badges | Check manifest exports and discovery, run exported tests in the Developer console when claimed, and compare the purpose badge with the reader's primary task. | Intended audience and purpose, and whether to publish. |
|
|
29
|
+
|
|
30
|
+
## Ask and keep working
|
|
31
|
+
|
|
32
|
+
Use the request, accepted decisions, documented behavior, and existing tests or saved content to establish intent. On a rework, fix gaps with a clear expected outcome within scope, including compatibility and accessibility regressions. On an audit, report the findings. Preserve existing behavior and authored data when the request leaves them open.
|
|
33
|
+
|
|
34
|
+
When fixing a gap would choose a user-visible design, change a documented default, or add or drop a supported capability, ask before making that change unless the user already decided it. Group related questions. State the observed behavior, give two or three concrete options with tradeoffs when available, and recommend one. Use the host's question mechanism if available. While the answer is pending, continue independent fixes and verification. Keep dependent changes pending until the user answers. If the host requires a reply before work can resume, complete the independent work first and ask with a summary of what remains.
|
|
35
|
+
|
|
36
|
+
For example, if a poll's default sharing scope is unclear, ask who should see votes by default and explain the individual, group, and everyone options. While waiting, verify keyboard submission and that existing saved polls still open, provided those checks do not depend on the choice.
|
|
37
|
+
|
|
38
|
+
## Verify and report
|
|
39
|
+
|
|
40
|
+
Test the affected flows with a fresh widget and representative saved content. Recheck the declared badge claims against the result. Update manifest keywords to reflect verified capabilities within the agreed scope. If a badge is unsupported and retaining or dropping the capability is a design decision, record the gap and ask. Report completed fixes and evidence alongside any pending decisions or unverified claims.
|