agent-knowledge-cli 0.1.2__py3-none-any.whl

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.
Files changed (88) hide show
  1. agent_knowledge/__init__.py +3 -0
  2. agent_knowledge/__main__.py +3 -0
  3. agent_knowledge/assets/__init__.py +0 -0
  4. agent_knowledge/assets/claude/global.md +44 -0
  5. agent_knowledge/assets/claude/project-template.md +46 -0
  6. agent_knowledge/assets/claude/scripts/install.sh +85 -0
  7. agent_knowledge/assets/commands/doctor.md +21 -0
  8. agent_knowledge/assets/commands/global-knowledge-sync.md +27 -0
  9. agent_knowledge/assets/commands/graphify-sync.md +26 -0
  10. agent_knowledge/assets/commands/knowledge-sync.md +26 -0
  11. agent_knowledge/assets/commands/ship.md +29 -0
  12. agent_knowledge/assets/rules/generate-architecture-doc.mdc +87 -0
  13. agent_knowledge/assets/rules/history-backfill.mdc +67 -0
  14. agent_knowledge/assets/rules/memory-bootstrap.mdc +53 -0
  15. agent_knowledge/assets/rules/memory-writeback.mdc +90 -0
  16. agent_knowledge/assets/rules/shared-memory.mdc +102 -0
  17. agent_knowledge/assets/rules/workflow-orchestration.mdc +93 -0
  18. agent_knowledge/assets/rules-global/action-first.mdc +26 -0
  19. agent_knowledge/assets/rules-global/no-icons-emojis.mdc +16 -0
  20. agent_knowledge/assets/rules-global/no-unsolicited-docs.mdc +20 -0
  21. agent_knowledge/assets/scripts/bootstrap-memory-tree.sh +389 -0
  22. agent_knowledge/assets/scripts/compact-memory.sh +191 -0
  23. agent_knowledge/assets/scripts/doctor.sh +137 -0
  24. agent_knowledge/assets/scripts/global-knowledge-sync.sh +372 -0
  25. agent_knowledge/assets/scripts/graphify-sync.sh +397 -0
  26. agent_knowledge/assets/scripts/import-agent-history.sh +706 -0
  27. agent_knowledge/assets/scripts/install-project-links.sh +258 -0
  28. agent_knowledge/assets/scripts/lib/knowledge-common.sh +875 -0
  29. agent_knowledge/assets/scripts/measure-token-savings.py +540 -0
  30. agent_knowledge/assets/scripts/ship.sh +256 -0
  31. agent_knowledge/assets/scripts/update-knowledge.sh +341 -0
  32. agent_knowledge/assets/scripts/validate-knowledge.sh +265 -0
  33. agent_knowledge/assets/skills/decision-recording/SKILL.md +124 -0
  34. agent_knowledge/assets/skills/history-backfill/SKILL.md +115 -0
  35. agent_knowledge/assets/skills/memory-compaction/SKILL.md +115 -0
  36. agent_knowledge/assets/skills/memory-management/SKILL.md +134 -0
  37. agent_knowledge/assets/skills/project-ontology-bootstrap/SKILL.md +173 -0
  38. agent_knowledge/assets/skills/session-management/SKILL.md +116 -0
  39. agent_knowledge/assets/skills-cursor/create-rule/SKILL.md +164 -0
  40. agent_knowledge/assets/skills-cursor/create-skill/SKILL.md +498 -0
  41. agent_knowledge/assets/skills-cursor/create-subagent/SKILL.md +225 -0
  42. agent_knowledge/assets/skills-cursor/migrate-to-skills/SKILL.md +134 -0
  43. agent_knowledge/assets/skills-cursor/shell/SKILL.md +24 -0
  44. agent_knowledge/assets/skills-cursor/update-cursor-settings/SKILL.md +122 -0
  45. agent_knowledge/assets/templates/dashboards/project-overview.template.md +24 -0
  46. agent_knowledge/assets/templates/dashboards/session-rollup.template.md +23 -0
  47. agent_knowledge/assets/templates/hooks/hooks.json.template +11 -0
  48. agent_knowledge/assets/templates/integrations/claude/CLAUDE.md +7 -0
  49. agent_knowledge/assets/templates/integrations/codex/AGENTS.md +7 -0
  50. agent_knowledge/assets/templates/integrations/cursor/agent-knowledge.mdc +11 -0
  51. agent_knowledge/assets/templates/integrations/cursor/hooks.json +11 -0
  52. agent_knowledge/assets/templates/memory/MEMORY.root.template.md +36 -0
  53. agent_knowledge/assets/templates/memory/branch.template.md +33 -0
  54. agent_knowledge/assets/templates/memory/decision.template.md +33 -0
  55. agent_knowledge/assets/templates/memory/profile.hybrid.yaml +16 -0
  56. agent_knowledge/assets/templates/memory/profile.ml-platform.yaml +18 -0
  57. agent_knowledge/assets/templates/memory/profile.robotics.yaml +19 -0
  58. agent_knowledge/assets/templates/memory/profile.web-app.yaml +16 -0
  59. agent_knowledge/assets/templates/portfolio/.obsidian/README.md +21 -0
  60. agent_knowledge/assets/templates/portfolio/.obsidian/app.json +5 -0
  61. agent_knowledge/assets/templates/portfolio/.obsidian/core-plugins.json +7 -0
  62. agent_knowledge/assets/templates/project/.agent-project.yaml +36 -0
  63. agent_knowledge/assets/templates/project/.agentknowledgeignore +10 -0
  64. agent_knowledge/assets/templates/project/AGENTS.md +87 -0
  65. agent_knowledge/assets/templates/project/agent-knowledge/.obsidian/README.md +23 -0
  66. agent_knowledge/assets/templates/project/agent-knowledge/.obsidian/app.json +5 -0
  67. agent_knowledge/assets/templates/project/agent-knowledge/.obsidian/core-plugins.json +7 -0
  68. agent_knowledge/assets/templates/project/agent-knowledge/Evidence/README.md +34 -0
  69. agent_knowledge/assets/templates/project/agent-knowledge/Evidence/imports/README.md +29 -0
  70. agent_knowledge/assets/templates/project/agent-knowledge/Evidence/raw/README.md +25 -0
  71. agent_knowledge/assets/templates/project/agent-knowledge/Memory/MEMORY.md +37 -0
  72. agent_knowledge/assets/templates/project/agent-knowledge/Memory/decisions/decisions.md +31 -0
  73. agent_knowledge/assets/templates/project/agent-knowledge/Outputs/README.md +24 -0
  74. agent_knowledge/assets/templates/project/agent-knowledge/STATUS.md +43 -0
  75. agent_knowledge/assets/templates/project/agent-knowledge/Sessions/README.md +21 -0
  76. agent_knowledge/assets/templates/project/agent-knowledge/Templates/README.md +19 -0
  77. agent_knowledge/assets/templates/project/gitignore.agent-knowledge +13 -0
  78. agent_knowledge/cli.py +457 -0
  79. agent_knowledge/runtime/__init__.py +0 -0
  80. agent_knowledge/runtime/integrations.py +154 -0
  81. agent_knowledge/runtime/paths.py +46 -0
  82. agent_knowledge/runtime/shell.py +22 -0
  83. agent_knowledge/runtime/sync.py +255 -0
  84. agent_knowledge_cli-0.1.2.dist-info/METADATA +155 -0
  85. agent_knowledge_cli-0.1.2.dist-info/RECORD +88 -0
  86. agent_knowledge_cli-0.1.2.dist-info/WHEEL +4 -0
  87. agent_knowledge_cli-0.1.2.dist-info/entry_points.txt +2 -0
  88. agent_knowledge_cli-0.1.2.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,87 @@
1
+ # Agent Knowledge: <project-name>
2
+
3
+ This project uses **agent-knowledge** for persistent project memory.
4
+ All knowledge is accessed through `./agent-knowledge/` (symlink to external vault).
5
+
6
+ ## First-Time Onboarding
7
+
8
+ Check `./agent-knowledge/STATUS.md`. If `onboarding: pending`:
9
+
10
+ 1. Inspect project structure: manifests, package files, CI/CD config, docs
11
+ 2. Inspect project-local tool config: `.cursor/`, `.claude/`, `.codex/` if present
12
+ 3. Review recent git history (last ~50 commits, key branches)
13
+ 4. Import findings into `Evidence/raw/` using `agent-knowledge import`
14
+ 5. Infer the project ontology from the actual repo -- use the project's own
15
+ functional domains as branch names (e.g., perception, navigation, localization),
16
+ not generic categories (e.g., architecture, conventions)
17
+ 6. Create one branch note per functional domain. Each note should be focused
18
+ and under ~150 lines. Do NOT put the whole system description in one file.
19
+ 7. Link related notes to each other with relative markdown links
20
+ 8. Update `Memory/MEMORY.md` with links to all new branches
21
+ 9. Update `./agent-knowledge/STATUS.md`: set `onboarding: complete`
22
+
23
+ ## Branch Convention
24
+
25
+ Use the same-name branch-note pattern:
26
+
27
+ ```
28
+ Memory/
29
+ MEMORY.md # root -- always read first
30
+ stack.md # flat note when no subtopics needed
31
+ perception/
32
+ perception.md # entry note = same name as folder
33
+ fusion.md # subtopic note
34
+ lane-detection.md
35
+ navigation/
36
+ navigation.md
37
+ path-following.md
38
+ localization/
39
+ localization.md
40
+ decisions/
41
+ decisions.md # decision log
42
+ 2025-01-15-use-raw-sql.md # individual decision
43
+ ```
44
+
45
+ Rules:
46
+ - Each branch = one focused functional domain from the project
47
+ - Use the project's own terminology, not generic templates
48
+ - Each note stays under ~150 lines. If a topic is too big, split it.
49
+ - Link between related notes with relative markdown links (e.g.,
50
+ `See [perception](perception/perception.md) for sensor details`)
51
+ - Small topic with no subtopics: one flat note (`stack.md`)
52
+ - Bigger topic: folder + same-name entry note (`perception/perception.md`)
53
+ - Do not create deep trees automatically -- grow only when justified
54
+ - Do NOT lump unrelated subsystems into a single "architecture" note.
55
+ Split by functional domain instead.
56
+
57
+ ## Onboarding Rules
58
+
59
+ - Only write confirmed facts to `Memory/` -- never speculate
60
+ - Keep raw/extracted material in `Evidence/`, not `Memory/`
61
+ - Keep generated views in `Outputs/` -- never treat as canonical truth
62
+ - Do NOT redo onboarding if STATUS.md already shows `onboarding: complete`
63
+
64
+ ## Ongoing Maintenance
65
+
66
+ After onboarding is complete, during normal work:
67
+ - Update `Memory/` when stable facts change (decisions, conventions, gotchas)
68
+ - Record architectural decisions in `Memory/decisions/`
69
+ - Run `agent-knowledge update` after significant changes
70
+ - Keep `Evidence/` and `Outputs/` separate from `Memory/`
71
+ - Do NOT rebuild the knowledge tree every session
72
+
73
+ ## Knowledge Structure
74
+
75
+ - `Memory/` -- Curated, durable project knowledge (source of truth)
76
+ - `Evidence/` -- Imported/extracted material (not curated truth)
77
+ - `Outputs/` -- Generated helper views (never canonical)
78
+ - `Sessions/` -- Temporary session state (prune aggressively)
79
+ - `STATUS.md` -- Onboarding and maintenance state
80
+ - `.agent-project.yaml` -- Project configuration
81
+
82
+ ## Reading Order
83
+
84
+ 1. `Memory/MEMORY.md` -- always read first
85
+ 2. Relevant branch entry notes (e.g., `perception/perception.md`)
86
+ 3. Leaf notes only if the specific detail is needed
87
+ 4. Keep context lean -- do not read branches unrelated to the current task
@@ -0,0 +1,23 @@
1
+ ---
2
+ note_type: obsidian-index
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - obsidian
9
+ ---
10
+
11
+ # .obsidian
12
+
13
+ This starter setup keeps the vault markdown-first and portable.
14
+
15
+ Open either:
16
+
17
+ - the real external folder directly
18
+ - or the local repo handle at `./agent-knowledge`
19
+
20
+ Both should resolve to the same project knowledge vault.
21
+
22
+ Keep this lightweight in shared repos.
23
+ Avoid committing machine-specific workspace noise unless the team explicitly wants it.
@@ -0,0 +1,5 @@
1
+ {
2
+ "useMarkdownLinks": true,
3
+ "newLinkFormat": "relative",
4
+ "alwaysUpdateLinks": true
5
+ }
@@ -0,0 +1,7 @@
1
+ [
2
+ "file-explorer",
3
+ "search",
4
+ "backlink",
5
+ "outgoing-link",
6
+ "tag-pane"
7
+ ]
@@ -0,0 +1,34 @@
1
+ ---
2
+ note_type: evidence-index
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - evidence
9
+ ---
10
+
11
+ # Evidence
12
+
13
+ Evidence is input for judgment, not canonical truth.
14
+
15
+ ## Raw
16
+
17
+ Automatically collected snapshots from the current repo.
18
+ → [raw/README.md](raw/README.md)
19
+
20
+ ## Imports
21
+
22
+ Imported docs, tasks, sessions, traces, and other supplemental artifacts.
23
+ → [imports/README.md](imports/README.md)
24
+
25
+ ## Tooling
26
+
27
+ Optional redacted tooling imports created by the global tooling sync flow.
28
+ → `tooling/`
29
+
30
+ ## Confidence Labels
31
+
32
+ - `EXTRACTED` means directly copied or listed from a source.
33
+ - `INFERRED` means derived summary output that still requires review.
34
+ - `AMBIGUOUS` means the source may be stale, incomplete, or unreliable.
@@ -0,0 +1,29 @@
1
+ ---
2
+ note_type: evidence-imports
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - evidence
9
+ - imports
10
+ ---
11
+
12
+ # Imported Evidence
13
+
14
+ Use this branch for imported supporting material that is useful during backfill but should
15
+ not be treated as canonical truth on its own.
16
+
17
+ Expected files include:
18
+
19
+ - `existing-docs.txt`
20
+ - `doc-index.txt`
21
+ - `tasks.txt`
22
+ - `session-files.txt`
23
+ - `cursor-sessions.txt`
24
+ - `trace-index.txt`
25
+ - `structural-summary.md`
26
+ - `graphify/` (optional)
27
+
28
+ Imported or generated evidence may include adjacent `.meta.json` files with source,
29
+ kind, confidence, generated_at, related_paths, and notes.
@@ -0,0 +1,25 @@
1
+ ---
2
+ note_type: evidence-raw
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - evidence
9
+ - raw
10
+ ---
11
+
12
+ # Raw Evidence
13
+
14
+ Use this branch for direct snapshots collected from the current codebase and repo state.
15
+
16
+ Expected files include:
17
+
18
+ - `git-log.txt`
19
+ - `git-log-detail.txt`
20
+ - `git-authors.txt`
21
+ - `structure.txt`
22
+ - `manifests.txt`
23
+ - `config-files.txt`
24
+ - `tests.txt`
25
+ - `ci-workflows.txt`
@@ -0,0 +1,37 @@
1
+ ---
2
+ note_type: durable-memory-root
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - memory
9
+ ---
10
+
11
+ # Memory: <project-name>
12
+
13
+ ## Purpose
14
+
15
+ Landing page for curated project memory. Keep this file short and use it to route into
16
+ the right branch notes.
17
+
18
+ ## Current State
19
+
20
+ - Project memory has been initialized but not yet populated.
21
+ - The agent should inspect the repo and create initial branch notes.
22
+
23
+ ## Recent Changes
24
+
25
+ - <date> - Created durable memory root.
26
+
27
+ ## Decisions
28
+
29
+ - [decisions/decisions.md](decisions/decisions.md) - Decision log.
30
+
31
+ ## Open Questions
32
+
33
+ - Which areas of the project should become the first memory branches?
34
+
35
+ ## Branches
36
+
37
+ - Add branch links here as the agent infers project structure.
@@ -0,0 +1,31 @@
1
+ ---
2
+ note_type: decision-log
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - decision
9
+ ---
10
+
11
+ # Decisions
12
+
13
+ ## Purpose
14
+
15
+ Architectural and process decisions that affect this project.
16
+
17
+ ## Current State
18
+
19
+ - No decisions recorded yet.
20
+
21
+ ## Recent Changes
22
+
23
+ - <date> - Created decision log.
24
+
25
+ ## Decisions
26
+
27
+ - None recorded yet.
28
+
29
+ ## Open Questions
30
+
31
+ - Which existing choices should be captured as explicit decisions?
@@ -0,0 +1,24 @@
1
+ ---
2
+ note_type: outputs-index
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - outputs
9
+ ---
10
+
11
+ # Outputs
12
+
13
+ Use this branch for generated outputs that are useful to keep near project memory.
14
+ Outputs are orientation artifacts first, not durable canonical memory.
15
+
16
+ Examples:
17
+
18
+ - release handoff notes
19
+ - generated summaries kept alongside project knowledge
20
+ - ad hoc reports
21
+ - `architecture-summary.md`
22
+ - `structural-map.md`
23
+ - `graphify/` summaries
24
+ - `token-measurements/` reports and task-run logs
@@ -0,0 +1,43 @@
1
+ ---
2
+ note_type: knowledge-status
3
+ project: <project-name>
4
+ profile_hint: <profile-type>
5
+ ontology_model: 2
6
+ real_knowledge_path: <absolute-path-to-dedicated-knowledge-folder>
7
+ local_pointer_path: ./agent-knowledge
8
+ last_bootstrap:
9
+ onboarding: pending
10
+ last_backfill_import:
11
+ last_project_sync:
12
+ last_global_sync:
13
+ last_graph_sync:
14
+ last_compaction:
15
+ last_validation:
16
+ last_validation_result: unknown
17
+ last_doctor:
18
+ last_doctor_result: unknown
19
+ ---
20
+
21
+ # Knowledge Status: <project-name>
22
+
23
+ ## Current State
24
+
25
+ - Profile hint: `<profile-type>`
26
+ - Real knowledge path: `<absolute-path-to-dedicated-knowledge-folder>`
27
+ - Local pointer path: `./agent-knowledge`
28
+ - Onboarding: `pending`
29
+
30
+ ## Activity
31
+
32
+ - Last bootstrap: `not-yet`
33
+ - Last backfill/import: `not-yet`
34
+ - Last project sync: `not-yet`
35
+ - Last global sync: `not-yet`
36
+ - Last graph sync: `not-yet`
37
+ - Last compaction: `not-yet`
38
+ - Last validation: `not-yet` (`unknown`)
39
+ - Last doctor: `not-yet` (`unknown`)
40
+
41
+ ## Health Warnings
42
+
43
+ - None.
@@ -0,0 +1,21 @@
1
+ ---
2
+ note_type: session-index
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - sessions
9
+ ---
10
+
11
+ # Sessions
12
+
13
+ Session notes are ephemeral and milestone-oriented.
14
+
15
+ Use this branch for:
16
+
17
+ - current milestones
18
+ - blockers
19
+ - handoff notes between active sessions
20
+
21
+ Do not treat this branch as durable memory.
@@ -0,0 +1,19 @@
1
+ ---
2
+ note_type: template-index
3
+ project: <project-name>
4
+ status: active
5
+ last_updated: <date>
6
+ tags:
7
+ - agent-knowledge
8
+ - templates
9
+ ---
10
+
11
+ # Templates
12
+
13
+ Use this branch for project-local note templates when the framework templates are not enough.
14
+
15
+ Start from the framework repo first:
16
+
17
+ - `templates/memory/`
18
+ - `templates/dashboards/`
19
+ - `templates/project/`
@@ -0,0 +1,13 @@
1
+ # Recommended ignores for connected projects using a dedicated knowledge folder.
2
+ # Keep or remove the local pointer based on your repo policy.
3
+
4
+ # If agent-knowledge is a symlink, many teams keep the pointer tracked.
5
+ # If you prefer it untracked, uncomment the next line.
6
+ # agent-knowledge/
7
+
8
+ # Usually ignore noisy generated or transient knowledge branches.
9
+ agent-knowledge/Evidence/
10
+ agent-knowledge/Sessions/
11
+ agent-knowledge/Outputs/
12
+ agent-knowledge/.obsidian/workspace*.json
13
+ agent-knowledge/.obsidian/cache/