kt 代码测试
- 作者仓库星标 0
- 作者仓库 skills-registry
Kotlin build / test / analyze / docker
Arguments: $ARGUMENTS
Project paths & JDK
Resolve project paths from ~/.claude/project-repos.json. A Kotlin project
is any registry entry whose root contains build.gradle or build.gradle.kts.
JDK version is per-project and should be declared in the project's
projects/{shortname}.md. Set it before invoking Gradle:
export JAVA_HOME=$(/usr/libexec/java_home -v {version})
Actions
build
cd {repo-path} && ./gradlew build -x test
# Multi-module projects:
cd {repo-path} && ./gradlew :{module}:build -x test
On failure, suggest ./gradlew --refresh-dependencies for dependency
errors. For compilation errors, quote the file/line and the offending type.
test
# All tests:
cd {repo-path} && ./gradlew test
# A specific module:
cd {repo-path} && ./gradlew :{module}:test
# A filter (uses JUnit's `--tests`):
cd {repo-path} && ./gradlew test --tests "{filter}"
# Module + filter:
cd {repo-path} && ./gradlew :{module}:test --tests "{filter}"
If the project uses TestContainers, ensure Docker is running first.
Report: total / passed / failed / skipped. For failures, show class, method, assertion error, and the first few lines of stack trace.
analyze
Detekt (common):
cd {repo-path} && ./gradlew detekt
cd {repo-path} && ./gradlew :{module}:detekt
cd {repo-path} && ./gradlew detekt --auto-correct
ktlint (alternative):
cd {repo-path} && ./gradlew ktlintCheck
cd {repo-path} && ./gradlew ktlintFormat
Report issues with: rule name, file:line, message, severity.
docker
Starts the project's docker-compose.yml services (Postgres, Redis, any
stub/mock servers):
# All services:
cd {repo-path} && docker compose up -d
# Specific service:
cd {repo-path} && docker compose up -d {service}
After start, wait ~5s and check health:
docker compose -f {repo-path}/docker-compose.yml ps
If any container is unhealthy:
docker compose logs --tail=20 {service}
Common fixes:
- Port conflict:
docker psto find the claimant - Stale volumes:
docker compose down -v && docker compose up -d
Process
- Parse arguments: action, shortname, optional module/filter/flags
- Set JDK (skip for
docker) cdto the resolved project path- Run the command
- Report result
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: ajvelo/claude-toolkit — distributed by TomeVault.
- 流狐分类
- 运维部署
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需手动接入
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- Docker
- 底层运行要求
- Docker
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Arguments: $ARGUMENTS
Resolve project paths from ~/.claude/project-repos.json. A Kotlin project is any registry entry whose root contains build.gradle or build.gradle.kts. JDK version is per-project and should be declared in the project's
Actions
On failure, suggest ./gradlew --refresh-dependencies for dependency errors. For compilation errors, quote the file/line and the offending type.
If the project uses TestContainers, ensure Docker is running first. Report: total / passed / failed / skipped. For failures, show class, method, assertion error, and the first few lines of stack trace.
Detekt (common): ktlint (alternative): Report issues with: rule name, file:line, message, severity.
## Kotlin build / test / analyze / docker
**Arguments:** $ARGUMENTS
## Project paths & JDK
Resolve project paths from `~/.claude/project-repos.json`. A Kotlin project
is any registry entry whose root contains `build.gradle` or `build.gradle.kts`.
JDK version is per-project and should be declared in the project's
`projects/{shortname}.md`. Set it before invoking Gradle:
```bash
export JAVA_HOME=$(/usr/libexec/java_home -v {version})
```
## Actions
### `build`
```bash
cd {repo-path} && ./gradlew build -x test
# Multi-module projects:
cd {repo-path} && ./gradlew :{module}:build -x test
```
On failure, suggest `./gradlew --refresh-dependencies` for dependency
errors. For compilation errors, quote the file/line and the offending type.
### `test`
```bash
# All tests:
cd {repo-path} && ./gradlew test
# A specific module:
cd {repo-path} && ./gradlew :{module}:test
# A filter (uses JUnit's `--tests`):
cd {repo-path} && ./gradlew test --tests "{filter}"
# Module + filter:
cd {repo-path} && ./gradlew :{module}:test --tests "{filter}"
```
If the project uses TestContainers, ensure Docker is running first.
Report: total / passed / failed / skipped. For failures, show class,
method, assertion error, and the first few lines of stack trace.
### `analyze`
Detekt (common):
```bash
cd {repo-path} && ./gradlew detekt
cd {repo-path} && ./gradlew :{module}:detekt
cd {repo-path} && ./gradlew detekt --auto-correct
```
ktlint (alternative):
```bash
cd {repo-path} && ./gradlew ktlintCheck
cd {repo-path} && ./gradlew ktlintFormat
```
Report issues with: rule name, file:line, message, severity.
### `docker`
Starts the project's `docker-compose.yml` services (Postgres, Redis, any
stub/mock servers):
```bash
# All services:
cd {repo-path} && docker compose up -d
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Kotlin build / test / analyze / docker → Project paths & JDK → Actions → build → test → analyze
要点 -> Arguments · Resolve project paths from ~/.claude/project-repos.json. · JDK version is per-project and should be declared in the project's projects/{shortname}.md. · On failure, suggest ./gradlew --refresh-dependencies for dependency errors. · If the project uses TestContainers, ensure Docker is running first. · Report: total / passed / failed / skipped. · Report issues with: rule name, file:line, message, severity. · 1. Parse arguments: action, shortname, optional module/filter/flags 2.
文件/命令 -> ~/.claude/project-repos.json · build.gradle · build.gradle.kts · projects/{shortname}.md · build · ./gradlew --refresh-dependencies · test · --tests
内容 SHA-256 -> 1bc801ccc39b
方法与流程
适用与边界
原文中的明确线索
~/.claude/project-repos.json、build.gradle、build.gradle.kts、projects/{shortname}.md、build、./gradlew --refresh-dependencies、test、--tests