codechart 1.0.2 → 1.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/README.md +1 -1
- package/config.schema.json +142 -0
- package/package.json +2 -2
- package/skills/codechart/spec-guide.md +1 -1
- package/templates/codechart.yaml +22 -0
package/README.md
CHANGED
|
@@ -234,7 +234,7 @@ More: [Why you can trust the diagram](https://github.com/MiscomLab/codechart/blo
|
|
|
234
234
|
|
|
235
235
|
## Cost
|
|
236
236
|
|
|
237
|
-
A diagram is about **2–3 extra API calls**, roughly 2–3% of a long session's usage, and nothing for trivial changes. That figure was measured on 2026-10-28 with a skill of 7.1k chars; the skill is now 17.0k chars (about 4.2k tokens), so a diagram costs more than that, and the benchmark has not been re-run. The CLI is a
|
|
237
|
+
A diagram is about **2–3 extra API calls**, roughly 2–3% of a long session's usage, and nothing for trivial changes. That figure was measured on 2026-10-28 with a skill of 7.1k chars; the skill is now 17.0k chars (about 4.2k tokens), so a diagram costs more than that, and the benchmark has not been re-run. The CLI is a 167.0 kB package, plus the 1.66 MB [`@codechart/core`](https://www.npmjs.com/package/@codechart/core) it depends on. Measured runs: [Efficiency](https://github.com/MiscomLab/codechart/blob/main/docs/efficiency.md).
|
|
238
238
|
|
|
239
239
|
## Safe to run
|
|
240
240
|
|
package/config.schema.json
CHANGED
|
@@ -197,6 +197,148 @@
|
|
|
197
197
|
],
|
|
198
198
|
"additionalProperties": false
|
|
199
199
|
}
|
|
200
|
+
},
|
|
201
|
+
"map": {
|
|
202
|
+
"description": "The desktop app's map: its rules, guidance for the model and pinned names. The CLI doesn't use it.",
|
|
203
|
+
"anyOf": [
|
|
204
|
+
{
|
|
205
|
+
"type": "object",
|
|
206
|
+
"properties": {
|
|
207
|
+
"rules": {
|
|
208
|
+
"description": "Top-down, first match wins, before the app's built-in rules",
|
|
209
|
+
"anyOf": [
|
|
210
|
+
{
|
|
211
|
+
"type": "array",
|
|
212
|
+
"items": {
|
|
213
|
+
"type": "object",
|
|
214
|
+
"properties": {
|
|
215
|
+
"paths": {
|
|
216
|
+
"description": "Globs the rule matches",
|
|
217
|
+
"minItems": 1,
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"minLength": 1,
|
|
222
|
+
"maxLength": 200,
|
|
223
|
+
"pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u200b\\u200c\\u200e\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff]*$"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"pattern": {
|
|
227
|
+
"description": "Tree-sitter query; the @entity capture is what the rule applies to",
|
|
228
|
+
"type": "string",
|
|
229
|
+
"minLength": 1,
|
|
230
|
+
"maxLength": 2000,
|
|
231
|
+
"allOf": [
|
|
232
|
+
{
|
|
233
|
+
"pattern": "^[^\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f\\u200b\\u200c\\u200e\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff]*$"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"pattern": "@entity(?![\\w.-])"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"lang": {
|
|
241
|
+
"description": "The pattern's tree-sitter grammar",
|
|
242
|
+
"type": "string",
|
|
243
|
+
"enum": [
|
|
244
|
+
"typescript",
|
|
245
|
+
"javascript",
|
|
246
|
+
"python",
|
|
247
|
+
"html",
|
|
248
|
+
"css",
|
|
249
|
+
"sql",
|
|
250
|
+
"bash",
|
|
251
|
+
"yaml",
|
|
252
|
+
"json"
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
"kind": {
|
|
256
|
+
"description": "The code is an entity of this kind",
|
|
257
|
+
"type": "string",
|
|
258
|
+
"enum": [
|
|
259
|
+
"table",
|
|
260
|
+
"model",
|
|
261
|
+
"service",
|
|
262
|
+
"endpoint",
|
|
263
|
+
"component",
|
|
264
|
+
"config"
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
"box": {
|
|
268
|
+
"description": "The code belongs to this box",
|
|
269
|
+
"type": "string",
|
|
270
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
271
|
+
},
|
|
272
|
+
"ignore": {
|
|
273
|
+
"description": "The code is read but left off the map",
|
|
274
|
+
"type": "boolean",
|
|
275
|
+
"const": true
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"additionalProperties": false
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"type": "null"
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
"guidance": {
|
|
287
|
+
"description": "Plain words for the model that names and groups boxes",
|
|
288
|
+
"anyOf": [
|
|
289
|
+
{
|
|
290
|
+
"type": "string",
|
|
291
|
+
"minLength": 1,
|
|
292
|
+
"maxLength": 2000,
|
|
293
|
+
"pattern": "^[^\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f\\u200b\\u200c\\u200e\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff]*$"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"type": "null"
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
"pinned": {
|
|
301
|
+
"description": "Names a person pinned, by rule box id (billing), folder box id (folder:src/payments) or node id (file::path::kind); written sorted by id",
|
|
302
|
+
"anyOf": [
|
|
303
|
+
{
|
|
304
|
+
"type": "object",
|
|
305
|
+
"propertyNames": {
|
|
306
|
+
"type": "string"
|
|
307
|
+
},
|
|
308
|
+
"additionalProperties": {
|
|
309
|
+
"type": "object",
|
|
310
|
+
"properties": {
|
|
311
|
+
"name": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"minLength": 1,
|
|
314
|
+
"maxLength": 80,
|
|
315
|
+
"pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u200b\\u200c\\u200e\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff]*$"
|
|
316
|
+
},
|
|
317
|
+
"reason": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"minLength": 1,
|
|
320
|
+
"maxLength": 300,
|
|
321
|
+
"pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u200b\\u200c\\u200e\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff]*$"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"required": [
|
|
325
|
+
"name"
|
|
326
|
+
],
|
|
327
|
+
"additionalProperties": false
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"type": "null"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"additionalProperties": false
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"type": "null"
|
|
340
|
+
}
|
|
341
|
+
]
|
|
200
342
|
}
|
|
201
343
|
},
|
|
202
344
|
"additionalProperties": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codechart",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Agent skill + CLI: maps and flowcharts of code changes, and of how existing code works, for AI coding agents, in terminal, chat and HTML",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"prepack": "npm run build && node ../../scripts/pack-readme.mjs"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@codechart/core": "0.
|
|
55
|
+
"@codechart/core": "0.7.0",
|
|
56
56
|
"commander": "15.1.0",
|
|
57
57
|
"elkjs": "0.12.1",
|
|
58
58
|
"picomatch": "4.0.7",
|
|
@@ -93,7 +93,7 @@ A `✗` mismatch fails the check and `--strict`; a `⚠` warning never fails it.
|
|
|
93
93
|
- **File exists:** every node with a `path`, except a summary's `removed` node (a class deleted from a file that stays) and a plan's `new` node (not built yet). A folder counts. A node without a `path` is counted as not checkable.
|
|
94
94
|
- **In the diff:** in a summary rendered with `--git`, `--since` or `--commit`, every `new`, `changed` or `removed` node's file, with git's status: `new` needs a file git adds, `removed` one it deletes, and `changed` one it modifies or renames. `context` and `config` nodes are not checked against the diff.
|
|
95
95
|
- **`match`:** found on exactly one line, when the file must exist.
|
|
96
|
-
- **Fields and arrows (warning):** each listed field must appear in its file (a dotted name such as `access_logs.bucket` may be a nested block, its parts in order), and an arrow's source file should mention the other box's name (`module.vpc`, `store.FindOrder`; for `Deployment api`, `api`) or its file's name (an `index` file's folder too)
|
|
96
|
+
- **Fields and arrows (warning):** each listed field must appear in its file (a dotted name such as `access_logs.bucket` may be a nested block, its parts in order), and an arrow's source file should mention the other box's name (`module.vpc`, `store.FindOrder`; for `Deployment api`, `api`) or its file's name (an `index` file's folder too) in its code: a mention only in a comment doesn't count. A Helm template's `include "name"` or `template "name"` counts for the `.tpl` file that defines that name. Two boxes in one file are checked by name only. Comparison ignores case, `_` and `-`; a miss is a `⚠` warning, never a `✗`.
|
|
97
97
|
|
|
98
98
|
## Drift from the plan
|
|
99
99
|
|
package/templates/codechart.yaml
CHANGED
|
@@ -24,6 +24,28 @@
|
|
|
24
24
|
|
|
25
25
|
# ignore: ["generated/**"] # files the desktop app's live map never reads (the CLI doesn't use it)
|
|
26
26
|
|
|
27
|
+
# map: # the desktop app's map, repo only (the CLI doesn't use it); not the agent rules under rules:
|
|
28
|
+
# rules: # top-down, first match wins, before the app's built-in ones
|
|
29
|
+
# - paths: ["app/models/**"] # globs, a tree-sitter pattern (with lang), or both
|
|
30
|
+
# kind: model # table | model | service | endpoint | component | config
|
|
31
|
+
# - pattern: "(class_definition superclasses: (argument_list (identifier) @base (#eq? @base \"Model\"))) @entity"
|
|
32
|
+
# lang: python
|
|
33
|
+
# kind: table
|
|
34
|
+
# - paths: ["legacy/billing/**"]
|
|
35
|
+
# box: billing # a box id: up to 64 lowercase letters, digits or hyphens
|
|
36
|
+
# - paths: ["generated/**"]
|
|
37
|
+
# ignore: true # read, but left off the map
|
|
38
|
+
# guidance: | # plain words for the model that names boxes, up to 2000 characters
|
|
39
|
+
# Group by business domain, not by technical layer.
|
|
40
|
+
# pinned: # names a person accepted or edited; the app writes these, sorted by id
|
|
41
|
+
# billing: # a rule box id (a rule's box:)
|
|
42
|
+
# name: Billing
|
|
43
|
+
# reason: Invoices and payouts, apart from checkout
|
|
44
|
+
# folder:src/payments: # a folder box id: folder: + the repo-relative folder
|
|
45
|
+
# name: Payments
|
|
46
|
+
# src/pay.ts::PaymentService.charge::method: # a node id: file::path::kind
|
|
47
|
+
# name: Charge a card
|
|
48
|
+
|
|
27
49
|
# useBuiltinRules: true # common migration and model paths, "more than 2 changed files depend on each other", and behaviour-flow
|
|
28
50
|
|
|
29
51
|
# Rules run top-down, before the built-in ones; per diagram type, for each file the first matching path rule wins.
|