ai-nexus 1.1.0 → 1.3.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/README.ko.md ADDED
@@ -0,0 +1,373 @@
1
+ **한국어** | [English](README.md)
2
+
3
+ # ai-nexus
4
+
5
+ > 토큰 낭비를 멈추세요. 필요한 룰만 로드하세요.
6
+
7
+ **Claude Code**, **Cursor**, **Codex**를 위한 AI 코딩 어시스턴트 룰 매니저.
8
+
9
+ [![npm version](https://img.shields.io/npm/v/ai-nexus.svg)](https://www.npmjs.com/package/ai-nexus)
10
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
11
+
12
+ ```bash
13
+ npx ai-nexus install
14
+ ```
15
+
16
+ ---
17
+
18
+ ## 문제
19
+
20
+ Claude Code에 질문할 때마다 **모든** 룰이 로드됩니다:
21
+
22
+ ```
23
+ Loading rules... 4,300 lines
24
+ 토큰 비용: 요청당 ~5,000 토큰
25
+ ```
26
+
27
+ Git 커밋에 대해 물어보는데 React 룰까지 로드되는 건 낭비입니다.
28
+
29
+ ## 해결
30
+
31
+ **ai-nexus**는 시맨틱 라우터를 사용해 관련 룰만 로드합니다:
32
+
33
+ ```
34
+ You: "커밋 메시지 작성해줘"
35
+
36
+ Semantic Router 활성화:
37
+ ✓ commit.md (필요)
38
+ ✓ essential.md (항상 활성)
39
+ ✗ react.md (건너뜀)
40
+ ✗ security.md (건너뜀)
41
+
42
+ 토큰 비용: ~800 토큰 (84% 절약)
43
+ ```
44
+
45
+ ---
46
+
47
+ ## 빠른 시작
48
+
49
+ ```bash
50
+ # 대화형 설치 (권장)
51
+ npx ai-nexus install -i
52
+
53
+ # 기본값으로 빠른 설치
54
+ npx ai-nexus install
55
+
56
+ # 팀 룰 사용
57
+ npx ai-nexus install --rules github.com/your-org/team-rules
58
+ ```
59
+
60
+ ---
61
+
62
+ ## 지원 도구
63
+
64
+ | 도구 | 동작 방식 | 토큰 절약 |
65
+ |------|-----------|-----------|
66
+ | **Claude Code** | 시맨틱 라우터가 프롬프트마다 동적으로 룰 교체 | ~84% |
67
+ | **Cursor** | `.mdc` description 필드를 통한 시맨틱 서치 | ~70% |
68
+ | **Codex** | 정적 `AGENTS.md` (동적 로딩 없음) | - |
69
+
70
+ ---
71
+
72
+ ## 작동 원리
73
+
74
+ ### Claude Code: 시맨틱 라우터
75
+
76
+ 매 프롬프트마다 훅이 실행되어 실제로 필요한 룰을 분석합니다:
77
+
78
+ ```
79
+ ~/.claude/
80
+ ├── hooks/
81
+ │ └── semantic-router.cjs # 매 프롬프트마다 실행
82
+ ├── settings.json # 훅 설정
83
+ ├── rules/ # 활성 룰
84
+ └── rules-inactive/ # 비활성 룰 (로드 안 됨)
85
+ ```
86
+
87
+ **AI 라우팅 사용** (권장):
88
+ ```bash
89
+ export OPENAI_API_KEY=sk-xxx # 또는 ANTHROPIC_API_KEY
90
+ export SEMANTIC_ROUTER_ENABLED=true
91
+ ```
92
+
93
+ GPT-4o-mini 또는 Claude Haiku가 프롬프트를 분석해 적절한 룰을 선택합니다. 비용: 월 ~$0.50.
94
+
95
+ **AI 없이** (폴백):
96
+ 프롬프트의 키워드를 매칭해서 룰을 활성화합니다.
97
+
98
+ ### Cursor: 시맨틱 서치
99
+
100
+ 룰이 description 메타데이터가 포함된 `.mdc` 형식으로 변환됩니다:
101
+
102
+ ```markdown
103
+ ---
104
+ description: Git 커밋 메시지 컨벤션 및 모범 사례
105
+ alwaysApply: false
106
+ ---
107
+
108
+ # 커밋 룰
109
+ ...
110
+ ```
111
+
112
+ Cursor의 내장 시맨틱 서치가 관련도에 따라 룰을 로드합니다.
113
+
114
+ ### Codex: 정적 룰
115
+
116
+ 세션 시작 시 단일 `AGENTS.md` 파일이 로드됩니다. 동적 로딩 없음.
117
+
118
+ ---
119
+
120
+ ## 명령어
121
+
122
+ | 명령어 | 설명 |
123
+ |--------|------|
124
+ | `install` | 전역 설치 (`~/.claude/`) |
125
+ | `install -i` | 대화형 모드 - 도구, 룰, 템플릿 선택 |
126
+ | `init` | 현재 프로젝트에 설치 (`.claude/`) |
127
+ | `update` | 최신 룰로 동기화 (로컬 변경 보호) |
128
+ | `list` | 설치된 룰 목록 |
129
+ | `test <prompt>` | 어떤 룰이 로드될지 미리보기 |
130
+ | `search [keyword]` | 커뮤니티 레지스트리에서 룰 검색 |
131
+ | `get <filename>` | 커뮤니티 레지스트리에서 룰 다운로드 |
132
+ | `add <url>` | Git 저장소에서 룰 추가 |
133
+ | `remove <name>` | 룰 소스 제거 |
134
+ | `browse` | 브라우저에서 룰 마켓플레이스 열기 |
135
+ | `doctor` | 설치 상태 진단 |
136
+ | `uninstall` | ai-nexus 제거 |
137
+
138
+ ---
139
+
140
+ ## 팀 룰
141
+
142
+ Git을 통해 팀 전체에 룰을 공유하세요:
143
+
144
+ ```bash
145
+ # 모든 팀원이 같은 소스에서 설치
146
+ npx ai-nexus install --rules github.com/acme/team-rules
147
+
148
+ # 룰 업데이트 시
149
+ npx ai-nexus update
150
+ ```
151
+
152
+ ### 룰 저장소 구조
153
+
154
+ ```
155
+ team-rules/
156
+ ├── config/
157
+ │ ├── rules/ # 핵심 룰 (essential.md, security.md)
158
+ │ ├── commands/ # 슬래시 커맨드 (/commit, /review)
159
+ │ ├── skills/ # 도메인 지식 (react.md, rust.md)
160
+ │ ├── agents/ # 서브 에이전트 (code-reviewer.md)
161
+ │ ├── contexts/ # 컨텍스트 파일 (@dev, @research)
162
+ │ ├── hooks/ # semantic-router.cjs
163
+ │ └── settings.json # Claude Code 훅 설정
164
+ └── README.md
165
+ ```
166
+
167
+ ### 룰 형식
168
+
169
+ ```markdown
170
+ ---
171
+ description: 이 룰을 로드할 시점 (시맨틱 라우터가 사용)
172
+ ---
173
+
174
+ # 룰 제목
175
+
176
+ 룰 내용...
177
+ ```
178
+
179
+ ---
180
+
181
+ ## 설치 모드
182
+
183
+ ### Symlink (기본값)
184
+
185
+ ```bash
186
+ npx ai-nexus install
187
+ ```
188
+
189
+ - 룰이 소스에 링크 → `update`로 즉시 동기화
190
+ - 룰을 직접 수정 불가 (소스에서 수정)
191
+
192
+ ### Copy
193
+
194
+ ```bash
195
+ npx ai-nexus install --copy
196
+ ```
197
+
198
+ - 룰이 독립적인 복사본
199
+ - 로컬에서 자유롭게 수정 가능
200
+ - `update`는 새 파일만 추가, 기존 파일 덮어쓰지 않음
201
+
202
+ ---
203
+
204
+ ## 로컬 우선
205
+
206
+ 사용자의 커스터마이징은 항상 안전합니다:
207
+
208
+ - **기존 파일은 절대 덮어쓰지 않음** (install, update 모두)
209
+ - 소스에서 새 파일만 추가
210
+ - `--force`로 강제 덮어쓰기 (백업 먼저!)
211
+
212
+ ```bash
213
+ # 커스텀 commit.md를 덮어쓰지 않음
214
+ npx ai-nexus update
215
+
216
+ # 모든 파일 강제 덮어쓰기
217
+ npx ai-nexus update --force
218
+ ```
219
+
220
+ ---
221
+
222
+ ## 디렉토리 구조
223
+
224
+ ```
225
+ .ai-nexus/ # ai-nexus 메타데이터
226
+ ├── config/ # 모든 소스에서 병합된 룰
227
+ ├── sources/ # 클론된 Git 저장소
228
+ └── meta.json # 설치 정보
229
+
230
+ .claude/ # Claude Code
231
+ ├── hooks/semantic-router.cjs
232
+ ├── settings.json
233
+ ├── rules/ → .ai-nexus/config/rules
234
+ └── commands/ → .ai-nexus/config/commands
235
+
236
+ .cursor/rules/ # Cursor (.mdc 파일)
237
+ ├── essential.mdc
238
+ └── commit.mdc
239
+
240
+ .codex/AGENTS.md # Codex
241
+ ```
242
+
243
+ ---
244
+
245
+ ## 사용 예시
246
+
247
+ ### 개인 설정
248
+
249
+ ```bash
250
+ npx ai-nexus install -i
251
+ # 선택: Claude Code, Cursor
252
+ # 선택: rules, commands, hooks, settings
253
+ # 템플릿: React/Next.js
254
+ # 모드: symlink
255
+ ```
256
+
257
+ ### 팀 설정
258
+
259
+ ```bash
260
+ # 1. GitHub에 팀 룰 저장소 생성
261
+
262
+ # 2. 각 개발자:
263
+ npx ai-nexus install --rules github.com/acme/team-rules
264
+
265
+ # 3. 주간 동기화:
266
+ npx ai-nexus update
267
+ ```
268
+
269
+ ### 멀티 소스 설정
270
+
271
+ ```bash
272
+ # 기본 회사 룰
273
+ npx ai-nexus install --rules github.com/acme/base-rules
274
+
275
+ # 프론트엔드 팀 룰 추가
276
+ npx ai-nexus add github.com/acme/frontend-rules
277
+
278
+ # 보안 룰 추가
279
+ npx ai-nexus add github.com/acme/security-rules
280
+
281
+ # 전체 업데이트
282
+ npx ai-nexus update
283
+ ```
284
+
285
+ ---
286
+
287
+ ## 룰 마켓플레이스
288
+
289
+ ![browse](docs/browse.png)
290
+
291
+ 웹 기반 마켓플레이스에서 룰을 검색, 설치, 제거할 수 있습니다:
292
+
293
+ ```bash
294
+ npx ai-nexus browse
295
+ ```
296
+
297
+ - 커뮤니티 룰 실시간 검색 및 카테고리 필터
298
+ - 브라우저에서 직접 설치/제거
299
+ - 도구 상태 (Claude Code, Cursor, Codex) 및 진단 확인
300
+ - `http://localhost:3847`에서 로컬 실행
301
+
302
+ ---
303
+
304
+ ## 커뮤니티 레지스트리
305
+
306
+ 커뮤니티가 기여한 룰을 GitHub에서 직접 검색하고 다운로드하세요 — `npm publish` 불필요.
307
+
308
+ ```bash
309
+ # 전체 룰 목록 보기
310
+ npx ai-nexus search
311
+
312
+ # 키워드로 검색
313
+ npx ai-nexus search react
314
+ ```
315
+
316
+ ```
317
+ Results for "react":
318
+
319
+ skills/
320
+ react.md - React/Next.js best practices
321
+
322
+ 1 file(s) found.
323
+ Use "ai-nexus get <filename>" to download.
324
+ ```
325
+
326
+ ```bash
327
+ # 룰 다운로드
328
+ npx ai-nexus get react.md
329
+
330
+ # 동일 이름이 여러 카테고리에 있을 때 카테고리 지정
331
+ npx ai-nexus get commit.md --category commands
332
+ ```
333
+
334
+ 룰은 [최신 GitHub 저장소](https://github.com/JSK9999/ai-nexus/tree/main/config)에서 `~/.claude/`로 다운로드됩니다. PR로 새 룰을 기여하면 merge 즉시 `search`와 `get`으로 사용 가능합니다.
335
+
336
+ ---
337
+
338
+ ## 테스트
339
+
340
+ 주어진 프롬프트에 어떤 룰이 로드될지 미리 확인:
341
+
342
+ ```bash
343
+ $ npx ai-nexus test "react 컴포넌트에 hooks 사용해서 작성해줘"
344
+
345
+ Selected rules (3):
346
+ • rules/essential.md
347
+ • rules/react.md
348
+ • skills/react.md
349
+ ```
350
+
351
+ ---
352
+
353
+ ## 기여하기
354
+
355
+ 룰 기여를 환영합니다! 기여된 룰은 `ai-nexus search`와 `ai-nexus get`으로 즉시 사용 가능합니다 — npm publish 불필요.
356
+
357
+ 1. **룰 제안**: [Rule Request 열기](https://github.com/JSK9999/ai-nexus/issues/new?template=rule-request.yml)
358
+ 2. **룰 제출**: [CONTRIBUTING.md](CONTRIBUTING.md) 전체 가이드 참고
359
+
360
+ ```bash
361
+ # 기여자 빠른 시작
362
+ git clone https://github.com/JSK9999/ai-nexus.git
363
+ cd ai-rules && npm install && npm run build
364
+
365
+ # config/rules/에 룰 추가 후 테스트:
366
+ node bin/ai-rules.cjs test "your prompt"
367
+ ```
368
+
369
+ ---
370
+
371
+ ## 라이선스
372
+
373
+ Apache 2.0
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [한국어](README.ko.md) | **English**
2
+
1
3
  # ai-nexus
2
4
 
3
5
  > Stop wasting tokens. Load only the rules you need.
@@ -125,8 +127,13 @@ A single `AGENTS.md` file is loaded at session start. No dynamic loading.
125
127
  | `update` | Sync latest rules (respects local changes) |
126
128
  | `list` | Show installed rules |
127
129
  | `test <prompt>` | Preview which rules would load |
130
+ | `search [keyword]` | Search community rules from the registry |
131
+ | `get <filename>` | Download a rule from the community registry |
128
132
  | `add <url>` | Add rules from a Git repository |
129
133
  | `remove <name>` | Remove a rule source |
134
+ | `browse` | Open rule marketplace in browser |
135
+ | `doctor` | Diagnose installation issues |
136
+ | `uninstall` | Remove ai-nexus installation |
130
137
 
131
138
  ---
132
139
 
@@ -277,6 +284,57 @@ npx ai-nexus update
277
284
 
278
285
  ---
279
286
 
287
+ ## Rule Marketplace
288
+
289
+ ![browse](docs/browse.png)
290
+
291
+ Open the web-based marketplace to search, install, and remove rules with one click:
292
+
293
+ ```bash
294
+ npx ai-nexus browse
295
+ ```
296
+
297
+ - Browse community rules with real-time search and category filters
298
+ - Install/remove rules directly from the browser
299
+ - View tool status (Claude Code, Cursor, Codex) and diagnostics
300
+ - Runs locally on `http://localhost:3847`
301
+
302
+ ---
303
+
304
+ ## Community Registry
305
+
306
+ Browse and download community-contributed rules directly from GitHub — no `npm publish` needed.
307
+
308
+ ```bash
309
+ # List all available rules
310
+ npx ai-nexus search
311
+
312
+ # Search by keyword
313
+ npx ai-nexus search react
314
+ ```
315
+
316
+ ```
317
+ Results for "react":
318
+
319
+ skills/
320
+ react.md - React/Next.js best practices
321
+
322
+ 1 file(s) found.
323
+ Use "ai-nexus get <filename>" to download.
324
+ ```
325
+
326
+ ```bash
327
+ # Download a rule
328
+ npx ai-nexus get react.md
329
+
330
+ # Specify category when name exists in multiple
331
+ npx ai-nexus get commit.md --category commands
332
+ ```
333
+
334
+ Rules are downloaded from the [latest GitHub repo](https://github.com/JSK9999/ai-nexus/tree/main/config) to `~/.claude/`. Anyone can contribute new rules via PR — they become available to `search` and `get` immediately after merge.
335
+
336
+ ---
337
+
280
338
  ## Testing
281
339
 
282
340
  Preview which rules would load for a given prompt:
@@ -294,15 +352,16 @@ Selected rules (3):
294
352
 
295
353
  ## Contributing
296
354
 
297
- We welcome rule contributions! The easiest way to contribute:
355
+ We welcome rule contributions! Contributed rules are instantly available via `ai-nexus search` and `ai-nexus get` — no npm publish needed.
298
356
 
299
- 1. **Suggest a rule**: [Open a Rule Request](https://github.com/JSK9999/ai-rules/issues/new?template=rule-request.yml)
357
+ 1. **Suggest a rule**: [Open a Rule Request](https://github.com/JSK9999/ai-nexus/issues/new?template=rule-request.yml)
300
358
  2. **Submit a rule**: See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide
301
359
 
302
360
  ```bash
303
361
  # Quick start for contributors
304
- git clone https://github.com/JSK9999/ai-rules.git
362
+ git clone https://github.com/JSK9999/ai-nexus.git
305
363
  cd ai-rules && npm install && npm run build
364
+
306
365
  # Add your rule to config/rules/, then test:
307
366
  node bin/ai-rules.cjs test "your prompt"
308
367
  ```
package/bin/ai-rules.cjs CHANGED
@@ -98,6 +98,28 @@ program
98
98
  }
99
99
  });
100
100
 
101
+ program
102
+ .command('search [keyword]')
103
+ .description('Search community rules from the registry')
104
+ .action(async (keyword) => {
105
+ if (keyword) {
106
+ const { search } = await import('../dist/commands/search.js');
107
+ await search(keyword);
108
+ } else {
109
+ const { searchAll } = await import('../dist/commands/search.js');
110
+ await searchAll();
111
+ }
112
+ });
113
+
114
+ program
115
+ .command('get <filename>')
116
+ .description('Download a rule from the community registry')
117
+ .option('-c, --category <category>', 'Specify category (rules, commands, skills, agents)')
118
+ .action(async (filename, options) => {
119
+ const { get } = await import('../dist/commands/get.js');
120
+ await get(filename, options);
121
+ });
122
+
101
123
  program
102
124
  .command('uninstall')
103
125
  .description('Remove ai-nexus installation')
@@ -117,4 +139,13 @@ program
117
139
  await doctor();
118
140
  });
119
141
 
142
+ program
143
+ .command('browse')
144
+ .description('Open rule marketplace in browser')
145
+ .argument('[port]', 'Server port (default: 3847)')
146
+ .action(async (port) => {
147
+ const { browse } = await import('../dist/commands/browse.js');
148
+ await browse(port ? parseInt(port, 10) : 3847);
149
+ });
150
+
120
151
  program.parse();
@@ -8,7 +8,7 @@
8
8
  "command": "node .claude/hooks/semantic-router.cjs"
9
9
  }
10
10
  ],
11
- "timeout": 60
11
+ "timeout": 120
12
12
  }
13
13
  ]
14
14
  }