Gradle run
Core principle
Treat complete Gradle output as a temporary, sensitive artifact. Every
agent-initiated Gradle command runs through the compact-output wrapper; never
stream, tee, paste, or reopen a full build log.
Every create, run, and finish invocation is the entire shell command for
that tool call. Prefixes, assignments, conditionals, pipes, command chains, and
follow-up inspection invalidate lifecycle evidence even when Gradle succeeds.
Procedure
Classify the request. Reuse a current successful result when unchanged
source and inputs already answer the question. A focused task that validates
another change is incidental; build/check/warning/failure work is a
Gradle-centered workflow.
Resolve this skill directory and confirm python3 plus
scripts/gradle_run.py. If either is unavailable, stop and report that
prerequisite; never run Gradle directly as a fallback.
Create one workflow before its first command and retain its opaque ID:
python3 <skill-dir>/scripts/gradle_run.py create
Run create, each run, and finish as standalone shell commands. Do not
combine one with test, variable setup, git, rg, &&, ;, a pipe, or a
newline containing another command. If create fails, retry a fresh
standalone create before any run. Use the wrapper exclusively; it
supplies --console=plain and --no-scan unless console behavior was
selected or the user authorized --scan. Add --warning-mode all only for
warning discovery or an explicit request. A workflow is busy result is an
ownership violation: wait for the owner or correct ownership; do not start
or finish concurrently.
For incidental validation, stay in the current agent and run the narrowest
task that answers a non-empty verification question:
python3 <skill-dir>/scripts/gradle_run.py run \
--workflow <id> --scope targeted \
--question "Does :module:test pass after this change?" -- \
./gradlew :module:test
Do not substitute compilation for requested fixture tests. Read only the
bounded JSON summary; report both the managed wrapper and nested Gradle task,
the question, and its bounded answer.
For Gradle-centered work, create one fresh persistent Solver diagnostic
owner with read-only repository access. It owns wrapper runs and diagnosis,
may not edit or delegate Gradle ownership, and remains available for the
workflow. Report its model and reasoning only when exposed. The parent owns
repository edits. If that owner cannot exist, stop rather than running the
loop in the parent.
Have the owner reuse actionable summaries, group warnings/failures by
fingerprint, and return source/line evidence plus the narrowest next command.
Run broad only for an aggregate question that targeted evidence cannot
answer. On a repeated primary source/compiler fingerprint, stop rebuilding;
inspect the cited source line and nearby declaration, import, or receiver
context before revising the diagnosis. Verify each parent change with the
same wrapper and narrowest applicable task. In the final diagnosis, name the
focused inspection as the next action; do not claim a source fix before it.
A new question does not permit a blind repeat.
Treat the full log as raw sensitive material even though summaries and
ledgers redact common credentials. Never expose it in model-visible context.
On interruption, use the wrapper's recorded signal and bounded partial
diagnostics; it owns process-group/process-tree cleanup and durable ledger
updates. Only logs still represented by the bounded recent-run ledger remain.
Finish after the last requested validation (targeted or broad) passes, or
report unresolved fingerprints and why validation cannot continue. In the
final response, quote each non-empty --question and give its bounded
answer; command history is not a substitute for reported evidence. Then run:
python3 <skill-dir>/scripts/gradle_run.py finish --workflow <id>
Report that finish removed only wrapper-owned logs. A finished known ID is
idempotent; an unknown ID or active workflow fails closed and leaves files in
place. This skill does not constrain unrelated review, implementation, or
subagents.
1---2name: gradle-run3description: Use when planning to execute Gradle through `gradle`, `./gradlew`, or a custom `gradlew*` wrapper script, or diagnosing a Gradle build, compact workflow ledger, repeated failure fingerprint, check, test, lint, warning, or failure even when no new Gradle run is appropriate.4---5
6# Gradle run
7
8## Core principle
9
10Treat complete Gradle output as a temporary, sensitive artifact. Every
11agent-initiated Gradle command runs through the compact-output wrapper; never
12stream, `tee`, paste, or reopen a full build log.
13
14Every `create`, `run`, and `finish` invocation is the entire shell command for
15that tool call. Prefixes, assignments, conditionals, pipes, command chains, and
16follow-up inspection invalidate lifecycle evidence even when Gradle succeeds.
17
18## Procedure
19
201. Classify the request. Reuse a current successful result when unchanged
21 source and inputs already answer the question. A focused task that validates
22 another change is incidental; build/check/warning/failure work is a
23 Gradle-centered workflow.
242. Resolve this skill directory and confirm `python3` plus
25 `scripts/gradle_run.py`. If either is unavailable, stop and report that
26 prerequisite; never run Gradle directly as a fallback.
273. Create one workflow before its first command and retain its opaque ID:
28
29 ```sh
30 python3 <skill-dir>/scripts/gradle_run.py create
31 ```
32
33 Run `create`, each `run`, and `finish` as standalone shell commands. Do not
34 combine one with `test`, variable setup, `git`, `rg`, `&&`, `;`, a pipe, or a
35 newline containing another command. If `create` fails, retry a fresh
36 standalone `create` before any `run`. Use the wrapper exclusively; it
37 supplies `--console=plain` and `--no-scan` unless console behavior was
38 selected or the user authorized `--scan`. Add `--warning-mode all` only for
39 warning discovery or an explicit request. A `workflow is busy` result is an
40 ownership violation: wait for the owner or correct ownership; do not start
41 or finish concurrently.
424. For incidental validation, stay in the current agent and run the narrowest
43 task that answers a non-empty verification question:
44
45 ```sh
46 python3 <skill-dir>/scripts/gradle_run.py run \
47 --workflow <id> --scope targeted \
48 --question "Does :module:test pass after this change?" -- \
49 ./gradlew :module:test
50 ```
51
52 Do not substitute compilation for requested fixture tests. Read only the
53 bounded JSON summary; report both the managed wrapper and nested Gradle task,
54 the question, and its bounded answer.
555. For Gradle-centered work, create one fresh persistent Solver diagnostic
56 owner with read-only repository access. It owns wrapper runs and diagnosis,
57 may not edit or delegate Gradle ownership, and remains available for the
58 workflow. Report its model and reasoning only when exposed. The parent owns
59 repository edits. If that owner cannot exist, stop rather than running the
60 loop in the parent.
616. Have the owner reuse actionable summaries, group warnings/failures by
62 fingerprint, and return source/line evidence plus the narrowest next command.
63 Run broad only for an aggregate question that targeted evidence cannot
64 answer. On a repeated primary source/compiler fingerprint, stop rebuilding;
65 inspect the cited source line and nearby declaration, import, or receiver
66 context before revising the diagnosis. Verify each parent change with the
67 same wrapper and narrowest applicable task. In the final diagnosis, name the
68 focused inspection as the next action; do not claim a source fix before it.
69 A new question does not permit a blind repeat.
707. Treat the full log as raw sensitive material even though summaries and
71 ledgers redact common credentials. Never expose it in model-visible context.
72 On interruption, use the wrapper's recorded signal and bounded partial
73 diagnostics; it owns process-group/process-tree cleanup and durable ledger
74 updates. Only logs still represented by the bounded recent-run ledger remain.
758. Finish after the last requested validation (targeted or broad) passes, or
76 report unresolved fingerprints and why validation cannot continue. In the
77 final response, quote each non-empty `--question` and give its bounded
78 answer; command history is not a substitute for reported evidence. Then run:
79
80 ```sh
81 python3 <skill-dir>/scripts/gradle_run.py finish --workflow <id>
82 ```
83
84 Report that finish removed only wrapper-owned logs. A finished known ID is
85 idempotent; an unknown ID or active workflow fails closed and leaves files in
86 place. This skill does not constrain unrelated review, implementation, or
87 subagents.