@aman_asmuei/aman 0.5.0 → 0.5.2

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 (3) hide show
  1. package/README.md +80 -0
  2. package/dist/index.js +61 -16
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -92,8 +92,13 @@ Each package works independently. `aman` is the front door.
92
92
  | `aman` | First run: setup. After that: show status |
93
93
  | `aman setup` | Set up the full ecosystem |
94
94
  | `aman status` | View ecosystem status (all layers) |
95
+ | `aman here` | Write a project context card (`.acore/context.md`) for the current directory |
95
96
  | `aman deploy` | Deploy your AI anywhere (Docker, Ollama, systemd) |
96
97
 
98
+ ### `aman here` — project context cards
99
+
100
+ Run `aman here` in any repo to create a `.acore/context.md` with the detected stack and today's date. The file is read by [aman-claude-code](https://github.com/amanasmuei/aman-claude-code) on every session start and embedded into [aman-copilot](https://github.com/amanasmuei/aman-copilot)'s `copilot-instructions.md` at `init` time — so both surfaces know which project you're in. Use `--force` to overwrite an existing card non-interactively.
101
+
97
102
  After setup, use the individual CLIs for detailed management:
98
103
 
99
104
  ```bash
@@ -219,6 +224,81 @@ https://amanasmuei.github.io/acore/
219
224
 
220
225
  ChatGPT, Claude, Claude Code, Cursor, Windsurf, Gemini, Ollama, and any AI that accepts a system prompt.
221
226
 
227
+ ---
228
+
229
+ ## Full install (all surfaces)
230
+
231
+ The one-command setup creates your global ecosystem. To light up every surface:
232
+
233
+ ```bash
234
+ # 1. Ecosystem (identity + rules + eval)
235
+ npx @aman_asmuei/aman@latest
236
+
237
+ # 2. Persistent memory (MCP) — required for cross-surface memory sync
238
+ npx @aman_asmuei/amem
239
+
240
+ # 3a. Claude Code — plugin + live MCP tools
241
+ claude plugin marketplace add amanasmuei/aman-claude-code
242
+ claude plugin install aman-claude-code@aman
243
+ # Plugin auto-installs the MCP tools on first session start. To install manually:
244
+ # node ~/.claude/plugins/cache/aman/aman-claude-code/*/bin/install-mcp.mjs
245
+
246
+ # 3b. VS Code Copilot Chat — per project
247
+ cd /path/to/your/project
248
+ npx @aman_asmuei/aman-copilot init
249
+ npx @aman_asmuei/aman-copilot install-mcp --all
250
+ # Then: reload VS Code window, switch Copilot Chat to Agent mode
251
+
252
+ # 4. Per-project context card (optional, per repo)
253
+ cd /path/to/your/project
254
+ npx @aman_asmuei/aman here
255
+ ```
256
+
257
+ Every step is idempotent — safe to re-run. The plugin + copilot auto-load identity/rules/memory from the global ecosystem; you only need to personalise once.
258
+
259
+ ---
260
+
261
+ ## Uninstall / reset
262
+
263
+ ### Soft reset — keep packages, wipe content, re-run setup
264
+
265
+ ```bash
266
+ rm -rf ~/.acore ~/.arules ~/.aeval
267
+ npx @aman_asmuei/aman@latest
268
+ ```
269
+
270
+ Useful when your identity drifts and you want a clean slate without fully uninstalling.
271
+
272
+ ### Full uninstall — nothing aman-related on disk
273
+
274
+ ```bash
275
+ # 1. Global ecosystem data
276
+ rm -rf ~/.acore ~/.arules ~/.aeval ~/.aflow ~/.akit ~/.askill ~/.amem
277
+
278
+ # 2. Claude Code plugin + MCP entry
279
+ claude plugin uninstall aman-claude-code@aman
280
+ claude plugin marketplace remove aman
281
+ claude mcp remove aman 2>/dev/null || true
282
+
283
+ # 3. VS Code + Copilot CLI MCP entries
284
+ npx @aman_asmuei/aman-copilot uninstall-mcp --all
285
+
286
+ # 4. Per-project files — find every .acore folder you opted in to
287
+ find ~ -maxdepth 4 -type d -name .acore 2>/dev/null
288
+ # Review the list, then delete by hand or:
289
+ # find ~/Projects -maxdepth 4 -type d -name .acore -exec rm -rf {} +
290
+ ```
291
+
292
+ ### Per-project only — remove aman from one repo
293
+
294
+ ```bash
295
+ # From the project root
296
+ rm -rf .acore .github/copilot-instructions.md
297
+ rm -f .github/prompts/{identity,rules,eval,remember,session-narrative}.prompt.md
298
+ ```
299
+
300
+ The package `npx` binaries (`aman`, `amem`, `aman-copilot`, etc.) live in npm's cache — `npm cache clean --force` if you want those gone too, but they're tiny and usually not worth the trouble.
301
+
222
302
  ## License
223
303
 
224
304
  [MIT](LICENSE)
package/dist/index.js CHANGED
@@ -76,9 +76,18 @@ function detectRole(cwd) {
76
76
  function isMcpPlatform(platform) {
77
77
  return platform === "claude-code" || platform === "cursor" || platform === "windsurf";
78
78
  }
79
+ function resolveLayerFile(layerDir, filename, home) {
80
+ const homeDir = home ?? os.homedir();
81
+ const scopedPath = path.join(homeDir, layerDir, "dev", "plugin", filename);
82
+ const legacyPath = path.join(homeDir, layerDir, filename);
83
+ if (fs.existsSync(scopedPath)) return scopedPath;
84
+ if (fs.existsSync(legacyPath)) return legacyPath;
85
+ return null;
86
+ }
79
87
  function detectEcosystem() {
80
88
  const home = os.homedir();
81
- const acorePath = path.join(home, ".acore", "core.md");
89
+ const acoreResolvedPath = resolveLayerFile(".acore", "core.md");
90
+ const acorePath = acoreResolvedPath ?? path.join(home, ".acore", "dev", "plugin", "core.md");
82
91
  const akitPath = path.join(home, ".akit", "kit.md");
83
92
  const akitInstalledPath = path.join(home, ".akit", "installed.json");
84
93
  let akitToolCount = 0;
@@ -113,11 +122,12 @@ function detectEcosystem() {
113
122
  } catch {
114
123
  }
115
124
  }
116
- const arulesPath = path.join(home, ".arules", "rules.md");
125
+ const arulesResolvedPath = resolveLayerFile(".arules", "rules.md");
126
+ const arulesPath = arulesResolvedPath ?? path.join(home, ".arules", "dev", "plugin", "rules.md");
117
127
  let arulesRuleCount = 0;
118
- if (fs.existsSync(arulesPath)) {
128
+ if (arulesResolvedPath) {
119
129
  try {
120
- const content = fs.readFileSync(arulesPath, "utf-8");
130
+ const content = fs.readFileSync(arulesResolvedPath, "utf-8");
121
131
  arulesRuleCount = (content.match(/^- /gm) || []).length;
122
132
  } catch {
123
133
  }
@@ -142,11 +152,11 @@ function detectEcosystem() {
142
152
  }
143
153
  }
144
154
  return {
145
- acore: { installed: fs.existsSync(acorePath), path: acorePath },
155
+ acore: { installed: acoreResolvedPath !== null, path: acorePath },
146
156
  amem: { installed: amemInstalled },
147
157
  akit: { installed: fs.existsSync(akitPath), path: akitPath, toolCount: akitToolCount },
148
158
  aflow: { installed: fs.existsSync(aflowPath), path: aflowPath, workflowCount: aflowWorkflowCount },
149
- arules: { installed: fs.existsSync(arulesPath), path: arulesPath, ruleCount: arulesRuleCount },
159
+ arules: { installed: arulesResolvedPath !== null, path: arulesPath, ruleCount: arulesRuleCount },
150
160
  aeval: { installed: fs.existsSync(aevalPath), path: aevalPath, sessions: aevalSessions },
151
161
  askill: { installed: fs.existsSync(askillPath), path: askillPath, skillCount: askillCount }
152
162
  };
@@ -374,8 +384,39 @@ var ARCHETYPES = {
374
384
  async function setupCommand() {
375
385
  p.intro(pc.bold("aman") + " \u2014 your complete AI companion");
376
386
  const ecosystem = detectEcosystem();
387
+ const scopedCorePath = path3.join(os2.homedir(), ".acore", "dev", "plugin", "core.md");
388
+ const legacyCorePath = path3.join(os2.homedir(), ".acore", "core.md");
377
389
  if (ecosystem.acore.installed) {
378
- p.log.success(`Identity: ${pc.dim("~/.acore/core.md")} already exists`);
390
+ const scopedExists = fs4.existsSync(scopedCorePath);
391
+ const legacyExists = fs4.existsSync(legacyCorePath);
392
+ if (legacyExists) {
393
+ const legacyContent = fs4.readFileSync(legacyCorePath, "utf-8");
394
+ const legacyIsTemplate = /\[your name\]|\[YOUR_NAME\]|\[AI_NAME\]/.test(legacyContent);
395
+ if (!legacyIsTemplate) {
396
+ if (!scopedExists) {
397
+ fs4.mkdirSync(path3.dirname(scopedCorePath), { recursive: true });
398
+ fs4.writeFileSync(scopedCorePath, legacyContent, "utf-8");
399
+ p.log.success(
400
+ `Identity: migrated ${pc.dim("~/.acore/core.md")} \u2192 ${pc.dim("~/.acore/dev/plugin/core.md")}`
401
+ );
402
+ } else {
403
+ const scopedContent = fs4.readFileSync(scopedCorePath, "utf-8");
404
+ const scopedIsTemplate = /\[your name\]|\[YOUR_NAME\]|\[AI_NAME\]/.test(scopedContent);
405
+ if (scopedIsTemplate) {
406
+ fs4.writeFileSync(scopedCorePath, legacyContent, "utf-8");
407
+ p.log.success(
408
+ `Identity: replaced unfilled template at ${pc.dim("~/.acore/dev/plugin/core.md")} with your personalized identity`
409
+ );
410
+ } else {
411
+ p.log.success(`Identity: ${pc.dim(ecosystem.acore.path)} already exists`);
412
+ }
413
+ }
414
+ } else {
415
+ p.log.success(`Identity: ${pc.dim(ecosystem.acore.path)} already exists`);
416
+ }
417
+ } else {
418
+ p.log.success(`Identity: ${pc.dim(ecosystem.acore.path)} already exists`);
419
+ }
379
420
  } else {
380
421
  p.log.step("Setting up your AI identity...");
381
422
  let userName = detectUserName();
@@ -421,10 +462,10 @@ async function setupCommand() {
421
462
  DATE: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
422
463
  UPDATE_INSTRUCTIONS: getUpdateInstructions(platform)
423
464
  });
424
- const globalDir = path3.join(os2.homedir(), ".acore");
425
- fs4.mkdirSync(globalDir, { recursive: true });
426
- fs4.writeFileSync(path3.join(globalDir, "core.md"), content, "utf-8");
427
- p.log.success(`Created ${pc.dim("~/.acore/core.md")} (identity)`);
465
+ const scopedAcoreDir = path3.join(os2.homedir(), ".acore", "dev", "plugin");
466
+ fs4.mkdirSync(scopedAcoreDir, { recursive: true });
467
+ fs4.writeFileSync(path3.join(scopedAcoreDir, "core.md"), content, "utf-8");
468
+ p.log.success(`Created ${pc.dim("~/.acore/dev/plugin/core.md")} (identity)`);
428
469
  if (stack) {
429
470
  const localDir = path3.join(process.cwd(), ".acore");
430
471
  fs4.mkdirSync(localDir, { recursive: true });
@@ -447,12 +488,15 @@ async function setupCommand() {
447
488
  fs4.writeFileSync(path3.join(localDir, "context.md"), contextContent, "utf-8");
448
489
  const configContent = JSON.stringify({ platform: platform || "other" }, null, 2) + "\n";
449
490
  fs4.writeFileSync(path3.join(localDir, "config.json"), configContent, "utf-8");
491
+ } else {
492
+ p.log.info(
493
+ `No project detected here \u2014 run ${pc.bold("aman here")} later from inside any repo to add per-project context.`
494
+ );
450
495
  }
451
496
  const platformFile = getPlatformFile(platform);
452
497
  if (platformFile) {
453
- const globalContent = fs4.readFileSync(path3.join(globalDir, "core.md"), "utf-8");
454
498
  const filePath = path3.join(process.cwd(), platformFile);
455
- const result = injectIntoFile(filePath, globalContent);
499
+ const result = injectIntoFile(filePath, content);
456
500
  if (result.created) {
457
501
  p.log.success(`Created ${pc.dim(platformFile)} with identity`);
458
502
  } else {
@@ -514,10 +558,10 @@ async function setupCommand() {
514
558
  p.log.success(`Workflows: ${ecosystem.aflow.workflowCount} defined`);
515
559
  }
516
560
  if (doRules) {
517
- const arulesDir = path3.join(home, ".arules");
561
+ const arulesDir = path3.join(home, ".arules", "dev", "plugin");
518
562
  fs4.mkdirSync(arulesDir, { recursive: true });
519
563
  fs4.writeFileSync(path3.join(arulesDir, "rules.md"), STARTER_RULES, "utf-8");
520
- p.log.success(`Guardrails: created ${pc.dim("~/.arules/rules.md")} (24 rules)`);
564
+ p.log.success(`Guardrails: created ${pc.dim("~/.arules/dev/plugin/rules.md")} (24 rules)`);
521
565
  } else if (arulesExists) {
522
566
  p.log.success(`Guardrails: ${ecosystem.arules.ruleCount} rules`);
523
567
  }
@@ -546,6 +590,7 @@ async function setupCommand() {
546
590
  ` ${pc.green("\u2714")} Your AI companion is ready.`,
547
591
  "",
548
592
  ` ${pc.bold("aman status")} See your full ecosystem`,
593
+ ` ${pc.bold("aman here")} Add per-project context (.acore/context.md)`,
549
594
  ` ${pc.bold("acore customize")} Change personality`,
550
595
  ` ${pc.bold("askill add testing")} Install skills`,
551
596
  ` ${pc.bold("npx @aman_asmuei/amem")} Enable automated memory`,
@@ -1027,7 +1072,7 @@ async function hereCommand(opts = {}) {
1027
1072
 
1028
1073
  // src/index.ts
1029
1074
  var program = new Command();
1030
- program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.5.0").action(() => {
1075
+ program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.5.2").action(() => {
1031
1076
  const ecosystem = detectEcosystem();
1032
1077
  if (ecosystem.acore.installed) {
1033
1078
  statusCommand();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aman_asmuei/aman",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Your complete AI companion — identity, memory, and tools in one command",
5
5
  "type": "module",
6
6
  "bin": {