Skip to content

Isometric line figures that answer the pointer. For React and for anything with a DOM.

Skill: hairline-adopt, the door that sends a drawing to hairline-create's step 0

Lucas Marques6e0f17e5b9b7
diff --git a/packages/hairline/test/skill/adopt.test.ts b/packages/hairline/test/skill/adopt.test.ts
new file mode 100644
index 0000000..6357e52
--- /dev/null
+++ b/packages/hairline/test/skill/adopt.test.ts
@@ -0,0 +1,32 @@
+import { readdirSync, readFileSync } from "node:fs";
+import { fileURLToPath } from "node:url";
+import { expect, it } from "vitest";
+
+/** The door: one file that sends an SVG to hairline-create's step 0. */
+const SKILL = fileURLToPath(new URL("../../../../skills/hairline-adopt/", import.meta.url));
+const text = readFileSync(SKILL + "SKILL.md", "utf8");
+
+it("holds exactly its one file", () => {
+ expect(readdirSync(SKILL)).toEqual(["SKILL.md"]);
+});
+
+it("opens with a name that is its folder's, a description that says when to use it, and an argument hint", () => {
+ const m = /^---\nname: (.+)\ndescription: (.+)\nargument-hint: (.+)\n---\n/.exec(text);
+ expect(m).not.toBeNull();
+ expect(m![1]).toBe("hairline-adopt");
+ expect(m![2]).toMatch(/^Use when someone has an SVG/);
+ expect(m![2]).toContain("/hairline-adopt");
+ expect(m![2].length).toBeLessThanOrEqual(1024);
+ expect(m![3]).toBe('"<file.svg> [what the pointer does]"');
+});
+
+it("says what it does and does not do, and hands over to /hairline-create by name, never by path", () => {
+ expect(text).toMatch(/never animates the SVG itself/);
+ expect(text).toMatch(/never traces it/);
+ expect(text).toMatch(/one figure at a time/);
+ expect(text).toContain("Invoke `/hairline-create`");
+ expect(text).toContain("step 0");
+ expect(text).not.toMatch(/\.\.\/hairline-create/);
+ expect(text).not.toMatch(/`[\w./-]+\.(?:mjs|js|html|md)`/);
+ expect(text.split("\n").length).toBeLessThan(40);
+});
diff --git a/skills/hairline-adopt/SKILL.md b/skills/hairline-adopt/SKILL.md
new file mode 100644
index 0000000..54d2e89
--- /dev/null
+++ b/skills/hairline-adopt/SKILL.md
@@ -0,0 +1,24 @@
+---
+name: hairline-adopt
+description: Use when someone has an SVG (an icon, a logo, an illustration) and wants it as a Hairline figure, or runs /hairline-adopt with a file. Reads the drawing, rebuilds its object as an isometric line figure on the engine of @lucasmarkes/hairline, and gives it a gesture that answers the pointer.
+argument-hint: "<file.svg> [what the pointer does]"
+---
+
+# Hairline: adopt a drawing
+
+The person has a drawing and wants it alive, as a Hairline figure. This skill reads the drawing, rebuilds its object as solids on Hairline's engine, and gives it a gesture. It never animates the SVG itself, and it never traces it: the drawing gives the identity, and the figure is built new, with its proportions and its parts.
+
+## What it needs
+
+- One `.svg` file: an icon, a logo, an illustration. Given several, make one figure at a time: ask which comes first.
+- Optionally, what the pointer should do to it. Without it, the concepts propose the gesture.
+
+## What to do
+
+Invoke `/hairline-create` with the file's path and, after it, whatever the person said about the gesture, in their words. Its step 0 reads the drawing and fixes the object and its parts; its concepts then keep them and differ in the gesture, or, when the gesture was given, in the form and the read-out. Everything after that, the build, the check and the hand-over, is that skill's.
+
+## What to say
+
+When you offer the concepts, say first, in one line, what you read the drawing as and which of its parts you kept. If the person corrects the reading, read it again their way before any concept is built.
+
+If the drawing is a mark that belongs to someone else, say so at hand-over: the page shows another company's mark, and it is theirs to publish or not.