@codecell-germany/company-agent-wiki-skill 0.1.1 → 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/README.md CHANGED
@@ -1,110 +1,107 @@
1
- # Company Agent Wiki Skill
1
+ # company-agent-wiki-skill
2
2
 
3
- > Context is king.
3
+ ---
4
4
 
5
- `company-agent-wiki-cli` is a local, agent-first company knowledge runtime:
5
+ # English
6
6
 
7
- - Markdown files stay the source of truth
8
- - a local SQLite index accelerates routing and section search
9
- - metadata-first retrieval lets agents inspect filenames, front matter and headings before loading full documents
10
- - Git remains the audit and history layer
11
- - the optional web view is read-only and shows index state, documents, diffs and history
7
+ ## Purpose
12
8
 
13
- It is also deliberately inspired by Anthropic's Markdown + YAML-frontmatter model for Claude Code subagents: [Anthropic Claude Code Subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents).
14
- The difference here is the retrieval layer: the metadata does not just sit in front matter, it is additionally indexed and filterable through a local SQLite search layer.
9
+ > Context is king.
15
10
 
16
- ## Core USP
11
+ `company-agent-wiki-skill` is an agent-first local company knowledge toolkit.
12
+ It ships as a real CLI plus a Codex-style skill payload, so an agent can set up a private company wiki, verify the index state, search knowledge, inspect metadata and headings first, and only then load full Markdown when needed.
17
13
 
18
- The main product differentiator is a strict metadata-first retrieval model for agents.
14
+ The product surface is the public CLI:
19
15
 
20
- Instead of throwing full Markdown files into context immediately, the intended flow is:
16
+ - `company-agent-wiki-cli`
17
+ - `company-agent-wiki-skill`
21
18
 
22
- 1. find candidate files via indexed search and routing
23
- 2. inspect descriptive filenames plus structured front matter
24
- 3. inspect the heading tree
25
- 4. only then load the full Markdown when the candidate is clearly relevant
19
+ The skill explains how an agent should use that CLI safely.
20
+ It is not a substitute implementation.
26
21
 
27
- That gives agents a local, deterministic and Git-friendly knowledge workflow that stays transparent for humans:
22
+ ## Current scope
28
23
 
29
- - context is king
30
- - filenames still matter
31
- - Markdown stays readable
32
- - front matter becomes the routing layer
33
- - headings become the low-cost structure preview
34
- - full document reads happen last, not first
24
+ - private local knowledge workspaces with Markdown as the source of truth
25
+ - a rebuildable local SQLite index for routing and section search
26
+ - metadata-first retrieval over filename, front matter and headings
27
+ - Git-backed history and diff workflows
28
+ - global per-user workspace discovery for later agents
29
+ - company-profile onboarding blueprints
30
+ - a read-only local web view
35
31
 
36
- Phase 1 is intentionally narrow:
32
+ ## Product model
37
33
 
38
- - no connectors
39
- - no GUI editing
40
- - no silent sync magic
41
- - no commits or pushes from this code repository
34
+ The core design is simple:
42
35
 
43
- The private knowledge workspace lives outside this public code repository. It may still be the current dedicated private folder in which you want to build the wiki; the important point is only that it must not be the public skill/CLI repository itself.
36
+ - Markdown stays human-readable and remains the source of truth
37
+ - SQLite is derived and rebuildable
38
+ - Git stays the audit and history layer
39
+ - the CLI is the real product surface for agents
44
40
 
45
- ## Product Surface
41
+ The retrieval model is deliberately inspired by Anthropic's Agent Skills model with YAML front matter, progressive disclosure and filesystem-based loading:
42
+ [Anthropic Agent Skills Overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)
46
43
 
47
- - npm package: `@codecell-germany/company-agent-wiki-skill`
48
- - CLI binary: `company-agent-wiki-cli`
49
- - installer binary: `company-agent-wiki-skill`
50
- - Codex skill name: `company-agent-wiki-cli`
44
+ The difference is the retrieval layer.
45
+ Here, front matter is not only stored in Markdown files, but also indexed and filterable through a local SQLite search layer.
51
46
 
52
- ## Requirements
47
+ ## Installation
53
48
 
54
- - Node.js `>= 20.10`
55
- - Git available in `PATH`
56
- - a private local folder for the actual knowledge workspace
57
- - optionally a private Git remote URL for that workspace
58
-
59
- The SQLite index is local and derived. It is rebuilt by the CLI and must not be treated as the source of truth.
60
- It lives inside the private workspace under `.company-agent-wiki/index.sqlite`, but it is intentionally kept out of Git by default because it is rebuildable, binary and noisy in diffs.
49
+ ### 1. Install into Codex with one command
61
50
 
62
- The workspace path can also be stored globally for other agents. Phase 1 now keeps a per-user workspace registry:
63
-
64
- - macOS: `~/Library/Application Support/company-agent-wiki/workspaces.json`
65
- - Windows: `%APPDATA%\\company-agent-wiki\\workspaces.json`
66
- - Linux: `${XDG_CONFIG_HOME:-~/.config}/company-agent-wiki/workspaces.json`
67
-
68
- ## Install
51
+ The preferred install path is:
69
52
 
70
53
  ```bash
71
- npm install
72
- npm run build
54
+ npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force
73
55
  ```
74
56
 
75
- Inside this implementation repo, the most reliable local install path is:
57
+ That installs:
76
58
 
77
- ```bash
78
- node dist/installer.js install --force
79
- ```
59
+ - the skill payload into `~/.codex/skills/company-agent-wiki-cli`
60
+ - the runtime into `~/.codex/tools/company-agent-wiki-cli`
61
+ - the CLI shim into `~/.codex/bin/company-agent-wiki-cli`
80
62
 
81
- Other valid operator paths:
63
+ ### 2. Verify the CLI
82
64
 
83
65
  ```bash
66
+ company-agent-wiki-cli --help
84
67
  "$CODEX_HOME/bin/company-agent-wiki-cli" --help
85
68
  "$HOME/.codex/bin/company-agent-wiki-cli" --help
86
- npx -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-cli --help
87
- node dist/index.js --help
88
69
  ```
89
70
 
90
- Important:
71
+ In Codex, the direct shim path is often the most reliable fallback.
91
72
 
92
- - the direct `~/.codex/bin` path is the most reliable fallback in Codex
93
- - `node dist/installer.js install --force` is the most reliable local install path while working from this repo
94
- - the `npx -p @codecell-germany/company-agent-wiki-skill ...` path only works after the package is actually published
95
- - `node dist/index.js` only works inside the public implementation repo after `npm run build`, not inside a private knowledge workspace
73
+ ### 3. Optional local repo workflow
96
74
 
97
- To test the local build without a global install:
75
+ If you are working inside this public implementation repo itself:
98
76
 
99
77
  ```bash
100
- node dist/index.js --help
78
+ npm install
79
+ npm run build
101
80
  node dist/installer.js install --force
102
81
  ```
103
82
 
104
- ## First Run
83
+ ## Requirements
84
+
85
+ - Node.js `>= 20.10`
86
+ - Git available in `PATH`
87
+ - a private local folder for the actual knowledge workspace
88
+ - optionally a private Git remote URL for that workspace
89
+
90
+ The private knowledge workspace must not be this public code repository.
91
+ It may still be the current dedicated private folder in which you want to build the wiki.
92
+
93
+ The SQLite index lives inside the private workspace under `.company-agent-wiki/index.sqlite`.
94
+ It is intentionally kept out of Git by default because it is rebuildable, binary and noisy in diffs.
95
+
96
+ The workspace path can also be stored globally for other agents:
97
+
98
+ - macOS: `~/Library/Application Support/company-agent-wiki/workspaces.json`
99
+ - Windows: `%APPDATA%\company-agent-wiki\workspaces.json`
100
+ - Linux: `${XDG_CONFIG_HOME:-~/.config}/company-agent-wiki/workspaces.json`
105
101
 
106
- 1. Create or choose a private workspace folder outside this repository.
107
- 2. Run setup:
102
+ ## Quick start
103
+
104
+ Create or choose a private workspace and run:
108
105
 
109
106
  ```bash
110
107
  company-agent-wiki-cli setup workspace \
@@ -113,27 +110,15 @@ company-agent-wiki-cli setup workspace \
113
110
  --git-remote git@github.com:your-org/private-company-knowledge.git
114
111
  ```
115
112
 
116
- This now also registers the workspace globally and marks it as the default for later agents.
117
-
118
- 3. Inspect the local state:
113
+ Then:
119
114
 
120
115
  ```bash
121
116
  company-agent-wiki-cli doctor --workspace /absolute/path/to/private-company-knowledge --json
122
- ```
123
-
124
- 4. Rebuild the index:
125
-
126
- ```bash
127
117
  company-agent-wiki-cli index rebuild --workspace /absolute/path/to/private-company-knowledge --json
128
- ```
129
-
130
- 5. Verify the indexed snapshot:
131
-
132
- ```bash
133
118
  company-agent-wiki-cli verify --workspace /absolute/path/to/private-company-knowledge --json
134
119
  ```
135
120
 
136
- 6. Query the workspace:
121
+ After that, start retrieval:
137
122
 
138
123
  ```bash
139
124
  company-agent-wiki-cli search "reverse charge aws invoice" --workspace /absolute/path/to/private-company-knowledge --type process --department buchhaltung --auto-rebuild --json
@@ -143,76 +128,40 @@ company-agent-wiki-cli read --doc-id process.example --workspace /absolute/path/
143
128
  company-agent-wiki-cli serve --workspace /absolute/path/to/private-company-knowledge --port 4187 --auto-rebuild
144
129
  ```
145
130
 
146
- The read-only web view is served by the installed CLI process. The private workspace itself contains Markdown, metadata and the local derived index, but no standalone frontend application.
147
-
148
- If the current shell is already inside a private workspace, runtime commands such as `doctor`, `verify`, `search`, `route`, `read`, `history`, `diff` and `serve` may omit `--workspace`.
149
- If not, the CLI can now also fall back to the globally registered default workspace.
150
-
151
- Useful discovery commands:
152
-
153
- ```bash
154
- company-agent-wiki-cli workspace current --json
155
- company-agent-wiki-cli workspace list --json
156
- company-agent-wiki-cli workspace register --workspace /absolute/path/to/private-company-knowledge --default --json
157
- company-agent-wiki-cli workspace use --workspace /absolute/path/to/private-company-knowledge --json
158
- ```
159
-
160
- By default `setup workspace` also creates starter Markdown documents such as `wiki-start-here.md`, `company-profile.md`, `organisation-und-rollen.md`, `systeme-und-tools.md`, `kernprozesse.md`, `projekte-und-roadmap.md` and `glossar.md`. Use `--no-starter-docs` only if you intentionally want an almost empty scaffold.
161
-
162
- You can also start the optional company-profile onboarding for the agent:
163
-
164
- ```bash
165
- company-agent-wiki-cli onboarding company
166
- company-agent-wiki-cli onboarding company --json
167
- company-agent-wiki-cli onboarding company \
168
- --workspace /absolute/path/to/private-company-knowledge \
169
- --answers-file /absolute/path/to/company-onboarding-answers.json
170
- company-agent-wiki-cli onboarding company \
171
- --workspace /absolute/path/to/private-company-knowledge \
172
- --answers-file /absolute/path/to/company-onboarding-answers.json \
173
- --execute
174
- ```
175
-
176
- Without `--execute`, the CLI stays in preview mode and only reports which draft starter Markdown files would be written into the managed root.
177
- `--execute` requires `--answers-file`, and `--force` is only valid together with `--execute`.
131
+ By default `setup workspace` also creates starter Markdown files such as:
178
132
 
179
- ## Secure Setup Model
133
+ - `wiki-start-here.md`
134
+ - `company-profile.md`
135
+ - `organisation-und-rollen.md`
136
+ - `systeme-und-tools.md`
137
+ - `kernprozesse.md`
138
+ - `projekte-und-roadmap.md`
139
+ - `glossar.md`
180
140
 
181
- This repository is publishable code only. It must never contain:
141
+ ## Deterministic first-run order for agents
182
142
 
183
- - real company knowledge
184
- - exported business data
185
- - private OAuth or API credentials
186
- - live SQLite index files from customer workspaces
143
+ If a fresh agent receives this skill, the correct order is:
187
144
 
188
- The actual knowledge workspace is separate and private. The human must provide:
145
+ 1. Verify the CLI path:
146
+ - `company-agent-wiki-cli --help`
147
+ - `"$CODEX_HOME/bin/company-agent-wiki-cli" --help`
148
+ - `"$HOME/.codex/bin/company-agent-wiki-cli" --help`
149
+ 2. If no workspace exists yet, create one with `setup workspace`.
150
+ 3. If a workspace already exists, inspect or register it:
151
+ - `workspace current --json`
152
+ - `workspace list --json`
153
+ - `workspace register --workspace /absolute/path --default --json`
154
+ 4. Run `doctor --json`.
155
+ 5. Run `index rebuild --json`.
156
+ 6. Run `verify --json`.
157
+ 7. Only then use `search`, `route`, `read`, `history`, `diff` or `serve`.
189
158
 
190
- - the private workspace path at least once
191
- - if desired, the private Git remote URL
192
- - access rights to that remote
159
+ If the current shell is already inside a private workspace, runtime commands may omit `--workspace`.
160
+ If not, the CLI can fall back to the globally registered default workspace.
193
161
 
194
- The agent can handle local scaffolding, root registration, global workspace registration and index rebuilds, but it should not invent remotes or inject private data into this repository.
162
+ ## Retrieval workflow
195
163
 
196
- ## Phase 1 Commands
197
-
198
- - `setup workspace`: scaffold a private workspace and optionally initialize Git
199
- - `workspace current|list|register|use`: inspect or manage the global workspace registry for other agents
200
- - `doctor`: inspect the local runtime and workspace state
201
- - `verify`: check whether the current roots still match the indexed snapshot
202
- - `roots add`: register another local Markdown root
203
- - `roots list`: show registered roots
204
- - `onboarding company`: emit the default German company-profile questionnaire or materialize draft onboarding Markdown from an answers file
205
- - `index rebuild`: rebuild the derived SQLite index and manifest
206
- - `search`: section-level search over Markdown knowledge, with safer free-text handling
207
- - `route`: grouped search results for agent routing
208
- - `read`: inspect metadata or headings first, then load a full document from the source files
209
- - `history`: show Git history for a tracked document
210
- - `diff`: show Git diff for a tracked document
211
- - `serve`: run a local read-only web view
212
-
213
- ## Retrieval Workflow
214
-
215
- This is the core USP in practice. The intended agent workflow is:
164
+ This is the core agent workflow:
216
165
 
217
166
  1. Find candidate documents with `search` or `route`.
218
167
  2. Narrow candidates with front-matter filters such as `--type`, `--project`, `--department`, `--tag`, `--owner` and `--system`.
@@ -227,7 +176,7 @@ company-agent-wiki-cli read --workspace /absolute/path --doc-id canonical.projek
227
176
  company-agent-wiki-cli read --workspace /absolute/path --doc-id canonical.projekt-alpha-roadmap --auto-rebuild
228
177
  ```
229
178
 
230
- ## Authoring Workflow
179
+ ## Authoring workflow
231
180
 
232
181
  For new company knowledge, use a descriptive filename plus strong front matter.
233
182
 
@@ -258,17 +207,44 @@ systems:
258
207
  ---
259
208
  ```
260
209
 
261
- Then:
210
+ Recommended authoring order:
211
+
212
+ 1. Create the Markdown file inside `knowledge/canonical/` or another registered managed root.
213
+ 2. Use a filename that roughly describes the real content.
214
+ 3. Set front matter including `id`, `summary` and the routing fields that matter.
215
+ 4. If the content depends on external sources, document provenance, date and source type.
216
+ 5. Structure the file with clear `#`, `##` and `###` headings.
217
+ 6. Rebuild the index or use an `--auto-rebuild` retrieval path.
218
+ 7. Validate discoverability with `search`, `route` and `read --metadata --headings --auto-rebuild`.
219
+ 8. If the document is structurally important, update the start page or thematic overview pages as well.
220
+
221
+ ## Company onboarding
222
+
223
+ You can also start the optional company-profile onboarding:
224
+
225
+ ```bash
226
+ company-agent-wiki-cli onboarding company
227
+ company-agent-wiki-cli onboarding company --json
228
+ company-agent-wiki-cli onboarding company \
229
+ --workspace /absolute/path/to/private-company-knowledge \
230
+ --answers-file /absolute/path/to/company-onboarding-answers.json
231
+ company-agent-wiki-cli onboarding company \
232
+ --workspace /absolute/path/to/private-company-knowledge \
233
+ --answers-file /absolute/path/to/company-onboarding-answers.json \
234
+ --execute
235
+ ```
236
+
237
+ Without `--execute`, the CLI stays in preview mode.
238
+ With `--execute`, it writes draft starter Markdown into the managed root and rebuilds the index.
262
239
 
263
- 1. write the Markdown with a clean heading structure
264
- 2. rebuild the index
265
- 3. validate discoverability with `search --auto-rebuild`, `route --auto-rebuild` and `read --metadata --headings --auto-rebuild`
240
+ ## Concurrency
266
241
 
267
- ## Concurrency Note
242
+ The SQLite index is intentionally local and rebuildable.
243
+ Parallel reads such as `search`, `route`, `read`, `history` and `diff` are a supported Phase-1 goal and should work across multiple agents.
268
244
 
269
- The SQLite index is intentionally local and rebuildable. Parallel reads such as `search`, `route`, `read`, `history` and `diff` are now an explicit Phase-1 goal and should work across multiple agents. Write paths such as `index rebuild` and onboarding apply are serialized per workspace through a local write lock, so concurrent writes queue behind the active writer instead of colliding.
245
+ Write paths such as `index rebuild` and onboarding apply are serialized per workspace through a local write lock, so concurrent writes queue behind the active writer instead of colliding.
270
246
 
271
- ## What Phase 1 Does Not Do
247
+ ## What Phase 1 does not do
272
248
 
273
249
  - it does not ingest e-mail, CRM, chat or meeting systems
274
250
  - it does not write or edit knowledge through the web UI
package/dist/index.js CHANGED
@@ -7162,6 +7162,7 @@ function writeJsonFile(targetPath, value) {
7162
7162
  }
7163
7163
  function writeJsonAtomic(targetPath, value) {
7164
7164
  const tempPath = `${targetPath}.tmp`;
7165
+ ensureDir(import_node_path2.default.dirname(targetPath));
7165
7166
  writeJsonFile(tempPath, value);
7166
7167
  import_node_fs2.default.renameSync(tempPath, targetPath);
7167
7168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecell-germany/company-agent-wiki-skill",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Context is king: agent-first local company knowledge workspace with metadata-first retrieval, Markdown as truth, SQLite-indexed front matter, Git-aware verification, and a Codex skill installer.",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -20,14 +20,15 @@ Use this skill when the task is about a private company knowledge workspace buil
20
20
  - The human should provide the workspace path at least once and, if desired, the private Git remote URL. After setup or manual registration, the CLI stores the workspace path in a global per-user registry so later agents can resolve it automatically.
21
21
  - Runtime discovery matters. Before relying on the CLI, verify which path is actually available.
22
22
  - In Codex, the most reliable fallback is usually the installed shim under `$CODEX_HOME/bin` or `~/.codex/bin`.
23
- - The `npx -p @codecell-germany/company-agent-wiki-skill ...` path only works after the npm package is really published.
23
+ - The preferred one-command installer path is `npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force`. This only works after the npm package is really published.
24
24
  - `node dist/index.js` only works inside the public implementation repo after `npm run build`, not inside an arbitrary private workspace.
25
25
  - If the binary is not already installed in PATH, use these fallbacks in this order:
26
26
 
27
27
  ```bash
28
28
  "$CODEX_HOME/bin/company-agent-wiki-cli" --help
29
29
  "$HOME/.codex/bin/company-agent-wiki-cli" --help
30
- npx -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-cli --help
30
+ company-agent-wiki-cli --help
31
+ npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force
31
32
  node dist/index.js --help
32
33
  ```
33
34
 
@@ -46,10 +47,10 @@ If that fails, try the PATH binary as a convenience fallback:
46
47
  company-agent-wiki-cli --help
47
48
  ```
48
49
 
49
- Only if the package is already published should you rely on:
50
+ If the CLI is not installed yet and the package is already published, install it with one command:
50
51
 
51
52
  ```bash
52
- npx -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-cli --help
53
+ npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force
53
54
  ```
54
55
 
55
56
  2. If no private workspace exists yet, create one:
@@ -3,6 +3,7 @@
3
3
  ## Use This Sequence
4
4
 
5
5
  ```bash
6
+ npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force
6
7
  "$CODEX_HOME/bin/company-agent-wiki-cli" --help
7
8
  "$HOME/.codex/bin/company-agent-wiki-cli" --help
8
9
  company-agent-wiki-cli --help
@@ -3,6 +3,7 @@
3
3
  ## Workspace
4
4
 
5
5
  ```bash
6
+ npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force
6
7
  "$CODEX_HOME/bin/company-agent-wiki-cli" --help
7
8
  "$HOME/.codex/bin/company-agent-wiki-cli" --help
8
9
  company-agent-wiki-cli about --json
@@ -25,12 +25,13 @@ The workspace path only has to be provided once. After setup or manual registrat
25
25
  Before relying on the CLI, verify a real executable path:
26
26
 
27
27
  ```bash
28
+ npx -y -p @codecell-germany/company-agent-wiki-skill company-agent-wiki-skill install --force
28
29
  "$CODEX_HOME/bin/company-agent-wiki-cli" --help
29
30
  "$HOME/.codex/bin/company-agent-wiki-cli" --help
30
31
  company-agent-wiki-cli --help
31
32
  ```
32
33
 
33
- The package-based `npx` path is only valid once the npm package is published.
34
+ The package-based `npx` installer path is only valid once the npm package is published.
34
35
 
35
36
  If the current folder is already inside a private workspace, runtime commands may omit `--workspace`.
36
37
  If not, inspect or update the global registry: