safeword 0.49.0 → 0.52.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/dist/{check-OFMUQD3Q.js → check-2DK5F4OO.js} +7 -6
- package/dist/{check-OFMUQD3Q.js.map → check-2DK5F4OO.js.map} +1 -1
- package/dist/{chunk-54KAYQTY.js → chunk-2WUL76K5.js} +2 -2
- package/dist/{chunk-UMPMYZ4F.js → chunk-5WF73MP2.js} +3 -3
- package/dist/{chunk-42IGUF5V.js → chunk-BAJDI467.js} +5 -5
- package/dist/{chunk-4J3GYDJF.js → chunk-DFATZL6F.js} +135 -121
- package/dist/chunk-DFATZL6F.js.map +1 -0
- package/dist/{chunk-2HB6H4G5.js → chunk-JLFYAVLP.js} +2 -2
- package/dist/{chunk-ZNIJO52Z.js → chunk-MPEK5NNA.js} +2 -2
- package/dist/{chunk-445LAX4Y.js → chunk-MPYFFJBF.js} +24 -1
- package/dist/chunk-MPYFFJBF.js.map +1 -0
- package/dist/chunk-WE7ZQLCT.js +66 -0
- package/dist/chunk-WE7ZQLCT.js.map +1 -0
- package/dist/cli.js +16 -10
- package/dist/cli.js.map +1 -1
- package/dist/{codify-HIWCNPCY.js → codify-YUGZVCR4.js} +3 -3
- package/dist/{diff-SACXR7ES.js → diff-ZAYGIAQF.js} +5 -4
- package/dist/{diff-SACXR7ES.js.map → diff-ZAYGIAQF.js.map} +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/{reset-AJ4B74Y2.js → reset-TKMSK7DX.js} +8 -6
- package/dist/{reset-AJ4B74Y2.js.map → reset-TKMSK7DX.js.map} +1 -1
- package/dist/{setup-IV3O3CKO.js → setup-4FE4FWIA.js} +13 -11
- package/dist/setup-4FE4FWIA.js.map +1 -0
- package/dist/{sync-config-ELXIXIY3.js → sync-config-5FCJLGMW.js} +3 -3
- package/dist/{sync-learnings-D2JYMRKZ.js → sync-learnings-C7GXSMKZ.js} +3 -3
- package/dist/{sync-tickets-YDFPSIVS.js → sync-tickets-SDX4XPVS.js} +4 -4
- package/dist/test-plan-4D3WNSQP.js +211 -0
- package/dist/test-plan-4D3WNSQP.js.map +1 -0
- package/dist/{ticket-new-BWMAVY7D.js → ticket-new-CVBD3MVR.js} +3 -3
- package/dist/{upgrade-FYGFT3CJ.js → upgrade-2TVZ6C3T.js} +33 -39
- package/dist/upgrade-2TVZ6C3T.js.map +1 -0
- package/package.json +3 -2
- package/templates/SAFEWORD.md +1 -1
- package/templates/commands/audit.md +21 -7
- package/templates/commands/verify.md +31 -13
- package/templates/cucumber/shared.steps.ts +21 -13
- package/templates/cursor/rules/safeword-quality-reviewing.mdc +27 -0
- package/templates/guides/data-architecture-guide.md +1 -0
- package/templates/guides/design-doc-guide.md +1 -0
- package/templates/guides/planning-guide.md +2 -0
- package/templates/hooks/lib/test-runner.ts +90 -44
- package/templates/hooks/record-skill-invocation.ts +4 -2
- package/templates/hooks/write-review-stamp.ts +2 -1
- package/templates/skills/audit/SKILL.md +21 -7
- package/templates/skills/debug/SKILL.md +1 -0
- package/templates/skills/quality-review/SKILL.md +26 -0
- package/templates/skills/verify/SKILL.md +31 -13
- package/dist/chunk-445LAX4Y.js.map +0 -1
- package/dist/chunk-4J3GYDJF.js.map +0 -1
- package/dist/setup-IV3O3CKO.js.map +0 -1
- package/dist/upgrade-FYGFT3CJ.js.map +0 -1
- /package/dist/{chunk-54KAYQTY.js.map → chunk-2WUL76K5.js.map} +0 -0
- /package/dist/{chunk-UMPMYZ4F.js.map → chunk-5WF73MP2.js.map} +0 -0
- /package/dist/{chunk-42IGUF5V.js.map → chunk-BAJDI467.js.map} +0 -0
- /package/dist/{chunk-2HB6H4G5.js.map → chunk-JLFYAVLP.js.map} +0 -0
- /package/dist/{chunk-ZNIJO52Z.js.map → chunk-MPEK5NNA.js.map} +0 -0
- /package/dist/{codify-HIWCNPCY.js.map → codify-YUGZVCR4.js.map} +0 -0
- /package/dist/{sync-config-ELXIXIY3.js.map → sync-config-5FCJLGMW.js.map} +0 -0
- /package/dist/{sync-learnings-D2JYMRKZ.js.map → sync-learnings-C7GXSMKZ.js.map} +0 -0
- /package/dist/{sync-tickets-YDFPSIVS.js.map → sync-tickets-SDX4XPVS.js.map} +0 -0
- /package/dist/{ticket-new-BWMAVY7D.js.map → ticket-new-CVBD3MVR.js.map} +0 -0
|
@@ -4,15 +4,16 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
checkHealth,
|
|
6
6
|
reportHealthSummary
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BAJDI467.js";
|
|
8
8
|
import {
|
|
9
9
|
syncTickets
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JLFYAVLP.js";
|
|
11
11
|
import "./chunk-NHXVS5FL.js";
|
|
12
12
|
import "./chunk-IGULTNHR.js";
|
|
13
13
|
import "./chunk-QLXFPFIC.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-DFATZL6F.js";
|
|
15
|
+
import "./chunk-2WUL76K5.js";
|
|
16
|
+
import "./chunk-WE7ZQLCT.js";
|
|
16
17
|
import "./chunk-LODQOJEK.js";
|
|
17
18
|
import "./chunk-HSC7TELY.js";
|
|
18
19
|
import {
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
keyValue,
|
|
22
23
|
success,
|
|
23
24
|
warn
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MPYFFJBF.js";
|
|
25
26
|
|
|
26
27
|
// src/commands/check.ts
|
|
27
28
|
import process from "process";
|
|
@@ -109,4 +110,4 @@ async function check(options) {
|
|
|
109
110
|
export {
|
|
110
111
|
check
|
|
111
112
|
};
|
|
112
|
-
//# sourceMappingURL=check-
|
|
113
|
+
//# sourceMappingURL=check-2DK5F4OO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/check.ts"],"sourcesContent":["/**\n * Check command - Verify project health and configuration\n *\n * The config-health core lives in ../health.ts (shared with the setup/upgrade\n * self-verify, ticket 3293WH). This command adds the standalone-only\n * surfaces: npm update-check, version display, and ticket-index refresh.\n */\n\nimport process from 'node:process';\n\nimport { checkHealth, type HealthStatus, reportHealthSummary } from '../health.js';\nimport { syncTickets } from '../ticket-sync/index.js';\nimport { header, info, keyValue, success, warn } from '../utils/output.js';\nimport { isNewerVersion } from '../utils/version.js';\n\ninterface CheckOptions {\n offline?: boolean;\n}\n\n/**\n * Check for latest version from npm (with timeout)\n * @param timeout\n */\nasync function checkLatestVersion(timeout = 3000): Promise<string | undefined> {\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => {\n controller.abort();\n }, timeout);\n\n const response = await fetch('https://registry.npmjs.org/safeword/latest', {\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) return undefined;\n\n const data = (await response.json()) as { version?: string };\n return data.version ?? undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Check for CLI updates and report status\n * @param health\n */\nasync function reportUpdateStatus(health: HealthStatus): Promise<void> {\n info('\\nChecking for updates...');\n const latestVersion = await checkLatestVersion();\n\n if (!latestVersion) {\n warn(\"Couldn't check for updates (offline?)\");\n return;\n }\n\n health.latestVersion = latestVersion;\n health.updateAvailable = isNewerVersion(health.cliVersion, latestVersion);\n\n if (health.updateAvailable) {\n warn(`Update available: v${latestVersion}`);\n info('Run `bunx safeword@latest upgrade` to upgrade');\n } else {\n success('CLI is up to date');\n }\n}\n\n/**\n * Compare project version vs CLI version and report\n * @param health\n */\nfunction reportVersionMismatch(health: HealthStatus): void {\n if (!health.projectVersion) return;\n\n if (isNewerVersion(health.cliVersion, health.projectVersion)) {\n warn(`Project config (v${health.projectVersion}) is newer than CLI (v${health.cliVersion})`);\n info('Consider upgrading the CLI');\n } else if (isNewerVersion(health.projectVersion, health.cliVersion)) {\n info(`\\nUpgrade available for project config`);\n info(\n `Run \\`safeword upgrade\\` to update from v${health.projectVersion} to v${health.cliVersion}`,\n );\n }\n}\n\n/**\n * Regenerate the ticket discovery index, swallowing any error — index\n * freshness must never block or fail a health check. Reports only when it\n * actually rewrote a file.\n * @param cwd\n */\nfunction regenerateTicketIndex(cwd: string): void {\n try {\n const result = syncTickets(cwd);\n if (result.wrote) {\n info('Regenerated ticket index (INDEX.md / INDEX-completed.md)');\n }\n } catch (error: unknown) {\n // Best-effort: index freshness must never fail the health check. Surface\n // under DEBUG, then return — the deliberate swallow point.\n if (process.env.DEBUG) {\n console.error('[check] ticket index regen failed:', error);\n }\n return;\n }\n}\n\n/**\n *\n * @param options\n */\nexport async function check(options: CheckOptions): Promise<void> {\n const cwd = process.cwd();\n\n header('Safeword Health Check');\n\n const health = await checkHealth(cwd);\n\n // Not configured\n if (!health.configured) {\n info('Not configured. Run `safeword setup` to initialize.');\n return;\n }\n\n // Keep the ticket discovery index fresh at this checkpoint (best-effort —\n // never fail the health check on index regen). Ticket 1GGD28.\n regenerateTicketIndex(cwd);\n\n // Show versions\n keyValue('Safeword CLI', `v${health.cliVersion}`);\n keyValue('Project config', health.projectVersion ? `v${health.projectVersion}` : 'unknown');\n\n // Check for updates (unless offline)\n if (options.offline) {\n info('\\nSkipped update check (offline mode)');\n } else {\n await reportUpdateStatus(health);\n }\n\n reportVersionMismatch(health);\n const hasIssues = reportHealthSummary(health);\n\n if (hasIssues) {\n process.exit(1);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/commands/check.ts"],"sourcesContent":["/**\n * Check command - Verify project health and configuration\n *\n * The config-health core lives in ../health.ts (shared with the setup/upgrade\n * self-verify, ticket 3293WH). This command adds the standalone-only\n * surfaces: npm update-check, version display, and ticket-index refresh.\n */\n\nimport process from 'node:process';\n\nimport { checkHealth, type HealthStatus, reportHealthSummary } from '../health.js';\nimport { syncTickets } from '../ticket-sync/index.js';\nimport { header, info, keyValue, success, warn } from '../utils/output.js';\nimport { isNewerVersion } from '../utils/version.js';\n\ninterface CheckOptions {\n offline?: boolean;\n}\n\n/**\n * Check for latest version from npm (with timeout)\n * @param timeout\n */\nasync function checkLatestVersion(timeout = 3000): Promise<string | undefined> {\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => {\n controller.abort();\n }, timeout);\n\n const response = await fetch('https://registry.npmjs.org/safeword/latest', {\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) return undefined;\n\n const data = (await response.json()) as { version?: string };\n return data.version ?? undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Check for CLI updates and report status\n * @param health\n */\nasync function reportUpdateStatus(health: HealthStatus): Promise<void> {\n info('\\nChecking for updates...');\n const latestVersion = await checkLatestVersion();\n\n if (!latestVersion) {\n warn(\"Couldn't check for updates (offline?)\");\n return;\n }\n\n health.latestVersion = latestVersion;\n health.updateAvailable = isNewerVersion(health.cliVersion, latestVersion);\n\n if (health.updateAvailable) {\n warn(`Update available: v${latestVersion}`);\n info('Run `bunx safeword@latest upgrade` to upgrade');\n } else {\n success('CLI is up to date');\n }\n}\n\n/**\n * Compare project version vs CLI version and report\n * @param health\n */\nfunction reportVersionMismatch(health: HealthStatus): void {\n if (!health.projectVersion) return;\n\n if (isNewerVersion(health.cliVersion, health.projectVersion)) {\n warn(`Project config (v${health.projectVersion}) is newer than CLI (v${health.cliVersion})`);\n info('Consider upgrading the CLI');\n } else if (isNewerVersion(health.projectVersion, health.cliVersion)) {\n info(`\\nUpgrade available for project config`);\n info(\n `Run \\`safeword upgrade\\` to update from v${health.projectVersion} to v${health.cliVersion}`,\n );\n }\n}\n\n/**\n * Regenerate the ticket discovery index, swallowing any error — index\n * freshness must never block or fail a health check. Reports only when it\n * actually rewrote a file.\n * @param cwd\n */\nfunction regenerateTicketIndex(cwd: string): void {\n try {\n const result = syncTickets(cwd);\n if (result.wrote) {\n info('Regenerated ticket index (INDEX.md / INDEX-completed.md)');\n }\n } catch (error: unknown) {\n // Best-effort: index freshness must never fail the health check. Surface\n // under DEBUG, then return — the deliberate swallow point.\n if (process.env.DEBUG) {\n console.error('[check] ticket index regen failed:', error);\n }\n return;\n }\n}\n\n/**\n *\n * @param options\n */\nexport async function check(options: CheckOptions): Promise<void> {\n const cwd = process.cwd();\n\n header('Safeword Health Check');\n\n const health = await checkHealth(cwd);\n\n // Not configured\n if (!health.configured) {\n info('Not configured. Run `safeword setup` to initialize.');\n return;\n }\n\n // Keep the ticket discovery index fresh at this checkpoint (best-effort —\n // never fail the health check on index regen). Ticket 1GGD28.\n regenerateTicketIndex(cwd);\n\n // Show versions\n keyValue('Safeword CLI', `v${health.cliVersion}`);\n keyValue('Project config', health.projectVersion ? `v${health.projectVersion}` : 'unknown');\n\n // Check for updates (unless offline)\n if (options.offline) {\n info('\\nSkipped update check (offline mode)');\n } else {\n await reportUpdateStatus(health);\n }\n\n reportVersionMismatch(health);\n const hasIssues = reportHealthSummary(health);\n\n if (hasIssues) {\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,OAAO,aAAa;AAepB,eAAe,mBAAmB,UAAU,KAAmC;AAC7E,MAAI;AACF,UAAM,aAAa,IAAI,gBAAgB;AACvC,UAAM,YAAY,WAAW,MAAM;AACjC,iBAAW,MAAM;AAAA,IACnB,GAAG,OAAO;AAEV,UAAM,WAAW,MAAM,MAAM,8CAA8C;AAAA,MACzE,QAAQ,WAAW;AAAA,IACrB,CAAC;AAED,iBAAa,SAAS;AAEtB,QAAI,CAAC,SAAS,GAAI,QAAO;AAEzB,UAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,WAAO,KAAK,WAAW;AAAA,EACzB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMA,eAAe,mBAAmB,QAAqC;AACrE,OAAK,2BAA2B;AAChC,QAAM,gBAAgB,MAAM,mBAAmB;AAE/C,MAAI,CAAC,eAAe;AAClB,SAAK,uCAAuC;AAC5C;AAAA,EACF;AAEA,SAAO,gBAAgB;AACvB,SAAO,kBAAkB,eAAe,OAAO,YAAY,aAAa;AAExE,M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W;AACb,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDirectory,
|
|
3
3
|
readFileSafe
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MPYFFJBF.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/configured-paths.ts
|
|
7
7
|
import nodePath from "path";
|
|
@@ -117,4 +117,4 @@ export {
|
|
|
117
117
|
defaultConfiguredPath,
|
|
118
118
|
resolveConfiguredPath
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-2WUL76K5.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
addInstalledPack,
|
|
4
4
|
isGitRepo,
|
|
5
5
|
isPackInstalled
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DFATZL6F.js";
|
|
7
7
|
import {
|
|
8
8
|
SAFEWORD_PEER_DEPENDENCIES
|
|
9
9
|
} from "./chunk-HSC7TELY.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
listItem,
|
|
14
14
|
readJson,
|
|
15
15
|
warn
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MPYFFJBF.js";
|
|
17
17
|
|
|
18
18
|
// src/packs/install.ts
|
|
19
19
|
function installPack(packId, cwd) {
|
|
@@ -390,4 +390,4 @@ export {
|
|
|
390
390
|
getEslintPeerMismatchWarning,
|
|
391
391
|
maybeAutoPatchOrNudge
|
|
392
392
|
};
|
|
393
|
-
//# sourceMappingURL=chunk-
|
|
393
|
+
//# sourceMappingURL=chunk-5WF73MP2.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
findDanglingDependencies,
|
|
3
3
|
findTicketsInCycles,
|
|
4
4
|
readTickets
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JLFYAVLP.js";
|
|
6
6
|
import {
|
|
7
7
|
formatTicketReference
|
|
8
8
|
} from "./chunk-NHXVS5FL.js";
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
createProjectContext,
|
|
23
23
|
getMissingPacks,
|
|
24
24
|
reconcile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-DFATZL6F.js";
|
|
26
26
|
import {
|
|
27
27
|
defaultConfiguredPath,
|
|
28
28
|
readConfiguredDocumentationSources,
|
|
29
29
|
readConfiguredPath,
|
|
30
30
|
resolveConfiguredPath,
|
|
31
31
|
resolveTicketsDirectory
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-2WUL76K5.js";
|
|
33
33
|
import {
|
|
34
34
|
VERSION
|
|
35
35
|
} from "./chunk-HSC7TELY.js";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
readFileSafe,
|
|
43
43
|
success,
|
|
44
44
|
warn
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-MPYFFJBF.js";
|
|
46
46
|
|
|
47
47
|
// src/health.ts
|
|
48
48
|
import { readdirSync as readdirSync2 } from "fs";
|
|
@@ -698,4 +698,4 @@ export {
|
|
|
698
698
|
checkHealth,
|
|
699
699
|
reportHealthSummary
|
|
700
700
|
};
|
|
701
|
-
//# sourceMappingURL=chunk-
|
|
701
|
+
//# sourceMappingURL=chunk-BAJDI467.js.map
|