@thebushidocollective/han 1.6.0 → 1.8.1
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 +73 -187
- package/dist/lib/align-progress.d.ts +1 -1
- package/dist/lib/align-progress.d.ts.map +1 -1
- package/dist/lib/align-progress.js +20 -20
- package/dist/lib/align-progress.js.map +1 -1
- package/dist/lib/align.d.ts +1 -1
- package/dist/lib/align.d.ts.map +1 -1
- package/dist/lib/align.js +12 -12
- package/dist/lib/align.js.map +1 -1
- package/dist/lib/codebase-analyzer.d.ts +16 -0
- package/dist/lib/codebase-analyzer.d.ts.map +1 -0
- package/dist/lib/codebase-analyzer.js +99 -0
- package/dist/lib/codebase-analyzer.js.map +1 -0
- package/dist/lib/detect-plugins-prompt.md +93 -0
- package/dist/lib/install-interactive.d.ts +12 -0
- package/dist/lib/install-interactive.d.ts.map +1 -0
- package/dist/lib/install-interactive.js +205 -0
- package/dist/lib/install-interactive.js.map +1 -0
- package/dist/lib/install-progress.d.ts +1 -1
- package/dist/lib/install-progress.d.ts.map +1 -1
- package/dist/lib/install-progress.js +20 -20
- package/dist/lib/install-progress.js.map +1 -1
- package/dist/lib/install.d.ts +6 -2
- package/dist/lib/install.d.ts.map +1 -1
- package/dist/lib/install.js +107 -34
- package/dist/lib/install.js.map +1 -1
- package/dist/lib/main.js +105 -30
- package/dist/lib/main.js.map +1 -1
- package/dist/lib/markdown-wrapper.d.ts +2 -2
- package/dist/lib/markdown-wrapper.d.ts.map +1 -1
- package/dist/lib/markdown-wrapper.js +19 -13
- package/dist/lib/markdown-wrapper.js.map +1 -1
- package/dist/lib/plugin-install.d.ts +5 -0
- package/dist/lib/plugin-install.d.ts.map +1 -0
- package/dist/lib/plugin-install.js +33 -0
- package/dist/lib/plugin-install.js.map +1 -0
- package/dist/lib/plugin-search.d.ts +5 -0
- package/dist/lib/plugin-search.d.ts.map +1 -0
- package/dist/lib/plugin-search.js +51 -0
- package/dist/lib/plugin-search.js.map +1 -0
- package/dist/lib/plugin-selector.d.ts +11 -0
- package/dist/lib/plugin-selector.d.ts.map +1 -0
- package/dist/lib/plugin-selector.js +146 -0
- package/dist/lib/plugin-selector.js.map +1 -0
- package/dist/lib/plugin-uninstall.d.ts +5 -0
- package/dist/lib/plugin-uninstall.d.ts.map +1 -0
- package/dist/lib/plugin-uninstall.js +29 -0
- package/dist/lib/plugin-uninstall.js.map +1 -0
- package/dist/lib/shared.d.ts +20 -9
- package/dist/lib/shared.d.ts.map +1 -1
- package/dist/lib/shared.js +171 -53
- package/dist/lib/shared.js.map +1 -1
- package/dist/lib/uninstall.js +18 -18
- package/dist/lib/uninstall.js.map +1 -1
- package/dist/lib/validate.d.ts.map +1 -1
- package/dist/lib/validate.js +15 -15
- package/dist/lib/validate.js.map +1 -1
- package/dist/test/han.test.js +249 -54
- package/dist/test/han.test.js.map +1 -1
- package/package.json +63 -62
- package/dist/lib/detect-plugins-prompt.d.ts +0 -5
- package/dist/lib/detect-plugins-prompt.d.ts.map +0 -1
- package/dist/lib/detect-plugins-prompt.js +0 -81
- package/dist/lib/detect-plugins-prompt.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,139 +1,105 @@
|
|
|
1
1
|
# @thebushidocollective/han
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Sophisticated Claude Code Plugins with Superior Accuracy**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A curated marketplace of Claude Code plugins built on the foundation of the seven Bushido virtues. Master your craft through disciplined practice, quality craftsmanship, and continuous improvement.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -g @thebushidocollective/han
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Or use with npx (no installation required):
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx
|
|
16
|
+
npx @thebushidocollective/han <command>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Plugin Categories
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Han organizes plugins into four categories inspired by Japanese samurai traditions:
|
|
22
|
+
|
|
23
|
+
- **Bushido** (武士道) - Core principles, enforcement hooks, and foundational quality skills
|
|
24
|
+
- **Do** (道 - The Way) - Specialized agents for development disciplines and practices
|
|
25
|
+
- **Buki** (武器 - Weapons) - Language and tool skills with validation hooks for quality
|
|
26
|
+
- **Sensei** (先生 - Teachers) - MCP servers providing external knowledge and integrations
|
|
27
27
|
|
|
28
28
|
## Commands
|
|
29
29
|
|
|
30
|
-
### install
|
|
30
|
+
### han install
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Auto-detect and install recommended plugins using AI analysis.
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
|
|
35
|
+
han install [--scope <project|local>]
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
This command uses the Claude Agent SDK to analyze your codebase and recommend appropriate plugins based on:
|
|
39
|
+
- Programming languages detected
|
|
40
|
+
- Frameworks and libraries in use
|
|
41
|
+
- Testing tools configured
|
|
42
|
+
- Project structure
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
- `project`: Install to `.claude/settings.json` (shared via git)
|
|
42
|
-
- `local`: Install to `.claude/settings.local.json` (git-ignored, machine-specific)
|
|
44
|
+
### han plugin install
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
Interactive plugin management.
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- Recommends appropriate Han plugins based on actual code, not just file patterns
|
|
50
|
-
- Displays real-time progress with a beautiful Ink-powered terminal UI
|
|
51
|
-
- Configures Claude Code settings automatically
|
|
48
|
+
```bash
|
|
49
|
+
# Interactive mode - browse and select plugins
|
|
50
|
+
han plugin install
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
# Auto-detect mode - AI analyzes codebase
|
|
53
|
+
han plugin install --auto
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- Testing frameworks (Jest, Pytest, RSpec, etc.)
|
|
59
|
-
- GraphQL implementations
|
|
60
|
-
- Monorepo tools (Nx, Turborepo, Lerna)
|
|
55
|
+
# Install specific plugin
|
|
56
|
+
han plugin install <plugin-name>
|
|
57
|
+
```
|
|
61
58
|
|
|
62
|
-
**
|
|
63
|
-
|
|
59
|
+
**Options:**
|
|
60
|
+
- `--auto` - Use AI to auto-detect and recommend plugins
|
|
61
|
+
- `--scope <project|local>` - Installation scope (default: `project`)
|
|
62
|
+
- `project`: Install to `.claude/settings.json` (shared via git)
|
|
63
|
+
- `local`: Install to `.claude/settings.local.json` (git-ignored)
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
### han plugin uninstall
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
# Install to project settings (default, shared via git)
|
|
69
|
-
npx @thebushidocollective/han install
|
|
67
|
+
Remove a specific plugin.
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
```bash
|
|
70
|
+
han plugin uninstall <plugin-name> [--scope <project|local>]
|
|
73
71
|
```
|
|
74
72
|
|
|
75
|
-
###
|
|
73
|
+
### han plugin search
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
Search for plugins in the Han marketplace.
|
|
78
76
|
|
|
79
77
|
```bash
|
|
80
|
-
|
|
78
|
+
han plugin search [query]
|
|
81
79
|
```
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
### han align
|
|
84
82
|
|
|
85
|
-
-
|
|
86
|
-
- `project`: Align plugins in `.claude/settings.json` (shared via git)
|
|
87
|
-
- `local`: Align plugins in `.claude/settings.local.json` (git-ignored, machine-specific)
|
|
88
|
-
- If not specified, automatically detects which scope(s) have Han installed and aligns those
|
|
89
|
-
- If Han is installed in both scopes, aligns both
|
|
90
|
-
- If Han is not installed anywhere, defaults to `project`
|
|
83
|
+
Re-analyze your codebase and sync plugins with current state. Adds new plugins for detected technologies and removes plugins for technologies no longer in use.
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- Compares detected plugins with currently installed plugins
|
|
96
|
-
- **Adds** plugins for newly detected technologies
|
|
97
|
-
- **Removes** plugins for technologies no longer found
|
|
98
|
-
- Reports all changes clearly
|
|
85
|
+
```bash
|
|
86
|
+
han align [--scope <project|local>]
|
|
87
|
+
```
|
|
99
88
|
|
|
100
89
|
**When to use:**
|
|
101
|
-
|
|
102
90
|
- After adding new dependencies or frameworks
|
|
103
91
|
- After removing technologies from your project
|
|
104
|
-
- Periodically to keep plugins in sync
|
|
105
|
-
- Automatically via Stop and PreCompact hooks (see below)
|
|
106
|
-
|
|
107
|
-
**Automatic Alignment:**
|
|
108
|
-
|
|
109
|
-
The bushido plugin includes hooks that automatically run `han align`:
|
|
110
|
-
- **Stop hook**: Runs at the end of each Claude Code session
|
|
111
|
-
- **PreCompact hook**: Runs before compacting conversation history
|
|
112
|
-
|
|
113
|
-
This ensures your plugins stay synchronized with your codebase as it evolves.
|
|
114
|
-
|
|
115
|
-
**Examples:**
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
# Auto-detect and align all scopes where Han is installed
|
|
119
|
-
npx @thebushidocollective/han align
|
|
120
|
-
|
|
121
|
-
# Explicitly align project settings only
|
|
122
|
-
npx @thebushidocollective/han align --scope project
|
|
92
|
+
- Periodically to keep plugins in sync
|
|
123
93
|
|
|
124
|
-
|
|
125
|
-
npx @thebushidocollective/han align --scope local
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### uninstall
|
|
94
|
+
### han uninstall
|
|
129
95
|
|
|
130
|
-
Remove all Han plugins and marketplace configuration
|
|
96
|
+
Remove all Han plugins and marketplace configuration.
|
|
131
97
|
|
|
132
98
|
```bash
|
|
133
|
-
|
|
99
|
+
han uninstall
|
|
134
100
|
```
|
|
135
101
|
|
|
136
|
-
### validate
|
|
102
|
+
### han validate
|
|
137
103
|
|
|
138
104
|
Run validation commands across monorepo packages.
|
|
139
105
|
|
|
@@ -141,137 +107,57 @@ Run validation commands across monorepo packages.
|
|
|
141
107
|
han validate [options] <command>
|
|
142
108
|
```
|
|
143
109
|
|
|
144
|
-
|
|
145
|
-
|
|
110
|
+
**Options:**
|
|
146
111
|
- `--fail-fast` - Stop on first failure
|
|
147
112
|
- `--dirs-with <file>` - Only run in directories containing the specified file
|
|
148
113
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
Run RSpec tests in all directories with a Gemfile:
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
han validate --fail-fast --dirs-with Gemfile bundle exec rspec
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Run npm test in all directories with package.json:
|
|
114
|
+
**Examples:**
|
|
158
115
|
|
|
159
116
|
```bash
|
|
117
|
+
# Run tests in all directories with package.json
|
|
160
118
|
han validate --dirs-with package.json npm test
|
|
161
|
-
```
|
|
162
119
|
|
|
163
|
-
Run
|
|
120
|
+
# Run RSpec in all directories with Gemfile
|
|
121
|
+
han validate --fail-fast --dirs-with Gemfile bundle exec rspec
|
|
164
122
|
|
|
165
|
-
|
|
123
|
+
# Run go tests everywhere
|
|
166
124
|
han validate go test ./...
|
|
167
125
|
```
|
|
168
126
|
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
- `0` - All validations passed
|
|
172
|
-
- `1` - Invalid usage or no directories found
|
|
173
|
-
- `2` - One or more validations failed
|
|
174
|
-
|
|
175
|
-
## How It Works
|
|
176
|
-
|
|
177
|
-
1. **Auto-discovers directories** - Uses git to find tracked directories,
|
|
178
|
-
falls back to filesystem scan
|
|
179
|
-
2. **Filters by marker files** - Only runs in directories containing
|
|
180
|
-
the specified file (e.g., `Gemfile`, `package.json`)
|
|
181
|
-
3. **Runs command in each** - Executes the command in each matching
|
|
182
|
-
directory
|
|
183
|
-
4. **Reports failures** - Shows which directories failed with clear
|
|
184
|
-
error messages
|
|
185
|
-
5. **Exits with code 2** - Hard failure prevents Claude from bypassing
|
|
186
|
-
validation
|
|
187
|
-
|
|
188
|
-
## Use Cases
|
|
189
|
-
|
|
190
|
-
### Monorepo Testing
|
|
191
|
-
|
|
192
|
-
Run tests across all packages in a monorepo:
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
# JavaScript/TypeScript packages
|
|
196
|
-
npx -y @thebushidocollective/han validate --dirs-with package.json npm test
|
|
197
|
-
|
|
198
|
-
# Ruby packages
|
|
199
|
-
npx -y @thebushidocollective/han validate --dirs-with Gemfile bundle exec rspec
|
|
200
|
-
|
|
201
|
-
# Go modules
|
|
202
|
-
npx -y @thebushidocollective/han validate --dirs-with go.mod go test ./...
|
|
203
|
-
|
|
204
|
-
# Python packages
|
|
205
|
-
npx -y @thebushidocollective/han validate --dirs-with pyproject.toml pytest
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Claude Code Hooks
|
|
127
|
+
## Usage in Claude Code Hooks
|
|
209
128
|
|
|
210
|
-
|
|
129
|
+
Use han validate in Claude Code hooks for quality enforcement:
|
|
211
130
|
|
|
212
131
|
```json
|
|
213
132
|
{
|
|
214
133
|
"hooks": {
|
|
215
134
|
"Stop": [
|
|
216
135
|
{
|
|
217
|
-
"
|
|
218
|
-
|
|
219
|
-
"type": "command",
|
|
220
|
-
"command": "npx -y @thebushidocollective/han validate --fail-fast --dirs-with package.json npm test || (echo 'Please fix failing tests before continuing:\\n'; exit 2)"
|
|
221
|
-
}
|
|
222
|
-
]
|
|
136
|
+
"type": "command",
|
|
137
|
+
"command": "npx -y @thebushidocollective/han validate --fail-fast --dirs-with package.json npm test"
|
|
223
138
|
}
|
|
224
139
|
]
|
|
225
140
|
}
|
|
226
141
|
}
|
|
227
142
|
```
|
|
228
143
|
|
|
229
|
-
##
|
|
230
|
-
|
|
231
|
-
This package is written in TypeScript and uses React (via Ink) for the terminal UI.
|
|
232
|
-
|
|
233
|
-
### Prerequisites
|
|
234
|
-
|
|
235
|
-
- Node.js >= 24
|
|
236
|
-
- TypeScript 5.9+
|
|
237
|
-
|
|
238
|
-
### Building
|
|
239
|
-
|
|
240
|
-
The build process compiles TypeScript to ES modules:
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
npm run build # Compile TypeScript to dist/
|
|
244
|
-
npm run typecheck # Type-check without emitting
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
The compiled output is in `dist/` and is what gets published to npm.
|
|
248
|
-
|
|
249
|
-
### Testing
|
|
250
|
-
|
|
251
|
-
Tests run against the compiled JavaScript:
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
npm test # Run tests from dist/test/
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Linting
|
|
144
|
+
## Exit Codes
|
|
258
145
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
```
|
|
146
|
+
- `0` - Success
|
|
147
|
+
- `1` - Invalid usage or no directories found
|
|
148
|
+
- `2` - One or more validations failed
|
|
263
149
|
|
|
264
|
-
|
|
150
|
+
## Philosophy
|
|
265
151
|
|
|
266
|
-
|
|
152
|
+
> "Beginning is easy - continuing is hard." - Japanese Proverb
|
|
267
153
|
|
|
268
|
-
|
|
269
|
-
- `lib/install.ts` - Integration with Claude Agent SDK
|
|
154
|
+
Walk the way of Bushido. Practice with Discipline. Build with Honor.
|
|
270
155
|
|
|
271
|
-
##
|
|
156
|
+
## Links
|
|
272
157
|
|
|
273
|
-
|
|
274
|
-
|
|
158
|
+
- [Han Marketplace](https://han.thebushido.co)
|
|
159
|
+
- [GitHub](https://github.com/thebushidocollective/han)
|
|
160
|
+
- [The Bushido Collective](https://thebushido.co)
|
|
275
161
|
|
|
276
162
|
## License
|
|
277
163
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"align-progress.d.ts","sourceRoot":"","sources":["../../lib/align-progress.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"align-progress.d.ts","sourceRoot":"","sources":["../../lib/align-progress.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEvE,UAAU,kBAAkB;IAC3B,aAAa,EAAE,CAAC,SAAS,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+MtD,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
import Spinner from
|
|
4
|
-
import { useEffect, useState } from
|
|
5
|
-
import { MarkdownWrapper } from
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import Spinner from "ink-spinner";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { MarkdownWrapper } from "./markdown-wrapper.js";
|
|
6
6
|
export const AlignProgress = ({ detectPlugins, onAlignComplete, onAlignError, }) => {
|
|
7
|
-
const [phase, setPhase] = useState(
|
|
7
|
+
const [phase, setPhase] = useState("analyzing");
|
|
8
8
|
const [plugins, setPlugins] = useState([]);
|
|
9
|
-
const [fullText, setFullText] = useState(
|
|
9
|
+
const [fullText, setFullText] = useState("");
|
|
10
10
|
const [currentTool, setCurrentTool] = useState(null);
|
|
11
11
|
const [error, setError] = useState(null);
|
|
12
12
|
const [toolsUsed, setToolsUsed] = useState(new Set());
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
const callbacks = {
|
|
15
15
|
onUpdate: (update) => {
|
|
16
|
-
if (update.type ===
|
|
16
|
+
if (update.type === "text") {
|
|
17
17
|
setFullText((prev) => prev + update.content);
|
|
18
18
|
}
|
|
19
|
-
else if (update.type ===
|
|
19
|
+
else if (update.type === "tool" && update.toolName) {
|
|
20
20
|
setCurrentTool(update.toolName);
|
|
21
21
|
setToolsUsed((prev) => new Set([...prev, update.toolName]));
|
|
22
22
|
}
|
|
@@ -25,18 +25,18 @@ export const AlignProgress = ({ detectPlugins, onAlignComplete, onAlignError, })
|
|
|
25
25
|
setPlugins(detectedPlugins);
|
|
26
26
|
setFullText(analysisText);
|
|
27
27
|
setCurrentTool(null);
|
|
28
|
-
setPhase(
|
|
28
|
+
setPhase("analyzed");
|
|
29
29
|
setTimeout(() => {
|
|
30
|
-
setPhase(
|
|
30
|
+
setPhase("aligning");
|
|
31
31
|
setTimeout(() => {
|
|
32
|
-
setPhase(
|
|
32
|
+
setPhase("complete");
|
|
33
33
|
onAlignComplete(detectedPlugins);
|
|
34
34
|
}, 500);
|
|
35
35
|
}, 1000);
|
|
36
36
|
},
|
|
37
37
|
onError: (err) => {
|
|
38
38
|
setError(err.message);
|
|
39
|
-
setPhase(
|
|
39
|
+
setPhase("error");
|
|
40
40
|
onAlignError(err);
|
|
41
41
|
},
|
|
42
42
|
};
|
|
@@ -44,15 +44,15 @@ export const AlignProgress = ({ detectPlugins, onAlignComplete, onAlignError, })
|
|
|
44
44
|
}, [detectPlugins, onAlignComplete, onAlignError]);
|
|
45
45
|
const getToolEmoji = (toolName) => {
|
|
46
46
|
const emojiMap = {
|
|
47
|
-
web_fetch:
|
|
48
|
-
read_file:
|
|
49
|
-
glob:
|
|
50
|
-
grep:
|
|
47
|
+
web_fetch: "🌐",
|
|
48
|
+
read_file: "📄",
|
|
49
|
+
glob: "🔍",
|
|
50
|
+
grep: "🔎",
|
|
51
51
|
};
|
|
52
|
-
return emojiMap[toolName] ||
|
|
52
|
+
return emojiMap[toolName] || "🔧";
|
|
53
53
|
};
|
|
54
|
-
return (_jsxs(Box, { flexDirection: "column", paddingY: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "\uD83E\uDD16 Han Plugin Alignment" }) }), phase ===
|
|
55
|
-
phase ===
|
|
56
|
-
phase ===
|
|
54
|
+
return (_jsxs(Box, { flexDirection: "column", paddingY: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "\uD83E\uDD16 Han Plugin Alignment" }) }), phase === "analyzing" && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "yellow", children: [_jsx(Spinner, { type: "dots" }), " Analyzing codebase..."] }) }), currentTool && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "blue", children: [getToolEmoji(currentTool), " ", currentTool] }) })), toolsUsed.size > 0 && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { dimColor: true, children: ["Tools used: ", Array.from(toolsUsed).join(", ")] }) })), fullText && (_jsxs(Box, { marginTop: 1, paddingX: 1, borderStyle: "round", borderColor: "gray", flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { dimColor: true, bold: true, children: [_jsx(Spinner, { type: "star" }), " Agent thinking:"] }) }), _jsx(MarkdownWrapper, { children: fullText })] }))] })), (phase === "analyzed" ||
|
|
55
|
+
phase === "aligning" ||
|
|
56
|
+
phase === "complete") && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "\u2705 Analysis complete" }) }), fullText && (_jsxs(Box, { marginBottom: 1, paddingX: 1, borderStyle: "round", borderColor: "cyan", flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "\uD83D\uDCCB Agent Analysis:" }) }), _jsx(MarkdownWrapper, { children: fullText })] })), plugins.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, color: "green", children: "\u2728 Recommended plugins:" }), plugins.sort().map((plugin) => (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { children: ["\u2022 ", plugin] }) }, plugin)))] })), phase === "aligning" && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "yellow", children: [_jsx(Spinner, { type: "dots" }), " Aligning plugins in Claude Code settings..."] }) })), phase === "complete" && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", children: "\u2705 Updated Claude Code settings" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "green", bold: true, children: "\u2705 Alignment complete!" }) }), _jsx(Box, { children: _jsx(Text, { color: "blue", children: "\uD83D\uDCA1 Restart Claude Code to load plugin changes." }) })] }))] })), phase === "error" && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "red", bold: true, children: "\u274C Error" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "red", children: error }) }), fullText && (_jsxs(Box, { marginBottom: 1, paddingX: 1, borderStyle: "round", borderColor: "red", flexDirection: "column", children: [_jsx(Text, { bold: true, color: "red", children: "Partial Analysis:" }), _jsx(Box, { children: _jsx(MarkdownWrapper, { children: fullText }) })] })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0\uFE0F Could not complete alignment, leaving plugins unchanged" }) })] }))] }));
|
|
57
57
|
};
|
|
58
58
|
//# sourceMappingURL=align-progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"align-progress.js","sourceRoot":"","sources":["../../lib/align-progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"align-progress.js","sourceRoot":"","sources":["../../lib/align-progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI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C,MAAM,yEAEX,GACF,IACD,CACN,IACI,CACN,EAEA,KAAK,KAAK,OAAO,IAAI,CACrB,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aAC1B,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YACnB,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,EAAC,IAAI,mCAEf,GACF,EACN,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YACnB,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,KAAK,GAAQ,GAC3B,EACL,QAAQ,IAAI,CACZ,MAAC,GAAG,IACH,YAAY,EAAE,CAAC,EACf,QAAQ,EAAE,CAAC,EACX,WAAW,EAAC,OAAO,EACnB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,QAAQ,aAEtB,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,KAAK,kCAEf,EACP,KAAC,GAAG,cACH,KAAC,eAAe,cAAE,QAAQ,GAAmB,GACxC,IACD,CACN,EACD,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YAChB,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,qFAEb,GACF,IACD,CACN,IACI,CACN,CAAC;AACH,CAAC,CAAC"}
|
package/dist/lib/align.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export interface AlignResult {
|
|
|
7
7
|
* SDK-based align command with Ink UI
|
|
8
8
|
* If scope is not provided, auto-detects which scope(s) have Han installed
|
|
9
9
|
*/
|
|
10
|
-
export declare function align(scope?:
|
|
10
|
+
export declare function align(scope?: "project" | "local"): Promise<void>;
|
|
11
11
|
//# sourceMappingURL=align.d.ts.map
|
package/dist/lib/align.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"align.d.ts","sourceRoot":"","sources":["../../lib/align.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;
|
|
1
|
+
{"version":3,"file":"align.d.ts","sourceRoot":"","sources":["../../lib/align.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACpB;AAuDD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBtE"}
|
package/dist/lib/align.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { render } from
|
|
2
|
-
import React from
|
|
3
|
-
import {
|
|
1
|
+
import { render } from "ink";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { detectHanScopes, detectPluginsWithAgent, ensureClaudeDirectory, getInstalledPlugins, HAN_MARKETPLACE_REPO, readOrCreateSettings, writeSettings, } from "./shared.js";
|
|
4
4
|
/**
|
|
5
5
|
* Compare current plugins with recommended plugins and update settings
|
|
6
6
|
*/
|
|
7
|
-
function alignPluginsInSettings(recommendedPlugins, scope =
|
|
7
|
+
function alignPluginsInSettings(recommendedPlugins, scope = "project") {
|
|
8
8
|
ensureClaudeDirectory();
|
|
9
9
|
const settings = readOrCreateSettings(scope);
|
|
10
10
|
const currentPlugins = getInstalledPlugins(scope);
|
|
@@ -16,7 +16,7 @@ function alignPluginsInSettings(recommendedPlugins, scope = 'project') {
|
|
|
16
16
|
if (!settings?.extraKnownMarketplaces?.han) {
|
|
17
17
|
settings.extraKnownMarketplaces = {
|
|
18
18
|
...settings.extraKnownMarketplaces,
|
|
19
|
-
han: { source: { source:
|
|
19
|
+
han: { source: { source: "github", repo: HAN_MARKETPLACE_REPO } },
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
// Initialize enabledPlugins if needed
|
|
@@ -57,7 +57,7 @@ export async function align(scope) {
|
|
|
57
57
|
scopesToAlign = detectHanScopes();
|
|
58
58
|
// Default to project if Han not installed anywhere
|
|
59
59
|
if (scopesToAlign.length === 0) {
|
|
60
|
-
scopesToAlign = [
|
|
60
|
+
scopesToAlign = ["project"];
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
// Align each detected scope
|
|
@@ -70,14 +70,14 @@ export async function align(scope) {
|
|
|
70
70
|
*/
|
|
71
71
|
async function alignSingleScope(scope) {
|
|
72
72
|
// Import Ink UI component dynamically
|
|
73
|
-
const { AlignProgress } = await import(
|
|
73
|
+
const { AlignProgress } = await import("./align-progress.js");
|
|
74
74
|
let resolveCompletion;
|
|
75
75
|
let rejectCompletion;
|
|
76
76
|
const completionPromise = new Promise((resolve, reject) => {
|
|
77
77
|
resolveCompletion = resolve;
|
|
78
78
|
rejectCompletion = reject;
|
|
79
79
|
});
|
|
80
|
-
const filename = scope ===
|
|
80
|
+
const filename = scope === "local" ? "settings.local.json" : "settings.json";
|
|
81
81
|
console.log(`Aligning plugins in ./.claude/${filename}...\n`);
|
|
82
82
|
const { unmount } = render(React.createElement(AlignProgress, {
|
|
83
83
|
detectPlugins: detectPluginsWithAgent,
|
|
@@ -85,16 +85,16 @@ async function alignSingleScope(scope) {
|
|
|
85
85
|
const result = alignPluginsInSettings(plugins, scope);
|
|
86
86
|
// Report changes
|
|
87
87
|
if (result.added.length > 0) {
|
|
88
|
-
console.log(`\n✓ Added ${result.added.length} plugin(s): ${result.added.join(
|
|
88
|
+
console.log(`\n✓ Added ${result.added.length} plugin(s): ${result.added.join(", ")}`);
|
|
89
89
|
}
|
|
90
90
|
if (result.removed.length > 0) {
|
|
91
|
-
console.log(`\n✓ Removed ${result.removed.length} plugin(s): ${result.removed.join(
|
|
91
|
+
console.log(`\n✓ Removed ${result.removed.length} plugin(s): ${result.removed.join(", ")}`);
|
|
92
92
|
}
|
|
93
93
|
if (result.added.length === 0 && result.removed.length === 0) {
|
|
94
|
-
console.log(
|
|
94
|
+
console.log("\n✓ No changes needed - plugins are already aligned");
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
|
-
console.log(
|
|
97
|
+
console.log("\n⚠️ Please restart Claude Code to load the plugin changes");
|
|
98
98
|
}
|
|
99
99
|
if (resolveCompletion)
|
|
100
100
|
resolveCompletion();
|
package/dist/lib/align.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"align.js","sourceRoot":"","sources":["../../lib/align.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"align.js","sourceRoot":"","sources":["../../lib/align.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,GACb,MAAM,aAAa,CAAC;AAQrB;;GAEG;AACH,SAAS,sBAAsB,CAC9B,kBAA4B,EAC5B,QAA6B,SAAS;IAEtC,qBAAqB,EAAE,CAAC;IAExB,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,qCAAqC;IACrC,IAAI,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAAC;QAC5C,QAAQ,CAAC,sBAAsB,GAAG;YACjC,GAAG,QAAQ,CAAC,sBAAsB;YAClC,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE;SACjE,CAAC;IACH,CAAC;IAED,sCAAsC;IACtC,IAAI,CAAC,QAAQ,CAAC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AC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC9E,CAAC;YACH,CAAC;YACD,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9D,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;YACpE,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,GAAG,CACV,6DAA6D,CAC7D,CAAC;YACH,CAAC;YAED,IAAI,iBAAiB;gBAAE,iBAAiB,EAAE,CAAC;QAC5C,CAAC;QACD,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE;YAC9B,IAAI,gBAAgB;gBAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;KACD,CAAC,CACF,CAAC;IAEF,IAAI,CAAC;QACJ,MAAM,iBAAiB,CAAC;QACxB,sDAAsD;QACtD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC;YAAS,CAAC;QACV,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ExtensionCount {
|
|
2
|
+
extension: string;
|
|
3
|
+
count: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ConfigFileCount {
|
|
6
|
+
fileName: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CodebaseStats {
|
|
10
|
+
totalFiles: number;
|
|
11
|
+
extensions: ExtensionCount[];
|
|
12
|
+
configFiles: ConfigFileCount[];
|
|
13
|
+
}
|
|
14
|
+
export declare function analyzeCodebase(rootPath: string): CodebaseStats;
|
|
15
|
+
export declare function formatStatsForPrompt(stats: CodebaseStats): string;
|
|
16
|
+
//# sourceMappingURL=codebase-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codebase-analyzer.d.ts","sourceRoot":"","sources":["../../lib/codebase-analyzer.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,WAAW,EAAE,eAAe,EAAE,CAAC;CAC/B;AAsBD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CA2D/D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAgCjE"}
|