ctxmedic 0.0.0-stage โ 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/LICENSE +110 -0
- package/NOTICE +19 -0
- package/README.md +87 -2
- package/dist/index.js +1850 -0
- package/package.json +62 -3
- package/public/assets/index-Bqo1oFYC.css +1 -0
- package/public/assets/index-CuWHlsFL.js +130 -0
- package/public/index.html +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 Vitalii Ponomarenko (also known as Vitaliy Ponomarenko, https://github.com/ponomarenko)
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions:
|
|
16
|
+
Vitalii Ponomarenko (also known as Vitaliy Ponomarenko, https://github.com/ponomarenko).
|
|
17
|
+
|
|
18
|
+
### The Software
|
|
19
|
+
|
|
20
|
+
The "Software" is each version of the software that we make available under
|
|
21
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
22
|
+
Conditions with the Software.
|
|
23
|
+
|
|
24
|
+
### License Grant
|
|
25
|
+
|
|
26
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
27
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
28
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
29
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
30
|
+
|
|
31
|
+
### Permitted Purpose
|
|
32
|
+
|
|
33
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
34
|
+
means making the Software available to others in a commercial product or
|
|
35
|
+
service that:
|
|
36
|
+
|
|
37
|
+
1. substitutes for the Software;
|
|
38
|
+
|
|
39
|
+
2. substitutes for any other product or service we offer using the Software
|
|
40
|
+
that exists as of the date we make the Software available; or
|
|
41
|
+
|
|
42
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
43
|
+
|
|
44
|
+
Permitted Purposes specifically include using the Software:
|
|
45
|
+
|
|
46
|
+
1. for your internal use and access;
|
|
47
|
+
|
|
48
|
+
2. for non-commercial education;
|
|
49
|
+
|
|
50
|
+
3. for non-commercial research; and
|
|
51
|
+
|
|
52
|
+
4. in connection with professional services that you provide to a licensee
|
|
53
|
+
using the Software in accordance with these Terms and Conditions.
|
|
54
|
+
|
|
55
|
+
### Patents
|
|
56
|
+
|
|
57
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
58
|
+
patents, the license grant above includes a license under our patents. If you
|
|
59
|
+
make a claim against any party that the Software infringes or contributes to
|
|
60
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
61
|
+
immediately.
|
|
62
|
+
|
|
63
|
+
### Redistribution
|
|
64
|
+
|
|
65
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
66
|
+
the Software.
|
|
67
|
+
|
|
68
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
69
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
70
|
+
remove any copyright notices provided in or with the Software.
|
|
71
|
+
|
|
72
|
+
### Disclaimer
|
|
73
|
+
|
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
75
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
76
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
77
|
+
|
|
78
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
79
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
80
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
81
|
+
|
|
82
|
+
### Trademarks
|
|
83
|
+
|
|
84
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
85
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
86
|
+
trademarks, trade names, service marks or product names.
|
|
87
|
+
|
|
88
|
+
## Grant of Future License
|
|
89
|
+
|
|
90
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
91
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
92
|
+
the Software available. On or after that date, you may use the Software under
|
|
93
|
+
the MIT license, in which case the following will apply:
|
|
94
|
+
|
|
95
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
96
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
97
|
+
the Software without restriction, including without limitation the rights to
|
|
98
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
99
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
100
|
+
subject to the following conditions:
|
|
101
|
+
|
|
102
|
+
The above copyright notice and this permission notice shall be included in all
|
|
103
|
+
copies or substantial portions of the Software.
|
|
104
|
+
|
|
105
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
106
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
107
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
108
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
109
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
110
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
ctxmedic
|
|
2
|
+
Copyright (c) 2026 Vitalii Ponomarenko (also known as Vitaliy Ponomarenko, https://github.com/ponomarenko)
|
|
3
|
+
|
|
4
|
+
This product was originally designed and written by Vitalii Ponomarenko.
|
|
5
|
+
The author's legal name, as written in the passport, is PONOMARENKO VITALII.
|
|
6
|
+
"Vitaliy Ponomarenko" is an alternative spelling of the same person, used in
|
|
7
|
+
earlier commits and publications.
|
|
8
|
+
Source: https://github.com/ponomarenko/ctxmedic
|
|
9
|
+
Package: https://www.npmjs.com/package/ctxmedic
|
|
10
|
+
|
|
11
|
+
Licensed under the Functional Source License, Version 1.1, MIT Future License
|
|
12
|
+
(FSL-1.1-MIT). See LICENSE. Each version converts to the MIT license on the
|
|
13
|
+
second anniversary of its release.
|
|
14
|
+
|
|
15
|
+
"ctxmedic" and the ctxmedic logo are trademarks of Vitalii Ponomarenko.
|
|
16
|
+
See TRADEMARKS.md.
|
|
17
|
+
|
|
18
|
+
Redistributions, forks and derivative works must keep this NOTICE file and
|
|
19
|
+
all copyright notices intact.
|
package/README.md
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ctxmedic
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> The context medic for your AI coding setup.
|
|
4
|
+
|
|
5
|
+
ctxmedic examines the AI configuration of a project like a doctor examines a
|
|
6
|
+
patient. It reads your `CLAUDE.md`, `AGENTS.md`, Cursor/Windsurf/Copilot/Cline
|
|
7
|
+
rules, skills and MCP configs, plus your local session logs, then gives you a
|
|
8
|
+
**Health Score**, triaged **diagnoses**, and one-step **prescriptions** that
|
|
9
|
+
save tokens and money.
|
|
10
|
+
|
|
11
|
+
Works with Claude Code, Cursor, Windsurf, Codex CLI, OpenCode, GitHub Copilot
|
|
12
|
+
and Cline. 100% local: nothing leaves your machine.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx ctxmedic checkup
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
๐ฉบ ctxmedic 0.1.0 ยท ~/code/my-app
|
|
20
|
+
Health Score: โโโโโโโโโโโโโโโโโโโโ 82/100 (+4 since the last visit)
|
|
21
|
+
Stable, but a few conditions need therapy.
|
|
22
|
+
๐ด Resuscitation 0 ๐ก Therapy 1 ๐ข Preventive 3 ยท Potential savings: $69.20/mo
|
|
23
|
+
|
|
24
|
+
โญโ ๐ก Therapy ยท RX-01 Context Snowball [FIN_CONTEXT_SNOWBALL]
|
|
25
|
+
โ 11 session(s) ran >35 steps with 100k+ context and no /clear or /compact
|
|
26
|
+
โ Vitals Worst Steps: 266 ยท Worst Max Context: 452,169
|
|
27
|
+
โ Prognosis Each step re-reads the whole history; quality drops as it grows.
|
|
28
|
+
โ Rx Run /compact at task milestones and /clear between unrelated tasks.
|
|
29
|
+
โ (+8 health, $68.80/mo)
|
|
30
|
+
โฐโ
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Commands
|
|
34
|
+
|
|
35
|
+
| Command | What it does |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `ctxmedic checkup [path]` | Full examination. `--json` for machines, exit code 1 on ๐ด findings (CI gate). |
|
|
38
|
+
| `ctxmedic treat RX-01` | Apply one prescription. `--all`, `--dry-run`, `--force`, `-y`. |
|
|
39
|
+
| `ctxmedic savings` | FinOps only: spend, run rate, cache hit ratio, savings. |
|
|
40
|
+
| `ctxmedic consult [--ai]` | Interactive appointment: your priorities, budget and main tool shape the treatment plan. `--ai` asks local Ollama or your own Anthropic/OpenAI key for a second opinion. |
|
|
41
|
+
| `ctxmedic history` | Health Score over time. |
|
|
42
|
+
| `ctxmedic ui` | Local Web UI on `127.0.0.1`: dashboard, diagnoses, FinOps, config graph. |
|
|
43
|
+
|
|
44
|
+
Common options: `--days 30`, `--no-finops`, `--no-global`.
|
|
45
|
+
|
|
46
|
+
## Diagnoses
|
|
47
|
+
|
|
48
|
+
| Code | Diagnosis | Auto-fix |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `ERR_BROKEN_LINK` | Symlink Necrosis: broken, circular or absolute symlinks | relative links |
|
|
51
|
+
| `WARN_CONTEXT_BLOAT` | Context Obesity: > 3,500 tokens loaded at session start | โ |
|
|
52
|
+
| `WARN_DUPLICATE_RULES` | Instruction Duplication: > 75% similar instruction files | hub-and-spoke `.ai/` + symlinks |
|
|
53
|
+
| `ERR_INVALID_SKILL` | Skill Amnesia: bad `SKILL.md` frontmatter, names, triggers | โ |
|
|
54
|
+
| `CRIT_SECRET_LEAK` | Credential Hemorrhage: API keys in configs (masked in output) | โ |
|
|
55
|
+
| `INFO_UNSUPPORTED_SYNTAX` | Cross-Harness Allergy: `@import`, `alwaysApply`โฆ read by tools that ignore them | โ |
|
|
56
|
+
| `FIN_BLOAT_IGNORE` | Indexing Bloat: no `.cursorignore` / `.codeiumignore` | generates it |
|
|
57
|
+
| `FIN_UNUSED_MCP` | Toxic MCP Syndrome: MCP servers never called | โ |
|
|
58
|
+
| `FIN_MODEL_OVERKILL` | Model Overkill: frontier models on one-shot tasks | โ |
|
|
59
|
+
| `FIN_CONTEXT_SNOWBALL` | Context Snowball: long sessions without `/compact` | โ |
|
|
60
|
+
| `FIN_CACHE_MISS` | Prompt Cache Thrashing: cache hit ratio < 40% | โ |
|
|
61
|
+
|
|
62
|
+
Every fix backs up the originals to `.ctxmedic/backups/<timestamp>/` and
|
|
63
|
+
refuses to touch files with uncommitted git changes unless you pass `--force`.
|
|
64
|
+
|
|
65
|
+
## Privacy
|
|
66
|
+
|
|
67
|
+
- No telemetry. No network calls, except `consult --ai`, which asks before it
|
|
68
|
+
sends anything and redacts secrets first.
|
|
69
|
+
- Session logs are read from `~/.claude/projects`, `~/.codex/sessions` and
|
|
70
|
+
`~/.cursor/projects`. Parsed totals are cached in `~/.ctxmedic/cache.json`.
|
|
71
|
+
- The UI server binds to `127.0.0.1` and requires a per-run token for writes.
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pnpm install
|
|
77
|
+
pnpm typecheck && pnpm test && pnpm build
|
|
78
|
+
node packages/cli/dist/index.js checkup
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) and [docs/ADR.md](./docs/ADR.md).
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
[FSL-1.1-MIT](./LICENSE) ยฉ 2026 [Vitalii Ponomarenko](https://github.com/ponomarenko).
|
|
86
|
+
Free for internal use, education and research; each release becomes MIT two
|
|
87
|
+
years after it ships. Commercial and team terms: [LICENSE_COMMERCIAL.md](./LICENSE_COMMERCIAL.md).
|
|
88
|
+
"ctxmedic" is a trademark: [TRADEMARKS.md](./TRADEMARKS.md).
|