knowns 0.3.0 → 0.4.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/CLAUDE.md CHANGED
@@ -1,3 +1,5 @@
1
+ /Users/howznguyen/Workspaces/Knowns/knowns/src/templates/knowns-guidelines-cli.md
2
+
1
3
  <!-- KNOWNS GUIDELINES START -->
2
4
  # Knowns CLI Guidelines
3
5
 
@@ -232,8 +234,8 @@ $ knowns task create "Add password reset flow" \
232
234
 
233
235
  # Output: Created task AUTH-042
234
236
 
235
- # 2. Take the task and start timer
236
- $ knowns task edit AUTH-042 -s in-progress -a @me
237
+ # 2. Take the task and start timer (uses defaultAssignee or @me fallback)
238
+ $ knowns task edit AUTH-042 -s in-progress -a $(knowns config get defaultAssignee --plain || echo "@me")
237
239
  $ knowns time start AUTH-042
238
240
 
239
241
  # Output: Timer started for AUTH-042
@@ -306,17 +308,24 @@ $ knowns task edit AUTH-042 -s done
306
308
  ### Step 1: Take Task
307
309
 
308
310
  ```bash
309
- knowns task edit <id> -s in-progress -a @me
311
+ # Assign using defaultAssignee from config (falls back to @me if not set)
312
+ knowns task edit <id> -s in-progress -a $(knowns config get defaultAssignee --plain || echo "@me")
310
313
  ```
311
314
 
312
- > **Note**: `@me` is a special keyword that assigns the task to yourself. You can also use specific usernames like `@harry` or `@john`.
315
+ > **Note**: The `defaultAssignee` is configured in `.knowns/config.json` during `knowns init`. If not set, `@me` is used as fallback. To update: `knowns config set defaultAssignee "@username"`
313
316
 
314
- ### Step 2: Start Time Tracking
317
+ ### Step 2: Start Time Tracking (REQUIRED)
315
318
 
316
319
  ```bash
317
320
  knowns time start <id>
318
321
  ```
319
322
 
323
+ > **CRITICAL**: Time tracking is MANDATORY. Always start timer when taking a task and stop when done. This data is essential for:
324
+ > - Accurate project estimation
325
+ > - Identifying bottlenecks
326
+ > - Resource planning
327
+ > - Sprint retrospectives
328
+
320
329
  ### Step 3: Read Related Documentation
321
330
 
322
331
  > **FOR AI AGENTS**: This step is MANDATORY, not optional. You must understand the codebase before planning.
@@ -352,11 +361,43 @@ knowns task edit <id> --plan $'1. Research patterns (see @doc/security-patterns)
352
361
  ### Step 5: Implement
353
362
 
354
363
  ```bash
355
- # Check acceptance criteria as you complete them
356
- knowns task edit <id> --check-ac 1 --check-ac 2 --check-ac 3
364
+ # Work through implementation plan step by step
365
+ # IMPORTANT: Only check AC AFTER completing the work, not before
366
+
367
+ # After completing work for AC #1:
368
+ knowns task edit <id> --check-ac 1
369
+ knowns task edit <id> --append-notes "✓ Completed: <brief description>"
370
+
371
+ # After completing work for AC #2:
372
+ knowns task edit <id> --check-ac 2
373
+ knowns task edit <id> --append-notes "✓ Completed: <brief description>"
374
+ ```
375
+
376
+ > **CRITICAL**: Never check an AC before the work is actually done. ACs represent completed outcomes, not intentions.
377
+
378
+ ### Step 6: Handle Dynamic Requests (During Implementation)
379
+
380
+ If the user adds new requirements during implementation:
381
+
382
+ ```bash
383
+ # Add new acceptance criteria
384
+ knowns task edit <id> --ac "New requirement from user"
385
+
386
+ # Update implementation plan to include new steps
387
+ knowns task edit <id> --plan $'1. Original step 1
388
+ 2. Original step 2
389
+ 3. NEW: Handle user request for X
390
+ 4. Continue with remaining work'
391
+
392
+ # Append note about scope change
393
+ knowns task edit <id> --append-notes "⚠️ Scope updated: Added requirement for X per user request"
394
+
395
+ # Continue with Step 5 (Implement) for new requirements
357
396
  ```
358
397
 
359
- ### Step 6: Add Implementation Notes
398
+ > **Note**: Always document scope changes. This helps track why a task took longer than expected.
399
+
400
+ ### Step 7: Add Implementation Notes
360
401
 
361
402
  ```bash
362
403
  # Add comprehensive notes (suitable for PR description)
@@ -373,18 +414,77 @@ knowns task edit <id> --append-notes "✓ Implemented middleware"
373
414
  knowns task edit <id> --append-notes "✓ Added tests"
374
415
  ```
375
416
 
376
- ### Step 7: Stop Time Tracking
417
+ ### Step 8: Stop Time Tracking (REQUIRED)
377
418
 
378
419
  ```bash
379
420
  knowns time stop
380
421
  ```
381
422
 
382
- ### Step 8: Complete Task
423
+ > **CRITICAL**: Never forget to stop the timer. If you forget, use manual entry: `knowns time add <id> <duration> -n "Forgot to stop timer"`
424
+
425
+ ### Step 9: Complete Task
383
426
 
384
427
  ```bash
385
428
  knowns task edit <id> -s done
386
429
  ```
387
430
 
431
+ ### Step 10: Handle Post-Completion Changes (If Applicable)
432
+
433
+ If the user requests changes or updates AFTER task is marked done:
434
+
435
+ ```bash
436
+ # 1. Reopen task - set back to in-progress
437
+ knowns task edit <id> -s in-progress
438
+
439
+ # 2. Restart time tracking (REQUIRED)
440
+ knowns time start <id>
441
+
442
+ # 3. Add new AC for the changes requested
443
+ knowns task edit <id> --ac "Post-completion fix: <description>"
444
+
445
+ # 4. Document the reopen reason
446
+ knowns task edit <id> --append-notes "🔄 Reopened: User requested changes - <reason>"
447
+
448
+ # 5. Follow Step 5-9 again (Implement → Notes → Stop Timer → Done)
449
+ ```
450
+
451
+ > **CRITICAL**: Treat post-completion changes as a mini-workflow. Always:
452
+ > - Reopen task (in-progress)
453
+ > - Start timer again
454
+ > - Add AC for traceability
455
+ > - Document why it was reopened
456
+ > - Follow the same completion process
457
+
458
+ ### Step 11: Knowledge Extraction (Post-Completion)
459
+
460
+ After completing a task, extract reusable knowledge to docs:
461
+
462
+ ```bash
463
+ # Search if similar pattern already documented
464
+ knowns search "<pattern/concept>" --type doc --plain
465
+
466
+ # If new knowledge, create a doc for future reference
467
+ knowns doc create "Pattern: <Name>" \
468
+ -d "Reusable pattern discovered during task implementation" \
469
+ -t "pattern,<domain>" \
470
+ -f "patterns"
471
+
472
+ # Or append to existing doc
473
+ knowns doc edit "<existing-doc>" -a "## New Section\n\nLearned from task <id>: ..."
474
+
475
+ # Reference the source task
476
+ knowns doc edit "<doc-name>" -a "\n\n> Source: @task-<id>"
477
+ ```
478
+
479
+ **When to extract knowledge:**
480
+ - New patterns/conventions discovered
481
+ - Common error solutions
482
+ - Reusable code snippets or approaches
483
+ - Integration patterns with external services
484
+ - Performance optimization techniques
485
+
486
+ > **CRITICAL**: Only extract **generalizable** knowledge. Task-specific details belong in implementation notes, not docs.
487
+
388
488
  ---
389
489
 
390
490
  ## Essential Commands
@@ -400,7 +500,7 @@ knowns task edit <id> -t "New title"
400
500
  knowns task edit <id> -d "New description"
401
501
  knowns task edit <id> -s in-progress
402
502
  knowns task edit <id> --priority high
403
- knowns task edit <id> -a @me
503
+ knowns task edit <id> -a <assignee> # $(knowns config get defaultAssignee --plain || echo "@me")
404
504
 
405
505
  # Acceptance Criteria
406
506
  knowns task edit <id> --ac "New criterion" # Add
@@ -418,7 +518,7 @@ knowns task <id> --plain # Shorthand (ALWAYS use --p
418
518
  knowns task view <id> --plain # Full command
419
519
  knowns task list --plain
420
520
  knowns task list --status in-progress --plain
421
- knowns task list --assignee @me --plain
521
+ knowns task list --assignee <assignee> --plain # $(knowns config get defaultAssignee --plain || echo "@me")
422
522
  knowns task list --tree --plain # Tree hierarchy
423
523
  ```
424
524
 
@@ -582,10 +682,11 @@ A task is **Done** ONLY when **ALL** criteria are met:
582
682
 
583
683
  ### Via CLI (Required)
584
684
 
585
- - [ ] All acceptance criteria checked: `--check-ac <index>`
685
+ - [ ] All acceptance criteria checked: `--check-ac <index>` (only after work is actually done)
586
686
  - [ ] Implementation notes added: `--notes "..."`
587
- - [ ] Timer stopped: `knowns time stop`
687
+ - [ ] ⏱️ Timer stopped: `knowns time stop` (MANDATORY - do not skip!)
588
688
  - [ ] Status set to done: `-s done`
689
+ - [ ] Knowledge extracted to docs (if applicable)
589
690
 
590
691
  ### Via Code (Required)
591
692
 
@@ -626,6 +727,8 @@ Use **lowercase with hyphens**:
626
727
  |-------|-------|
627
728
  | Edit .md files directly | Use `knowns task edit` |
628
729
  | Change `- [ ]` to `- [x]` in file | Use `--check-ac <index>` |
730
+ | Check AC before completing work | Only check AC AFTER work is actually done |
731
+ | Skip time tracking | ALWAYS use `time start` and `time stop` |
629
732
  | Start coding without reading docs | Read ALL related docs FIRST |
630
733
  | Skip `knowns doc list` on new project | Always list docs when starting |
631
734
  | Assume you know the conventions | Read CONVENTIONS/ARCHITECTURE docs |
@@ -638,7 +741,7 @@ Use **lowercase with hyphens**:
638
741
  | Mark done without all criteria | Check ALL criteria first |
639
742
  | Write implementation steps in AC | Write outcome-oriented criteria |
640
743
  | Use `"In Progress"` or `"Done"` | Use `in-progress`, `done` |
641
- | Use `@yourself` | Use `@me` or specific username |
744
+ | Use `@yourself` or unknown assignee | Use `$(knowns config get defaultAssignee --plain \|\| echo "@me")` |
642
745
  | Ignore refs in task description | Follow ALL refs (`@.knowns/...`) before planning |
643
746
  | See `@.knowns/docs/...` but don't read | Use `knowns doc "<path>" --plain` |
644
747
  | See `@.knowns/tasks/task-X` but don't check | Use `knowns task X --plain` for context |
@@ -682,6 +785,26 @@ EOF
682
785
  - **Unix/macOS**: Use forward slashes: `./docs/api.md`
683
786
  - **Windows**: Both work, but prefer forward slashes for consistency
684
787
 
788
+ ### Windows Command Line Limit
789
+
790
+ Windows has ~8191 character limit. For long content, append in chunks:
791
+
792
+ ```bash
793
+ # 1. Create or reset with short content
794
+ knowns doc edit "doc-name" -c "## Overview\n\nShort intro."
795
+
796
+ # 2. Append each section separately
797
+ knowns doc edit "doc-name" -a "## Section 1\n\nContent..."
798
+ knowns doc edit "doc-name" -a "## Section 2\n\nMore content..."
799
+ ```
800
+
801
+ Or use file-based options:
802
+
803
+ ```bash
804
+ knowns doc edit "doc-name" --content-file ./content.md
805
+ knowns doc edit "doc-name" --append-file ./more.md
806
+ ```
807
+
685
808
  ---
686
809
 
687
810
  ## Best Practices Checklist
@@ -701,7 +824,7 @@ EOF
701
824
  - [ ] Related docs searched: `knowns search "keyword" --type doc --plain`
702
825
  - [ ] ALL relevant docs read: `knowns doc "Doc Name" --plain`
703
826
  - [ ] Similar done tasks reviewed for patterns
704
- - [ ] Task assigned to self: `-a @me`
827
+ - [ ] Task assigned to self: `-a $(knowns config get defaultAssignee --plain || echo "@me")`
705
828
  - [ ] Status set to in-progress: `-s in-progress`
706
829
  - [ ] Timer started: `knowns time start <id>`
707
830
 
@@ -714,12 +837,13 @@ EOF
714
837
 
715
838
  ### After Work
716
839
 
717
- - [ ] All acceptance criteria checked
840
+ - [ ] All acceptance criteria checked (only after work is done)
718
841
  - [ ] Implementation notes added: `--notes "..."`
719
842
  - [ ] Timer stopped: `knowns time stop`
720
843
  - [ ] Tests passing
721
844
  - [ ] Documentation updated
722
845
  - [ ] Status set to done: `-s done`
846
+ - [ ] Knowledge extracted to docs (if applicable): patterns, solutions, conventions
723
847
 
724
848
  ---
725
849
 
@@ -734,22 +858,26 @@ knowns doc "CONVENTIONS" --plain
734
858
 
735
859
  # === FULL WORKFLOW ===
736
860
  knowns task create "Title" -d "Description" --ac "Criterion"
737
- knowns task edit <id> -s in-progress -a @me
738
- knowns time start <id>
861
+ knowns task edit <id> -s in-progress -a $(knowns config get defaultAssignee --plain || echo "@me")
862
+ knowns time start <id> # ⏱️ REQUIRED: Start timer
739
863
  knowns search "keyword" --type doc --plain
740
864
  knowns doc "Doc Name" --plain
741
865
  knowns search "keyword" --type task --status done --plain # Learn from history
742
866
  knowns task edit <id> --plan $'1. Step (see @doc/file)\n2. Step'
743
867
  # ... wait for approval, then implement ...
744
- knowns task edit <id> --check-ac 1 --check-ac 2
745
- knowns task edit <id> --append-notes "✓ Completed feature"
746
- knowns time stop
868
+ # Only check AC AFTER completing the work:
869
+ knowns task edit <id> --check-ac 1
870
+ knowns task edit <id> --append-notes "✓ Completed: feature X"
871
+ knowns task edit <id> --check-ac 2
872
+ knowns task edit <id> --append-notes "✓ Completed: feature Y"
873
+ knowns time stop # ⏱️ REQUIRED: Stop timer
747
874
  knowns task edit <id> -s done
875
+ # Optional: Extract knowledge to docs if generalizable patterns found
748
876
 
749
877
  # === VIEW & SEARCH ===
750
878
  knowns task <id> --plain # Shorthand for view
751
879
  knowns task list --plain
752
- knowns task list --status in-progress --assignee @me --plain
880
+ knowns task list --status in-progress --assignee $(knowns config get defaultAssignee --plain || echo "@me") --plain
753
881
  knowns search "query" --plain
754
882
  knowns search "bug" --type task --status in-progress --plain
755
883
 
@@ -782,7 +910,3 @@ knowns doc edit "doc-name" -a "Appended content"
782
910
 
783
911
 
784
912
 
785
-
786
-
787
-
788
-
package/README.md CHANGED
@@ -98,7 +98,7 @@ knowns browser # Open Web UI
98
98
  | **Documentation** | Nested folders with markdown support |
99
99
  | **Time Tracking** | Built-in timers and reports |
100
100
  | **Context Linking** | `@task-42` and `@doc/patterns/auth` references |
101
- | **AI Integration** | MCP Server for Claude, `--plain` output |
101
+ | **AI Integration** | MCP Server, `--plain` output, guideline templates |
102
102
  | **Web UI** | Kanban board, doc browser, dark mode |
103
103
 
104
104
  ---
@@ -119,6 +119,11 @@ knowns doc "doc-name" --plain # View doc (shorthand)
119
119
  # Time & Search
120
120
  knowns time start <id> && knowns time stop
121
121
  knowns search "query" --plain
122
+
123
+ # AI Guidelines
124
+ knowns agents sync # Sync CLAUDE.md, AGENTS.md
125
+ knowns agents sync --gemini # Compact version for Gemini
126
+ knowns agents sync --type mcp # MCP tools format
122
127
  ```
123
128
 
124
129
  ---
@@ -134,6 +139,8 @@ knowns search "query" --plain
134
139
  | [MCP Integration](./docs/mcp-integration.md) | Claude Desktop setup |
135
140
  | [Configuration](./docs/configuration.md) | Project structure and options |
136
141
  | [AI Workflow](./docs/ai-workflow.md) | Guide for AI agents |
142
+ | [Developer Guide](./docs/developer-guide.md) | Technical docs for contributors |
143
+ | [Changelog](./CHANGELOG.md) | Version history |
137
144
 
138
145
  ---
139
146