waypoint-skills 1.3.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.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +348 -0
  3. package/README.npm.md +56 -0
  4. package/cli/bin/cli.js +127 -0
  5. package/cli/bin/lib/paths.mjs +31 -0
  6. package/cli/bin/postinstall.mjs +25 -0
  7. package/manifest.json +107 -0
  8. package/package.json +44 -0
  9. package/packages/agents/inspiration-scout.md +105 -0
  10. package/packages/agents/orchestrator.md +186 -0
  11. package/packages/agents/scrutiny-validator.md +136 -0
  12. package/packages/agents/user-testing-validator.md +171 -0
  13. package/packages/agents/validator.md +102 -0
  14. package/packages/agents/worker.md +116 -0
  15. package/packages/agents/wp-router.md +69 -0
  16. package/packages/hooks/hooks.json.example +12 -0
  17. package/packages/hooks/templates/mission-worktree-bootstrap.sh +88 -0
  18. package/packages/hooks/templates/run-assertions.sh +48 -0
  19. package/packages/rules/adversarial-context-isolation.mdc +57 -0
  20. package/packages/rules/serial-git-enforcement.mdc +77 -0
  21. package/packages/skills/caveman/SKILL.md +78 -0
  22. package/packages/skills/design-taste-frontend/SKILL.md +1206 -0
  23. package/packages/skills/gpt-taste/SKILL.md +74 -0
  24. package/packages/skills/impeccable/SKILL.md +164 -0
  25. package/packages/skills/impeccable/reference/adapt.md +311 -0
  26. package/packages/skills/impeccable/reference/animate.md +201 -0
  27. package/packages/skills/impeccable/reference/audit.md +133 -0
  28. package/packages/skills/impeccable/reference/bolder.md +120 -0
  29. package/packages/skills/impeccable/reference/brand.md +108 -0
  30. package/packages/skills/impeccable/reference/clarify.md +288 -0
  31. package/packages/skills/impeccable/reference/codex.md +105 -0
  32. package/packages/skills/impeccable/reference/colorize.md +257 -0
  33. package/packages/skills/impeccable/reference/craft.md +123 -0
  34. package/packages/skills/impeccable/reference/critique.md +780 -0
  35. package/packages/skills/impeccable/reference/delight.md +302 -0
  36. package/packages/skills/impeccable/reference/distill.md +111 -0
  37. package/packages/skills/impeccable/reference/document.md +429 -0
  38. package/packages/skills/impeccable/reference/extract.md +69 -0
  39. package/packages/skills/impeccable/reference/harden.md +347 -0
  40. package/packages/skills/impeccable/reference/hooks.md +90 -0
  41. package/packages/skills/impeccable/reference/init.md +172 -0
  42. package/packages/skills/impeccable/reference/interaction-design.md +189 -0
  43. package/packages/skills/impeccable/reference/layout.md +161 -0
  44. package/packages/skills/impeccable/reference/live.md +718 -0
  45. package/packages/skills/impeccable/reference/onboard.md +234 -0
  46. package/packages/skills/impeccable/reference/optimize.md +258 -0
  47. package/packages/skills/impeccable/reference/overdrive.md +130 -0
  48. package/packages/skills/impeccable/reference/polish.md +241 -0
  49. package/packages/skills/impeccable/reference/product.md +60 -0
  50. package/packages/skills/impeccable/reference/quieter.md +99 -0
  51. package/packages/skills/impeccable/reference/shape.md +165 -0
  52. package/packages/skills/impeccable/reference/typeset.md +279 -0
  53. package/packages/skills/impeccable/scripts/command-metadata.json +94 -0
  54. package/packages/skills/impeccable/scripts/context-signals.mjs +225 -0
  55. package/packages/skills/impeccable/scripts/context.mjs +961 -0
  56. package/packages/skills/impeccable/scripts/critique-storage.mjs +242 -0
  57. package/packages/skills/impeccable/scripts/detect-csp.mjs +198 -0
  58. package/packages/skills/impeccable/scripts/detect.mjs +21 -0
  59. package/packages/skills/impeccable/scripts/detector/browser/injected/index.mjs +1937 -0
  60. package/packages/skills/impeccable/scripts/detector/cli/main.mjs +290 -0
  61. package/packages/skills/impeccable/scripts/detector/design-system.mjs +750 -0
  62. package/packages/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +5185 -0
  63. package/packages/skills/impeccable/scripts/detector/detect-antipatterns.mjs +50 -0
  64. package/packages/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +277 -0
  65. package/packages/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +568 -0
  66. package/packages/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1015 -0
  67. package/packages/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +234 -0
  68. package/packages/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  69. package/packages/skills/impeccable/scripts/detector/findings.mjs +12 -0
  70. package/packages/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
  71. package/packages/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
  72. package/packages/skills/impeccable/scripts/detector/registry/antipatterns.mjs +459 -0
  73. package/packages/skills/impeccable/scripts/detector/rules/checks.mjs +2707 -0
  74. package/packages/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
  75. package/packages/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
  76. package/packages/skills/impeccable/scripts/detector/shared/inline-ignores.mjs +148 -0
  77. package/packages/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
  78. package/packages/skills/impeccable/scripts/hook-admin.mjs +660 -0
  79. package/packages/skills/impeccable/scripts/hook-before-edit.mjs +476 -0
  80. package/packages/skills/impeccable/scripts/hook-lib.mjs +1632 -0
  81. package/packages/skills/impeccable/scripts/hook.mjs +61 -0
  82. package/packages/skills/impeccable/scripts/lib/design-parser.mjs +842 -0
  83. package/packages/skills/impeccable/scripts/lib/impeccable-config.mjs +638 -0
  84. package/packages/skills/impeccable/scripts/lib/impeccable-paths.mjs +128 -0
  85. package/packages/skills/impeccable/scripts/lib/is-generated.mjs +69 -0
  86. package/packages/skills/impeccable/scripts/lib/target-args.mjs +42 -0
  87. package/packages/skills/impeccable/scripts/live/browser-script-parts.mjs +49 -0
  88. package/packages/skills/impeccable/scripts/live/completion.mjs +19 -0
  89. package/packages/skills/impeccable/scripts/live/event-validation.mjs +137 -0
  90. package/packages/skills/impeccable/scripts/live/insert-ui.mjs +458 -0
  91. package/packages/skills/impeccable/scripts/live/manual-apply.mjs +939 -0
  92. package/packages/skills/impeccable/scripts/live/manual-edit-routes.mjs +357 -0
  93. package/packages/skills/impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
  94. package/packages/skills/impeccable/scripts/live/session-store.mjs +289 -0
  95. package/packages/skills/impeccable/scripts/live/svelte-component.mjs +826 -0
  96. package/packages/skills/impeccable/scripts/live/sveltekit-adapter.mjs +274 -0
  97. package/packages/skills/impeccable/scripts/live/ui-core.mjs +180 -0
  98. package/packages/skills/impeccable/scripts/live/vocabulary.mjs +36 -0
  99. package/packages/skills/impeccable/scripts/live-accept.mjs +812 -0
  100. package/packages/skills/impeccable/scripts/live-browser-dom.js +146 -0
  101. package/packages/skills/impeccable/scripts/live-browser-session.js +123 -0
  102. package/packages/skills/impeccable/scripts/live-browser.js +11173 -0
  103. package/packages/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
  104. package/packages/skills/impeccable/scripts/live-complete.mjs +75 -0
  105. package/packages/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
  106. package/packages/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  107. package/packages/skills/impeccable/scripts/live-inject.mjs +583 -0
  108. package/packages/skills/impeccable/scripts/live-insert.mjs +272 -0
  109. package/packages/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
  110. package/packages/skills/impeccable/scripts/live-poll.mjs +384 -0
  111. package/packages/skills/impeccable/scripts/live-resume.mjs +94 -0
  112. package/packages/skills/impeccable/scripts/live-server.mjs +1135 -0
  113. package/packages/skills/impeccable/scripts/live-status.mjs +61 -0
  114. package/packages/skills/impeccable/scripts/live-target.mjs +30 -0
  115. package/packages/skills/impeccable/scripts/live-wrap.mjs +894 -0
  116. package/packages/skills/impeccable/scripts/live.mjs +297 -0
  117. package/packages/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  118. package/packages/skills/impeccable/scripts/palette.mjs +633 -0
  119. package/packages/skills/impeccable/scripts/pin.mjs +214 -0
  120. package/packages/skills/ponytail/SKILL.md +117 -0
  121. package/packages/skills/stitch-design-taste/DESIGN.md +121 -0
  122. package/packages/skills/stitch-design-taste/SKILL.md +184 -0
  123. package/packages/skills/waypoint/SKILL.md +67 -0
  124. package/packages/skills/wp/SKILL.md +330 -0
  125. package/packages/skills/wp/caveman-wire.md +148 -0
  126. package/packages/skills/wp/reference.md +411 -0
  127. package/scripts/detect-platform.sh +32 -0
  128. package/scripts/install.sh +123 -0
  129. package/scripts/lib/common.sh +215 -0
  130. package/scripts/sync-skills.sh +21 -0
  131. package/scripts/uninstall.sh +38 -0
  132. package/scripts/waypoint +281 -0
@@ -0,0 +1,290 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ import { loadDesignSystemForCwd } from '../design-system.mjs';
5
+ import { createBrowserDetector, detectUrl } from '../engines/browser/detect-url.mjs';
6
+ import { detectHtml } from '../engines/static-html/detect-html.mjs';
7
+ import { detectText } from '../engines/regex/detect-text.mjs';
8
+ import {
9
+ filterDetectionFindings,
10
+ readDetectionConfig,
11
+ shouldIgnoreDetectionFile,
12
+ } from '../../lib/impeccable-config.mjs';
13
+ import {
14
+ HTML_EXTENSIONS,
15
+ buildImportGraph,
16
+ detectFrameworkConfig,
17
+ isPortListening,
18
+ walkDir,
19
+ } from '../node/file-system.mjs';
20
+
21
+ // ---------------------------------------------------------------------------
22
+ // Output formatting
23
+ // ---------------------------------------------------------------------------
24
+
25
+ function formatFindingSummary(count) {
26
+ return `${count} anti-pattern${count === 1 ? '' : 's'} found.`;
27
+ }
28
+
29
+ function formatFindings(findings, jsonMode) {
30
+ if (jsonMode) return JSON.stringify(findings, null, 2);
31
+
32
+ const grouped = {};
33
+ for (const f of findings) {
34
+ if (!grouped[f.file]) grouped[f.file] = [];
35
+ grouped[f.file].push(f);
36
+ }
37
+ const out = [];
38
+ for (const [file, items] of Object.entries(grouped)) {
39
+ const importNote = items[0]?.importedBy?.length ? ` (imported by ${items[0].importedBy.join(', ')})` : '';
40
+ out.push(`\n${file}${importNote}`);
41
+ for (const item of items) {
42
+ out.push(` ${item.line ? `line ${item.line}: ` : ''}[${item.antipattern}] ${item.snippet}`);
43
+ out.push(` → ${item.description}`);
44
+ }
45
+ }
46
+ out.push(`\n${formatFindingSummary(findings.length)}`);
47
+ return out.join('\n');
48
+ }
49
+
50
+ // ---------------------------------------------------------------------------
51
+ // Stdin handling
52
+ // ---------------------------------------------------------------------------
53
+
54
+ async function handleStdin(options = {}) {
55
+ const chunks = [];
56
+ for await (const chunk of process.stdin) chunks.push(chunk);
57
+ const input = Buffer.concat(chunks).toString('utf-8');
58
+ try {
59
+ const parsed = JSON.parse(input);
60
+ const fp = parsed?.tool_input?.file_path;
61
+ if (fp && fs.existsSync(fp)) {
62
+ return HTML_EXTENSIONS.has(path.extname(fp).toLowerCase())
63
+ ? detectHtml(fp, options) : detectText(fs.readFileSync(fp, 'utf-8'), fp, options);
64
+ }
65
+ } catch { /* not JSON */ }
66
+ return detectText(input, '<stdin>', options);
67
+ }
68
+
69
+
70
+ // ---------------------------------------------------------------------------
71
+ // CLI
72
+ // ---------------------------------------------------------------------------
73
+
74
+ async function confirm(question) {
75
+ const rl = (await import('node:readline')).default.createInterface({
76
+ input: process.stdin, output: process.stderr,
77
+ });
78
+ return new Promise((resolve) => {
79
+ rl.question(`${question} [Y/n] `, (answer) => {
80
+ rl.close();
81
+ resolve(!answer || /^y(es)?$/i.test(answer.trim()));
82
+ });
83
+ });
84
+ }
85
+
86
+ function printUsage() {
87
+ console.log(`Usage: impeccable detect [options] [file-or-dir-or-url...]
88
+
89
+ Scan files or URLs for UI anti-patterns and design quality issues.
90
+
91
+ Options:
92
+ --json Output results as JSON
93
+ --quiet In text mode, only print the final findings count
94
+ --gpt Also report GPT-specific provider tells (off by default)
95
+ --gemini Also report Gemini-specific provider tells (off by default)
96
+ --no-config Do not apply project config, detector ignores, inline
97
+ ignore comments, or DESIGN.md
98
+ --no-inline-ignores Do not honor in-file impeccable-disable* ignore comments
99
+ --no-design-system Do not load local DESIGN.md / .impeccable/design.json context
100
+ --help Show this help message
101
+
102
+ Project config:
103
+ Respects .impeccable/config.json and .impeccable/config.local.json detector
104
+ settings: detector.ignoreRules, detector.ignoreFiles, detector.ignoreValues,
105
+ and detector.designSystem.enabled.
106
+
107
+ Inline ignores:
108
+ In-file comments waive a finding where it lives and travel with the file:
109
+ <!-- impeccable-disable overused-font -- exported brand doc -->
110
+ .brand { font-family: Inter } /* impeccable-disable-line overused-font */
111
+ // impeccable-disable-next-line bounce-easing: intentional bounce
112
+ impeccable-disable applies to the whole file; -line / -next-line are scoped.
113
+ List one or more rule ids (comma-separated), or omit them / use * for all.
114
+
115
+ Detection modes:
116
+ HTML files Static HTML/CSS analysis (default, catches linked CSS)
117
+ Non-HTML files Regex pattern matching (CSS, JSX, TSX, etc.)
118
+ URLs Puppeteer full browser rendering (auto-detected)
119
+
120
+ Examples:
121
+ impeccable detect src/
122
+ impeccable detect index.html
123
+ impeccable detect https://example.com
124
+ impeccable detect --json .
125
+ impeccable detect --no-config src/`);
126
+ }
127
+
128
+ async function detectCli() {
129
+ let args = process.argv.slice(2).map(arg => {
130
+ if (arg === '-json') return '--json';
131
+ if (arg === '-fast') return '--fast';
132
+ return arg;
133
+ });
134
+ if (args[0] === 'detect') args = args.slice(1);
135
+ const jsonMode = args.includes('--json');
136
+ const quietMode = args.includes('--quiet');
137
+ const helpMode = args.includes('--help');
138
+ // --fast (regex-only) is deprecated: since the jsdom removal, the static
139
+ // HTML/CSS analysis is fast and covers every rule, so the regex-only path
140
+ // only loses coverage for no real speed win. Accept the flag for back-compat
141
+ // but ignore it and run the full scan.
142
+ if (args.includes('--fast')) {
143
+ process.stderr.write(
144
+ 'Note: --fast is deprecated and ignored. The full scan is fast now and runs every rule.\n',
145
+ );
146
+ }
147
+ const configEnabled = !args.includes('--no-config');
148
+ const detectionConfig = configEnabled
149
+ ? readDetectionConfig(process.cwd())
150
+ : { ignoreRules: [], ignoreFiles: [], ignoreValues: [] };
151
+ const providers = [];
152
+ if (args.includes('--gpt')) providers.push('gpt');
153
+ if (args.includes('--gemini')) providers.push('gemini');
154
+ const designSystemEnabled = configEnabled && !args.includes('--no-design-system') && detectionConfig.designSystem?.enabled !== false;
155
+ const designSystem = designSystemEnabled ? loadDesignSystemForCwd(process.cwd()) : null;
156
+ // Inline `impeccable-disable*` waivers are part of the scanned file, so they
157
+ // apply by default. `--no-config` (raw scan) and the dedicated
158
+ // `--no-inline-ignores` both turn them off.
159
+ const inlineIgnoresEnabled = configEnabled && !args.includes('--no-inline-ignores');
160
+ const scanOptions = { providers, inlineIgnores: inlineIgnoresEnabled };
161
+ if (designSystem) scanOptions.designSystem = designSystem;
162
+ const targets = args.filter(a => !a.startsWith('--'));
163
+
164
+ if (helpMode) { printUsage(); process.exit(0); }
165
+
166
+ let allFindings = [];
167
+
168
+ if (!process.stdin.isTTY && targets.length === 0) {
169
+ allFindings = await handleStdin(scanOptions);
170
+ } else {
171
+ const paths = targets.length > 0 ? targets : [process.cwd()];
172
+ const urlTargetCount = paths.filter(target => /^https?:\/\//i.test(target)).length;
173
+ const browserDetector = urlTargetCount > 1 ? await createBrowserDetector() : null;
174
+
175
+ try {
176
+ for (const target of paths) {
177
+ if (/^https?:\/\//i.test(target)) {
178
+ try {
179
+ const scanner = browserDetector
180
+ ? (url) => browserDetector.detectUrl(url, scanOptions)
181
+ : (url) => detectUrl(url, scanOptions);
182
+ allFindings.push(...await scanner(target));
183
+ } catch (e) { process.stderr.write(`Error: ${e.message}\n`); }
184
+ continue;
185
+ }
186
+
187
+ const resolved = path.resolve(target);
188
+ let stat;
189
+ try { stat = fs.statSync(resolved); }
190
+ catch { process.stderr.write(`Warning: cannot access ${target}\n`); continue; }
191
+
192
+ if (stat.isDirectory()) {
193
+ // Check for framework dev server config (skip in JSON/quiet modes to avoid polluting output)
194
+ if (!jsonMode && !quietMode) {
195
+ const fwConfig = detectFrameworkConfig(resolved);
196
+ if (fwConfig) {
197
+ const probe = await isPortListening(fwConfig.port, fwConfig.fingerprint);
198
+ if (probe.listening && probe.matched) {
199
+ process.stderr.write(
200
+ `\n${fwConfig.name} dev server detected on localhost:${fwConfig.port}.\n` +
201
+ `For more accurate results, scan the running site:\n` +
202
+ ` npx impeccable detect http://localhost:${fwConfig.port}\n\n`
203
+ );
204
+ } else if (probe.listening && !probe.matched) {
205
+ process.stderr.write(
206
+ `\n${fwConfig.name} project detected (${path.basename(fwConfig.configPath)}).\n` +
207
+ `Port ${fwConfig.port} is in use by another service. Start the ${fwConfig.name} dev server and scan via URL for best results.\n\n`
208
+ );
209
+ } else {
210
+ process.stderr.write(
211
+ `\n${fwConfig.name} project detected (${path.basename(fwConfig.configPath)}).\n` +
212
+ `Start the dev server and scan via URL for best results:\n` +
213
+ ` npx impeccable detect http://localhost:${fwConfig.port}\n\n`
214
+ );
215
+ }
216
+ }
217
+ }
218
+
219
+ const files = walkDir(resolved)
220
+ .filter(file => !shouldIgnoreDetectionFile(file, process.cwd(), detectionConfig));
221
+ const htmlCount = files.filter(f => HTML_EXTENSIONS.has(path.extname(f).toLowerCase())).length;
222
+
223
+ // Warn and confirm if scanning many files (static HTML/CSS processes each HTML file)
224
+ if (files.length > 50 && process.stdin.isTTY && !jsonMode && !quietMode) {
225
+ process.stderr.write(
226
+ `\nFound ${files.length} files (${htmlCount} HTML) in ${target}.\n` +
227
+ `Scanning may take a while${htmlCount > 10 ? ' (static HTML/CSS processes each HTML file individually)' : ''}.\n` +
228
+ `Target a specific subdirectory to narrow scope.\n`
229
+ );
230
+ const ok = await confirm('Continue?');
231
+ if (!ok) { process.stderr.write('Aborted.\n'); process.exit(0); }
232
+ }
233
+
234
+ // Build import graph for multi-file awareness
235
+ const graph = buildImportGraph(files);
236
+ // Build reverse map: file -> set of files that import it
237
+ const importedByMap = new Map();
238
+ for (const [importer, imports] of graph) {
239
+ for (const imported of imports) {
240
+ if (!importedByMap.has(imported)) importedByMap.set(imported, new Set());
241
+ importedByMap.get(imported).add(importer);
242
+ }
243
+ }
244
+
245
+ for (const file of files) {
246
+ const ext = path.extname(file).toLowerCase();
247
+ let fileFindings;
248
+ if (HTML_EXTENSIONS.has(ext)) {
249
+ fileFindings = await detectHtml(file, scanOptions);
250
+ } else {
251
+ fileFindings = detectText(fs.readFileSync(file, 'utf-8'), file, scanOptions);
252
+ }
253
+ // Annotate findings with import context
254
+ const importers = importedByMap.get(file);
255
+ if (importers && importers.size > 0) {
256
+ const importerNames = [...importers].map(f => path.basename(f));
257
+ for (const f of fileFindings) {
258
+ f.importedBy = importerNames;
259
+ }
260
+ }
261
+ allFindings.push(...fileFindings);
262
+ }
263
+ } else if (stat.isFile()) {
264
+ if (shouldIgnoreDetectionFile(resolved, process.cwd(), detectionConfig)) continue;
265
+ const ext = path.extname(resolved).toLowerCase();
266
+ if (HTML_EXTENSIONS.has(ext)) {
267
+ allFindings.push(...await detectHtml(resolved, scanOptions));
268
+ } else {
269
+ allFindings.push(...detectText(fs.readFileSync(resolved, 'utf-8'), resolved, scanOptions));
270
+ }
271
+ }
272
+ }
273
+ } finally {
274
+ if (browserDetector) await browserDetector.close();
275
+ }
276
+ }
277
+
278
+ allFindings = filterDetectionFindings(allFindings, detectionConfig);
279
+
280
+ if (allFindings.length > 0) {
281
+ if (jsonMode) process.stdout.write(formatFindings(allFindings, true) + '\n');
282
+ else if (quietMode) process.stderr.write(formatFindingSummary(allFindings.length) + '\n');
283
+ else process.stderr.write(formatFindings(allFindings, false) + '\n');
284
+ process.exit(2);
285
+ }
286
+ if (jsonMode) process.stdout.write('[]\n');
287
+ process.exit(0);
288
+ }
289
+
290
+ export { formatFindings, handleStdin, confirm, printUsage, detectCli };