codex-arsenal 0.1.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/CLAUDE.md +15 -0
- package/CODEX.md +121 -0
- package/README.md +173 -0
- package/bin/cli.js +85 -0
- package/configs/codex/config.json +6 -0
- package/configs/vscode/settings.json +5 -0
- package/lib/fetcher.js +31 -0
- package/lib/installer.js +89 -0
- package/lib/manifest.js +93 -0
- package/package.json +45 -0
- package/plugins/context-window-compressor/README.md +7 -0
- package/plugins/context-window-compressor/plugin.json +6 -0
- package/prompts/system-prompts/solo-dev.md +11 -0
- package/skills/debug-workflow/README.md +12 -0
- package/skills/debug-workflow/prompt.md +3 -0
- package/skills/debug-workflow/workflow.json +11 -0
- package/skills/test-gen/README.md +15 -0
- package/skills/test-gen/prompt.md +1 -0
- package/workflows/solo-dev-loop/README.md +12 -0
- package/workflows/solo-dev-loop/setup.sh +5 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Use this file as a project-local behavior guide for Claude Code agents.
|
|
4
|
+
|
|
5
|
+
## Operating Principles
|
|
6
|
+
|
|
7
|
+
- Read the repository instructions before editing.
|
|
8
|
+
- Keep changes small and directly tied to the task.
|
|
9
|
+
- Prefer tests before behavior changes.
|
|
10
|
+
- Explain uncertainty instead of guessing silently.
|
|
11
|
+
- Do not overwrite user work unless explicitly asked.
|
|
12
|
+
|
|
13
|
+
## Completion Criteria
|
|
14
|
+
|
|
15
|
+
Before reporting completion, run the smallest command that proves the change works and summarize the result.
|
package/CODEX.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# CODEX.md
|
|
2
|
+
|
|
3
|
+
> Behavioral guidelines to reduce common LLM coding mistakes.
|
|
4
|
+
> Merge with project-specific instructions as needed.
|
|
5
|
+
> **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Think Before Coding
|
|
10
|
+
|
|
11
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
12
|
+
|
|
13
|
+
Before implementing:
|
|
14
|
+
|
|
15
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
16
|
+
- If multiple interpretations exist, present them — don't pick silently.
|
|
17
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
18
|
+
- If something is unclear, **stop**. Name what's confusing. Ask.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. Simplicity First
|
|
23
|
+
|
|
24
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
25
|
+
|
|
26
|
+
- No features beyond what was asked.
|
|
27
|
+
- No abstractions for single-use code.
|
|
28
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
29
|
+
- No error handling for impossible scenarios.
|
|
30
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
31
|
+
|
|
32
|
+
> Ask yourself: *"Would a senior engineer say this is overcomplicated?"*
|
|
33
|
+
> If yes — simplify.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Surgical Changes
|
|
38
|
+
|
|
39
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
40
|
+
|
|
41
|
+
When editing existing code:
|
|
42
|
+
|
|
43
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
44
|
+
- Don't refactor things that aren't broken.
|
|
45
|
+
- Match existing style, even if you'd do it differently.
|
|
46
|
+
- If you notice unrelated dead code, **mention it — don't delete it**.
|
|
47
|
+
|
|
48
|
+
When your changes create orphans:
|
|
49
|
+
|
|
50
|
+
- Remove imports / variables / functions that **YOUR changes** made unused.
|
|
51
|
+
- Don't remove pre-existing dead code unless asked.
|
|
52
|
+
|
|
53
|
+
> **The test:** Every changed line should trace directly to the user's request.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Goal-Driven Execution
|
|
58
|
+
|
|
59
|
+
**Define success criteria. Loop until verified.**
|
|
60
|
+
|
|
61
|
+
Transform tasks into verifiable goals:
|
|
62
|
+
|
|
63
|
+
| Vague | Verifiable |
|
|
64
|
+
|-------|------------|
|
|
65
|
+
| "Add validation" | "Write tests for invalid inputs, then make them pass" |
|
|
66
|
+
| "Fix the bug" | "Write a test that reproduces it, then make it pass" |
|
|
67
|
+
| "Refactor X" | "Ensure tests pass before and after" |
|
|
68
|
+
|
|
69
|
+
For multi-step tasks, state a brief plan:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
1. [Step] → verify: [check]
|
|
73
|
+
2. [Step] → verify: [check]
|
|
74
|
+
3. [Step] → verify: [check]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Strong success criteria let you loop independently.
|
|
78
|
+
Weak criteria ("make it work") require constant clarification.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 5. Agentic Execution (Codex-specific)
|
|
83
|
+
|
|
84
|
+
**Codex runs with more autonomy — so guardrails matter more.**
|
|
85
|
+
|
|
86
|
+
- **Sandbox first:** Never run destructive commands (`rm -rf`, DB migrations, deploys) without explicit confirmation.
|
|
87
|
+
- **Read before write:** Understand the existing codebase structure before modifying it. Use `find`, `grep`, `cat` to build context.
|
|
88
|
+
- **One action at a time:** In agentic loops, complete and verify each step before proceeding to the next.
|
|
89
|
+
- **Fail loudly:** If a step fails, surface the error immediately. Don't try to work around it silently.
|
|
90
|
+
- **Scope your shell:** Prefer relative paths over absolute. Never assume a working directory without confirming it.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 6. Context Awareness
|
|
95
|
+
|
|
96
|
+
**Codex has a limited context window — use it wisely.**
|
|
97
|
+
|
|
98
|
+
- Don't re-read files you've already loaded. Reference prior output instead.
|
|
99
|
+
- When summarizing large codebases, compress systematically: directory tree → key files → function signatures.
|
|
100
|
+
- If context is filling up, state it: *"I'm approaching context limits. Summarizing and continuing."*
|
|
101
|
+
- Prefer targeted grep/search over reading entire files when looking for a specific symbol.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 7. Tool Use Discipline
|
|
106
|
+
|
|
107
|
+
**Every tool call has a cost. Make them count.**
|
|
108
|
+
|
|
109
|
+
- Batch related reads into a single operation where possible.
|
|
110
|
+
- Don't run the same command twice to "verify" — if you need to verify, define the assertion first.
|
|
111
|
+
- Avoid speculative exploration ("let me just check...") — know what you're looking for before you look.
|
|
112
|
+
- If a tool fails, diagnose before retrying. Don't brute-force.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## ✅ These guidelines are working if:
|
|
117
|
+
|
|
118
|
+
- Diffs contain fewer unnecessary changes
|
|
119
|
+
- Fewer rewrites due to overcomplication
|
|
120
|
+
- Clarifying questions come **before** implementation, not after mistakes
|
|
121
|
+
- Agentic runs complete tasks end-to-end without silent failures or scope creep
|
package/README.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Codex-Arsenal
|
|
2
|
+
|
|
3
|
+
> OpenAI Codex / Claude Code 기반 개발 경험을 극대화하기 위한
|
|
4
|
+
> 플러그인 · 스킬 · 워크플로 · 설정 · 프롬프트 큐레이션 레포지토리.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🧭 이 레포는 무엇인가?
|
|
9
|
+
|
|
10
|
+
**Codex-Arsenal**은 AI 코딩 에이전트(OpenAI Codex, Claude Code 등)를 실무에 적용하면서
|
|
11
|
+
"vanilla setup만으로는 부족하다"고 느낀 개발자들을 위한 실용 자료 모음입니다.
|
|
12
|
+
|
|
13
|
+
단순한 awesome list와 다른 점:
|
|
14
|
+
|
|
15
|
+
- 실제로 써봤거나, 체감 생산성이 검증된 것만 수록
|
|
16
|
+
- setup → 사용법 → 주의사항까지 한 곳에서 해결
|
|
17
|
+
- 개인 개발자 / 소규모 팀 모두를 대상으로 함
|
|
18
|
+
- Claude Code 스타일의 agentic workflow에 최적화
|
|
19
|
+
|
|
20
|
+
> **대상 독자:** 이미 Codex 또는 Claude Code를 써본 개발자.
|
|
21
|
+
> AI 코딩 도구가 처음이라면 [공식 문서](https://platform.openai.com/docs/guides/code)부터 시작하세요.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 📂 레포지토리 구조
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
codex-arsenal/
|
|
29
|
+
├── plugins/ # 에이전트 기능을 확장하는 플러그인 모음
|
|
30
|
+
├── skills/ # 재사용 가능한 에이전트 스킬 패키지
|
|
31
|
+
├── prompts/ # 프롬프트 템플릿 및 system prompt 예제
|
|
32
|
+
├── workflows/ # 워크플로 정의 및 실행 스크립트
|
|
33
|
+
├── configs/ # .codex, VSCode, zsh, tmux 등 설정 파일
|
|
34
|
+
├── references/ # 논문 · 블로그 · 주목할 GitHub 레포 링크
|
|
35
|
+
├── examples/ # 실전 데모 및 before/after 예제
|
|
36
|
+
└── README.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ✨ 수록 콘텐츠 카테고리
|
|
42
|
+
|
|
43
|
+
### 🔌 Plugins
|
|
44
|
+
|
|
45
|
+
에이전트 자체 기능을 보강하는 플러그인.
|
|
46
|
+
|
|
47
|
+
현재 수록 중 / 예정:
|
|
48
|
+
|
|
49
|
+
| 이름 | 설명 | 상태 |
|
|
50
|
+
|------|------|------|
|
|
51
|
+
| context-window-compressor | 긴 대화 컨텍스트를 압축해 토큰 절약 | 준비 중 |
|
|
52
|
+
| git-diff-helper | PR diff 요약 및 리뷰 요청 자동화 | 준비 중 |
|
|
53
|
+
| multi-agent-router | 여러 에이전트에 작업을 분배하는 라우터 | 계획 중 |
|
|
54
|
+
| repo-memory | 프로젝트 구조를 기억하는 메모리 레이어 | 계획 중 |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### 🧠 Skills
|
|
59
|
+
|
|
60
|
+
반복 작업에서 즉시 꺼내 쓸 수 있는 스킬셋.
|
|
61
|
+
|
|
62
|
+
| 스킬 | 설명 |
|
|
63
|
+
|------|------|
|
|
64
|
+
| `debug-workflow` | 에러 로그 → 원인 분석 → 수정 → 재현 테스트까지 파이프라인화 |
|
|
65
|
+
| `pr-reviewer` | PR diff를 받아 리뷰 코멘트를 자동 생성 |
|
|
66
|
+
| `test-gen` | 함수 시그니처와 코드를 보고 유닛 테스트 자동 생성 |
|
|
67
|
+
| `refactor-pipeline` | 코드 품질 분석 → 리팩터링 제안 → 적용까지 단계 처리 |
|
|
68
|
+
| `doc-gen` | 코드베이스에서 README, API 문서 자동 작성 |
|
|
69
|
+
| `arch-analysis` | 레포 전체 구조를 분석해 의존성 맵 생성 |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### ⚙️ Configs
|
|
74
|
+
|
|
75
|
+
실제 사용 중인 설정 파일 모음. 복붙 후 바로 사용 가능한 형태로 제공.
|
|
76
|
+
|
|
77
|
+
- `.codex/config.json` — Codex 에이전트 기본 설정 프리셋
|
|
78
|
+
- `settings.json` — VSCode + Codex 통합 설정
|
|
79
|
+
- `system-prompts/` — 역할별 system prompt 템플릿 (solo dev / 팀 / 레거시 분석)
|
|
80
|
+
- `.zshrc` 스니펫 — Codex CLI alias 및 단축키 모음
|
|
81
|
+
- `tmux.conf` — AI 세션을 병렬로 띄우기 위한 tmux 레이아웃
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### 🧩 Workflows
|
|
86
|
+
|
|
87
|
+
"어떻게 써야 잘 쓰는가"에 대한 실전 운영 방식.
|
|
88
|
+
|
|
89
|
+
| 워크플로 | 대상 | 핵심 아이디어 |
|
|
90
|
+
|----------|------|---------------|
|
|
91
|
+
| `solo-dev-loop` | 혼자 개발하는 개발자 | 계획 → 코딩 → 테스트 → 커밋을 에이전트와 함께 |
|
|
92
|
+
| `startup-mvp` | 빠른 프로토타입이 필요한 팀 | 스펙 → 구현 → 배포 최단 경로 |
|
|
93
|
+
| `legacy-onboarding` | 오래된 코드베이스 합류 | 에이전트로 구조 파악 → 코드 맵 생성 |
|
|
94
|
+
| `ai-pair-programming` | 주니어/미드 개발자 | 에이전트를 시니어처럼 활용하는 패턴 |
|
|
95
|
+
| `multi-agent-orch` | 복잡한 대형 태스크 | 여러 에이전트에게 역할 분배 후 결과 통합 |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### 📚 References
|
|
100
|
+
|
|
101
|
+
읽어볼 가치 있는 자료 큐레이션. 링크만 나열하지 않고, **왜 읽어야 하는지** 한 줄 설명 포함.
|
|
102
|
+
|
|
103
|
+
- 논문 · 연구 자료
|
|
104
|
+
- 주목할 GitHub 레포 (with star 기준 및 실용성 코멘트)
|
|
105
|
+
- 블로그 · 튜토리얼 (검증된 것만)
|
|
106
|
+
- 프롬프트 엔지니어링 컬렉션
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## ⭐ 수록 기준
|
|
111
|
+
|
|
112
|
+
모든 콘텐츠는 아래 기준을 만족해야 합니다:
|
|
113
|
+
|
|
114
|
+
| 기준 | 설명 |
|
|
115
|
+
|------|------|
|
|
116
|
+
| ✅ 실사용 검증 | 실제로 사용해봤거나, 커뮤니티에서 반복 검증된 것 |
|
|
117
|
+
| ✅ 실무 적용 가능 | 장난감 예제가 아닌 실제 코드베이스에 적용 가능 |
|
|
118
|
+
| ✅ 반복 사용성 | 한 번만 쓰고 마는 것이 아닌, 루틴으로 쓸 수 있는 것 |
|
|
119
|
+
| ✅ setup 대비 효율 | 설치/설정 비용보다 얻는 생산성이 명확히 큰 것 |
|
|
120
|
+
| ✅ 한계 보완 | Codex/Claude Code의 알려진 약점을 보완하는 것 |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 🛠 빠른 시작
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# 레포 클론
|
|
128
|
+
git clone https://github.com/your-username/codex-arsenal.git
|
|
129
|
+
cd codex-arsenal
|
|
130
|
+
|
|
131
|
+
# 설정 파일 적용 (예시: VSCode 설정)
|
|
132
|
+
cp configs/vscode/settings.json ~/.vscode/settings.json
|
|
133
|
+
|
|
134
|
+
# 워크플로 스크립트 실행 (예시: solo-dev-loop)
|
|
135
|
+
./workflows/solo-dev-loop/setup.sh
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
> 각 폴더에는 독립적인 `README.md`가 있어 개별 설치 및 사용법을 안내합니다.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 🤝 기여 방법
|
|
143
|
+
|
|
144
|
+
좋은 자료가 있다면 PR로 기여해주세요. 특히 환영하는 기여:
|
|
145
|
+
|
|
146
|
+
- 실제로 오래 써서 검증된 것
|
|
147
|
+
- before / after 생산성 차이가 명확한 것
|
|
148
|
+
- setup 과정이 step-by-step으로 정리된 것
|
|
149
|
+
- 특정 상황(레거시, 대형 레포, 팀 협업 등)에서 효과적인 것
|
|
150
|
+
|
|
151
|
+
**기여 절차:**
|
|
152
|
+
|
|
153
|
+
1. `fork` → feature 브랜치 생성 (`feat/plugin-이름` 또는 `feat/workflow-이름`)
|
|
154
|
+
2. 해당 카테고리 폴더에 파일 추가 (각 폴더의 `TEMPLATE.md` 참고)
|
|
155
|
+
3. PR 제목에 카테고리 명시: `[plugin] context-window-compressor 추가`
|
|
156
|
+
4. PR 본문에 **사용 배경 / 실제 효과 / 주의사항** 포함
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🌌 방향성
|
|
161
|
+
|
|
162
|
+
가까운 미래의 개발 환경은 "IDE + 자동완성 AI" 수준을 넘어,
|
|
163
|
+
개발자가 **여러 AI 에이전트를 orchestration하며 일하는 구조**에 가까워질 것입니다.
|
|
164
|
+
|
|
165
|
+
이 레포는 그 방향으로의 전환을 실험하고,
|
|
166
|
+
실제로 쓸 수 있는 도구와 패턴을 기록하는 공간입니다.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 📌 태그
|
|
171
|
+
|
|
172
|
+
`codex` `claude-code` `ai-agent` `developer-tools` `prompt-engineering`
|
|
173
|
+
`llm-workflow` `productivity` `automation` `vscode` `terminal`
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { MANIFEST, findManifestItems } from "../lib/manifest.js";
|
|
3
|
+
import { runInit } from "../lib/installer.js";
|
|
4
|
+
|
|
5
|
+
function printHelp() {
|
|
6
|
+
console.log(`codex-arsenal
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
codex-arsenal init [--yes] [--dir <path>]
|
|
10
|
+
codex-arsenal list
|
|
11
|
+
codex-arsenal get <id...> [--dir <path>]
|
|
12
|
+
`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function readOption(args, name, fallback = undefined) {
|
|
16
|
+
const index = args.indexOf(name);
|
|
17
|
+
if (index === -1) {
|
|
18
|
+
return fallback;
|
|
19
|
+
}
|
|
20
|
+
return args[index + 1] || fallback;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function nonOptionArgs(args) {
|
|
24
|
+
const result = [];
|
|
25
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
26
|
+
const arg = args[index];
|
|
27
|
+
if (arg === "--dir" || arg === "-d") {
|
|
28
|
+
index += 1;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (arg === "--yes" || arg === "-y") {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
result.push(arg);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function printList() {
|
|
40
|
+
let currentCategory = "";
|
|
41
|
+
for (const item of MANIFEST) {
|
|
42
|
+
if (item.category !== currentCategory) {
|
|
43
|
+
currentCategory = item.category;
|
|
44
|
+
console.log(`\n${currentCategory}`);
|
|
45
|
+
}
|
|
46
|
+
console.log(` ${item.id.padEnd(32)} ${item.description}`);
|
|
47
|
+
}
|
|
48
|
+
console.log();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function main(argv) {
|
|
52
|
+
const [command = "init", ...args] = argv;
|
|
53
|
+
const dir = readOption(args, "--dir", readOption(args, "-d", process.cwd()));
|
|
54
|
+
|
|
55
|
+
if (command === "help" || command === "--help" || command === "-h") {
|
|
56
|
+
printHelp();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (command === "list") {
|
|
61
|
+
printList();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (command === "get") {
|
|
66
|
+
const ids = nonOptionArgs(args);
|
|
67
|
+
if (!ids.length) {
|
|
68
|
+
throw new Error("get requires at least one item id");
|
|
69
|
+
}
|
|
70
|
+
await runInit({ preSelected: findManifestItems(ids), skipPrompt: true, dir });
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (command === "init") {
|
|
75
|
+
await runInit({ yes: args.includes("--yes") || args.includes("-y"), dir });
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
throw new Error(`Unknown command: ${command}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
main(process.argv.slice(2)).catch((error) => {
|
|
83
|
+
console.error(error.message);
|
|
84
|
+
process.exitCode = 1;
|
|
85
|
+
});
|
package/lib/fetcher.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import https from "node:https";
|
|
2
|
+
|
|
3
|
+
const REDIRECT_CODES = new Set([301, 302, 303, 307, 308]);
|
|
4
|
+
|
|
5
|
+
export function fetchFile(url) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
https
|
|
8
|
+
.get(url, (res) => {
|
|
9
|
+
if (REDIRECT_CODES.has(res.statusCode) && res.headers.location) {
|
|
10
|
+
const nextUrl = new URL(res.headers.location, url).toString();
|
|
11
|
+
res.resume();
|
|
12
|
+
fetchFile(nextUrl).then(resolve, reject);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (res.statusCode !== 200) {
|
|
17
|
+
res.resume();
|
|
18
|
+
reject(new Error(`HTTP ${res.statusCode} for ${url}`));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
res.setEncoding("utf8");
|
|
23
|
+
let data = "";
|
|
24
|
+
res.on("data", (chunk) => {
|
|
25
|
+
data += chunk;
|
|
26
|
+
});
|
|
27
|
+
res.on("end", () => resolve(data));
|
|
28
|
+
})
|
|
29
|
+
.on("error", reject);
|
|
30
|
+
});
|
|
31
|
+
}
|
package/lib/installer.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { createInterface } from "node:readline/promises";
|
|
3
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { BASE_URL, MANIFEST } from "./manifest.js";
|
|
6
|
+
import { fetchFile } from "./fetcher.js";
|
|
7
|
+
|
|
8
|
+
async function readSourceFile(src) {
|
|
9
|
+
try {
|
|
10
|
+
return await readFile(src, "utf8");
|
|
11
|
+
} catch (error) {
|
|
12
|
+
if (error.code !== "ENOENT") {
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
return fetchFile(`${BASE_URL}/${src}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function installItems(items, targetDir) {
|
|
20
|
+
const resolvedTarget = path.resolve(targetDir);
|
|
21
|
+
let installed = 0;
|
|
22
|
+
let failed = 0;
|
|
23
|
+
const failures = [];
|
|
24
|
+
|
|
25
|
+
for (const item of items) {
|
|
26
|
+
for (const file of item.files) {
|
|
27
|
+
const destination = path.join(resolvedTarget, file.dest);
|
|
28
|
+
try {
|
|
29
|
+
const content = await readSourceFile(file.src);
|
|
30
|
+
await mkdir(path.dirname(destination), { recursive: true });
|
|
31
|
+
await writeFile(destination, content, "utf8");
|
|
32
|
+
installed += 1;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
failed += 1;
|
|
35
|
+
failures.push({ item: item.id, file: file.src, error: error.message });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return { installed, failed, failures, targetDir: resolvedTarget };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function defaultItems() {
|
|
44
|
+
return MANIFEST.filter((item) => item.default);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function askForItems(preSelected = defaultItems()) {
|
|
48
|
+
const rl = createInterface({ input, output });
|
|
49
|
+
try {
|
|
50
|
+
console.log("\nInstallable Codex-Arsenal items:\n");
|
|
51
|
+
MANIFEST.forEach((item, index) => {
|
|
52
|
+
const checked = preSelected.some((selected) => selected.id === item.id) ? "*" : " ";
|
|
53
|
+
console.log(`${String(index + 1).padStart(2, " ")}. [${checked}] ${item.id} - ${item.description}`);
|
|
54
|
+
});
|
|
55
|
+
const answer = await rl.question("\nChoose item numbers separated by commas, or press Enter for defaults: ");
|
|
56
|
+
if (!answer.trim()) {
|
|
57
|
+
return preSelected;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const selectedIndexes = answer
|
|
61
|
+
.split(",")
|
|
62
|
+
.map((part) => Number(part.trim()) - 1)
|
|
63
|
+
.filter((index) => Number.isInteger(index) && MANIFEST[index]);
|
|
64
|
+
|
|
65
|
+
return selectedIndexes.map((index) => MANIFEST[index]);
|
|
66
|
+
} finally {
|
|
67
|
+
rl.close();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function runInit(opts = {}) {
|
|
72
|
+
const selected = opts.skipPrompt || opts.yes
|
|
73
|
+
? opts.preSelected || defaultItems()
|
|
74
|
+
: await askForItems(opts.preSelected || defaultItems());
|
|
75
|
+
|
|
76
|
+
if (!selected.length) {
|
|
77
|
+
console.log("No items selected.");
|
|
78
|
+
return { installed: 0, failed: 0, failures: [], targetDir: path.resolve(opts.dir || ".") };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const result = await installItems(selected, opts.dir || process.cwd());
|
|
82
|
+
for (const item of selected) {
|
|
83
|
+
for (const file of item.files) {
|
|
84
|
+
console.log(`installed ${file.dest}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
console.log(`\nDone: ${result.installed} installed${result.failed ? `, ${result.failed} failed` : ""}.`);
|
|
88
|
+
return result;
|
|
89
|
+
}
|
package/lib/manifest.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export const REPO = "your-username/codex-arsenal";
|
|
2
|
+
export const BRANCH = "main";
|
|
3
|
+
export const BASE_URL = `https://raw.githubusercontent.com/${REPO}/${BRANCH}`;
|
|
4
|
+
|
|
5
|
+
export const MANIFEST = [
|
|
6
|
+
{
|
|
7
|
+
id: "codex-md",
|
|
8
|
+
category: "Behavior Guidelines",
|
|
9
|
+
label: "CODEX.md",
|
|
10
|
+
description: "Behavior guidelines for Codex agents in software projects.",
|
|
11
|
+
files: [{ src: "CODEX.md", dest: "CODEX.md" }],
|
|
12
|
+
default: true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "claude-md",
|
|
16
|
+
category: "Behavior Guidelines",
|
|
17
|
+
label: "CLAUDE.md",
|
|
18
|
+
description: "Behavior guidelines adapted for Claude Code agents.",
|
|
19
|
+
files: [{ src: "CLAUDE.md", dest: "CLAUDE.md" }]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "config-codex",
|
|
23
|
+
category: "Configs",
|
|
24
|
+
label: ".codex/config.json",
|
|
25
|
+
description: "Starter Codex agent configuration.",
|
|
26
|
+
files: [{ src: "configs/codex/config.json", dest: ".codex/config.json" }]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "config-vscode",
|
|
30
|
+
category: "Configs",
|
|
31
|
+
label: ".vscode/settings.json",
|
|
32
|
+
description: "VS Code settings for AI-assisted development.",
|
|
33
|
+
files: [{ src: "configs/vscode/settings.json", dest: ".vscode/settings.json" }]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "prompt-solo-dev",
|
|
37
|
+
category: "Prompts",
|
|
38
|
+
label: "solo-dev system prompt",
|
|
39
|
+
description: "System prompt template for solo developer workflows.",
|
|
40
|
+
files: [{ src: "prompts/system-prompts/solo-dev.md", dest: "prompts/system-prompts/solo-dev.md" }]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "skill-debug-workflow",
|
|
44
|
+
category: "Skills",
|
|
45
|
+
label: "debug-workflow",
|
|
46
|
+
description: "A repeatable skill for reproducing, diagnosing, and fixing bugs.",
|
|
47
|
+
files: [
|
|
48
|
+
{ src: "skills/debug-workflow/README.md", dest: "skills/debug-workflow/README.md" },
|
|
49
|
+
{ src: "skills/debug-workflow/prompt.md", dest: "skills/debug-workflow/prompt.md" },
|
|
50
|
+
{ src: "skills/debug-workflow/workflow.json", dest: "skills/debug-workflow/workflow.json" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "skill-test-gen",
|
|
55
|
+
category: "Skills",
|
|
56
|
+
label: "test-gen",
|
|
57
|
+
description: "A skill for generating focused tests from function signatures and behavior notes.",
|
|
58
|
+
files: [
|
|
59
|
+
{ src: "skills/test-gen/README.md", dest: "skills/test-gen/README.md" },
|
|
60
|
+
{ src: "skills/test-gen/prompt.md", dest: "skills/test-gen/prompt.md" }
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "plugin-context-window-compressor",
|
|
65
|
+
category: "Plugins",
|
|
66
|
+
label: "context-window-compressor",
|
|
67
|
+
description: "Plugin sketch for summarizing long context before it becomes unmanageable.",
|
|
68
|
+
files: [
|
|
69
|
+
{ src: "plugins/context-window-compressor/README.md", dest: "plugins/context-window-compressor/README.md" },
|
|
70
|
+
{ src: "plugins/context-window-compressor/plugin.json", dest: "plugins/context-window-compressor/plugin.json" }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "workflow-solo-dev-loop",
|
|
75
|
+
category: "Workflows",
|
|
76
|
+
label: "solo-dev-loop",
|
|
77
|
+
description: "Plan, code, test, and commit loop for solo developers working with agents.",
|
|
78
|
+
files: [
|
|
79
|
+
{ src: "workflows/solo-dev-loop/README.md", dest: "workflows/solo-dev-loop/README.md" },
|
|
80
|
+
{ src: "workflows/solo-dev-loop/setup.sh", dest: "workflows/solo-dev-loop/setup.sh" }
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
export function findManifestItems(ids) {
|
|
86
|
+
return ids.map((id) => {
|
|
87
|
+
const item = MANIFEST.find((entry) => entry.id === id);
|
|
88
|
+
if (!item) {
|
|
89
|
+
throw new Error(`Unknown item: ${id}`);
|
|
90
|
+
}
|
|
91
|
+
return item;
|
|
92
|
+
});
|
|
93
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codex-arsenal",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A practical arsenal of Codex and Claude Code plugins, skills, prompts, workflows, and configs.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"codex-arsenal": "bin/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "node --test"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/citron03/Codex-Arsenal.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/citron03/Codex-Arsenal/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/citron03/Codex-Arsenal#readme",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/",
|
|
25
|
+
"lib/",
|
|
26
|
+
"CODEX.md",
|
|
27
|
+
"CLAUDE.md",
|
|
28
|
+
"configs/",
|
|
29
|
+
"plugins/",
|
|
30
|
+
"prompts/",
|
|
31
|
+
"skills/",
|
|
32
|
+
"workflows/"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"codex",
|
|
39
|
+
"claude-code",
|
|
40
|
+
"ai-agent",
|
|
41
|
+
"developer-tools",
|
|
42
|
+
"prompt-engineering"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT"
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Solo Developer Agent Prompt
|
|
2
|
+
|
|
3
|
+
You are helping a solo developer move from idea to shipped change.
|
|
4
|
+
|
|
5
|
+
Work loop:
|
|
6
|
+
|
|
7
|
+
1. Restate the goal and assumptions.
|
|
8
|
+
2. Inspect the existing project before editing.
|
|
9
|
+
3. Make the smallest useful change.
|
|
10
|
+
4. Run focused verification.
|
|
11
|
+
5. Report what changed, what was verified, and what remains risky.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# debug-workflow
|
|
2
|
+
|
|
3
|
+
A repeatable debugging skill for agentic coding sessions.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
1. Reproduce the symptom with the smallest command or test.
|
|
8
|
+
2. Capture the actual error output.
|
|
9
|
+
3. Identify the boundary where expected behavior first diverges.
|
|
10
|
+
4. Add or update a regression test.
|
|
11
|
+
5. Implement the smallest fix.
|
|
12
|
+
6. Re-run the regression test and the nearest relevant suite.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# test-gen
|
|
2
|
+
|
|
3
|
+
A skill for turning behavior notes and function signatures into focused tests.
|
|
4
|
+
|
|
5
|
+
## Inputs
|
|
6
|
+
|
|
7
|
+
- Function or module path
|
|
8
|
+
- Expected behavior
|
|
9
|
+
- Edge cases worth preserving
|
|
10
|
+
|
|
11
|
+
## Output
|
|
12
|
+
|
|
13
|
+
- Minimal tests that use real code
|
|
14
|
+
- Clear test names
|
|
15
|
+
- Assertions that describe behavior, not implementation details
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Generate tests before implementation. Prefer one behavior per test. Use real code unless a dependency is external, slow, or nondeterministic.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# solo-dev-loop
|
|
2
|
+
|
|
3
|
+
A practical loop for solo developers working with coding agents.
|
|
4
|
+
|
|
5
|
+
## Loop
|
|
6
|
+
|
|
7
|
+
1. Define the next verifiable goal.
|
|
8
|
+
2. Ask the agent to inspect the local project.
|
|
9
|
+
3. Write or update a focused test.
|
|
10
|
+
4. Implement the smallest change.
|
|
11
|
+
5. Run verification.
|
|
12
|
+
6. Commit the finished slice.
|