@fringetools/cli 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,8 @@
1
+ interface CliOpts {
2
+ log?: (s: string) => void;
3
+ cwd?: string;
4
+ err?: (s: string) => void;
5
+ }
6
+ declare function runCli(argv: string[], opts?: CliOpts): Promise<number>;
7
+
8
+ export { type CliOpts, runCli };
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import {
2
+ runCli
3
+ } from "./chunk-W23H5MXS.js";
4
+ export {
5
+ runCli
6
+ };
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@fringetools/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "bin": {
7
+ "fringe": "dist/bin.js"
8
+ },
9
+ "engines": {
10
+ "node": ">=18"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "skill"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsup src/index.ts src/bin.ts --format esm --dts --outDir dist --clean",
18
+ "test": "vitest run",
19
+ "prepublishOnly": "pnpm build && pnpm test"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^22.0.0",
23
+ "tsup": "^8.0.0",
24
+ "typescript": "^5.5.0",
25
+ "vitest": "^2.0.0"
26
+ },
27
+ "dependencies": {
28
+ "@babel/parser": "^7.29.9",
29
+ "parse5": "^7.3.0",
30
+ "postcss": "^8.5.31"
31
+ },
32
+ "description": "UX-quality checker for AI coding agents: accessibility, states, dark patterns, token drift, AI-look.",
33
+ "keywords": [
34
+ "accessibility",
35
+ "a11y",
36
+ "lint",
37
+ "ux",
38
+ "ai-agents",
39
+ "claude-code"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/skc-learn/fringe.git",
47
+ "directory": "packages/cli"
48
+ },
49
+ "homepage": "https://github.com/skc-learn/fringe#readme",
50
+ "bugs": {
51
+ "url": "https://github.com/skc-learn/fringe/issues"
52
+ }
53
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: fringe
3
+ description: Use when writing or changing frontend code (JSX/TSX, HTML, CSS, Vue, Svelte). Runs the Fringe checker so accessibility, state handling, dark patterns, token drift and the generic "AI look" are measured, not guessed.
4
+ ---
5
+
6
+ # Fringe
7
+
8
+ Command: use `fringe` if it is on the PATH, otherwise `npx -y @fringetools/cli` in its place (e.g. `npx -y @fringetools/cli check --json .`).
9
+
10
+ Ponytail trims your code. Fringe handles your edges. Work the ladder in order.
11
+
12
+ 1. **Flow (judged).** Before building, ask what the user can skip. Cut steps, screens or options nobody needs. Write each decision with its evidence to `.fringe/manifest.json`: `{"flows":[{"action":"cut"|"kept","what":"...","evidence":"..."}]}`. No evidence, no cut.
13
+ 2. **Edges (verified, gates).** After every edit the hook runs `fringe check --claude-hook` and feeds errors back to you. Fix every listed finding. If there is no hook, run `fringe check --hook` yourself from the project root and do not finish while `block` is `true`.
14
+ 3. **Polish (verified, never gates).** Run `fringe check` once before finishing. Fix `review` items you agree with. Fix `signal` items that are cheap. Say which you left and why.
15
+
16
+ When done: `fringe check --record --manifest .fringe/manifest.json`. Report the health score as measured; never estimate it yourself.
17
+
18
+ Rules of the road:
19
+ - Never grade your own work where the checker can measure it.
20
+ - Do not silence a rule with `ignore`/`disable` in `fringe.config.json` to get green. Fix the code, or tell the user why the rule is wrong.
21
+ - A `// fringe-ignore FR-123` comment is allowed only for a real false positive. Say so in your final message with the rule and why; the run output counts suppressions (`N suppressed`) and a reviewer will see them.
22
+ - If `fringe` is not installed, say so. Do not skip the check silently.
23
+ - Hook wiring and the full rule table: `packages/cli/README.md`.
package/skill/audit.md ADDED
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: fringe-audit
3
+ description: Use when the user wants a whole-repo UX/accessibility audit, a plan for an existing frontend with many problems, or to adopt Fringe on a messy repo ("audit this codebase", "where do we start", "adopt fringe"). Produces a prioritized plan and sets a baseline.
4
+ ---
5
+
6
+ # Fringe audit
7
+
8
+ Command: use `fringe` if it is on the PATH, otherwise `npx -y @fringetools/cli` in its place (e.g. `npx -y @fringetools/cli check --json .`).
9
+
10
+ 1. Run `fringe check --json .` and note the totals. Do not print every finding.
11
+ 2. Summarize as a plan:
12
+ - Totals by severity and the health score, plus files scanned and skipped.
13
+ - **Top rules** by count, and **top files** by error count (the 5 worst of each).
14
+ - For each top rule: what it means in one sentence, a typical fix, and whether it is likely mechanical (add `aria-label`, add `alt`) or needs design judgment.
15
+ - A suggested order: mechanical `error` fixes first, then `error`s needing judgment, then `review`, then `signal`.
16
+ 3. Offer the baseline: "`fringe check --update-baseline` records today's findings so only new problems gate; commit `fringe.baseline.json`." Run it only if the user agrees.
17
+ 4. Ask before changing code. If the user says go, fix one rule at a time, re-run `fringe check` after each, and re-baseline at the end so the file shrinks.
18
+
19
+ Spot-check a few reported findings by reading the code before presenting them as certain; Fringe is static and can be wrong. Say which you checked.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: fringe-review
3
+ description: Use when the user asks to review, check or critique a UI, page or component for accessibility and UX edges ("review this page", "what's wrong with this form", "is this accessible"). Runs Fringe and reports ranked findings with fixes, in plain English.
4
+ ---
5
+
6
+ # Fringe review
7
+
8
+ Command: use `fringe` if it is on the PATH, otherwise `npx -y @fringetools/cli` in its place (e.g. `npx -y @fringetools/cli check --json .`).
9
+
10
+ 1. Run `fringe check --json .` from the project root. Fringe takes directories, not single files, so if the user named one file or page, run on the folder and keep only the findings whose `loc.file` matches it.
11
+ 2. Report in plain English, no jargon left unexplained:
12
+ - **Must fix** — `error` findings. Group by rule. For each: where (`file:line`), what is wrong in one sentence, the exact fix, and who is hurt (for example "a screen reader says only 'button'"). Cite the `wcag` criterion when present.
13
+ - **Worth a look** — `review` findings. These are heuristics: say they need your judgment, and give your call on each.
14
+ - **Polish** — `signal` findings, only the top few. Never present them as bugs.
15
+ 3. End with the health score as measured, the count by severity, and one line on what was not checked (Fringe is static: it cannot judge contrast on images, real focus order, or whether copy is good).
16
+ 4. Change no code unless asked. If asked to fix, fix `error` items first and re-run to confirm.
17
+
18
+ Do not invent findings the tool did not report, and do not call the score an estimate: it is measured.