kotonoha 0.1.0 → 0.1.1

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 ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.1] - 2026-09-28
9
+
10
+ ### Added
11
+
12
+ - Add the `kotonoha install` CLI for installing `tech-writer` into a
13
+ project or user skill directory.
14
+ - Add `--target` for selecting a skill directory and `--force` for
15
+ explicitly replacing an existing installation.
16
+ - Add automated tests for default installation, overwrite protection,
17
+ forced replacement, and installation from the packed npm artifact.
18
+
19
+ ### Changed
20
+
21
+ - Document separate npm and source-checkout installation workflows in the
22
+ README.
23
+
24
+ ## [0.1.0] - 2026-09-28
25
+
26
+ ### Added
27
+
28
+ - Publish the initial `tech-writer` skill for structuring README files,
29
+ design documents, API references, PR and issue text, release notes,
30
+ user manuals, code comments, and Qiita and Zenn articles.
31
+ - Add structural linting for headings, code fences, placeholders, and
32
+ suspicious links.
33
+
34
+ [0.1.1]: https://github.com/nahisaho/kotonoha/compare/v0.1.0...v0.1.1
35
+ [0.1.0]: https://github.com/nahisaho/kotonoha/releases/tag/v0.1.0
package/README.md CHANGED
@@ -39,7 +39,34 @@ Japanese prose with natural-japanese.
39
39
  - Python 3.9+ if you want to run the lint script (standard library only,
40
40
  no extra install needed)
41
41
 
42
- ### Install
42
+ ### Install from npm
43
+
44
+ Install the package, then copy `tech-writer` into a skill directory with
45
+ the included CLI:
46
+
47
+ ```bash
48
+ npm install --save-dev kotonoha
49
+ npx kotonoha install
50
+ ```
51
+
52
+ The default destination is `.github/skills/tech-writer` in the current
53
+ project. To install into another supported skill directory, pass its parent
54
+ directory:
55
+
56
+ ```bash
57
+ npx kotonoha install --target .claude/skills
58
+ npx kotonoha install --target ~/.copilot/skills
59
+ ```
60
+
61
+ The command refuses to overwrite an existing `tech-writer` directory. Review
62
+ or back up the existing installation, then pass `--force` only when you
63
+ intend to replace it:
64
+
65
+ ```bash
66
+ npx kotonoha install --force
67
+ ```
68
+
69
+ ### Install from a source checkout
43
70
 
44
71
  Inside this repository, the skill is already placed at
45
72
  `.github/skills/tech-writer`, so no extra setup is needed to use it with
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+
6
+ const packageJson = require("../package.json");
7
+
8
+ function printUsage() {
9
+ console.log(`Usage:
10
+ kotonoha install [--target <directory>] [--force]
11
+
12
+ Options:
13
+ --target <directory> Skill directory root (default: .github/skills)
14
+ --force Replace an existing tech-writer installation
15
+ --help Show this help
16
+ --version Show the installed kotonoha version`);
17
+ }
18
+
19
+ function fail(message) {
20
+ console.error(`kotonoha: ${message}`);
21
+ process.exitCode = 1;
22
+ }
23
+
24
+ function parseInstallOptions(args) {
25
+ let target = ".github/skills";
26
+ let force = false;
27
+
28
+ for (let index = 0; index < args.length; index += 1) {
29
+ const argument = args[index];
30
+
31
+ if (argument === "--force") {
32
+ force = true;
33
+ continue;
34
+ }
35
+
36
+ if (argument === "--target") {
37
+ const value = args[index + 1];
38
+ if (!value || value.startsWith("--")) {
39
+ throw new Error("--target requires a directory");
40
+ }
41
+ target = value;
42
+ index += 1;
43
+ continue;
44
+ }
45
+
46
+ if (argument.startsWith("--target=")) {
47
+ const value = argument.slice("--target=".length);
48
+ if (!value) {
49
+ throw new Error("--target requires a directory");
50
+ }
51
+ target = value;
52
+ continue;
53
+ }
54
+
55
+ throw new Error(`unknown option: ${argument}`);
56
+ }
57
+
58
+ return { target, force };
59
+ }
60
+
61
+ function install(args) {
62
+ let options;
63
+ try {
64
+ options = parseInstallOptions(args);
65
+ } catch (error) {
66
+ fail(error.message);
67
+ return;
68
+ }
69
+
70
+ const source = path.resolve(__dirname, "..", "skills", "tech-writer");
71
+ const targetRoot = path.resolve(process.cwd(), options.target);
72
+ const destination = path.join(targetRoot, "tech-writer");
73
+
74
+ if (!fs.existsSync(source)) {
75
+ fail(`packaged skill not found at ${source}`);
76
+ return;
77
+ }
78
+
79
+ if (fs.existsSync(destination)) {
80
+ if (!options.force) {
81
+ fail(
82
+ `${destination} already exists; rerun with --force to replace it`,
83
+ );
84
+ return;
85
+ }
86
+ fs.rmSync(destination, { recursive: true, force: true });
87
+ }
88
+
89
+ fs.mkdirSync(targetRoot, { recursive: true });
90
+ fs.cpSync(source, destination, { recursive: true });
91
+ console.log(`Installed tech-writer to ${destination}`);
92
+ }
93
+
94
+ const [command, ...args] = process.argv.slice(2);
95
+
96
+ if (command === "install") {
97
+ install(args);
98
+ } else if (command === "--version" || command === "-v") {
99
+ console.log(packageJson.version);
100
+ } else if (command === "--help" || command === "-h" || command === undefined) {
101
+ printUsage();
102
+ } else {
103
+ fail(`unknown command: ${command}`);
104
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kotonoha",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A GitHub Copilot CLI skill for structuring and polishing technical documents.",
5
5
  "license": "MIT",
6
6
  "author": "nahisaho",
@@ -12,6 +12,15 @@
12
12
  "url": "https://github.com/nahisaho/kotonoha/issues"
13
13
  },
14
14
  "homepage": "https://github.com/nahisaho/kotonoha#readme",
15
+ "bin": {
16
+ "kotonoha": "bin/kotonoha.js"
17
+ },
18
+ "scripts": {
19
+ "test": "node --test"
20
+ },
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
15
24
  "keywords": [
16
25
  "copilot",
17
26
  "github-copilot",
@@ -21,6 +30,8 @@
21
30
  "markdown"
22
31
  ],
23
32
  "files": [
33
+ "CHANGELOG.md",
34
+ "bin/",
24
35
  "skills/"
25
36
  ]
26
37
  }