oh-my-customcodex 0.2.0 → 0.2.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 +6 -2
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/hooks/hooks.json +4 -0
- package/templates/.claude/hooks/scripts/agent-mode-guard.sh +22 -0
- package/templates/CLAUDE.md +1 -1
- package/templates/CLAUDE.md.en +1 -1
- package/templates/CLAUDE.md.ko +1 -1
- package/templates/guides/index.yaml +8 -0
- package/templates/guides/java/index.yaml +29 -0
- package/templates/guides/java/java-style-guide.md +35 -0
- package/templates/guides/java/modern-java.md +71 -0
- package/templates/manifest.json +2 -2
package/README.md
CHANGED
|
@@ -225,7 +225,7 @@ Key rules: R010 (orchestrator never writes files), R009 (parallel execution mand
|
|
|
225
225
|
|
|
226
226
|
---
|
|
227
227
|
|
|
228
|
-
### Guides (
|
|
228
|
+
### Guides (40)
|
|
229
229
|
|
|
230
230
|
Reference documentation covering best practices, architecture decisions, and integration patterns. Located in `guides/` at project root, covering topics from agent design to CI/CD to observability.
|
|
231
231
|
|
|
@@ -282,7 +282,11 @@ your-project/
|
|
|
282
282
|
│ ├── specs/ # Extracted canonical specs
|
|
283
283
|
│ ├── contexts/ # 4 shared context files
|
|
284
284
|
│ └── ontology/ # Knowledge graph for RAG
|
|
285
|
-
|
|
285
|
+
<<<<<<< HEAD
|
|
286
|
+
└── guides/ # 40 reference documents
|
|
287
|
+
=======
|
|
288
|
+
└── guides/ # 40 reference documents
|
|
289
|
+
>>>>>>> origin/develop
|
|
286
290
|
```
|
|
287
291
|
|
|
288
292
|
---
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
{
|
|
106
106
|
"matcher": "tool == \"Task\" || tool == \"Agent\"",
|
|
107
107
|
"hooks": [
|
|
108
|
+
{
|
|
109
|
+
"type": "command",
|
|
110
|
+
"command": "bash .codex/hooks/scripts/agent-mode-guard.sh"
|
|
111
|
+
},
|
|
108
112
|
{
|
|
109
113
|
"type": "command",
|
|
110
114
|
"command": "#!/bin/bash\ninput=$(cat)\nagent_type=$(echo \"$input\" | jq -r '.tool_input.subagent_type // \"unknown\"')\nmodel=$(echo \"$input\" | jq -r '.tool_input.model // \"inherit\"')\ndesc=$(echo \"$input\" | jq -r '.tool_input.description // \"\"' | head -c 40)\nresume=$(echo \"$input\" | jq -r '.tool_input.resume // empty')\nif [ -n \"$resume\" ]; then\n echo \"─── [Resume] ${agent_type}:${model} | ${desc} ───\" >&2\nelse\n echo \"─── [Spawn] ${agent_type}:${model} | ${desc} ───\" >&2\nfi\necho \"$input\""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Agent mode guard
|
|
3
|
+
# Blocks Agent/Task spawns that omit mode:"bypassPermissions".
|
|
4
|
+
# This closes the gap where frontmatter permissionMode is ignored unless the
|
|
5
|
+
# spawn call sets mode explicitly.
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
command -v jq >/dev/null 2>&1 || exit 0
|
|
10
|
+
|
|
11
|
+
input=$(cat)
|
|
12
|
+
mode=$(echo "$input" | jq -r '.tool_input.mode // ""')
|
|
13
|
+
|
|
14
|
+
if [ "$mode" != "bypassPermissions" ]; then
|
|
15
|
+
echo "[Hook] BLOCKED: Agent/Task spawn missing required mode: \"bypassPermissions\"" >&2
|
|
16
|
+
echo "[Hook] Saw mode: ${mode:-<missing>}" >&2
|
|
17
|
+
echo "[Hook] The Agent tool defaults to acceptEdits and will trigger permission prompts." >&2
|
|
18
|
+
echo "[Hook] Fix the spawn call by adding: mode: \"bypassPermissions\"" >&2
|
|
19
|
+
exit 2
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
echo "$input"
|
package/templates/CLAUDE.md
CHANGED
package/templates/CLAUDE.md.en
CHANGED
|
@@ -136,7 +136,7 @@ project/
|
|
|
136
136
|
| +-- rules/ # Global rules (22 files)
|
|
137
137
|
| +-- hooks/ # Hook scripts (security, validation, HUD)
|
|
138
138
|
| +-- contexts/ # Context files (4 files)
|
|
139
|
-
+-- guides/ # Reference docs (
|
|
139
|
+
+-- guides/ # Reference docs (39 topics)
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
## Orchestration
|
package/templates/CLAUDE.md.ko
CHANGED
|
@@ -57,6 +57,14 @@ guides:
|
|
|
57
57
|
origin: docs.oracle.com
|
|
58
58
|
url: https://docs.oracle.com/en/java/javase/21/
|
|
59
59
|
|
|
60
|
+
- name: java
|
|
61
|
+
description: Java 25 LTS language reference and modern feature documentation
|
|
62
|
+
path: ./java/
|
|
63
|
+
source:
|
|
64
|
+
type: external
|
|
65
|
+
origin: docs.oracle.com
|
|
66
|
+
url: https://docs.oracle.com/en/java/javase/25/
|
|
67
|
+
|
|
60
68
|
- name: python
|
|
61
69
|
description: Python reference from PEP 8 and PEP 20
|
|
62
70
|
path: ./python/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Java Guide
|
|
2
|
+
|
|
3
|
+
metadata:
|
|
4
|
+
name: java
|
|
5
|
+
description: Java 25 LTS language reference and modern feature documentation
|
|
6
|
+
|
|
7
|
+
source:
|
|
8
|
+
type: external
|
|
9
|
+
origin: docs.oracle.com
|
|
10
|
+
urls:
|
|
11
|
+
- https://docs.oracle.com/en/java/javase/25/
|
|
12
|
+
- https://openjdk.org/projects/loom/
|
|
13
|
+
- https://openjdk.org/jeps/440
|
|
14
|
+
- https://openjdk.org/jeps/441
|
|
15
|
+
- https://openjdk.org/jeps/444
|
|
16
|
+
- https://google.github.io/styleguide/javaguide.html
|
|
17
|
+
last_fetched: "2026-04-20"
|
|
18
|
+
|
|
19
|
+
documents:
|
|
20
|
+
- name: modern-java
|
|
21
|
+
path: ./modern-java.md
|
|
22
|
+
description: Java 25 LTS modern features (Virtual Threads, Pattern Matching, Records, Sealed Classes)
|
|
23
|
+
|
|
24
|
+
- name: java-style-guide
|
|
25
|
+
path: ./java-style-guide.md
|
|
26
|
+
description: Google Java Style Guide conventions
|
|
27
|
+
|
|
28
|
+
used_by:
|
|
29
|
+
- lang-java-expert
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Google Java Style Guide Notes
|
|
2
|
+
|
|
3
|
+
> Source: https://google.github.io/styleguide/javaguide.html
|
|
4
|
+
|
|
5
|
+
## Core Conventions
|
|
6
|
+
|
|
7
|
+
- Indent with 2 spaces, never tabs
|
|
8
|
+
- Use `UpperCamelCase` for classes, `lowerCamelCase` for methods and fields
|
|
9
|
+
- Constants use `UPPER_SNAKE_CASE`
|
|
10
|
+
- Prefer one top-level type per file
|
|
11
|
+
- Keep line length readable and wrap before expressions become visually dense
|
|
12
|
+
|
|
13
|
+
## Imports
|
|
14
|
+
|
|
15
|
+
- No wildcard imports
|
|
16
|
+
- Static imports come before non-static imports
|
|
17
|
+
- Keep imports sorted ASCII-style within each block
|
|
18
|
+
|
|
19
|
+
## Braces
|
|
20
|
+
|
|
21
|
+
- Opening brace stays on the same line
|
|
22
|
+
- Always use braces for `if`, `for`, `while`, and `do`
|
|
23
|
+
|
|
24
|
+
## Classes And Members
|
|
25
|
+
|
|
26
|
+
- Order members consistently: constants, fields, constructors, public methods, private helpers
|
|
27
|
+
- Prefer immutable fields where possible
|
|
28
|
+
- Document non-obvious public API behavior with Javadoc
|
|
29
|
+
|
|
30
|
+
## Naming
|
|
31
|
+
|
|
32
|
+
- Packages: lowercase, no underscores
|
|
33
|
+
- Types: nouns or noun phrases
|
|
34
|
+
- Methods: verbs or verb phrases
|
|
35
|
+
- Test methods: describe behavior, not implementation detail
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Modern Java Features
|
|
2
|
+
|
|
3
|
+
> Sources: https://openjdk.org/jeps/ (JEP 431, 440, 441, 444)
|
|
4
|
+
|
|
5
|
+
## Virtual Threads (JEP 444)
|
|
6
|
+
|
|
7
|
+
Virtual Threads are lightweight threads managed by the JVM, enabling millions of concurrent tasks without thread pool tuning.
|
|
8
|
+
|
|
9
|
+
### Key Properties
|
|
10
|
+
|
|
11
|
+
| Property | Platform Thread | Virtual Thread |
|
|
12
|
+
|----------|----------------|----------------|
|
|
13
|
+
| Creation cost | High (OS thread) | Low (JVM-managed) |
|
|
14
|
+
| Memory footprint | ~1MB per thread | ~few KB |
|
|
15
|
+
| Blocking behavior | Blocks OS thread | Unmounts carrier thread |
|
|
16
|
+
| Pooling | Needed | Not recommended |
|
|
17
|
+
|
|
18
|
+
### Usage
|
|
19
|
+
|
|
20
|
+
```java
|
|
21
|
+
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
|
|
22
|
+
List<Future<String>> futures = IntStream.range(0, 10_000)
|
|
23
|
+
.mapToObj(i -> executor.submit(() -> fetchData(i)))
|
|
24
|
+
.toList();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Thread.ofVirtual().name("vt-worker").start(() -> processRequest());
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Pattern Matching
|
|
31
|
+
|
|
32
|
+
```java
|
|
33
|
+
if (obj instanceof String s && !s.isEmpty()) {
|
|
34
|
+
return s.toUpperCase();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
String format = switch (obj) {
|
|
38
|
+
case Integer i -> "int %d".formatted(i);
|
|
39
|
+
case String s -> "string %s".formatted(s);
|
|
40
|
+
case null -> "null";
|
|
41
|
+
default -> obj.toString();
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Records
|
|
46
|
+
|
|
47
|
+
```java
|
|
48
|
+
record Point(int x, int y) {}
|
|
49
|
+
|
|
50
|
+
record Range(int min, int max) {
|
|
51
|
+
Range {
|
|
52
|
+
if (min > max) {
|
|
53
|
+
throw new IllegalArgumentException("min > max");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Sealed Types
|
|
60
|
+
|
|
61
|
+
```java
|
|
62
|
+
sealed interface Shape permits Circle, Rectangle {}
|
|
63
|
+
|
|
64
|
+
record Circle(double radius) implements Shape {}
|
|
65
|
+
record Rectangle(double width, double height) implements Shape {}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Sequenced Collections
|
|
69
|
+
|
|
70
|
+
- Prefer `getFirst()` / `getLast()` over index arithmetic for ordered collections
|
|
71
|
+
- Use `reversed()` when reverse traversal is the intent
|
package/templates/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.1",
|
|
3
3
|
"lastUpdated": "2026-04-19T08:50:00.000Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"name": "guides",
|
|
25
25
|
"path": "guides",
|
|
26
26
|
"description": "Reference documentation",
|
|
27
|
-
"files":
|
|
27
|
+
"files": 40
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "hooks",
|