@alaarab/cortex 1.15.2 → 1.15.3

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.
@@ -758,7 +758,11 @@ export async function doViewAction(host, key) {
758
758
  });
759
759
  }
760
760
  else if (key === "a") {
761
- host.setMessage(` Use "cortex skills add ${project ?? "<project>"} <path>" to add a skill`);
761
+ if (!project) {
762
+ host.setMessage("Select a project first.");
763
+ return;
764
+ }
765
+ host.startInput("skill-add", "");
762
766
  }
763
767
  break;
764
768
  case "Hooks":
@@ -48,6 +48,7 @@ export function renderBottomBar(state, navMode, inputCtx, inputBuf) {
48
48
  command: "cmd",
49
49
  add: "add task",
50
50
  "learn-add": "add finding",
51
+ "skill-add": "new skill name",
51
52
  "mq-edit": "edit Memory Queue item",
52
53
  };
53
54
  const label = labels[inputCtx] || inputCtx;
package/mcp/dist/shell.js CHANGED
@@ -140,6 +140,27 @@ export class CortexShell {
140
140
  this.setMessage(` ${resultMsg(addFinding(this.cortexPath, p, buf))}`);
141
141
  break;
142
142
  }
143
+ case "skill-add": {
144
+ const p = this.ensureProjectSelected();
145
+ if (!p)
146
+ return;
147
+ const name = buf.trim().replace(/\.md$/i, "").replace(/[^a-zA-Z0-9_-]/g, "-");
148
+ if (!name) {
149
+ this.setMessage(" No name entered.");
150
+ return;
151
+ }
152
+ const destDir = path.join(this.cortexPath, p, "skills");
153
+ fs.mkdirSync(destDir, { recursive: true });
154
+ const dest = path.join(destDir, `${name}.md`);
155
+ if (fs.existsSync(dest)) {
156
+ this.setMessage(` Skill "${name}" already exists.`);
157
+ return;
158
+ }
159
+ const template = `# ${name}\n\nDescribe what this skill does.\n\n## Usage\n\n\`\`\`\nExample usage here\n\`\`\`\n`;
160
+ fs.writeFileSync(dest, template, "utf8");
161
+ this.setMessage(` Created skill "${name}" — edit ${dest}`);
162
+ break;
163
+ }
143
164
  case "mq-edit": {
144
165
  const p = this.ensureProjectSelected();
145
166
  if (!p)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/cortex",
3
- "version": "1.15.2",
3
+ "version": "1.15.3",
4
4
  "description": "Long-term memory for AI agents. Stored as markdown in a git repo you own.",
5
5
  "type": "module",
6
6
  "bin": {