the-grid-cc 1.7.1 → 1.7.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/01-SUMMARY.md +95 -0
- package/README.md +31 -13
- package/assets/terminal.svg +74 -0
- package/commands/grid/VERSION +1 -1
- package/package.json +1 -1
- package/tools/grid-viz/PLAN.md +235 -0
- package/tools/grid-viz/README.md +84 -0
- package/tools/grid-viz/VERIFICATION.md +197 -0
- package/tools/grid-viz/grid-viz.js +248 -0
- package/tools/grid-viz/node_modules/.package-lock.json +78 -0
- package/tools/grid-viz/node_modules/ansi-styles/index.d.ts +345 -0
- package/tools/grid-viz/node_modules/ansi-styles/index.js +163 -0
- package/tools/grid-viz/node_modules/ansi-styles/license +9 -0
- package/tools/grid-viz/node_modules/ansi-styles/package.json +56 -0
- package/tools/grid-viz/node_modules/ansi-styles/readme.md +152 -0
- package/tools/grid-viz/node_modules/chalk/index.d.ts +415 -0
- package/tools/grid-viz/node_modules/chalk/license +9 -0
- package/tools/grid-viz/node_modules/chalk/package.json +68 -0
- package/tools/grid-viz/node_modules/chalk/readme.md +341 -0
- package/tools/grid-viz/node_modules/chalk/source/index.js +229 -0
- package/tools/grid-viz/node_modules/chalk/source/templates.js +134 -0
- package/tools/grid-viz/node_modules/chalk/source/util.js +39 -0
- package/tools/grid-viz/node_modules/color-convert/CHANGELOG.md +54 -0
- package/tools/grid-viz/node_modules/color-convert/LICENSE +21 -0
- package/tools/grid-viz/node_modules/color-convert/README.md +68 -0
- package/tools/grid-viz/node_modules/color-convert/conversions.js +839 -0
- package/tools/grid-viz/node_modules/color-convert/index.js +81 -0
- package/tools/grid-viz/node_modules/color-convert/package.json +48 -0
- package/tools/grid-viz/node_modules/color-convert/route.js +97 -0
- package/tools/grid-viz/node_modules/color-name/LICENSE +8 -0
- package/tools/grid-viz/node_modules/color-name/README.md +11 -0
- package/tools/grid-viz/node_modules/color-name/index.js +152 -0
- package/tools/grid-viz/node_modules/color-name/package.json +28 -0
- package/tools/grid-viz/node_modules/has-flag/index.d.ts +39 -0
- package/tools/grid-viz/node_modules/has-flag/index.js +8 -0
- package/tools/grid-viz/node_modules/has-flag/license +9 -0
- package/tools/grid-viz/node_modules/has-flag/package.json +46 -0
- package/tools/grid-viz/node_modules/has-flag/readme.md +89 -0
- package/tools/grid-viz/node_modules/supports-color/browser.js +5 -0
- package/tools/grid-viz/node_modules/supports-color/index.js +135 -0
- package/tools/grid-viz/node_modules/supports-color/license +9 -0
- package/tools/grid-viz/node_modules/supports-color/package.json +53 -0
- package/tools/grid-viz/node_modules/supports-color/readme.md +76 -0
- package/tools/grid-viz/package-lock.json +89 -0
- package/tools/grid-viz/package.json +23 -0
package/01-SUMMARY.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
cluster: grid-viz
|
|
3
|
+
block: 01
|
|
4
|
+
subsystem: tooling
|
|
5
|
+
requires:
|
|
6
|
+
- block: none
|
|
7
|
+
provides: "Initial block"
|
|
8
|
+
provides:
|
|
9
|
+
- "Terminal visualization tool for Grid state"
|
|
10
|
+
- "Colorful CLI output with progress bars and status"
|
|
11
|
+
- "Scratchpad, blockers, and learnings display"
|
|
12
|
+
affects:
|
|
13
|
+
- Future Grid monitoring and debugging workflows
|
|
14
|
+
tech-stack:
|
|
15
|
+
added: [chalk@4.1.2, Node.js CLI]
|
|
16
|
+
patterns: [markdown parsing, terminal visualization, ANSI colors]
|
|
17
|
+
key-files:
|
|
18
|
+
created:
|
|
19
|
+
- tools/grid-viz/grid-viz.js
|
|
20
|
+
- tools/grid-viz/package.json
|
|
21
|
+
- tools/grid-viz/README.md
|
|
22
|
+
- tools/grid-viz/package-lock.json
|
|
23
|
+
modified: []
|
|
24
|
+
commits: [210b17a, 13407a9, 8e3313b]
|
|
25
|
+
|
|
26
|
+
# WARMTH - knowledge that survives to next Program
|
|
27
|
+
lessons_learned:
|
|
28
|
+
codebase_patterns:
|
|
29
|
+
- "Grid state lives in .grid/ directory at project root"
|
|
30
|
+
- "STATE.md uses markdown with ## headings and **Label:** format"
|
|
31
|
+
- "Scratchpad entries use ### for entry headers"
|
|
32
|
+
- "LEARNINGS.md, BLOCKERS.md, DECISIONS.md use bullet lists"
|
|
33
|
+
gotchas:
|
|
34
|
+
- "chalk ^4.1.2 is CommonJS compatible; v5+ is ESM only"
|
|
35
|
+
- "Node.js scripts need #!/usr/bin/env node shebang"
|
|
36
|
+
- "chmod +x required for executable scripts"
|
|
37
|
+
user_preferences:
|
|
38
|
+
- "User prefers ANSI art and terminal aesthetics (Grid theme)"
|
|
39
|
+
- "Clean output with visual hierarchy (colors, spacing)"
|
|
40
|
+
- "'End of Line.' footer matches Grid lore"
|
|
41
|
+
almost_did:
|
|
42
|
+
- "Considered using chalk v5, chose v4 for CommonJS compatibility"
|
|
43
|
+
- "Almost used JSON for state, but Grid uses markdown"
|
|
44
|
+
fragile_areas:
|
|
45
|
+
- "Markdown parsing is basic - assumes specific formatting"
|
|
46
|
+
- "Progress percentage extraction uses regex - brittle if format changes"
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
# Block 01: grid-viz Terminal Visualization Summary
|
|
50
|
+
|
|
51
|
+
**One-liner:** Terminal visualization tool displaying Grid state with colorful CLI output, progress bars, and scratchpad entries using chalk@4.1.2
|
|
52
|
+
|
|
53
|
+
## Tasks Completed
|
|
54
|
+
|
|
55
|
+
| Thread | Name | Commit | Files |
|
|
56
|
+
|--------|------|--------|-------|
|
|
57
|
+
| 1 | Create grid-viz.js | 210b17a | grid-viz.js (248 lines) |
|
|
58
|
+
| 2 | Create package.json and README | 13407a9 | package.json, README.md |
|
|
59
|
+
| 3 | Test and install dependencies | 8e3313b | node_modules/, package-lock.json |
|
|
60
|
+
|
|
61
|
+
## Deviations from Plan
|
|
62
|
+
|
|
63
|
+
None - plan executed exactly as written.
|
|
64
|
+
|
|
65
|
+
## Decisions Made
|
|
66
|
+
|
|
67
|
+
**1. Use chalk v4.1.2 instead of v5+**
|
|
68
|
+
- Rationale: v4 uses CommonJS (require), v5+ is ESM-only
|
|
69
|
+
- Grid tooling expects traditional Node.js scripts
|
|
70
|
+
- Better compatibility with existing tools
|
|
71
|
+
|
|
72
|
+
**2. Auto-discover .grid directory**
|
|
73
|
+
- Rationale: User can run from anywhere in project tree
|
|
74
|
+
- Searches current directory and parents
|
|
75
|
+
- More convenient than requiring exact path
|
|
76
|
+
|
|
77
|
+
**3. Graceful degradation for missing files**
|
|
78
|
+
- Rationale: Not all .grid files exist in every project
|
|
79
|
+
- Tool should show what's available
|
|
80
|
+
- Better UX than failing on missing files
|
|
81
|
+
|
|
82
|
+
**4. Parse markdown instead of JSON**
|
|
83
|
+
- Rationale: Grid uses markdown for human readability
|
|
84
|
+
- STATE.md, SCRATCHPAD.md are markdown format
|
|
85
|
+
- Simple regex/string parsing sufficient
|
|
86
|
+
|
|
87
|
+
## Next Block Readiness
|
|
88
|
+
|
|
89
|
+
Tool is ready for integration into Grid CLI if desired. Potential enhancements:
|
|
90
|
+
- Add watch mode (--watch flag for live updates)
|
|
91
|
+
- Export JSON format for programmatic use
|
|
92
|
+
- Add filtering options (--blockers-only, --scratchpad-only)
|
|
93
|
+
- Integration with grid status command
|
|
94
|
+
|
|
95
|
+
No blockers for future work.
|
package/README.md
CHANGED
|
@@ -1,33 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">THE GRID</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<strong>
|
|
5
|
-
<br>
|
|
6
|
-
Multi-agent orchestration for Claude Code that keeps your context clean
|
|
4
|
+
<strong>Multi-agent orchestration for Claude Code that keeps your context clean.</strong>
|
|
7
5
|
</p>
|
|
8
6
|
|
|
9
7
|
<p align="center">
|
|
10
|
-
|
|
11
|
-
<a href="#three-modes">Three Modes</a> •
|
|
12
|
-
<a href="#commands">Commands</a> •
|
|
13
|
-
<a href="#faq">FAQ</a>
|
|
8
|
+
Solves context rot — the quality degradation that happens as Claude fills its context window.
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
11
|
<p align="center">
|
|
17
12
|
<a href="https://www.npmjs.com/package/the-grid-cc">
|
|
18
13
|
<img src="https://img.shields.io/npm/v/the-grid-cc?style=for-the-badge&logo=npm&logoColor=white&color=CB3837" alt="npm version"/>
|
|
19
14
|
</a>
|
|
20
|
-
<a href="https://github.com/JamesWeatherhead/grid/stargazers">
|
|
21
|
-
<img src="https://img.shields.io/github/stars/JamesWeatherhead/grid?style=for-the-badge" alt="GitHub stars"/>
|
|
22
|
-
</a>
|
|
23
15
|
<a href="https://www.npmjs.com/package/the-grid-cc">
|
|
24
|
-
<img src="https://img.shields.io/npm/dm/the-grid-cc?style=for-the-badge" alt="npm downloads"/>
|
|
16
|
+
<img src="https://img.shields.io/npm/dm/the-grid-cc?style=for-the-badge&color=blue" alt="npm downloads"/>
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://github.com/JamesWeatherhead/grid/stargazers">
|
|
19
|
+
<img src="https://img.shields.io/github/stars/JamesWeatherhead/grid?style=for-the-badge&color=yellow" alt="GitHub stars"/>
|
|
25
20
|
</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
26
24
|
<a href="https://github.com/JamesWeatherhead/grid/blob/main/LICENSE">
|
|
27
|
-
<img src="https://img.shields.io/badge/
|
|
25
|
+
<img src="https://img.shields.io/badge/LICENSE-MIT-cyan.svg?style=for-the-badge" alt="MIT License"/>
|
|
28
26
|
</a>
|
|
29
27
|
</p>
|
|
30
28
|
|
|
29
|
+
<br>
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
npx the-grid-cc
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
<strong>Works on Mac, Windows, and Linux.</strong>
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
<br>
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<img src="assets/terminal.svg" alt="The Grid Terminal" width="700"/>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
31
49
|
---
|
|
32
50
|
|
|
33
51
|
## The Problem
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 520">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="termBg" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#2d2d2d"/>
|
|
5
|
+
<stop offset="100%" style="stop-color:#1a1a1a"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
|
|
9
|
+
<!-- Terminal window -->
|
|
10
|
+
<rect width="800" height="520" rx="10" fill="url(#termBg)"/>
|
|
11
|
+
|
|
12
|
+
<!-- Title bar -->
|
|
13
|
+
<rect width="800" height="32" rx="10" fill="#3d3d3d"/>
|
|
14
|
+
<rect y="22" width="800" height="10" fill="#3d3d3d"/>
|
|
15
|
+
|
|
16
|
+
<!-- Traffic lights -->
|
|
17
|
+
<circle cx="20" cy="16" r="6" fill="#ff5f57"/>
|
|
18
|
+
<circle cx="40" cy="16" r="6" fill="#febc2e"/>
|
|
19
|
+
<circle cx="60" cy="16" r="6" fill="#28c840"/>
|
|
20
|
+
|
|
21
|
+
<!-- Title -->
|
|
22
|
+
<text x="400" y="20" fill="#888" font-family="SF Mono, Monaco, monospace" font-size="13" text-anchor="middle">Terminal</text>
|
|
23
|
+
|
|
24
|
+
<!-- Terminal content -->
|
|
25
|
+
<text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14" fill="#ccc">
|
|
26
|
+
<!-- Prompt -->
|
|
27
|
+
<tspan x="20" y="60" fill="#6cf">~</tspan>
|
|
28
|
+
<tspan fill="#888"> $ </tspan>
|
|
29
|
+
<tspan fill="#fff">npx the-grid-cc</tspan>
|
|
30
|
+
|
|
31
|
+
<!-- ASCII Art - THE GRID -->
|
|
32
|
+
<tspan x="20" y="100" fill="#0ff"> ████████╗██╗ ██╗███████╗ ██████╗ ██████╗ ██╗██████╗ </tspan>
|
|
33
|
+
<tspan x="20" y="118" fill="#0ff"> ╚══██╔══╝██║ ██║██╔════╝ ██╔════╝ ██╔══██╗██║██╔══██╗</tspan>
|
|
34
|
+
<tspan x="20" y="136" fill="#0ff"> ██║ ███████║█████╗ ██║ ███╗██████╔╝██║██║ ██║</tspan>
|
|
35
|
+
<tspan x="20" y="154" fill="#0ff"> ██║ ██╔══██║██╔══╝ ██║ ██║██╔══██╗██║██║ ██║</tspan>
|
|
36
|
+
<tspan x="20" y="172" fill="#0ff"> ██║ ██║ ██║███████╗ ╚██████╔╝██║ ██║██║██████╔╝</tspan>
|
|
37
|
+
<tspan x="20" y="190" fill="#0ff"> ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ </tspan>
|
|
38
|
+
|
|
39
|
+
<!-- Version -->
|
|
40
|
+
<tspan x="20" y="230" fill="#fff">The Grid</tspan>
|
|
41
|
+
<tspan fill="#888"> v1.7.2</tspan>
|
|
42
|
+
|
|
43
|
+
<tspan x="20" y="250" fill="#888">Multi-agent orchestration for Claude Code</tspan>
|
|
44
|
+
|
|
45
|
+
<!-- Installation -->
|
|
46
|
+
<tspan x="20" y="290" fill="#28c840">✓</tspan>
|
|
47
|
+
<tspan fill="#ccc"> Installed commands/grid</tspan>
|
|
48
|
+
<tspan x="20" y="310" fill="#28c840">✓</tspan>
|
|
49
|
+
<tspan fill="#ccc"> Installed agents</tspan>
|
|
50
|
+
|
|
51
|
+
<!-- Done -->
|
|
52
|
+
<tspan x="20" y="350" fill="#28c840">Done!</tspan>
|
|
53
|
+
<tspan fill="#ccc"> Run </tspan>
|
|
54
|
+
<tspan fill="#fff">/grid</tspan>
|
|
55
|
+
<tspan fill="#ccc"> to get started.</tspan>
|
|
56
|
+
|
|
57
|
+
<!-- Master Control session -->
|
|
58
|
+
<tspan x="20" y="390" fill="#6cf">~</tspan>
|
|
59
|
+
<tspan fill="#888"> $ </tspan>
|
|
60
|
+
<tspan fill="#fff">/grid</tspan>
|
|
61
|
+
|
|
62
|
+
<tspan x="20" y="430" fill="#0ff">THE GRID</tspan>
|
|
63
|
+
<tspan x="20" y="448" fill="#0ff">════════</tspan>
|
|
64
|
+
|
|
65
|
+
<tspan x="20" y="478" fill="#fff">Master Control online.</tspan>
|
|
66
|
+
|
|
67
|
+
<tspan x="20" y="508" fill="#ccc">What would you like to build?</tspan>
|
|
68
|
+
</text>
|
|
69
|
+
|
|
70
|
+
<!-- Cursor -->
|
|
71
|
+
<rect x="20" y="495" width="8" height="16" fill="#fff" opacity="0.8">
|
|
72
|
+
<animate attributeName="opacity" values="0.8;0;0.8" dur="1s" repeatCount="indefinite"/>
|
|
73
|
+
</rect>
|
|
74
|
+
</svg>
|
package/commands/grid/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.7.
|
|
1
|
+
1.7.2
|
package/package.json
CHANGED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
---
|
|
2
|
+
cluster: grid-viz
|
|
3
|
+
block: 01
|
|
4
|
+
type: execute
|
|
5
|
+
wave: 1
|
|
6
|
+
depends_on: []
|
|
7
|
+
files_modified:
|
|
8
|
+
- tools/grid-viz/grid-viz.js
|
|
9
|
+
- tools/grid-viz/package.json
|
|
10
|
+
- tools/grid-viz/README.md
|
|
11
|
+
autonomous: true
|
|
12
|
+
|
|
13
|
+
must_haves:
|
|
14
|
+
truths:
|
|
15
|
+
- "User can run grid-viz.js and see formatted Grid state"
|
|
16
|
+
- "Progress bar displays current block/phase completion"
|
|
17
|
+
- "Recent scratchpad entries are visible"
|
|
18
|
+
- "Active blockers and decisions are highlighted"
|
|
19
|
+
- "Warmth/learnings count is shown"
|
|
20
|
+
artifacts:
|
|
21
|
+
- path: "tools/grid-viz/grid-viz.js"
|
|
22
|
+
provides: "Main CLI visualization script"
|
|
23
|
+
min_lines: 150
|
|
24
|
+
exports: []
|
|
25
|
+
- path: "tools/grid-viz/package.json"
|
|
26
|
+
provides: "Package manifest with chalk dependency"
|
|
27
|
+
exports: []
|
|
28
|
+
- path: "tools/grid-viz/README.md"
|
|
29
|
+
provides: "Usage documentation"
|
|
30
|
+
min_lines: 20
|
|
31
|
+
key_links:
|
|
32
|
+
- from: "grid-viz.js"
|
|
33
|
+
to: ".grid/STATE.md"
|
|
34
|
+
via: "fs.readFileSync parse"
|
|
35
|
+
pattern: "readFileSync.*STATE\\.md"
|
|
36
|
+
- from: "grid-viz.js"
|
|
37
|
+
to: ".grid/SCRATCHPAD.md"
|
|
38
|
+
via: "fs.readFileSync parse"
|
|
39
|
+
pattern: "readFileSync.*SCRATCHPAD\\.md"
|
|
40
|
+
- from: "grid-viz.js"
|
|
41
|
+
to: ".grid/LEARNINGS.md"
|
|
42
|
+
via: "fs.readFileSync parse"
|
|
43
|
+
pattern: "readFileSync.*LEARNINGS\\.md"
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<objective>
|
|
47
|
+
Build a terminal visualization tool that displays Grid project state in a clear, colorful format.
|
|
48
|
+
|
|
49
|
+
Purpose: Provide quick visual insight into Grid project progress without reading raw markdown files.
|
|
50
|
+
Output: Single-file Node.js CLI tool with chalk-based terminal rendering.
|
|
51
|
+
</objective>
|
|
52
|
+
|
|
53
|
+
<context>
|
|
54
|
+
Grid projects store state in .grid/ directory with structured markdown files:
|
|
55
|
+
- STATE.md: Current cluster, blocks, threads, active programs
|
|
56
|
+
- SCRATCHPAD.md: Running notes, discoveries, decisions
|
|
57
|
+
- LEARNINGS.md: Lessons learned during execution
|
|
58
|
+
|
|
59
|
+
This tool reads these files and renders a dashboard view with:
|
|
60
|
+
- Color-coded sections (chalk)
|
|
61
|
+
- Progress indicators for blocks/threads
|
|
62
|
+
- Recent activity highlights
|
|
63
|
+
- Visual hierarchy
|
|
64
|
+
|
|
65
|
+
Target usage: `node grid-viz.js` from Grid project root or `node /path/to/grid-viz.js` from anywhere.
|
|
66
|
+
</context>
|
|
67
|
+
|
|
68
|
+
<threads>
|
|
69
|
+
|
|
70
|
+
<thread type="auto">
|
|
71
|
+
<name>Thread 1: Create grid-viz.js with file parsing and terminal rendering</name>
|
|
72
|
+
<files>tools/grid-viz/grid-viz.js</files>
|
|
73
|
+
<action>
|
|
74
|
+
Create grid-viz.js as a single-file Node.js CLI tool:
|
|
75
|
+
|
|
76
|
+
1. **File Structure:**
|
|
77
|
+
- Shebang line: `#!/usr/bin/env node`
|
|
78
|
+
- Import: fs, path, chalk
|
|
79
|
+
- Helper functions: parseStateFile(), parseScratchpad(), parseLearnings()
|
|
80
|
+
- Rendering functions: renderHeader(), renderProgress(), renderScratchpad(), renderBlockers(), renderWarmth()
|
|
81
|
+
- Main function: main()
|
|
82
|
+
|
|
83
|
+
2. **File Parsing:**
|
|
84
|
+
- Read .grid/STATE.md: Extract cluster name, status, energy, blocks table
|
|
85
|
+
- Read .grid/SCRATCHPAD.md: Extract last 5 entries (look for timestamped sections or bullet points)
|
|
86
|
+
- Read .grid/LEARNINGS.md: Count total learnings entries
|
|
87
|
+
- Handle missing files gracefully (show "No .grid/ directory found")
|
|
88
|
+
|
|
89
|
+
3. **Terminal Rendering:**
|
|
90
|
+
- Header: Cyan bold "GRID PROJECT STATE" with cluster name
|
|
91
|
+
- Progress section:
|
|
92
|
+
- Green for COMPLETE blocks/threads
|
|
93
|
+
- Yellow for IN_PROGRESS
|
|
94
|
+
- White for PENDING
|
|
95
|
+
- Bar visualization using Unicode box characters
|
|
96
|
+
- Scratchpad: Recent discoveries (yellow highlights on key terms)
|
|
97
|
+
- Blockers: Red-highlighted active decisions from STATE.md "I/O TOWER" section
|
|
98
|
+
- Warmth: Count of learnings with flame emoji if >0
|
|
99
|
+
|
|
100
|
+
4. **Color Scheme:**
|
|
101
|
+
- Headers: cyan bold
|
|
102
|
+
- Success/complete: green
|
|
103
|
+
- In-progress: yellow
|
|
104
|
+
- Pending: white/dim
|
|
105
|
+
- Errors/blockers: red
|
|
106
|
+
- Highlights: magenta for important keywords
|
|
107
|
+
|
|
108
|
+
5. **Error Handling:**
|
|
109
|
+
- Check if .grid/ exists in current directory
|
|
110
|
+
- If not, show helpful message: "Not a Grid project. Run from Grid project root."
|
|
111
|
+
- Gracefully handle malformed markdown
|
|
112
|
+
|
|
113
|
+
**What to avoid and WHY:**
|
|
114
|
+
- Avoid complex CLI argument parsing - This is a simple visualization tool, not a complex CLI. Keep it single-purpose.
|
|
115
|
+
- Avoid external markdown parsers - Use simple regex/string parsing to keep it lightweight and dependency-free except chalk.
|
|
116
|
+
- Avoid real-time watching - This is a snapshot tool. Running it again shows updated state.
|
|
117
|
+
</action>
|
|
118
|
+
<verify>Run `node tools/grid-viz/grid-viz.js` from /Users/jacweath/grid and confirm it displays formatted state with colors</verify>
|
|
119
|
+
<done>grid-viz.js exists, reads all three .grid files, renders colorful terminal output with progress bars, scratchpad highlights, and warmth summary</done>
|
|
120
|
+
</thread>
|
|
121
|
+
|
|
122
|
+
<thread type="auto">
|
|
123
|
+
<name>Thread 2: Create package.json and README.md</name>
|
|
124
|
+
<files>tools/grid-viz/package.json, tools/grid-viz/README.md</files>
|
|
125
|
+
<action>
|
|
126
|
+
Create supporting files:
|
|
127
|
+
|
|
128
|
+
1. **package.json:**
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"name": "grid-viz",
|
|
132
|
+
"version": "1.0.0",
|
|
133
|
+
"description": "Terminal visualization for Grid project state",
|
|
134
|
+
"main": "grid-viz.js",
|
|
135
|
+
"bin": {
|
|
136
|
+
"grid-viz": "./grid-viz.js"
|
|
137
|
+
},
|
|
138
|
+
"dependencies": {
|
|
139
|
+
"chalk": "^4.1.2"
|
|
140
|
+
},
|
|
141
|
+
"engines": {
|
|
142
|
+
"node": ">=14.0.0"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
2. **README.md:**
|
|
148
|
+
Include:
|
|
149
|
+
- Project description
|
|
150
|
+
- Installation: `npm install` in tools/grid-viz/
|
|
151
|
+
- Usage:
|
|
152
|
+
- From Grid project: `node tools/grid-viz/grid-viz.js`
|
|
153
|
+
- From anywhere: `node /path/to/grid-viz.js` (must be in Grid project dir)
|
|
154
|
+
- Future: Install globally with `npm install -g`
|
|
155
|
+
- Screenshot/example output (ASCII art mockup)
|
|
156
|
+
- Requirements: Node 14+, chalk dependency
|
|
157
|
+
- What it displays:
|
|
158
|
+
- Cluster status and energy
|
|
159
|
+
- Block/thread progress
|
|
160
|
+
- Recent scratchpad discoveries (last 5)
|
|
161
|
+
- Active blockers from I/O Tower
|
|
162
|
+
- Warmth summary (learnings count)
|
|
163
|
+
|
|
164
|
+
**What to avoid and WHY:**
|
|
165
|
+
- Avoid overpromising features - Document only what exists now. No "coming soon" features.
|
|
166
|
+
- Avoid complex installation steps - This is a dev tool for Grid maintainers, not public npm package (yet).
|
|
167
|
+
</action>
|
|
168
|
+
<verify>Verify package.json is valid JSON and README.md is clear and accurate</verify>
|
|
169
|
+
<done>package.json and README.md exist with accurate content, npm install works in tools/grid-viz/</done>
|
|
170
|
+
</thread>
|
|
171
|
+
|
|
172
|
+
<thread type="auto">
|
|
173
|
+
<name>Thread 3: Test grid-viz with Grid repo state and document output format</name>
|
|
174
|
+
<files>tools/grid-viz/grid-viz.js</files>
|
|
175
|
+
<action>
|
|
176
|
+
Test and refine the visualization:
|
|
177
|
+
|
|
178
|
+
1. **Test Cases:**
|
|
179
|
+
- Run from /Users/jacweath/grid (has .grid/ directory)
|
|
180
|
+
- Test with COMPLETE cluster (current state)
|
|
181
|
+
- Verify colors render correctly in terminal
|
|
182
|
+
- Check progress bar calculation (e.g., 4/4 threads = 100% = full bar)
|
|
183
|
+
- Verify scratchpad parsing extracts recent entries
|
|
184
|
+
- Confirm learnings count is accurate
|
|
185
|
+
|
|
186
|
+
2. **Output Format Refinement:**
|
|
187
|
+
- Ensure proper spacing and alignment
|
|
188
|
+
- Use Unicode box-drawing characters for visual structure:
|
|
189
|
+
- ┌─┐ │ ├─┤ └─┘ for sections
|
|
190
|
+
- ▓░ for progress bars
|
|
191
|
+
- Keep total output under 50 lines for quick scanning
|
|
192
|
+
- Make "no blockers" state clear (green checkmark)
|
|
193
|
+
|
|
194
|
+
3. **Edge Cases:**
|
|
195
|
+
- Empty scratchpad (show "No recent activity")
|
|
196
|
+
- Zero learnings (show "No learnings recorded yet")
|
|
197
|
+
- Missing I/O Tower section (skip blockers section)
|
|
198
|
+
- Malformed STATE.md (show error but don't crash)
|
|
199
|
+
|
|
200
|
+
4. **Documentation:**
|
|
201
|
+
- Add inline comments explaining file parsing logic
|
|
202
|
+
- Document expected .grid/ file structure at top of file
|
|
203
|
+
- Include example output in README.md
|
|
204
|
+
|
|
205
|
+
**What to avoid and WHY:**
|
|
206
|
+
- Avoid assuming specific STATE.md formats - Parse flexibly since Grid state format may evolve.
|
|
207
|
+
- Avoid truncating important info - Show all blockers/decisions even if many (they're critical).
|
|
208
|
+
</action>
|
|
209
|
+
<verify>Run `cd /Users/jacweath/grid && node tools/grid-viz/grid-viz.js` and confirm output is clear, colorful, and informative</verify>
|
|
210
|
+
<done>grid-viz tested successfully with Grid repo, handles edge cases gracefully, README includes example output</done>
|
|
211
|
+
</thread>
|
|
212
|
+
|
|
213
|
+
</threads>
|
|
214
|
+
|
|
215
|
+
<verification>
|
|
216
|
+
1. Run grid-viz from /Users/jacweath/grid and see formatted output
|
|
217
|
+
2. Check that colors display correctly (cyan headers, green success, yellow warnings, red errors)
|
|
218
|
+
3. Verify progress bars show correct completion percentages
|
|
219
|
+
4. Confirm scratchpad shows last 5 entries
|
|
220
|
+
5. Verify learnings count is accurate
|
|
221
|
+
6. Test error handling by running from non-Grid directory
|
|
222
|
+
7. Confirm package.json dependencies install correctly
|
|
223
|
+
</verification>
|
|
224
|
+
|
|
225
|
+
<success_criteria>
|
|
226
|
+
- grid-viz.js exists and is executable
|
|
227
|
+
- Displays Grid state with colors using chalk
|
|
228
|
+
- Shows progress bar for blocks/threads
|
|
229
|
+
- Renders recent scratchpad entries (last 5)
|
|
230
|
+
- Highlights active blockers/decisions
|
|
231
|
+
- Shows warmth summary (learnings count)
|
|
232
|
+
- Handles missing .grid/ directory gracefully
|
|
233
|
+
- README.md documents usage clearly
|
|
234
|
+
- Tool runs successfully from Grid project root
|
|
235
|
+
</success_criteria>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# grid-viz
|
|
2
|
+
|
|
3
|
+
Terminal visualization tool for The Grid state.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Displays colorful, formatted terminal output showing:
|
|
8
|
+
- Current cluster status (name, status, energy)
|
|
9
|
+
- Phase and block progress with visual progress bars
|
|
10
|
+
- Recent scratchpad entries
|
|
11
|
+
- Active blockers and pending decisions
|
|
12
|
+
- Warmth/learnings count
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
From the grid-viz directory:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install
|
|
20
|
+
chmod +x grid-viz.js
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Run from anywhere within a Grid-initialized project:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
node /Users/jacweath/grid/tools/grid-viz/grid-viz.js
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or if installed globally:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g .
|
|
35
|
+
grid-viz
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The tool automatically searches for the `.grid` directory in the current path or parent directories.
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
- Node.js (v12 or higher)
|
|
43
|
+
- chalk ^4.1.2 (installed via npm)
|
|
44
|
+
|
|
45
|
+
## Output Format
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
═══════════════════════════════════════════════════════════════════════
|
|
49
|
+
THE GRID - State Visualization
|
|
50
|
+
═══════════════════════════════════════════════════════════════════════
|
|
51
|
+
|
|
52
|
+
Grid directory: /path/to/.grid
|
|
53
|
+
|
|
54
|
+
CLUSTER STATUS
|
|
55
|
+
Name: React Todo App
|
|
56
|
+
Status: COMPLETE
|
|
57
|
+
Energy: 9000
|
|
58
|
+
Progress: ████████████████████████████████████████ 100%
|
|
59
|
+
Last: 2026-01-23 - Completed 01-PLAN.md
|
|
60
|
+
|
|
61
|
+
RECENT SCRATCHPAD ENTRIES
|
|
62
|
+
[1] executor-01 (2026-01-23 19:00)
|
|
63
|
+
Found: React hooks require functional components...
|
|
64
|
+
|
|
65
|
+
WARMTH
|
|
66
|
+
Learnings: 12 patterns captured
|
|
67
|
+
|
|
68
|
+
═══════════════════════════════════════════════════════════════════════
|
|
69
|
+
End of Line.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Files Parsed
|
|
73
|
+
|
|
74
|
+
- `.grid/STATE.md` - Cluster status and progress
|
|
75
|
+
- `.grid/SCRATCHPAD.md` - Recent discoveries (last 5)
|
|
76
|
+
- `.grid/LEARNINGS.md` - Captured patterns count
|
|
77
|
+
- `.grid/BLOCKERS.md` - Active blockers (top 5)
|
|
78
|
+
- `.grid/DECISIONS.md` - Pending decisions (top 3)
|
|
79
|
+
|
|
80
|
+
## Error Handling
|
|
81
|
+
|
|
82
|
+
- Gracefully handles missing files
|
|
83
|
+
- Shows warning if .grid directory not found
|
|
84
|
+
- Displays available information even if some files are missing
|