knowns 0.1.7 → 0.2.0

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
@@ -5,6 +5,99 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.0] - 2025-12-27
9
+
10
+ ### Added
11
+ - **Project Documentation**: Comprehensive project docs for contributors and users
12
+ - `PHILOSOPHY.md` - 10 core principles guiding Knowns design
13
+ - `ARCHITECTURE.md` - Technical overview, diagrams, data flow, sync logic
14
+ - `CONTRIBUTING.md` - Contribution guidelines aligned with philosophy
15
+ - `docs/` folder with detailed guides:
16
+ - `commands.md` - Full CLI command reference
17
+ - `workflow.md` - Task lifecycle guide
18
+ - `reference-system.md` - How `@doc/` and `@task-` linking works
19
+ - `web-ui.md` - Kanban board and document browser guide
20
+ - `mcp-integration.md` - Claude Desktop MCP setup
21
+ - `configuration.md` - Project structure and options
22
+ - `ai-workflow.md` - Guide for AI agents
23
+
24
+ - **README Improvements**:
25
+ - Added TL;DR section for quick understanding
26
+ - Added comparison table vs Notion/Jira/Obsidian
27
+ - Added "How it works" 3-step explanation
28
+ - Added Roadmap section with Self-Hosted Team Sync (planned)
29
+ - New badges: Node version, TypeScript, Platform, GitHub stars, PRs welcome
30
+ - Links to Philosophy, Architecture, and Contributing docs
31
+
32
+ - **Node.js Engine Requirement**: Added `engines.node >= 18.0.0` to package.json
33
+
34
+ ### Changed
35
+ - **README Restructure**: Optimized for first impressions
36
+ - Moved detailed docs to `./docs/` folder
37
+ - Shortened main README from ~300 to ~175 lines
38
+ - Documentation table links to detailed guides
39
+ - **Tagline**: Updated to "CLI-first knowledge layer that gives AI persistent memory of your project"
40
+ - **Version Display**: Now reads directly from package.json (works with both npm and bun)
41
+
42
+ ### Fixed
43
+ - **UI Version Display**: Fixed version showing "dev" or old version when built with bun
44
+ - Vite config now reads version directly from package.json instead of `npm_package_version`
45
+ - **Doc Mention Regex**: Fixed badge not rendering for `@doc/path` without `.md` extension
46
+ - Changed regex from `/@doc\/([^\s]+\.md)/g` to `/@docs?\/([^\s)]+)/g`
47
+ - Added `normalizeDocPath()` to automatically add `.md` extension
48
+
49
+ ## [0.1.8] - 2025-12-27
50
+
51
+ ### Added
52
+ - **Node.js Runtime Support**: Browser command now works with both Bun and Node.js
53
+ - Migrated server from `Bun.serve()` to Express + ws
54
+ - Added `express`, `ws`, and `cors` dependencies
55
+ - WebSocket real-time sync works on both runtimes
56
+ - **Bun Compatibility Layer**: New `src/utils/bun-compat.ts` utility providing cross-runtime support
57
+ - `file()` - Bun.file() compatible wrapper for reading files
58
+ - `write()` - Bun.write() compatible wrapper for writing files
59
+ - `bunSpawn()` - Bun.spawn() compatible wrapper for process spawning
60
+ - CLI commands now work with both Bun and Node.js runtimes
61
+ - **Build Scripts**: Added `scripts/build-cli.js` using esbuild for Node.js-compatible builds
62
+ - CLI can now be built with `node scripts/build-cli.js` (no Bun required)
63
+ - Uses ESM format with `createRequire` shim for CommonJS compatibility
64
+ - Builds both main CLI and MCP server
65
+ - Properly strips old shebangs and adds Node.js-compatible shebang
66
+ - **CI/CD**: Updated GitHub Actions workflows to use only Node.js and npm
67
+ - Removed Bun dependency from CI/CD pipelines
68
+ - Both `ci.yml` and `publish.yml` now use `npm ci`, `npm test`, `npm run build`
69
+ - Added npm cache for faster builds
70
+ - **Testing**: Migrated from `bun test` to `vitest`
71
+ - Added `vitest.config.ts` with path aliases support
72
+ - All 76 tests passing with vitest
73
+
74
+ ### Fixed
75
+ - **File Deletion**: Fixed improper file deletion that was clearing files instead of deleting them
76
+ - Changed from `Bun.write(path, "")` to proper `unlink()` in `file-store.ts` and `version-store.ts`
77
+ - Tasks and version history are now properly deleted when archived or removed
78
+ - **Browser Command**: Fixed browser opening on non-Bun runtimes with proper `spawn()` fallback
79
+ - **Server Path Detection**: Fixed `import.meta.dir` undefined error when running with Node.js
80
+ - Now uses `fileURLToPath(import.meta.url)` as fallback for Node.js compatibility
81
+ - Added Windows path separator support
82
+ - **Windows Build**: Fixed shebang syntax error when running built CLI on Windows
83
+ - Build script now strips BOM and old shebangs before adding Node.js shebang
84
+ - Added `.npmrc` with `legacy-peer-deps=true` for React 19 compatibility
85
+ - **Web UI Doc Update**: Fixed "path must be string" error when updating docs
86
+ - Express 5 wildcard `{*path}` returns array, now properly joined to string
87
+
88
+ ### Changed
89
+ - **Server Architecture**: Complete rewrite of `src/server/index.ts`
90
+ - Replaced `Bun.serve()` with Express HTTP server
91
+ - Replaced Bun WebSocket API with `ws` library
92
+ - All 15 API routes migrated to Express router pattern
93
+ - Static file serving now uses `express.static()`
94
+ - Refactored file operations across multiple modules to use the new compatibility layer:
95
+ - `src/commands/task.ts` - Archive/unarchive operations
96
+ - `src/commands/time.ts` - Time tracking data persistence
97
+ - `src/storage/file-store.ts` - Task and project storage
98
+ - `src/storage/version-store.ts` - Version history storage
99
+ - Simplified `src/utils/bun-compat.ts` - removed `serve()` function (now using Express)
100
+
8
101
  ## [0.1.7] - 2025-12-27
9
102
 
10
103
  ### Fixed
@@ -146,6 +239,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
146
239
  - CLAUDE.md with complete guidelines for AI agents
147
240
  - Example workflows and patterns
148
241
 
242
+ [0.2.0]: https://github.com/knowns-dev/knowns/compare/v0.1.8...v0.2.0
243
+ [0.1.8]: https://github.com/knowns-dev/knowns/compare/v0.1.7...v0.1.8
149
244
  [0.1.7]: https://github.com/knowns-dev/knowns/compare/v0.1.6...v0.1.7
150
245
  [0.1.6]: https://github.com/knowns-dev/knowns/compare/v0.1.5...v0.1.6
151
246
  [0.1.5]: https://github.com/knowns-dev/knowns/compare/v0.1.3...v0.1.5
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- CLI tool for dev teams to manage tasks and documentation with AI-first context linking.
12
+ CLI-first knowledge layer that gives AI persistent memory of your project.
13
13
  </p>
14
14
 
15
15
  <p align="center">
@@ -17,198 +17,149 @@
17
17
  <a href="https://www.npmjs.com/package/knowns"><img src="https://img.shields.io/npm/dm/knowns.svg?style=flat-square" alt="npm downloads"></a>
18
18
  <a href="https://github.com/knowns-dev/knowns/actions"><img src="https://img.shields.io/github/actions/workflow/status/knowns-dev/knowns/ci.yml?branch=main&style=flat-square&label=CI" alt="CI"></a>
19
19
  <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="License: MIT"></a>
20
+ <br>
21
+ <a href="#"><img src="https://img.shields.io/node/v/knowns?style=flat-square" alt="node version"></a>
22
+ <a href="#"><img src="https://img.shields.io/badge/TypeScript-5.0-blue?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript"></a>
23
+ <a href="#"><img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=flat-square" alt="platform"></a>
24
+ <a href="https://github.com/knowns-dev/knowns/stargazers"><img src="https://img.shields.io/github/stars/knowns-dev/knowns?style=flat-square" alt="GitHub stars"></a>
25
+ <a href="#"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square" alt="PRs Welcome"></a>
20
26
  </p>
21
27
 
22
28
  ---
23
29
 
24
- ## Why Knowns?
30
+ > **TL;DR:** Knowns is a CLI-first knowledge layer that lets AI reliably read and reuse your project context — instead of asking the same questions every session.
25
31
 
26
- **Problem:** AI assistants lose context between sessions. You repeat the same architecture explanations, patterns, and decisions over and over.
32
+ ## The Problem
27
33
 
28
- **Solution:** Knowns links tasks to documentation with structured context that AI can understand and reference automatically.
34
+ AI assistants are stateless they forget your architecture, patterns, and decisions every session.
29
35
 
30
- ## Features
31
-
32
- | Feature | Description |
33
- |---------|-------------|
34
- | 🎯 **Task Management** | Create, track, and manage tasks with acceptance criteria |
35
- | 📚 **Documentation** | Nested folder structure with markdown support |
36
- | ⏱️ **Time Tracking** | Built-in timers and time reports |
37
- | 🔗 **Context Linking** | `@task-42` and `@doc/patterns/auth` references |
38
- | 🤖 **AI Integration** | MCP Server for Claude Desktop, `--plain` output for AI |
39
- | 🌐 **Web UI** | Kanban board, document browser, dark mode |
40
- | 🔄 **Agent Sync** | Sync guidelines to Claude, Gemini, Copilot |
41
-
42
- ## Installation
36
+ ```
37
+ Session 1: "Implement feature X" → AI: "How does your auth work?" → You explain
43
38
 
44
- ```bash
45
- # Using npm
46
- npm install -g knowns
39
+ Session 2: "Implement feature Y" → AI: "How does your auth work?" → You explain AGAIN
47
40
 
48
- # Using bun
49
- bun install -g knowns
41
+ Session 100: Still explaining the same thing...
50
42
  ```
51
43
 
52
- ## Quick Start
44
+ ## The Solution
53
45
 
54
46
  ```bash
55
- # Initialize project
56
- knowns init
57
-
58
- # Create documentation
59
- knowns doc create "Auth Pattern" -d "JWT authentication" -t "patterns" -f patterns
47
+ # Document once
48
+ knowns doc create "Auth Pattern" -d "JWT with guards" -f patterns
60
49
 
61
- # Create task with context
62
- knowns task create "Add authentication" \
63
- -d "Implement JWT auth following @doc/patterns/auth-pattern" \
64
- --ac "User can login" \
65
- --ac "Session persists"
50
+ # Reference everywhere
51
+ knowns task create "Add login" -d "Follow @doc/patterns/auth-pattern"
66
52
 
67
- # View task (AI-readable)
68
- knowns task view 1 --plain
69
-
70
- # Open Web UI
71
- knowns browser
53
+ # AI reads context automatically — never forgets
72
54
  ```
73
55
 
74
- ## Commands
56
+ **How it works:**
75
57
 
76
- ### Tasks
58
+ 1. **You plan** — Create tasks with acceptance criteria in Web UI or CLI
59
+ 2. **You link** — Reference docs like `@doc/patterns/auth` in task descriptions
60
+ 3. **AI executes** — Tell AI *"Work on task 42"*, it reads the task, follows the refs, and implements
77
61
 
78
- ```bash
79
- knowns task create "Title" -d "Description" --ac "Criterion"
80
- knowns task view <id> --plain
81
- knowns task list --plain
82
- knowns task edit <id> -s in-progress -a @me
83
- knowns task edit <id> --check-ac 1 --check-ac 2
84
- knowns task edit <id> --plan "1. Step 1\n2. Step 2"
85
- knowns task edit <id> --notes "Implementation summary"
86
- ```
62
+ Knowns resolves `@doc/...` and `@task-...` into real files. AI reads them via [MCP](./docs/mcp-integration.md) or `--plain` output — no copy-paste needed.
87
63
 
88
- ### Documentation
64
+ ## Install
89
65
 
90
66
  ```bash
91
- knowns doc create "Title" -d "Description" -t "tags" -f "folder"
92
- knowns doc view "doc-name" --plain
93
- knowns doc list --plain
94
- knowns doc edit "doc-name" -c "New content"
95
- knowns doc edit "doc-name" -a "Appended content"
96
- ```
97
-
98
- ### Time Tracking
67
+ # using npm
68
+ npm install -g knowns
99
69
 
100
- ```bash
101
- knowns time start <task-id>
102
- knowns time stop
103
- knowns time status
104
- knowns time report --from "2025-01-01" --to "2025-12-31"
105
- ```
70
+ # using bun
71
+ bun install -g knowns
106
72
 
107
- ### Search
108
73
 
109
- ```bash
110
- knowns search "query" --plain
111
- knowns search "auth" --type task --plain
112
- knowns search "patterns" --type doc --plain
74
+ knowns init
75
+ knowns browser # Open Web UI
113
76
  ```
114
77
 
115
- ### Other
78
+ ---
116
79
 
117
- ```bash
118
- knowns browser # Open Web UI
119
- knowns agents --update-instructions # Sync AI guidelines
120
- knowns mcp # Start MCP server
121
- ```
80
+ ## Why Knowns over Notion / Jira / Obsidian?
122
81
 
123
- ## Reference System
82
+ | | Knowns | Notion/Jira | Obsidian |
83
+ |---|--------|-------------|----------|
84
+ | **AI-readable** | `--plain` output, MCP server | Copy-paste manually | Plugins needed |
85
+ | **File-based** | Git-friendly `.knowns/` folder | Cloud-locked | Local files |
86
+ | **CLI-first** | Full CLI + Web UI | Web only | GUI only |
87
+ | **Context linking** | `@doc/...` `@task-42` refs | Manual links | Wiki links |
88
+ | **Source of truth** | Local files (Git-versioned) | Remote database | Local vault |
89
+ | **Minimal setup** | `knowns init` and done | Complex setup | Many plugins |
124
90
 
125
- Link tasks and docs using `@` syntax:
91
+ **Best for:** Dev teams who pair with AI and want persistent project memory.
126
92
 
127
- | Type | Input | Output |
128
- |------|-------|--------|
129
- | Task | `@task-42` | `@.knowns/tasks/task-42 - Title.md` |
130
- | Doc | `@doc/patterns/auth` | `@.knowns/docs/patterns/auth.md` |
93
+ ## Features
131
94
 
132
- **Example:**
133
- ```markdown
134
- Implement auth following @doc/patterns/guards
135
- Related: @task-42 @task-38
136
- ```
95
+ | Feature | Description |
96
+ |---------|-------------|
97
+ | **Task Management** | Create, track tasks with acceptance criteria |
98
+ | **Documentation** | Nested folders with markdown support |
99
+ | **Time Tracking** | Built-in timers and reports |
100
+ | **Context Linking** | `@task-42` and `@doc/patterns/auth` references |
101
+ | **AI Integration** | MCP Server for Claude, `--plain` output |
102
+ | **Web UI** | Kanban board, doc browser, dark mode |
137
103
 
138
- AI reads task → sees refs → fetches context → implements correctly.
104
+ ---
139
105
 
140
- ## Web UI
106
+ ## Quick Reference
141
107
 
142
108
  ```bash
143
- knowns browser
144
- ```
109
+ # Tasks
110
+ knowns task create "Title" -d "Description" --ac "Criterion"
111
+ knowns task list --plain
112
+ knowns task view <id> --plain
113
+ knowns task edit <id> -s in-progress -a @me
145
114
 
146
- Features:
147
- - **Kanban Board** - Drag & drop tasks
148
- - **Document Browser** - Tree view with markdown preview
149
- - **Task Details** - Inline editing with acceptance criteria
150
- - **Dark Mode** - System preference aware
151
- - **Global Search** - Cmd+K
152
-
153
- ## MCP Server (Claude Desktop)
154
-
155
- Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
156
-
157
- ```json
158
- {
159
- "mcpServers": {
160
- "knowns": {
161
- "command": "knowns",
162
- "args": ["mcp"]
163
- }
164
- }
165
- }
115
+ # Documentation
116
+ knowns doc create "Title" -d "Description" -f "folder"
117
+ knowns doc view "doc-name" --plain
118
+
119
+ # Time & Search
120
+ knowns time start <id> && knowns time stop
121
+ knowns search "query" --plain
166
122
  ```
167
123
 
168
- Claude can now read your tasks and documentation automatically.
124
+ ---
169
125
 
170
- ## Project Structure
126
+ ## Documentation
171
127
 
172
- ```
173
- .knowns/
174
- ├── tasks/ # Task markdown files
175
- ├── docs/ # Documentation
176
- │ ├── patterns/
177
- │ ├── guides/
178
- │ └── architecture/
179
- └── config.json # Project config
180
- ```
128
+ | Guide | Description |
129
+ |-------|-------------|
130
+ | [Command Reference](./docs/commands.md) | All CLI commands with examples |
131
+ | [Workflow Guide](./docs/workflow.md) | Task lifecycle from creation to completion |
132
+ | [Reference System](./docs/reference-system.md) | How `@doc/` and `@task-` linking works |
133
+ | [Web UI](./docs/web-ui.md) | Kanban board and document browser |
134
+ | [MCP Integration](./docs/mcp-integration.md) | Claude Desktop setup |
135
+ | [Configuration](./docs/configuration.md) | Project structure and options |
136
+ | [AI Workflow](./docs/ai-workflow.md) | Guide for AI agents |
181
137
 
182
- ## Task Workflow
138
+ ---
183
139
 
184
- ```bash
185
- # 1. Take task
186
- knowns task edit <id> -s in-progress -a @me
140
+ ## Roadmap
187
141
 
188
- # 2. Start timer
189
- knowns time start <id>
142
+ ### Self-Hosted Team Sync 🚧 (Planned)
190
143
 
191
- # 3. Create plan
192
- knowns task edit <id> --plan "1. Research\n2. Implement\n3. Test"
144
+ Knowns will optionally support a self-hosted sync server — for teams that want shared visibility without giving up local-first workflows.
193
145
 
194
- # 4. Work & check criteria
195
- knowns task edit <id> --check-ac 1 --check-ac 2
146
+ - **Real-time visibility** See who is working on what
147
+ - **Shared knowledge** Sync tasks and documentation across the team
148
+ - **Progress tracking** — Track activity over time
149
+ - **Full data control** — Self-hosted, no cloud dependency
196
150
 
197
- # 5. Add notes
198
- knowns task edit <id> --notes "Implementation complete"
151
+ The CLI and local `.knowns/` folder remain the source of truth.
152
+ The server acts only as a sync and visibility layer.
199
153
 
200
- # 6. Stop timer & complete
201
- knowns time stop
202
- knowns task edit <id> -s done
203
- ```
154
+ ---
204
155
 
205
156
  ## Development
206
157
 
207
158
  ```bash
208
- bun install
209
- bun run dev # Dev mode
210
- bun run build # Build
211
- bun run lint # Lint
159
+ npm install
160
+ npm run dev # Dev mode
161
+ npm run build # Build
162
+ npm run test # Test
212
163
  ```
213
164
 
214
165
  ## Links
@@ -217,6 +168,10 @@ bun run lint # Lint
217
168
  - [GitHub](https://github.com/knowns-dev/knowns)
218
169
  - [Changelog](./CHANGELOG.md)
219
170
 
171
+ For design principles and long-term direction, see [Philosophy](./PHILOSOPHY.md).
172
+
173
+ For technical details, see [Architecture](./ARCHITECTURE.md) and [Contributing](./CONTRIBUTING.md).
174
+
220
175
  ---
221
176
 
222
177
  <p align="center">