claudia-mentor 0.2.1 → 0.3.0

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
@@ -15,27 +15,13 @@ A Claude Code plugin that acts as your technology mentor, security advisor, and
15
15
 
16
16
  ## Install
17
17
 
18
- **Step 1: Get Claudia**
19
-
20
18
  ```bash
21
19
  npm install -g claudia-mentor
22
20
  ```
23
21
 
24
- **Step 2: Start Claude Code with Claudia**
25
-
26
- ```bash
27
- claude --plugin-dir $(npm root -g)/claudia-mentor
28
- ```
29
-
30
- That's it. Claudia is now loaded. Try `/claudia are you there?` to say hi.
31
-
32
- **Want her loaded every time?** Add this to your shell config (`~/.zshrc` or `~/.bashrc`):
33
-
34
- ```bash
35
- alias claude='claude --plugin-dir $(npm root -g)/claudia-mentor'
36
- ```
22
+ That's it. One command. The installer automatically configures your shell so every `claude` session loads Claudia. Restart your terminal and type `claude` -- she's there.
37
23
 
38
- Then restart your terminal. Now every `claude` session includes Claudia automatically.
24
+ To verify, type `/claudia-mentor:claudia are you there?` inside Claude Code.
39
25
 
40
26
  ## Usage
41
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudia-mentor",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Proactive technology mentor, security advisor, and prompt coach for Claude Code",
5
5
  "author": "Regan O'Malley <regan@reganomalley.com>",
6
6
  "license": "MIT",
@@ -1,20 +1,72 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // Colors (matching Claude Code's block-character style)
4
- const v = "\x1b[31m"; // vermillion
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ // Colors
8
+ const v = "\x1b[31m"; // vermillion
5
9
  const p = "\x1b[38;5;203m"; // lighter vermillion/coral
6
10
  const d2 = "\x1b[38;5;52m"; // dark red
7
- const w = "\x1b[37m"; // white
8
- const d = "\x1b[2m"; // dim
9
- const b = "\x1b[1m"; // bold
10
- const r = "\x1b[0m"; // reset
11
- const hide = "\x1b[?25l"; // hide cursor
12
- const show = "\x1b[?25h"; // show cursor
11
+ const w = "\x1b[37m"; // white
12
+ const d = "\x1b[2m"; // dim
13
+ const b = "\x1b[1m"; // bold
14
+ const g = "\x1b[32m"; // green
15
+ const r = "\x1b[0m"; // reset
16
+ const hide = "\x1b[?25l"; // hide cursor
17
+ const show = "\x1b[?25h"; // show cursor
13
18
 
14
19
  const version = require('../package.json').version;
20
+ const pluginDir = path.resolve(__dirname, '..');
21
+
22
+ // ── Auto-setup: add alias to shell config ──────────────────────
23
+
24
+ function getShellConfig() {
25
+ const shell = process.env.SHELL || '';
26
+ if (shell.includes('zsh')) return path.join(os.homedir(), '.zshrc');
27
+ if (shell.includes('bash')) {
28
+ // macOS uses .bash_profile, Linux uses .bashrc
29
+ const profile = path.join(os.homedir(), '.bash_profile');
30
+ if (fs.existsSync(profile)) return profile;
31
+ return path.join(os.homedir(), '.bashrc');
32
+ }
33
+ return null;
34
+ }
35
+
36
+ const ALIAS_MARKER = '# claudia-mentor';
37
+ const ALIAS_LINE = `alias claude='claude --plugin-dir "${pluginDir}"' ${ALIAS_MARKER}`;
38
+
39
+ let aliasStatus = 'skipped';
40
+
41
+ try {
42
+ const configFile = getShellConfig();
43
+ if (configFile) {
44
+ const contents = fs.existsSync(configFile) ? fs.readFileSync(configFile, 'utf8') : '';
45
+
46
+ if (contents.includes(ALIAS_MARKER)) {
47
+ // Already installed -- update the path in case it moved
48
+ const updated = contents.replace(
49
+ /alias claude='claude --plugin-dir ".*?"' # claudia-mentor/,
50
+ ALIAS_LINE
51
+ );
52
+ if (updated !== contents) {
53
+ fs.writeFileSync(configFile, updated);
54
+ aliasStatus = 'updated';
55
+ } else {
56
+ aliasStatus = 'exists';
57
+ }
58
+ } else {
59
+ // First install -- append alias
60
+ fs.appendFileSync(configFile, `\n${ALIAS_LINE}\n`);
61
+ aliasStatus = 'added';
62
+ }
63
+ }
64
+ } catch (e) {
65
+ aliasStatus = 'failed';
66
+ }
67
+
68
+ // ── Animation ──────────────────────────────────────────────────
15
69
 
16
- // Claudia's icon - pixel art using block characters
17
- // A small geometric "C" shape with a sparkle/star accent
18
70
  const icon = [
19
71
  ` ${p}*${r}`,
20
72
  ` ${v}│${r}`,
@@ -25,21 +77,25 @@ const icon = [
25
77
  ` ${v}██████${r}`,
26
78
  ];
27
79
 
80
+ const setupMsg = aliasStatus === 'added'
81
+ ? ` ${g}✓${r} ${w}Auto-configured.${r} ${d}Restart your terminal, then just type${r} ${w}claude${r}`
82
+ : aliasStatus === 'updated'
83
+ ? ` ${g}✓${r} ${d}Alias updated.${r} ${w}claude${r} ${d}always loads Claudia.${r}`
84
+ : aliasStatus === 'exists'
85
+ ? ` ${g}✓${r} ${d}Already configured.${r} ${w}claude${r} ${d}always loads Claudia.${r}`
86
+ : ` ${d}Run:${r} ${w}claude --plugin-dir "${pluginDir}"${r}`;
87
+
28
88
  const lines = [
29
89
  ...icon,
30
90
  ``,
31
91
  ` ${w}${b}Claudia${r} ${d}v${version}${r}`,
32
92
  ` ${d}The senior dev you don't have.${r}`,
33
93
  ``,
34
- ` ${d}Commands:${r}`,
35
- ` ${w}/claudia-mentor:claudia${r} ${d}ask anything${r}`,
36
- ` ${w}/claudia-mentor:claudia-explain${r} ${d}explain the code${r}`,
37
- ` ${w}/claudia-mentor:claudia-review${r} ${d}catch bugs${r}`,
38
- ` ${w}/claudia-mentor:claudia-why${r} ${d}why this stack${r}`,
39
- ` ${w}/claudia-mentor:claudia-health${r} ${d}project audit${r}`,
94
+ setupMsg,
40
95
  ``,
41
- ` ${d}7 hooks. 10 knowledge domains.${r}`,
42
- ` ${d}She remembers your stack across sessions.${r}`,
96
+ ` ${d}She checks your code automatically.${r}`,
97
+ ` ${d}She joins conversations about tech decisions.${r}`,
98
+ ` ${d}She teaches you as you build.${r}`,
43
99
  ``,
44
100
  ` ${d}Docs:${r} ${w}https://getclaudia.dev${r}`,
45
101
  ` ${d}Source:${r} ${w}https://github.com/reganomalley/claudia${r}`,
@@ -55,7 +111,6 @@ async function sleep(ms) {
55
111
  async function animate() {
56
112
  process.stdout.write(hide + '\n');
57
113
 
58
- // Draw icon with slightly slower timing
59
114
  for (let i = 0; i < icon.length; i++) {
60
115
  process.stdout.write(lines[i] + '\n');
61
116
  await sleep(50);
@@ -63,7 +118,6 @@ async function animate() {
63
118
 
64
119
  await sleep(150);
65
120
 
66
- // Rest cascades in faster
67
121
  for (let i = icon.length; i < lines.length; i++) {
68
122
  process.stdout.write(lines[i] + '\n');
69
123
  await sleep(30);