knowns 0.1.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/README.md ADDED
@@ -0,0 +1,535 @@
1
+ # Knowns
2
+
3
+ > **Know what your team knows.**
4
+
5
+ CLI tool for dev teams to manage tasks and documentation with AI-first context linking.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/knowns.svg)](https://www.npmjs.com/package/knowns)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
9
+
10
+ ## Why Knowns?
11
+
12
+ **Problem:** AI assistants lose context between sessions. You repeat the same architecture explanations, patterns, and decisions over and over.
13
+
14
+ **Solution:** Knowns links tasks to documentation with structured context that AI can understand and reference automatically.
15
+
16
+ ## Core Features
17
+
18
+ ### 1. **Context-Aware Task Management**
19
+ - Link documentation directly in task descriptions
20
+ - AI sees `@.knowns/docs/patterns/guards.md` and knows where to find context
21
+ - Related Documentation section auto-extracts all doc links
22
+ - No more "remind me how authentication works again"
23
+
24
+ ### 2. **Time Tracking Built-In**
25
+ - Start/stop timers per task
26
+ - Track total time spent
27
+ - View time history with task context
28
+ - Perfect for time reporting and productivity analysis
29
+
30
+ ### 3. **Smart Documentation**
31
+ - Nested folder structure (`patterns/`, `guides/`, `architecture/`)
32
+ - Markdown links automatically resolve to `@.knowns/docs/` paths
33
+ - Search across all docs instantly
34
+ - AI can fetch exact context when needed
35
+
36
+ ### 4. **AI Integration**
37
+ - `--plain` flag outputs clean text for AI consumption
38
+ - MCP Server for Claude Desktop integration
39
+ - Agent instructions sync across Claude, Gemini, Copilot
40
+ - Every task and doc is AI-readable
41
+
42
+ ## Who Should Use Knowns?
43
+
44
+ ### Perfect For:
45
+
46
+ 1. **Teams using AI assistants** - Stop repeating context every session
47
+ 2. **Projects with established patterns** - Document once, link everywhere
48
+ 3. **Remote/async teams** - Knowledge doesn't live in someone's head
49
+ 4. **Developers who pair with AI** - Give AI perfect project memory
50
+ 5. **Teams tracking time** - Context + time in one place
51
+
52
+ ### Not For:
53
+
54
+ - Large enterprises needing complex permissions (use Jira)
55
+ - Non-technical teams (no markdown)
56
+ - Projects without established patterns yet
57
+
58
+ ## Installation
59
+
60
+ ```bash
61
+ npm install -g knowns
62
+ ```
63
+
64
+ ## Quick Start
65
+
66
+ ```bash
67
+ # 1. Initialize in your project
68
+ knowns init
69
+
70
+ # 2. Create documentation for your patterns
71
+ knowns doc create "Authentication Pattern" \
72
+ -d "JWT-based auth with guards" \
73
+ -t "patterns,auth"
74
+
75
+ # 3. Create task with context links
76
+ knowns task create "Add user authentication" \
77
+ -d $'Implement JWT auth following [authentication pattern](./patterns/authentication-pattern.md)
78
+
79
+ Requirements:
80
+ - Use JWT tokens
81
+ - Email/password login
82
+ - Session persistence' \
83
+ --ac "User can login with email/password" \
84
+ --ac "Session persists across page refresh"
85
+
86
+ # 4. View task (AI-readable format)
87
+ knowns task view 1 --plain
88
+
89
+ # Output shows:
90
+ # Description: ...
91
+ # Related Documentation:
92
+ # 📄 authentication pattern: @.knowns/docs/patterns/authentication-pattern.md
93
+
94
+ # 5. AI reads the linked docs and implements with full context!
95
+ ```
96
+
97
+ **Key insight:** Link docs in descriptions. AI gets context automatically.
98
+
99
+ ## The Context Problem
100
+
101
+ ### Before Knowns:
102
+
103
+ ```
104
+ Session 1:
105
+ You: "Implement feature X"
106
+ AI: "How does your auth work?"
107
+ You: *explains guards pattern*
108
+ AI: *implements*
109
+
110
+ Session 2 (next day):
111
+ You: "Implement feature Y"
112
+ AI: "How does your auth work?"
113
+ You: *explains AGAIN*
114
+ ```
115
+
116
+ ### With Knowns:
117
+
118
+ ```
119
+ Session 1:
120
+ You: "Implement feature X, follow [guards.md](./patterns/guards.md)"
121
+ AI: *reads doc, implements correctly*
122
+
123
+ Session 2:
124
+ You: "Implement feature Y, follow [guards.md](./patterns/guards.md)"
125
+ AI: *reads same doc, implements consistently*
126
+
127
+ Session 100:
128
+ You: "Implement feature Z, follow [guards.md](./patterns/guards.md)"
129
+ AI: *still reads same doc, never forgets*
130
+ ```
131
+
132
+ **Benefits:**
133
+ - ✅ No repetition
134
+ - ✅ Consistent implementations
135
+ - ✅ Onboarding is instant (AI reads docs)
136
+ - ✅ Documentation stays up-to-date (it's actually used)
137
+ - ✅ New team members follow same patterns
138
+
139
+ ## Commands
140
+
141
+ ### Task Management
142
+
143
+ ```bash
144
+ # Create task
145
+ knowns task create "Title" -d "Description" --ac "Criterion 1"
146
+
147
+ # View task
148
+ knowns task view <id> --plain
149
+
150
+ # Edit task
151
+ knowns task edit <id> -s "In Progress" -a @yourself
152
+ knowns task edit <id> --check-ac 1
153
+ knowns task edit <id> --plan $'1. Research\n2. Implement\n3. Test'
154
+ knowns task edit <id> --notes "Implementation complete"
155
+
156
+ # List tasks
157
+ knowns task list --plain
158
+ knowns task list -s "In Progress" --plain
159
+ ```
160
+
161
+ ### Documentation
162
+
163
+ ```bash
164
+ # List all docs (includes nested folders)
165
+ knowns doc list --plain
166
+
167
+ # View document
168
+ knowns doc view patterns/guards --plain
169
+
170
+ # Create document
171
+ knowns doc create "API Guidelines" -d "REST API standards" -t "api,backend"
172
+
173
+ # Edit metadata
174
+ knowns doc edit <name> -t "New Title" -d "Updated description"
175
+ ```
176
+
177
+ ### Search
178
+
179
+ ```bash
180
+ # Search everything
181
+ knowns search "authentication" --plain
182
+
183
+ # Search tasks only
184
+ knowns search "login" --type task --plain
185
+
186
+ # Search with filters
187
+ knowns search "api" --status "In Progress" --plain
188
+ ```
189
+
190
+ ### Web UI
191
+
192
+ ```bash
193
+ # Open browser UI (Kanban + Docs)
194
+ knowns browser
195
+
196
+ # Open on specific port
197
+ knowns browser -p 8080
198
+ ```
199
+
200
+ ### Agent Instructions
201
+
202
+ ```bash
203
+ # Sync guidelines to all agent instruction files
204
+ knowns agents --update-instructions
205
+ ```
206
+
207
+ Updates:
208
+ - `CLAUDE.md` - Claude Code
209
+ - `AGENTS.md` - Agent SDK
210
+ - `GEMINI.md` - Gemini
211
+ - `.github/copilot-instructions.md` - GitHub Copilot
212
+
213
+ ## Task Workflow
214
+
215
+ ### 1. Take Task
216
+ ```bash
217
+ knowns task edit <id> -s "In Progress" -a @yourself
218
+ ```
219
+
220
+ ### 2. Create Plan
221
+ ```bash
222
+ knowns task edit <id> --plan $'1. Research API\n2. Implement feature\n3. Add tests'
223
+ ```
224
+
225
+ ### 3. Work & Check Criteria
226
+ ```bash
227
+ # As you complete acceptance criteria
228
+ knowns task edit <id> --check-ac 1 --check-ac 2 --check-ac 3
229
+ ```
230
+
231
+ ### 4. Add Implementation Notes
232
+ ```bash
233
+ knowns task edit <id> --notes $'Implemented using X pattern\nAdded comprehensive tests\nReady for review'
234
+ ```
235
+
236
+ ### 5. Complete
237
+ ```bash
238
+ knowns task edit <id> -s Done
239
+ ```
240
+
241
+ ## File Structure
242
+
243
+ After `knowns init`:
244
+
245
+ ```
246
+ .knowns/
247
+ ├── tasks/ # Task markdown files
248
+ └── docs/ # Documentation (supports nested folders)
249
+ ├── patterns/
250
+ ├── guides/
251
+ └── architecture/
252
+ ```
253
+
254
+ ## Context Linking in Action
255
+
256
+ ### Problem: AI Loses Context
257
+
258
+ **Without Knowns:**
259
+ ```
260
+ User: "Implement authentication for the new API endpoint"
261
+ AI: "Sure! What authentication method are you using?"
262
+ User: "We use JWT with guards pattern"
263
+ AI: "Can you explain your guards pattern?"
264
+ User: *explains again for the 10th time*
265
+ ```
266
+
267
+ **With Knowns:**
268
+ ```bash
269
+ # Create task with context links
270
+ knowns task create "Implement auth for /users endpoint" \
271
+ -d "Follow our standard [guards pattern](./patterns/guards.md) and [JWT setup](./patterns/authentication.md)"
272
+
273
+ # AI reads task
274
+ knowns task view 42 --plain
275
+ ```
276
+
277
+ **Output:**
278
+ ```
279
+ Description:
280
+ Follow our standard guards pattern and JWT setup
281
+
282
+ Related Documentation:
283
+ 📄 guards pattern: @.knowns/docs/patterns/guards.md
284
+ 📄 JWT setup: @.knowns/docs/patterns/authentication.md
285
+ ```
286
+
287
+ AI now knows EXACTLY where to find your patterns. No context loss.
288
+
289
+ ### How It Works
290
+
291
+ 1. **Link docs in task descriptions:**
292
+ ```markdown
293
+ See [mapper pattern](./patterns/mapper.md) for data conversion
294
+ ```
295
+
296
+ 2. **AI-readable output:**
297
+ ```bash
298
+ knowns task view 1 --plain
299
+ # Shows: @.knowns/docs/patterns/mapper.md
300
+ ```
301
+
302
+ 3. **AI fetches context automatically:**
303
+ - Via MCP Server (Claude Desktop)
304
+ - Via search commands
305
+ - Direct doc reading
306
+
307
+ ### Example: Complete Task with Context
308
+
309
+ ```bash
310
+ knowns task create "Add user profile endpoint" -d $'Implement GET /api/users/:id
311
+
312
+ Architecture:
313
+ - Follow [controller pattern](./patterns/controller.md)
314
+ - Use [repository pattern](./patterns/repository.md) for data access
315
+ - Apply [DTO pattern](./patterns/dto.md) for response
316
+ - Add [guards](./patterns/guards.md) for auth
317
+
318
+ See [API guidelines](./guides/api-standards.md) for naming conventions'
319
+ ```
320
+
321
+ When AI reads this task, it sees:
322
+ ```
323
+ Related Documentation:
324
+ 📄 controller pattern: @.knowns/docs/patterns/controller.md
325
+ 📄 repository pattern: @.knowns/docs/patterns/repository.md
326
+ 📄 DTO pattern: @.knowns/docs/patterns/dto.md
327
+ 📄 guards: @.knowns/docs/patterns/guards.md
328
+ 📄 API guidelines: @.knowns/docs/guides/api-standards.md
329
+ ```
330
+
331
+ AI has ALL the context it needs. Zero repetition.
332
+
333
+ ## Features Deep Dive
334
+
335
+ ### Smart Document Linking
336
+
337
+ Links in tasks/docs are automatically resolved:
338
+
339
+ **Markdown:**
340
+ ```markdown
341
+ [guards.md](./patterns/guards.md)
342
+ ```
343
+
344
+ **Plain output:**
345
+ ```
346
+ @.knowns/docs/patterns/guards.md
347
+ ```
348
+
349
+ ### Acceptance Criteria Management
350
+
351
+ ```bash
352
+ # Add criteria
353
+ knowns task edit 42 --ac "New criterion"
354
+
355
+ # Check multiple at once
356
+ knowns task edit 42 --check-ac 1 --check-ac 2 --check-ac 3
357
+
358
+ # Uncheck
359
+ knowns task edit 42 --uncheck-ac 2
360
+
361
+ # Remove
362
+ knowns task edit 42 --remove-ac 3
363
+ ```
364
+
365
+ ### Multi-line Input
366
+
367
+ **Bash/Zsh:**
368
+ ```bash
369
+ knowns task edit 42 --plan $'1. Step one\n2. Step two\n3. Step three'
370
+ ```
371
+
372
+ **PowerShell:**
373
+ ```powershell
374
+ knowns task edit 42 --notes "Line 1`nLine 2"
375
+ ```
376
+
377
+ ### Time Tracking
378
+
379
+ ```bash
380
+ # Start timer for task
381
+ knowns time start 42
382
+
383
+ # Stop timer
384
+ knowns time stop 42
385
+
386
+ # View time spent
387
+ knowns task view 42 --plain
388
+ # Shows: Time Spent: 2h 30m
389
+
390
+ # View time history
391
+ knowns time list 42
392
+ ```
393
+
394
+ **Why built-in time tracking?**
395
+ - Task context is preserved (what you worked on)
396
+ - Links to documentation show what you learned
397
+ - AI can analyze time patterns
398
+ - No separate time tracking tool needed
399
+
400
+ ### Search with Filters
401
+
402
+ ```bash
403
+ # By status
404
+ knowns search "api" --status "In Progress"
405
+
406
+ # By priority
407
+ knowns search "bug" --priority high
408
+
409
+ # By assignee
410
+ knowns task list -a @john --plain
411
+ ```
412
+
413
+ ## Web UI
414
+
415
+ The browser UI provides:
416
+
417
+ - **Kanban Board** - Drag & drop tasks across status columns
418
+ - **Task Details** - Full task view with inline editing
419
+ - **Document Browser** - Tree view with markdown preview
420
+ - **Dark Mode** - System preference aware
421
+ - **Search** - Global search across tasks and docs
422
+ - **Time Tracking** - Start/stop timers, view history
423
+
424
+ ## MCP Server - AI Context Integration
425
+
426
+ Knowns includes a Model Context Protocol server that lets AI (Claude Desktop) access your context automatically.
427
+
428
+ ### Setup
429
+
430
+ Add to Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
431
+
432
+ ```json
433
+ {
434
+ "mcpServers": {
435
+ "knowns": {
436
+ "command": "knowns",
437
+ "args": ["mcp"]
438
+ }
439
+ }
440
+ }
441
+ ```
442
+
443
+ ### What It Does
444
+
445
+ When you tell Claude: *"Implement the user profile feature"*
446
+
447
+ Claude can now:
448
+ 1. **Read task**: `knowns task view 42 --plain`
449
+ 2. **See linked docs**: `@.knowns/docs/patterns/controller.md`
450
+ 3. **Fetch context**: Reads controller pattern automatically
451
+ 4. **Implement correctly**: Following your exact patterns
452
+
453
+ **No more:**
454
+ - "Can you explain your architecture?"
455
+ - "What's your naming convention?"
456
+ - "How do you structure controllers?"
457
+
458
+ **AI already knows** because it reads your docs.
459
+
460
+ ### Available Tools
461
+
462
+ The MCP server provides:
463
+ - `search_tasks` - Find relevant tasks
464
+ - `read_task` - Get full task with linked docs
465
+ - `search_docs` - Find documentation
466
+ - `read_doc` - Get doc content
467
+ - `list_docs` - Browse doc structure
468
+
469
+ ### Example Conversation
470
+
471
+ ```
472
+ You: "Start working on task 42"
473
+
474
+ Claude: [Reads task via MCP]
475
+ "I see this task requires implementing auth following the guards
476
+ pattern. Let me check the guards documentation..."
477
+ [Fetches @.knowns/docs/patterns/guards.md via MCP]
478
+ "Got it! I'll implement JWT guard with email verification check
479
+ as documented. Starting implementation..."
480
+ ```
481
+
482
+ **Zero context loss. AI has perfect memory of your project.**
483
+
484
+ ## Development
485
+
486
+ ```bash
487
+ # Install dependencies
488
+ bun install
489
+
490
+ # Run in dev mode
491
+ bun run dev
492
+
493
+ # Build
494
+ bun run build
495
+
496
+ # Lint
497
+ bun run lint
498
+
499
+ # Format
500
+ bun run format
501
+ ```
502
+
503
+ ## Guidelines
504
+
505
+ **Core Principle:** Never edit `.md` files directly. Always use CLI commands.
506
+
507
+ ```bash
508
+ # ❌ Wrong
509
+ vim .knowns/tasks/task-42.md
510
+
511
+ # ✅ Right
512
+ knowns task edit 42 -d "Updated description"
513
+ ```
514
+
515
+ See [CLAUDE.md](./CLAUDE.md) for complete guidelines.
516
+
517
+ ## Contributing
518
+
519
+ Contributions welcome! Please read our contributing guidelines before submitting PRs.
520
+
521
+ ## License
522
+
523
+ MIT © [Knowns Contributors](./LICENSE)
524
+
525
+ ## Links
526
+
527
+ - [npm package](https://www.npmjs.com/package/knowns)
528
+ - [GitHub repository](https://github.com/yourusername/knowns)
529
+ - [Issues](https://github.com/yourusername/knowns/issues)
530
+
531
+ ---
532
+
533
+ **Know what your team knows.**
534
+
535
+ Built for dev teams who pair with AI and value structured knowledge over tribal knowledge.