synthesisui 0.1.12 → 0.1.13
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/commands/add.js +14 -0
- package/dist/guide.js +13 -1
- package/package.json +1 -1
package/dist/commands/add.js
CHANGED
|
@@ -53,6 +53,17 @@ export async function add(slug, opts) {
|
|
|
53
53
|
fetchedAt: new Date().toISOString(),
|
|
54
54
|
};
|
|
55
55
|
await writeFile(rootLockPath, `${JSON.stringify(lock, null, 2)}\n`, "utf8");
|
|
56
|
+
// 5b. governance rules (personal DS) → rules.md at the slug root (stable path,
|
|
57
|
+
// highest authority; the GUIDE tells the agent to read it first)
|
|
58
|
+
const rules = payload.rules ?? [];
|
|
59
|
+
if (rules.length > 0) {
|
|
60
|
+
const body = `# ${payload.name} — Rules\n\n` +
|
|
61
|
+
"> Accumulated rules for this design system. **Max authority — follow these first.**\n" +
|
|
62
|
+
`> Managed by synthesisui (edit in the studio). ${rules.length} rule(s).\n\n${rules
|
|
63
|
+
.map((r) => `- ${r}`)
|
|
64
|
+
.join("\n")}\n`;
|
|
65
|
+
await writeFile(join(slugDir, "rules.md"), body, "utf8");
|
|
66
|
+
}
|
|
56
67
|
// 6. discovery by the agent
|
|
57
68
|
const claudeMd = await syncClaudeMd(projectRoot);
|
|
58
69
|
// outcome line
|
|
@@ -75,6 +86,9 @@ export async function add(slug, opts) {
|
|
|
75
86
|
"GUIDE.md",
|
|
76
87
|
];
|
|
77
88
|
console.log(` v${v}/: ${files.join(", ")}`);
|
|
89
|
+
if (rules.length > 0) {
|
|
90
|
+
console.log(` rules.md → ${rules.length} rule(s) (read these first)`);
|
|
91
|
+
}
|
|
78
92
|
console.log(` CLAUDE.md ${claudeMd.created ? "created" : "updated"} (${claudeMd.count} system(s) installed)`);
|
|
79
93
|
console.log("");
|
|
80
94
|
console.log("Next steps:");
|
package/dist/guide.js
CHANGED
|
@@ -100,6 +100,18 @@ its typographic identity. Load them once (any one approach):
|
|
|
100
100
|
const artifactList = Object.keys(payload.artifacts)
|
|
101
101
|
.map((f) => `\`${f}\``)
|
|
102
102
|
.join(", ");
|
|
103
|
+
const hasRules = (payload.rules?.length ?? 0) > 0;
|
|
104
|
+
const rulesNote = hasRules
|
|
105
|
+
? `
|
|
106
|
+
## Rules — highest authority
|
|
107
|
+
|
|
108
|
+
**Read \`_synthesisui/ds/${slug}/rules.md\` FIRST and obey it above everything else in this guide.**
|
|
109
|
+
It carries this system's accumulated, project-specific rules; on any conflict they win over the
|
|
110
|
+
generic guidance below.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
`
|
|
114
|
+
: "";
|
|
103
115
|
return `# Design System: ${name}
|
|
104
116
|
|
|
105
117
|
> Generated by \`synthesisui add ${slug}\` (v${version}). **Do not edit by hand** —
|
|
@@ -114,7 +126,7 @@ ${meta.sourceUrl ? `**Reinterpretation of:** ${meta.sourceUrl}` : "**Original sy
|
|
|
114
126
|
${meta.narrative}
|
|
115
127
|
|
|
116
128
|
---
|
|
117
|
-
|
|
129
|
+
${rulesNote}
|
|
118
130
|
## How to apply
|
|
119
131
|
|
|
120
132
|
1. Import the tokens once in your project's global CSS:
|