@morphist/aspects 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -7,22 +7,22 @@
7
7
  ╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚══════╝
8
8
  ```
9
9
 
10
- > **Community Aspects Registry** Personality modules for AI agents.
10
+ > **The Open Aspect Registry** - Personality modules for AI agents.
11
11
 
12
- [![Validate PRs](https://github.com/aimorphist/aspects/actions/workflows/validate-pr.yml/badge.svg)](https://github.com/aimorphist/aspects/actions/workflows/validate-pr.yml)
12
+ **Website:** [aspects.sh](https://aspects.sh) | **Docs:** [aspects.sh/docs](https://aspects.sh/docs)
13
13
 
14
14
  ---
15
15
 
16
16
  ## What are Aspects?
17
17
 
18
- Aspects are personality modules for AI agents. They define how an AI speaks, thinks, and behaves from quirky wizards to helpful assistants to domain experts.
18
+ Aspects are personality modules for AI agents. They define how an AI speaks, thinks, and behaves - from quirky wizards to helpful assistants to domain experts.
19
19
 
20
20
  Each aspect is a JSON file containing:
21
21
 
22
- - **Identity** Name, tagline, character description
23
- - **Voice Hints** Speaking speed, emotional tone, style guidance
24
- - **Modes** Different behavioral modes (e.g., "campaign mode" for a D&D wizard)
25
- - **Prompt** The core personality prompt
22
+ - **Identity** - Name, tagline, character description
23
+ - **Voice Hints** - Speaking speed, emotional tone, style guidance
24
+ - **Modes** - Different behavioral modes (e.g., "campaign mode" for a D&D wizard)
25
+ - **Prompt** - The core personality prompt
26
26
 
27
27
  ## Quick Start
28
28
 
@@ -58,7 +58,75 @@ npx @morphist/aspects add alaric
58
58
  npx @morphist/aspects add -g alaric
59
59
  ```
60
60
 
61
- See [CLI Documentation](./docs/CLI.md) for full reference.
61
+ ### Install Formats
62
+
63
+ Multiple ways to specify an aspect:
64
+
65
+ ```bash
66
+ # By name (registry)
67
+ aspects add alaric
68
+
69
+ # Anonymous aspect (name with hash suffix)
70
+ aspects add my-wizard-7kYx3abc12
71
+
72
+ # By URL
73
+ aspects add https://aspects.sh/aspects/my-wizard-7kYx3abc12
74
+
75
+ # By hash
76
+ aspects add blake3:BnCcPam...
77
+
78
+ # From GitHub
79
+ aspects add github:user/repo
80
+
81
+ # From local path
82
+ aspects add ./path/to/aspect
83
+ ```
84
+
85
+ ### Create & Share (No Account Needed)
86
+
87
+ The simplest way to publish an aspect:
88
+
89
+ ```bash
90
+ # 1. Create your aspect interactively
91
+ npx @morphist/aspects create my-aspect
92
+
93
+ # 2. Edit the generated aspect.json (customize prompt, add directives)
94
+
95
+ # 3. Share to the public registry
96
+ npx @morphist/aspects share ./my-aspect
97
+ # Output: ✓ Shared! Name: my-aspect-7kYx3abc12
98
+
99
+ # 4. Anyone can now install it:
100
+ npx @morphist/aspects add my-aspect-7kYx3abc12
101
+ ```
102
+
103
+ ### Publishing to Registry
104
+
105
+ Two ways to publish aspects to the public registry:
106
+
107
+ | Method | Command | Account | Features |
108
+ |--------|---------|---------|----------|
109
+ | **Share** | `aspects share` | No | Quick anonymous sharing via content hash |
110
+ | **Publish** | `aspects publish` | Yes | Claim names, version updates, edit metadata |
111
+
112
+ ```bash
113
+ # Anonymous sharing (no account)
114
+ npx @morphist/aspects share ./my-aspect
115
+ # Output: ✓ Shared! Name: my-aspect-7kYx3abc12
116
+ # Install with: npx @morphist/aspects add my-aspect-7kYx3abc12
117
+
118
+ # Publishing with account
119
+ npx @morphist/aspects login # Create account or authenticate
120
+ npx @morphist/aspects publish # Claim name, publish versions
121
+ ```
122
+
123
+ We fully embrace anonymous contributions - but creating an account lets you claim names and publish updates.
124
+
125
+ ### Behavioral Rules
126
+
127
+ Aspects support **directives** (strict MUST-follow rules) and **instructions** (softer guidance). See [Instructions & Directives](#instructions--directives) for details.
128
+
129
+ Run `npx @morphist/aspects --help` for quick reference, or see [CLI Documentation](./docs/CLI.md) for full details.
62
130
 
63
131
  ## Registry Structure
64
132
 
@@ -119,7 +187,9 @@ Aspects are defined in `aspect.json`:
119
187
 
120
188
  ### Categories
121
189
 
122
- Every aspect must have exactly one official category:
190
+ Every aspect has exactly one category. You can use an official category or create your own custom category.
191
+
192
+ **Official Categories:**
123
193
 
124
194
  | Category | Description |
125
195
  | -------------- | ---------------------------------- |
@@ -132,6 +202,10 @@ Every aspect must have exactly one official category:
132
202
  | `spiritual` | Mindfulness, wisdom, guidance |
133
203
  | `pundit` | Commentary, analysis, opinions |
134
204
 
205
+ **Custom Categories:**
206
+
207
+ You can use any category name (2-20 characters, alphanumeric + hyphens, any case). Examples: `YOLO`, `my-niche`, `Cooking`.
208
+
135
209
  ### Optional Fields
136
210
 
137
211
  | Field | Description |
@@ -146,106 +220,122 @@ Every aspect must have exactly one official category:
146
220
 
147
221
  ### Field Limits
148
222
 
149
- To prevent abuse, fields have maximum lengths:
150
-
151
- | Field | Limit |
152
- | ------------- | ----------------------- |
153
- | `name` | 50 characters |
154
- | `displayName` | 100 characters |
155
- | `tagline` | 200 characters |
156
- | `tags` | 10 items, 30 chars each |
157
- | `prompt` | 50,000 characters |
158
- | `modes` | 10 maximum |
159
-
160
- ## Create & Submit an Aspect
161
-
162
- ### Fork & Pull Request
163
-
164
- The standard way to contribute:
165
-
166
- 1. **Fork this repository** on GitHub
167
-
168
- 2. **Clone your fork**
169
-
170
- ```bash
171
- git clone https://github.com/YOUR_USERNAME/aspects
172
- cd aspects
173
- ```
174
-
175
- 3. **Create your aspect** (use the CLI or manually)
176
-
177
- ```bash
178
- # With CLI (recommended)
179
- npx @morphist/aspects create
180
-
181
- # Or manually create the files:
182
- mkdir -p registry/aspects/my-aspect
183
- ```
184
-
185
- 4. **If creating manually**, add `registry/aspects/my-aspect/aspect.json`:
186
-
187
- ```json
188
- {
189
- "schemaVersion": 1,
190
- "name": "my-aspect",
191
- "publisher": "your-username",
192
- "version": "1.0.0",
193
- "displayName": "My Awesome Aspect",
194
- "tagline": "A brief description",
195
- "category": "assistant",
196
- "tags": ["helpful", "friendly"],
197
- "prompt": "Your personality prompt here..."
198
- }
199
- ```
200
-
201
- 5. **If creating manually**, update `registry/index.json`:
202
-
203
- ```json
204
- {
205
- "my-aspect": {
206
- "latest": "1.0.0",
207
- "versions": {
208
- "1.0.0": {
209
- "published": "2026-01-20T00:00:00Z",
210
- "url": "https://raw.githubusercontent.com/aimorphist/aspects/main/registry/aspects/my-aspect/aspect.json"
211
- }
212
- },
213
- "metadata": {
214
- "displayName": "My Awesome Aspect",
215
- "tagline": "A brief description",
216
- "category": "assistant",
217
- "publisher": "your-username",
218
- "trust": "community"
219
- }
220
- }
221
- }
222
- ```
223
-
224
- 6. **Commit and push**
225
-
226
- ```bash
227
- git add .
228
- git commit -m "Add my-aspect"
229
- git push origin main
230
- ```
231
-
232
- 7. **Open a Pull Request** at [github.com/aimorphist/aspects/compare](https://github.com/aimorphist/aspects/compare)
233
-
234
- ### Automated Validation
235
-
236
- All submissions are automatically validated:
223
+ Fields have minimum and maximum lengths:
224
+
225
+ | Field | Min | Max |
226
+ | ------------- | --- | ----------------------- |
227
+ | `name` | 2 | 50 characters |
228
+ | `displayName` | 2 | 100 characters |
229
+ | `tagline` | 10 | 200 characters |
230
+ | `category` | 2 | 20 characters |
231
+ | `prompt` | 10 | 50,000 characters |
232
+ | `tags` | 2 | 30 chars each, max 10 |
233
+ | `icon` | - | 50 characters |
234
+ | `modes` | - | 10 maximum |
235
+
236
+ ## Instructions & Directives
237
+
238
+ Aspects can include behavioral rules that shape how the AI responds.
239
+
240
+ ### Directives (Strict Rules)
241
+
242
+ Directives are **MUST-follow** rules with priority levels. They receive special formatting and emphasis across all LLM models.
243
+
244
+ ```json
245
+ {
246
+ "directives": [
247
+ {
248
+ "id": "stay-in-character",
249
+ "rule": "Never break character under any circumstances",
250
+ "priority": "high"
251
+ },
252
+ {
253
+ "id": "no-real-advice",
254
+ "rule": "Always clarify you cannot provide real medical, legal, or financial advice",
255
+ "priority": "high"
256
+ }
257
+ ]
258
+ }
259
+ ```
260
+
261
+ ### Instructions (General Guidance)
262
+
263
+ Instructions are softer preferences-guidance rather than hard rules.
264
+
265
+ ```json
266
+ {
267
+ "instructions": [
268
+ { "id": "concise", "rule": "Prefer shorter responses when possible" },
269
+ { "id": "humor", "rule": "Use dry wit and occasional wordplay" }
270
+ ]
271
+ }
272
+ ```
273
+
274
+ ### Cross-LLM Universal Pattern
275
+
276
+ When you compile an aspect (`aspects compile <name> -m <model>`), **high-priority directives are automatically repeated** at both the beginning and end of the prompt:
277
+
278
+ | Model | Behavior |
279
+ |-------|----------|
280
+ | **Claude** | Weights the **beginning** of prompts more heavily |
281
+ | **GPT** | Weights the **end** of prompts more heavily |
282
+
283
+ By placing critical rules in both positions, aspects work reliably across all models. The compiled output includes a comment explaining this:
284
+
285
+ ```xml
286
+ <!-- Universal Pattern: High-priority directives repeated here for cross-LLM compatibility.
287
+ Claude weights prompt beginning; GPT weights prompt end. Repetition ensures emphasis on both. -->
288
+ <critical-reminders>
289
+ <rule id="stay-in-character" priority="high">Never break character under any circumstances</rule>
290
+ </critical-reminders>
291
+ ```
292
+
293
+ ### Best Practices
294
+
295
+ - **Few > Many** - A few well-crafted rules beat many vague ones
296
+ - **Add escape clauses** - "Never do X, unless the user explicitly requests it" (GPT takes absolutes very literally)
297
+ - **Be specific** - "Never reveal you are an AI" vs "Stay in character"
298
+
299
+ See [Multi-LLM Prompting Guide](./docs/MULTI-LLM-PROMPTING.md) for detailed cross-model guidance.
300
+
301
+ ## Create & Publish an Aspect
302
+
303
+ ### Quick Start
304
+
305
+ ```bash
306
+ # 1. Create your aspect interactively
307
+ npx @morphist/aspects create my-aspect
308
+
309
+ # 2. Edit the generated aspect.json (customize prompt, add directives)
310
+
311
+ # 3. Share anonymously (no account needed)
312
+ npx @morphist/aspects share ./my-aspect
313
+ # Output: ✓ Shared! Name: my-aspect-BnCcPam123
314
+ # Anyone can install with: npx @morphist/aspects add my-aspect-BnCcPam123
315
+ ```
316
+
317
+ ### Publishing with an Account
318
+
319
+ To claim a name and publish versioned updates:
320
+
321
+ ```bash
322
+ # Authenticate with the registry
323
+ npx @morphist/aspects login
324
+
325
+ # Publish your aspect
326
+ npx @morphist/aspects publish
327
+ ```
328
+
329
+ We fully embrace anonymous contributions via `share` - but creating an account lets you claim names and publish updates.
330
+
331
+ ### Validation
332
+
333
+ All aspects are automatically validated:
237
334
 
238
335
  - ✅ JSON schema validation
239
336
  - ✅ Field length limits
240
337
  - ✅ Category verification
241
338
  - ✅ Security scan for prompt injection
242
- - ✅ Registry entry consistency
243
-
244
- ### Submit via Issue Form
245
-
246
- Don't want to use git? Submit directly via our issue template:
247
-
248
- **[Submit an Aspect →](https://github.com/aimorphist/aspects/issues/new?template=new-aspect.yml)**
249
339
 
250
340
  ## Trust Levels
251
341
 
@@ -256,43 +346,50 @@ Don't want to use git? Submit directly via our issue template:
256
346
 
257
347
  ## For App Developers
258
348
 
259
- Fetch aspects from the registry:
349
+ Fetch aspects from the registry API:
260
350
 
261
351
  ```typescript
262
- const REGISTRY_URL =
263
- "https://raw.githubusercontent.com/aimorphist/aspects/main/registry/index.json";
352
+ const API_URL = "https://aspects.sh/api/v1";
264
353
 
265
- // Fetch registry index
266
- const registry = await fetch(REGISTRY_URL).then((r) => r.json());
267
-
268
- // Get aspect details
269
- const alaricEntry = registry.aspects["alaric"];
270
- const aspectUrl = alaricEntry.versions[alaricEntry.latest].url;
271
-
272
- // Fetch full aspect
273
- const aspect = await fetch(aspectUrl).then((r) => r.json());
354
+ // Fetch a specific aspect
355
+ const response = await fetch(`${API_URL}/aspects/alaric/1.0.0`);
356
+ const { aspect } = await response.json();
274
357
 
275
358
  console.log(aspect.prompt); // The personality prompt
276
359
  console.log(aspect.voiceHints); // Voice configuration
360
+
361
+ // Search aspects
362
+ const search = await fetch(`${API_URL}/search?q=wizard`).then(r => r.json());
363
+ console.log(search.results);
277
364
  ```
278
365
 
366
+ See the [API documentation](https://aspects.sh/docs) for full details.
367
+
279
368
  ## CLI
280
369
 
281
370
  The Aspects CLI helps you create and manage aspects.
282
371
 
283
372
  ```bash
284
- # Install globally
373
+ # Use directly with npx (no install required)
374
+ npx @morphist/aspects <command>
375
+
376
+ # Or install globally for shorter commands
285
377
  npm install -g @morphist/aspects
378
+ ```
286
379
 
287
- # Or use directly with npx
288
- npx @morphist/aspects <command>
380
+ After global installation, run commands directly without npx:
381
+
382
+ ```bash
383
+ aspects add alaric
384
+ aspects search wizard
385
+ aspects list
289
386
  ```
290
387
 
291
388
  ### Commands
292
389
 
293
390
  | Command | Aliases | Description |
294
391
  | ---------- | ------- | ------------------------- |
295
- | `create` | `c`, `new`, `n` | Interactive aspect wizard |
392
+ | `create` | `c`, `new`, `n` | Interactive aspect generator |
296
393
  | `add` | `install`, `i`, `a` | Install aspects |
297
394
  | `list` | `ls` | List installed aspects |
298
395
  | `search` | | Search registry |
@@ -300,7 +397,9 @@ npx @morphist/aspects <command>
300
397
  | `remove` | `rm` | Uninstall aspect |
301
398
  | `validate` | | Validate aspect.json |
302
399
  | `publish` | | Submit to registry |
400
+ | `share` | | Share anonymously via hash |
303
401
  | `login` | | Authenticate with registry |
402
+ | `logout` | | Sign out |
304
403
 
305
404
  ### Options
306
405
 
@@ -329,8 +428,9 @@ bun run scan
329
428
 
330
429
  ## Links
331
430
 
332
- - **Website:** [aspects.sh](https://aspects.sh) _(coming soon)_
333
- - **Registry:** [github.com/aimorphist/aspects](https://github.com/aimorphist/aspects)
431
+ - **Website:** [aspects.sh](https://aspects.sh)
432
+ - **Documentation:** [aspects.sh/docs](https://aspects.sh/docs)
433
+ - **Source Code:** [github.com/aimorphist/aspects](https://github.com/aimorphist/aspects)
334
434
  - **Morphist App:** [morphist.ai](https://morphist.ai)
335
435
 
336
436
  ## License
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
3
+ var __create = Object.create;
4
+ var __getProtoOf = Object.getPrototypeOf;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __toESM = (mod, isNodeMode, target) => {
9
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
10
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
+ for (let key of __getOwnPropNames(mod))
12
+ if (!__hasOwnProp.call(to, key))
13
+ __defProp(to, key, {
14
+ get: () => mod[key],
15
+ enumerable: true
16
+ });
17
+ return to;
18
+ };
19
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, {
23
+ get: all[name],
24
+ enumerable: true,
25
+ configurable: true,
26
+ set: (newValue) => all[name] = () => newValue
27
+ });
28
+ };
29
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
31
+
32
+ // scripts/lib/output.ts
33
+ var rgb = (r, g, b) => (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
34
+ var colors = {
35
+ cyan: rgb(3, 138, 213),
36
+ teal: rgb(80, 163, 171),
37
+ orange: rgb(246, 114, 58),
38
+ red: rgb(196, 59, 57),
39
+ dim: (text) => `\x1B[2m${text}\x1B[0m`,
40
+ bold: (text) => `\x1B[1m${text}\x1B[0m`,
41
+ green: rgb(34, 197, 94),
42
+ yellow: rgb(234, 179, 8),
43
+ white: rgb(255, 255, 255)
44
+ };
45
+ var icons = {
46
+ pass: colors.green("✓"),
47
+ fail: colors.red("✗"),
48
+ warn: colors.orange("!"),
49
+ file: colors.cyan("◆"),
50
+ arrow: colors.dim("→"),
51
+ dot: colors.teal("●")
52
+ };
53
+ var LINE_COLORS = [colors.cyan, colors.teal, colors.orange, colors.red];
54
+ function morphistBanner() {
55
+ const lines = [
56
+ " █████╗ ███████╗██████╗ ███████╗ ██████╗████████╗███████╗",
57
+ " ██╔══██╗██╔════╝██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔════╝",
58
+ " ███████║███████╗██████╔╝█████╗ ██║ ██║ ███████╗",
59
+ " ██╔══██║╚════██║██╔═══╝ ██╔══╝ ██║ ██║ ╚════██║",
60
+ " ██║ ██║███████║██║ ███████╗╚██████╗ ██║ ███████║",
61
+ " ╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚══════╝"
62
+ ];
63
+ console.log();
64
+ console.log(colors.cyan(lines[0]));
65
+ console.log(colors.teal(lines[1]));
66
+ console.log(colors.teal(lines[2]));
67
+ console.log(colors.orange(lines[3]));
68
+ console.log(colors.red(lines[4]));
69
+ console.log(colors.red(lines[5]));
70
+ console.log();
71
+ }
72
+
73
+ // scripts/postinstall.ts
74
+ morphistBanner();
75
+ console.log(colors.bold(" Quick Start"));
76
+ console.log();
77
+ console.log(colors.dim(" # Install an aspect"));
78
+ console.log(" npx @morphist/aspects add alaric");
79
+ console.log();
80
+ console.log(colors.dim(" # Search the registry"));
81
+ console.log(" npx @morphist/aspects search meditation");
82
+ console.log();
83
+ console.log(colors.dim(" # Create your own aspect"));
84
+ console.log(" npx @morphist/aspects create");
85
+ console.log();
86
+ console.log(colors.dim(" # List installed aspects"));
87
+ console.log(" npx @morphist/aspects list");
88
+ console.log();
89
+ console.log(colors.dim(" Docs: https://github.com/aimorphist/aspects"));
90
+ console.log();