@hyperdrive.bot/gut 0.1.14 → 0.1.15-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperdrive.bot/gut",
3
- "version": "0.1.14",
3
+ "version": "0.1.15-alpha.0",
4
4
  "description": "Git Unified Tooling - Enhanced git with workspace intelligence for entity-based organization",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -93,4 +93,4 @@
93
93
  "access": "public",
94
94
  "registry": "https://registry.npmjs.org/"
95
95
  }
96
- }
96
+ }
@@ -0,0 +1,179 @@
1
+ <!-- gut:start -->
2
+ # Gut — Workspace Intelligence
3
+
4
+ ## What is Gut
5
+
6
+ Gut is an entity-aware workspace manager for multi-repo and monorepo setups. It wraps git with workspace intelligence — focus-driven commands that scope operations to the entities you care about, dependency analysis across repos, and atomic multi-repo worktree isolation. The CLI is `gut` (npm: `@hyperdrive.bot/gut`).
7
+
8
+ ## Mental Model
9
+
10
+ ### Entities
11
+
12
+ Entities are the building blocks of your workspace. Each entity has a type, name, and path:
13
+
14
+ | Type | Purpose |
15
+ |------|---------|
16
+ | `client` | Client projects |
17
+ | `company` | Company-level repositories |
18
+ | `delivery` | Delivery/app projects |
19
+ | `initiative` | Internal initiatives |
20
+ | `module` | Packages and libraries |
21
+ | `prospect` | Prospect/sales projects |
22
+ | `service` | Backend services |
23
+ | `system` | System-level infrastructure |
24
+ | `tool` | Developer tools |
25
+
26
+ Entities are stored in `.gut/config.json` and auto-discovered from directory patterns (`apps/` → delivery, `packages/` → module, `libs/` → module, `services/` → service, `tools/` → tool).
27
+
28
+ ### Focus System
29
+
30
+ Focus scopes all gut commands to selected entities. When you focus on an entity, commands like `gut status`, `gut commit`, and `gut push` operate only on that entity's repository.
31
+
32
+ | Mode | Purpose |
33
+ |------|---------|
34
+ | `audit` | Reviewing code quality and compliance |
35
+ | `debug` | Investigating and fixing issues |
36
+ | `delivery` | Building and shipping features |
37
+ | `proposal` | Preparing proposals and estimates |
38
+ | `research` | Exploring and prototyping |
39
+ | `strategy` | Planning and architecture |
40
+
41
+ Focus state is stored in `.gut/focus.json` with history in `.gut/history.json` (max 10 entries).
42
+
43
+ ### Worktrees
44
+
45
+ Gut provides atomic multi-repo isolation via `gut worktree create`. This creates a super-repo worktree plus per-entity worktrees on a new branch, allowing isolated pipeline runs without affecting your working tree. Default location: `~/.local/share/gut/worktrees/<slug>`.
46
+
47
+ ## Command Reference
48
+
49
+ ### Setup
50
+
51
+ | Command | Description |
52
+ |---------|-------------|
53
+ | `gut init` | Initialize a gut workspace |
54
+ | `gut quick-setup` | Quick workspace setup wizard |
55
+
56
+ ### Entity
57
+
58
+ | Command | Description |
59
+ |---------|-------------|
60
+ | `gut entity add` | Add entity to workspace |
61
+ | `gut entity clone` | Clone entity repository |
62
+ | `gut entity clone-all` | Clone all entities |
63
+ | `gut entity list` | List entities |
64
+ | `gut entity remove` | Remove entity |
65
+
66
+ ### Focus
67
+
68
+ | Command | Description |
69
+ |---------|-------------|
70
+ | `gut focus` | Set focus on entities |
71
+ | `gut unfocus` | Clear focus |
72
+ | `gut back` | Return to previous focus/branch |
73
+ | `gut context` | Show current focus context |
74
+ | `gut contexts` | List saved focus contexts |
75
+
76
+ ### Git
77
+
78
+ | Command | Description |
79
+ |---------|-------------|
80
+ | `gut status` | Show git status for focused entities |
81
+ | `gut commit` | Commit changes across focused entities |
82
+ | `gut push` | Push changes to remotes |
83
+ | `gut pull` | Pull changes from remotes |
84
+ | `gut checkout` | Checkout branches across entities |
85
+ | `gut sync` | Sync across entities |
86
+
87
+ ### Worktree
88
+
89
+ | Command | Description |
90
+ |---------|-------------|
91
+ | `gut worktree create` | Create mirrored worktrees for super-repo + focused entities |
92
+ | `gut worktree list` | List worktrees |
93
+ | `gut worktree remove` | Remove worktree |
94
+ | `gut worktree status` | Show worktree status |
95
+
96
+ ### Analysis
97
+
98
+ | Command | Description |
99
+ |---------|-------------|
100
+ | `gut affected` | Detect entities potentially affected by changes |
101
+ | `gut deps` | Analyze dependencies |
102
+ | `gut graph` | Visualize dependency graph |
103
+ | `gut related` | Find related entities |
104
+ | `gut used-by` | Show what uses an entity |
105
+ | `gut stack` | Show dependency stack |
106
+ | `gut patterns` | Analyze patterns across codebase |
107
+ | `gut insights` | Show insights about entities |
108
+ | `gut audit` | Run audits across entities |
109
+
110
+ ### Tickets
111
+
112
+ | Command | Description |
113
+ |---------|-------------|
114
+ | `gut ticket focus` | Focus on a ticket |
115
+ | `gut ticket get` | Get ticket details |
116
+ | `gut ticket list` | List tickets |
117
+ | `gut ticket sync` | Sync tickets |
118
+ | `gut ticket update` | Update ticket |
119
+ | `gut ticket config` | Configure ticket system |
120
+
121
+ ### Auth
122
+
123
+ | Command | Description |
124
+ |---------|-------------|
125
+ | `gut auth login` | Authenticate |
126
+ | `gut auth logout` | Logout |
127
+ | `gut auth status` | Show auth status |
128
+
129
+ ### Other
130
+
131
+ | Command | Description |
132
+ |---------|-------------|
133
+ | `gut repos` | List repositories |
134
+ | `gut recent` | Show recent activity |
135
+ | `gut add` | Add a git submodule or dependency |
136
+ | `gut extract` | Extract code/modules |
137
+ | `gut workspace` | Workspace management |
138
+
139
+ ## Common Workflows
140
+
141
+ 1. **Start a client project:**
142
+ ```
143
+ gut init
144
+ gut entity add my-client client ./path
145
+ gut focus client my-client --mode delivery
146
+ gut context
147
+ ```
148
+
149
+ 2. **Check blast radius before changes:**
150
+ ```
151
+ gut affected --verbose
152
+ ```
153
+ Review confidence levels (high/medium/low) and dependency reasons before making cross-entity changes.
154
+
155
+ 3. **Create isolated worktree for pipeline run:**
156
+ ```
157
+ gut focus client my-client
158
+ gut worktree create feature-x --install
159
+ cd ~/.local/share/gut/worktrees/feature-x
160
+ ```
161
+
162
+ 4. **Explore workspace:**
163
+ ```
164
+ gut entity list
165
+ gut focus <entity>
166
+ gut context
167
+ gut status --all --verbose
168
+ ```
169
+
170
+ ## Rules for Claude
171
+
172
+ - Prefer `gut` commands over raw `git` when inside a gut workspace (`.gut/` directory exists)
173
+ - Always check current focus with `gut context` before suggesting git operations
174
+ - Use `gut affected --verbose` to understand blast radius before making cross-entity changes
175
+ - Never modify `.gut/` directory contents directly — use gut commands
176
+ - Use `gut status --all --verbose` for full workspace status, not `git status`
177
+ - When a gut command fails, check if the workspace is initialized (`gut init`) and if entities are focused (`gut context`)
178
+ - Use `gut worktree create` for isolated pipeline/workflow runs — never create git worktrees manually in a gut workspace
179
+ <!-- gut:end -->
@@ -0,0 +1,40 @@
1
+ Analyze which entities are potentially affected by recent changes in the current focus.
2
+
3
+ ## Steps
4
+
5
+ 1. Run `gut affected --verbose` to detect entities affected by changes since the last commit
6
+
7
+ ## Fallback — no entities focused
8
+
9
+ If the command fails or returns no results because no entities are currently focused:
10
+
11
+ 1. Tell the user: "No entities are focused. You need to focus on an entity first."
12
+ 2. Suggest: Run `gut focus <entity-name>` to set focus on the entity you're working on
13
+ 3. Then retry `/gut-affected`
14
+
15
+ ## Interpreting the output
16
+
17
+ ### Confidence levels
18
+ Results are grouped by how likely an entity is to be affected:
19
+ - **High** — direct dependency or shared code path changed
20
+ - **Medium** — related configuration or schema change detected
21
+ - **Low** — indirect or transitive dependency change
22
+
23
+ ### Change types
24
+ Each affected entity shows what kind of change triggered the detection:
25
+ - **API** — API contract or endpoint changes
26
+ - **Config** — configuration file changes (serverless.yml, package.json, etc.)
27
+ - **Schema** — database schema or type definition changes
28
+ - **Dependency** — shared dependency or package version changes
29
+
30
+ ### Verbose output
31
+ With `--verbose`, each affected entity includes a file-level breakdown showing exactly which changed files triggered the detection.
32
+
33
+ ## Suggested actions
34
+
35
+ Based on the affected entities list, suggest which entities the user should:
36
+ - **Review** — entities with high-confidence API or schema changes
37
+ - **Test** — entities with config or dependency changes that may break at runtime
38
+ - **Deploy** — entities that depend on the changed code and need redeployment
39
+
40
+ Prioritize high-confidence results first. For low-confidence results, mention them but note they may not require immediate action.
@@ -0,0 +1,33 @@
1
+ Show the current gut context and git status across all entities in the super-repo.
2
+
3
+ ## Steps
4
+
5
+ 1. Run `gut context` to show the current focus context (which entities are focused, their types, and paths)
6
+ 2. Run `gut status --all --verbose` to show git status across all entities with file-level detail
7
+
8
+ ## Interpreting the output
9
+
10
+ ### Entity type emojis
11
+ - 🏢 = client
12
+ - 🚀 = initiative
13
+ - 🏗️ = company
14
+ - 📦 = package
15
+ - 🌐 = web-app
16
+
17
+ ### Status indicators
18
+ - ✓ = clean (no uncommitted changes)
19
+ - ● = has changes (staged, unstaged, or untracked files)
20
+
21
+ ### Verbose output
22
+ When `--verbose` is used, each entity with changes shows file-level details:
23
+ - **Staged** — files added to the index, ready to commit
24
+ - **Unstaged** — modified files not yet staged
25
+ - **Untracked** — new files not tracked by git
26
+
27
+ ## Summary
28
+
29
+ After running both commands, present a concise summary of:
30
+ - Which entities have uncommitted changes
31
+ - What kind of changes each has (staged, unstaged, untracked)
32
+ - How many files are affected per entity
33
+ - Any entities that are currently focused