@legacycodehq/clarity 0.15.0 → 0.15.2
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 +84 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@legacycodehq/clarity)
|
|
7
7
|
[](https://goreportcard.com/report/github.com/LegacyCodeHQ/clarity)
|
|
8
8
|
|
|
9
|
-
Clarity is a software design tool for developers and coding agents.
|
|
9
|
+
Clarity is a software design tool for AI-native developers and coding agents.
|
|
10
10
|
|
|
11
11
|
> **Renamed from Sanity:** If you previously used `sanity`, this is the same project under a new name.
|
|
12
12
|
|
|
13
|
+
**Note:** Clarity supports [**13 languages**](#supported-languages) (parsing quality may vary by language).
|
|
14
|
+
|
|
15
|
+
## What You Get
|
|
16
|
+
|
|
17
|
+
Clarity generates impact graphs from your code so you can review design effects before commit.
|
|
18
|
+
|
|
19
|
+
- Keep a live impact view while coding with `clarity watch`.
|
|
20
|
+
- Generate focused snapshots for uncommitted changes, commits, commit ranges, and file-to-file paths with `clarity show`.
|
|
21
|
+
- Run repeatable design checks in developer and coding-agent workflows, with shareable visualization output when needed.
|
|
22
|
+
|
|
13
23
|
## Quick Start
|
|
14
24
|
|
|
15
25
|
**Step 1:** Install with npm (cross-platform):
|
|
@@ -24,78 +34,112 @@ Or install on macOS/Linux using Homebrew:
|
|
|
24
34
|
brew install LegacyCodeHQ/tap/clarity
|
|
25
35
|
```
|
|
26
36
|
|
|
37
|
+
For more install options see the [installation guide](docs/usage/installation.md).
|
|
38
|
+
|
|
27
39
|
**Step 2:** Inside your project:
|
|
28
40
|
|
|
29
41
|
```bash
|
|
30
|
-
clarity setup #
|
|
42
|
+
clarity setup # Configures AGENTS.md for your coding agent to use Clarity
|
|
31
43
|
```
|
|
32
44
|
|
|
33
|
-
|
|
45
|
+
**Step 3:** Start with a live impact view while you code:
|
|
34
46
|
|
|
35
|
-
|
|
47
|
+
```bash
|
|
48
|
+
clarity watch
|
|
49
|
+
```
|
|
36
50
|
|
|
37
|
-
|
|
38
|
-
- C++
|
|
39
|
-
- C#
|
|
40
|
-
- Dart
|
|
41
|
-
- Go
|
|
42
|
-
- JavaScript
|
|
43
|
-
- Java
|
|
44
|
-
- Kotlin
|
|
45
|
-
- Python
|
|
46
|
-
- Ruby
|
|
47
|
-
- Rust
|
|
48
|
-
- Swift
|
|
49
|
-
- TypeScript
|
|
51
|
+
## Developers & Agents
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
Clarity helps teams using coding agents make safer, faster design changes.
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
- Understand codebases
|
|
55
|
-
- [Audit AI-generated code](https://youtu.be/EqOwJnZSiQs)
|
|
56
|
-
- Stabilize and reclaim apps built with AI
|
|
55
|
+
**For developers**, the value is practical:
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
- Understand what a change will affect before commit.
|
|
58
|
+
- Review architecture and design impact quickly during feature work.
|
|
59
|
+
- Give coding agents concrete feedback grounded in actual low-level design.
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
**For agents**, Clarity provides a deterministic and repeatable way to verify and validate their design changes.
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
### Developer Workflows
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
#### 1) During development: keep impact visible while making changes
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
clarity watch
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Use `clarity watch` during active development to keep design impact visible as the codebase evolves.
|
|
72
|
+
|
|
73
|
+
#### 2) Before committing: generate focused change context
|
|
74
|
+
|
|
75
|
+
If your coding agent is already configured with Clarity via `clarity setup` (one-time), the agent can run these commands and render
|
|
76
|
+
a diagram for you.
|
|
77
|
+
|
|
78
|
+
If not, run them manually as part of your development flow.
|
|
65
79
|
|
|
66
80
|
```bash
|
|
67
81
|
clarity show # Visualize uncommitted changes
|
|
68
82
|
clarity show -c HEAD # Visualize the latest commit
|
|
69
83
|
clarity show -c HEAD~3...HEAD # Visualize a commit range
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Use this output to answer: "What did we actually touch?", "What does the solution look like?" and "Which parts of the system are now coupled?"
|
|
87
|
+
|
|
88
|
+
#### 3) Explore the codebase and debug design decisions: trace specific relationships
|
|
89
|
+
|
|
90
|
+
```bash
|
|
70
91
|
clarity show -i src,tests # Build graph from specific files/directories
|
|
71
92
|
clarity show -w a.go,b.go # Show all paths between files
|
|
72
|
-
clarity show -f mermaid # Mermaid output (default is dot)
|
|
73
|
-
clarity show -u # Generate a shareable visualization URL
|
|
74
|
-
clarity languages # List supported languages and extensions
|
|
75
93
|
```
|
|
76
94
|
|
|
77
|
-
|
|
95
|
+
**Note:** Use the `-u` flag, as in `clarity show -u` to generate a shareable visualization URL.
|
|
78
96
|
|
|
79
|
-
|
|
97
|
+
> **💡 Tip:** During design discussions, use actual graphs to explain or challenge design decisions with evidence instead of intuition.
|
|
80
98
|
|
|
81
|
-
|
|
82
|
-
- `-f mermaid`: Mermaid flowchart output
|
|
83
|
-
- `-u`: Generate a visualization URL for supported formats
|
|
99
|
+
#### When to Use `watch` vs `show`
|
|
84
100
|
|
|
85
|
-
|
|
101
|
+
If your coding agent is configured using `clarity setup`, running `clarity show` manually is optional.
|
|
86
102
|
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
| Use case | Command | Why |
|
|
104
|
+
|--------------------------------------------------------------|-------------------------|--------------------------------------------------------------------------------|
|
|
105
|
+
| You are actively coding and want continuous feedback | `clarity watch` | Keeps a live view updated as files change so you can catch design drift early. |
|
|
106
|
+
| You want a point-in-time view of current uncommitted work | `clarity show` | Produces a snapshot of what your current changes impact. |
|
|
107
|
+
| You are reviewing committed history (single commit or range) | `clarity show -c <rev>` | Focuses analysis on specific commits for review or debugging. |
|
|
108
|
+
| You want a shareable/browser-friendly view | `clarity show -u` | Generates a visualization URL you can open or share. |
|
|
89
109
|
|
|
90
|
-
|
|
110
|
+
### Agent Workflow
|
|
91
111
|
|
|
92
|
-
|
|
112
|
+
If you use a coding agent, set up Clarity once so the agent can include design checks in its normal loop.
|
|
113
|
+
|
|
114
|
+
1. Run `clarity setup` in your repository.
|
|
115
|
+
2. Confirm `AGENTS.md` includes Clarity instructions.
|
|
116
|
+
3. Ask your agent to run `clarity show` after meaningful changes and use the output in its review.
|
|
93
117
|
|
|
94
118
|
<p align="center">
|
|
95
119
|
<img src="docs/images/clarity+codex-app.png" alt="Clarity graph in Codex app">
|
|
96
|
-
<small>Clarity
|
|
120
|
+
<small>Clarity highlights impacted files and related tests so you can review design impact before commit.</small>
|
|
97
121
|
</p>
|
|
98
122
|
|
|
123
|
+
Clarity works across desktop and CLI-based agent workflows.
|
|
124
|
+
In desktop products, agents can render Mermaid diagrams inline.
|
|
125
|
+
In CLI workflows, agents are configured to open a generated visualization URL in a new browser tab when showing design output.
|
|
126
|
+
|
|
127
|
+
## Supported Languages
|
|
128
|
+
|
|
129
|
+
- C
|
|
130
|
+
- C++
|
|
131
|
+
- C#
|
|
132
|
+
- Dart
|
|
133
|
+
- Go
|
|
134
|
+
- JavaScript
|
|
135
|
+
- Java
|
|
136
|
+
- Kotlin
|
|
137
|
+
- Python
|
|
138
|
+
- Ruby
|
|
139
|
+
- Rust
|
|
140
|
+
- Swift
|
|
141
|
+
- TypeScript
|
|
142
|
+
|
|
99
143
|
---
|
|
100
144
|
|
|
101
145
|
## License
|