@abuswami1996/agent-md 0.1.0 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ - Installed agent skills into each tool's documented `SKILL.md` directory.
6
+ - Made Cursor skill installs self-contained under `.cursor/skills/agent-markdown/`.
7
+ - Clarified Cursor extension installation via bundled VSIX until Open VSX publishing is complete.
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  Initial MVP release candidate for the `agent-md` CLI.
package/README.md CHANGED
@@ -16,15 +16,29 @@ npx agent-md init --agent cursor
16
16
 
17
17
  This creates local configuration, an agent skill file, schema metadata, starter examples, and VSCode/Cursor extension recommendations for `AbhinavSwaminathan.agent-md-preview`.
18
18
 
19
+ Use the `--agent` flag to install the skill in the project-local location for your tool:
20
+
21
+ - `cursor`: `.cursor/skills/agent-markdown/SKILL.md`
22
+ - `claude-code`: `.claude/skills/agent-markdown/SKILL.md`
23
+ - `codex`: `.agents/skills/agent-markdown/SKILL.md`
24
+ - `opencode`: `.opencode/skills/agent-markdown/SKILL.md`
25
+ - `all`: all supported project-local skill locations
26
+
19
27
  Install the published editor extension:
20
28
 
21
29
  ```bash
22
- cursor --install-extension AbhinavSwaminathan.agent-md-preview
30
+ code --install-extension AbhinavSwaminathan.agent-md-preview
23
31
  ```
24
32
 
25
33
  Marketplace listing:
26
34
  [Agent Markdown Preview](https://marketplace.visualstudio.com/items?itemName=AbhinavSwaminathan.agent-md-preview)
27
35
 
36
+ Cursor uses Open VSX for extension ID installs. Until Agent Markdown Preview is published there too, install the bundled VSIX:
37
+
38
+ ```bash
39
+ npx agent-md vscode-extension --install --editor cursor
40
+ ```
41
+
28
42
  ## Commands
29
43
 
30
44
  ```bash
@@ -34,7 +48,7 @@ npx agent-md export examples/example.agent.md --format json
34
48
  npx agent-md vscode-extension
35
49
  ```
36
50
 
37
- `npx agent-md vscode-extension` prints local VSIX install instructions when the CLI package includes a bundled extension. The Marketplace extension is the preferred install path for most users.
51
+ `npx agent-md vscode-extension` prints local VSIX install instructions when the CLI package includes a bundled extension. The Visual Studio Marketplace extension is the preferred install path for VSCode users; Cursor users should use the bundled VSIX until an Open VSX listing exists.
38
52
 
39
53
  ## Security
40
54
 
Binary file
package/dist/index.js CHANGED
@@ -308,7 +308,14 @@ function splitPropsAndBody(lines, sourcePath, startLine, diagnostics) {
308
308
  }
309
309
 
310
310
  // ../skill/src/index.ts
311
- var skillMarkdown = `# Agent Markdown Skill
311
+ var skillName = "agent-markdown";
312
+ var skillMarkdown = `---
313
+ name: agent-markdown
314
+ description: Create, validate, and revise local-first Agent Markdown .agent.md documents with charts, tables, maps, diagrams, metrics, tabs, local data, and safe workspace file references.
315
+ license: MIT
316
+ ---
317
+
318
+ # Agent Markdown Skill
312
319
 
313
320
  Use Agent Markdown when the user asks for interactive reports, dashboards, visual analysis, charts or tables in Markdown, or local visualization documents.
314
321
 
@@ -323,6 +330,12 @@ Rules:
323
330
  - Add frontmatter with format: agent-md and version: 0.1.
324
331
  - Run agent-md validate before considering a document complete.
325
332
 
333
+ Supporting files in this skill directory:
334
+ - agent-md.config.json: default runtime configuration.
335
+ - schema.json: primitive reference schema.
336
+ - components.json: registered component reference.
337
+ - examples/example.agent.md: starter Agent Markdown document.
338
+
326
339
  Supported MVP primitives:
327
340
  - ::metric for KPI cards.
328
341
  - ::chart for line, bar, area, scatter, and pie charts.
@@ -614,6 +627,7 @@ function columnType(source, column) {
614
627
  // src/index.ts
615
628
  var program = new Command();
616
629
  var cliDir = path2.dirname(fileURLToPath(import.meta.url));
630
+ var cliVersion = "0.1.2";
617
631
  var extensionId = "AbhinavSwaminathan.agent-md-preview";
618
632
  var viewerDistCandidates = [
619
633
  path2.resolve(cliDir, "../viewer-dist"),
@@ -623,19 +637,21 @@ var vsixCandidates = [
623
637
  path2.resolve(cliDir, "../agent-md-preview.vsix"),
624
638
  path2.resolve(cliDir, "../../vscode-extension/dist/agent-md-preview.vsix")
625
639
  ];
626
- program.name("agent-md").description("Local-first Agent Markdown runtime").version("0.1.0");
640
+ program.name("agent-md").description("Local-first Agent Markdown runtime").version(cliVersion);
627
641
  program.command("init").option("--agent <agent>", "agent skill flavor", "generic").action(async (options) => {
628
642
  const root = process.cwd();
643
+ const agent = normalizeAgent(String(options.agent));
629
644
  await writeIfMissing(path2.join(root, "agent-md.config.json"), configJson());
630
645
  await fs2.mkdir(path2.join(root, ".agent-md"), { recursive: true });
631
646
  await fs2.mkdir(path2.join(root, "examples"), { recursive: true });
632
- await writeIfMissing(path2.join(root, ".agent-md", "skill.md"), skillMarkdown);
647
+ const installedSkillPaths = await installAgentSkill(root, agent);
633
648
  await writeIfMissing(path2.join(root, ".agent-md", "schema.json"), schemaJson());
634
649
  await writeIfMissing(path2.join(root, ".agent-md", "components.json"), componentsJson());
635
650
  await writeIfMissing(path2.join(root, "examples", "example.agent.md"), exampleAgentMarkdown);
636
- if (["cursor", "vscode"].includes(String(options.agent).toLowerCase())) await mergeVsCodeRecommendation(root);
651
+ if (["cursor", "vscode"].includes(agent)) await mergeVsCodeRecommendation(root);
637
652
  console.log(pc.green("Agent Markdown project initialized."));
638
- if (["cursor", "vscode"].includes(String(options.agent).toLowerCase())) {
653
+ for (const installedPath of installedSkillPaths) console.log(pc.gray(`Agent skill installed: ${path2.relative(root, installedPath)}`));
654
+ if (["cursor", "vscode"].includes(agent)) {
639
655
  console.log(pc.gray(`Recommended extension added: ${extensionId}`));
640
656
  console.log(pc.gray("Open an .agent.md file and run: Agent Markdown: Open Preview"));
641
657
  console.log(pc.gray("Browser fallback: npx agent-md serve"));
@@ -710,6 +726,36 @@ async function writeIfMissing(file, content) {
710
726
  if (error.code !== "EEXIST") throw error;
711
727
  }
712
728
  }
729
+ async function installAgentSkill(root, agent) {
730
+ const skillPaths = skillInstallPaths(root, agent);
731
+ for (const skillPath of skillPaths) {
732
+ const skillDir = path2.dirname(skillPath);
733
+ await fs2.mkdir(path2.join(skillDir, "examples"), { recursive: true });
734
+ await writeIfMissing(skillPath, skillMarkdown);
735
+ await writeIfMissing(path2.join(skillDir, "agent-md.config.json"), configJson());
736
+ await writeIfMissing(path2.join(skillDir, "schema.json"), schemaJson());
737
+ await writeIfMissing(path2.join(skillDir, "components.json"), componentsJson());
738
+ await writeIfMissing(path2.join(skillDir, "examples", "example.agent.md"), exampleAgentMarkdown);
739
+ }
740
+ return skillPaths;
741
+ }
742
+ function normalizeAgent(agent) {
743
+ return agent.toLowerCase().trim().replace(/[\s_]+/g, "-");
744
+ }
745
+ function skillInstallPaths(root, agent) {
746
+ const relativeRoots = {
747
+ cursor: [".cursor/skills"],
748
+ vscode: [".agents/skills"],
749
+ "claude-code": [".claude/skills"],
750
+ claude: [".claude/skills"],
751
+ codex: [".agents/skills"],
752
+ opencode: [".opencode/skills"],
753
+ generic: [".agents/skills"],
754
+ all: [".cursor/skills", ".claude/skills", ".agents/skills", ".opencode/skills"]
755
+ };
756
+ const roots = relativeRoots[agent] ?? relativeRoots.generic;
757
+ return roots.map((relativeRoot) => path2.join(root, relativeRoot, skillName, "SKILL.md"));
758
+ }
713
759
  async function mergeVsCodeRecommendation(root) {
714
760
  const vscodeDir = path2.join(root, ".vscode");
715
761
  const extensionsPath = path2.join(vscodeDir, "extensions.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abuswami1996/agent-md",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Local-first Agent Markdown runtime, validator, browser viewer, and agent skill installer.",
5
5
  "license": "MIT",
6
6
  "author": "Abhinav Swaminathan",
@@ -22,12 +22,29 @@
22
22
  "cursor"
23
23
  ],
24
24
  "type": "module",
25
- "engines": { "node": ">=20" },
26
- "bin": { "agent-md": "dist/index.js" },
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "bin": {
29
+ "agent-md": "dist/index.js"
30
+ },
27
31
  "main": "dist/index.js",
28
32
  "types": "dist/index.d.ts",
29
- "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },
30
- "files": ["dist", "viewer-dist", "agent-md-preview.vsix", "README.md", "LICENSE", "CHANGELOG.md", "package.json"],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ }
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "viewer-dist",
42
+ "agent-md-preview.vsix",
43
+ "README.md",
44
+ "LICENSE",
45
+ "CHANGELOG.md",
46
+ "package.json"
47
+ ],
31
48
  "scripts": {
32
49
  "build": "tsup src/index.ts --format esm --external commander --external picocolors --external fast-glob --external chokidar --external ws --external yaml --external papaparse --external zod && tsc src/index.ts --ignoreConfig --emitDeclarationOnly --declaration --outDir dist --module ESNext --moduleResolution Bundler --target ES2022 --skipLibCheck --strict && rm -rf viewer-dist && cp -R ../viewer/dist viewer-dist && if [ -f ../vscode-extension/dist/agent-md-preview.vsix ]; then cp ../vscode-extension/dist/agent-md-preview.vsix agent-md-preview.vsix; fi",
33
50
  "prepack": "node -e \"const fs=require('fs'); for (const p of ['dist/index.js','dist/index.d.ts','viewer-dist/index.html','agent-md-preview.vsix','README.md','LICENSE','CHANGELOG.md']) if (!fs.existsSync(p)) { console.error('Missing publish artifact: '+p); process.exit(1); }\""