Skip to content

Commit ab5907b

Browse files
committed
test release: v0.0.3
1 parent d43b17c commit ab5907b

File tree

7 files changed

+298
-127
lines changed

7 files changed

+298
-127
lines changed

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,20 @@ analysis, implementation, and collaboration tasks.
2121

2222
**1. Download/Clone source from repository**
2323

24+
**1.1 Download source**
25+
2426
[Download](https://github.com/ForteScarlet/codex-kkp/archive/refs/heads/skills/release.zip)
25-
the source code for Branch `skills/release` and extract it, or clone the repository and
27+
the source code for Branch `skills/release` and extract it,
28+
29+
**1.2 Clone source**
30+
31+
**OR** clone the repository and
2632
[check out Branch `skills/release`](https://github.com/ForteScarlet/codex-kkp/tree/skills/release) .
2733

34+
```
35+
git clone -b skills/release https://github.com/ForteScarlet/codex-kkp.git
36+
```
37+
2838
**2. Add into Claude Code's marketplace**
2939

3040
Run claude:
@@ -42,5 +52,36 @@ Choose `Add aarketplace` and enter the local path where you downloaded/cloned th
4252

4353
### Download from releases
4454

45-
TODO
55+
Go to the [releases](https://github.com/ForteScarlet/codex-kkp/releases)
56+
page and select a version (such as the [latest](https://github.com/ForteScarlet/codex-kkp/releases/latest) version).
57+
58+
Select the content you need from assets, download it, and configure it.
59+
60+
#### Download skills zip file
61+
62+
The compressed file `codex-agent-collaboration.zip` in Assets contains a unified multi-platform skill bundle.
63+
You can download and unzip it, then place the extracted directory in your skills directory
64+
(e.g., `<PROJECT_DIR>/.claude/skills/codex-agent-collaboration/`).
65+
66+
This single ZIP file includes executables for all supported platforms:
67+
- macOS Intel (x86_64) - `executables/codex-kkp-cli-macosx64`
68+
- macOS Apple Silicon (ARM64) - `executables/codex-kkp-cli-macosarm64`
69+
- Linux x86_64 - `executables/codex-kkp-cli-linuxx64`
70+
- Linux ARM64 - `executables/codex-kkp-cli-linuxarm64`
71+
- Windows x86_64 - `executables/codex-kkp-cli-mingwx64`
72+
73+
Claude Code will automatically select the appropriate executable for your system.
74+
75+
#### Download executable binary file
76+
77+
Standalone binary files (e.g., `codex-kkp-cli-macosx64`, `codex-kkp-cli-mingwx64`)
78+
in Assets are raw executable binaries for each platform.
79+
You can download only the executable file for your platform and design the skills yourself.
80+
81+
Note: All executables use uniform naming without file extensions (including Windows builds).
82+
83+
### Tool installation and management
4684

85+
Some open-source projects may allow independent management of marketplaces
86+
and skills through repository addresses and branches (e.g., [cc-switch](https://github.com/farion1231/cc-switch)).
87+
You can also configure skills directly based on repositories and branches using these tools.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
import org.gradle.api.DefaultTask
2+
import org.gradle.api.file.DirectoryProperty
3+
import org.gradle.api.file.FileSystemOperations
4+
import org.gradle.api.provider.MapProperty
5+
import org.gradle.api.provider.Property
6+
import org.gradle.api.tasks.*
7+
import javax.inject.Inject
8+
9+
/**
10+
* Gradle task to prepare a unified multi-platform skill bundle for Claude Code.
11+
*
12+
* This task creates a single skill directory containing executables for all supported platforms,
13+
* rather than creating separate platform-specific skill directories. Claude Code will automatically
14+
* select the appropriate executable based on the runtime platform.
15+
*
16+
* This task follows Gradle best practices:
17+
* - Uses [FileSystemOperations] for file operations (injected service)
18+
* - Supports incremental builds via proper input/output annotations
19+
* - Supports build cache via [@CacheableTask] and [@PathSensitive]
20+
* - Uses Gradle's [filePermissions] API for setting executable permissions
21+
*
22+
* ZIP creation is handled separately by a standard [org.gradle.api.tasks.bundling.Zip] task
23+
* for better separation of concerns and native Gradle support.
24+
*
25+
* @see org.gradle.api.tasks.bundling.Zip
26+
*/
27+
@CacheableTask
28+
abstract class UnifiedSkillPackagingTask @Inject constructor(
29+
private val fsOps: FileSystemOperations
30+
) : DefaultTask() {
31+
32+
/**
33+
* Platform executables directory.
34+
* This should point to the build/bin directory containing platform subdirectories.
35+
*/
36+
@get:InputDirectory
37+
@get:PathSensitive(PathSensitivity.RELATIVE)
38+
abstract val executablesSourceDir: DirectoryProperty
39+
40+
/**
41+
* Template directory containing skill documentation.
42+
* Expected structure: templateDir/{SKILL.md, examples.md, outputs.md, sandbox-modes.md}
43+
*/
44+
@get:InputDirectory
45+
@get:PathSensitive(PathSensitivity.RELATIVE)
46+
abstract val templateDir: DirectoryProperty
47+
48+
/**
49+
* Version string for this release.
50+
* Currently stored for potential future use (e.g., version file generation).
51+
*/
52+
@get:Input
53+
abstract val version: Property<String>
54+
55+
/**
56+
* Output directory for the unified skill bundle.
57+
* This will contain all documentation and the executables/ subdirectory.
58+
* Example: build/skills/codex-agent-collaboration/
59+
*/
60+
@get:OutputDirectory
61+
abstract val outputDir: DirectoryProperty
62+
63+
/**
64+
* Platform mapping: Kotlin Native target names to platform names.
65+
* Used to find and rename executables.
66+
*/
67+
@get:Input
68+
abstract val platformMapping: MapProperty<String, String>
69+
70+
init {
71+
group = "distribution"
72+
description = "Prepares unified multi-platform skill bundle for Claude Code"
73+
}
74+
75+
@TaskAction
76+
fun packageUnifiedSkill() {
77+
val skillDir = outputDir.get().asFile
78+
val templateDirectory = templateDir.get().asFile
79+
val binDir = executablesSourceDir.get().asFile
80+
val platforms = platformMapping.get()
81+
82+
logger.lifecycle("Preparing unified skill bundle for ${platforms.size} platforms")
83+
84+
// Sync documentation files from template using Gradle's sync operation
85+
// sync() ensures the destination matches the source exactly (removes stale files)
86+
fsOps.sync {
87+
from(templateDirectory) {
88+
include("SKILL.md", "examples.md", "outputs.md", "sandbox-modes.md")
89+
}
90+
into(skillDir)
91+
}
92+
93+
logger.info("Synced documentation files to: ${skillDir.absolutePath}")
94+
95+
// Create executables directory for all platform binaries
96+
val executablesDir = skillDir.resolve("executables")
97+
executablesDir.mkdirs()
98+
99+
// Copy all platform executables with uniform naming
100+
var copiedCount = 0
101+
var skippedCount = 0
102+
103+
platforms.forEach { (targetName, platformName) ->
104+
// Find executable in bin/{targetName}/releaseExecutable/
105+
val platformDir = binDir.resolve("$targetName/releaseExecutable")
106+
val possibleExecs = listOf(
107+
platformDir.resolve("codex-kkp-cli.kexe"),
108+
platformDir.resolve("codex-kkp-cli.exe")
109+
)
110+
111+
val sourceFile = possibleExecs.firstOrNull { it.exists() }
112+
113+
if (sourceFile != null && sourceFile.exists()) {
114+
// Uniform naming: codex-kkp-cli-{platform} (no extension)
115+
val targetFileName = "codex-kkp-cli-$platformName"
116+
val targetFile = executablesDir.resolve(targetFileName)
117+
118+
fsOps.copy {
119+
from(sourceFile)
120+
into(executablesDir)
121+
rename { targetFileName }
122+
123+
// Set Unix permissions: rwxr-xr-x (755)
124+
// This is the Gradle 8.3+ way to handle file permissions
125+
filePermissions {
126+
user {
127+
read = true
128+
write = true
129+
execute = true
130+
}
131+
group {
132+
read = true
133+
execute = true
134+
}
135+
other {
136+
read = true
137+
execute = true
138+
}
139+
}
140+
}
141+
142+
val execSize = sourceFile.length() / 1024
143+
logger.lifecycle("$targetFileName ($execSize KB)")
144+
copiedCount++
145+
} else {
146+
logger.lifecycle(" ⊘ codex-kkp-cli-$platformName - not available on this host OS")
147+
skippedCount++
148+
}
149+
}
150+
151+
logger.lifecycle("Unified skill bundle prepared: ${skillDir.absolutePath}")
152+
logger.lifecycle(" Platforms included: $copiedCount" + if (skippedCount > 0) ", $skippedCount skipped" else "")
153+
}
154+
}

claude-code-skills-template/codex-agent-collaboration/SKILL.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ The `codex-kkp-cli` is a Codex Agent CLI tool, allowing you to:
1818

1919
## Usage
2020

21+
### Basic Syntax
22+
2123
```bash
22-
executable/codex-kkp-cli --cd=/absolute/path/to/project [options] "<task_description>"
24+
executables/codex-kkp-cli-{platform} --cd=/absolute/path/to/project [options] "<task_description>"
2325
```
2426

27+
**Platform Variable**: `{platform}` should be automatically replaced based on current system:
28+
- `macosx64` - macOS Intel (x86_64)
29+
- `macosarm64` - macOS Apple Silicon (ARM64)
30+
- `linuxx64` - Linux x86_64
31+
- `linuxarm64` - Linux ARM64
32+
- `mingwx64` - Windows x86_64
33+
2534
### Required Parameters
2635

2736
| Parameter | Description |
@@ -71,13 +80,13 @@ Returns JSON with `"type": "SUCCESS"` or `"type": "ERROR"`.
7180
New Session:
7281

7382
```bash
74-
executable/codex-kkp-cli --cd=/path/to/project "Explain the main function in Main.kt"
83+
executables/codex-kkp-cli-{platform} --cd=/path/to/project "Explain the main function in Main.kt"
7584
```
7685

7786
Continue Previous Session:
7887

7988
```bash
80-
executable/codex-kkp-cli --cd=/path/to/project --session=xxxxxxx "Explain the main function in Main.kt"
89+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --session=xxxxxxx "Explain the main function in Main.kt"
8190
```
8291

8392
More examples: [examples.md](examples.md)

claude-code-skills-template/codex-agent-collaboration/examples.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,51 @@ This document provides examples of using the Codex CLI for various tasks.
77
### Simple Task
88

99
```bash
10-
executable/codex-kkp-cli --cd=/path/to/project "Explain the main function in Main.kt"
10+
executables/codex-kkp-cli-{platform} --cd=/path/to/project "Explain the main function in Main.kt"
1111
```
1212

1313
### Continue Previous Session
1414

1515
```bash
16-
executable/codex-kkp-cli --cd=/path/to/project --session=previous-session-id "Now implement the suggested changes"
16+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --session=previous-session-id "Now implement the suggested changes"
1717
```
1818

1919
### Code Review with Full Auto
2020

2121
```bash
22-
executable/codex-kkp-cli --cd=/path/to/project --full-auto --sandbox=workspace-write "Review this implementation for bugs and suggest improvements"
22+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --full-auto --sandbox=workspace-write "Review this implementation for bugs and suggest improvements"
2323
```
2424

2525
## Advanced Examples
2626

2727
### With Image Input
2828

2929
```bash
30-
executable/codex-kkp-cli --cd=/path/to/project --image=/path/to/screenshot.png "Implement the UI shown in this design"
30+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --image=/path/to/screenshot.png "Implement the UI shown in this design"
3131
```
3232

3333
### Multiple Images
3434

3535
```bash
36-
executable/codex-kkp-cli --cd=/path/to/project --image=/path/to/design1.png --image=/path/to/design2.png "Compare these two designs and implement the better approach"
36+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --image=/path/to/design1.png --image=/path/to/design2.png "Compare these two designs and implement the better approach"
3737
```
3838

3939
### Full Event Output
4040

4141
```bash
42-
executable/codex-kkp-cli --cd=/path/to/project --full "Refactor the authentication module"
42+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --full "Refactor the authentication module"
4343
```
4444

4545
### Save Last Message to File
4646

4747
```bash
48-
executable/codex-kkp-cli --cd=/path/to/project --output-last-message=/tmp/codex-response.txt "Generate API documentation"
48+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --output-last-message=/tmp/codex-response.txt "Generate API documentation"
4949
```
5050

5151
### Structured Output with Schema
5252

5353
```bash
54-
executable/codex-kkp-cli --cd=/path/to/project --output-schema=/path/to/schema.json "Extract all function signatures from this module"
54+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --output-schema=/path/to/schema.json "Extract all function signatures from this module"
5555
```
5656

5757
### With Git Repository Check
@@ -60,5 +60,5 @@ By default, Git repository check is skipped (`--skip-git-repo-check=true`).
6060
To enable Git check (e.g., for ensuring clean working directory):
6161

6262
```bash
63-
executable/codex-kkp-cli --cd=/path/to/project --skip-git-repo-check=false "Analyze uncommitted changes"
63+
executables/codex-kkp-cli-{platform} --cd=/path/to/project --skip-git-repo-check=false "Analyze uncommitted changes"
6464
```

claude-code-skills-template/codex-agent-collaboration/outputs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This produces significantly larger output and should only be used when you need
6464
Save the last agent message to a specified file:
6565

6666
```bash
67-
executable/codex-kkp-cli \
67+
executables/codex-kkp-cli-{platform} \
6868
--cd="/path/to/project" \
6969
--output-last-message="/path/to/output/response.txt" \
7070
"Analyze this code"
@@ -75,7 +75,7 @@ executable/codex-kkp-cli \
7575
Specify a JSON schema file for structured output:
7676

7777
```bash
78-
executable/codex-kkp-cli \
78+
executables/codex-kkp-cli-{platform} \
7979
--cd="/path/to/project" \
8080
--output-schema="/path/to/schema.json" \
8181
"Extract function signatures"

claude-code-skills-template/codex-agent-collaboration/sandbox-modes.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Choose the appropriate mode based on your task requirements.
1414
Codex can only read files in the workspace. No modifications are allowed.
1515

1616
```bash
17-
executable/codex-kkp-cli \
17+
executables/codex-kkp-cli-{platform} \
1818
--cd="/path/to/project" \
1919
--sandbox=read-only \
2020
"Analyze this codebase"
@@ -31,7 +31,7 @@ executable/codex-kkp-cli \
3131
Codex can read and write files within the workspace directory.
3232

3333
```bash
34-
executable/codex-kkp-cli \
34+
executables/codex-kkp-cli-{platform} \
3535
--cd="/path/to/project" \
3636
--sandbox=workspace-write \
3737
--full-auto \
@@ -49,7 +49,7 @@ executable/codex-kkp-cli \
4949
Full system access including network operations. **Use with caution.**
5050

5151
```bash
52-
executable/codex-kkp-cli \
52+
executables/codex-kkp-cli-{platform} \
5353
--cd="/path/to/project" \
5454
--sandbox=danger-full-access \
5555
"Install dependencies and run tests"
@@ -63,11 +63,11 @@ executable/codex-kkp-cli \
6363

6464
## Security Considerations
6565

66-
| Mode | File Read | File Write | Network | System Commands |
67-
|------|-----------|------------|---------|-----------------|
68-
| `read-only` | Workspace only | No | No | No |
69-
| `workspace-write` | Workspace only | Workspace only | No | No |
70-
| `danger-full-access` | Full | Full | Yes | Yes |
66+
| Mode | File Read | File Write | Network | System Commands |
67+
|----------------------|----------------|----------------|---------|-----------------|
68+
| `read-only` | Workspace only | No | No | No |
69+
| `workspace-write` | Workspace only | Workspace only | No | No |
70+
| `danger-full-access` | Full | Full | Yes | Yes |
7171

7272
## Recommendations
7373

0 commit comments

Comments
 (0)