@dotdotgod/cli 0.1.21
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 +94 -0
- package/README.md +100 -0
- package/bin/dotdotgod.mjs +4 -0
- package/package.json +48 -0
- package/src/core.mjs +2458 -0
- package/src/init.mjs +245 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Elastic License 2.0 (ELv2)
|
|
2
|
+
|
|
3
|
+
Copyright 2026 JooYoung Kim
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
+
available, and prepare derivative works of the software, in each case subject
|
|
14
|
+
to the limitations and conditions below.
|
|
15
|
+
|
|
16
|
+
## Limitations
|
|
17
|
+
|
|
18
|
+
You may not provide the software to third parties as a hosted or managed
|
|
19
|
+
service, where the service provides users with access to any substantial set
|
|
20
|
+
of the features or functionality of the software.
|
|
21
|
+
|
|
22
|
+
You may not move, change, disable, or circumvent the license key
|
|
23
|
+
functionality in the software, and you may not remove or obscure any
|
|
24
|
+
functionality in the software that is protected by the license key.
|
|
25
|
+
|
|
26
|
+
You may not alter, remove, or obscure any licensing, copyright, or other
|
|
27
|
+
notices of the licensor in the software. Any use of the licensor's trademarks
|
|
28
|
+
is subject to applicable law.
|
|
29
|
+
|
|
30
|
+
## Patents
|
|
31
|
+
|
|
32
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
+
sale, import and have imported the software, in each case subject to the
|
|
35
|
+
limitations and conditions in this license. This license does not cover any
|
|
36
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
+
the software. If you or your company make any written claim that the software
|
|
38
|
+
infringes or contributes to infringement of any patent, your patent license
|
|
39
|
+
for the software granted under these terms ends immediately. If your company
|
|
40
|
+
makes such a claim, your patent license ends immediately for work on behalf
|
|
41
|
+
of your company.
|
|
42
|
+
|
|
43
|
+
## Notices
|
|
44
|
+
|
|
45
|
+
You must ensure that anyone who gets a copy of any part of the software from
|
|
46
|
+
you also gets a copy of these terms.
|
|
47
|
+
|
|
48
|
+
If you modify the software, you must include in any modified copies of the
|
|
49
|
+
software prominent notices stating that you have modified the software.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
+
these terms.
|
|
55
|
+
|
|
56
|
+
## Termination
|
|
57
|
+
|
|
58
|
+
If you use the software in violation of these terms, such use is not
|
|
59
|
+
licensed, and your licenses will automatically terminate. If the licensor
|
|
60
|
+
provides you with a notice of your violation, and you cease all violation of
|
|
61
|
+
this license no later than 30 days after you receive that notice, your
|
|
62
|
+
licenses will be reinstated retroactively. However, if you violate these
|
|
63
|
+
terms after such reinstatement, any additional violation of these terms will
|
|
64
|
+
cause your licenses to terminate automatically and permanently.
|
|
65
|
+
|
|
66
|
+
## No Liability
|
|
67
|
+
|
|
68
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
70
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
71
|
+
legal claim.*
|
|
72
|
+
|
|
73
|
+
## Definitions
|
|
74
|
+
|
|
75
|
+
The **licensor** is the entity offering these terms, and the **software** is
|
|
76
|
+
the software the licensor makes available under these terms, including any
|
|
77
|
+
portion of it.
|
|
78
|
+
|
|
79
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
+
|
|
81
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
+
organization that you work for, plus all organizations that have control over,
|
|
83
|
+
are under the control of, or are under common control with that organization.
|
|
84
|
+
**control** means ownership of substantially all the assets of an entity, or
|
|
85
|
+
the power to direct its management and policies by vote, contract, or
|
|
86
|
+
otherwise. Control can be direct or indirect.
|
|
87
|
+
|
|
88
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
89
|
+
these terms.
|
|
90
|
+
|
|
91
|
+
**use** means anything you do with the software requiring one of your
|
|
92
|
+
licenses.
|
|
93
|
+
|
|
94
|
+
**trademark** means trademarks, service marks, and similar rights.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# @dotdotgod/cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@dotdotgod/cli) [](https://github.com/dotdotgod/dotdotgod-kit/tree/main/packages/cli) [](../../LICENSE)
|
|
4
|
+
|
|
5
|
+
> **Change a file, know what else must be checked.**
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
$ dotdotgod graph impact . --changed packages/cli/src/core.mjs --compact
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
docs:
|
|
13
|
+
- docs/spec/REFERENCE_EXPANSION.md (91; incoming:implemented_by, semantic_similarity)
|
|
14
|
+
- docs/test/REFERENCE_EXPANSION.md (65.3; verified_by, semantic_similarity)
|
|
15
|
+
- docs/spec/LOAD_PROJECT.md (35.8; related_doc, semantic_similarity)
|
|
16
|
+
|
|
17
|
+
tests:
|
|
18
|
+
- packages/cli/test/core.test.mjs (78.6; semantic_similarity, incoming:semantic_similarity, verified_by)
|
|
19
|
+
- packages/cli/test/e2e.test.mjs (51.4; verified_by)
|
|
20
|
+
|
|
21
|
+
files:
|
|
22
|
+
- packages/cli/src/core.mjs (100; changed-file)
|
|
23
|
+
- packages/pi/extensions/plan-mode/index.ts (45; implemented_by, semantic_similarity)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`graph impact` ranks the specs, tests, architecture notes, config docs, and source files most likely to matter for a change. `--compact` keeps the result agent-facing: grouped by docs/tests/files and annotated with the reasons each item is likely relevant. It uses the project-memory graph built from Markdown links, README routes, headings, traceability blocks, package metadata, memory areas, and deterministic routing hints.
|
|
27
|
+
|
|
28
|
+
Command-line tools for dotdotgod project memory. The CLI turns explicit, maintained project links into a local graph/cache: README routes, Markdown links, traceability blocks, memory areas, package metadata, commands, tests, and deterministic routing hints. That maintained graph powers `graph impact`, while the initialized docs surface keeps agent load context high signal.
|
|
29
|
+
|
|
30
|
+
## Why Use It?
|
|
31
|
+
|
|
32
|
+
- Initialize `AGENTS.md`, thin agent entrypoints, docs indexes, active-plan space, archive map, and local cache ignores with `dotdotgod init`.
|
|
33
|
+
- Replace ad-hoc docs checks with `dotdotgod validate`.
|
|
34
|
+
- Build `.dotdotgod/` as a local ignored cache of file fingerprints and compact graph shards derived from maintained project links.
|
|
35
|
+
- Use `load-snapshot` as a bounded first-pass map for high-quality agent loading.
|
|
36
|
+
- Resolve explicit `[[...]]` references or high-signal fuzzy references before broad text search.
|
|
37
|
+
- Query safe review scope for a changed file with grouped, bounded impact reports.
|
|
38
|
+
- Inspect or initialize project config with `dotdotgod config` and `dotdotgod config init`.
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
dotdotgod --help
|
|
44
|
+
dotdotgod --version
|
|
45
|
+
dotdotgod init .
|
|
46
|
+
dotdotgod validate .
|
|
47
|
+
dotdotgod validate . --check-index
|
|
48
|
+
dotdotgod config .
|
|
49
|
+
dotdotgod config init .
|
|
50
|
+
dotdotgod status .
|
|
51
|
+
dotdotgod index .
|
|
52
|
+
dotdotgod load-snapshot .
|
|
53
|
+
dotdotgod resolve . PLAN_MODE
|
|
54
|
+
dotdotgod expand . "Update [[PLAN_MODE]] and [[HOOKS]]"
|
|
55
|
+
dotdotgod expand . "PLAN_MODE 수정하자" --fuzzy
|
|
56
|
+
dotdotgod graph impact . --changed <path>
|
|
57
|
+
dotdotgod graph impact . --changed <path> --compact
|
|
58
|
+
dotdotgod graph communities .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`--help`, `-h`, and `help` print usage to stdout. Command-specific help is available with `dotdotgod <command> --help`, including nested commands such as `dotdotgod graph impact --help` and `dotdotgod config init --help`.
|
|
62
|
+
|
|
63
|
+
## Graph, Cache, and Impact
|
|
64
|
+
|
|
65
|
+
The cache uses `.dotdotgod/manifest.json` plus graph shards under `.dotdotgod/graph/`. `status` is read-only. `load-snapshot`, `resolve`, `expand`, and `graph` commands lazily refresh missing or stale cache data before returning agent-facing output.
|
|
66
|
+
|
|
67
|
+
`graph impact` requires `--changed <path>` so ranking has a seed file. Raw JSON is useful for diagnostics; `--compact` returns a smaller grouped summary for agents. Related nodes include scores, reasons, and retrieval metadata, and output stays bounded with omitted counts.
|
|
68
|
+
|
|
69
|
+
`graph communities` runs Leiden community detection through `leiden-ts` with a deterministic fallback for tiny or invalid graphs.
|
|
70
|
+
|
|
71
|
+
## Reference Expansion
|
|
72
|
+
|
|
73
|
+
`resolve` maps one project-memory reference such as `PLAN_MODE` or `docs/spec/PLAN_MODE.md` to ranked graph candidates. `expand` scans prompt text for `[[refs]]`, resolves each target, and can include compact impact context with `--with-impact`.
|
|
74
|
+
|
|
75
|
+
Use `expand --fuzzy` for high-signal natural prompt references such as uppercase identifiers, path-like mentions, quoted phrases, and strong indexed aliases. Fuzzy low-signal terms use built-in defaults and can be adjusted in `dotdotgod.config.json` with `referenceExpansion.fuzzy.lowSignal.add` and `remove`. Archive bodies are excluded by default unless `--include-archive` is passed.
|
|
76
|
+
|
|
77
|
+
## Memory, Specs, and Config
|
|
78
|
+
|
|
79
|
+
The default docs scaffold gives files explicit project-memory meaning:
|
|
80
|
+
|
|
81
|
+
- `docs/spec/**`: stable shared/fresh product truth and, by default, the traceability-enforced behavior-spec path.
|
|
82
|
+
- `docs/arch/**`: stable shared/fresh architecture rationale.
|
|
83
|
+
- `docs/test/**`: stable shared/fresh verification knowledge.
|
|
84
|
+
- `docs/plan/**`: local fresh active-task intent.
|
|
85
|
+
- `docs/archive/README.md`: local stale archive map included by default.
|
|
86
|
+
- `docs/archive/**`: local stale archive bodies excluded by default.
|
|
87
|
+
|
|
88
|
+
Those roles are configurable but separate. Use `memory.areas` to customize memory classification and retrieval priority. Use `traceability.required` / `traceability.exclude` to customize which markdown paths must end with `json dotdotgod` traceability blocks. Use `validation.markdown`, `impactRanking`, and `referenceExpansion` to tune size budgets, impact scoring, and fuzzy prompt matching.
|
|
89
|
+
|
|
90
|
+
See the [root README](../../README.md), [GitHub repository](https://github.com/dotdotgod/dotdotgod-kit), [`docs/concept/CONTEXT_CURATION.md`](../../docs/concept/CONTEXT_CURATION.md), [`docs/concept/CONTEXT_MECHANICS.md`](../../docs/concept/CONTEXT_MECHANICS.md), [`docs/spec/MEMORY_AREA_CONFIG.md`](../../docs/spec/MEMORY_AREA_CONFIG.md), and [`docs/spec/TRACEABILITY_CONFIG.md`](../../docs/spec/TRACEABILITY_CONFIG.md) for the deeper model.
|
|
91
|
+
|
|
92
|
+
## Indexing Scope
|
|
93
|
+
|
|
94
|
+
`dotdotgod index` is gitignore-aware by default. It uses `git ls-files --cached --others --exclude-standard` when possible, then filters to supported text, source, script, config, web, and infrastructure files. In non-git contexts it falls back to a conservative directory walk.
|
|
95
|
+
|
|
96
|
+
Default exclusions include dependency, generated, cache, and secret-like paths such as `.git/`, `.dotdotgod/`, `node_modules/`, `dist/`, `build/`, `coverage/`, `.next/`, `target/`, `vendor/`, `.venv/`, and `.env`. Example env templates such as `.env.example` remain indexable.
|
|
97
|
+
|
|
98
|
+
## Compared with Graphify-Style Reports
|
|
99
|
+
|
|
100
|
+
The CLI is not designed to make agents read a giant graph report. The full graph stays local; agent-facing output is bounded. The strength is explicit project-maintained links before extraction: docs areas, README indexes, traceability blocks, package metadata, commands, tests, and memory policy tell agents which files are behavior truth, architecture rationale, verification, current intent, or historical memory before they read source.
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dotdotgod/cli",
|
|
3
|
+
"version": "0.1.21",
|
|
4
|
+
"description": "CLI for dotdotgod validation, project memory snapshots, and graph indexing.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Elastic-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"dotdotgod": "./bin/dotdotgod.mjs"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"agent-memory",
|
|
15
|
+
"ai-coding-agent",
|
|
16
|
+
"context-curation",
|
|
17
|
+
"docs",
|
|
18
|
+
"dotdotgod",
|
|
19
|
+
"graph-impact",
|
|
20
|
+
"knowledge-graph",
|
|
21
|
+
"markdown",
|
|
22
|
+
"traceability",
|
|
23
|
+
"validator"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "node --test test/*.test.mjs",
|
|
27
|
+
"verify": "node --check bin/dotdotgod.mjs && node --check src/core.mjs && pnpm run test && node bin/dotdotgod.mjs validate ../.. --include-local-memory",
|
|
28
|
+
"pack:dry-run": "pnpm pack --dry-run --json"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"src",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"leiden-ts": "^0.1.0"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/dotdotgod/dotdotgod-kit/tree/main/packages/cli#readme",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/dotdotgod/dotdotgod-kit.git",
|
|
43
|
+
"directory": "packages/cli"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/dotdotgod/dotdotgod-kit/issues"
|
|
47
|
+
}
|
|
48
|
+
}
|