knowns 0.2.0 → 0.3.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,93 @@ 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.3.0] - 2025-12-29
9
+
10
+ ### Added
11
+ - **CLI Shorthand Commands**: New concise syntax for common operations
12
+ - `knowns task <id>` - Shorthand for `knowns task view <id>`
13
+ - `knowns doc <path>` - Shorthand for `knowns doc view <path>`
14
+ - Reduces typing while maintaining full command compatibility
15
+
16
+ - **New UI Components** (shadcn/ui):
17
+ - Badge, Card, Checkbox, Label, Progress, Select components
18
+ - Data Table with sorting, filtering, and pagination
19
+ - Dropdown Menu for context actions
20
+ - Kanban board components (Column, Card, Board)
21
+ - Sonner for toast notifications
22
+ - Table component for data display
23
+
24
+ - **New React Contexts**:
25
+ - `ConfigContext` - Global configuration state management
26
+ - `TimeTrackerContext` - Time tracking state across components
27
+ - `UIPreferencesContext` - User UI preferences persistence
28
+
29
+ - **Server Architecture**:
30
+ - `src/server/middleware/` - Request processing middleware
31
+ - `src/server/routes/` - Modular route handlers
32
+ - `src/server/utils/` - Server utility functions
33
+ - `src/server/types.ts` - TypeScript type definitions
34
+
35
+ - **Documentation**:
36
+ - `docs/developer-guide.md` - Developer setup and contribution guide
37
+ - `docs/user-guide.md` - End-user documentation
38
+
39
+ - **Utilities**:
40
+ - `src/ui/utils/colors.ts` - Color utility functions for UI
41
+ - `src/ui/utils/markdown-sections.ts` - Markdown section parsing
42
+
43
+ ### Changed
44
+ - **UI Architecture**: Migrated to Atomic Design pattern
45
+ - `atoms/` - Basic UI building blocks (buttons, inputs, icons)
46
+ - `molecules/` - Composed components (form fields, cards)
47
+ - `organisms/` - Complex UI sections (forms, lists, modals)
48
+ - `templates/` - Page layout templates
49
+ - Improved component reusability and maintainability
50
+
51
+ - **Server Refactoring**: Modularized monolithic server
52
+ - Split 567-line `server/index.ts` into focused modules
53
+ - Cleaner separation of concerns
54
+ - Easier testing and maintenance
55
+
56
+ - **Page Components**: Simplified and optimized
57
+ - `TasksPage` - Reduced from 700+ to ~300 lines
58
+ - `DocsPage` - Streamlined document management
59
+ - `KanbanPage` - Enhanced board functionality
60
+ - `ConfigPage` - Improved settings interface
61
+
62
+ - **API Client**: Enhanced `src/ui/api/client.ts`
63
+ - Better error handling
64
+ - Type-safe API calls
65
+ - Improved response parsing
66
+
67
+ - **Guidelines**: Updated AI agent guidelines
68
+ - Clearer reference format documentation
69
+ - Better examples for input vs output formats
70
+ - Improved workflow instructions
71
+
72
+ ### Removed
73
+ - **Legacy Components**: Cleaned up old monolithic components
74
+ - `ActivityFeed.tsx`, `AppSidebar.tsx`, `AssigneeDropdown.tsx`
75
+ - `Avatar.tsx`, `Board.tsx`, `Column.tsx`
76
+ - `MarkdownRenderer.tsx`, `NotificationBell.tsx`
77
+ - `SearchBox.tsx`, `SearchCommandDialog.tsx`
78
+ - `TaskCard.tsx`, `TaskCreateForm.tsx`, `TaskDetailModal.tsx`
79
+ - `TaskHistoryPanel.tsx`, `TimeTracker.tsx`, `VersionDiffViewer.tsx`
80
+ - Functionality preserved in new Atomic Design components
81
+
82
+ ### Fixed
83
+ - **Dialog/Sheet Components**: Fixed accessibility and styling issues
84
+ - **Mention Refs**: Improved reference parsing reliability
85
+ - **Server Notifications**: Better WebSocket notification handling
86
+
87
+ ## [0.2.1] - 2025-12-28
88
+
89
+ ### Fixed
90
+ - **Web UI Static Files**: Fixed `NotFoundError` when running `knowns browser` from global install
91
+ - Bun creates symlinks in `~/.bun/bin/` which broke path resolution for UI files
92
+ - Added `realpathSync` to resolve symlinks before computing paths
93
+ - Changed Express `sendFile` to use `root` option for reliable file serving
94
+
8
95
  ## [0.2.0] - 2025-12-27
9
96
 
10
97
  ### Added
package/CLAUDE.md CHANGED
@@ -28,10 +28,10 @@ When starting a new session or working on an unfamiliar project:
28
28
  knowns doc list --plain
29
29
 
30
30
  # 2. Read essential project docs (prioritize these)
31
- knowns doc view "README" --plain # Project overview
32
- knowns doc view "ARCHITECTURE" --plain # System design
33
- knowns doc view "CONVENTIONS" --plain # Coding standards
34
- knowns doc view "API" --plain # API specifications
31
+ knowns doc "README" --plain # Project overview
32
+ knowns doc "ARCHITECTURE" --plain # System design
33
+ knowns doc "CONVENTIONS" --plain # Coding standards
34
+ knowns doc "API" --plain # API specifications
35
35
 
36
36
  # 3. Review current task backlog
37
37
  knowns task list --plain
@@ -42,17 +42,17 @@ knowns task list --status in-progress --plain
42
42
 
43
43
  ```bash
44
44
  # 1. View the task details
45
- knowns task view <id> --plain
45
+ knowns task <id> --plain
46
46
 
47
47
  # 2. Follow ALL refs in the task (see Reference System section)
48
- # @.knowns/tasks/task-44 - ... → knowns task view 44 --plain
49
- # @.knowns/docs/patterns/module.md → knowns doc view "patterns/module" --plain
48
+ # @.knowns/tasks/task-44 - ... → knowns task 44 --plain
49
+ # @.knowns/docs/patterns/module.md → knowns doc "patterns/module" --plain
50
50
 
51
51
  # 3. Search for additional related documentation
52
52
  knowns search "<keywords from task>" --type doc --plain
53
53
 
54
54
  # 4. Read ALL related docs before planning
55
- knowns doc view "<related-doc>" --plain
55
+ knowns doc "<related-doc>" --plain
56
56
 
57
57
  # 5. Check for similar completed tasks (learn from history)
58
58
  knowns search "<keywords>" --type task --status done --plain
@@ -90,10 +90,15 @@ Tasks and docs can contain **references** to other tasks/docs. AI agents MUST un
90
90
 
91
91
  ### Reference Formats
92
92
 
93
- | Type | User Input | System Output | CLI Command |
94
- |------|------------|---------------|-------------|
95
- | **Task ref** | `@task-<id>` | `@.knowns/tasks/task-<id> - <title>.md` | `knowns task view <id> --plain` |
96
- | **Doc ref** | `@doc/<path>` | `@.knowns/docs/<path>.md` | `knowns doc view "<path>" --plain` |
93
+ | Type | When Writing (Input) | When Reading (Output) | CLI Command |
94
+ |------|---------------------|----------------------|-------------|
95
+ | **Task ref** | `@task-<id>` | `@.knowns/tasks/task-<id> - <title>.md` | `knowns task <id> --plain` |
96
+ | **Doc ref** | `@doc/<path>` | `@.knowns/docs/<path>.md` | `knowns doc <path> --plain` |
97
+
98
+ > **CRITICAL for AI Agents**:
99
+ > - When **WRITING** refs (in descriptions, plans, notes): Use `@task-<id>` and `@doc/<path>`
100
+ > - When **READING** output from `--plain`: You'll see `@.knowns/tasks/...` and `@.knowns/docs/...`
101
+ > - **NEVER write** the output format (`@.knowns/...`) - always use input format (`@task-<id>`, `@doc/<path>`)
97
102
 
98
103
  ### How to Follow Refs
99
104
 
@@ -105,16 +110,16 @@ When you read a task and see refs in system output format, follow them:
105
110
  # @.knowns/docs/patterns/module.md
106
111
 
107
112
  # Follow task ref (extract ID from task-<id>)
108
- knowns task view 44 --plain
113
+ knowns task 44 --plain
109
114
 
110
115
  # Follow doc ref (extract path, remove .md)
111
- knowns doc view "patterns/module" --plain
116
+ knowns doc "patterns/module" --plain
112
117
  ```
113
118
 
114
119
  ### Parsing Rules
115
120
 
116
- 1. **Task refs**: `@.knowns/tasks/task-<id> - ...` → extract `<id>` → `knowns task view <id> --plain`
117
- 2. **Doc refs**: `@.knowns/docs/<path>.md` → extract `<path>` → `knowns doc view "<path>" --plain`
121
+ 1. **Task refs**: `@.knowns/tasks/task-<id> - ...` → extract `<id>` → `knowns task <id> --plain`
122
+ 2. **Doc refs**: `@.knowns/docs/<path>.md` → extract `<path>` → `knowns doc "<path>" --plain`
118
123
 
119
124
  ### Recursive Following
120
125
 
@@ -140,20 +145,20 @@ Task 42
140
145
 
141
146
  ```bash
142
147
  # 1. Read the task
143
- $ knowns task view 42 --plain
148
+ $ knowns task 42 --plain
144
149
 
145
150
  # Output contains:
146
151
  # @.knowns/tasks/task-44 - CLI Task Create Command.md
147
152
  # @.knowns/docs/README.md
148
153
 
149
154
  # 2. Follow task ref
150
- $ knowns task view 44 --plain
155
+ $ knowns task 44 --plain
151
156
 
152
157
  # 3. Follow doc ref
153
- $ knowns doc view "README" --plain
158
+ $ knowns doc "README" --plain
154
159
 
155
160
  # 4. If README contains more refs, follow them too
156
- # @.knowns/docs/patterns/module.md → knowns doc view "patterns/module" --plain
161
+ # @.knowns/docs/patterns/module.md → knowns doc "patterns/module" --plain
157
162
 
158
163
  # Now you have complete context
159
164
  ```
@@ -172,7 +177,12 @@ knowns init [name]
172
177
  knowns task create "Title" -d "Description" --ac "Criterion 1" --ac "Criterion 2"
173
178
 
174
179
  # View task (ALWAYS use --plain for AI)
175
- knowns task view <id> --plain
180
+ knowns task <id> --plain # Shorthand
181
+ knowns task view <id> --plain # Full command
182
+
183
+ # View doc (ALWAYS use --plain for AI)
184
+ knowns doc <path> --plain # Shorthand
185
+ knowns doc view "<path>" --plain # Full command
176
186
 
177
187
  # List tasks
178
188
  knowns task list --plain
@@ -202,9 +212,9 @@ $ knowns doc list --plain
202
212
  # DOC: email-templates.md
203
213
 
204
214
  # 0b. Read essential project docs
205
- $ knowns doc view "README" --plain
206
- $ knowns doc view "ARCHITECTURE" --plain
207
- $ knowns doc view "CONVENTIONS" --plain
215
+ $ knowns doc "README" --plain
216
+ $ knowns doc "ARCHITECTURE" --plain
217
+ $ knowns doc "CONVENTIONS" --plain
208
218
 
209
219
  # Now the agent understands project context and conventions
210
220
 
@@ -236,12 +246,12 @@ $ knowns search "password security" --type doc --plain
236
246
  # DOC: email-templates.md (score: 0.78)
237
247
 
238
248
  # 4. Read the documentation
239
- $ knowns doc view "security-patterns" --plain
249
+ $ knowns doc "security-patterns" --plain
240
250
 
241
251
  # 5. Create implementation plan (SHARE WITH USER, WAIT FOR APPROVAL)
242
- $ knowns task edit AUTH-042 --plan $'1. Review security patterns (see [security-patterns.md](./docs/security-patterns.md))
252
+ $ knowns task edit AUTH-042 --plan $'1. Review security patterns (see @doc/security-patterns)
243
253
  2. Design token generation with 1-hour expiry
244
- 3. Create email template (see [email-templates.md](./docs/email-templates.md))
254
+ 3. Create email template (see @doc/email-templates)
245
255
  4. Implement /forgot-password endpoint
246
256
  5. Implement /reset-password endpoint
247
257
  6. Add unit tests
@@ -316,8 +326,8 @@ knowns time start <id>
316
326
  knowns search "authentication" --type doc --plain
317
327
 
318
328
  # View relevant documents
319
- knowns doc view "API Guidelines" --plain
320
- knowns doc view "Security Patterns" --plain
329
+ knowns doc "API Guidelines" --plain
330
+ knowns doc "Security Patterns" --plain
321
331
 
322
332
  # Also check for similar completed tasks
323
333
  knowns search "auth" --type task --status done --plain
@@ -328,7 +338,7 @@ knowns search "auth" --type task --status done --plain
328
338
  ### Step 4: Create Implementation Plan
329
339
 
330
340
  ```bash
331
- knowns task edit <id> --plan $'1. Research patterns (see [security-patterns.md](./security-patterns.md))
341
+ knowns task edit <id> --plan $'1. Research patterns (see @doc/security-patterns)
332
342
  2. Design middleware
333
343
  3. Implement
334
344
  4. Add tests
@@ -337,7 +347,7 @@ knowns task edit <id> --plan $'1. Research patterns (see [security-patterns.md](
337
347
 
338
348
  > **CRITICAL**:
339
349
  > - Share plan with user and **WAIT for approval** before coding
340
- > - Include doc references using `[file.md](./path/file.md)` format
350
+ > - Include doc references using `@doc/<path>` format
341
351
 
342
352
  ### Step 5: Implement
343
353
 
@@ -404,7 +414,8 @@ knowns task edit <id> --notes "Implementation summary"
404
414
  knowns task edit <id> --append-notes "Progress update"
405
415
 
406
416
  # View & List
407
- knowns task view <id> --plain # ALWAYS use --plain
417
+ knowns task <id> --plain # Shorthand (ALWAYS use --plain)
418
+ knowns task view <id> --plain # Full command
408
419
  knowns task list --plain
409
420
  knowns task list --status in-progress --plain
410
421
  knowns task list --assignee @me --plain
@@ -435,7 +446,8 @@ knowns time report --by-label --csv > report.csv
435
446
  # List & View
436
447
  knowns doc list --plain
437
448
  knowns doc list --tag architecture --plain
438
- knowns doc view "Doc Name" --plain
449
+ knowns doc <path> --plain # Shorthand (ALWAYS use --plain)
450
+ knowns doc view "<path>" --plain # Full command
439
451
 
440
452
  # Create (with optional folder)
441
453
  knowns doc create "Title" -d "Description" -t "tags"
@@ -479,14 +491,12 @@ Clear summary (WHAT needs to be done).
479
491
 
480
492
  ### Description
481
493
 
482
- Explains WHY and WHAT (not HOW). **Link related docs using `[file.md](./path/file.md)`**
494
+ Explains WHY and WHAT (not HOW). **Link related docs using `@doc/<path>`**
483
495
 
484
496
  ```markdown
485
497
  We need JWT authentication because sessions don't scale for our microservices architecture.
486
498
 
487
- Related docs:
488
- - [security-patterns.md](./docs/security-patterns.md)
489
- - [api-guidelines.md](./docs/api-guidelines.md)
499
+ Related docs: @doc/security-patterns, @doc/api-guidelines
490
500
  ```
491
501
 
492
502
  ### Acceptance Criteria
@@ -504,7 +514,7 @@ Related docs:
504
514
  HOW to solve. Added AFTER taking task, BEFORE coding.
505
515
 
506
516
  ```markdown
507
- 1. Research JWT libraries (see [security-patterns.md](./docs/security-patterns.md))
517
+ 1. Research JWT libraries (see @doc/security-patterns)
508
518
  2. Design token structure (access + refresh tokens)
509
519
  3. Implement auth middleware
510
520
  4. Add unit tests (aim for 90%+ coverage)
@@ -544,7 +554,7 @@ Implemented JWT auth using jsonwebtoken library.
544
554
  | `Error: No active timer` | Calling `time stop` without active timer | Start timer first: `knowns time start <id>` |
545
555
  | `Error: Timer already running` | Starting timer when one is active | Stop current: `knowns time stop` |
546
556
  | `Error: Invalid status` | Wrong status format | Use lowercase with hyphens: `in-progress`, not `In Progress` |
547
- | `Error: AC index out of range` | Checking non-existent criterion | View task first: `knowns task view <id> --plain` |
557
+ | `Error: AC index out of range` | Checking non-existent criterion | View task first: `knowns task <id> --plain` |
548
558
  | `Error: Document not found` | Wrong document name | Run `knowns doc list --plain` to find correct name |
549
559
  | `Error: Not initialized` | Running commands without init | Run `knowns init` first |
550
560
 
@@ -558,7 +568,7 @@ knowns --version
558
568
  knowns status
559
569
 
560
570
  # View raw task data (for debugging)
561
- knowns task view <id> --json
571
+ knowns task <id> --json
562
572
 
563
573
  # Check timer status
564
574
  knowns time status
@@ -621,7 +631,8 @@ Use **lowercase with hyphens**:
621
631
  | Assume you know the conventions | Read CONVENTIONS/ARCHITECTURE docs |
622
632
  | Plan without checking docs | Read docs before planning |
623
633
  | Ignore similar completed tasks | Search done tasks for patterns |
624
- | Missing doc links in description/plan | Link docs using `[file.md](./path)` |
634
+ | Missing doc links in description/plan | Link docs using `@doc/<path>` |
635
+ | Write refs as `@.knowns/docs/...` or `@.knowns/tasks/...` | Use input format: `@doc/<path>`, `@task-<id>` |
625
636
  | Forget `--plain` flag | Always use `--plain` for AI |
626
637
  | Code before plan approval | Share plan, WAIT for approval |
627
638
  | Mark done without all criteria | Check ALL criteria first |
@@ -629,8 +640,8 @@ Use **lowercase with hyphens**:
629
640
  | Use `"In Progress"` or `"Done"` | Use `in-progress`, `done` |
630
641
  | Use `@yourself` | Use `@me` or specific username |
631
642
  | Ignore refs in task description | Follow ALL refs (`@.knowns/...`) before planning |
632
- | See `@.knowns/docs/...` but don't read | Use `knowns doc view "<path>" --plain` |
633
- | See `@.knowns/tasks/task-X` but don't check | Use `knowns task view X --plain` for context |
643
+ | See `@.knowns/docs/...` but don't read | Use `knowns doc "<path>" --plain` |
644
+ | See `@.knowns/tasks/task-X` but don't check | Use `knowns task X --plain` for context |
634
645
  | Follow only first-level refs | Recursively follow nested refs until complete |
635
646
 
636
647
  ---
@@ -688,7 +699,7 @@ EOF
688
699
  - [ ] ALL refs in task followed (`@.knowns/...`)
689
700
  - [ ] Nested refs recursively followed until complete context gathered
690
701
  - [ ] Related docs searched: `knowns search "keyword" --type doc --plain`
691
- - [ ] ALL relevant docs read: `knowns doc view "Doc Name" --plain`
702
+ - [ ] ALL relevant docs read: `knowns doc "Doc Name" --plain`
692
703
  - [ ] Similar done tasks reviewed for patterns
693
704
  - [ ] Task assigned to self: `-a @me`
694
705
  - [ ] Status set to in-progress: `-s in-progress`
@@ -697,7 +708,7 @@ EOF
697
708
  ### During Work
698
709
 
699
710
  - [ ] Implementation plan created and approved
700
- - [ ] Doc links included in plan: `[file.md](./path/file.md)`
711
+ - [ ] Doc links included in plan: `@doc/<path>`
701
712
  - [ ] Criteria checked as completed: `--check-ac <index>`
702
713
  - [ ] Progress notes appended: `--append-notes "✓ ..."`
703
714
 
@@ -717,18 +728,18 @@ EOF
717
728
  ```bash
718
729
  # === AGENT INITIALIZATION (Once per session) ===
719
730
  knowns doc list --plain
720
- knowns doc view "README" --plain
721
- knowns doc view "ARCHITECTURE" --plain
722
- knowns doc view "CONVENTIONS" --plain
731
+ knowns doc "README" --plain
732
+ knowns doc "ARCHITECTURE" --plain
733
+ knowns doc "CONVENTIONS" --plain
723
734
 
724
735
  # === FULL WORKFLOW ===
725
736
  knowns task create "Title" -d "Description" --ac "Criterion"
726
737
  knowns task edit <id> -s in-progress -a @me
727
738
  knowns time start <id>
728
739
  knowns search "keyword" --type doc --plain
729
- knowns doc view "Doc Name" --plain
740
+ knowns doc "Doc Name" --plain
730
741
  knowns search "keyword" --type task --status done --plain # Learn from history
731
- knowns task edit <id> --plan $'1. Step (see [file.md](./file.md))\n2. Step'
742
+ knowns task edit <id> --plan $'1. Step (see @doc/file)\n2. Step'
732
743
  # ... wait for approval, then implement ...
733
744
  knowns task edit <id> --check-ac 1 --check-ac 2
734
745
  knowns task edit <id> --append-notes "✓ Completed feature"
@@ -736,7 +747,7 @@ knowns time stop
736
747
  knowns task edit <id> -s done
737
748
 
738
749
  # === VIEW & SEARCH ===
739
- knowns task view <id> --plain
750
+ knowns task <id> --plain # Shorthand for view
740
751
  knowns task list --plain
741
752
  knowns task list --status in-progress --assignee @me --plain
742
753
  knowns search "query" --plain
@@ -750,7 +761,7 @@ knowns time report --from "2025-12-01" --to "2025-12-31"
750
761
 
751
762
  # === DOCUMENTATION ===
752
763
  knowns doc list --plain
753
- knowns doc view "path/doc-name" --plain
764
+ knowns doc "path/doc-name" --plain # Shorthand for view
754
765
  knowns doc create "Title" -d "Description" -t "tags" -f "folder"
755
766
  knowns doc edit "doc-name" -c "New content"
756
767
  knowns doc edit "doc-name" -a "Appended content"
@@ -774,3 +785,4 @@ knowns doc edit "doc-name" -a "Appended content"
774
785
 
775
786
 
776
787
 
788
+
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="images/cover.png" alt="Knowns - Task & Documentation Management" width="100%">
2
+ <img src="images/cover.jpeg" alt="Knowns - Task & Documentation Management" width="100%">
3
3
  </p>
4
4
 
5
5
  <h1 align="center">Knowns</h1>
@@ -109,12 +109,12 @@ knowns browser # Open Web UI
109
109
  # Tasks
110
110
  knowns task create "Title" -d "Description" --ac "Criterion"
111
111
  knowns task list --plain
112
- knowns task view <id> --plain
112
+ knowns task <id> --plain # View task (shorthand)
113
113
  knowns task edit <id> -s in-progress -a @me
114
114
 
115
115
  # Documentation
116
116
  knowns doc create "Title" -d "Description" -f "folder"
117
- knowns doc view "doc-name" --plain
117
+ knowns doc "doc-name" --plain # View doc (shorthand)
118
118
 
119
119
  # Time & Search
120
120
  knowns time start <id> && knowns time stop