@agent-ix/quoin 0.2.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.
Files changed (124) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +122 -0
  3. package/bin/quoin.js +8 -0
  4. package/default-modules.yaml +82 -0
  5. package/dist/catalog.d.ts +32 -0
  6. package/dist/catalog.d.ts.map +1 -0
  7. package/dist/cli-ClS52_Fm.js +436 -0
  8. package/dist/cli.d.ts +3 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +2 -0
  11. package/dist/flows.d.ts +7 -0
  12. package/dist/flows.d.ts.map +1 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +2 -0
  16. package/dist/modules.d.ts +10 -0
  17. package/dist/modules.d.ts.map +1 -0
  18. package/dist/plugins.d.ts +13 -0
  19. package/dist/plugins.d.ts.map +1 -0
  20. package/dist/write.d.ts +22 -0
  21. package/dist/write.d.ts.map +1 -0
  22. package/package.json +85 -0
  23. package/plugin.json +6 -0
  24. package/skills/spec-app-review/SKILL.md +51 -0
  25. package/skills/spec-app-review/references/checklist.md +194 -0
  26. package/skills/spec-dependency-analysis/SKILL.md +75 -0
  27. package/skills/spec-evidence-analysis/SKILL.md +78 -0
  28. package/skills/spec-failure-domain-analysis/SKILL.md +44 -0
  29. package/skills/spec-ideation/SKILL.md +46 -0
  30. package/skills/spec-integrity-analysis/SKILL.md +47 -0
  31. package/skills/spec-matrix/SKILL.md +79 -0
  32. package/skills/spec-matrix/assets/test-cases/TC-001.md +35 -0
  33. package/skills/spec-matrix/assets/test-cases/TC-002.md +37 -0
  34. package/skills/spec-matrix/assets/test-cases/TC-006.md +50 -0
  35. package/skills/spec-matrix/assets/test-matrix-example.md +97 -0
  36. package/skills/spec-matrix/assets/test-matrix-template.md +117 -0
  37. package/skills/spec-matrix/workflow-assets/dist/index.d.ts +146 -0
  38. package/skills/spec-matrix/workflow-assets/dist/index.d.ts.map +1 -0
  39. package/skills/spec-matrix/workflow-assets/dist/index.js +7655 -0
  40. package/skills/spec-matrix/workflow-assets/dist/invariants.d.ts +6 -0
  41. package/skills/spec-matrix/workflow-assets/dist/invariants.d.ts.map +1 -0
  42. package/skills/spec-matrix/workflow-assets/skills/matrix/SKILL.md +35 -0
  43. package/skills/spec-matrix/workflow-assets/skills/matrix/scripts/invariants.js +1 -0
  44. package/skills/spec-matrix/workflow-assets/skills/matrix/templates/report/default.md +30 -0
  45. package/skills/spec-matrix/workflow-assets/skills/matrix/workflows/matrix/def.yaml +82 -0
  46. package/skills/spec-object-review/SKILL.md +125 -0
  47. package/skills/spec-object-review/references/object-type-guide.md +113 -0
  48. package/skills/spec-review/SKILL.md +41 -0
  49. package/skills/spec-review/references/checklist.md +50 -0
  50. package/skills/spec-review/workflow-assets/dist/index.d.ts +146 -0
  51. package/skills/spec-review/workflow-assets/dist/index.d.ts.map +1 -0
  52. package/skills/spec-review/workflow-assets/dist/index.js +7655 -0
  53. package/skills/spec-review/workflow-assets/dist/invariants.d.ts +6 -0
  54. package/skills/spec-review/workflow-assets/dist/invariants.d.ts.map +1 -0
  55. package/skills/spec-review/workflow-assets/skills/review/SKILL.md +35 -0
  56. package/skills/spec-review/workflow-assets/skills/review/scripts/invariants.js +1 -0
  57. package/skills/spec-review/workflow-assets/skills/review/templates/report/default.md +30 -0
  58. package/skills/spec-review/workflow-assets/skills/review/workflows/review/def.yaml +82 -0
  59. package/skills/spec-risk-complexity-analysis/SKILL.md +77 -0
  60. package/skills/spec-scope-boundary-analysis/SKILL.md +86 -0
  61. package/skills/spec-security-analysis/SKILL.md +84 -0
  62. package/skills/spec-security-analysis/assets/security-analysis-example.md +89 -0
  63. package/skills/spec-security-analysis/assets/security-analysis-template.md +73 -0
  64. package/skills/spec-security-analysis/references/component-type-mapping.md +161 -0
  65. package/skills/spec-security-analysis/references/gdpr/ChII-Principles.md +58 -0
  66. package/skills/spec-security-analysis/references/gdpr/ChIII-DataSubjectRights.md +84 -0
  67. package/skills/spec-security-analysis/references/gdpr/ChIV-ControllerProcessor.md +83 -0
  68. package/skills/spec-security-analysis/references/gdpr/ChV-DataTransfers.md +62 -0
  69. package/skills/spec-security-analysis/references/gdpr/index.md +54 -0
  70. package/skills/spec-security-analysis/references/iso27001/A5-OrganizationalControls.md +64 -0
  71. package/skills/spec-security-analysis/references/iso27001/A6-PeopleControls.md +30 -0
  72. package/skills/spec-security-analysis/references/iso27001/A7-PhysicalControls.md +35 -0
  73. package/skills/spec-security-analysis/references/iso27001/A8-TechnologicalControls.md +66 -0
  74. package/skills/spec-security-analysis/references/iso27001/index.md +43 -0
  75. package/skills/spec-security-analysis/references/nist-800-53/AC-AccessControl.md +57 -0
  76. package/skills/spec-security-analysis/references/nist-800-53/AU-AuditAccountability.md +49 -0
  77. package/skills/spec-security-analysis/references/nist-800-53/CM-ConfigurationManagement.md +36 -0
  78. package/skills/spec-security-analysis/references/nist-800-53/IA-IdentificationAuthentication.md +44 -0
  79. package/skills/spec-security-analysis/references/nist-800-53/SA-SystemServicesAcquisition.md +50 -0
  80. package/skills/spec-security-analysis/references/nist-800-53/SC-SystemCommunications.md +53 -0
  81. package/skills/spec-security-analysis/references/nist-800-53/SI-SystemInformationIntegrity.md +52 -0
  82. package/skills/spec-security-analysis/references/nist-800-53/index.md +58 -0
  83. package/skills/spec-security-analysis/references/owasp-asvs/V1-Architecture.md +33 -0
  84. package/skills/spec-security-analysis/references/owasp-asvs/V10-MaliciousCode.md +33 -0
  85. package/skills/spec-security-analysis/references/owasp-asvs/V11-BusinessLogic.md +32 -0
  86. package/skills/spec-security-analysis/references/owasp-asvs/V12-Files.md +34 -0
  87. package/skills/spec-security-analysis/references/owasp-asvs/V13-API.md +34 -0
  88. package/skills/spec-security-analysis/references/owasp-asvs/V14-Configuration.md +35 -0
  89. package/skills/spec-security-analysis/references/owasp-asvs/V2-Authentication.md +36 -0
  90. package/skills/spec-security-analysis/references/owasp-asvs/V3-SessionManagement.md +35 -0
  91. package/skills/spec-security-analysis/references/owasp-asvs/V4-AccessControl.md +39 -0
  92. package/skills/spec-security-analysis/references/owasp-asvs/V5-Validation.md +37 -0
  93. package/skills/spec-security-analysis/references/owasp-asvs/V6-Cryptography.md +34 -0
  94. package/skills/spec-security-analysis/references/owasp-asvs/V7-ErrorLogging.md +37 -0
  95. package/skills/spec-security-analysis/references/owasp-asvs/V8-DataProtection.md +34 -0
  96. package/skills/spec-security-analysis/references/owasp-asvs/V9-Communication.md +32 -0
  97. package/skills/spec-security-analysis/references/owasp-asvs/index.md +59 -0
  98. package/skills/spec-security-analysis/references/soc2/CC1-ControlEnvironment.md +31 -0
  99. package/skills/spec-security-analysis/references/soc2/CC2-CommunicationInformation.md +27 -0
  100. package/skills/spec-security-analysis/references/soc2/CC3-RiskAssessment.md +29 -0
  101. package/skills/spec-security-analysis/references/soc2/CC4-MonitoringActivities.md +27 -0
  102. package/skills/spec-security-analysis/references/soc2/CC5-ControlActivities.md +28 -0
  103. package/skills/spec-security-analysis/references/soc2/CC6-LogicalPhysicalAccess.md +45 -0
  104. package/skills/spec-security-analysis/references/soc2/CC7-SystemOperations.md +42 -0
  105. package/skills/spec-security-analysis/references/soc2/CC8-ChangeManagement.md +32 -0
  106. package/skills/spec-security-analysis/references/soc2/CC9-RiskMitigation.md +34 -0
  107. package/skills/spec-security-analysis/references/soc2/index.md +46 -0
  108. package/skills/spec-security-analysis/references/standards-index.md +46 -0
  109. package/skills/spec-to-plan/SKILL.md +44 -0
  110. package/skills/spec-to-plan/references/step-1-analysis.md +58 -0
  111. package/skills/spec-to-plan/references/step-2-test-plan.md +37 -0
  112. package/skills/spec-to-plan/references/step-3-execution-plan.md +178 -0
  113. package/skills/spec-to-plan/workflow-assets/dist/index.d.ts +146 -0
  114. package/skills/spec-to-plan/workflow-assets/dist/index.d.ts.map +1 -0
  115. package/skills/spec-to-plan/workflow-assets/dist/index.js +7655 -0
  116. package/skills/spec-to-plan/workflow-assets/dist/invariants.d.ts +6 -0
  117. package/skills/spec-to-plan/workflow-assets/dist/invariants.d.ts.map +1 -0
  118. package/skills/spec-to-plan/workflow-assets/skills/to-plan/SKILL.md +35 -0
  119. package/skills/spec-to-plan/workflow-assets/skills/to-plan/scripts/invariants.js +1 -0
  120. package/skills/spec-to-plan/workflow-assets/skills/to-plan/templates/implementation-plan/default.md +43 -0
  121. package/skills/spec-to-plan/workflow-assets/skills/to-plan/workflows/to-plan/def.yaml +82 -0
  122. package/skills/specify/SKILL.md +69 -0
  123. package/skills/specify/assets/app-spec-template.md +143 -0
  124. package/skills/specify/assets/spec-template.md +299 -0
@@ -0,0 +1,436 @@
1
+ import { existsSync as e, readFileSync as t, readdirSync as n, rmSync as r, statSync as i } from "node:fs";
2
+ import { basename as a, dirname as o, join as s, resolve as c } from "node:path";
3
+ import { fileURLToPath as l } from "node:url";
4
+ import { configureRuntimeContext as u } from "@agent-ix/ix-cli-core";
5
+ import { homedir as d } from "node:os";
6
+ import { parse as f } from "yaml";
7
+ import { installEntry as p, readRegistry as m, reconcile as h, validateMarketplaceManifest as g, writeRegistry as ee } from "@agent-ix/ts-plugin-kit";
8
+ import { spawn as _ } from "node:child_process";
9
+ //#region src/catalog.ts
10
+ function v() {
11
+ return process.env.IX_HOME && process.env.IX_HOME.length > 0 ? process.env.IX_HOME : s(d(), ".ix");
12
+ }
13
+ function y(e = v()) {
14
+ return s(e, "filament", "modules");
15
+ }
16
+ function b(t = v()) {
17
+ let r = [], i = process.env.QUOIN_MODULE_PATHS;
18
+ i && r.push(...i.split(":").filter(Boolean));
19
+ let a = y(t);
20
+ if (e(a)) for (let e of n(a)) r.push(s(a, e));
21
+ return r;
22
+ }
23
+ function x(e = b()) {
24
+ let n = [], r = [], i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
25
+ for (let c of e) {
26
+ let e = w(c);
27
+ if (!e || i.has(e)) continue;
28
+ i.add(e);
29
+ let l = f(t(s(e, "manifest.yaml"), "utf8")), u = D(l.name) ?? a(e);
30
+ if (o.has(u)) continue;
31
+ o.add(u);
32
+ let d = E(l.artifact_types), p = E(l.object_types);
33
+ n.push({
34
+ name: u,
35
+ version: D(l.version),
36
+ root: e,
37
+ artifactTypes: d.map((e) => String(e.name)),
38
+ objectTypes: p.map((e) => String(e.name))
39
+ });
40
+ for (let t of d) {
41
+ let n = String(t.name), i = D(t.frontmatter_schema_ref);
42
+ r.push({
43
+ name: n,
44
+ kind: "artifact",
45
+ moduleName: u,
46
+ moduleRoot: e,
47
+ schemaRef: i,
48
+ schemaPath: i ? s(e, i) : void 0,
49
+ skeletonPath: T(e, n)
50
+ });
51
+ }
52
+ for (let t of p) {
53
+ let n = String(t.name);
54
+ r.push({
55
+ name: n,
56
+ kind: "object",
57
+ moduleName: u,
58
+ moduleRoot: e,
59
+ skeletonPath: T(e, n)
60
+ });
61
+ }
62
+ }
63
+ return {
64
+ modules: n,
65
+ entries: r,
66
+ duplicates: O(r)
67
+ };
68
+ }
69
+ function S(e, t) {
70
+ let n = C(t);
71
+ return e.entries.find((e) => C(e.name) === n);
72
+ }
73
+ function C(e) {
74
+ return e.toLowerCase();
75
+ }
76
+ function w(t) {
77
+ let r = c(t);
78
+ if (e(r)) {
79
+ if (e(s(r, "manifest.yaml"))) return r;
80
+ if (i(r).isDirectory()) for (let t of n(r)) {
81
+ let n = s(r, t);
82
+ if (e(s(n, "manifest.yaml"))) return n;
83
+ }
84
+ }
85
+ }
86
+ function T(t, n) {
87
+ return [s(t, "skeletons", `${n}.md`), s(t, "skeletons", `${n.toLowerCase()}.md`)].find((t) => e(t));
88
+ }
89
+ function E(e) {
90
+ return Array.isArray(e) ? e.filter((e) => !!e && typeof e == "object" && "name" in e) : [];
91
+ }
92
+ function D(e) {
93
+ return typeof e == "string" ? e : void 0;
94
+ }
95
+ function O(e) {
96
+ let t = /* @__PURE__ */ new Map();
97
+ for (let n of e) {
98
+ let e = `${n.kind}:${n.name}`, r = t.get(e) ?? /* @__PURE__ */ new Set();
99
+ r.add(n.moduleName), t.set(e, r);
100
+ }
101
+ return [...t.entries()].filter(([, e]) => e.size > 1).map(([e, t]) => {
102
+ let [n, r] = e.split(":");
103
+ return {
104
+ kind: n,
105
+ name: r,
106
+ modules: [...t].sort()
107
+ };
108
+ });
109
+ }
110
+ //#endregion
111
+ //#region src/plugins.ts
112
+ function k(e = v()) {
113
+ return s(e, "filament", "registry.json");
114
+ }
115
+ function A(e) {
116
+ return {
117
+ cacheRoot: s(e, "cache", "ts-plugin-kit"),
118
+ targetRoot: y(e),
119
+ registryPath: k(e),
120
+ readName: te,
121
+ materialize: "copy"
122
+ };
123
+ }
124
+ function j(e) {
125
+ if (e.startsWith("path:")) return {
126
+ type: "path",
127
+ path: e.slice(5)
128
+ };
129
+ if (e.startsWith("github:")) {
130
+ let [t, n] = e.slice(7).split("@"), r = t.indexOf("//");
131
+ return r === -1 ? {
132
+ type: "github",
133
+ repo: t,
134
+ ref: n
135
+ } : {
136
+ type: "git-subdir",
137
+ url: t.slice(0, r),
138
+ path: t.slice(r + 2),
139
+ ref: n
140
+ };
141
+ }
142
+ if (e.startsWith("package:")) {
143
+ let t = e.slice(8), n = t.lastIndexOf("@");
144
+ return n > 0 ? {
145
+ type: "npm",
146
+ package: t.slice(0, n),
147
+ version: t.slice(n + 1)
148
+ } : {
149
+ type: "npm",
150
+ package: t
151
+ };
152
+ }
153
+ return {
154
+ type: "path",
155
+ path: e
156
+ };
157
+ }
158
+ function M(e, t = v()) {
159
+ return p({ source: j(e) }, A(t));
160
+ }
161
+ function N(e = v()) {
162
+ return m(k(e)).plugins;
163
+ }
164
+ function P(e, t = v()) {
165
+ let n = m(k(t));
166
+ r(s(y(t), e), {
167
+ force: !0,
168
+ recursive: !0
169
+ }), ee(k(t), {
170
+ schemaVersion: 1,
171
+ plugins: n.plugins.filter((t) => t.name !== e)
172
+ });
173
+ }
174
+ function te(n) {
175
+ let r = e(s(n, "manifest.yaml")) ? s(n, "manifest.yaml") : s(n, a(n), "manifest.yaml");
176
+ if (!e(r)) throw Error(`no manifest.yaml found under ${n}`);
177
+ let i = f(t(r, "utf8"));
178
+ if (typeof i.name != "string" || i.name.length === 0) throw Error(`manifest ${r} has no name`);
179
+ return i.name;
180
+ }
181
+ //#endregion
182
+ //#region src/modules.ts
183
+ function F() {
184
+ return o(o(l(import.meta.url)));
185
+ }
186
+ function I() {
187
+ return g(f(t(s(F(), "default-modules.yaml"), "utf8")));
188
+ }
189
+ function L(e = v(), t = I()) {
190
+ h(t, {
191
+ ...A(e),
192
+ mode: "lazy"
193
+ });
194
+ }
195
+ //#endregion
196
+ //#region src/flows.ts
197
+ var R = {
198
+ review: {
199
+ packageSkill: "spec-review",
200
+ runtimeSkill: "review"
201
+ },
202
+ matrix: {
203
+ packageSkill: "spec-matrix",
204
+ runtimeSkill: "matrix"
205
+ },
206
+ "to-plan": {
207
+ packageSkill: "spec-to-plan",
208
+ runtimeSkill: "to-plan"
209
+ }
210
+ };
211
+ function z() {
212
+ return Object.keys(R);
213
+ }
214
+ async function ne(e, t = {}) {
215
+ let n = re(e), r = v(), i = [
216
+ "run",
217
+ e,
218
+ "--path",
219
+ n,
220
+ "--config-root",
221
+ r,
222
+ "--state-dir",
223
+ s(r, "flows")
224
+ ];
225
+ t.id && i.push("--id", t.id), t.json && i.push("--json");
226
+ for (let e of t.target ?? []) i.push("--target", e);
227
+ await V(i);
228
+ }
229
+ function re(t) {
230
+ let n = R[t];
231
+ if (!n) throw Error(`unknown spec flow ${t}`);
232
+ let r = [
233
+ process.env.IX_SPEC_WORKFLOWS_ROOT,
234
+ B(),
235
+ s(o(c(process.cwd())), "ix-spec-workflows"),
236
+ s(d(), ".ix", "plugins", "ix-spec-workflows")
237
+ ].filter((e) => !!e);
238
+ for (let t of r) {
239
+ let r = s(t, n.packageSkill, "workflow-assets", "skills", n.runtimeSkill);
240
+ if (e(r)) return r;
241
+ }
242
+ throw Error(`could not find ix-spec workflow skill ${n.runtimeSkill}; set IX_SPEC_WORKFLOWS_ROOT`);
243
+ }
244
+ function B() {
245
+ return s(o(o(l(import.meta.url))), "skills");
246
+ }
247
+ async function V(e) {
248
+ await new Promise((t, n) => {
249
+ let r = _("ix-flow", e, { stdio: "inherit" });
250
+ r.on("error", n), r.on("close", (e) => {
251
+ if (e === 0) {
252
+ t();
253
+ return;
254
+ }
255
+ process.exitCode = e ?? 1, t();
256
+ });
257
+ });
258
+ }
259
+ //#endregion
260
+ //#region src/write.ts
261
+ function H(e) {
262
+ return (Array.isArray(e) ? e : e ? [e] : []).flatMap((e) => e.split(",")).map((e) => e.trim()).filter(Boolean);
263
+ }
264
+ function U(t, n, r) {
265
+ if (r.length === 0) throw Error("write requires --types <type[,type...]>");
266
+ let a = c(n);
267
+ if (!e(a) || !i(a).isDirectory()) throw Error(`write repo_dir is not a directory: ${n}`);
268
+ return {
269
+ repoRoot: a,
270
+ types: r.map((e) => {
271
+ let n = S(t, e);
272
+ if (!n) throw Error(`catalog type not found: ${e}\nAvailable types: ${t.entries.map((e) => e.name).sort((e, t) => e.localeCompare(t)).join(", ")}`);
273
+ return G(n);
274
+ }),
275
+ validation: {
276
+ command: `quire validate --scope ${K(a)} "spec/**/*.md"`,
277
+ scope: a,
278
+ globs: ["spec/**/*.md"]
279
+ }
280
+ };
281
+ }
282
+ function W(e) {
283
+ let t = [
284
+ "quoin write",
285
+ "",
286
+ `Repo: ${e.repoRoot}`,
287
+ "",
288
+ "Authoring contracts:"
289
+ ];
290
+ for (let n of e.types) t.push(`- ${n.name} (${n.kind})`), t.push(` module: ${n.moduleName}`), t.push(` module_root: ${n.moduleRoot}`), n.skeletonPath && t.push(` skeleton: ${n.skeletonPath}`), n.schemaPath && t.push(` schema: ${n.schemaPath}`), !n.skeletonPath && !n.schemaPath && t.push(" contract: manifest only");
291
+ return t.push(""), t.push("Author files directly in the repo, then validate changed spec files."), t.push(`Validate scope: ${e.validation.scope}`), t.push(`Validate command: ${e.validation.command}`), t.join("\n");
292
+ }
293
+ function G(e) {
294
+ return {
295
+ name: e.name,
296
+ kind: e.kind,
297
+ moduleName: e.moduleName,
298
+ moduleRoot: e.moduleRoot,
299
+ ...e.schemaPath ? { schemaPath: e.schemaPath } : {},
300
+ ...e.skeletonPath ? { skeletonPath: e.skeletonPath } : {}
301
+ };
302
+ }
303
+ function K(e) {
304
+ return /^[A-Za-z0-9_./:-]+$/.test(e) ? e : `'${e.replaceAll("'", "'\\''")}'`;
305
+ }
306
+ //#endregion
307
+ //#region src/cli.ts
308
+ var q = "quoin\n\nSpec workflow and catalog CLI for Agent IX.\n\nquoin starts spec-domain work. ix-flow resumes, advances, acknowledges gates,\nand inspects workflow runs created by quoin.\n\nDefault modules (installed on first use into ~/.ix/filament/modules):\n Artifact modules: spec-artifacts-iso, spec-artifacts-app, spec-artifacts-process\n Object modules: spec-objects-business, spec-objects-architecture,\n spec-objects-enterprise, spec-objects-operational,\n spec-objects-security\n Workflows: review, matrix, to-plan\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n quoin catalog list|validate\n quoin catalog show <type>\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n quoin review|matrix|to-plan [--target <ref>...]\n\nGlobal flags:\n --json\n --config-root <dir> Defaults to ~/.ix\n\nExamples:\n quoin catalog list\n quoin catalog show FR\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin write . --types FR,domain\n ix-flow status <run-id>\n", J = "quoin write\n\nBuild an authoring pack for spec files an agent is about to create or edit.\n\nPass the target repository and the artifact/object types involved in the work.\nquoin resolves those types from the active catalog and returns the local\nskeletons, schemas, module roots, and Quire validation command for the repo.\n\nUsage:\n quoin write <repo_dir> --types <type[,type...]>\n\nExamples:\n quoin write . --types FR\n quoin write . --types FR,domain,entity\n quoin write ../my-service --types fr,DOMAIN --json\n\nNotes:\n - Type lookup is case-insensitive; FR and fr are the same type.\n - Types can be artifacts or objects from the default module set or plugins.\n - Use the returned skeletons and schemas as the authoring contract.\n - Run the returned Quire command after editing spec files.\n", Y = "quoin catalog\n\nInspect the active artifact/object catalog.\n\nThe catalog is assembled from, in order:\n 1. QUOIN_MODULE_PATHS\n 2. modules installed under ~/.ix/filament/modules\n\nThe default module set is installed there automatically on first catalog access,\nand updated by \"quoin plugin install\". The same directory is read by quire-rs.\n\nDefault artifact modules:\n spec-artifacts-iso FR, NFR, StR, US, IT, TC, AC, CON, Spec\n spec-artifacts-app app-level artifacts\n spec-artifacts-process plans, reviews, matrices, ADRs, tasks, findings\n\nDefault object modules:\n spec-objects-business\n spec-objects-architecture\n spec-objects-enterprise\n spec-objects-operational\n spec-objects-security\n\nUsage:\n quoin catalog list\n quoin catalog show <type>\n quoin catalog validate\n\nExamples:\n quoin catalog show FR\n quoin catalog show entity\n quoin catalog validate --json\n", ie = "quoin plugin\n\nInstall and manage user/community spec modules.\n\nPlugins add or override artifact/object modules under ~/.ix/filament/modules.\nUse \"catalog list\" to see the full active catalog, including default modules and\nplugins.\n\nSupported install sources:\n path:<dir> Use a local directory containing manifest.yaml\n github:<owner>/<repo> Clone a GitHub repository (manifest at root)\n github:<owner>/<repo>@<ref> Pin to a tag, branch, or sha\n github:<owner>/<repo>//<subdir> Manifest in a monorepo subdirectory (@<ref> ok)\n\nUsage:\n quoin plugin install <path:...|github:...>\n quoin plugin list\n quoin plugin remove <name>\n\nExamples:\n quoin plugin install path:../spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-custom\n quoin plugin install github:agent-ix/spec-objects-security//spec_objects_security@v0.1.1\n quoin plugin list\n", ae = "quoin workflows\n\nStart bundled spec review/planning workflows. quoin creates the workflow run in ~/.ix/flows.\nUse ix-flow to inspect, resume, advance phases, and acknowledge human gates.\n\nAvailable workflow launchers:\n review Run a composite spec review\n matrix Build or update a requirements test matrix\n to-plan Convert accepted requirements into an implementation plan\n\nUsage:\n quoin review|matrix|to-plan [--target <ref>...]\n\nExamples:\n quoin review --target spec/\n quoin matrix --target spec/\n ix-flow status <run-id>\n ix-flow resume <run-id>\n";
309
+ async function oe(e) {
310
+ let t = ue(e);
311
+ if (t.flags.version || t.flags.v || t.command === "version") {
312
+ console.log(X());
313
+ return;
314
+ }
315
+ if (!t.command) {
316
+ console.log(q);
317
+ return;
318
+ }
319
+ if (t.flags.help || t.flags.h) {
320
+ console.log(se(t));
321
+ return;
322
+ }
323
+ let n = Q(t, "config-root") ?? v();
324
+ if (process.env.IX_HOME = n, u({
325
+ configRoot: n,
326
+ configNamespace: "ix",
327
+ projectConfigRoot: `${process.cwd()}/.ix`,
328
+ projectConfigEnabled: t.flags["no-project-config"] !== !0
329
+ }), t.command === "catalog") return ce(t);
330
+ if (t.command === "plugin") return le(t);
331
+ if (t.command === "write") return Z(t);
332
+ if (z().includes(t.command)) return ne(t.command, {
333
+ json: t.flags.json === !0,
334
+ id: Q(t, "id"),
335
+ target: $(t, "target")
336
+ });
337
+ throw Error(`unknown command ${t.command}\n\n${q}`);
338
+ }
339
+ function X() {
340
+ let e = o(o(l(import.meta.url))), n = JSON.parse(t(s(e, "package.json"), "utf8"));
341
+ if (typeof n.version != "string") throw Error("package.json version is missing");
342
+ return n.version;
343
+ }
344
+ function se(e) {
345
+ return e.command === "write" ? J : e.command === "catalog" ? Y : e.command === "plugin" ? ie : z().includes(e.command) ? ae : q;
346
+ }
347
+ function Z(e) {
348
+ let [t] = e.positionals;
349
+ if (!t) throw Error(`write requires <repo_dir>\n\n${J}`);
350
+ L();
351
+ let n = U(x(), t, H($(e, "types")));
352
+ console.log(e.flags.json ? JSON.stringify(n, null, 2) : W(n));
353
+ }
354
+ function ce(e) {
355
+ L();
356
+ let t = x();
357
+ switch (e.subcommand) {
358
+ case "list":
359
+ case void 0:
360
+ if (e.flags.json) {
361
+ console.log(JSON.stringify(t, null, 2));
362
+ return;
363
+ }
364
+ for (let e of t.modules) console.log(`${e.name}@${e.version ?? "unknown"} ${e.root}`);
365
+ return;
366
+ case "show": {
367
+ let [n] = e.positionals;
368
+ if (!n) throw Error("catalog show requires <type>");
369
+ let r = S(t, n);
370
+ if (!r) throw Error(`catalog type not found: ${n}`);
371
+ console.log(e.flags.json ? JSON.stringify(r, null, 2) : `${r.kind} ${r.name} from ${r.moduleName}\n${r.moduleRoot}`);
372
+ return;
373
+ }
374
+ case "validate":
375
+ if (t.duplicates.length > 0) {
376
+ console.error(JSON.stringify({
377
+ ok: !1,
378
+ duplicates: t.duplicates
379
+ }, null, 2)), process.exitCode = 1;
380
+ return;
381
+ }
382
+ console.log(e.flags.json ? JSON.stringify({
383
+ ok: !0,
384
+ modules: t.modules.length
385
+ }, null, 2) : `catalog ok (${t.modules.length} modules)`);
386
+ return;
387
+ default: throw Error(`unknown catalog command ${e.subcommand}`);
388
+ }
389
+ }
390
+ function le(e) {
391
+ switch (e.subcommand) {
392
+ case "list":
393
+ case void 0:
394
+ console.log(JSON.stringify({ plugins: N() }, null, 2));
395
+ return;
396
+ case "install": {
397
+ let [t] = e.positionals;
398
+ if (!t) throw Error("plugin install requires <source>");
399
+ console.log(JSON.stringify(M(t), null, 2));
400
+ return;
401
+ }
402
+ case "remove": {
403
+ let [t] = e.positionals;
404
+ if (!t) throw Error("plugin remove requires <name>");
405
+ P(t), console.log(`removed ${t}`);
406
+ return;
407
+ }
408
+ default: throw Error(`unknown plugin command ${e.subcommand}`);
409
+ }
410
+ }
411
+ function ue(e) {
412
+ let t = {}, n = [], r, i;
413
+ for (let a = 0; a < e.length; a++) {
414
+ let o = e[a];
415
+ if (o.startsWith("--")) {
416
+ let n = o.indexOf("="), r = o.slice(2, n === -1 ? void 0 : n), i = n === -1 ? e[a + 1] && !e[a + 1].startsWith("-") ? e[++a] : !0 : o.slice(n + 1);
417
+ r === "target" || r === "types" ? t[r] = [...$({ flags: t }, r), String(i)] : t[r] = i;
418
+ } else o.startsWith("-") && o.length > 1 ? t[o.slice(1)] = !0 : r ? !i && (r === "catalog" || r === "plugin") ? i = o : n.push(o) : r = o;
419
+ }
420
+ return {
421
+ command: r,
422
+ subcommand: i,
423
+ positionals: n,
424
+ flags: t
425
+ };
426
+ }
427
+ function Q(e, t) {
428
+ let n = e.flags[t];
429
+ return typeof n == "string" ? n : void 0;
430
+ }
431
+ function $(e, t) {
432
+ let n = e.flags[t];
433
+ return Array.isArray(n) ? n : [];
434
+ }
435
+ //#endregion
436
+ export { H as a, M as c, P as d, b as f, x as h, W as i, N as l, S as m, X as n, I as o, y as p, U as r, L as s, oe as t, j as u };
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export declare function main(argv: string[]): Promise<void>;
2
+ export declare function packageVersion(): string;
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAiKA,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCxD;AAED,wBAAgB,cAAc,IAAI,MAAM,CASvC"}
package/dist/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./cli-ClS52_Fm.js";
2
+ export { t as main, e as packageVersion };
@@ -0,0 +1,7 @@
1
+ export declare function specFlowNames(): string[];
2
+ export declare function startSpecFlow(flow: string, opts?: {
3
+ json?: boolean;
4
+ id?: string;
5
+ target?: string[];
6
+ }): Promise<void>;
7
+ //# sourceMappingURL=flows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../src/flows.ts"],"names":[],"mappings":"AAiBA,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GAC5D,OAAO,CAAC,IAAI,CAAC,CAiBf"}
@@ -0,0 +1,6 @@
1
+ export { main } from './cli.js';
2
+ export { loadCatalog, defaultModuleRoots, filamentModulesDir, findCatalogEntry, } from './catalog.js';
3
+ export { ensureDefaultModules, defaultModulesManifest } from './modules.js';
4
+ export { installPlugin, listPlugins, removePlugin, parseSourceArg, } from './plugins.js';
5
+ export { createAuthoringPack, formatAuthoringPack, parseTypeList, } from './write.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./cli-ClS52_Fm.js";
2
+ export { u as createAuthoringPack, r as defaultModuleRoots, c as defaultModulesManifest, d as ensureDefaultModules, l as filamentModulesDir, s as findCatalogEntry, a as formatAuthoringPack, t as installPlugin, o as listPlugins, i as loadCatalog, f as main, p as parseSourceArg, e as parseTypeList, n as removePlugin };
@@ -0,0 +1,10 @@
1
+ import { MarketplaceManifest } from '@agent-ix/ts-plugin-kit';
2
+ /** The committed default module set shipped with quoin. */
3
+ export declare function defaultModulesManifest(): MarketplaceManifest;
4
+ /**
5
+ * Lazily install the default module set into `~/.ix/filament/modules`. Idempotent
6
+ * and (once installed and pinned) does no git — safe to call before every catalog
7
+ * read. Pass a manifest to override the committed default set (used by tests).
8
+ */
9
+ export declare function ensureDefaultModules(home?: string, manifest?: MarketplaceManifest): void;
10
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AASjC,2DAA2D;AAC3D,wBAAgB,sBAAsB,IAAI,mBAAmB,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,SAAW,EACf,QAAQ,GAAE,mBAA8C,GACvD,IAAI,CAEN"}
@@ -0,0 +1,13 @@
1
+ import { InstallOptions, InstalledPlugin, Source } from '@agent-ix/ts-plugin-kit';
2
+ export type { InstalledPlugin } from '@agent-ix/ts-plugin-kit';
3
+ export declare function registryPath(home?: string): string;
4
+ /** Shared ts-plugin-kit install options for this home (default-set reconcile + ad-hoc install). */
5
+ export declare function installOptions(home: string): InstallOptions;
6
+ /** Map a quoin CLI source argument to a typed ts-plugin-kit {@link Source}. */
7
+ export declare function parseSourceArg(arg: string): Source;
8
+ export declare function installPlugin(source: string, home?: string): InstalledPlugin;
9
+ export declare function listPlugins(home?: string): InstalledPlugin[];
10
+ export declare function removePlugin(name: string, home?: string): void;
11
+ /** Read a module's declared name from its `manifest.yaml`. Used as the `readName` hook. */
12
+ export declare function readModuleName(moduleRoot: string): string;
13
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,MAAM,EACZ,MAAM,yBAAyB,CAAC;AAIjC,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,wBAAgB,YAAY,CAAC,IAAI,SAAW,GAAG,MAAM,CAEpD;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAQ3D;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA6BlD;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,SAAW,GACd,eAAe,CAEjB;AAED,wBAAgB,WAAW,CAAC,IAAI,SAAW,GAAG,eAAe,EAAE,CAE9D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,SAAW,GAAG,IAAI,CAUhE;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAazD"}
@@ -0,0 +1,22 @@
1
+ import { SpecCatalog } from './catalog.js';
2
+ export interface AuthoringContract {
3
+ name: string;
4
+ kind: "artifact" | "object";
5
+ moduleName: string;
6
+ moduleRoot: string;
7
+ schemaPath?: string;
8
+ skeletonPath?: string;
9
+ }
10
+ export interface AuthoringPack {
11
+ repoRoot: string;
12
+ types: AuthoringContract[];
13
+ validation: {
14
+ command: string;
15
+ scope: string;
16
+ globs: string[];
17
+ };
18
+ }
19
+ export declare function parseTypeList(value: string | string[] | undefined): string[];
20
+ export declare function createAuthoringPack(catalog: SpecCatalog, repoDir: string, typeNames: string[]): AuthoringPack;
21
+ export declare function formatAuthoringPack(pack: AuthoringPack): string;
22
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAM5E;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,GAClB,aAAa,CA+Bf;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAyB/D"}
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@agent-ix/quoin",
3
+ "description": "Spec workflow and catalog CLI for Agent IX.",
4
+ "version": "0.2.1",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "dist/",
9
+ "default-modules.yaml",
10
+ "skills/",
11
+ "bin/",
12
+ "plugin.json",
13
+ "LICENSE",
14
+ "README.md"
15
+ ],
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "bin": {
19
+ "quoin": "bin/quoin.js"
20
+ },
21
+ "packageManager": "pnpm@10.33.4",
22
+ "scripts": {
23
+ "help": "node scripts/help.js",
24
+ "test": "vitest run",
25
+ "test:coverage": "vitest run --coverage",
26
+ "test:json": "vitest run --reporter=json --outputFile=report.json || true",
27
+ "test:evals": "node evals/run.mjs",
28
+ "lint": "eslint \"src/**/*.{ts,tsx,js,jsx}\" \"tests/**/*.{ts,tsx,js,jsx}\" && pnpm run format:check",
29
+ "format": "prettier --write .",
30
+ "format:check": "prettier --check .",
31
+ "build": "vite build",
32
+ "clean": "rm -rf node_modules dist coverage .pnpm-store",
33
+ "install:frozen": "pnpm install --frozen-lockfile",
34
+ "update-lock": "pnpm install --lockfile-only",
35
+ "version": "node scripts/build-tools.js version",
36
+ "info": "node scripts/build-tools.js info",
37
+ "docker:build": "docker build -t ghcr.io/agent-ix/quoin .",
38
+ "publish:dry-run": "pnpm publish --dry-run",
39
+ "prepublishOnly": "pnpm run build",
40
+ "tags": "npm dist-tag ls @agent-ix/quoin --registry https://npm.pkg.github.com || echo '(package not found or registry unavailable)'",
41
+ "pkg:add": "pnpm add",
42
+ "pkg:add-dev": "pnpm add -D",
43
+ "pkg:update": "pnpm update",
44
+ "pkg:update-latest": "pnpm update --latest",
45
+ "pkg:use-local": "pnpm dlx @agent-ix/js-deps use-local",
46
+ "pkg:use-upstream": "pnpm dlx @agent-ix/js-deps use-upstream",
47
+ "pkg:refresh-local": "pnpm dlx @agent-ix/js-deps refresh-local",
48
+ "test-results:summary": "./node_modules/.bin/jest-results summary",
49
+ "test-results:groups": "./node_modules/.bin/jest-results groups",
50
+ "test-results:detail": "./node_modules/.bin/jest-results detail",
51
+ "test-results:find": "./node_modules/.bin/jest-results find",
52
+ "test-results:failed": "./node_modules/.bin/jest-results failed",
53
+ "test-results:errors": "./node_modules/.bin/jest-results errors",
54
+ "test-results:warnings": "./node_modules/.bin/jest-results warnings"
55
+ },
56
+ "dependencies": {
57
+ "@agent-ix/ix-cli-core": "0.10.2",
58
+ "@agent-ix/ts-plugin-kit": "^0.1.1",
59
+ "yaml": "^2.9.0"
60
+ },
61
+ "devDependencies": {
62
+ "@types/node": "25.9.2",
63
+ "@typescript-eslint/eslint-plugin": "8.60.1",
64
+ "@typescript-eslint/parser": "8.60.1",
65
+ "@vitest/coverage-v8": "4.1.8",
66
+ "add": "^2.0.6",
67
+ "eslint": "10.4.1",
68
+ "eslint-plugin-prettier": "5.5.6",
69
+ "pnpm": "11.5.2",
70
+ "prettier": "3.8.3",
71
+ "ts-node": "^10.9.2",
72
+ "typescript": "6.0.3",
73
+ "vite": "8.0.16",
74
+ "vite-plugin-dts": "5.0.2",
75
+ "vitest": "4.1.8"
76
+ },
77
+ "publishConfig": {
78
+ "registry": "https://registry.npmjs.org/",
79
+ "access": "public"
80
+ },
81
+ "repository": {
82
+ "type": "git",
83
+ "url": "git+https://github.com/agent-ix/quoin.git"
84
+ }
85
+ }
package/plugin.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "quoin",
3
+ "version": "0.1.0",
4
+ "description": "Spec authoring, review, matrix, and planning skills for Agent IX.",
5
+ "skills": "./skills"
6
+ }