ai-nexus 1.5.1 → 1.5.3
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 +40 -31
- package/README.md +39 -30
- package/bin/ai-nexus.cjs +1 -1
- package/config/skills/java-spring.md +168 -0
- package/config/skills/tailwind.md +67 -0
- package/dist/utils/config-scanner.js +15 -23
- package/dist/utils/registry.js +3 -2
- package/dist/utils/semantic-router.js +3 -0
- package/package.json +2 -2
package/README.ko.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# ai-nexus
|
|
4
4
|
|
|
5
|
-
>
|
|
6
|
-
>
|
|
5
|
+
> 200개 이상의 룰과 스킬을 설치하세요. 프롬프트당 2-3개만 로딩됩니다.
|
|
6
|
+
> 한 번 작성하면 Claude Code, Cursor, Codex에 자동 배포.
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/ai-nexus)
|
|
9
9
|
[](https://www.npmjs.com/package/ai-nexus)
|
|
10
10
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
11
11
|
|
|
12
|
-
**[홈페이지](https://jsk9999.github.io/ai-nexus/)** | **[문서](https://jsk9999.github.io/ai-nexus/docs.html)**
|
|
12
|
+
**[홈페이지](https://jsk9999.github.io/ai-nexus/)** | **[문서](https://jsk9999.github.io/ai-nexus/docs.html)** | **[로드맵](ROADMAP.ko.md)**
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npx ai-nexus install
|
|
@@ -19,13 +19,17 @@ npx ai-nexus install
|
|
|
19
19
|
|
|
20
20
|
## 문제
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
`alwaysApply: true` 룰은 매 프롬프트마다 전부 로딩됩니다 — 많을수록 토큰 낭비가 커집니다. `alwaysApply: false`라도 Claude가 모든 룰의 description을 전부 읽고 뭘 로딩할지 판단합니다 — 코드 작성 대신 룰 필터링에 Claude 토큰을 쓰는 셈입니다. 스킬과 커맨드는 호출할 때만 로딩되지만, 뭘 언제 호출해야 하는지 기억해야 합니다.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
그래서 대부분 자기검열을 합니다. 관리가 부담되어 룰이나 스킬을 적게 설치하고, 유용한 컨텍스트를 놓치게 됩니다.
|
|
25
|
+
|
|
26
|
+
[ETH Zurich의 최근 연구](https://arxiv.org/pdf/2602.11988) (12개 레포, 5,694개 PR 대상)가 이를 확인합니다: **모든 룰을 한꺼번에 로드하면 성능이 ~3% 하락하고 비용은 20% 이상 증가합니다.** 결론: 프롬프트마다 관련 컨텍스트만 로드해야 합니다.
|
|
27
|
+
|
|
28
|
+
게다가 AI 도구마다 형식이 다릅니다 — `.claude/rules/*.md`, `.cursor/rules/*.mdc`, `.codex/AGENTS.md`. 여러 도구를 쓰면 같은 룰과 스킬을 여러 곳에 관리하다 결국 서로 달라집니다.
|
|
25
29
|
|
|
26
30
|
## 해결
|
|
27
31
|
|
|
28
|
-
**ai-nexus
|
|
32
|
+
**ai-nexus**는 룰 필터링을 **Claude 바깥에서** 처리합니다. 시맨틱 라우터 훅이 Claude가 시작되기 전에 실행되어 관련 있는 2-3개 파일만 `rules/`에 두고 나머지는 `rules-inactive/`로 물리적으로 빼버립니다. Claude는 나머지가 있는지도 모릅니다. 필터링은 키워드 매칭(무료) 또는 GPT-4o-mini(월 ~$0.50)가 처리. 한 번 작성하면 모든 도구에 배포:
|
|
29
33
|
|
|
30
34
|
```
|
|
31
35
|
한 번 작성:
|
|
@@ -38,7 +42,7 @@ AI 코딩 도구마다 룰 형식이 다릅니다 — `.claude/rules/*.md`, `.cu
|
|
|
38
42
|
✓ Codex → .codex/AGENTS.md (통합)
|
|
39
43
|
|
|
40
44
|
하나의 소스. 모든 도구가 동기화됩니다.
|
|
41
|
-
|
|
45
|
+
200개 이상 설치, 프롬프트당 2-3개만 로딩.
|
|
42
46
|
```
|
|
43
47
|
|
|
44
48
|
---
|
|
@@ -47,12 +51,12 @@ AI 코딩 도구마다 룰 형식이 다릅니다 — `.claude/rules/*.md`, `.cu
|
|
|
47
51
|
|
|
48
52
|
| | 강점 | 상세 |
|
|
49
53
|
|---|---|---|
|
|
50
|
-
|
|
|
51
|
-
| **한 번 작성, 어디서든 배포** | 하나의
|
|
52
|
-
| **AI 기반
|
|
53
|
-
| **팀 전체 일관성** | Git 기반
|
|
54
|
-
| **내 수정은 안전** | 비파괴적 업데이트 | install과 update 모두 로컬 커스터마이징을 절대 덮어쓰지
|
|
55
|
-
| **커뮤니티 마켓플레이스** | 브라우저에서 검색, 설치, 제거 | `npx ai-nexus browse`로 로컬 웹 UI
|
|
54
|
+
| **다 설치해도 필요한 것만 로딩** | 200개 이상 설치, 프롬프트당 2-3개만 로딩 | 시맨틱 라우터가 프롬프트를 분석해 필요한 것만 골라 로드 — 룰, 스킬, 커맨드, 에이전트 전부. 설치할 때 자기검열할 필요 없음. |
|
|
55
|
+
| **한 번 작성, 어디서든 배포** | 하나의 파일 → 세 가지 도구 | `.md` 파일 하나만 작성하면 Cursor용 `.mdc`, Codex용 `AGENTS.md`로 자동 변환. 복붙 불필요. |
|
|
56
|
+
| **AI 기반 선택** | GPT-4o-mini 또는 Claude Haiku가 선택 | 매 프롬프트마다 훅이 실행되어 필요한 것만 로딩. 월 ~$0.50. AI 없이도 키워드 매칭으로 무료 동작. |
|
|
57
|
+
| **팀 전체 일관성** | Git 기반 공유 | 모든 팀원이 같은 저장소에서 설치. `npx ai-nexus update` 한 번으로 전팀 동기화. |
|
|
58
|
+
| **내 수정은 안전** | 비파괴적 업데이트 | install과 update 모두 로컬 커스터마이징을 절대 덮어쓰지 않음. 새 파일만 추가. |
|
|
59
|
+
| **커뮤니티 마켓플레이스** | 브라우저에서 검색, 설치, 제거 | `npx ai-nexus browse`로 로컬 웹 UI. 230개 이상의 커뮤니티 룰과 스킬, PR merge 즉시 사용 가능. |
|
|
56
60
|
|
|
57
61
|
---
|
|
58
62
|
|
|
@@ -85,9 +89,9 @@ npx ai-nexus install --rules github.com/your-org/team-rules
|
|
|
85
89
|
|
|
86
90
|
| 도구 | 동작 방식 | 토큰 부담 |
|
|
87
91
|
|------|-----------|-----------|
|
|
88
|
-
| **Claude Code** | 시맨틱 라우터가 프롬프트마다
|
|
89
|
-
| **Cursor** |
|
|
90
|
-
| **Codex** | 집계된 `AGENTS.md` (
|
|
92
|
+
| **Claude Code** | 시맨틱 라우터가 프롬프트마다 관련 룰과 스킬을 동적 로딩 | 2-3개만 로딩 |
|
|
93
|
+
| **Cursor** | `.mdc` 형식으로 변환; Cursor 내장 검색이 필터링 | Cursor 검색에 의존 |
|
|
94
|
+
| **Codex** | 집계된 `AGENTS.md` (전체 파일 병합) | 전체 로딩 |
|
|
91
95
|
|
|
92
96
|
---
|
|
93
97
|
|
|
@@ -95,7 +99,7 @@ npx ai-nexus install --rules github.com/your-org/team-rules
|
|
|
95
99
|
|
|
96
100
|
### Claude Code: 시맨틱 라우터
|
|
97
101
|
|
|
98
|
-
|
|
102
|
+
`alwaysApply: false`는 Claude가 컨텍스트 안에서 모든 description을 읽고 판단합니다. ai-nexus는 Claude가 시작되기 **전에** 훅이 실행되어 관련 파일을 `rules/`로, 나머지를 `rules-inactive/`로 물리적으로 이동시킵니다. Claude는 불필요한 파일을 아예 보지 않습니다:
|
|
99
103
|
|
|
100
104
|
```
|
|
101
105
|
~/.claude/
|
|
@@ -112,12 +116,12 @@ export OPENAI_API_KEY=sk-xxx # 또는 ANTHROPIC_API_KEY
|
|
|
112
116
|
export SEMANTIC_ROUTER_ENABLED=true
|
|
113
117
|
```
|
|
114
118
|
|
|
115
|
-
GPT-4o-mini 또는 Claude Haiku가 프롬프트를 분석해 적절한
|
|
119
|
+
GPT-4o-mini 또는 Claude Haiku가 프롬프트를 분석해 적절한 룰과 스킬을 선택합니다. 비용: 월 ~$0.50. 명시적으로 활성화해야 동작합니다.
|
|
116
120
|
|
|
117
121
|
> **상세 설정 가이드:** [시맨틱 라우터 설정](https://jsk9999.github.io/ai-nexus/docs.html#semantic-router-setup) — 프로바이더 선택, 환경 변수, 커스텀 모델, 동작 확인 방법.
|
|
118
122
|
|
|
119
123
|
**AI 없이** (기본값):
|
|
120
|
-
프롬프트의 키워드를 매칭해서
|
|
124
|
+
프롬프트의 키워드를 매칭해서 룰과 스킬을 활성화합니다. 비용 없음, API 키 불필요.
|
|
121
125
|
|
|
122
126
|
### Cursor: 룰 변환기
|
|
123
127
|
|
|
@@ -398,26 +402,31 @@ node bin/ai-nexus.cjs test "your prompt"
|
|
|
398
402
|
|
|
399
403
|
## FAQ
|
|
400
404
|
|
|
401
|
-
|
|
405
|
+
**나한테 이게 필요해?**
|
|
402
406
|
|
|
403
|
-
|
|
404
|
-
-
|
|
405
|
-
-
|
|
406
|
-
-
|
|
407
|
+
도구 하나에 룰이나 스킬 몇 개면 굳이 필요 없습니다. 해당 도구 자체 설정으로 충분해요. ai-nexus는 이런 사람들을 위한 거예요:
|
|
408
|
+
- 룰/스킬을 많이 설치하고 효율적으로 로딩하고 싶을 때 (200개 이상 설치, 2-3개만 로딩)
|
|
409
|
+
- **여러 도구** (Claude Code + Cursor + Codex)를 쓰면서 한 곳에서 관리하고 싶을 때
|
|
410
|
+
- **230개 이상 커뮤니티 룰과 스킬**을 직접 안 쓰고 바로 가져다 쓰고 싶을 때
|
|
407
411
|
|
|
408
|
-
|
|
412
|
+
**스킬만 쓰고 룰은 안 쓰는데, 의미가 있나요?**
|
|
409
413
|
|
|
410
|
-
|
|
414
|
+
네. 시맨틱 라우터는 스킬, 룰, 커맨드, 에이전트 전부 동일하게 라우팅합니다. 스킬 50개를 깔아도 프롬프트마다 관련 있는 것만 로딩됩니다. "다 설치해도 토큰 걱정 없음"이 스킬에도 똑같이 적용됩니다.
|
|
411
415
|
|
|
412
|
-
|
|
416
|
+
**Claude Code 스킬(`alwaysApply: false`)이랑 뭐가 다른가요?**
|
|
417
|
+
|
|
418
|
+
스킬은 Claude Code 안에서 온디맨드 로딩을 처리합니다. ai-nexus는 추가로:
|
|
419
|
+
- **크로스 도구 동기화** — 스킬을 Cursor와 Codex에도 배포
|
|
420
|
+
- **더 저렴한 라우팅** — 키워드 매칭(무료) 또는 저렴한 모델로 필터링
|
|
421
|
+
- **커뮤니티 라이브러리** — 230개 이상의 룰과 스킬 바로 사용
|
|
413
422
|
|
|
414
|
-
|
|
423
|
+
**CLAUDE.md나 AGENTS.md에 다 넣으면 되지 않나요?**
|
|
415
424
|
|
|
416
|
-
|
|
425
|
+
5개면 괜찮지만 50개 넘으면 커밋 메시지 쓸 때 Docker best practices까지 같이 로드됩니다. [ETH Zurich 연구](https://arxiv.org/pdf/2602.11988)에서도 성능과 비용 둘 다 악화시킨다고 나왔습니다. ai-nexus는 프롬프트당 2-3개만 로드합니다.
|
|
417
426
|
|
|
418
|
-
|
|
427
|
+
**스킬 vs 룰?**
|
|
419
428
|
|
|
420
|
-
ai-nexus는
|
|
429
|
+
스킬은 직접 호출하는 워크플로우 (`/commit`, `/review`). 룰은 자동으로 적용되는 패시브 가이드라인 (코딩 컨벤션, 보안 기준, 네이밍 패턴). ai-nexus는 둘 다 프롬프트 기반으로 라우팅 — 뭘 호출할지 기억할 필요 없음.
|
|
421
430
|
|
|
422
431
|
---
|
|
423
432
|
|
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# ai-nexus
|
|
4
4
|
|
|
5
|
-
>
|
|
6
|
-
>
|
|
5
|
+
> Install 200+ rules and skills. Only 2-3 load per prompt.
|
|
6
|
+
> Write once, deploy across Claude Code, Cursor, and Codex.
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/ai-nexus)
|
|
9
9
|
[](https://www.npmjs.com/package/ai-nexus)
|
|
10
10
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
11
11
|
|
|
12
|
-
**[Homepage](https://jsk9999.github.io/ai-nexus/)** | **[Documentation](https://jsk9999.github.io/ai-nexus/docs.html)**
|
|
12
|
+
**[Homepage](https://jsk9999.github.io/ai-nexus/)** | **[Documentation](https://jsk9999.github.io/ai-nexus/docs.html)** | **[Roadmap](ROADMAP.md)**
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npx ai-nexus install
|
|
@@ -19,13 +19,17 @@ npx ai-nexus install
|
|
|
19
19
|
|
|
20
20
|
## The Problem
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Rules with `alwaysApply: true` load on every prompt — the more you have, the more tokens you waste. With `alwaysApply: false`, Claude reads every rule's description to decide what to load — all your rule descriptions sit in Claude's context while it picks 2-3. You're paying Claude to filter rules instead of writing code. Skills and commands only load when invoked, but that means you have to remember what to call and when.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Most people end up self-censoring: only installing a handful of rules or skills to keep things manageable. That means leaving useful context on the table.
|
|
25
|
+
|
|
26
|
+
A [recent study from ETH Zurich](https://arxiv.org/pdf/2602.11988) (12 repos, 5,694 PRs) confirms this: **loading all rules at once hurts performance by ~3% and increases cost by 20%+.** The takeaway: only relevant context should be loaded per prompt.
|
|
27
|
+
|
|
28
|
+
On top of that, every AI tool has its own format — `.claude/rules/*.md`, `.cursor/rules/*.mdc`, `.codex/AGENTS.md`. If you use more than one tool, you end up maintaining the same rules and skills in multiple places, and they inevitably drift apart.
|
|
25
29
|
|
|
26
30
|
## The Solution
|
|
27
31
|
|
|
28
|
-
**ai-nexus**
|
|
32
|
+
**ai-nexus** filters rules **before Claude sees them**. A semantic router hook runs on each prompt, picks 2-3 relevant files, and physically parks the rest in `rules-inactive/`. Claude only sees what it needs — it doesn't even know the rest exist. Filtering is done by keyword matching (free) or GPT-4o-mini (~$0.50/month), not by Claude. Write once, deploy across all your tools:
|
|
29
33
|
|
|
30
34
|
```
|
|
31
35
|
Write once:
|
|
@@ -38,7 +42,7 @@ Deploy everywhere:
|
|
|
38
42
|
✓ Codex → .codex/AGENTS.md (aggregated)
|
|
39
43
|
|
|
40
44
|
One source of truth. Every tool in sync.
|
|
41
|
-
|
|
45
|
+
200+ installed, only 2-3 loaded per prompt.
|
|
42
46
|
```
|
|
43
47
|
|
|
44
48
|
---
|
|
@@ -47,12 +51,12 @@ Only relevant rules loaded per prompt.
|
|
|
47
51
|
|
|
48
52
|
| | Benefit | Detail |
|
|
49
53
|
|---|---|---|
|
|
50
|
-
| **
|
|
51
|
-
| **Write once, deploy everywhere** | One
|
|
52
|
-
| **AI-powered
|
|
53
|
-
| **Team-wide consistency** | Git-based
|
|
54
|
+
| **Install everything, load only what's needed** | 200+ rules and skills installed, only 2-3 loaded per prompt | Semantic Router analyzes your prompt and picks just what you need — rules, skills, commands, agents. No more self-censoring what to install. |
|
|
55
|
+
| **Write once, deploy everywhere** | One file → three tools | Write a single `.md` file. ai-nexus auto-converts to `.mdc` for Cursor and `AGENTS.md` for Codex. No more copy-pasting. |
|
|
56
|
+
| **AI-powered selection** | GPT-4o-mini or Claude Haiku picks files for you | A hook runs on every prompt, loading only what you need. Costs ~$0.50/month. Falls back to keyword matching with zero cost. |
|
|
57
|
+
| **Team-wide consistency** | Git-based sharing | Everyone installs from the same repo. `npx ai-nexus update` keeps the whole team in sync. |
|
|
54
58
|
| **Your edits are safe** | Non-destructive updates | Install and update never overwrite your local customizations. Only new files are added. |
|
|
55
|
-
| **Community marketplace** | Browse, install, remove — from your browser | `npx ai-nexus browse` opens a local web UI.
|
|
59
|
+
| **Community marketplace** | Browse, install, remove — from your browser | `npx ai-nexus browse` opens a local web UI. 230+ community rules and skills available instantly after PR merge. |
|
|
56
60
|
|
|
57
61
|
---
|
|
58
62
|
|
|
@@ -85,9 +89,9 @@ npx ai-nexus install --rules github.com/your-org/team-rules
|
|
|
85
89
|
|
|
86
90
|
| Tool | How it works | Token overhead |
|
|
87
91
|
|------|--------------|----------------|
|
|
88
|
-
| **Claude Code** | Semantic Router dynamically
|
|
89
|
-
| **Cursor** | Converts
|
|
90
|
-
| **Codex** | Aggregated `AGENTS.md` (
|
|
92
|
+
| **Claude Code** | Semantic Router dynamically loads relevant rules and skills per prompt | Only 2-3 files loaded |
|
|
93
|
+
| **Cursor** | Converts to `.mdc` format; Cursor's built-in search handles filtering | Depends on Cursor's search |
|
|
94
|
+
| **Codex** | Aggregated `AGENTS.md` (all files merged into single file) | All files loaded |
|
|
91
95
|
|
|
92
96
|
---
|
|
93
97
|
|
|
@@ -95,7 +99,7 @@ npx ai-nexus install --rules github.com/your-org/team-rules
|
|
|
95
99
|
|
|
96
100
|
### Claude Code: Semantic Router
|
|
97
101
|
|
|
98
|
-
|
|
102
|
+
Unlike `alwaysApply: false` where Claude reads all descriptions inside its context, ai-nexus runs a hook **before** Claude starts. It moves relevant files into `rules/` and parks the rest in `rules-inactive/`. Claude never sees the irrelevant ones:
|
|
99
103
|
|
|
100
104
|
```
|
|
101
105
|
~/.claude/
|
|
@@ -112,12 +116,12 @@ export OPENAI_API_KEY=sk-xxx # or ANTHROPIC_API_KEY
|
|
|
112
116
|
export SEMANTIC_ROUTER_ENABLED=true
|
|
113
117
|
```
|
|
114
118
|
|
|
115
|
-
GPT-4o-mini or Claude Haiku analyzes your prompt and picks the right rules. Cost: ~$0.50/month. Requires explicit opt-in.
|
|
119
|
+
GPT-4o-mini or Claude Haiku analyzes your prompt and picks the right rules and skills. Cost: ~$0.50/month. Requires explicit opt-in.
|
|
116
120
|
|
|
117
121
|
> **Full setup guide:** [Semantic Router Setup](https://jsk9999.github.io/ai-nexus/docs.html#semantic-router-setup) — provider selection, environment variables, custom models, and verification.
|
|
118
122
|
|
|
119
123
|
**Without AI** (default):
|
|
120
|
-
Keyword matching activates rules based on words in your prompt. Zero cost, no API key needed.
|
|
124
|
+
Keyword matching activates rules and skills based on words in your prompt. Zero cost, no API key needed.
|
|
121
125
|
|
|
122
126
|
### Cursor: Rule Converter
|
|
123
127
|
|
|
@@ -398,26 +402,31 @@ node bin/ai-nexus.cjs test "your prompt"
|
|
|
398
402
|
|
|
399
403
|
## FAQ
|
|
400
404
|
|
|
401
|
-
**
|
|
405
|
+
**Do I actually need this?**
|
|
402
406
|
|
|
403
|
-
|
|
404
|
-
-
|
|
405
|
-
-
|
|
406
|
-
-
|
|
407
|
+
If you use one tool with a few rules or skills, probably not — your tool's built-in settings are enough. ai-nexus is for people who:
|
|
408
|
+
- Install a lot of rules/skills and want them loaded efficiently (200+ installed, 2-3 loaded)
|
|
409
|
+
- Use **multiple tools** (Claude Code + Cursor + Codex) and want one source of truth
|
|
410
|
+
- Want **230+ community rules and skills** without writing everything from scratch
|
|
407
411
|
|
|
408
|
-
|
|
412
|
+
**I only use skills, not rules. Is this relevant?**
|
|
409
413
|
|
|
410
|
-
|
|
414
|
+
Yes. The semantic router handles skills, rules, commands, and agents equally. Install 50 skills and only the relevant ones load per prompt. The "install everything without worrying about tokens" benefit applies to skills just as much as rules.
|
|
411
415
|
|
|
412
|
-
|
|
416
|
+
**How is this different from Claude Code skills (`alwaysApply: false`)?**
|
|
417
|
+
|
|
418
|
+
Skills handle on-demand loading within Claude Code. ai-nexus adds:
|
|
419
|
+
- **Cross-tool sync** — deploy skills to Cursor and Codex too, not just Claude Code
|
|
420
|
+
- **Smarter routing** — keyword matching (free) or a cheaper model instead of Claude doing the filtering
|
|
421
|
+
- **Community library** — 230+ rules and skills ready to use
|
|
413
422
|
|
|
414
|
-
|
|
423
|
+
**Why not just put everything in CLAUDE.md or AGENTS.md?**
|
|
415
424
|
|
|
416
|
-
|
|
425
|
+
Works fine with 5 files. With 50+, you're burning tokens on Docker best practices while writing a commit message. The [ETH Zurich study](https://arxiv.org/pdf/2602.11988) shows this hurts both performance and cost. ai-nexus loads only 2-3 relevant files per prompt.
|
|
417
426
|
|
|
418
|
-
Skills
|
|
427
|
+
**Skills vs rules?**
|
|
419
428
|
|
|
420
|
-
|
|
429
|
+
Skills are workflows you explicitly invoke (`/commit`, `/review`). Rules are passive guidelines that apply automatically (coding conventions, security standards, naming patterns). ai-nexus routes both based on your prompt — no need to remember which to invoke.
|
|
421
430
|
|
|
422
431
|
---
|
|
423
432
|
|
package/bin/ai-nexus.cjs
CHANGED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guidelines for building maintainable Java Spring Boot services and REST APIs using common production patterns
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Java & Spring Boot Development
|
|
6
|
+
|
|
7
|
+
## Project Structure
|
|
8
|
+
|
|
9
|
+
Prefer a clear layered structure.
|
|
10
|
+
|
|
11
|
+
Typical layout:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
src/main/java/com/example/app
|
|
15
|
+
├── controller → HTTP layer
|
|
16
|
+
├── service → business logic
|
|
17
|
+
├── repository → persistence
|
|
18
|
+
├── entity → JPA models
|
|
19
|
+
├── dto → request/response objects
|
|
20
|
+
└── config → security and configuration
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Avoid putting business logic in controllers.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## REST Controller Design
|
|
28
|
+
|
|
29
|
+
Controllers should only handle HTTP concerns.
|
|
30
|
+
|
|
31
|
+
Responsibilities:
|
|
32
|
+
|
|
33
|
+
- validate input
|
|
34
|
+
- call service layer
|
|
35
|
+
- return response objects
|
|
36
|
+
|
|
37
|
+
Example pattern:
|
|
38
|
+
|
|
39
|
+
```java
|
|
40
|
+
@RestController
|
|
41
|
+
@RequestMapping("/api/users")
|
|
42
|
+
class UserController {
|
|
43
|
+
|
|
44
|
+
private final UserService userService;
|
|
45
|
+
|
|
46
|
+
UserController(UserService userService) {
|
|
47
|
+
this.userService = userService;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Follow standard REST endpoints:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
GET /users
|
|
57
|
+
GET /users/{id}
|
|
58
|
+
POST /users
|
|
59
|
+
PUT /users/{id}
|
|
60
|
+
DELETE /users/{id}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Return appropriate HTTP status codes.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Service Layer
|
|
68
|
+
|
|
69
|
+
Business logic belongs in services.
|
|
70
|
+
|
|
71
|
+
Guidelines:
|
|
72
|
+
|
|
73
|
+
- annotate with `@Service`
|
|
74
|
+
- keep controllers thin
|
|
75
|
+
- avoid database code in controllers
|
|
76
|
+
|
|
77
|
+
Example:
|
|
78
|
+
|
|
79
|
+
```java
|
|
80
|
+
@Service
|
|
81
|
+
class UserService {
|
|
82
|
+
|
|
83
|
+
private final UserRepository repo;
|
|
84
|
+
|
|
85
|
+
UserService(UserRepository repo) {
|
|
86
|
+
this.repo = repo;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Persistence with JPA
|
|
95
|
+
|
|
96
|
+
Use Spring Data JPA repositories.
|
|
97
|
+
|
|
98
|
+
Guidelines:
|
|
99
|
+
|
|
100
|
+
- annotate entities with `@Entity`
|
|
101
|
+
- use `@Id` and generated IDs
|
|
102
|
+
- prefer `FetchType.LAZY` for relations
|
|
103
|
+
- avoid exposing entities directly in APIs
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
```java
|
|
108
|
+
@ManyToOne(fetch = FetchType.LAZY)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Use DTOs for responses.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Dependency Injection
|
|
116
|
+
|
|
117
|
+
Prefer constructor injection.
|
|
118
|
+
|
|
119
|
+
Good:
|
|
120
|
+
|
|
121
|
+
```java
|
|
122
|
+
UserService(UserRepository repo)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Avoid:
|
|
126
|
+
|
|
127
|
+
```java
|
|
128
|
+
@Autowired
|
|
129
|
+
private UserRepository repo;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Constructor injection improves testability.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Configuration
|
|
137
|
+
|
|
138
|
+
Keep configuration external.
|
|
139
|
+
|
|
140
|
+
Use:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
application.yml
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Profiles should separate environments:
|
|
147
|
+
|
|
148
|
+
- dev
|
|
149
|
+
- test
|
|
150
|
+
- prod
|
|
151
|
+
|
|
152
|
+
Example configuration:
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
spring:
|
|
156
|
+
datasource:
|
|
157
|
+
url: jdbc:postgresql://localhost:5432/app
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## General Practices
|
|
163
|
+
|
|
164
|
+
- keep classes small and focused
|
|
165
|
+
- write meaningful method names
|
|
166
|
+
- use validation annotations for request data
|
|
167
|
+
- handle errors with `@ControllerAdvice`
|
|
168
|
+
- log important application events
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Tailwind CSS utility-first styling best practices
|
|
3
|
+
keywords: [tailwind, tailwindcss, css, utility-first, styling]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tailwind CSS Best Practices
|
|
7
|
+
|
|
8
|
+
## When to Apply
|
|
9
|
+
- Styling components with Tailwind utility classes
|
|
10
|
+
- Configuring themes and design tokens
|
|
11
|
+
- Implementing responsive or dark mode layouts
|
|
12
|
+
- Optimizing production CSS output
|
|
13
|
+
|
|
14
|
+
## Critical Rules
|
|
15
|
+
|
|
16
|
+
### 1. Utility-First Workflow
|
|
17
|
+
- Compose designs directly in markup with utility classes
|
|
18
|
+
- Avoid premature abstraction — inline utilities first, extract later
|
|
19
|
+
- Follow consistent class ordering: layout → sizing → spacing → typography → visual → state
|
|
20
|
+
- Use official Prettier plugin (`prettier-plugin-tailwindcss`) to auto-sort classes
|
|
21
|
+
|
|
22
|
+
### 2. Responsive Design
|
|
23
|
+
- Use mobile-first breakpoints: `sm:`, `md:`, `lg:`, `xl:`, `2xl:`
|
|
24
|
+
- Prefer `min-width` breakpoints; use `max-*:` variants sparingly
|
|
25
|
+
- Use container queries (`@container`, `@sm:`, `@lg:`) for component-level responsiveness
|
|
26
|
+
- Group responsive variants logically: `flex flex-col md:flex-row md:items-center`
|
|
27
|
+
|
|
28
|
+
### 3. Custom Theme Configuration
|
|
29
|
+
- Extend the default theme via `tailwind.config.js` / `tailwind.config.ts`
|
|
30
|
+
- Define design tokens for colors, spacing, and fonts under `theme.extend`
|
|
31
|
+
- Use CSS variables for dynamic theming: `--color-primary` mapped in config
|
|
32
|
+
- Keep config minimal — extend rather than override the defaults
|
|
33
|
+
|
|
34
|
+
### 4. Component Extraction & @apply
|
|
35
|
+
- Extract only when a pattern repeats ≥ 3 times across files
|
|
36
|
+
- Prefer component abstractions (React, Vue, etc.) over `@apply`
|
|
37
|
+
- If `@apply` is needed, keep rules in a dedicated layer: `@layer components { ... }`
|
|
38
|
+
- Never use `@apply` for one-off styles — use inline utilities instead
|
|
39
|
+
|
|
40
|
+
### 5. Dark Mode
|
|
41
|
+
- Use `class` strategy for user-controlled toggling: `darkMode: 'class'`
|
|
42
|
+
- Use `media` strategy when OS preference is sufficient
|
|
43
|
+
- Apply dark variants consistently: `bg-white dark:bg-gray-900`
|
|
44
|
+
- Define semantic color tokens that map to light/dark values
|
|
45
|
+
|
|
46
|
+
### 6. Performance & Production
|
|
47
|
+
- Enable JIT mode (default in Tailwind v3+)
|
|
48
|
+
- Configure `content` paths to include all template files for tree-shaking
|
|
49
|
+
- Avoid dynamic class construction: `bg-${color}-500` — use safelist or full classes
|
|
50
|
+
- Remove unused base/component layers if not needed: `@tailwind base;`
|
|
51
|
+
|
|
52
|
+
## File Structure
|
|
53
|
+
```
|
|
54
|
+
project/
|
|
55
|
+
tailwind.config.ts # Theme, plugins, content paths
|
|
56
|
+
postcss.config.js # PostCSS with tailwindcss + autoprefixer
|
|
57
|
+
src/
|
|
58
|
+
styles/
|
|
59
|
+
globals.css # @tailwind directives, custom @layer rules
|
|
60
|
+
components/ # UI components using utility classes
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Common Pitfalls
|
|
64
|
+
- Don't use string interpolation for class names — breaks tree-shaking
|
|
65
|
+
- Don't override the entire theme — use `theme.extend` to preserve defaults
|
|
66
|
+
- Don't mix Tailwind utilities with large custom CSS files — pick one approach
|
|
67
|
+
- Don't forget `content` config — missing paths cause styles to be purged
|
|
@@ -48,44 +48,36 @@ function parseFileMeta(filePath) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Recursively scan a directory for markdown files
|
|
52
52
|
*/
|
|
53
|
-
function
|
|
54
|
-
const files = [];
|
|
55
|
-
if (!fs.existsSync(dir))
|
|
56
|
-
return files;
|
|
53
|
+
function scanRecursive(dir, baseDir, category, files) {
|
|
57
54
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
58
55
|
for (const entry of entries) {
|
|
59
56
|
const fullPath = path.join(dir, entry.name);
|
|
60
57
|
if (entry.isDirectory()) {
|
|
61
|
-
|
|
62
|
-
const subEntries = fs.readdirSync(fullPath, { withFileTypes: true });
|
|
63
|
-
for (const subEntry of subEntries) {
|
|
64
|
-
if (!subEntry.isFile() || !subEntry.name.endsWith('.md'))
|
|
65
|
-
continue;
|
|
66
|
-
const subFile = subEntry.name;
|
|
67
|
-
const subFilePath = path.join(fullPath, subFile);
|
|
68
|
-
const meta = parseFileMeta(subFilePath);
|
|
69
|
-
files.push({
|
|
70
|
-
name: meta.name,
|
|
71
|
-
file: `${entry.name}/${subFile}`,
|
|
72
|
-
path: `${category}/${entry.name}/${subFile}`,
|
|
73
|
-
description: meta.description,
|
|
74
|
-
category,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
58
|
+
scanRecursive(fullPath, baseDir, category, files);
|
|
77
59
|
}
|
|
78
60
|
else if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
61
|
+
const relativePath = path.relative(baseDir, fullPath).replace(/\\/g, '/');
|
|
79
62
|
const meta = parseFileMeta(fullPath);
|
|
80
63
|
files.push({
|
|
81
64
|
name: meta.name,
|
|
82
|
-
file:
|
|
83
|
-
path: `${category}/${
|
|
65
|
+
file: relativePath,
|
|
66
|
+
path: `${category}/${relativePath}`,
|
|
84
67
|
description: meta.description,
|
|
85
68
|
category,
|
|
86
69
|
});
|
|
87
70
|
}
|
|
88
71
|
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Scan a directory for markdown files and extract metadata
|
|
75
|
+
*/
|
|
76
|
+
function scanCategoryDir(dir, category) {
|
|
77
|
+
const files = [];
|
|
78
|
+
if (!fs.existsSync(dir))
|
|
79
|
+
return files;
|
|
80
|
+
scanRecursive(dir, dir, category, files);
|
|
89
81
|
return files;
|
|
90
82
|
}
|
|
91
83
|
/**
|
package/dist/utils/registry.js
CHANGED
|
@@ -31,11 +31,12 @@ export async function fetchRegistry() {
|
|
|
31
31
|
if (!item.path.endsWith('.md'))
|
|
32
32
|
continue;
|
|
33
33
|
const parts = item.path.replace('config/', '').split('/');
|
|
34
|
-
if (parts.length
|
|
34
|
+
if (parts.length < 2)
|
|
35
35
|
continue;
|
|
36
|
-
const
|
|
36
|
+
const category = parts[0];
|
|
37
37
|
if (!CATEGORIES.includes(category))
|
|
38
38
|
continue;
|
|
39
|
+
const name = parts.slice(1).join('/');
|
|
39
40
|
files.push({
|
|
40
41
|
name,
|
|
41
42
|
category,
|
|
@@ -249,6 +249,9 @@ const KEYWORD_MAP = {
|
|
|
249
249
|
'nuxt': { skills: ['vue.md'] },
|
|
250
250
|
'svelte': { skills: ['svelte.md'] },
|
|
251
251
|
'sveltekit': { skills: ['svelte.md'] },
|
|
252
|
+
'tailwind': { skills: ['tailwind.md'] },
|
|
253
|
+
'tailwindcss': { skills: ['tailwind.md'] },
|
|
254
|
+
'utility-first': { skills: ['tailwind.md'] },
|
|
252
255
|
'refactor': { commands: ['refactor.md'] },
|
|
253
256
|
'리팩토링': { commands: ['refactor.md'] },
|
|
254
257
|
'debug': { commands: ['debug.md'], contexts: ['debug.md'] },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-nexus",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.5.3",
|
|
4
|
+
"description": "Install 200+ AI coding rules and skills — only 2-3 load per prompt. Write once, deploy across Claude Code, Cursor, and Codex.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ai-nexus": "bin/ai-nexus.cjs"
|