@ctxo/cli 0.12.0 → 0.13.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 CHANGED
@@ -20,7 +20,7 @@ ctxo index
20
20
  <img src="https://img.shields.io/badge/Get%20Started-%E2%86%92-06b6d4?style=for-the-badge&labelColor=0f172a" alt="Get Started →">
21
21
  </a>
22
22
 
23
- <sub>Detects your languages, installs the right plugins, wires Ctxo into your AI client, installs git hooks, and builds the first index one command.</sub>
23
+ <sub>Detects your languages, installs the right plugins, wires Ctxo into your AI client, installs git hooks, and builds the first index, all in one command.</sub>
24
24
 
25
25
  </div>
26
26
 
@@ -28,7 +28,7 @@ ctxo index
28
28
 
29
29
  ## The Problem: agents code blind
30
30
 
31
- Drop a modern coding agent into a real repo. It ripgreps a symbol, gets 47 hits, reads five files to find the definition, five more for callers **misses the subclass entirely** (inheritance doesn't show up in text search), **never checks git history** (and confidently reintroduces a bug that was reverted three weeks ago), then runs out of context and starts hallucinating.
31
+ Drop a modern coding agent into a real repo. It ripgreps a symbol, gets 47 hits, reads five files to find the definition, five more for callers, **misses the subclass entirely** (inheritance doesn't show up in text search), **never checks git history** (and confidently reintroduces a bug that was reverted three weeks ago), then runs out of context and starts hallucinating.
32
32
 
33
33
  It's not a skill gap. It's a **sensory gap**. The agent is navigating your codebase with its eyes closed and a phone book.
34
34
 
@@ -36,11 +36,11 @@ It's not a skill gap. It's a **sensory gap**. The agent is navigating your codeb
36
36
 
37
37
  The core shift: your agent stops reacting to files it stumbles into and starts planning from a complete map. **Blast radius before the edit. Git intent before the bug fix. Importer list before the rename.**
38
38
 
39
- Ctxo indexes your repo once kept fresh by file watchers and git hooks into a deterministic graph: every symbol, every edge (imports, calls, extends, implements), every relevant git commit with intent classified, every anti-pattern. All exposed through 14 semantic MCP tools.
39
+ Ctxo indexes your repo once, kept fresh by file watchers and git hooks, into a deterministic graph: every symbol, every edge (imports, calls, extends, implements, uses, and the data edges reads, writes and executes), every relevant git commit with intent classified, every anti-pattern. All exposed through 14 semantic MCP tools.
40
40
 
41
41
  One `get_blast_radius` call replaces an entire ripgrep/read spiral. One `get_pr_impact` replaces a full review session of "wait, what calls this?"
42
42
 
43
- The agent still writes the code. It just stops writing it **blind** so the bug never has to be caught by the compiler, the tests, CI, or a user.
43
+ The agent still writes the code. It just stops writing it **blind**, so the bug never has to be caught by the compiler, the tests, CI, or a user.
44
44
 
45
45
  ## Codebase Dashboard
46
46
 
@@ -71,6 +71,26 @@ The safe-edit guard closes this loop deterministically. When you run `ctxo init`
71
71
 
72
72
  If an agent tries to edit a high-impact symbol without first calling `get_blast_radius`, the hook blocks the edit and tells the agent what to check. Once the agent runs the tool, the edit goes through normally. Fires once per symbol per session, fail-open on any uncertainty.
73
73
 
74
+ With the hook and the skills doing the work, the always-loaded `CLAUDE.md` block shrinks to four lines:
75
+
76
+ ```markdown
77
+ ## ctxo
78
+
79
+ This repo has a ctxo index: dependency graph, git intent, change health. For structural questions (who depends on X, what breaks if X changes, why X looks like this), use the ctxo MCP tools before grepping.
80
+ A pre-edit guard blocks the first edit to a high-impact symbol until `get_blast_radius` has been called for it.
81
+ Skills: `ctxo-understand` (orient at task start), `ctxo-safe-edit` (before changing a symbol), `ctxo-review-pr` (before reviewing a diff).
82
+ ```
83
+
84
+ Every other client, Claude Code without the guard, and a `CLAUDE.md` that another client reads too (an `AGENTS.md` linked to it) get the full tool guide. Re-running `ctxo init` replaces the block in place and keeps the rest of your file. The blocks and skills are written in Prettier's layout and compared with formatting ignored, so a markdown formatter and ctxo never rewrite each other. `ctxo doctor` warns when the block, the skills or the hook drift, and `ctxo doctor --fix` repairs them.
85
+
86
+ **Pick the parts:**
87
+
88
+ ```shell
89
+ ctxo init --only rules,skills,guard # add the guard and the skills; the rules block follows
90
+ ctxo init --skip git-hooks # everything except the git hooks
91
+ ctxo init --no-guard # does not install the guard (CLAUDE.md gets the full block unless a guard is already registered)
92
+ ```
93
+
74
94
  **Tune it:**
75
95
 
76
96
  ```shell
@@ -97,6 +117,30 @@ gate:
97
117
  | Cursor | no (no blocking pre-edit hook) | yes | yes |
98
118
  | Other | no | where supported | yes |
99
119
 
120
+ ## Fresh on every commit
121
+
122
+ A stale index is worse than none: the agent trusts a map that no longer matches the code. `ctxo init` installs a post-commit hook that runs `ctxo index --commit HEAD` once per commit. It re-indexes only the files that commit changed, refreshes the co-change matrix from git history, and records one snapshot per commit for the drift and boundary signals.
123
+
124
+ ```shell
125
+ ctxo index --commit HEAD # what the hook runs
126
+ ctxo index --files src/a.ts src/b.ts # re-index a few files
127
+ ctxo index --cochange-commits 500 --cochange-since 12m # co-change window (or `cochange:` in config.yaml)
128
+ ctxo doctor --fix # upgrades an old hook block in place
129
+ ```
130
+
131
+ The file you forget to touch is usually the one no import points at. Files that keep changing together are coupled anyway: `get_blast_radius` promotes a dependent that co-changes with your target from `potential` to `likely`, and lists the files with no dependency path at all as `coChangedFiles`. `ctxo index --max-history` only controls how many commits each file keeps for `get_why_context`; the co-change window has its own settings.
132
+
133
+ ## Where the boundaries really are
134
+
135
+ Folder names say one thing; imports and commit history often say another. `ctxo index` also writes candidate bounded contexts: files clustered by dependency and co-change edges, with hub files damped, each with a suggested label, a cohesion score, top terms and the edges that cross into other candidates. With `@ctxo/lang-sql` installed, tables, views and procedures join the graph: a table's readers and writers show up in its blast radius, and each candidate lists the tables it shares with other candidates.
136
+
137
+ ```shell
138
+ ctxo contexts # candidates as a table
139
+ ctxo contexts --json # the full contexts-view.json
140
+ ```
141
+
142
+ Agents get the same view from `get_architectural_overlay(mode: "contexts")`, and one candidate in full with `candidate: <id>`.
143
+
100
144
  ## Supported Languages
101
145
 
102
146
  | Language | Plugin | Tier | Notes |
@@ -105,11 +149,13 @@ gate:
105
149
  | Go | `@ctxo/lang-go` | syntax | tree-sitter; exported-symbol analysis |
106
150
  | C# | `@ctxo/lang-csharp` | full | Roslyn; .NET SDK 8+ for full tier, tree-sitter fallback |
107
151
  | Java | `@ctxo/lang-java` | syntax / full | tree-sitter syntax tier built-in; full tier via `@ctxo/lang-java-analyzer` companion (JRE 11+ required, covers Java 8-21); detected by `pom.xml` / `build.gradle` |
152
+ | SQL (T-SQL) | `@ctxo/lang-sql` | syntax | `.sql` tables, views, procedures and functions with `reads` / `writes` / `executes` edges; no database or .NET needed. With it installed, the C# plugin's Roslyn tier also links constant SQL at ADO.NET, Dapper, `SqlBulkCopy` and EF Core call sites to the same tables |
108
153
 
109
154
  Install via the CLI shortcut:
110
155
 
111
156
  ```bash
112
157
  ctxo install typescript go csharp # syntax or full tier auto-detected
158
+ ctxo install sql # T-SQL plugin (alias tsql)
113
159
  ctxo install java # installs syntax tier; adds full-tier analyzer when JRE 11+ detected
114
160
  ctxo install java --full-tier # force full-tier analyzer install
115
161
  ctxo install java --syntax-only # skip analyzer, syntax tier only
@@ -117,7 +163,7 @@ ctxo install java --syntax-only # skip analyzer, syntax tier only
117
163
 
118
164
  ## Links
119
165
 
120
- * [Docs](https://alperhankendi.github.io/Ctxo/docs/) quick start, MCP tools, CLI reference, integrations
166
+ * [Docs](https://alperhankendi.github.io/Ctxo/docs/): quick start, MCP tools, CLI reference, integrations
121
167
  * [npm](https://www.npmjs.com/package/@ctxo/cli)
122
168
  * [Changelog](CHANGELOG.md)
123
169
  * [LLM Reference](llms-full.txt)