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.
- package/LICENSE +21 -0
- package/README.md +348 -0
- package/README.npm.md +56 -0
- package/cli/bin/cli.js +127 -0
- package/cli/bin/lib/paths.mjs +31 -0
- package/cli/bin/postinstall.mjs +25 -0
- package/manifest.json +107 -0
- package/package.json +44 -0
- package/packages/agents/inspiration-scout.md +105 -0
- package/packages/agents/orchestrator.md +186 -0
- package/packages/agents/scrutiny-validator.md +136 -0
- package/packages/agents/user-testing-validator.md +171 -0
- package/packages/agents/validator.md +102 -0
- package/packages/agents/worker.md +116 -0
- package/packages/agents/wp-router.md +69 -0
- package/packages/hooks/hooks.json.example +12 -0
- package/packages/hooks/templates/mission-worktree-bootstrap.sh +88 -0
- package/packages/hooks/templates/run-assertions.sh +48 -0
- package/packages/rules/adversarial-context-isolation.mdc +57 -0
- package/packages/rules/serial-git-enforcement.mdc +77 -0
- package/packages/skills/caveman/SKILL.md +78 -0
- package/packages/skills/design-taste-frontend/SKILL.md +1206 -0
- package/packages/skills/gpt-taste/SKILL.md +74 -0
- package/packages/skills/impeccable/SKILL.md +164 -0
- package/packages/skills/impeccable/reference/adapt.md +311 -0
- package/packages/skills/impeccable/reference/animate.md +201 -0
- package/packages/skills/impeccable/reference/audit.md +133 -0
- package/packages/skills/impeccable/reference/bolder.md +120 -0
- package/packages/skills/impeccable/reference/brand.md +108 -0
- package/packages/skills/impeccable/reference/clarify.md +288 -0
- package/packages/skills/impeccable/reference/codex.md +105 -0
- package/packages/skills/impeccable/reference/colorize.md +257 -0
- package/packages/skills/impeccable/reference/craft.md +123 -0
- package/packages/skills/impeccable/reference/critique.md +780 -0
- package/packages/skills/impeccable/reference/delight.md +302 -0
- package/packages/skills/impeccable/reference/distill.md +111 -0
- package/packages/skills/impeccable/reference/document.md +429 -0
- package/packages/skills/impeccable/reference/extract.md +69 -0
- package/packages/skills/impeccable/reference/harden.md +347 -0
- package/packages/skills/impeccable/reference/hooks.md +90 -0
- package/packages/skills/impeccable/reference/init.md +172 -0
- package/packages/skills/impeccable/reference/interaction-design.md +189 -0
- package/packages/skills/impeccable/reference/layout.md +161 -0
- package/packages/skills/impeccable/reference/live.md +718 -0
- package/packages/skills/impeccable/reference/onboard.md +234 -0
- package/packages/skills/impeccable/reference/optimize.md +258 -0
- package/packages/skills/impeccable/reference/overdrive.md +130 -0
- package/packages/skills/impeccable/reference/polish.md +241 -0
- package/packages/skills/impeccable/reference/product.md +60 -0
- package/packages/skills/impeccable/reference/quieter.md +99 -0
- package/packages/skills/impeccable/reference/shape.md +165 -0
- package/packages/skills/impeccable/reference/typeset.md +279 -0
- package/packages/skills/impeccable/scripts/command-metadata.json +94 -0
- package/packages/skills/impeccable/scripts/context-signals.mjs +225 -0
- package/packages/skills/impeccable/scripts/context.mjs +961 -0
- package/packages/skills/impeccable/scripts/critique-storage.mjs +242 -0
- package/packages/skills/impeccable/scripts/detect-csp.mjs +198 -0
- package/packages/skills/impeccable/scripts/detect.mjs +21 -0
- package/packages/skills/impeccable/scripts/detector/browser/injected/index.mjs +1937 -0
- package/packages/skills/impeccable/scripts/detector/cli/main.mjs +290 -0
- package/packages/skills/impeccable/scripts/detector/design-system.mjs +750 -0
- package/packages/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +5185 -0
- package/packages/skills/impeccable/scripts/detector/detect-antipatterns.mjs +50 -0
- package/packages/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +277 -0
- package/packages/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +568 -0
- package/packages/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1015 -0
- package/packages/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +234 -0
- package/packages/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
- package/packages/skills/impeccable/scripts/detector/findings.mjs +12 -0
- package/packages/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
- package/packages/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
- package/packages/skills/impeccable/scripts/detector/registry/antipatterns.mjs +459 -0
- package/packages/skills/impeccable/scripts/detector/rules/checks.mjs +2707 -0
- package/packages/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
- package/packages/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
- package/packages/skills/impeccable/scripts/detector/shared/inline-ignores.mjs +148 -0
- package/packages/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
- package/packages/skills/impeccable/scripts/hook-admin.mjs +660 -0
- package/packages/skills/impeccable/scripts/hook-before-edit.mjs +476 -0
- package/packages/skills/impeccable/scripts/hook-lib.mjs +1632 -0
- package/packages/skills/impeccable/scripts/hook.mjs +61 -0
- package/packages/skills/impeccable/scripts/lib/design-parser.mjs +842 -0
- package/packages/skills/impeccable/scripts/lib/impeccable-config.mjs +638 -0
- package/packages/skills/impeccable/scripts/lib/impeccable-paths.mjs +128 -0
- package/packages/skills/impeccable/scripts/lib/is-generated.mjs +69 -0
- package/packages/skills/impeccable/scripts/lib/target-args.mjs +42 -0
- package/packages/skills/impeccable/scripts/live/browser-script-parts.mjs +49 -0
- package/packages/skills/impeccable/scripts/live/completion.mjs +19 -0
- package/packages/skills/impeccable/scripts/live/event-validation.mjs +137 -0
- package/packages/skills/impeccable/scripts/live/insert-ui.mjs +458 -0
- package/packages/skills/impeccable/scripts/live/manual-apply.mjs +939 -0
- package/packages/skills/impeccable/scripts/live/manual-edit-routes.mjs +357 -0
- package/packages/skills/impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
- package/packages/skills/impeccable/scripts/live/session-store.mjs +289 -0
- package/packages/skills/impeccable/scripts/live/svelte-component.mjs +826 -0
- package/packages/skills/impeccable/scripts/live/sveltekit-adapter.mjs +274 -0
- package/packages/skills/impeccable/scripts/live/ui-core.mjs +180 -0
- package/packages/skills/impeccable/scripts/live/vocabulary.mjs +36 -0
- package/packages/skills/impeccable/scripts/live-accept.mjs +812 -0
- package/packages/skills/impeccable/scripts/live-browser-dom.js +146 -0
- package/packages/skills/impeccable/scripts/live-browser-session.js +123 -0
- package/packages/skills/impeccable/scripts/live-browser.js +11173 -0
- package/packages/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
- package/packages/skills/impeccable/scripts/live-complete.mjs +75 -0
- package/packages/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
- package/packages/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
- package/packages/skills/impeccable/scripts/live-inject.mjs +583 -0
- package/packages/skills/impeccable/scripts/live-insert.mjs +272 -0
- package/packages/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
- package/packages/skills/impeccable/scripts/live-poll.mjs +384 -0
- package/packages/skills/impeccable/scripts/live-resume.mjs +94 -0
- package/packages/skills/impeccable/scripts/live-server.mjs +1135 -0
- package/packages/skills/impeccable/scripts/live-status.mjs +61 -0
- package/packages/skills/impeccable/scripts/live-target.mjs +30 -0
- package/packages/skills/impeccable/scripts/live-wrap.mjs +894 -0
- package/packages/skills/impeccable/scripts/live.mjs +297 -0
- package/packages/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/packages/skills/impeccable/scripts/palette.mjs +633 -0
- package/packages/skills/impeccable/scripts/pin.mjs +214 -0
- package/packages/skills/ponytail/SKILL.md +117 -0
- package/packages/skills/stitch-design-taste/DESIGN.md +121 -0
- package/packages/skills/stitch-design-taste/SKILL.md +184 -0
- package/packages/skills/waypoint/SKILL.md +67 -0
- package/packages/skills/wp/SKILL.md +330 -0
- package/packages/skills/wp/caveman-wire.md +148 -0
- package/packages/skills/wp/reference.md +411 -0
- package/scripts/detect-platform.sh +32 -0
- package/scripts/install.sh +123 -0
- package/scripts/lib/common.sh +215 -0
- package/scripts/sync-skills.sh +21 -0
- package/scripts/uninstall.sh +38 -0
- package/scripts/waypoint +281 -0
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `/impeccable hooks <on|off|status|reset>` — manage the design hook runtime
|
|
4
|
+
* via the `hook` key and shared detector ignores via the `detector` key in
|
|
5
|
+
* .impeccable/config.json / .impeccable/config.local.json.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node hook-admin.mjs status # print current state
|
|
9
|
+
* node hook-admin.mjs on # set enabled: true
|
|
10
|
+
* node hook-admin.mjs off # set enabled: false
|
|
11
|
+
* node hook-admin.mjs ignore-rule <rule-id> # append to ignoreRules
|
|
12
|
+
* node hook-admin.mjs ignore-rule overused-font --all-values
|
|
13
|
+
* node hook-admin.mjs ignore-file <glob> # append to ignoreFiles
|
|
14
|
+
* node hook-admin.mjs ignore-value <rule> <value> # append to shared ignoreValues
|
|
15
|
+
* node hook-admin.mjs ignore-value <rule> <value> --local
|
|
16
|
+
* node hook-admin.mjs reset # remove all config + cache
|
|
17
|
+
*
|
|
18
|
+
* Designed to be invoked by the LLM from the reference/hooks.md flow.
|
|
19
|
+
* Output is human-readable; the harness will pass it back to the user.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import fs from 'node:fs';
|
|
23
|
+
import path from 'node:path';
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
getConfigPath,
|
|
27
|
+
getLocalConfigPath,
|
|
28
|
+
getCachePath,
|
|
29
|
+
getPendingPath,
|
|
30
|
+
readConfig,
|
|
31
|
+
DEFAULT_CONFIG,
|
|
32
|
+
ensureHookGitExcludes,
|
|
33
|
+
normalizeIgnoreValue,
|
|
34
|
+
normalizeIgnoreValueEntries,
|
|
35
|
+
} from './hook-lib.mjs';
|
|
36
|
+
|
|
37
|
+
const ACTIONS = new Set(['status', 'on', 'off', 'ignore-rule', 'ignore-file', 'ignore-value', 'reset']);
|
|
38
|
+
const IMPECCABLE_HOOK_COMMAND_MARKERS = [
|
|
39
|
+
'skills/impeccable/scripts/hook-probe.mjs',
|
|
40
|
+
'skills/impeccable/scripts/hook.mjs',
|
|
41
|
+
'skills/impeccable/scripts/hook-before-edit.mjs',
|
|
42
|
+
'skills/impeccable/scripts/hook-after-edit.mjs',
|
|
43
|
+
'skills/impeccable/scripts/hook-stop.mjs',
|
|
44
|
+
];
|
|
45
|
+
const TIMEOUT_SECONDS = 5;
|
|
46
|
+
const STATUS_MESSAGE = 'Checking UI changes';
|
|
47
|
+
|
|
48
|
+
const HOOK_MANIFEST_TARGETS = [
|
|
49
|
+
{
|
|
50
|
+
provider: '.claude',
|
|
51
|
+
skillRel: '.claude/skills/impeccable',
|
|
52
|
+
destRel: '.claude/settings.local.json',
|
|
53
|
+
sharedDestRel: '.claude/settings.json',
|
|
54
|
+
manifest: () => ({
|
|
55
|
+
description: 'Impeccable design detector: runs after Edit/Write/MultiEdit on UI files and surfaces findings as system reminders.',
|
|
56
|
+
hooks: {
|
|
57
|
+
PostToolUse: [
|
|
58
|
+
{
|
|
59
|
+
matcher: 'Edit|Write|MultiEdit',
|
|
60
|
+
hooks: [
|
|
61
|
+
{
|
|
62
|
+
type: 'command',
|
|
63
|
+
command: 'node "${CLAUDE_PROJECT_DIR}/.claude/skills/impeccable/scripts/hook.mjs"',
|
|
64
|
+
timeout: TIMEOUT_SECONDS,
|
|
65
|
+
statusMessage: STATUS_MESSAGE,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
provider: '.agents',
|
|
75
|
+
skillRel: '.agents/skills/impeccable',
|
|
76
|
+
destRel: '.codex/hooks.json',
|
|
77
|
+
manifest: () => ({
|
|
78
|
+
hooks: {
|
|
79
|
+
PostToolUse: [
|
|
80
|
+
{
|
|
81
|
+
matcher: 'Edit|Write|apply_patch',
|
|
82
|
+
hooks: [
|
|
83
|
+
{
|
|
84
|
+
type: 'command',
|
|
85
|
+
command: 'node ".agents/skills/impeccable/scripts/hook.mjs"',
|
|
86
|
+
timeout: TIMEOUT_SECONDS,
|
|
87
|
+
statusMessage: STATUS_MESSAGE,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
provider: '.cursor',
|
|
97
|
+
skillRel: '.cursor/skills/impeccable',
|
|
98
|
+
destRel: '.cursor/hooks.json',
|
|
99
|
+
manifest: () => ({
|
|
100
|
+
version: 1,
|
|
101
|
+
hooks: {
|
|
102
|
+
preToolUse: [
|
|
103
|
+
{
|
|
104
|
+
command: 'node ".cursor/skills/impeccable/scripts/hook-before-edit.mjs"',
|
|
105
|
+
timeout: TIMEOUT_SECONDS,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
// GitHub Copilot reads repo-level hooks from `.github/hooks/*.json`. The same
|
|
113
|
+
// manifest is honored by the CLI (once committed to the default branch) and
|
|
114
|
+
// the cloud/app agent. Schema differs: lowercase `postToolUse`, flat entries,
|
|
115
|
+
// `bash`/`timeoutSec`, and a `matcher` regex against the `edit`/`create` tools.
|
|
116
|
+
provider: '.github',
|
|
117
|
+
skillRel: '.github/skills/impeccable',
|
|
118
|
+
destRel: '.github/hooks/impeccable.json',
|
|
119
|
+
manifest: () => ({
|
|
120
|
+
version: 1,
|
|
121
|
+
hooks: {
|
|
122
|
+
postToolUse: [
|
|
123
|
+
{
|
|
124
|
+
type: 'command',
|
|
125
|
+
matcher: 'edit|create|apply_patch',
|
|
126
|
+
bash: 'node "$(git rev-parse --show-toplevel)/.github/skills/impeccable/scripts/hook.mjs"',
|
|
127
|
+
timeoutSec: TIMEOUT_SECONDS,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
function readRawConfigFile(filePath) {
|
|
136
|
+
if (!fs.existsSync(filePath)) return { exists: false, malformed: false, raw: null };
|
|
137
|
+
try {
|
|
138
|
+
return { exists: true, malformed: false, raw: JSON.parse(fs.readFileSync(filePath, 'utf-8')) };
|
|
139
|
+
} catch {
|
|
140
|
+
return { exists: true, malformed: true, raw: null };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const DETECTOR_CONFIG_KEYS = new Set(['ignoreRules', 'ignoreFiles', 'ignoreValues', 'designSystem']);
|
|
145
|
+
|
|
146
|
+
function hookSection(unified) {
|
|
147
|
+
return unified && typeof unified === 'object' && !Array.isArray(unified) && unified.hook && typeof unified.hook === 'object' && !Array.isArray(unified.hook)
|
|
148
|
+
? unified.hook
|
|
149
|
+
: null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function detectorSection(unified) {
|
|
153
|
+
return unified && typeof unified === 'object' && !Array.isArray(unified) && unified.detector && typeof unified.detector === 'object' && !Array.isArray(unified.detector)
|
|
154
|
+
? unified.detector
|
|
155
|
+
: null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function readRawHookConfig(cwd, opts = {}) {
|
|
159
|
+
const unified = readRawConfigFile(opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd)).raw;
|
|
160
|
+
return hookSection(unified);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function readRawDetectorConfig(cwd, opts = {}) {
|
|
164
|
+
const unified = readRawConfigFile(opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd)).raw;
|
|
165
|
+
const merged = mergeDetectorConfig(hookSection(unified));
|
|
166
|
+
return mergeDetectorConfig(detectorSection(unified), merged);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function stripDetectorKeys(raw) {
|
|
170
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return {};
|
|
171
|
+
const out = {};
|
|
172
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
173
|
+
if (!DETECTOR_CONFIG_KEYS.has(key)) out[key] = value;
|
|
174
|
+
}
|
|
175
|
+
return out;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Write hook runtime config under `hook`, leaving detector filters in
|
|
179
|
+
// `detector` and preserving sibling keys such as updateCheck.
|
|
180
|
+
function writeHookConfig(cwd, hookConfig, opts = {}) {
|
|
181
|
+
const filePath = opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd);
|
|
182
|
+
if (opts.local) ensureHookGitExcludes(cwd);
|
|
183
|
+
const existingRaw = readRawConfigFile(filePath).raw;
|
|
184
|
+
const existing = existingRaw && typeof existingRaw === 'object' && !Array.isArray(existingRaw) ? existingRaw : {};
|
|
185
|
+
const existingHook = stripDetectorKeys(hookSection(existing));
|
|
186
|
+
// Merge over the existing hook object so fields the merge helpers don't manage
|
|
187
|
+
// (consent, quiet, auditLog) survive a `/impeccable hooks` edit.
|
|
188
|
+
const next = { ...existing, hook: { ...existingHook, ...hookConfig } };
|
|
189
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
190
|
+
fs.writeFileSync(filePath, JSON.stringify(next, null, 2) + '\n');
|
|
191
|
+
return filePath;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function writeDetectorConfig(cwd, detectorConfig, opts = {}) {
|
|
195
|
+
const filePath = opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd);
|
|
196
|
+
if (opts.local) ensureHookGitExcludes(cwd);
|
|
197
|
+
const existingRaw = readRawConfigFile(filePath).raw;
|
|
198
|
+
const existing = existingRaw && typeof existingRaw === 'object' && !Array.isArray(existingRaw) ? existingRaw : {};
|
|
199
|
+
const nextHook = stripDetectorKeys(hookSection(existing));
|
|
200
|
+
const existingDetector = mergeDetectorConfig(detectorSection(existing));
|
|
201
|
+
const next = {
|
|
202
|
+
...existing,
|
|
203
|
+
detector: mergeDetectorConfig(detectorConfig, existingDetector),
|
|
204
|
+
};
|
|
205
|
+
if (Object.keys(nextHook).length > 0) next.hook = nextHook;
|
|
206
|
+
else delete next.hook;
|
|
207
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
208
|
+
fs.writeFileSync(filePath, JSON.stringify(next, null, 2) + '\n');
|
|
209
|
+
return filePath;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function mergeHookConfig(existing) {
|
|
213
|
+
const base = existing && typeof existing === 'object' ? existing : {};
|
|
214
|
+
return {
|
|
215
|
+
enabled: base.enabled === false ? false : true,
|
|
216
|
+
limits: {
|
|
217
|
+
maxFindings: Number.isFinite(base?.limits?.maxFindings) ? base.limits.maxFindings : DEFAULT_CONFIG.limits.maxFindings,
|
|
218
|
+
maxChars: Number.isFinite(base?.limits?.maxChars) ? base.limits.maxChars : DEFAULT_CONFIG.limits.maxChars,
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function mergeDetectorConfig(existing, seed = null) {
|
|
224
|
+
const base = existing && typeof existing === 'object' ? existing : {};
|
|
225
|
+
const out = seed ? {
|
|
226
|
+
ignoreRules: [...seed.ignoreRules],
|
|
227
|
+
ignoreFiles: [...seed.ignoreFiles],
|
|
228
|
+
ignoreValues: normalizeIgnoreValueEntries(seed.ignoreValues),
|
|
229
|
+
} : {
|
|
230
|
+
ignoreRules: [],
|
|
231
|
+
ignoreFiles: [],
|
|
232
|
+
ignoreValues: [],
|
|
233
|
+
};
|
|
234
|
+
if (seed?.designSystem && typeof seed.designSystem === 'object' && !Array.isArray(seed.designSystem)) {
|
|
235
|
+
out.designSystem = { ...seed.designSystem };
|
|
236
|
+
}
|
|
237
|
+
if (base.designSystem && typeof base.designSystem === 'object' && !Array.isArray(base.designSystem)) {
|
|
238
|
+
out.designSystem = {
|
|
239
|
+
...(out.designSystem || {}),
|
|
240
|
+
enabled: base.designSystem.enabled === false ? false : true,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
if (Array.isArray(base.ignoreRules)) {
|
|
244
|
+
out.ignoreRules = Array.from(new Set([...out.ignoreRules, ...base.ignoreRules.map(String)]));
|
|
245
|
+
}
|
|
246
|
+
if (Array.isArray(base.ignoreFiles)) {
|
|
247
|
+
out.ignoreFiles = Array.from(new Set([...out.ignoreFiles, ...base.ignoreFiles.map(String)]));
|
|
248
|
+
}
|
|
249
|
+
if (Array.isArray(base.ignoreValues)) {
|
|
250
|
+
out.ignoreValues = mergeIgnoreValueEntries(out.ignoreValues, base.ignoreValues);
|
|
251
|
+
}
|
|
252
|
+
return out;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function mergeIgnoreValueEntries(existing, incoming) {
|
|
256
|
+
const map = new Map();
|
|
257
|
+
for (const entry of normalizeIgnoreValueEntries(existing)) {
|
|
258
|
+
map.set(ignoreValueEntryKey(entry), entry);
|
|
259
|
+
}
|
|
260
|
+
for (const entry of normalizeIgnoreValueEntries(incoming)) {
|
|
261
|
+
map.set(ignoreValueEntryKey(entry), entry);
|
|
262
|
+
}
|
|
263
|
+
return Array.from(map.values());
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function ignoreValueEntryKey(entry) {
|
|
267
|
+
const files = Array.isArray(entry.files) && entry.files.length > 0 ? entry.files.join('\x1f') : '';
|
|
268
|
+
return `${entry.rule}\0${entry.value}\0${files}`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function statusReport(cwd) {
|
|
272
|
+
const shared = readRawConfigFile(getConfigPath(cwd));
|
|
273
|
+
const local = readRawConfigFile(getLocalConfigPath(cwd));
|
|
274
|
+
const cfg = readConfig(cwd);
|
|
275
|
+
const envKill = process.env.IMPECCABLE_HOOK_DISABLED;
|
|
276
|
+
const envState = envKill ? `IMPECCABLE_HOOK_DISABLED=${envKill}` : 'unset';
|
|
277
|
+
const cfgPath = path.relative(cwd, getConfigPath(cwd)) || '.impeccable/config.json';
|
|
278
|
+
const localPath = path.relative(cwd, getLocalConfigPath(cwd)) || '.impeccable/config.local.json';
|
|
279
|
+
const cachePath = path.relative(cwd, getCachePath(cwd)) || '.impeccable/hook.cache.json';
|
|
280
|
+
const fileState = (info, relPath, absent) => {
|
|
281
|
+
if (info.malformed) return `${relPath} (malformed; ignored)`;
|
|
282
|
+
if (info.exists) return relPath;
|
|
283
|
+
return `${relPath} (${absent})`;
|
|
284
|
+
};
|
|
285
|
+
const ignoreValues = cfg.ignoreValues.map((entry) => `${entry.rule}=${entry.value}`);
|
|
286
|
+
|
|
287
|
+
const lines = [
|
|
288
|
+
`Impeccable design hook`,
|
|
289
|
+
` state: ${cfg.enabled ? 'enabled' : 'disabled'}`,
|
|
290
|
+
` shared file: ${fileState(shared, cfgPath, 'using defaults; file not present')}`,
|
|
291
|
+
` local file: ${fileState(local, localPath, 'not present')}`,
|
|
292
|
+
` ignoreRules: ${cfg.ignoreRules.length ? cfg.ignoreRules.join(', ') : '(none)'}`,
|
|
293
|
+
` ignoreFiles: ${cfg.ignoreFiles.length ? cfg.ignoreFiles.join(', ') : '(none)'}`,
|
|
294
|
+
` ignoreValues: ${ignoreValues.length ? ignoreValues.join(', ') : '(none)'}`,
|
|
295
|
+
` maxFindings: ${cfg.limits.maxFindings}`,
|
|
296
|
+
` maxChars: ${cfg.limits.maxChars}`,
|
|
297
|
+
` env override: ${envState}`,
|
|
298
|
+
` cache file: ${fs.existsSync(getCachePath(cwd)) ? cachePath : `${cachePath} (not present)`}`,
|
|
299
|
+
];
|
|
300
|
+
return lines.join('\n');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function setEnabled(cwd, value) {
|
|
304
|
+
const config = mergeHookConfig(readRawHookConfig(cwd));
|
|
305
|
+
config.enabled = value;
|
|
306
|
+
const target = writeHookConfig(cwd, config);
|
|
307
|
+
if (!value) {
|
|
308
|
+
return `Design hook disabled for this project (wrote ${path.relative(cwd, target) || target}).`;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const localTarget = writeHookConfig(cwd, { consent: 'accepted' }, { local: true });
|
|
312
|
+
const repaired = repairHookManifests(cwd);
|
|
313
|
+
const parts = [
|
|
314
|
+
`Design hook enabled for this project (wrote ${path.relative(cwd, target) || target}).`,
|
|
315
|
+
`Recorded local hook consent in ${path.relative(cwd, localTarget) || localTarget}.`,
|
|
316
|
+
];
|
|
317
|
+
if (repaired.written.length > 0) {
|
|
318
|
+
parts.push(`Installed or repaired hook manifests for: ${repaired.written.join(', ')}.`);
|
|
319
|
+
} else if (repaired.already.length > 0) {
|
|
320
|
+
parts.push(`Hook manifests already installed for: ${repaired.already.join(', ')}.`);
|
|
321
|
+
} else {
|
|
322
|
+
parts.push('No installed provider skill folders found to repair.');
|
|
323
|
+
}
|
|
324
|
+
if (repaired.backups.length > 0) {
|
|
325
|
+
parts.push(`Backed up malformed manifest(s): ${repaired.backups.map((filePath) => path.relative(cwd, filePath) || filePath).join(', ')}.`);
|
|
326
|
+
}
|
|
327
|
+
return parts.join(' ');
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function repairHookManifests(cwd) {
|
|
331
|
+
const result = { written: [], already: [], backups: [] };
|
|
332
|
+
for (const target of HOOK_MANIFEST_TARGETS) {
|
|
333
|
+
if (!fs.existsSync(path.join(cwd, target.skillRel))) continue;
|
|
334
|
+
const dest = path.join(cwd, target.destRel);
|
|
335
|
+
const sharedDest = target.sharedDestRel ? path.join(cwd, target.sharedDestRel) : null;
|
|
336
|
+
|
|
337
|
+
if (sharedDest && fileHasImpeccableHookMarker(sharedDest)) {
|
|
338
|
+
pruneImpeccableHookFromManifest(dest);
|
|
339
|
+
result.already.push(target.provider);
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const fresh = target.manifest();
|
|
344
|
+
let next = fresh;
|
|
345
|
+
if (fs.existsSync(dest)) {
|
|
346
|
+
try {
|
|
347
|
+
next = mergeHookManifests(JSON.parse(fs.readFileSync(dest, 'utf-8')), fresh);
|
|
348
|
+
} catch {
|
|
349
|
+
const backup = `${dest}.bak`;
|
|
350
|
+
fs.copyFileSync(dest, backup);
|
|
351
|
+
result.backups.push(backup);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const serialized = `${JSON.stringify(next, null, 2)}\n`;
|
|
356
|
+
const current = fs.existsSync(dest) ? safeReadText(dest) : null;
|
|
357
|
+
if (current === serialized) {
|
|
358
|
+
result.already.push(target.provider);
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
362
|
+
fs.writeFileSync(dest, serialized);
|
|
363
|
+
result.written.push(target.provider);
|
|
364
|
+
}
|
|
365
|
+
return result;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function safeReadText(filePath) {
|
|
369
|
+
try {
|
|
370
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
371
|
+
} catch {
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function mergeHookManifests(existing, fresh) {
|
|
377
|
+
const existingObject = existing && typeof existing === 'object' && !Array.isArray(existing) ? existing : {};
|
|
378
|
+
const freshObject = fresh && typeof fresh === 'object' && !Array.isArray(fresh) ? fresh : {};
|
|
379
|
+
const existingHooks = existingObject.hooks && typeof existingObject.hooks === 'object' && !Array.isArray(existingObject.hooks)
|
|
380
|
+
? existingObject.hooks
|
|
381
|
+
: {};
|
|
382
|
+
const freshHooks = freshObject.hooks && typeof freshObject.hooks === 'object' && !Array.isArray(freshObject.hooks)
|
|
383
|
+
? freshObject.hooks
|
|
384
|
+
: {};
|
|
385
|
+
|
|
386
|
+
const merged = { ...existingObject, hooks: {} };
|
|
387
|
+
if (freshObject.version !== undefined) merged.version = freshObject.version;
|
|
388
|
+
if (freshObject.description !== undefined) merged.description = freshObject.description;
|
|
389
|
+
|
|
390
|
+
const hookEvents = new Set([...Object.keys(existingHooks), ...Object.keys(freshHooks)]);
|
|
391
|
+
for (const event of hookEvents) {
|
|
392
|
+
const preserved = stripImpeccableHookEntries(existingHooks[event]);
|
|
393
|
+
const added = Array.isArray(freshHooks[event]) ? freshHooks[event] : [];
|
|
394
|
+
const mergedEntries = [...preserved, ...added];
|
|
395
|
+
if (mergedEntries.length > 0) merged.hooks[event] = mergedEntries;
|
|
396
|
+
}
|
|
397
|
+
return merged;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function fileHasImpeccableHookMarker(filePath) {
|
|
401
|
+
if (!fs.existsSync(filePath)) return false;
|
|
402
|
+
let parsed;
|
|
403
|
+
try {
|
|
404
|
+
parsed = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
405
|
+
} catch {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return false;
|
|
409
|
+
if (!parsed.hooks || typeof parsed.hooks !== 'object') return false;
|
|
410
|
+
return valueHasImpeccableHookMarker(parsed.hooks);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function valueHasImpeccableHookMarker(value) {
|
|
414
|
+
if (typeof value === 'string') {
|
|
415
|
+
return IMPECCABLE_HOOK_COMMAND_MARKERS.some((marker) => value.includes(marker));
|
|
416
|
+
}
|
|
417
|
+
if (Array.isArray(value)) return value.some(valueHasImpeccableHookMarker);
|
|
418
|
+
if (value && typeof value === 'object') return Object.values(value).some(valueHasImpeccableHookMarker);
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
function stripImpeccableHookEntry(entry) {
|
|
423
|
+
if (!entry || typeof entry !== 'object') return entry;
|
|
424
|
+
// `command`/`args`: Claude/Codex/Cursor. `bash`/`powershell`: GitHub Copilot's
|
|
425
|
+
// flat entry shape, where the marker lives under the shell-command keys.
|
|
426
|
+
if (valueHasImpeccableHookMarker(entry.command) || valueHasImpeccableHookMarker(entry.args)
|
|
427
|
+
|| valueHasImpeccableHookMarker(entry.bash) || valueHasImpeccableHookMarker(entry.powershell)) {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
if (!Array.isArray(entry.hooks)) return entry;
|
|
431
|
+
|
|
432
|
+
const strippedHooks = entry.hooks
|
|
433
|
+
.map(stripImpeccableHookEntry)
|
|
434
|
+
.filter(Boolean);
|
|
435
|
+
|
|
436
|
+
if (strippedHooks.length === 0 && entry.hooks.some(valueHasImpeccableHookMarker)) {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
return { ...entry, hooks: strippedHooks };
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function stripImpeccableHookEntries(entries) {
|
|
443
|
+
if (!Array.isArray(entries)) return [];
|
|
444
|
+
return entries
|
|
445
|
+
.map(stripImpeccableHookEntry)
|
|
446
|
+
.filter(Boolean);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function pruneImpeccableHookFromManifest(manifestPath) {
|
|
450
|
+
if (!fileHasImpeccableHookMarker(manifestPath)) return false;
|
|
451
|
+
let parsed;
|
|
452
|
+
try {
|
|
453
|
+
parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
454
|
+
} catch {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const existingHooks = parsed.hooks && typeof parsed.hooks === 'object' && !Array.isArray(parsed.hooks)
|
|
459
|
+
? parsed.hooks
|
|
460
|
+
: {};
|
|
461
|
+
const cleanedHooks = {};
|
|
462
|
+
for (const [event, entries] of Object.entries(existingHooks)) {
|
|
463
|
+
const kept = stripImpeccableHookEntries(entries);
|
|
464
|
+
if (kept.length > 0) cleanedHooks[event] = kept;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const next = { ...parsed };
|
|
468
|
+
if (Object.keys(cleanedHooks).length > 0) {
|
|
469
|
+
next.hooks = cleanedHooks;
|
|
470
|
+
} else {
|
|
471
|
+
delete next.hooks;
|
|
472
|
+
delete next.description;
|
|
473
|
+
delete next.version;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (Object.keys(next).length === 0) {
|
|
477
|
+
fs.rmSync(manifestPath, { force: true });
|
|
478
|
+
} else {
|
|
479
|
+
fs.writeFileSync(manifestPath, `${JSON.stringify(next, null, 2)}\n`);
|
|
480
|
+
}
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function normalizeRuleId(rule) {
|
|
485
|
+
return String(rule || '').trim().toLowerCase();
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function parseIgnoreRuleArgs(args) {
|
|
489
|
+
const positionals = [];
|
|
490
|
+
let allValues = false;
|
|
491
|
+
|
|
492
|
+
for (let i = 0; i < args.length; i++) {
|
|
493
|
+
const arg = String(args[i] || '');
|
|
494
|
+
if (arg === '--all-values') {
|
|
495
|
+
allValues = true;
|
|
496
|
+
} else if (arg === '--reason') {
|
|
497
|
+
while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) i++;
|
|
498
|
+
} else if (arg.startsWith('--reason=')) {
|
|
499
|
+
// Accepted for command symmetry; ignoreRules stores rule ids only.
|
|
500
|
+
} else if (arg.startsWith('--')) {
|
|
501
|
+
throw new Error(`Unknown ignore-rule flag: ${arg}`);
|
|
502
|
+
} else {
|
|
503
|
+
positionals.push(arg);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
return {
|
|
508
|
+
rule: normalizeRuleId(positionals[0]),
|
|
509
|
+
allValues,
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function addIgnoreRule(cwd, args) {
|
|
514
|
+
const parsed = parseIgnoreRuleArgs(args);
|
|
515
|
+
const rule = parsed.rule;
|
|
516
|
+
if (!rule) throw new Error('Pass a rule id, e.g. /impeccable hooks ignore-rule side-tab');
|
|
517
|
+
if (rule === 'overused-font' && !parsed.allValues) {
|
|
518
|
+
throw new Error('overused-font is value-specific by default. Use /impeccable hooks ignore-value overused-font <font> for a confirmed font, or /impeccable hooks ignore-rule overused-font --all-values only when the user asked to ignore overused fonts generally.');
|
|
519
|
+
}
|
|
520
|
+
const config = mergeDetectorConfig(readRawDetectorConfig(cwd));
|
|
521
|
+
if (!config.ignoreRules.includes(rule)) config.ignoreRules.push(rule);
|
|
522
|
+
writeDetectorConfig(cwd, config);
|
|
523
|
+
return `Added "${rule}" to detector.ignoreRules. Current: ${config.ignoreRules.join(', ')}`;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function addIgnoreFile(cwd, glob) {
|
|
527
|
+
if (!glob) throw new Error('Pass a glob, e.g. /impeccable hooks ignore-file "src/legacy/**"');
|
|
528
|
+
const config = mergeDetectorConfig(readRawDetectorConfig(cwd));
|
|
529
|
+
if (!config.ignoreFiles.includes(glob)) config.ignoreFiles.push(glob);
|
|
530
|
+
writeDetectorConfig(cwd, config);
|
|
531
|
+
return `Added "${glob}" to detector.ignoreFiles. Current: ${config.ignoreFiles.join(', ')}`;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function parseIgnoreValueArgs(args) {
|
|
535
|
+
const positionals = [];
|
|
536
|
+
let shared = false;
|
|
537
|
+
let local = false;
|
|
538
|
+
let reason = '';
|
|
539
|
+
|
|
540
|
+
for (let i = 0; i < args.length; i++) {
|
|
541
|
+
const arg = args[i];
|
|
542
|
+
if (arg === '--shared') {
|
|
543
|
+
shared = true;
|
|
544
|
+
} else if (arg === '--local') {
|
|
545
|
+
local = true;
|
|
546
|
+
} else if (arg === '--reason') {
|
|
547
|
+
const chunks = [];
|
|
548
|
+
while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) {
|
|
549
|
+
chunks.push(args[++i]);
|
|
550
|
+
}
|
|
551
|
+
reason = chunks.join(' ').trim();
|
|
552
|
+
} else if (String(arg).startsWith('--reason=')) {
|
|
553
|
+
reason = String(arg).slice('--reason='.length).trim();
|
|
554
|
+
} else {
|
|
555
|
+
positionals.push(arg);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
const [rule, ...valueParts] = positionals;
|
|
560
|
+
return {
|
|
561
|
+
rule: String(rule || '').trim().toLowerCase(),
|
|
562
|
+
value: normalizeIgnoreValue(valueParts.join(' ')),
|
|
563
|
+
shared,
|
|
564
|
+
local,
|
|
565
|
+
reason,
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function addIgnoreValue(cwd, args) {
|
|
570
|
+
const parsed = parseIgnoreValueArgs(args);
|
|
571
|
+
if (!parsed.rule || !parsed.value) {
|
|
572
|
+
throw new Error('Pass a rule id and value, e.g. /impeccable hooks ignore-value overused-font Inter');
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
if (parsed.shared && parsed.local) {
|
|
576
|
+
throw new Error('Pass only one scope flag: --shared or --local');
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
const local = parsed.local;
|
|
580
|
+
const config = mergeDetectorConfig(readRawDetectorConfig(cwd, { local }));
|
|
581
|
+
const key = `${parsed.rule}\0${parsed.value}`;
|
|
582
|
+
const existing = config.ignoreValues.find((entry) => `${entry.rule}\0${entry.value}` === key);
|
|
583
|
+
|
|
584
|
+
if (existing) {
|
|
585
|
+
if (parsed.reason) existing.reason = parsed.reason;
|
|
586
|
+
} else {
|
|
587
|
+
const entry = {
|
|
588
|
+
rule: parsed.rule,
|
|
589
|
+
value: parsed.value,
|
|
590
|
+
createdAt: new Date().toISOString(),
|
|
591
|
+
};
|
|
592
|
+
if (parsed.reason) entry.reason = parsed.reason;
|
|
593
|
+
config.ignoreValues.push(entry);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
const target = writeDetectorConfig(cwd, config, { local });
|
|
597
|
+
const scope = local ? 'local detector.ignoreValues' : 'shared detector.ignoreValues';
|
|
598
|
+
return `Added ${parsed.rule}=${parsed.value} to ${scope} (${path.relative(cwd, target) || target}).`;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
function reset(cwd) {
|
|
602
|
+
const removed = [];
|
|
603
|
+
// Unified files may hold non-hook keys (e.g. updateCheck); strip only the
|
|
604
|
+
// hook/detector subtrees and keep the rest, deleting the file only if nothing remains.
|
|
605
|
+
for (const filePath of [getConfigPath(cwd), getLocalConfigPath(cwd)]) {
|
|
606
|
+
try {
|
|
607
|
+
const raw = readRawConfigFile(filePath).raw;
|
|
608
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw) || (!('hook' in raw) && !('detector' in raw))) continue;
|
|
609
|
+
const { hook, detector, ...rest } = raw;
|
|
610
|
+
if (Object.keys(rest).length === 0) {
|
|
611
|
+
fs.unlinkSync(filePath);
|
|
612
|
+
} else {
|
|
613
|
+
fs.writeFileSync(filePath, JSON.stringify(rest, null, 2) + '\n');
|
|
614
|
+
}
|
|
615
|
+
removed.push(path.relative(cwd, filePath) || filePath);
|
|
616
|
+
} catch { /* ignore */ }
|
|
617
|
+
}
|
|
618
|
+
// State files are wholly ours; delete outright.
|
|
619
|
+
for (const filePath of [getCachePath(cwd), getPendingPath(cwd)]) {
|
|
620
|
+
try {
|
|
621
|
+
if (fs.existsSync(filePath)) {
|
|
622
|
+
fs.unlinkSync(filePath);
|
|
623
|
+
removed.push(path.relative(cwd, filePath) || filePath);
|
|
624
|
+
}
|
|
625
|
+
} catch { /* ignore */ }
|
|
626
|
+
}
|
|
627
|
+
return removed.length
|
|
628
|
+
? `Reset design hook config and cache (removed: ${removed.join(', ')}).`
|
|
629
|
+
: 'No hook config or cache to remove. Already at defaults.';
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function main() {
|
|
633
|
+
const [, , actionArg, ...rest] = process.argv;
|
|
634
|
+
const action = (actionArg || 'status').toLowerCase();
|
|
635
|
+
const cwd = process.cwd();
|
|
636
|
+
|
|
637
|
+
if (!ACTIONS.has(action)) {
|
|
638
|
+
process.stderr.write(`Unknown action: ${action}\nValid: ${Array.from(ACTIONS).join(', ')}\n`);
|
|
639
|
+
process.exit(1);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
try {
|
|
643
|
+
let out = '';
|
|
644
|
+
switch (action) {
|
|
645
|
+
case 'status': out = statusReport(cwd); break;
|
|
646
|
+
case 'on': out = setEnabled(cwd, true); break;
|
|
647
|
+
case 'off': out = setEnabled(cwd, false); break;
|
|
648
|
+
case 'ignore-rule': out = addIgnoreRule(cwd, rest); break;
|
|
649
|
+
case 'ignore-file': out = addIgnoreFile(cwd, rest[0]); break;
|
|
650
|
+
case 'ignore-value': out = addIgnoreValue(cwd, rest); break;
|
|
651
|
+
case 'reset': out = reset(cwd); break;
|
|
652
|
+
}
|
|
653
|
+
process.stdout.write(out + '\n');
|
|
654
|
+
} catch (err) {
|
|
655
|
+
process.stderr.write(`Error: ${err.message || err}\n`);
|
|
656
|
+
process.exit(1);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
main();
|