@ryuxdsgn/design-intelligence 2.13.3 → 2.13.5
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/adapters.js +29 -0
- package/dist/cli/fsutil.js +61 -0
- package/dist/cli/index.js +712 -0
- package/dist/intelligence/analyze.js +146 -0
- package/dist/intelligence/capture.js +25 -0
- package/dist/intelligence/content.js +1422 -0
- package/dist/intelligence/critique.js +231 -0
- package/dist/intelligence/guides.js +778 -0
- package/dist/product.js +16 -0
- package/dist/render.js +279 -0
- package/dist/validate.js +68 -0
- package/package.json +2 -1
package/dist/adapters.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const AGENT_TARGETS = [
|
|
2
|
+
{ id: "claude", label: "Claude Code", dir: ".claude/skills", globalDir: ".claude/skills", pointer: "CLAUDE.md" },
|
|
3
|
+
{ id: "codex", label: "Codex", dir: ".codex/skills", globalDir: ".agents/skills", pointer: "AGENTS.md" },
|
|
4
|
+
{ id: "cursor", label: "Cursor", dir: ".cursor/skills", globalDir: ".cursor/skills", pointer: "AGENTS.md" },
|
|
5
|
+
{ id: "gemini", label: "Gemini CLI", dir: ".gemini/skills", globalDir: ".gemini/skills", pointer: "GEMINI.md" },
|
|
6
|
+
{ id: "opencode", label: "OpenCode", dir: ".opencode/skills", globalDir: ".config/opencode/skills", pointer: "AGENTS.md" },
|
|
7
|
+
{ id: "cline", label: "Cline", dir: ".cline/skills", globalDir: ".cline/skills", pointer: "AGENTS.md" },
|
|
8
|
+
{ id: "copilot", label: "GitHub Copilot", dir: ".agents/skills", globalDir: ".agents/skills", pointer: "AGENTS.md" },
|
|
9
|
+
{ id: "amp", label: "Amp", dir: ".agents/skills", globalDir: ".config/agents/skills", pointer: "AGENTS.md" },
|
|
10
|
+
{ id: "kimi", label: "Kimi Code", dir: ".agents/skills", globalDir: ".agents/skills", pointer: "AGENTS.md" },
|
|
11
|
+
{ id: "antigravity", label: "Antigravity", dir: ".agents/skills", globalDir: ".gemini/config/skills", pointer: "AGENTS.md" },
|
|
12
|
+
];
|
|
13
|
+
/** Inline target for any other agent: the full rules written into AGENTS.md (project only). */
|
|
14
|
+
export const AGENTS_MD_INLINE = { id: "agents-md", label: "Any other agent (rules inline in AGENTS.md)" };
|
|
15
|
+
// Old per-concern installs (ruleset RX-1.x) mapped to the new skills, for --concerns.
|
|
16
|
+
// RX-1.x --concerns values mapped to current skill ids (kept for migration).
|
|
17
|
+
export const LEGACY_CONCERNS = {
|
|
18
|
+
ui: ["ui", "design-system", "responsive"],
|
|
19
|
+
copy: ["content"],
|
|
20
|
+
a11y: ["accessibility"],
|
|
21
|
+
ux: ["ux", "interaction", "forms", "edge-cases"],
|
|
22
|
+
local: ["product", "interaction", "forms", "content"],
|
|
23
|
+
code: ["frontend"],
|
|
24
|
+
};
|
|
25
|
+
// Skill folder names from earlier releases that no longer exist. "ui" and "ux" are not listed:
|
|
26
|
+
// they are current skill names again and get overwritten or removed with the current set.
|
|
27
|
+
export const LEGACY_SKILL_DIRS = ["rules", "copy", "a11y", "local", "code"];
|
|
28
|
+
/** Cursor used .mdc rule files before it read skill folders (ryux-rules 0.x). */
|
|
29
|
+
export const LEGACY_CURSOR_RULES_DIR = ".cursor/rules";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, relative } from "node:path";
|
|
4
|
+
import { MARK_END, MARK_START } from "../product.js";
|
|
5
|
+
function escapeRe(s) {
|
|
6
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7
|
+
}
|
|
8
|
+
const RULES_MARKS = [MARK_START, MARK_END];
|
|
9
|
+
const blockRe = ([start, end]) => new RegExp(`${escapeRe(start)}[\\s\\S]*?${escapeRe(end)}`);
|
|
10
|
+
/** True when the file holds a block between these markers. */
|
|
11
|
+
export function hasBlock(content, marks = RULES_MARKS) {
|
|
12
|
+
return Boolean(content && blockRe(marks).test(content));
|
|
13
|
+
}
|
|
14
|
+
export function rel(path) {
|
|
15
|
+
return relative(process.cwd(), path) || path;
|
|
16
|
+
}
|
|
17
|
+
export async function writeFileEnsured(path, content) {
|
|
18
|
+
await mkdir(dirname(path), { recursive: true });
|
|
19
|
+
await writeFile(path, content, "utf8");
|
|
20
|
+
}
|
|
21
|
+
/** Write or update ONLY the marked ryux-rules block. The rest of the user's file is untouched. */
|
|
22
|
+
export async function upsertBlock(path, body, marks = RULES_MARKS) {
|
|
23
|
+
const block = `${marks[0]}\n${body}\n${marks[1]}`;
|
|
24
|
+
const existing = existsSync(path) ? await readFile(path, "utf8") : "";
|
|
25
|
+
let next;
|
|
26
|
+
if (blockRe(marks).test(existing)) {
|
|
27
|
+
next = existing.replace(blockRe(marks), block);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const base = existing.trimEnd();
|
|
31
|
+
next = base ? `${base}\n\n${block}\n` : `${block}\n`;
|
|
32
|
+
}
|
|
33
|
+
await writeFileEnsured(path, next);
|
|
34
|
+
}
|
|
35
|
+
/** Remove the marked ryux-rules block; return true if anything was removed. */
|
|
36
|
+
export async function removeBlock(path, marks = RULES_MARKS) {
|
|
37
|
+
if (!existsSync(path))
|
|
38
|
+
return false;
|
|
39
|
+
const existing = await readFile(path, "utf8");
|
|
40
|
+
if (!blockRe(marks).test(existing))
|
|
41
|
+
return false;
|
|
42
|
+
const stripped = existing.replace(blockRe(marks), "").replace(/\n{3,}/g, "\n\n").trimEnd();
|
|
43
|
+
if (!stripped) {
|
|
44
|
+
// The file only holds the ryux-rules block (we created it) -> delete it, don't leave an empty file.
|
|
45
|
+
await rm(path, { force: true });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
await writeFile(path, `${stripped}\n`, "utf8");
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
export async function readIfExists(path) {
|
|
53
|
+
return existsSync(path) ? readFile(path, "utf8") : null;
|
|
54
|
+
}
|
|
55
|
+
export async function removePath(path) {
|
|
56
|
+
if (!existsSync(path))
|
|
57
|
+
return false;
|
|
58
|
+
await rm(path, { recursive: true, force: true });
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
export { existsSync };
|