ai-design-context 0.4.0 → 0.5.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/AGENTS.md +4 -0
- package/CHANGELOG.md +14 -0
- package/README.md +10 -3
- package/RELEASE_NOTES_v0.5.0.md +31 -0
- package/SECURITY.md +1 -1
- package/docs/AGENT_CONTEXT.md +1 -1
- package/docs/BROWSER_DESIGN_QA.md +52 -0
- package/docs/GITHUB_SETUP.md +14 -7
- package/docs/INDEX.md +2 -0
- package/docs/NPM_RELEASE.md +1 -1
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/README.md +29 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/desktop-default.png +0 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/desktop-detail.png +0 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/mobile-default.png +0 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/mobile-detail.png +0 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/mobile-error.png +0 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/mobile-keyboard-focus.png +0 -0
- package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/mobile-saved.png +0 -0
- package/package.json +2 -1
- package/skills/README.md +12 -0
- package/skills/accessibility-check/SKILL.md +27 -0
- package/skills/design-understand/SKILL.md +22 -0
- package/skills/responsive-check/SKILL.md +29 -0
- package/skills/visual-qa/SKILL.md +55 -0
- package/starter-kit/INSTALL_WITH_AGENT.md +5 -3
- package/starter-kit/README.md +2 -0
- package/tools/cli.mjs +9 -2
- package/tools/init.mjs +33 -8
- package/tools/skills.mjs +75 -0
package/AGENTS.md
CHANGED
|
@@ -92,6 +92,10 @@ Use them when the task matches their role:
|
|
|
92
92
|
- `skills/prompt-architect/SKILL.md` for graph-backed prompt structure and output contracts.
|
|
93
93
|
- `skills/knowledge-graph-architect/SKILL.md` for schema, registry, generated indexes, relationships, and validation scope.
|
|
94
94
|
- `skills/agent-context/SKILL.md` for focused graph retrieval before implementation or review.
|
|
95
|
+
- `skills/design-understand/SKILL.md` for understanding an existing screen before UI changes.
|
|
96
|
+
- `skills/visual-qa/SKILL.md` for browser/screenshot evidence and scoped visual QA.
|
|
97
|
+
- `skills/responsive-check/SKILL.md` for executing viewport and responsive interaction checks.
|
|
98
|
+
- `skills/accessibility-check/SKILL.md` for executing semantic and keyboard/state checks.
|
|
95
99
|
|
|
96
100
|
These skill files are not registered knowledge objects yet. Do not add them to `registry/objects.json` until skill metadata migration is explicitly requested.
|
|
97
101
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.5.0 — Discoverable Design Skills And Browser QA
|
|
6
|
+
|
|
7
|
+
- Adapt the four supplied UI checklist skills with standalone metadata, existing graph references, concrete browser/image workflows, and explicit evidence boundaries.
|
|
8
|
+
- Add read-only `skills list` / `skills show` CLI commands with Markdown and JSON output.
|
|
9
|
+
- Install missing namespaced `.agents/skills` launchers for all 20 bundled workflows through `init`, preserving existing local files.
|
|
10
|
+
- Load current workflows from the pinned npm package so package updates do not overwrite customized launchers.
|
|
11
|
+
- Append design/browser-review routing separately from the original context block for safe upgrades from `0.4.0`.
|
|
12
|
+
- Extend initialization and packed-install verification for skill discovery, source retrieval, local customization, malformed markers, and symlink paths.
|
|
13
|
+
- Document browser and image-model prerequisites, reproducible findings, scoped verdicts, and unverified coverage.
|
|
14
|
+
|
|
15
|
+
## npm v0.4.0 — AI Design Context Package
|
|
16
|
+
|
|
5
17
|
- Rename the project to AI Design Context and use `ai-design-context` as the package name; keep the GitHub URL at `dev-ik/ai-design-rules`.
|
|
6
18
|
- Preserve historical releases, frozen benchmark evidence, stable graph identifiers, and schema URIs under their original names.
|
|
7
19
|
- Package the complete graph and upstream evidence with a dependency-free Node.js 20+ CLI and an explicit publish allowlist.
|
|
8
20
|
- Add `init` for preserving existing agent instructions and creating only missing templates, with repeated-run and symlink protections.
|
|
9
21
|
- Add installed-package `context` retrieval with absolute reading paths while preserving the existing checkout CLI contract.
|
|
10
22
|
- Verify offline installation and use of the actual npm tarball; run repository checks and tests before packing.
|
|
23
|
+
- Publish the first npm package as `ai-design-context@0.4.0`; preserve the existing historical GitHub `v0.4.0` tag.
|
|
24
|
+
- Add automatic npm publishing from matching GitHub Releases through OIDC Trusted Publishing, with validation-only manual runs.
|
|
11
25
|
|
|
12
26
|
## v0.4.0 — Focused Context And Applied Patterns
|
|
13
27
|
|
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<h1 align="center">AI Design Context</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/ai-design-context"><img alt="npm version" src="https://img.shields.io/npm/v/ai-design-context.svg"></a>
|
|
8
9
|
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
|
9
10
|
<a href="CHANGELOG.md"><img alt="Status: active" src="https://img.shields.io/badge/status-active-success.svg"></a>
|
|
10
11
|
<a href="evidence/README.md"><img alt="Evidence: benchmark driven" src="https://img.shields.io/badge/evidence-benchmark--driven-orange.svg"></a>
|
|
@@ -82,6 +83,8 @@ The repository is built as a **schema-first knowledge graph** for both humans an
|
|
|
82
83
|
- Research-driven design rules
|
|
83
84
|
- Reusable product and UI patterns
|
|
84
85
|
- AI agent skills
|
|
86
|
+
- Discoverable project-local skill launchers and a `skills` CLI
|
|
87
|
+
- Browser and image QA workflows with explicit capability and evidence limits
|
|
85
88
|
- Validation tooling
|
|
86
89
|
- Benchmark framework
|
|
87
90
|
- DesignLint v0 for evidence-chain relationship checks
|
|
@@ -123,7 +126,7 @@ The first benchmark is **directional**, not conclusive, and serves as the starti
|
|
|
123
126
|
|
|
124
127
|
AI Design Context ships as the dependency-free npm package `ai-design-context` with a CLI and a versioned knowledge graph. Requires **Node.js 20 or later**. The GitHub repository stays at [`dev-ik/ai-design-rules`](https://github.com/dev-ik/ai-design-rules).
|
|
125
128
|
|
|
126
|
-
|
|
129
|
+
Install the published package:
|
|
127
130
|
|
|
128
131
|
```bash
|
|
129
132
|
npm install --save-dev --save-exact ai-design-context
|
|
@@ -131,7 +134,7 @@ npx ai-design-context init
|
|
|
131
134
|
npx ai-design-context context --task quick-capture --platform mobile --intent implement
|
|
132
135
|
```
|
|
133
136
|
|
|
134
|
-
Commit the project's dependency manifest and lockfile to pin the knowledge version. Installation alone does not edit project files: `init` explicitly appends
|
|
137
|
+
Commit the project's dependency manifest and lockfile to pin the knowledge version. Installation alone does not edit project files: `init` explicitly appends marked context and design-review sections to `AGENTS.md` and creates only missing product-context docs, feature/task templates, review/benchmark checklists, and namespaced `.agents/skills` launchers. It preserves existing instructions, populated files, and edited integration blocks; repeated runs do not duplicate them. Fill new placeholders with actual product context.
|
|
135
138
|
|
|
136
139
|
`context` reads the graph from the installed package, independently of the project's working directory. Markdown provides absolute reading paths; JSON adds `knowledgeRoot` and each object's `absolutePath` while preserving graph-relative `path`. Read the selected research and rules before implementing UI changes.
|
|
137
140
|
|
|
@@ -139,10 +142,14 @@ Commit the project's dependency manifest and lockfile to pin the knowledge versi
|
|
|
139
142
|
npx ai-design-context context --object PAT-00002 --format json
|
|
140
143
|
npx ai-design-context context --review REF-00001 --intent qa
|
|
141
144
|
npx ai-design-context --help
|
|
145
|
+
npx ai-design-context skills list
|
|
146
|
+
npx ai-design-context skills show visual-qa
|
|
142
147
|
```
|
|
143
148
|
|
|
144
149
|
Review queries retrieve matching graph knowledge; they do not analyze arbitrary application files. Matching is lexical, with known IDs and slugs available when phrases do not match. See [Agent Context](docs/AGENT_CONTEXT.md).
|
|
145
150
|
|
|
151
|
+
After UI work, the installed skills guide browser interaction, screenshot inspection, responsive checks, and accessibility checks before final design review. Use the agent's browser tools or the project's Playwright setup and an image-capable model. The npm package supplies workflows and graph context; it does not provision browser binaries, connectors, or model vision. See [Design and Browser QA](docs/BROWSER_DESIGN_QA.md) for capability requirements and evidence reporting.
|
|
152
|
+
|
|
146
153
|
Before publication, build a local tarball from this repository and install it into a product repository:
|
|
147
154
|
|
|
148
155
|
```bash
|
|
@@ -150,7 +157,7 @@ Before publication, build a local tarball from this repository and install it in
|
|
|
150
157
|
npm pack
|
|
151
158
|
|
|
152
159
|
# In the product repository; replace the path with the generated tarball path.
|
|
153
|
-
npm install --save-dev /path/to/ai-design-context-0.
|
|
160
|
+
npm install --save-dev /path/to/ai-design-context-0.5.0.tgz
|
|
154
161
|
npx ai-design-context init
|
|
155
162
|
```
|
|
156
163
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# AI Design Context v0.5.0
|
|
2
|
+
|
|
3
|
+
This release connects the installed knowledge graph to discoverable design workflows and concrete browser/image QA.
|
|
4
|
+
|
|
5
|
+
## Included
|
|
6
|
+
|
|
7
|
+
- Adapt four supplied checklist skills: `design-understand`, `visual-qa`, `responsive-check`, and `accessibility-check`, with metadata, graph grounding, tool requirements, and evidence-based report contracts.
|
|
8
|
+
- Install missing namespaced launchers for all 20 workflows under `.agents/skills` through explicit `init`.
|
|
9
|
+
- Add `skills list` and `skills show <name>`, including JSON output with paths, descriptions, content, and package version.
|
|
10
|
+
- Load current workflow instructions from the lockfile-pinned package rather than overwriting customized local skills on upgrades.
|
|
11
|
+
- Preserve the original `0.4.0` context block and append a separately marked design/browser-review routing block once.
|
|
12
|
+
- Cover installed-package retrieval, launcher creation, customized skills, malformed markers, symlink preflight, repeated initialization, and offline tarball installation.
|
|
13
|
+
|
|
14
|
+
## Install or upgrade
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install --save-dev --save-exact ai-design-context@0.5.0
|
|
18
|
+
npx ai-design-context init
|
|
19
|
+
npx ai-design-context skills list
|
|
20
|
+
npx ai-design-context skills show visual-qa
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use the installed launchers or `skills show` to apply the workflow: understand the screen, retrieve research/rules, implement within the existing stack, exercise browser interactions, capture and inspect screenshots, check responsive/accessibility behavior, fix authorized issues, and retest.
|
|
24
|
+
|
|
25
|
+
## Capability and evidence limits
|
|
26
|
+
|
|
27
|
+
The package supplies knowledge and agent workflows. Browser tools or the project's Playwright setup, browser binaries, image viewing, and an image-capable model must be supplied by the agent/project environment. Missing capabilities are unverified scope, not a QA pass. One screenshot does not establish responsive, keyboard, virtual-keyboard, screen-reader, or asynchronous-state behavior.
|
|
28
|
+
|
|
29
|
+
The new skills use existing graph-backed guidance and are not registered knowledge objects. Existing draft/seed research and rules retain their maturity. Skill application scenarios and the reference fixture check validate the workflow's operation; they do not establish a general quality gain or replace paired benchmark evidence.
|
|
30
|
+
|
|
31
|
+
See [Design and Browser QA](docs/BROWSER_DESIGN_QA.md).
|
package/SECURITY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Security Policy
|
|
2
2
|
|
|
3
|
-
AI Design Context ships a local npm CLI, documentation, schemas, a knowledge graph, and validation tools including DesignLint. It does not run a hosted service. Graph retrieval
|
|
3
|
+
AI Design Context ships a local npm CLI, documentation, schemas, a knowledge graph, and validation tools including DesignLint. It does not run a hosted service. Graph and skill retrieval are read-only and offline; `init` explicitly writes agent instructions, missing templates, and namespaced `.agents/skills` launchers into the current project. Installation has no initialization hooks. Browser and image tools belong to the consuming agent/project environment. Review repository guidance as input to your agent, with project-specific instructions remaining authoritative.
|
|
4
4
|
|
|
5
5
|
## Supported Versions
|
|
6
6
|
|
package/docs/AGENT_CONTEXT.md
CHANGED
|
@@ -14,7 +14,7 @@ npx --no-install ai-design-context context --object PAT-00002 --format json
|
|
|
14
14
|
|
|
15
15
|
The installed CLI always reads its own graph, not a `registry/` directory in the consuming project. Markdown lists absolute paths so the agent can open the selected files. JSON preserves the relative graph `path`, adds an `absolutePath` to anchors and objects, and adds the package's `knowledgeRoot` at the top level. These reading paths depend on the installation location and must not be used as stable object identifiers.
|
|
16
16
|
|
|
17
|
-
`npx ai-design-context init` appends
|
|
17
|
+
`npx ai-design-context init` appends marked context and design-review blocks to `AGENTS.md` and creates only missing starter-kit files and namespaced `.agents/skills` launchers. It preserves current project instructions, populated files, customized launchers, and existing marked blocks. It rejects malformed markers, symlinked destinations, and incompatible file/directory destinations before creating files. Installation itself performs no initialization. See [Design and Browser QA](BROWSER_DESIGN_QA.md) for discovery, the `skills` CLI, and browser/image capability requirements.
|
|
18
18
|
|
|
19
19
|
Retrieval is lexical and read-only. A `--review` query matches a known graph object or phrase; it does not inspect or judge arbitrary files in the product repository. Resolve relevant context, then inspect the implementation separately. See [installation](../starter-kit/INSTALL_WITH_AGENT.md) for pre-publication tarball use.
|
|
20
20
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Design and Browser QA
|
|
2
|
+
|
|
3
|
+
AI Design Context connects product/design reasoning with evidence-based checks of implemented screens. Version `0.5.0` adapts four user-supplied checklists from `Skills.zip` into executable agent workflows: `design-understand`, `visual-qa`, `responsive-check`, and `accessibility-check`. They complement the existing specialist skills; they do not add new design rules or become registry objects.
|
|
4
|
+
|
|
5
|
+
## Install and discover
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-dev --save-exact ai-design-context@0.5.0
|
|
9
|
+
npx ai-design-context init
|
|
10
|
+
npx ai-design-context skills list
|
|
11
|
+
npx ai-design-context skills show visual-qa
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`init` creates missing namespaced launchers under `.agents/skills/ai-design-context-<name>/SKILL.md` for all 20 bundled skills. It preserves existing launchers and project instructions. Each launcher reads its full workflow from the installed package with `skills show`; upgrading the pinned package updates the workflow without overwriting local customization. `skills list --format json` and `skills show <name> --format json` expose source paths, content, descriptions, and the package version for other tooling.
|
|
15
|
+
|
|
16
|
+
Codex discovers repository skills in `.agents/skills` and can match their descriptions automatically. If the skill list does not refresh, restart the agent. Other runtimes can load workflows through `skills show` and the `AGENTS.md` routing section; automatic discovery depends on their own supported directories. See [official skill discovery documentation](https://learn.chatgpt.com/docs/build-skills#where-codex-loads-local-skills).
|
|
17
|
+
|
|
18
|
+
For a project already initialized with `0.4.0`, rerun `init` after the npm update. The original context block stays intact; a separately marked design-and-review routing block is appended once, and missing launchers are installed. Edited blocks and existing local skills remain authoritative. Commit the lockfile, chosen templates, `AGENTS.md`, and `.agents/skills` with your project instructions.
|
|
19
|
+
|
|
20
|
+
## Workflow
|
|
21
|
+
|
|
22
|
+
| Stage | Workflow | Evidence |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| Understand | `design-understand` for an existing screen; `product-designer` for new product direction | User goal, primary action, existing objects, source components, assumptions. |
|
|
25
|
+
| Ground | `agent-context` | Retrieved research, rules, and patterns with explicit maturity limits. |
|
|
26
|
+
| Implement | Visual, interaction, mobile, and design-system specialists | Focused changes within the project's existing stack and logic. |
|
|
27
|
+
| Inspect | `visual-qa`, `responsive-check`, `accessibility-check` | Browser interactions, screenshots opened by the model, DOM measurements, keyboard/error recovery observations. |
|
|
28
|
+
| Review | `design-reviewer` | Scoped verdict, severity-ordered findings, graph traceability, retest results, and coverage gaps. |
|
|
29
|
+
|
|
30
|
+
Use an available browser connector/tool or the project's existing Playwright setup. Open the actual screen, exercise its primary flow, resize supported viewports, scroll, inspect dialogs and sticky regions, and capture relevant states. Use semantic roles and labels when the browser tool supports them. Inspect the resulting image pixels with an image-capable model. Compare a supplied design reference under matching viewport, state, theme, scale, and content.
|
|
31
|
+
|
|
32
|
+
Example exploratory CSS viewports are 390x844, 768x1024, and 1440x900; use the product's supported targets and affected breakpoints. Viewport emulation does not establish physical touch, virtual-keyboard resizing, safe areas, or screen-reader behavior. Record those as unverified when not actually exercised.
|
|
33
|
+
|
|
34
|
+
## What the npm package provides
|
|
35
|
+
|
|
36
|
+
| Capability | Supplied by the package |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Knowledge graph and workflow instructions | Yes, versioned and local. |
|
|
39
|
+
| Discoverable repository skill launchers | Yes, after explicit `init`. |
|
|
40
|
+
| Browser connector, Playwright runtime, or browser binaries | No; use tools already available to the agent/project. |
|
|
41
|
+
| Image viewing and model vision | No; the agent's runtime/model must support them. |
|
|
42
|
+
| Screenshot-based compliance certification or universal design-quality guarantee | No. |
|
|
43
|
+
|
|
44
|
+
If tools are absent, continue with source or supplied-image inspection and label the scope **PARTIAL**. A static screenshot cannot prove responsive interactions, keyboard behavior, asynchronous state handling, or numerical contrast ratios. Missing evidence is a coverage gap rather than a pass or a confirmed product defect.
|
|
45
|
+
|
|
46
|
+
## Review output
|
|
47
|
+
|
|
48
|
+
Keep evidence in the project's established location; otherwise use a dated folder under `output/playwright/`. Each confirmed issue records its severity, screen/component, viewport and state, reproducible actions, observed versus expected behavior, applicable graph/reference basis, screenshot/measurement, impact, proposed fix, and retest result. Label unverified component/file attribution as a hypothesis.
|
|
49
|
+
|
|
50
|
+
Finish with a table of **surface | viewport | state/input | evidence | checked/unverified/not applicable**. Use `PASS`, `NEEDS WORK`, or `PARTIAL` for the declared scope. After an authorized fix, repeat the failed check and relevant neighboring layouts under matching conditions; run the project's code checks. The existing `examples/todo-reference` fixture can exercise this process but is not a new benchmark pair or evidence of general quality gains.
|
|
51
|
+
|
|
52
|
+
Tool mechanics: [Playwright screenshots](https://playwright.dev/docs/screenshots), [emulation](https://playwright.dev/docs/emulation), and [role/label locators](https://playwright.dev/docs/locators). Upstream guidance remains `CHECK-00001`, applicable registered rules and research, and explicit user constraints.
|
package/docs/GITHUB_SETUP.md
CHANGED
|
@@ -6,23 +6,30 @@ The project is named **AI Design Context** and the npm package is `ai-design-con
|
|
|
6
6
|
|
|
7
7
|
## Repository Description
|
|
8
8
|
|
|
9
|
-
Evidence-driven design context and
|
|
9
|
+
Evidence-driven design context, reusable agent skills, and browser QA workflows for AI coding agents. Install via npm: ai-design-context.
|
|
10
|
+
|
|
11
|
+
## About Link
|
|
12
|
+
|
|
13
|
+
https://www.npmjs.com/package/ai-design-context
|
|
10
14
|
|
|
11
15
|
## Suggested Topics
|
|
12
16
|
|
|
13
17
|
- ai
|
|
18
|
+
- ai-design-context
|
|
19
|
+
- ai-agents
|
|
20
|
+
- agent-skills
|
|
14
21
|
- design
|
|
15
22
|
- ux
|
|
16
23
|
- product-design
|
|
17
|
-
-
|
|
18
|
-
- codex
|
|
19
|
-
- cursor
|
|
20
|
-
- design-systems
|
|
24
|
+
- visual-testing
|
|
21
25
|
- accessibility
|
|
22
|
-
-
|
|
26
|
+
- playwright
|
|
27
|
+
- knowledge-graph
|
|
28
|
+
- codex
|
|
29
|
+
- npm
|
|
23
30
|
|
|
24
31
|
## Release Positioning
|
|
25
32
|
|
|
26
|
-
The first
|
|
33
|
+
The current release packages a schema-first knowledge graph, reusable design skills, and browser/image QA workflows. Browser automation and image-model capabilities must be available in the consuming agent/project; the package itself does not provision them. Reference-fixture and skill smoke checks validate the process, while paired benchmarks remain the source for any comparative quality claim.
|
|
27
34
|
|
|
28
35
|
Do not claim broad product-quality improvement until benchmark evidence supports it across repeated runs.
|
package/docs/INDEX.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Read these files in order when you are new to AI Design Context or when an agent needs repository context.
|
|
4
4
|
|
|
5
|
+
For npm installation and the implemented-screen QA loop, see [Design and Browser QA](BROWSER_DESIGN_QA.md), [Agent Context](AGENT_CONTEXT.md), and [npm Releases](NPM_RELEASE.md).
|
|
6
|
+
|
|
5
7
|
AI Design Context is a connected knowledge graph. Each layer depends on the previous one:
|
|
6
8
|
|
|
7
9
|
```text
|
package/docs/NPM_RELEASE.md
CHANGED
|
@@ -34,7 +34,7 @@ The workflow uses a GitHub-hosted runner, Node.js 24, npm >=11.5.1, and `id-toke
|
|
|
34
34
|
|
|
35
35
|
1. Update `package.json` and `package-lock.json` to a new version, write its changelog, and run `npm run check` and `npm test`.
|
|
36
36
|
2. Commit and push the reviewed source, including the workflow and lockfile.
|
|
37
|
-
3. Create and push a tag matching `v<package.json version>`, such as `v0.
|
|
37
|
+
3. Create and push a tag matching `v<package.json version>`, such as `v0.5.1`.
|
|
38
38
|
4. Publish a GitHub Release for that tag. This triggers **Publish npm Package**.
|
|
39
39
|
5. Confirm the workflow succeeds, then verify the version in npm.
|
|
40
40
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Browser QA workflow smoke check
|
|
2
|
+
|
|
3
|
+
Date: 2026-10-06. Target: the unchanged `examples/todo-reference` fixture, served locally. Purpose: exercise the browser/image workflow documented by the new v0.5.0 skills. This is a smoke check, not a paired benchmark, quality score, accessibility certification, or promotion of graph maturity.
|
|
4
|
+
|
|
5
|
+
## Scope and reproduction
|
|
6
|
+
|
|
7
|
+
Open the fixture in Playwright's browser at 390x844 CSS pixels. Capture the default state. Submit the empty capture input, observe the alert `Enter a task before adding it.`, and capture the error state. Fill the input with `Review a long grocery list item and verify that its complete title remains readable on a narrow screen`; press Tab, capture keyboard focus on the submit button, then press Enter and capture the saved list.
|
|
8
|
+
|
|
9
|
+
Resize the same browser to 1440x900 and capture the list. Open `Pick up fruit for breakfast`, capture desktop details, then resize the open detail surface to 390x844 and capture the mobile layout. All seven resulting images were opened and visually inspected. The fixture's static header date is sample content, not the run date.
|
|
10
|
+
|
|
11
|
+
## Coverage
|
|
12
|
+
|
|
13
|
+
| Surface | Viewport | State/input | Evidence | Result |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| List and capture | 390x844 | Default | `mobile-default.png` | Inspected; primary capture action and list readable. |
|
|
16
|
+
| Capture | 390x844 | Empty submission | `mobile-error.png`, browser alert snapshot | Observed textual error and input focus. |
|
|
17
|
+
| Capture | 390x844 | Fill, Tab | `mobile-keyboard-focus.png`, active-element observation | Visible submit-button focus inspected. |
|
|
18
|
+
| List | 390x844 | Enter to save long title | `mobile-saved.png`, updated browser snapshot | Item inserted; title wraps in list. DOM observation: viewport and document scroll width both 390px. |
|
|
19
|
+
| List | 1440x900 | Saved state | `desktop-default.png` | Inspected; title wraps without visible collision. |
|
|
20
|
+
| Details | 1440x900 | Pointer opens item | `desktop-detail.png`, browser snapshot | Source list remains visible beside details. |
|
|
21
|
+
| Details | 390x844 | Resize open details | `mobile-detail.png` | Inspected mobile detail geometry; not proof of modal focus management. |
|
|
22
|
+
|
|
23
|
+
No confirmed blocking visual defect was established in the inspected captures. Overall verdict is **PARTIAL** for complete UI QA: tablet/neighboring breakpoints, physical touch, real virtual keyboard, full dialog keyboard cycle, loading timing/layout, retry, reduced motion, numeric contrast, clickable target measurements, and screen-reader behavior were not tested. No supplied design reference existed for layout comparison. The single input's horizontal text scroll is distinct from accidental page overflow.
|
|
24
|
+
|
|
25
|
+
## Skill behavior and package checks
|
|
26
|
+
|
|
27
|
+
The four skill documents passed metadata validation. Read-only application scenarios exercised missing browser/image evidence, existing-screen diagnosis, responsive emulation limits, and accessibility limitations. Reports separated observed evidence from unverified states and avoided inventing defects or broad passes. These are scenario checks, not estimates of population-level agent performance.
|
|
28
|
+
|
|
29
|
+
Automated tests separately verify packed installation, graph/source retrieval, discoverable launcher creation, preservation of local files, marker validation, and symlink preflight. See `tools/cli.test.mjs` and `tools/package.test.mjs`. Grounding uses existing `CHECK-00001` and applicable rules/research; the new skills remain outside the knowledge registry.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/examples/todo-reference/review-evidence/2026-10-06-skills-qa/mobile-keyboard-focus.png
ADDED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-design-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Evidence-driven design knowledge and context retrieval for AI coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dev Ik",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"tools/cli.mjs",
|
|
43
43
|
"tools/context.mjs",
|
|
44
44
|
"tools/init.mjs",
|
|
45
|
+
"tools/skills.mjs",
|
|
45
46
|
"tools/validate-knowledge.mjs",
|
|
46
47
|
"tools/validate-benchmark-evidence.mjs",
|
|
47
48
|
"tools/designlint.mjs",
|
package/skills/README.md
CHANGED
|
@@ -24,6 +24,16 @@ Use skills as an agent design team:
|
|
|
24
24
|
| `agent-context` | Read-only graph context retrieval for an implementation or review target. |
|
|
25
25
|
| `prompt-architect` | Graph-backed prompt structure and output contracts. |
|
|
26
26
|
| `knowledge-graph-architect` | Schema, registry, generated indexes, relationships, and validation scope. |
|
|
27
|
+
| `design-understand` | Diagnose an existing screen before choosing UI changes. |
|
|
28
|
+
| `visual-qa` | Inspect rendered screenshots and interactions; record defects and evidence coverage. |
|
|
29
|
+
| `responsive-check` | Execute viewport, overflow, wrapping, sticky-region, and mobile-input checks. |
|
|
30
|
+
| `accessibility-check` | Execute semantic, keyboard, dialog, error, target, and reduced-motion checks. |
|
|
31
|
+
|
|
32
|
+
## Installation and execution
|
|
33
|
+
|
|
34
|
+
The npm CLI's `init` installs missing namespaced launchers for all 20 skills under `.agents/skills/ai-design-context-<name>/SKILL.md`. Launchers use `npx --no-install ai-design-context skills show <name>` to read the current pinned workflow, so package upgrades do not overwrite customized local skill files. Existing local skills are preserved.
|
|
35
|
+
|
|
36
|
+
Use `npx ai-design-context skills list` to discover bundled workflows and `skills show visual-qa` to load a specific one. Browser automation and image analysis require tools/model capabilities supplied by the agent or project. See [Design and Browser QA](../docs/BROWSER_DESIGN_QA.md).
|
|
27
37
|
|
|
28
38
|
## Routing
|
|
29
39
|
|
|
@@ -46,3 +56,5 @@ Use `prompt-architect` when writing or reviewing agent prompts.
|
|
|
46
56
|
Use `knowledge-graph-architect` when schemas, registry records, generated indexes, or validation behavior are affected.
|
|
47
57
|
|
|
48
58
|
Use `design-reviewer` as the final quality gate.
|
|
59
|
+
|
|
60
|
+
For existing UI, start with `design-understand`. After implementation, use `visual-qa`, `responsive-check`, and `accessibility-check` to collect concrete browser/image evidence, then hand off to `design-reviewer`. Keep unverified states explicit; source inspection alone is not a rendered QA pass.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: accessibility-check
|
|
3
|
+
description: Use when implemented interactive UI needs practical checks of keyboard navigation, visible focus, accessible names, form labels and errors, dialog focus, touch targets, color-only status, or reduced motion. Skip legal certification and backend-only work.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Accessibility Check
|
|
7
|
+
|
|
8
|
+
Exercise the user's flow and inspect semantics as well as pixels. This execution skill complements `accessibility-reviewer`; it is not a conformance certificate.
|
|
9
|
+
|
|
10
|
+
Retrieve matching graph context and read applicable research, particularly `A11Y-001` through `A11Y-004`. Record the actual browser, viewport, data, states, and tools. If only source or a screenshot is available, identify that limited scope and mark behavioral checks unverified.
|
|
11
|
+
|
|
12
|
+
## Check the implemented flow
|
|
13
|
+
|
|
14
|
+
- Inspect semantic elements and accessible names. Buttons perform actions; links navigate. Inputs have associated labels. Icon-only controls have meaningful names or decorative icons are hidden. Prefer native elements; inspect existing custom controls without adding unnecessary ARIA.
|
|
15
|
+
- Use keyboard input to follow the primary journey. Check Tab and Shift+Tab order, visible focus, Enter/Space where relevant, and access to actions that also work with a pointer. For dialogs and sheets, observe initial focus, containment when modal, Escape behavior where supported, and focus restoration after closing. A role locator alone does not establish keyboard behavior.
|
|
16
|
+
- Trigger input errors and recovery. Observe specific textual messages, association with the affected input, retained values, and retry. Check applicable loading, success, and disabled states for understandable feedback and remaining navigation.
|
|
17
|
+
- Measure clickable target bounds, not just visible icons, when applying the graph's `A11Y-001`. Inspect responsive collision risks with `responsive-check`.
|
|
18
|
+
- Inspect focus and status in screenshots. For contrast, use actual foreground/background values and a suitable measurement tool; a visual impression cannot prove a numeric contrast ratio. State the applicable criterion and report unknown composite/translucent colors as unresolved. Status must remain understandable without color alone.
|
|
19
|
+
- When interaction motion exists, exercise the available reduced-motion preference and confirm equivalent function and feedback. Record any assistive-technology testing actually performed; browser DOM/role inspection does not prove screen-reader behavior.
|
|
20
|
+
|
|
21
|
+
For authorized fixes, preserve business logic, use the existing component system, and repeat the failed keyboard/error/state interaction. Capture focused evidence before and after where visible behavior is involved.
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
|
|
25
|
+
Return **scoped verdict | tools and conditions | confirmed findings | coverage gaps**. A finding includes severity, affected control/state, keyboard or pointer reproduction, measured/observed evidence, user impact, applicable graph rule or external criterion, fix, verified component/file, and retest status. Distinguish **checked**, **unverified**, and **not applicable** for labels/semantics, keyboard/focus, dialogs, errors/recovery, targets, contrast, reduced motion, and assistive technology. Missing evidence is not a pass or a confirmed implementation defect.
|
|
26
|
+
|
|
27
|
+
Sources: `CHECK-00001`, `RULE-00009` through `RULE-00013`, `research/accessibility/textual-error-recovery.md`, and `research/accessibility/keyboard-focus-and-interaction-motion.md`. [Playwright role and label locators](https://playwright.dev/docs/locators) provide useful semantic feedback but do not replace accessibility audits.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-understand
|
|
3
|
+
description: Use when an existing screen, screenshot, or layout must be understood before UI changes, visual polish, or redesign. Skip backend maintenance and greenfield product direction without an existing surface.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Understand an Existing Screen
|
|
7
|
+
|
|
8
|
+
Identify what the user is trying to accomplish before choosing visual changes. For a new product without an existing screen, use `product-designer` instead.
|
|
9
|
+
|
|
10
|
+
1. Record the user's goal, primary action, secondary actions, core objects, and current state. Separate observed behavior from assumptions and questions that affect the change.
|
|
11
|
+
2. Retrieve task context with `npx --no-install ai-design-context context --task "<matching phrase or known slug>" --intent implement`. Read the returned research and rules; use `--platform mobile` for narrow or touch-first screens. Record unresolved knowledge needs instead of inventing rules.
|
|
12
|
+
3. Inspect the actual screen or supplied image with the available browser/image tools. Use source inspection to identify existing components, semantic tokens, and responsive conventions. A screenshot describes one state, not the entire interaction model.
|
|
13
|
+
4. Diagnose hierarchy, layout, typography, spacing, component consistency, and relevant default, loading, empty, error, success, and disabled states. Explain how competition for attention affects the primary task. Distinguish concrete friction from an unsupported preference about product feel.
|
|
14
|
+
5. Propose the smallest changes that serve the stated goal. Keep business logic and the existing stack. New visual directions require user intent and upstream references, not only taste.
|
|
15
|
+
|
|
16
|
+
## Handoff
|
|
17
|
+
|
|
18
|
+
Return: **screen and user goal | primary/secondary actions | observed strengths and problems | assumptions and missing states | ranked improvements with graph/reference evidence | affected components/tokens | verification plan**. Rank up to three consequential problems when present; do not invent three defects to fill a quota.
|
|
19
|
+
|
|
20
|
+
Use `visual-designer` or `interaction-designer` for the selected change, `reference-driven-design` for requested new visual directions, and `visual-qa` after implementation. Preserve the evidence limits of all `draft` and `seed` graph objects.
|
|
21
|
+
|
|
22
|
+
Graph anchors: `RULE-00001` / `PRD-001` for the primary repeated action, `RULE-00004` / `IA-002` for object structure, `RULE-00008` / `VIS-001` for existing tokens, and `CHECK-00001` for state and review coverage. Their source research remains the basis of design advice.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: responsive-check
|
|
3
|
+
description: Use when a screen must be checked across mobile, tablet, laptop, or desktop sizes for overflow, wrapping, sticky overlaps, collapsed navigation, unreachable actions, sheets, dialogs, tables, filters, or charts. Skip non-UI maintenance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Responsive Check
|
|
7
|
+
|
|
8
|
+
Verify adaptation through browser behavior and inspected screenshots. This execution skill complements `mobile-ux-expert`, which guides touch-first product decisions.
|
|
9
|
+
|
|
10
|
+
## Scope and preparation
|
|
11
|
+
|
|
12
|
+
Identify the target devices, primary task, changed breakpoints, long-content cases, and relevant states. Retrieve focused graph context with `--platform mobile` and read the applicable research and rules. Use the project's actual breakpoints and device targets. Example CSS viewports for exploratory sampling are 390x844, 768x1024, and 1440x900; include narrower widths and just below/above affected breakpoints when the product supports them. These samples are not universal layout rules or a substitute for actual devices.
|
|
13
|
+
|
|
14
|
+
Use available browser tools or the project's existing Playwright setup. Record viewport dimensions, scale, theme, data, and state. If browser access is absent, provide a source/screenshot-limited review and mark unseen widths and interactions unverified.
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
1. Load the same flow at each selected width. Exercise capture/navigation, open and close sheets or dialogs, and scroll through long content and sticky regions.
|
|
19
|
+
2. Check horizontal page overflow, broken grids, long labels and entries, clipped text, navigation collapse, hidden primary actions, oversized dialogs, and controls obscured by sticky elements. For tables/charts, distinguish intentional bounded horizontal scrolling from accidental page overflow.
|
|
20
|
+
3. Observe wrapping and control placement before and after state changes, including loading, validation errors, retry, and success. Compare geometry when `PERF-001` applies.
|
|
21
|
+
4. Inspect images of each captured state and confirm suspected bounds with DOM measurements. Judge touch targets using the clickable area and the graph's `A11Y-001`, not icon dimensions alone.
|
|
22
|
+
5. For mobile input flows, record whether a real virtual keyboard was exercised. Desktop viewport emulation does not prove keyboard resizing, safe-area handling, or physical-device touch behavior. Mark those as gaps if relevant and untested.
|
|
23
|
+
6. After authorized fixes, repeat the failing width, relevant neighboring breakpoint, and affected wide layout. Capture before/after evidence under matching conditions.
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
Return a **scoped verdict**, then **viewport | state/action | observed behavior | screenshot/measurement | checked/unverified/not applicable**. Each confirmed issue includes severity, reproduction, user impact, graph/reference basis, focused fix, and verified component/file when known. Report breakpoint behavior and physical-device gaps separately. A screenshot at one size is not a responsive pass.
|
|
28
|
+
|
|
29
|
+
Sources: `CHECK-00001`, `RULE-00005` / `UX-001`, `RULE-00009` / `A11Y-001`, `RULE-00011` / `PERF-001`, and their retrieved source research. Use [Playwright emulation](https://playwright.dev/docs/emulation) for tool mechanics; it does not replace device evidence.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-qa
|
|
3
|
+
description: Use when an implemented screen, screenshot, or UI change needs visual QA for spacing, alignment, wrapping, clipping, overlap, hierarchy, component states, or comparison with a supplied design reference. Skip backend-only changes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Visual QA
|
|
7
|
+
|
|
8
|
+
Review observed UI against the user's task, existing design system, and retrieved graph context. This execution skill complements `design-reviewer`, which owns the final traceability review.
|
|
9
|
+
|
|
10
|
+
## Inputs and capabilities
|
|
11
|
+
|
|
12
|
+
Identify the screen, primary action, changed components, relevant states, target devices, and any supplied reference. Retrieve focused context with `npx --no-install ai-design-context context --review "<graph ID or matching phrase>" --intent qa`; read the returned research and rules. An arbitrary application path is not automatically a graph match.
|
|
13
|
+
|
|
14
|
+
Record which tools are actually available:
|
|
15
|
+
|
|
16
|
+
- A browser tool or the project's existing Playwright setup for navigation, viewport changes, clicks, keyboard input, scrolling, DOM measurements, and screenshots.
|
|
17
|
+
- An image-viewing tool and an image-capable model for inspecting captured pixels and references.
|
|
18
|
+
- Source and DOM inspection for relating a visible issue to its implementation.
|
|
19
|
+
|
|
20
|
+
If a capability is unavailable, continue with the available evidence and mark the missing checks **unverified**. Skills do not install browser binaries, provision model vision, or enable MCP tools. A code-only review cannot establish rendered quality; a screenshot cannot establish keyboard or responsive behavior.
|
|
21
|
+
|
|
22
|
+
## Browser and image loop
|
|
23
|
+
|
|
24
|
+
1. Open the actual implementation. Record its URL or fixture path, browser, viewport in CSS pixels, theme, zoom, data, and state. Exercise the primary action and relevant default, loading, empty, error, success, and disabled states; mark inapplicable states with a reason.
|
|
25
|
+
2. Check narrow and wide layouts with `responsive-check`. Open and close menus, dialogs, and sheets, scroll past sticky regions, and exercise keyboard focus with `accessibility-check`.
|
|
26
|
+
3. Save viewport screenshots for geometry and separate full-page screenshots for long content. Use the project's evidence convention; otherwise create a dated review folder under `output/playwright/`. Record the steps that reproduce each capture.
|
|
27
|
+
4. Open the captured images, not just their filenames. Inspect alignment, spacing consistency, typography, line breaks, clipped text, collisions, icon alignment, button/input sizing, content density, primary-action prominence, and state feedback. Confirm suspected geometry problems with DOM measurements where possible.
|
|
28
|
+
5. If a design reference exists, compare matching viewport, state, theme, content, and scale. Record unmatched conditions instead of attributing every pixel difference to a defect. Without a reference, assess task clarity and existing tokens; do not invent a target composition from taste.
|
|
29
|
+
6. For authorized fixes, make a focused patch, repeat the failed interaction, and recapture the same conditions. Run the project's relevant code checks. Preserve product logic and the existing UI stack.
|
|
30
|
+
|
|
31
|
+
## Report contract
|
|
32
|
+
|
|
33
|
+
Lead with **PASS**, **NEEDS WORK**, or **PARTIAL**, scoped to the surfaces and states actually reviewed. PARTIAL means missing evidence prevents completing that scope. Separate observed defects from coverage gaps; a skipped check is not a confirmed product defect.
|
|
34
|
+
|
|
35
|
+
For each finding, include:
|
|
36
|
+
|
|
37
|
+
| Field | Required evidence |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| ID and severity | Stable review-local ID; Critical, Major, Minor, or Polish based on impact on the primary task. |
|
|
40
|
+
| Surface and conditions | Screen/component, viewport, data/state, and input method. |
|
|
41
|
+
| Reproduction | Actions another reviewer can repeat. |
|
|
42
|
+
| Observed / expected | What happened; applicable rule, pattern, reference, or explicit knowledge gap. |
|
|
43
|
+
| Evidence | Screenshot path and inspected region; DOM measurement or interaction observation when available. |
|
|
44
|
+
| Impact and fix | User consequence, focused correction, likely file/component when verified. |
|
|
45
|
+
| Retest | Outcome and matching after-capture, or pending. |
|
|
46
|
+
|
|
47
|
+
Finish with a coverage table: **surface | viewport | state/input | evidence | checked/unverified/not applicable**. List missing tools and any reference-comparison gaps. Do not infer a global pass from one desktop screenshot.
|
|
48
|
+
|
|
49
|
+
## Graph anchors and tool references
|
|
50
|
+
|
|
51
|
+
- `CHECK-00001` / `checklists/DESIGN_QA.md`: state, responsive, accessibility, and evidence boundaries.
|
|
52
|
+
- `RULE-00008` / `VIS-001`: existing semantic tokens.
|
|
53
|
+
- `RULE-00014` / `VIS-002`: content and primary-action hierarchy.
|
|
54
|
+
- `RULE-00011` / `PERF-001`: loading-state layout stability.
|
|
55
|
+
- [Playwright screenshots](https://playwright.dev/docs/screenshots) and [emulation](https://playwright.dev/docs/emulation) describe capture and viewport capabilities, not proof that those tools are installed.
|
|
@@ -20,7 +20,7 @@ After setup, the product repository has:
|
|
|
20
20
|
|
|
21
21
|
## npm Installation
|
|
22
22
|
|
|
23
|
-
The package is
|
|
23
|
+
The package is published on npm. Run these commands from the product repository:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npm install --save-dev --save-exact ai-design-context
|
|
@@ -28,9 +28,11 @@ npx ai-design-context init
|
|
|
28
28
|
npx ai-design-context context --task quick-capture --platform mobile --intent implement
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
For local evaluation before a new version is published, run `npm pack` in the knowledge-source checkout, then install that generated `.tgz` with `npm install --save-dev /path/to/ai-design-context-0.5.0.tgz` in the product repository. The same `init`, `context`, and `skills` commands work with the local tarball.
|
|
32
32
|
|
|
33
|
-
`init` appends
|
|
33
|
+
`init` appends optional, marked context and design-review sections to the existing `AGENTS.md` and creates only missing files under `docs/`, `templates/`, `reviews/`, `benchmarks/`, and `.agents/skills/`. It preserves existing project-specific instructions, populated documents, edited integration blocks, and customized skill launchers. Repeat it safely to create newly missing templates or launchers; it does not refresh an existing block. An upgrade from `0.4.0` adds the new skill-routing section without changing the original block. Review any newly created placeholders and fill them with actual product context. There are no install hooks and no runtime dependencies.
|
|
34
|
+
|
|
35
|
+
The 20 namespaced launchers read current workflows from the pinned package. Use `npx ai-design-context skills list` and `npx ai-design-context skills show visual-qa`. Browser and image tools must be available in the agent/project; missing capabilities are recorded as unverified QA scope. See [Design and Browser QA](../docs/BROWSER_DESIGN_QA.md).
|
|
34
36
|
|
|
35
37
|
Ask the agent to use the returned absolute reading paths, read research and rules, and preserve evidence limits. JSON output includes `knowledgeRoot`, relative `path`, and `absolutePath`. `--review` matches graph identifiers or phrases rather than analyzing arbitrary product files.
|
|
36
38
|
|
package/starter-kit/README.md
CHANGED
|
@@ -27,6 +27,8 @@ research -> rules -> patterns -> prompts -> prototype -> review -> code -> bench
|
|
|
27
27
|
|
|
28
28
|
For an existing repository, start with `INSTALL_WITH_AGENT.md`. It tells an agent how to preserve current instructions and populated project documents.
|
|
29
29
|
|
|
30
|
+
The npm CLI's `init` also creates missing namespaced `.agents/skills` launchers and a separately marked design/browser-review section. Use `skills list` and `skills show <name>` to load current workflows from the pinned package. Browser tools and image analysis remain capabilities of the agent/project environment.
|
|
31
|
+
|
|
30
32
|
1. Fill `docs/PRD.md`.
|
|
31
33
|
2. Define users in `docs/PERSONAS.md`.
|
|
32
34
|
3. Map the core journey in `docs/USER_FLOWS.md`.
|
package/tools/cli.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { runContext } from './context.mjs';
|
|
6
6
|
import { initProject } from './init.mjs';
|
|
7
|
+
import { runSkills } from './skills.mjs';
|
|
7
8
|
|
|
8
9
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
10
|
const usage = `AI Design Context
|
|
@@ -13,9 +14,11 @@ Usage:
|
|
|
13
14
|
ai-design-context context --task <query> [--platform mobile] [--intent implement] [--format json]
|
|
14
15
|
ai-design-context context --review <object-id-or-phrase> [--intent qa]
|
|
15
16
|
ai-design-context context --object <object-id-or-slug>
|
|
17
|
+
ai-design-context skills list [--format json]
|
|
18
|
+
ai-design-context skills show <name> [--format json]
|
|
16
19
|
ai-design-context --version
|
|
17
20
|
|
|
18
|
-
init appends agent instructions and creates only missing
|
|
21
|
+
init appends agent instructions and creates only missing templates and skill launchers.
|
|
19
22
|
context reads the knowledge graph shipped with this installed package.
|
|
20
23
|
Requires Node.js 20 or later. See context --help for all retrieval options.`;
|
|
21
24
|
|
|
@@ -28,14 +31,18 @@ try {
|
|
|
28
31
|
console.log(version);
|
|
29
32
|
} else if (command === 'context') {
|
|
30
33
|
runContext(args, { root: packageRoot, readingPaths: true, command: 'ai-design-context context' });
|
|
34
|
+
} else if (command === 'skills') {
|
|
35
|
+
runSkills(args, packageRoot);
|
|
31
36
|
} else if (command === 'init') {
|
|
32
37
|
if (args.length === 1 && ['--help', '-h'].includes(args[0])) {
|
|
33
|
-
console.log('Usage: ai-design-context init\nAppend agent instructions and create only missing product templates in the current directory.');
|
|
38
|
+
console.log('Usage: ai-design-context init\nAppend agent instructions and create only missing product templates and namespaced .agents/skills launchers in the current directory.');
|
|
34
39
|
} else {
|
|
35
40
|
if (args.length > 0) throw new Error(`Unknown init argument: ${args[0]}`);
|
|
36
41
|
const result = initProject(process.cwd(), packageRoot);
|
|
37
42
|
console.log(result.instructionsAdded ? 'Added AI Design Context instructions to AGENTS.md.' : 'AI Design Context instructions already present; preserved the existing block.');
|
|
38
43
|
console.log(result.created.length ? `Created: ${result.created.join(', ')}` : 'No missing templates; existing files preserved.');
|
|
44
|
+
if (result.routingAdded) console.log('Added design and browser review skill routing.');
|
|
45
|
+
console.log(`Installed ${result.skillsInstalled.length} missing skill launcher(s); existing skills preserved.`);
|
|
39
46
|
}
|
|
40
47
|
} else {
|
|
41
48
|
throw new Error(`Unknown command or argument: ${command}\n${usage}`);
|
package/tools/init.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { skillCatalog, skillLauncher } from './skills.mjs';
|
|
3
4
|
|
|
4
5
|
const startMarker = '<!-- ai-design-context:start -->';
|
|
5
6
|
const endMarker = '<!-- ai-design-context:end -->';
|
|
7
|
+
const skillsStartMarker = '<!-- ai-design-context:skills:start -->';
|
|
8
|
+
const skillsEndMarker = '<!-- ai-design-context:skills:end -->';
|
|
6
9
|
const templates = [
|
|
7
10
|
'docs/PRD.md',
|
|
8
11
|
'docs/PERSONAS.md',
|
|
@@ -40,6 +43,27 @@ Treat \`draft\` and \`seed\` guidance as bounded evidence. Matching is lexical,
|
|
|
40
43
|
Use existing product documentation first. Fill any newly created starter-kit placeholders with actual product context; use \`reviews/DESIGN_REVIEW.md\` for UI review.
|
|
41
44
|
${endMarker}`;
|
|
42
45
|
|
|
46
|
+
const routingInstructions = `${skillsStartMarker}
|
|
47
|
+
## Design and browser review skills
|
|
48
|
+
|
|
49
|
+
AI Design Context installs namespaced workflow launchers under \`.agents/skills/\`. Start with \`ai-design-context-design-understand\` for an existing screen and \`ai-design-context-product-designer\` for product direction. Use visual, interaction, and design-system specialists for implementation within the existing stack.
|
|
50
|
+
|
|
51
|
+
After UI changes, use \`ai-design-context-visual-qa\`, \`ai-design-context-responsive-check\`, and \`ai-design-context-accessibility-check\`, then \`ai-design-context-design-reviewer\` for the final evidence and traceability review. Open the real UI with available browser tools or the project's Playwright setup, exercise the primary flow and relevant states, capture screenshots, inspect them with an image-capable model, make authorized fixes, and repeat the failed checks.
|
|
52
|
+
|
|
53
|
+
Use \`npx --no-install ai-design-context skills list\` and \`npx --no-install ai-design-context skills show <name>\` to load workflows from the installed package, including in agents without automatic local-skill discovery. Package upgrades refresh these source workflows without replacing customized launchers.
|
|
54
|
+
|
|
55
|
+
Report viewport, state, reproduction steps, screenshot paths, applicable graph rules, observed defects, and coverage gaps. A source-only review or single screenshot cannot establish complete visual, responsive, or keyboard QA. Missing browser or image tools must be reported as unverified checks, not passes. The package does not provision those tools or change the project's application dependencies.
|
|
56
|
+
${skillsEndMarker}`;
|
|
57
|
+
|
|
58
|
+
function hasValidBlock(content, start, end) {
|
|
59
|
+
const starts = content.split(start).length - 1;
|
|
60
|
+
const ends = content.split(end).length - 1;
|
|
61
|
+
if (starts !== ends || starts > 1 || (starts === 1 && content.indexOf(start) > content.indexOf(end))) {
|
|
62
|
+
throw new Error('Invalid AI Design Context markers in AGENTS.md; repair the marked block before running init.');
|
|
63
|
+
}
|
|
64
|
+
return starts === 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
43
67
|
function inspectTarget(root, relativePath) {
|
|
44
68
|
const parts = relativePath.split('/');
|
|
45
69
|
let current = root;
|
|
@@ -66,15 +90,15 @@ export function initProject(projectRoot, packageRoot) {
|
|
|
66
90
|
const agentsPath = path.join(root, 'AGENTS.md');
|
|
67
91
|
const agentsExists = inspectTarget(root, 'AGENTS.md');
|
|
68
92
|
const original = agentsExists ? fs.readFileSync(agentsPath, 'utf8') : '';
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
if (starts !== ends || starts > 1 || (starts === 1 && original.indexOf(startMarker) > original.indexOf(endMarker))) {
|
|
72
|
-
throw new Error('Invalid AI Design Context markers in AGENTS.md; repair the marked block before running init.');
|
|
73
|
-
}
|
|
93
|
+
const hasInstructions = hasValidBlock(original, startMarker, endMarker);
|
|
94
|
+
const hasRouting = hasValidBlock(original, skillsStartMarker, skillsEndMarker);
|
|
74
95
|
|
|
75
96
|
// Preflight all destinations and sources before writing any project files.
|
|
76
97
|
const missing = templates.filter((file) => !inspectTarget(root, file));
|
|
77
98
|
const contents = missing.map((file) => [file, fs.readFileSync(path.join(packageRoot, 'starter-kit', file))]);
|
|
99
|
+
const skillFiles = skillCatalog(packageRoot).map((skill) => ({ skill, file: `.agents/skills/${skill.installedName}/SKILL.md` }));
|
|
100
|
+
const missingSkills = skillFiles.filter(({ file }) => !inspectTarget(root, file));
|
|
101
|
+
contents.push(...missingSkills.map(({ skill, file }) => [file, skillLauncher(skill)]));
|
|
78
102
|
const created = [];
|
|
79
103
|
for (const [file, content] of contents) {
|
|
80
104
|
const target = path.join(root, file);
|
|
@@ -83,9 +107,10 @@ export function initProject(projectRoot, packageRoot) {
|
|
|
83
107
|
created.push(file);
|
|
84
108
|
}
|
|
85
109
|
|
|
86
|
-
|
|
110
|
+
const blocks = [!hasInstructions && instructions, !hasRouting && routingInstructions].filter(Boolean);
|
|
111
|
+
if (blocks.length > 0) {
|
|
87
112
|
const newline = original.includes('\r\n') ? '\r\n' : '\n';
|
|
88
|
-
const block =
|
|
113
|
+
const block = blocks.join('\n\n').replaceAll('\n', newline);
|
|
89
114
|
if (agentsExists) {
|
|
90
115
|
const separator = original.endsWith(newline) ? newline : `${newline}${newline}`;
|
|
91
116
|
fs.appendFileSync(agentsPath, `${separator}${block}${newline}`);
|
|
@@ -95,5 +120,5 @@ export function initProject(projectRoot, packageRoot) {
|
|
|
95
120
|
}
|
|
96
121
|
}
|
|
97
122
|
|
|
98
|
-
return { created, instructionsAdded:
|
|
123
|
+
return { created, instructionsAdded: !hasInstructions, routingAdded: !hasRouting, skillsInstalled: missingSkills.map(({ skill }) => skill.installedName) };
|
|
99
124
|
}
|
package/tools/skills.mjs
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export function skillCatalog(root) {
|
|
5
|
+
const directory = path.join(root, 'skills');
|
|
6
|
+
return fs.readdirSync(directory, { withFileTypes: true })
|
|
7
|
+
.filter((entry) => entry.isDirectory())
|
|
8
|
+
.sort((left, right) => left.name.localeCompare(right.name))
|
|
9
|
+
.map((entry) => {
|
|
10
|
+
const relativePath = `skills/${entry.name}/SKILL.md`;
|
|
11
|
+
const absolutePath = path.join(root, relativePath);
|
|
12
|
+
const content = fs.readFileSync(absolutePath, 'utf8');
|
|
13
|
+
const frontMatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/)?.[1];
|
|
14
|
+
const name = frontMatter?.match(/^name:\s*(.+)$/m)?.[1].trim();
|
|
15
|
+
const rawDescription = frontMatter?.match(/^description:\s*(.+)$/m)?.[1].trim();
|
|
16
|
+
const description = rawDescription?.replace(/^(["'])(.*)\1$/, '$2');
|
|
17
|
+
if (name !== entry.name || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name) || !description) {
|
|
18
|
+
throw new Error(`Invalid skill metadata: ${relativePath}`);
|
|
19
|
+
}
|
|
20
|
+
return { name, installedName: `ai-design-context-${name}`, description, path: relativePath, absolutePath, content };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function skillLauncher(skill) {
|
|
25
|
+
return `---
|
|
26
|
+
name: ${skill.installedName}
|
|
27
|
+
description: ${JSON.stringify(skill.description)}
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# AI Design Context: ${skill.name}
|
|
31
|
+
|
|
32
|
+
Load the current workflow from the project's installed, lockfile-pinned package:
|
|
33
|
+
|
|
34
|
+
\`\`\`bash
|
|
35
|
+
npx --no-install ai-design-context skills show ${skill.name}
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
Read and apply the returned workflow before acting. Its source location and knowledge root identify where supporting files live. In a product repository, use \`npx --no-install ai-design-context context\` in place of checkout-only \`npm run context --\` examples. Resolve focused graph context and read applicable research and rules before making design decisions.
|
|
39
|
+
|
|
40
|
+
Preserve existing project instructions and user scope. Use available browser and image tools for rendered checks; record unavailable capabilities and unverified states. This launcher installs instructions, not browser binaries or model vision. Other bundled workflows can be read with \`npx --no-install ai-design-context skills list\` and \`skills show <name>\`.
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function runSkills(argv, root) {
|
|
45
|
+
const usage = 'Usage: ai-design-context skills list [--format json]\n ai-design-context skills show <name> [--format json]';
|
|
46
|
+
if (argv.length === 1 && ['--help', '-h'].includes(argv[0])) {
|
|
47
|
+
console.log(usage);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const args = [...argv];
|
|
51
|
+
const formatIndex = args.indexOf('--format');
|
|
52
|
+
let format = 'markdown';
|
|
53
|
+
if (formatIndex >= 0) {
|
|
54
|
+
format = args[formatIndex + 1];
|
|
55
|
+
args.splice(formatIndex, 2);
|
|
56
|
+
}
|
|
57
|
+
if (!['markdown', 'json'].includes(format)) throw new Error('--format must be markdown or json');
|
|
58
|
+
const [action = 'list', name] = args;
|
|
59
|
+
if ((action === 'list' && args.length > 1) || (action === 'show' && args.length !== 2) || !['list', 'show'].includes(action)) {
|
|
60
|
+
throw new Error(usage);
|
|
61
|
+
}
|
|
62
|
+
const skills = skillCatalog(root);
|
|
63
|
+
const { version } = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
64
|
+
const common = { version, knowledgeRoot: root };
|
|
65
|
+
if (action === 'show') {
|
|
66
|
+
const skill = skills.find((entry) => entry.name === name);
|
|
67
|
+
if (!skill) throw new Error(`Unknown skill: ${name}`);
|
|
68
|
+
console.log(format === 'json' ? JSON.stringify({ ...common, ...skill }, null, 2)
|
|
69
|
+
: `Source: ${skill.absolutePath}\nKnowledge root: ${root}\nPackage version: ${version}\n\nIn product repositories, use npx --no-install ai-design-context context for graph retrieval. Resolve paths in this workflow relative to the knowledge root or its source directory.\n\n${skill.content}`);
|
|
70
|
+
} else {
|
|
71
|
+
const entries = skills.map(({ content, ...skill }) => skill);
|
|
72
|
+
console.log(format === 'json' ? JSON.stringify({ ...common, skills: entries }, null, 2)
|
|
73
|
+
: `# AI Design Context Skills (${version})\n\n${entries.map((skill) => `- ${skill.name}: ${skill.description}\n Source: ${skill.absolutePath}\n Installed launcher: ${skill.installedName}`).join('\n')}`);
|
|
74
|
+
}
|
|
75
|
+
}
|