innernote 0.3.2 → 0.3.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.
package/README.md CHANGED
@@ -100,6 +100,7 @@ from it fails the suite, so what you read here is what the binary has.
100
100
  | `week` | what is scheduled for the next seven days |
101
101
  | `queue <post-id>` | schedule a post into your next open slot |
102
102
  | `unqueue <post-id>` | pull it back out before it goes live |
103
+ | `skill [--install]` | print the agent skill, or register it for Claude Code |
103
104
 
104
105
  ### write
105
106
 
package/dist/index.js CHANGED
@@ -1410,6 +1410,12 @@ var COMMANDS = {
1410
1410
  detail: "The undo for queue, while there is still time. The post returns to your drafts and nothing goes live. Once it has been published this refuses, because a live post cannot be unsent this way.",
1411
1411
  examples: ["innernote unqueue p17abc...", "innernote unqueue 3"]
1412
1412
  },
1413
+ skill: {
1414
+ summary: "print the agent skill, or install it for Claude Code",
1415
+ usage: "innernote skill [--install]",
1416
+ detail: "The playbook an agent should read before driving this CLI: the loop, the read-before-write rule, what the exit codes mean, and the one rule that protects real people. Prints to stdout so any agent can take it. --install also registers it in ~/.claude/skills so Claude Code knows it in every future session.",
1417
+ examples: ["innernote skill", "innernote skill --install"]
1418
+ },
1413
1419
  context: {
1414
1420
  summary: "what you post about: your pillars and your series",
1415
1421
  usage: "innernote context",
@@ -1533,7 +1539,7 @@ function suggest(state) {
1533
1539
  // package.json
1534
1540
  var package_default = {
1535
1541
  name: "innernote",
1536
- version: "0.3.2",
1542
+ version: "0.3.3",
1537
1543
  description: "Write LinkedIn posts in your voice, from the terminal.",
1538
1544
  type: "module",
1539
1545
  bin: {
@@ -1616,6 +1622,42 @@ async function home(inSession = false) {
1616
1622
  return 0;
1617
1623
  }
1618
1624
 
1625
+ // src/commands/skill.ts
1626
+ import { chmod as chmod2, mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
1627
+ import { homedir as homedir2 } from "node:os";
1628
+ import { dirname, join as join2 } from "node:path";
1629
+ import { fileURLToPath } from "node:url";
1630
+ async function readSkill() {
1631
+ const here = dirname(fileURLToPath(import.meta.url));
1632
+ for (const rel of ["../../skills/innernote-cli/SKILL.md", "../skills/innernote-cli/SKILL.md"]) {
1633
+ try {
1634
+ return await readFile2(join2(here, rel), "utf8");
1635
+ } catch {}
1636
+ }
1637
+ return null;
1638
+ }
1639
+ async function skill(args) {
1640
+ const install = args.includes("--install");
1641
+ const text = await readSkill();
1642
+ if (!text) {
1643
+ fail("The skill file is missing from this install.");
1644
+ note(dim2("Reinstall with `npm i -g innernote`, or read it on any machine with the package."));
1645
+ return 1;
1646
+ }
1647
+ if (install) {
1648
+ const dir = join2(homedir2(), ".claude", "skills", "innernote-cli");
1649
+ await mkdir2(dir, { recursive: true });
1650
+ const target = join2(dir, "SKILL.md");
1651
+ await writeFile2(target, text);
1652
+ await chmod2(target, 420);
1653
+ ok(`Installed for Claude Code at ${target}`);
1654
+ note(dim2("It loads in future sessions on its own. Here it is for this one:"));
1655
+ note("");
1656
+ }
1657
+ out(text);
1658
+ return 0;
1659
+ }
1660
+
1619
1661
  // src/session.ts
1620
1662
  import { createInterface } from "node:readline";
1621
1663
 
@@ -1761,6 +1803,12 @@ var COMMANDS2 = {
1761
1803
  detail: "The undo for queue, while there is still time. The post returns to your drafts and nothing goes live. Once it has been published this refuses, because a live post cannot be unsent this way.",
1762
1804
  examples: ["innernote unqueue p17abc...", "innernote unqueue 3"]
1763
1805
  },
1806
+ skill: {
1807
+ summary: "print the agent skill, or install it for Claude Code",
1808
+ usage: "innernote skill [--install]",
1809
+ detail: "The playbook an agent should read before driving this CLI: the loop, the read-before-write rule, what the exit codes mean, and the one rule that protects real people. Prints to stdout so any agent can take it. --install also registers it in ~/.claude/skills so Claude Code knows it in every future session.",
1810
+ examples: ["innernote skill", "innernote skill --install"]
1811
+ },
1764
1812
  context: {
1765
1813
  summary: "what you post about: your pillars and your series",
1766
1814
  usage: "innernote context",
@@ -2029,7 +2077,7 @@ function whatThereIs() {
2029
2077
  ["Writing", ["write", "shape", "ask", "save", "capture"]],
2030
2078
  ["Looking", ["show", "ideas", "drafts", "open", "week", "context", "whoami"]],
2031
2079
  ["Shipping", ["queue", "unqueue"]],
2032
- ["Connection", ["login", "logout"]]
2080
+ ["Connection", ["login", "logout", "skill"]]
2033
2081
  ];
2034
2082
  for (const [title, cmds] of groups) {
2035
2083
  lines.push(` ${bold2(title)}`);
@@ -2055,7 +2103,7 @@ var VERSION2 = package_default.version;
2055
2103
  // src/index.ts
2056
2104
  function commandList() {
2057
2105
  const groups = [
2058
- ["Getting connected", ["login", "logout", "whoami"]],
2106
+ ["Getting connected", ["login", "logout", "whoami", "skill"]],
2059
2107
  ["Writing", ["write", "shape", "ask", "save", "capture"]],
2060
2108
  ["Looking", ["show", "ideas", "drafts", "open", "week", "context"]],
2061
2109
  ["Shipping", ["queue", "unqueue"]]
@@ -2084,6 +2132,7 @@ var HELP = () => [
2084
2132
  `);
2085
2133
  var COMMANDS3 = {
2086
2134
  context,
2135
+ skill,
2087
2136
  login,
2088
2137
  logout: () => logout(),
2089
2138
  whoami,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innernote",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Write LinkedIn posts in your voice, from the terminal.",
5
5
  "type": "module",
6
6
  "bin": {