wikifier 4.1.2__tar.gz → 4.1.4__tar.gz

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 (51) hide show
  1. wikifier-4.1.4/PKG-INFO +171 -0
  2. wikifier-4.1.4/README.md +139 -0
  3. {wikifier-4.1.2 → wikifier-4.1.4}/index.html +81 -13
  4. {wikifier-4.1.2 → wikifier-4.1.4}/pyproject.toml +5 -3
  5. {wikifier-4.1.2 → wikifier-4.1.4}/skills/run.md +1 -1
  6. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/__init__.py +1 -1
  7. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/cli.py +4 -2
  8. wikifier-4.1.4/wikifier.egg-info/PKG-INFO +171 -0
  9. wikifier-4.1.2/PKG-INFO +0 -423
  10. wikifier-4.1.2/README.md +0 -391
  11. wikifier-4.1.2/wikifier.egg-info/PKG-INFO +0 -423
  12. {wikifier-4.1.2 → wikifier-4.1.4}/CONTRIBUTING.md +0 -0
  13. {wikifier-4.1.2 → wikifier-4.1.4}/LICENSE +0 -0
  14. {wikifier-4.1.2 → wikifier-4.1.4}/MANIFEST.in +0 -0
  15. {wikifier-4.1.2 → wikifier-4.1.4}/diagnostics.html +0 -0
  16. {wikifier-4.1.2 → wikifier-4.1.4}/docs/Basis-v0.3.md +0 -0
  17. {wikifier-4.1.2 → wikifier-4.1.4}/docs/RELEASE_NOTES.md +0 -0
  18. {wikifier-4.1.2 → wikifier-4.1.4}/docs/TRADEOFFS.md +0 -0
  19. {wikifier-4.1.2 → wikifier-4.1.4}/docs/spec.md +0 -0
  20. {wikifier-4.1.2 → wikifier-4.1.4}/docs/v0.4-Execution-Plan.md +0 -0
  21. {wikifier-4.1.2 → wikifier-4.1.4}/docs/v0.4-execution-plan.md +0 -0
  22. {wikifier-4.1.2 → wikifier-4.1.4}/setup.cfg +0 -0
  23. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/__main__.py +0 -0
  24. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/contracts.py +0 -0
  25. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/daemon.py +0 -0
  26. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/diagnostics.py +0 -0
  27. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/gap1_validation_harness.py +0 -0
  28. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/health.py +0 -0
  29. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/import_cache.py +0 -0
  30. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/locking.py +0 -0
  31. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/mcp/__init__.py +0 -0
  32. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/mcp/server.py +0 -0
  33. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/parsers/__init__.py +0 -0
  34. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/parsers/bree.py +0 -0
  35. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/parsers/cdia.py +0 -0
  36. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/parsers/javascript.py +0 -0
  37. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/parsers/python.py +0 -0
  38. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/resolution.py +0 -0
  39. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/exclude_patterns.txt +0 -0
  40. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/file_health.md +0 -0
  41. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/library.md +0 -0
  42. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/monitored_paths.txt +0 -0
  43. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/pending_updates.md +0 -0
  44. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/wikifier.bat +0 -0
  45. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/wikifier.ps1 +0 -0
  46. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier/scripts/wikifier.sh +0 -0
  47. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier.egg-info/SOURCES.txt +0 -0
  48. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier.egg-info/dependency_links.txt +0 -0
  49. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier.egg-info/entry_points.txt +0 -0
  50. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier.egg-info/requires.txt +0 -0
  51. {wikifier-4.1.2 → wikifier-4.1.4}/wikifier.egg-info/top_level.txt +0 -0
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: wikifier
3
+ Version: 4.1.4
4
+ Summary: Zero-dependency agent-to-agent codebase wiki for LLMs and AI agents. Autonomously maintained via record-change and mark-green for token-efficient lookup of files, dependencies, health, and summaries — across tiny scripts to 50k+ monorepos. Optional MCP server with rich tools for agents.
5
+ Author-email: Aron Amos <aron@example.com>
6
+ Maintainer: Aron Amos
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/IronAdamant/wikifier
9
+ Project-URL: Repository, https://github.com/IronAdamant/wikifier
10
+ Project-URL: Documentation, https://github.com/IronAdamant/wikifier#readme
11
+ Project-URL: Bug Tracker, https://github.com/IronAdamant/wikifier/issues
12
+ Keywords: wiki,documentation,llm,agent,mcp,codebase,health-matrix,zero-dependency,shell,token-efficient,autonomous,record-change,mark-green,agent-wiki,llm-tools,dependency-graph,monorepo
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Operating System :: OS Independent
23
+ Classifier: Topic :: Software Development :: Documentation
24
+ Classifier: Topic :: Software Development :: Version Control
25
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Provides-Extra: mcp
30
+ Requires-Dist: mcp>=1.0.0; extra == "mcp"
31
+ Dynamic: license-file
32
+
33
+ # Wikifier
34
+
35
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
36
+ [![PyPI version](https://img.shields.io/pypi/v/wikifier.svg)](https://pypi.org/project/wikifier/)
37
+ [![GitHub Stars](https://img.shields.io/github/stars/IronAdamant/wikifier?style=social)](https://github.com/IronAdamant/wikifier/stargazers)
38
+
39
+ **Agent-to-Agent Codebase Wiki — Token-Efficient • Autonomous • Zero-Dependency**
40
+
41
+ Wikifier gives AI agents and LLMs a living, queryable map of any codebase — from tiny scripts to 50k+ file monorepos — so they can look up files, imports, health status, and summaries without dumping full source into context.
42
+
43
+ The goal is token efficiency. It works as a token-saving agent-operated wiki layer that agents maintain themselves through a strict but lightweight workflow. Primary purpose: help LLMs and agents work on real codebases without wasting context on raw files they don't need right now.
44
+
45
+ Key capabilities flow naturally from this:
46
+ - Fast, targeted lookup through small `file_health.md`, `library.md` (with Mermaid dependency graphs and summaries), per-file `*.wiki.md` notes, health matrix, barrel reports, and incremental status.
47
+ - Autonomous maintenance: after editing source, agents use `record-change "the why"` (this is mandatory) to log intent, then `mark-green` once the wiki entry is updated.
48
+ - Support for creating new wiki entries or docs on the fly during agent work.
49
+ - Works great with or without MCP. There's an optional `wikifier-mcp` server that provides rich tools such as `get_project_status`, `get_dependencies`, `get_file_wiki`, `suggest_next_actions`, and `check_changes`.
50
+ - Handles large projects well thanks to incremental updates, directory scoping, and streaming modes. Everything is zero-dependency (pure Python + Bash).
51
+
52
+ **Mandatory agent protocol** (the exact loop agents should follow): `check-changes` → read the compact `file_health.md` + `pending_updates.md` → prioritize → edit → `record-change` → `mark-green` → `update-maps` when imports or structure change. The full LLM-ready details and examples live in `skills/run.md` (v0.5).
53
+
54
+ This entire project (including all the M5 dogfood evidence) was built and operated by agents using exactly this mode. It is deliberately **not** a general-purpose human documentation tool or IDE replacement — agent-to-agent first, always.
55
+
56
+ See `--help`, `skills/run.md`, and the MCP README for concrete usage.
57
+
58
+ ### Intended Use: Strictly Agent-to-Agent (Token-Saving)
59
+
60
+ This is meant **strictly** as an agent-to-agent wiki layer for token saving:
61
+
62
+ - Primary purpose: save tokens for agents/LLMs by letting them consult the health matrix, file wikis, barrels, and incremental status instead of re-reading full sources.
63
+ - Agents autonomously keep everything current: edit source → `record-change "the why"` → update the corresponding wiki entry → `mark-green`.
64
+ - You can create new wiki-maintained files or docs as part of your agent sessions.
65
+ - Typical workflow: run `wikifier check-changes`, read the small `file_health.md` + `pending_updates.md`, prioritize (🔴 then 🟡), do the work, record the change with intent, mark it green, and run `update-maps` when the dependency picture shifts.
66
+ - **It shouldn't be used for anything more than that.** Not general human docs, not an IDE, not for broad non-agent use.
67
+
68
+ The exact loop and LLM workflow are documented in `--help` and `skills/run.md`. All the real-world M5+ evidence in `Findings/` was produced by agents following this protocol precisely.
69
+
70
+ ### Status & Recent Changes
71
+
72
+ M5 broad real-world dogfood (85-90%+) on multiple external 5k–50k+ creative projects is complete. See `Findings/M5-Dogfood-Progress.md`, `M5-Dogfood-Assessment-Report.md`, and `p6_real_world_validation_report.md` for full agent diaries, metrics, 9 Guiding Principles traces, and the M5.3 plan.
73
+
74
+ Recent focus (v4.1.x):
75
+ - Human investigation layer separation (only the clean `index.html` viewer is deployed to targets; `diagnostics.html` is maintainer-only).
76
+ - Mapping & update speed hygiene (faster candidate collection with scandir + git fast-path, consistent excludes, parser micro-opts).
77
+ - Human dashboard UX: prominent Quick actions toolbar with copy-to-clipboard buttons for main commands (check-changes, update-maps, monitor &); big primary buttons in empty states for first-time setup; auto-copy of `wikifier update-maps` command on first render of "no structure map yet" (session-guarded) so it feels automatic on first run of a fresh project.
78
+ - mcp and skills docs sync: updated the human layer descriptions in `skills/run.md` and `wikifier/mcp/README.md` (and cli.py comment) to accurately reflect the new dashboard command buttons, empty-state CTAs, and first-run auto-copy behavior. See v4.1.4 notes.
79
+
80
+ Full history moved to `docs/` and `Findings/`. The project stays deliberately lean and agent-first.
81
+
82
+ **v4.1.4 (2026-06)**: mcp and skills docs sync for latest human dashboard UX (very minor polish; no behaviour change).
83
+ - Updated "Human investigation layer" section in `skills/run.md` and "Human layer in MCP projects" in `wikifier/mcp/README.md` to describe the Quick actions toolbar, prominent first-time command buttons in empty states, and session-guarded auto-copy of update-maps on first no-map render.
84
+ - Minor update to cli.py comment on copy_human_dashboards for accuracy.
85
+ - Ensures docs accurately describe what humans see in the secondary viewer after init, without altering agent protocol, MCP tools, or core behavior.
86
+ - All under FRESH + record+mark-green (subid=human-dashboard-commands). Complements the v4.1.3 dashboard template changes.
87
+
88
+ **v4.1.3 (2026-06)**: Human dashboard command buttons + first-run update-maps UX (very minor polish to the secondary human investigation layer).
89
+ - Added visible "Quick actions" bar with easy one-click copy buttons for the primary commands available to humans using the dashboard (check-changes, update-maps, start monitor). Feedback includes exact pasteable command + "run in this project folder then Refresh" guidance + manual refresh link.
90
+ - Enhanced empty states ("No structure map yet", "No files yet") with prominent primary buttons for the relevant commands (update-maps prioritized, combined first-time setup for files).
91
+ - "Automatically on first run": when the no-map empty state first appears in a browser session, the `wikifier update-maps` command is auto-copied (guarded by sessionStorage) with a note, making the recommended first action feel automatic. Buttons + instructions guide the user to run in terminal and refresh/poll.
92
+ - Existing "Rebuild tree" / "Update data" buttons now use the improved copy+feedback UX. Keeps the clean human view (no dense agent internals).
93
+ - All under protocol (FRESH, record+mark-green with subid=human-dashboard-commands). No new features or scope change. Complements the existing copy snapshot buttons and guidance.
94
+
95
+ **v4.1.2 (2026-06)**: Speed improvements for updates on large projects (scandir/git fast-path in collectors, richer early pruning via `exclude_patterns.txt`, regex hoisting in parsers). Complements scoping, streaming budgets, and incremental dirty + barrel reverse index. No behaviour change.
96
+
97
+ **v4.1.1**: Human layer separation enforcement (only `index.html` copied on init).
98
+
99
+ **v4.1.0**: Structure cleanup (historical docs to `docs/`).
100
+
101
+ **v4.0 + 4.0.1 + M5**: Broad dogfood, MCP hardening, zero-dep enforcement, sustained monitor/subagent foundations. See `Findings/` for details.
102
+
103
+ ---
104
+
105
+ ## 🚀 Installation
106
+
107
+ ## Installation & Quick Start (for Agents & Humans)
108
+
109
+ ```bash
110
+ pip install wikifier
111
+ ```
112
+
113
+ For a project (recommended for agents):
114
+
115
+ ```bash
116
+ # 1. In the target project (or use WIKIFIER_PROJECT_ROOT)
117
+ wikifier init
118
+
119
+ # 2. Focus monitored_paths.txt for large repos (highly recommended)
120
+ # 3. Run the agent loop
121
+ wikifier check-changes
122
+ wikifier health --summary
123
+ # ... edit ...
124
+ wikifier record-change "path/to/file.py" "added feature X because Y (agent task Z)"
125
+ wikifier mark-green "path/to/file.py"
126
+ wikifier update-maps # when imports/structure changed
127
+ ```
128
+
129
+ **For MCP / AI agents** (Claude Desktop, Cursor, Cline, etc.):
130
+
131
+ ```bash
132
+ WIKIFIER_PROJECT_ROOT=/abs/path/to/your/project wikifier-mcp
133
+ ```
134
+
135
+ Or pass `project_root=` on every tool call. Root detection priority: env var > explicit param > upward walk for markers > .mcp.json.
136
+
137
+ Full protocol, examples, and LLM workflow: `skills/run.md` (read this first as an agent).
138
+
139
+ ## What You Get
140
+
141
+ - Token-efficient lookup for agents (health matrix, library.md with Mermaid, file wikis, BRC, incremental status).
142
+ - Autonomous maintenance: `record-change` (the "why") + `mark-green`.
143
+ - Incremental + scoped + resumable for large codebases.
144
+ - Optional MCP server with 23+ tools for agents.
145
+ - Secondary clean `index.html` dashboard (after init) for humans browsing the agent's wiki (chart + file descriptions + copyable snapshots).
146
+ - True zero dependencies.
147
+
148
+ See `skills/run.md` for the exact agent contract and `wikifier/mcp/README.md` for MCP setup.
149
+
150
+ ## Core Commands
151
+
152
+ | Command | Purpose |
153
+ |---------|---------|
154
+ | `wikifier check-changes` | Incremental scan + health/pending update |
155
+ | `wikifier record-change <file> "reason"` | Log why (required after edits) |
156
+ | `wikifier mark-green <file>` | Mark the wiki entry current |
157
+ | `wikifier update-maps` | Rebuild dependency graph + library.md |
158
+ | `wikifier health --summary` | Quick view (use for agents) |
159
+ | `wikifier monitor &` | Background incremental heartbeat |
160
+
161
+ For full power use the Python library (`from wikifier import ...`) or MCP tools directly.
162
+
163
+ ## Links
164
+
165
+ - GitHub: https://github.com/IronAdamant/wikifier
166
+ - PyPI: https://pypi.org/project/wikifier/
167
+ - Agent Protocol: `skills/run.md`
168
+ - MCP: `wikifier/mcp/README.md`
169
+ - Evidence: `Findings/` (M5 dogfood etc.)
170
+
171
+ **For AI search / agents**: Wikifier is a zero-dependency, agent-maintained, token-saving codebase wiki with autonomous `record-change` / `mark-green` updates, MCP tools, and strong support for large monorepos via scoping and streaming.
@@ -0,0 +1,139 @@
1
+ # Wikifier
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![PyPI version](https://img.shields.io/pypi/v/wikifier.svg)](https://pypi.org/project/wikifier/)
5
+ [![GitHub Stars](https://img.shields.io/github/stars/IronAdamant/wikifier?style=social)](https://github.com/IronAdamant/wikifier/stargazers)
6
+
7
+ **Agent-to-Agent Codebase Wiki — Token-Efficient • Autonomous • Zero-Dependency**
8
+
9
+ Wikifier gives AI agents and LLMs a living, queryable map of any codebase — from tiny scripts to 50k+ file monorepos — so they can look up files, imports, health status, and summaries without dumping full source into context.
10
+
11
+ The goal is token efficiency. It works as a token-saving agent-operated wiki layer that agents maintain themselves through a strict but lightweight workflow. Primary purpose: help LLMs and agents work on real codebases without wasting context on raw files they don't need right now.
12
+
13
+ Key capabilities flow naturally from this:
14
+ - Fast, targeted lookup through small `file_health.md`, `library.md` (with Mermaid dependency graphs and summaries), per-file `*.wiki.md` notes, health matrix, barrel reports, and incremental status.
15
+ - Autonomous maintenance: after editing source, agents use `record-change "the why"` (this is mandatory) to log intent, then `mark-green` once the wiki entry is updated.
16
+ - Support for creating new wiki entries or docs on the fly during agent work.
17
+ - Works great with or without MCP. There's an optional `wikifier-mcp` server that provides rich tools such as `get_project_status`, `get_dependencies`, `get_file_wiki`, `suggest_next_actions`, and `check_changes`.
18
+ - Handles large projects well thanks to incremental updates, directory scoping, and streaming modes. Everything is zero-dependency (pure Python + Bash).
19
+
20
+ **Mandatory agent protocol** (the exact loop agents should follow): `check-changes` → read the compact `file_health.md` + `pending_updates.md` → prioritize → edit → `record-change` → `mark-green` → `update-maps` when imports or structure change. The full LLM-ready details and examples live in `skills/run.md` (v0.5).
21
+
22
+ This entire project (including all the M5 dogfood evidence) was built and operated by agents using exactly this mode. It is deliberately **not** a general-purpose human documentation tool or IDE replacement — agent-to-agent first, always.
23
+
24
+ See `--help`, `skills/run.md`, and the MCP README for concrete usage.
25
+
26
+ ### Intended Use: Strictly Agent-to-Agent (Token-Saving)
27
+
28
+ This is meant **strictly** as an agent-to-agent wiki layer for token saving:
29
+
30
+ - Primary purpose: save tokens for agents/LLMs by letting them consult the health matrix, file wikis, barrels, and incremental status instead of re-reading full sources.
31
+ - Agents autonomously keep everything current: edit source → `record-change "the why"` → update the corresponding wiki entry → `mark-green`.
32
+ - You can create new wiki-maintained files or docs as part of your agent sessions.
33
+ - Typical workflow: run `wikifier check-changes`, read the small `file_health.md` + `pending_updates.md`, prioritize (🔴 then 🟡), do the work, record the change with intent, mark it green, and run `update-maps` when the dependency picture shifts.
34
+ - **It shouldn't be used for anything more than that.** Not general human docs, not an IDE, not for broad non-agent use.
35
+
36
+ The exact loop and LLM workflow are documented in `--help` and `skills/run.md`. All the real-world M5+ evidence in `Findings/` was produced by agents following this protocol precisely.
37
+
38
+ ### Status & Recent Changes
39
+
40
+ M5 broad real-world dogfood (85-90%+) on multiple external 5k–50k+ creative projects is complete. See `Findings/M5-Dogfood-Progress.md`, `M5-Dogfood-Assessment-Report.md`, and `p6_real_world_validation_report.md` for full agent diaries, metrics, 9 Guiding Principles traces, and the M5.3 plan.
41
+
42
+ Recent focus (v4.1.x):
43
+ - Human investigation layer separation (only the clean `index.html` viewer is deployed to targets; `diagnostics.html` is maintainer-only).
44
+ - Mapping & update speed hygiene (faster candidate collection with scandir + git fast-path, consistent excludes, parser micro-opts).
45
+ - Human dashboard UX: prominent Quick actions toolbar with copy-to-clipboard buttons for main commands (check-changes, update-maps, monitor &); big primary buttons in empty states for first-time setup; auto-copy of `wikifier update-maps` command on first render of "no structure map yet" (session-guarded) so it feels automatic on first run of a fresh project.
46
+ - mcp and skills docs sync: updated the human layer descriptions in `skills/run.md` and `wikifier/mcp/README.md` (and cli.py comment) to accurately reflect the new dashboard command buttons, empty-state CTAs, and first-run auto-copy behavior. See v4.1.4 notes.
47
+
48
+ Full history moved to `docs/` and `Findings/`. The project stays deliberately lean and agent-first.
49
+
50
+ **v4.1.4 (2026-06)**: mcp and skills docs sync for latest human dashboard UX (very minor polish; no behaviour change).
51
+ - Updated "Human investigation layer" section in `skills/run.md` and "Human layer in MCP projects" in `wikifier/mcp/README.md` to describe the Quick actions toolbar, prominent first-time command buttons in empty states, and session-guarded auto-copy of update-maps on first no-map render.
52
+ - Minor update to cli.py comment on copy_human_dashboards for accuracy.
53
+ - Ensures docs accurately describe what humans see in the secondary viewer after init, without altering agent protocol, MCP tools, or core behavior.
54
+ - All under FRESH + record+mark-green (subid=human-dashboard-commands). Complements the v4.1.3 dashboard template changes.
55
+
56
+ **v4.1.3 (2026-06)**: Human dashboard command buttons + first-run update-maps UX (very minor polish to the secondary human investigation layer).
57
+ - Added visible "Quick actions" bar with easy one-click copy buttons for the primary commands available to humans using the dashboard (check-changes, update-maps, start monitor). Feedback includes exact pasteable command + "run in this project folder then Refresh" guidance + manual refresh link.
58
+ - Enhanced empty states ("No structure map yet", "No files yet") with prominent primary buttons for the relevant commands (update-maps prioritized, combined first-time setup for files).
59
+ - "Automatically on first run": when the no-map empty state first appears in a browser session, the `wikifier update-maps` command is auto-copied (guarded by sessionStorage) with a note, making the recommended first action feel automatic. Buttons + instructions guide the user to run in terminal and refresh/poll.
60
+ - Existing "Rebuild tree" / "Update data" buttons now use the improved copy+feedback UX. Keeps the clean human view (no dense agent internals).
61
+ - All under protocol (FRESH, record+mark-green with subid=human-dashboard-commands). No new features or scope change. Complements the existing copy snapshot buttons and guidance.
62
+
63
+ **v4.1.2 (2026-06)**: Speed improvements for updates on large projects (scandir/git fast-path in collectors, richer early pruning via `exclude_patterns.txt`, regex hoisting in parsers). Complements scoping, streaming budgets, and incremental dirty + barrel reverse index. No behaviour change.
64
+
65
+ **v4.1.1**: Human layer separation enforcement (only `index.html` copied on init).
66
+
67
+ **v4.1.0**: Structure cleanup (historical docs to `docs/`).
68
+
69
+ **v4.0 + 4.0.1 + M5**: Broad dogfood, MCP hardening, zero-dep enforcement, sustained monitor/subagent foundations. See `Findings/` for details.
70
+
71
+ ---
72
+
73
+ ## 🚀 Installation
74
+
75
+ ## Installation & Quick Start (for Agents & Humans)
76
+
77
+ ```bash
78
+ pip install wikifier
79
+ ```
80
+
81
+ For a project (recommended for agents):
82
+
83
+ ```bash
84
+ # 1. In the target project (or use WIKIFIER_PROJECT_ROOT)
85
+ wikifier init
86
+
87
+ # 2. Focus monitored_paths.txt for large repos (highly recommended)
88
+ # 3. Run the agent loop
89
+ wikifier check-changes
90
+ wikifier health --summary
91
+ # ... edit ...
92
+ wikifier record-change "path/to/file.py" "added feature X because Y (agent task Z)"
93
+ wikifier mark-green "path/to/file.py"
94
+ wikifier update-maps # when imports/structure changed
95
+ ```
96
+
97
+ **For MCP / AI agents** (Claude Desktop, Cursor, Cline, etc.):
98
+
99
+ ```bash
100
+ WIKIFIER_PROJECT_ROOT=/abs/path/to/your/project wikifier-mcp
101
+ ```
102
+
103
+ Or pass `project_root=` on every tool call. Root detection priority: env var > explicit param > upward walk for markers > .mcp.json.
104
+
105
+ Full protocol, examples, and LLM workflow: `skills/run.md` (read this first as an agent).
106
+
107
+ ## What You Get
108
+
109
+ - Token-efficient lookup for agents (health matrix, library.md with Mermaid, file wikis, BRC, incremental status).
110
+ - Autonomous maintenance: `record-change` (the "why") + `mark-green`.
111
+ - Incremental + scoped + resumable for large codebases.
112
+ - Optional MCP server with 23+ tools for agents.
113
+ - Secondary clean `index.html` dashboard (after init) for humans browsing the agent's wiki (chart + file descriptions + copyable snapshots).
114
+ - True zero dependencies.
115
+
116
+ See `skills/run.md` for the exact agent contract and `wikifier/mcp/README.md` for MCP setup.
117
+
118
+ ## Core Commands
119
+
120
+ | Command | Purpose |
121
+ |---------|---------|
122
+ | `wikifier check-changes` | Incremental scan + health/pending update |
123
+ | `wikifier record-change <file> "reason"` | Log why (required after edits) |
124
+ | `wikifier mark-green <file>` | Mark the wiki entry current |
125
+ | `wikifier update-maps` | Rebuild dependency graph + library.md |
126
+ | `wikifier health --summary` | Quick view (use for agents) |
127
+ | `wikifier monitor &` | Background incremental heartbeat |
128
+
129
+ For full power use the Python library (`from wikifier import ...`) or MCP tools directly.
130
+
131
+ ## Links
132
+
133
+ - GitHub: https://github.com/IronAdamant/wikifier
134
+ - PyPI: https://pypi.org/project/wikifier/
135
+ - Agent Protocol: `skills/run.md`
136
+ - MCP: `wikifier/mcp/README.md`
137
+ - Evidence: `Findings/` (M5 dogfood etc.)
138
+
139
+ **For AI search / agents**: Wikifier is a zero-dependency, agent-maintained, token-saving codebase wiki with autonomous `record-change` / `mark-green` updates, MCP tools, and strong support for large monorepos via scoping and streaming.
@@ -125,6 +125,25 @@
125
125
  </div>
126
126
  </div>
127
127
 
128
+ <!-- Quick actions: buttons for the main commands (copy to clipboard so user can run in terminal) -->
129
+ <div class="mb-4 px-1">
130
+ <div class="text-[10px] text-slate-400 mb-1">Quick actions — click to copy the command, paste &amp; run in your terminal (this folder), then refresh the page</div>
131
+ <div class="flex flex-wrap gap-2">
132
+ <button onclick="copyCommandForRun('check-changes')"
133
+ class="px-3 py-1.5 text-sm rounded-xl bg-slate-800 hover:bg-slate-700 border border-slate-700 flex items-center gap-x-2">
134
+ <span>Check for changes</span>
135
+ </button>
136
+ <button onclick="copyCommandForRun('update-maps')"
137
+ class="px-3 py-1.5 text-sm rounded-xl bg-emerald-800 hover:bg-emerald-700 border border-emerald-700 text-emerald-300 flex items-center gap-x-2">
138
+ <span>Rebuild structure map</span>
139
+ </button>
140
+ <button onclick="copyCommandForRun('monitor &amp;')"
141
+ class="px-3 py-1.5 text-sm rounded-xl bg-slate-800 hover:bg-slate-700 border border-slate-700 flex items-center gap-x-2">
142
+ <span>Start background monitor</span>
143
+ </button>
144
+ </div>
145
+ </div>
146
+
128
147
  <!-- HERO: The Chart / Tree (what humans see first and clearly) -->
129
148
  <div class="mb-8 bg-slate-900 border border-slate-800 rounded-3xl p-6">
130
149
  <div class="flex items-center justify-between mb-3">
@@ -341,7 +360,13 @@
341
360
  if (!rows || rows.length === 0) {
342
361
  listEl.innerHTML = `<div class="px-5 py-8 text-center">
343
362
  <div class="text-sm text-slate-400">No files in the wiki yet.</div>
344
- <div class="text-xs mt-2 text-slate-500">Run <code class="bg-slate-900 px-1">wikifier check-changes &amp;&amp; wikifier update-maps</code> in this project folder, then refresh.</div>
363
+ <div class="mt-3">
364
+ <button onclick="copyCommandForRun('check-changes &amp;&amp; update-maps', 'wikifier check-changes &amp;&amp; wikifier update-maps')"
365
+ class="px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-sm font-medium">
366
+ 📋 Copy first-time setup command
367
+ </button>
368
+ </div>
369
+ <div class="mt-2 text-xs text-slate-500">Run <code class="bg-slate-900 px-1">wikifier check-changes &amp;&amp; wikifier update-maps</code> in this project folder, then refresh.</div>
345
370
  </div>`;
346
371
  return;
347
372
  }
@@ -524,10 +549,30 @@
524
549
  container.innerHTML = `<div class="text-sm p-4 bg-slate-900 border border-slate-700 rounded">
525
550
  <div class="font-semibold mb-1">No structure map yet</div>
526
551
  <div class="text-slate-400">This project hasn't had its import/dependency tree generated yet.</div>
527
- <div class="mt-2 text-xs">Run this in the project folder:</div>
528
- <code class="block mt-1 p-2 bg-slate-950 rounded text-emerald-300">wikifier update-maps</code>
529
- <div class="mt-1 text-[10px] text-slate-500">Then refresh this page. The chart will show your codebase structure.</div>
552
+ <div class="mt-3">
553
+ <button onclick="copyCommandForRun('update-maps')"
554
+ class="px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-sm font-medium w-full sm:w-auto">
555
+ 📋 Copy command &amp; run wikifier update-maps (first time)
556
+ </button>
557
+ </div>
558
+ <div class="mt-2 text-[10px] text-slate-400">Run the copied command in your terminal <strong>inside this project folder</strong>, then refresh this page (or wait for the ~30s auto update). This is the recommended first step when you open the dashboard in a new project.</div>
530
559
  </div>`;
560
+
561
+ // "Automatically on the first run": if this is the very first time the user sees the empty map state in this browser session,
562
+ // auto-copy the command for them so it feels automatic, with clear feedback.
563
+ if (!sessionStorage.getItem('wikifier_first_map_auto_copied')) {
564
+ sessionStorage.setItem('wikifier_first_map_auto_copied', '1');
565
+ setTimeout(() => {
566
+ navigator.clipboard.writeText('wikifier update-maps').then(() => {
567
+ // non-intrusive note that we helped
568
+ const note = document.createElement('div');
569
+ note.className = 'mt-2 text-[10px] text-emerald-400';
570
+ note.textContent = '✓ update-maps command auto-copied for first run — paste it in your terminal now.';
571
+ const emptyBox = container.querySelector('div');
572
+ if (emptyBox) emptyBox.appendChild(note);
573
+ }).catch(() => {});
574
+ }, 300);
575
+ }
531
576
  return;
532
577
  }
533
578
  window.libraryMdCache = md;
@@ -611,16 +656,39 @@ Open index.html in the project for the live visual version.
611
656
  // Agents and technical users: use the .md files directly, diagnostics.html, MCP, or CLI.)
612
657
 
613
658
  // Lightweight runCommand for the human dashboard (only the two we surface prominently)
659
+ // Helper to copy a ready-to-paste command and give clear next-step feedback
660
+ function copyCommandForRun(cmd, fullText) {
661
+ const full = fullText || `wikifier ${cmd}`;
662
+ navigator.clipboard.writeText(full).then(() => {
663
+ const msg = document.createElement('div');
664
+ msg.className = `fixed bottom-4 right-4 bg-emerald-900 border border-emerald-700 px-4 py-3 rounded-2xl text-sm z-50 max-w-xs`;
665
+ msg.innerHTML = `
666
+ <div class="font-medium">Copied to clipboard:</div>
667
+ <code class="block mt-1 bg-black/40 px-2 py-1 rounded text-emerald-300 break-all">${full}</code>
668
+ <div class="mt-2 text-xs text-emerald-200">Paste &amp; run it in the terminal <strong>inside this project folder</strong>, then click <span class="underline">Refresh</span> above (or wait ~30s).</div>
669
+ <button onclick="this.closest('.fixed').remove(); window.location.reload()" class="mt-2 text-xs underline">Refresh dashboard now</button>
670
+ `;
671
+ document.body.appendChild(msg);
672
+ // auto remove after a while if user doesn't interact
673
+ setTimeout(() => { if (msg.parentNode) msg.parentNode.removeChild(msg); }, 12000);
674
+ }).catch(() => {
675
+ // Fallback for browsers that block clipboard
676
+ const msg = document.createElement('div');
677
+ msg.className = `fixed bottom-4 right-4 bg-slate-800 border border-slate-700 px-3 py-2 rounded-2xl text-xs z-50`;
678
+ msg.innerHTML = `Run this in the terminal: <code class="bg-black/40 px-1">${full}</code>`;
679
+ document.body.appendChild(msg);
680
+ setTimeout(()=>{ if (msg.parentNode) msg.parentNode.removeChild(msg); }, 4000);
681
+ });
682
+
683
+ // Optimistic: after user likely ran it, the next poll will pick it up
684
+ if (cmd.includes('check') || cmd.includes('health')) setTimeout(() => loadHealthMatrix && loadHealthMatrix(), 800);
685
+ if (cmd.includes('update')) setTimeout(() => loadMermaid && loadMermaid(), 800);
686
+ if (cmd.includes('monitor')) setTimeout(() => loadMonitorStatus && loadMonitorStatus(true), 600);
687
+ }
688
+
689
+ // Legacy / existing buttons still work via the improved helper
614
690
  function runCommand(cmd) {
615
- const msg = document.createElement('div');
616
- msg.className = `fixed bottom-4 right-4 bg-slate-800 border border-slate-700 px-3 py-1.5 rounded-2xl text-xs flex items-center gap-2 z-50`;
617
- msg.innerHTML = `Run <code>wikifier ${cmd}</code> (or <code>./wikifier.sh ${cmd}</code>) in this folder`;
618
- document.body.appendChild(msg);
619
- setTimeout(()=>{msg.style.opacity=0;setTimeout(()=>msg.remove(),900)},1600);
620
-
621
- if (cmd.includes('check') || cmd.includes('health')) setTimeout(() => loadHealthMatrix && loadHealthMatrix(), 600);
622
- if (cmd.includes('update')) setTimeout(() => loadMermaid && loadMermaid(), 500);
623
- if (cmd.includes('monitor')) setTimeout(() => loadMonitorStatus && loadMonitorStatus(true), 400);
691
+ copyCommandForRun(cmd);
624
692
  }
625
693
 
626
694
  // Boot: only what the human view needs (chart + files+descs + tree + monitor). Poll for live feel.
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wikifier"
7
- version = "4.1.2"
8
- description = "Agent-first, zero-dependency, self-maintaining codebase documentation & change tracking system"
7
+ version = "4.1.4"
8
+ description = "Zero-dependency agent-to-agent codebase wiki for LLMs and AI agents. Autonomously maintained via record-change and mark-green for token-efficient lookup of files, dependencies, health, and summaries — across tiny scripts to 50k+ monorepos. Optional MCP server with rich tools for agents."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
11
11
  authors = [
@@ -17,7 +17,9 @@ maintainers = [
17
17
  requires-python = ">=3.8"
18
18
  keywords = [
19
19
  "wiki", "documentation", "llm", "agent", "mcp", "codebase",
20
- "health-matrix", "zero-dependency", "shell"
20
+ "health-matrix", "zero-dependency", "shell", "token-efficient",
21
+ "autonomous", "record-change", "mark-green", "agent-wiki",
22
+ "llm-tools", "dependency-graph", "monorepo"
21
23
  ]
22
24
  classifiers = [
23
25
  "Development Status :: 4 - Beta",
@@ -243,4 +243,4 @@ All support `project_root=...` and return structured data (plus side-effecting s
243
243
 
244
244
  See README.md "Intended Use" for the strict agent-to-agent wiki scope (token saving for lookup + autonomous update/create of wiki entries only). M5 dogfood validated this on real external projects with the exact patterns above. Recent 4.0.1 hygiene (health coerce + superseded prune) further improves reliability of the matrix for agents doing direct lookups/updates.
245
245
 
246
- **Human investigation layer (secondary, opt-in)**: `wikifier init` copies only `index.html` (the clean human wiki viewer) into the target project (the folder where MCP/CLI run). `diagnostics.html` (Wikifier maintainer hub) is no longer copied — it would show the wrong tree (Wikifier's internals) and be stale for the host project. Humans open the local `index.html` (via `python -m http.server` recommended) to see a clean visual of *that project's* agent-maintained wiki: prominent code structure / dependency chart (Mermaid) as the hero, followed by a simple "Files & descriptions" list (paths + short "what this file is about" summaries pulled from the wiki notes), and a lightweight "Browse by folder" tree derived from the health data. It auto-polls for refresh when the monitor or agents update the underlying .md files. Prominent copy buttons export "structure as text" (Mermaid source) and a clean full snapshot (tree + file list + descriptions) — exactly the compact, token-saving view agents use. The default human page is intentionally free of dense agent internals (those live in `diagnostics.html` in the Wikifier source for technical users). If an old diagnostics.html is present, it can be safely deleted. The .md files + MCP/CLI/tools remain the primary SSOT and update mechanism for agents. This layer lets humans (or teams) visually investigate and copy-paste wiki summaries for their own work / LLM chats without touching agent behavior or adding deps.
246
+ **Human investigation layer (secondary, opt-in)**: `wikifier init` copies only `index.html` (the clean human wiki viewer) into the target project (the folder where MCP/CLI run). `diagnostics.html` (Wikifier maintainer hub) is no longer copied — it would show the wrong tree (Wikifier's internals) and be stale for the host project. Humans open the local `index.html` (via `python -m http.server` recommended) to see a clean visual of *that project's* agent-maintained wiki: prominent code structure / dependency chart (Mermaid) as the hero, followed by a simple "Files & descriptions" list (paths + short "what this file is about" summaries pulled from the wiki notes), and a lightweight "Browse by folder" tree derived from the health data. A "Quick actions" toolbar provides one-click copy buttons for the main commands (check-changes, update-maps, monitor &); empty states ("no map yet", "no files yet") have prominent buttons for first-time commands (update-maps is prioritized). On first open with no map, the update-maps command is auto-copied (sessionStorage-guarded) with guidance so initial setup feels automatic. It auto-polls for refresh when the monitor or agents update the underlying .md files. Prominent copy buttons export "structure as text" (Mermaid source) and a clean full snapshot (tree + file list + descriptions) — exactly the compact, token-saving view agents use. The default human page is intentionally free of dense agent internals (those live in `diagnostics.html` in the Wikifier source for technical users). If an old diagnostics.html is present, it can be safely deleted. The .md files + MCP/CLI/tools remain the primary SSOT and update mechanism for agents. This layer lets humans (or teams) visually investigate and copy-paste wiki summaries for their own work / LLM chats without touching agent behavior or adding deps.
@@ -62,4 +62,4 @@ from .contracts import (
62
62
  compute_acs_confidence,
63
63
  )
64
64
 
65
- __version__ = "4.1.2"
65
+ __version__ = "4.1.4"
@@ -1160,8 +1160,10 @@ def health(
1160
1160
  # Human Investigation Layer (secondary sub-project)
1161
1161
  # Only index.html (the clean human wiki viewer) is copied into target projects by init.
1162
1162
  # It provides the prominent code structure chart (Mermaid), "Files & descriptions" list with
1163
- # short summaries, folder browser, and copy buttons for the *target project's* agent-maintained
1164
- # wiki (data-driven from its file_health.* + library.md after check-changes + update-maps).
1163
+ # short summaries, folder browser, copy buttons for tree/snapshot, a "Quick actions" toolbar
1164
+ # with copy buttons for main commands (check-changes, update-maps, monitor &), and prominent
1165
+ # buttons + session-guarded auto-copy of update-maps in empty states for easy first-run setup.
1166
+ # (data-driven from its file_health.* + library.md after check-changes + update-maps).
1165
1167
  # diagnostics.html is the Wikifier-specific heavy maintainer/refactor/porter hub (architecture,
1166
1168
  # full command map, porting checklist, this project's own source tree with purposes). It is
1167
1169
  # *not* copied to foreign project roots — it would point at the wrong folder and be stale for