docks-kit 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/AGENTS.md +99 -0
- package/LICENSE +21 -0
- package/README.md +124 -0
- package/SoT/.agents/skills.txt +14 -0
- package/SoT/.claude/CLAUDE.md +146 -0
- package/SoT/.claude/fetch-usage.sh +66 -0
- package/SoT/.claude/hooks/notify.sh +14 -0
- package/SoT/.claude/mcp-servers.json +10 -0
- package/SoT/.claude/settings.json +258 -0
- package/SoT/.claude/statusline.sh +175 -0
- package/SoT/.codex/AGENTS.md +75 -0
- package/SoT/.codex/agents/.gitkeep +1 -0
- package/SoT/.codex/config.toml +45 -0
- package/SoT/.codex/plugins/marketplace.json +50 -0
- package/SoT/.codex/rules/docks.rules +116 -0
- package/SoT/models.json +28 -0
- package/SoT/toolchain.json +26 -0
- package/cli/docs/flags.md +48 -0
- package/cli/docs/install.md +56 -0
- package/cli/docs/models.md +42 -0
- package/cli/docs/modifiers.md +33 -0
- package/cli/docs/overview.md +37 -0
- package/cli/docs/platforms.md +31 -0
- package/cli/docs/plugins.md +44 -0
- package/cli/docs/sync-layers.md +43 -0
- package/cli/docs/toolchain.md +54 -0
- package/cli/src/commands/docs.ts +65 -0
- package/cli/src/commands/model.ts +60 -0
- package/cli/src/commands/models.ts +46 -0
- package/cli/src/commands/plugins.ts +34 -0
- package/cli/src/commands/skills.ts +37 -0
- package/cli/src/commands/status.ts +79 -0
- package/cli/src/commands/sync.ts +134 -0
- package/cli/src/commands/toolchain.ts +42 -0
- package/cli/src/engine.ts +36 -0
- package/cli/src/kitHome.ts +31 -0
- package/cli/src/main.ts +60 -0
- package/cli/src/manifests.ts +105 -0
- package/cli/src/md.d.ts +4 -0
- package/cli/tsconfig.json +14 -0
- package/docks-kit +61 -0
- package/lib/claude.sh +846 -0
- package/lib/codex.sh +518 -0
- package/lib/common.sh +229 -0
- package/lib/engine.sh +153 -0
- package/lib/skills.sh +373 -0
- package/lib/toolchain.sh +222 -0
- package/notification.mp3 +0 -0
- package/package.json +39 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"minimumVersion": "2.1.170",
|
|
4
|
+
"model": "opus",
|
|
5
|
+
"advisorModel": "fable",
|
|
6
|
+
"effortLevel": "xhigh",
|
|
7
|
+
"autoMemoryEnabled": true,
|
|
8
|
+
"skillListingMaxDescChars": 2048,
|
|
9
|
+
"respectGitignore": true,
|
|
10
|
+
"cleanupPeriodDays": 14,
|
|
11
|
+
"skillListingBudgetFraction": 0.05,
|
|
12
|
+
"env": {
|
|
13
|
+
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "64000",
|
|
14
|
+
"CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1",
|
|
15
|
+
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "468000",
|
|
16
|
+
"CLAUDE_CODE_NO_FLICKER": "1"
|
|
17
|
+
},
|
|
18
|
+
"permissions": {
|
|
19
|
+
"defaultMode": "auto",
|
|
20
|
+
"allow": [
|
|
21
|
+
"Read",
|
|
22
|
+
"Glob",
|
|
23
|
+
"Grep",
|
|
24
|
+
"WebFetch",
|
|
25
|
+
"WebSearch",
|
|
26
|
+
"Edit(./)",
|
|
27
|
+
"Write(./)",
|
|
28
|
+
"Bash(git *)",
|
|
29
|
+
"Bash(git add *)",
|
|
30
|
+
"Bash(git commit *)",
|
|
31
|
+
"Bash(git status *)",
|
|
32
|
+
"Bash(git diff *)",
|
|
33
|
+
"Bash(git log *)",
|
|
34
|
+
"Bash(git branch *)",
|
|
35
|
+
"Bash(git checkout *)",
|
|
36
|
+
"Bash(git switch *)",
|
|
37
|
+
"Bash(git stash *)",
|
|
38
|
+
"Bash(git fetch *)",
|
|
39
|
+
"Bash(git pull *)",
|
|
40
|
+
"Bash(git tag *)",
|
|
41
|
+
"Bash(git show *)",
|
|
42
|
+
"Bash(git blame *)",
|
|
43
|
+
"Bash(git worktree *)",
|
|
44
|
+
"Bash(gh *)",
|
|
45
|
+
"Bash(pnpm *)",
|
|
46
|
+
"Bash(npm *)",
|
|
47
|
+
"Bash(npx *)",
|
|
48
|
+
"Bash(node *)",
|
|
49
|
+
"Bash(docker *)",
|
|
50
|
+
"Bash(docker-compose *)",
|
|
51
|
+
"Bash(rtk *)",
|
|
52
|
+
"Bash(ls *)",
|
|
53
|
+
"Bash(cat *)",
|
|
54
|
+
"Bash(find *)",
|
|
55
|
+
"Bash(grep *)",
|
|
56
|
+
"Bash(head *)",
|
|
57
|
+
"Bash(tail *)",
|
|
58
|
+
"Bash(wc *)",
|
|
59
|
+
"Bash(sort *)",
|
|
60
|
+
"Bash(uniq *)",
|
|
61
|
+
"Bash(diff *)",
|
|
62
|
+
"Bash(which *)",
|
|
63
|
+
"Bash(pwd *)",
|
|
64
|
+
"Bash(date *)",
|
|
65
|
+
"Bash(mkdir *)",
|
|
66
|
+
"Bash(basename *)",
|
|
67
|
+
"Bash(dirname *)",
|
|
68
|
+
"Bash(realpath *)",
|
|
69
|
+
"Bash(jq *)",
|
|
70
|
+
"Bash(curl *)",
|
|
71
|
+
"Bash(tree *)",
|
|
72
|
+
"Bash(sed *)",
|
|
73
|
+
"Bash(awk *)",
|
|
74
|
+
"Bash(cut *)",
|
|
75
|
+
"Bash(tr *)",
|
|
76
|
+
"Bash(tee *)",
|
|
77
|
+
"Bash(echo *)",
|
|
78
|
+
"Bash(printf *)",
|
|
79
|
+
"Bash(env *)",
|
|
80
|
+
"Bash(printenv *)",
|
|
81
|
+
"Bash(uname *)",
|
|
82
|
+
"Bash(file *)",
|
|
83
|
+
"Bash(stat *)",
|
|
84
|
+
"Bash(du *)",
|
|
85
|
+
"Bash(id *)",
|
|
86
|
+
"Bash(whoami *)",
|
|
87
|
+
"Bash(php *)",
|
|
88
|
+
"Bash(composer *)",
|
|
89
|
+
"Bash(python3 *)",
|
|
90
|
+
"Bash(python *)",
|
|
91
|
+
"Bash(pip *)",
|
|
92
|
+
"Bash(pip3 *)"
|
|
93
|
+
],
|
|
94
|
+
"deny": [
|
|
95
|
+
"Read(**/.env)",
|
|
96
|
+
"Read(**/.env.local)",
|
|
97
|
+
"Read(**/secrets/**)",
|
|
98
|
+
"Read(**/*.key)",
|
|
99
|
+
"Read(**/*.pem)",
|
|
100
|
+
"Read(**/*.p12)",
|
|
101
|
+
"Read(**/.credentials*)",
|
|
102
|
+
"Edit(**/.env)",
|
|
103
|
+
"Edit(**/.env.local)",
|
|
104
|
+
"Edit(**/secrets/**)",
|
|
105
|
+
"Write(**/.env)",
|
|
106
|
+
"Write(**/.env.local)",
|
|
107
|
+
"Write(**/secrets/**)",
|
|
108
|
+
"Bash(sudo *)",
|
|
109
|
+
"Bash(rm -rf /)",
|
|
110
|
+
"Bash(rm -rf / *)",
|
|
111
|
+
"Bash(rm -rf ~)",
|
|
112
|
+
"Bash(rm -rf ~ *)",
|
|
113
|
+
"Bash(rm -rf $HOME)",
|
|
114
|
+
"Bash(rm -rf $HOME *)",
|
|
115
|
+
"Bash(> /dev *)",
|
|
116
|
+
"Bash(dd if= *)",
|
|
117
|
+
"Bash(mkfs *)",
|
|
118
|
+
"Bash(eval *)",
|
|
119
|
+
"Bash(chmod 777 *)",
|
|
120
|
+
"Bash(chmod -R 777 *)",
|
|
121
|
+
"Bash(git push --force origin main *)",
|
|
122
|
+
"Bash(git push --force origin master *)",
|
|
123
|
+
"Bash(git push -f origin main *)",
|
|
124
|
+
"Bash(git push -f origin master *)"
|
|
125
|
+
],
|
|
126
|
+
"ask": [
|
|
127
|
+
"Bash(git push *)",
|
|
128
|
+
"Bash(git reset *)",
|
|
129
|
+
"Bash(git clean *)",
|
|
130
|
+
"Bash(git merge *)",
|
|
131
|
+
"Bash(git rebase *)",
|
|
132
|
+
"Bash(git checkout -- *)",
|
|
133
|
+
"Bash(git checkout . *)",
|
|
134
|
+
"Bash(rm *)",
|
|
135
|
+
"Bash(mv *)",
|
|
136
|
+
"Bash(chmod *)",
|
|
137
|
+
"Bash(chown *)",
|
|
138
|
+
"Bash(kill *)",
|
|
139
|
+
"Bash(pkill *)",
|
|
140
|
+
"Bash(docker run *)",
|
|
141
|
+
"Bash(docker rm *)",
|
|
142
|
+
"Bash(docker stop *)",
|
|
143
|
+
"Bash(docker volume rm *)",
|
|
144
|
+
"Bash(docker system prune *)",
|
|
145
|
+
"Bash(docker-compose down *)",
|
|
146
|
+
"Bash(docker-compose up *)",
|
|
147
|
+
"Bash(sed -i *)",
|
|
148
|
+
"Bash(xargs *)",
|
|
149
|
+
"Bash(pip install *)",
|
|
150
|
+
"Bash(pip uninstall *)",
|
|
151
|
+
"Bash(pip3 install *)",
|
|
152
|
+
"Bash(pip3 uninstall *)"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"hooks": {
|
|
156
|
+
"SessionStart": [
|
|
157
|
+
{
|
|
158
|
+
"hooks": [
|
|
159
|
+
{
|
|
160
|
+
"type": "command",
|
|
161
|
+
"command": "echo \"[CONTEXT] Current date: $(date '+%A, %Y-%m-%d %H:%M:%S %Z')\"",
|
|
162
|
+
"timeout": 5
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"type": "command",
|
|
166
|
+
"command": "echo \"[CONFIG] Context: $([ \\\"${CLAUDE_CODE_DISABLE_1M_CONTEXT:-0}\\\" = \\\"1\\\" ] && echo '200K' || echo '1M') | Compact-window: ${CLAUDE_CODE_AUTO_COMPACT_WINDOW:-full} | Effort: ${CLAUDE_CODE_EFFORT_LEVEL:-$(jq -r .effortLevel $HOME/.claude/settings.json 2>/dev/null || echo default)} | Thinking: adaptive | Subagent: ${CLAUDE_CODE_SUBAGENT_MODEL:-default}\"",
|
|
167
|
+
"timeout": 5
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"Notification": [
|
|
173
|
+
{
|
|
174
|
+
"hooks": [
|
|
175
|
+
{
|
|
176
|
+
"type": "command",
|
|
177
|
+
"command": "[ -x \"$HOME/.claude/hooks/notify.sh\" ] && \"$HOME/.claude/hooks/notify.sh\" || true",
|
|
178
|
+
"timeout": 10,
|
|
179
|
+
"async": true
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"PreToolUse": [
|
|
185
|
+
{
|
|
186
|
+
"matcher": "Bash",
|
|
187
|
+
"hooks": [
|
|
188
|
+
{
|
|
189
|
+
"type": "command",
|
|
190
|
+
"command": "rtk hook claude"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"PostToolUseFailure": [
|
|
196
|
+
{
|
|
197
|
+
"matcher": "Bash",
|
|
198
|
+
"hooks": [
|
|
199
|
+
{
|
|
200
|
+
"type": "command",
|
|
201
|
+
"command": "echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PostToolUseFailure\",\"additionalContext\":\"Last bash command failed. Repository / file state may have shifted — re-read affected files before retrying. If the failure is a missing dependency or env mismatch, surface it to the user rather than retrying blindly.\"}}'",
|
|
202
|
+
"timeout": 5
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"Stop": [
|
|
208
|
+
{
|
|
209
|
+
"hooks": [
|
|
210
|
+
{
|
|
211
|
+
"type": "command",
|
|
212
|
+
"command": "bash $HOME/.claude/fetch-usage.sh",
|
|
213
|
+
"timeout": 5,
|
|
214
|
+
"async": true
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"SubagentStop": [
|
|
220
|
+
{
|
|
221
|
+
"hooks": [
|
|
222
|
+
{
|
|
223
|
+
"type": "prompt",
|
|
224
|
+
"prompt": "You are a quality gate for subagent outputs in a multi-agent code-analysis pipeline.\n\nEvaluate the subagent's `last_assistant_message` field (in the JSON below) against these requirements:\n\n1. ALLOW (return `{}`): Mode-selection or no-issues responses. Examples: \"Which mode do you prefer\", \"select an option\", \"no issues / problems / violations / blockers found\".\n\n2. ALLOW (return `{}`): Output contains at least one concrete file:line citation — e.g. `src/auth.ts:42`, `lib/db.ts:100-115`, or path references that include line numbers.\n\n3. BLOCK (return `{\"decision\":\"block\",\"reason\":\"<one-line explanation>\"}`): Output claims about code or findings WITHOUT concrete file:line citations. Vague references like \"the auth handler\" or \"near the database code\" are not acceptable as the only evidence.\n\nSubagent invocation JSON:\n$ARGUMENTS\n\nReturn ONLY the JSON decision (no commentary, no markdown fences).",
|
|
225
|
+
"timeout": 30
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"statusLine": {
|
|
232
|
+
"type": "command",
|
|
233
|
+
"command": "~/.claude/statusline.sh",
|
|
234
|
+
"refreshInterval": 5
|
|
235
|
+
},
|
|
236
|
+
"enabledPlugins": {
|
|
237
|
+
"context7@claude-plugins-official": true,
|
|
238
|
+
"frontend-design@claude-plugins-official": true,
|
|
239
|
+
"php-lsp@claude-plugins-official": true,
|
|
240
|
+
"typescript-lsp@claude-plugins-official": true,
|
|
241
|
+
"docks@docks": true,
|
|
242
|
+
"session-relay@docks": true,
|
|
243
|
+
"effect-kit@docks": true
|
|
244
|
+
},
|
|
245
|
+
"extraKnownMarketplaces": {
|
|
246
|
+
"docks": {
|
|
247
|
+
"source": {
|
|
248
|
+
"source": "github",
|
|
249
|
+
"repo": "DocksDocks/docks"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"alwaysThinkingEnabled": true,
|
|
254
|
+
"showThinkingSummaries": true,
|
|
255
|
+
"viewMode": "default",
|
|
256
|
+
"theme": "dark-daltonized",
|
|
257
|
+
"skipDangerousModePermissionPrompt": true
|
|
258
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Claude Code status line — single-line display inspired by claude-watch.
|
|
3
|
+
# Layout: model | folder • branch | ctx X% (Xk/Xk) | 5h X% (Xh Xm) • 7d X% (Xd Xh)
|
|
4
|
+
# Cross-platform: works on both macOS and Linux.
|
|
5
|
+
|
|
6
|
+
input=$(cat)
|
|
7
|
+
|
|
8
|
+
# --- platform-aware file age ---
|
|
9
|
+
file_mtime() {
|
|
10
|
+
if [ "$(uname)" = "Darwin" ]; then
|
|
11
|
+
stat -f %m "$1" 2>/dev/null || echo 0
|
|
12
|
+
else
|
|
13
|
+
stat -c %Y "$1" 2>/dev/null || echo 0
|
|
14
|
+
fi
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# --- platform-aware ISO date parsing ---
|
|
18
|
+
parse_epoch() {
|
|
19
|
+
# GNU date (Linux)
|
|
20
|
+
date -d "$1" +%s 2>/dev/null && return
|
|
21
|
+
# BSD date (macOS): strip fractional seconds and timezone suffix
|
|
22
|
+
local clean
|
|
23
|
+
clean=$(echo "$1" | sed 's/\.[0-9]*//' | sed 's/[+-][0-9][0-9]:[0-9][0-9]$//' | sed 's/Z$//')
|
|
24
|
+
date -j -f "%Y-%m-%dT%H:%M:%S" "$clean" "+%s" 2>/dev/null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# --- model ---
|
|
28
|
+
model=$(echo "$input" | jq -r '.model.display_name // ""')
|
|
29
|
+
model="${model%% (*}" # strip parenthetical suffix: "Opus 4.7 (1M context)" → "Opus 4.7"
|
|
30
|
+
|
|
31
|
+
# --- folder ---
|
|
32
|
+
dir=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // ""')
|
|
33
|
+
dir_name=$(basename "$dir")
|
|
34
|
+
|
|
35
|
+
# --- git branch (per-invocation, no cache) ---
|
|
36
|
+
# Previously cached to /tmp/statusline-git-cache with a 5s TTL, but that
|
|
37
|
+
# leaked branches across concurrent sessions in different worktrees: any
|
|
38
|
+
# session reading the cache within 5s of another saw the other's branch.
|
|
39
|
+
# `git -C "$dir" symbolic-ref` is sub-5ms; not worth caching.
|
|
40
|
+
branch=""
|
|
41
|
+
if [ -d "${dir}/.git" ] || git -C "$dir" rev-parse --git-dir > /dev/null 2>&1; then
|
|
42
|
+
branch=$(git -C "$dir" symbolic-ref --short HEAD 2>/dev/null || git -C "$dir" rev-parse --short HEAD 2>/dev/null)
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# --- usage stats from cache ---
|
|
46
|
+
USAGE_CACHE="/tmp/.claude_usage_cache"
|
|
47
|
+
CREDS_FILE="$HOME/.claude/.credentials.json"
|
|
48
|
+
FETCH_MARKER="/tmp/.claude_usage_fetching"
|
|
49
|
+
|
|
50
|
+
# At most one spawn per 5s window: redraws come ~every 300ms but the fetch
|
|
51
|
+
# takes up to 3s, so an unthrottled spawn here piles up overlapping curls.
|
|
52
|
+
spawn_usage_fetch() {
|
|
53
|
+
if [ $(( $(date +%s) - $(file_mtime "$FETCH_MARKER") )) -ge 5 ]; then
|
|
54
|
+
touch "$FETCH_MARKER"
|
|
55
|
+
bash ~/.claude/fetch-usage.sh > /dev/null 2>&1 &
|
|
56
|
+
fi
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
# Credentials newer than the cache => account switch; the cached numbers
|
|
60
|
+
# belong to the previous account. Treat as missing rather than display them.
|
|
61
|
+
five_h="" seven_d="" five_h_reset="" seven_d_reset=""
|
|
62
|
+
if [ -f "$USAGE_CACHE" ] \
|
|
63
|
+
&& { [ ! -f "$CREDS_FILE" ] || [ "$(file_mtime "$CREDS_FILE")" -lt "$(file_mtime "$USAGE_CACHE")" ]; }; then
|
|
64
|
+
five_h=$(sed -n '1p' "$USAGE_CACHE")
|
|
65
|
+
seven_d=$(sed -n '2p' "$USAGE_CACHE")
|
|
66
|
+
five_h_reset=$(sed -n '3p' "$USAGE_CACHE")
|
|
67
|
+
seven_d_reset=$(sed -n '4p' "$USAGE_CACHE")
|
|
68
|
+
else
|
|
69
|
+
spawn_usage_fetch
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# --- format token count in thousands → "Xk" under 1000, "XM"/"X.XM" at/above ---
|
|
73
|
+
format_tokens_k() {
|
|
74
|
+
local k=$1
|
|
75
|
+
if [ "$k" -ge 1000 ]; then
|
|
76
|
+
if [ $((k % 1000)) -eq 0 ]; then
|
|
77
|
+
echo "$((k / 1000))M"
|
|
78
|
+
else
|
|
79
|
+
awk -v k="$k" 'BEGIN { printf "%.1fM", k/1000 }'
|
|
80
|
+
fi
|
|
81
|
+
else
|
|
82
|
+
echo "${k}k"
|
|
83
|
+
fi
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
# --- time delta: ISO timestamp → human-readable countdown ---
|
|
87
|
+
compute_delta() {
|
|
88
|
+
local ts="$1"
|
|
89
|
+
[ -z "$ts" ] && return
|
|
90
|
+
local reset_epoch now_epoch diff days hours minutes
|
|
91
|
+
reset_epoch=$(parse_epoch "$ts")
|
|
92
|
+
[ -z "$reset_epoch" ] && return
|
|
93
|
+
now_epoch=$(date -u +%s)
|
|
94
|
+
diff=$(( reset_epoch - now_epoch ))
|
|
95
|
+
[ "$diff" -le 0 ] && echo "now" && return
|
|
96
|
+
days=$(( diff / 86400 ))
|
|
97
|
+
hours=$(( (diff % 86400) / 3600 ))
|
|
98
|
+
minutes=$(( (diff % 3600) / 60 ))
|
|
99
|
+
# Show only the largest non-zero unit; truncate smaller (2h 13m → 2h).
|
|
100
|
+
if [ "$days" -gt 0 ]; then
|
|
101
|
+
echo "${days}d"
|
|
102
|
+
elif [ "$hours" -gt 0 ]; then
|
|
103
|
+
echo "${hours}h"
|
|
104
|
+
else
|
|
105
|
+
echo "${minutes}m"
|
|
106
|
+
fi
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
# --- context window ---
|
|
110
|
+
# Anthropic's used_percentage is always vs the model's full context window
|
|
111
|
+
# (per env-vars docs). When CLAUDE_CODE_AUTO_COMPACT_WINDOW caps the effective
|
|
112
|
+
# window (e.g. 400K on a 1M model), recompute the bar against that cap so
|
|
113
|
+
# `ctx 95%` actually means "autocompact imminent".
|
|
114
|
+
used=$(echo "$input" | jq -r '.context_window.used_percentage // empty')
|
|
115
|
+
ctx_str="" ctx_tokens_str=""
|
|
116
|
+
if [ -n "$used" ]; then
|
|
117
|
+
ctx_total=$(echo "$input" | jq -r '.context_window.context_window_size // empty' 2>/dev/null)
|
|
118
|
+
if [ -n "$ctx_total" ]; then
|
|
119
|
+
ctx_used_k=$(awk -v p="$used" -v t="$ctx_total" 'BEGIN { printf "%.0f", (p/100) * (t/1000) }')
|
|
120
|
+
|
|
121
|
+
effective_total=$ctx_total
|
|
122
|
+
if [ -n "$CLAUDE_CODE_AUTO_COMPACT_WINDOW" ] \
|
|
123
|
+
&& [ "$CLAUDE_CODE_AUTO_COMPACT_WINDOW" -lt "$ctx_total" ]; then
|
|
124
|
+
effective_total=$CLAUDE_CODE_AUTO_COMPACT_WINDOW
|
|
125
|
+
fi
|
|
126
|
+
effective_total_k=$(( effective_total / 1000 ))
|
|
127
|
+
|
|
128
|
+
if [ "$effective_total_k" -gt 0 ]; then
|
|
129
|
+
effective_pct=$(awk -v u="$ctx_used_k" -v t="$effective_total_k" 'BEGIN { printf "%.0f", (u/t) * 100 }')
|
|
130
|
+
ctx_str="${effective_pct}%"
|
|
131
|
+
fi
|
|
132
|
+
ctx_tokens_str="$(format_tokens_k "$ctx_used_k")/$(format_tokens_k "$effective_total_k")"
|
|
133
|
+
else
|
|
134
|
+
ctx_str="$(printf '%.0f%%' "$used")"
|
|
135
|
+
fi
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# --- assemble output ---
|
|
139
|
+
SEP="\033[90m • \033[0m"
|
|
140
|
+
|
|
141
|
+
# Line 1: model | folder • branch
|
|
142
|
+
printf "\033[38;5;208m\033[1m%s\033[22m\033[0m" "$model"
|
|
143
|
+
printf "\033[90m | \033[0m"
|
|
144
|
+
printf "\033[1m\033[38;2;76;208;222m%s\033[22m\033[0m" "$dir_name"
|
|
145
|
+
if [ -n "$branch" ]; then
|
|
146
|
+
printf "%b" "$SEP"
|
|
147
|
+
printf "\033[1m\033[38;2;192;103;222m%s\033[22m\033[0m" "$branch"
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
# Usage groups in order: ctx | 5h • 7d. Each group opens with `|`; the 5h/7d
|
|
151
|
+
# pair share a soft-dot separator.
|
|
152
|
+
if [ -n "$ctx_str" ]; then
|
|
153
|
+
printf "\033[90m | \033[0m"
|
|
154
|
+
printf "\033[38;2;130;160;230mctx %s\033[0m" "$ctx_str"
|
|
155
|
+
[ -n "$ctx_tokens_str" ] && printf " \033[2m\033[38;2;156;162;175m(%s)\033[0m" "$ctx_tokens_str"
|
|
156
|
+
fi
|
|
157
|
+
if [ -n "$five_h" ] || [ -n "$seven_d" ]; then
|
|
158
|
+
printf "\033[90m | \033[0m"
|
|
159
|
+
fi
|
|
160
|
+
if [ -n "$five_h" ]; then
|
|
161
|
+
printf "\033[38;2;100;200;200m5h %s%%\033[0m" "$five_h"
|
|
162
|
+
if [ -n "$five_h_reset" ]; then
|
|
163
|
+
delta=$(compute_delta "$five_h_reset")
|
|
164
|
+
[ -n "$delta" ] && printf " \033[2m\033[38;2;156;162;175m(%s)\033[0m" "$delta"
|
|
165
|
+
fi
|
|
166
|
+
fi
|
|
167
|
+
if [ -n "$seven_d" ]; then
|
|
168
|
+
[ -n "$five_h" ] && printf "%b" "$SEP"
|
|
169
|
+
printf "\033[38;2;230;180;90m7d %s%%\033[0m" "$seven_d"
|
|
170
|
+
if [ -n "$seven_d_reset" ]; then
|
|
171
|
+
delta=$(compute_delta "$seven_d_reset")
|
|
172
|
+
[ -n "$delta" ] && printf " \033[2m\033[38;2;156;162;175m(%s)\033[0m" "$delta"
|
|
173
|
+
fi
|
|
174
|
+
fi
|
|
175
|
+
printf "\n"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Research Before Implementation
|
|
4
|
+
|
|
5
|
+
Before writing or modifying code that uses an API, hook, method, or config surface you have not verified in this session, research current documentation first.
|
|
6
|
+
|
|
7
|
+
Research workflow:
|
|
8
|
+
1. Prefer official documentation and primary sources for the specific library, framework, or API.
|
|
9
|
+
2. If a local docs or MCP tool is available, use it before broad web search.
|
|
10
|
+
3. Only then proceed to implementation.
|
|
11
|
+
|
|
12
|
+
Research when:
|
|
13
|
+
- Installing or configuring a dependency.
|
|
14
|
+
- Using an API, hook, method, or pattern not verified in this session.
|
|
15
|
+
- Upgrading or migrating between versions.
|
|
16
|
+
- Any task where relying on memory could cause stale syntax or behavior.
|
|
17
|
+
|
|
18
|
+
Do not:
|
|
19
|
+
- Assume API signatures, method names, or config options from memory.
|
|
20
|
+
- Generate framework code without checking current docs first.
|
|
21
|
+
- Skip research because the library seems familiar.
|
|
22
|
+
|
|
23
|
+
<constraint>
|
|
24
|
+
Research the codebase before editing. Never change code you have not read.
|
|
25
|
+
</constraint>
|
|
26
|
+
|
|
27
|
+
## Agentic Harness Heuristics
|
|
28
|
+
|
|
29
|
+
Model-agnostic operating rules for coding-agent work.
|
|
30
|
+
|
|
31
|
+
1. Persistence. Keep going until the user's request is actually handled. Only yield when the problem is solved or a concrete blocker is identified. Resolve in the fewest useful tool loops — once you can answer the core request with evidence, answer. Before ending a turn, check the last paragraph: if it is a plan, a question you can answer yourself, or a promise of work not done, do that work now.
|
|
32
|
+
2. Default to parallel. When multiple reads, searches, inspections, or independent checks can run without depending on each other, run them together.
|
|
33
|
+
3. Multi-pass search. First-pass search often misses — vary the wording before concluding something does not exist.
|
|
34
|
+
4. Trace symbols. Before modifying a symbol, trace its definition and usages. Do not infer behavior from one call site.
|
|
35
|
+
5. Linter-loop 3-strike rule. Do not loop more than 3 times fixing the same lint/test failure without reassessing the diagnosis.
|
|
36
|
+
6. Read-before-edit TTL. If you have not read a file recently, re-read it before editing. User edits can make cached context stale.
|
|
37
|
+
7. Big-file rule. For files over 1000 lines, prefer targeted search plus scoped reads over whole-file reads.
|
|
38
|
+
8. Task hygiene. Track meaningful deliverables, not operational sub-steps. Mark work complete as soon as it is done.
|
|
39
|
+
9. Literal-instruction rule. Treat explicit user requirements as checklists with success criteria. Do not silently broaden scope.
|
|
40
|
+
10. Context hygiene. Prefer a fresh session at task boundaries over carrying stale context; preserve useful state before quality decays. Never stop, summarize, or suggest a new session on account of context limits.
|
|
41
|
+
11. Autonomy calibration. For minor choices (naming, formatting, defaults, equivalent approaches), pick a reasonable option and note it — do not ask. Ask first only for scope changes, destructive actions, or decisions that change the deliverable. When the user is describing a problem or asking a question rather than requesting a change, the deliverable is your assessment — report findings and stop; do not apply fixes until asked.
|
|
42
|
+
12. Capability triggering. Search or fetch current documentation when the answer depends on current or version-specific information. When work fans out across independent items, parallelize or delegate; never delegate work you can complete directly. For verification, prefer a fresh-context check over self-critique. On long tasks, keep running notes and re-read them between phases.
|
|
43
|
+
|
|
44
|
+
<constraint>
|
|
45
|
+
Treat these heuristics as protocol. If a turn violates an applicable rule, self-correct before continuing.
|
|
46
|
+
</constraint>
|
|
47
|
+
|
|
48
|
+
## Engineering Discipline
|
|
49
|
+
|
|
50
|
+
- Prefer the repository's existing patterns and helpers over new abstractions.
|
|
51
|
+
- Keep edits scoped to the user's request and the surrounding ownership boundary.
|
|
52
|
+
- Add abstractions only when they remove real complexity or match an established local pattern.
|
|
53
|
+
- Preserve user changes. Never revert unrelated dirty work unless explicitly asked.
|
|
54
|
+
- Verify with the narrowest useful command first, then broaden if risk warrants it.
|
|
55
|
+
- Surface any test or verification you could not run.
|
|
56
|
+
- Before the first tool call, state in one or two sentences what you are about to do; give a brief progress update every few execution steps.
|
|
57
|
+
- Concise teammate tone: no status tics, no log-style updates; reference file paths instead of dumping contents; lead with what changed and why, not a "Summary" heading.
|
|
58
|
+
- The final message is for a reader who did not watch the work: outcome first, complete sentences. Shorten by dropping detail, never by compressing into fragments or arrow chains.
|
|
59
|
+
|
|
60
|
+
<constraint>
|
|
61
|
+
No secrets in committed config. Treat plugin marketplaces, installers, and downloaded artifacts as untrusted until verified.
|
|
62
|
+
</constraint>
|
|
63
|
+
|
|
64
|
+
## Agentic Engineering Discipline
|
|
65
|
+
|
|
66
|
+
1. **State assumptions; push back when warranted.** If a requirement is ambiguous in a way that changes the deliverable, surface the ambiguity and propose 1–2 concrete interpretations in your first message — do not silently pick one. Surface inconsistencies instead of guessing past them; present tradeoffs when approaches genuinely differ; push back when the request looks wrong.
|
|
67
|
+
2. **Minimum code that solves the stated problem.** No speculative features, no abstractions without a second caller, no broad exception handling around internally-trusted calls, no dead code left behind after a refactor, no comments that restate what the code says.
|
|
68
|
+
3. **Surgical changes only.** Do not modify code, comments, or formatting outside the explicit scope of the request. Surface unrelated issues as follow-ups — do not fix inline.
|
|
69
|
+
4. **State how success will be verified before implementing.** Name the test, build, smoke check, or diff inspection that will prove the change works. Prefer executable criteria — a test that fails before and passes after, a command with expected output — and keep each change small enough that its diff is reviewable in one sitting.
|
|
70
|
+
5. **Review scope follows the pipeline.** In pipeline reviews with a downstream filter, report every issue found with confidence and severity — filtering happens downstream. In ad-hoc reviews, flag only gaps that affect correctness or the stated requirements; treat the rest as optional.
|
|
71
|
+
6. **Ground every progress claim in evidence.** Before reporting progress or completion, audit each claim against a tool result from this session — show the test output, the command and what it returned. If something is unverified, say so explicitly; if tests fail, say so with the output.
|
|
72
|
+
|
|
73
|
+
<constraint>
|
|
74
|
+
Treat the six rules above as preventive (during generation), not remedial (after the fact). Self-correct if a turn drifts.
|
|
75
|
+
</constraint>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
model = "gpt-5.5"
|
|
2
|
+
model_reasoning_effort = "xhigh"
|
|
3
|
+
plan_mode_reasoning_effort = "xhigh"
|
|
4
|
+
model_reasoning_summary = "detailed"
|
|
5
|
+
model_verbosity = "medium"
|
|
6
|
+
personality = "pragmatic"
|
|
7
|
+
web_search = "live"
|
|
8
|
+
project_doc_max_bytes = 131072
|
|
9
|
+
approval_policy = "on-request"
|
|
10
|
+
sandbox_mode = "workspace-write"
|
|
11
|
+
approvals_reviewer = "auto_review"
|
|
12
|
+
|
|
13
|
+
[sandbox_workspace_write]
|
|
14
|
+
network_access = true
|
|
15
|
+
|
|
16
|
+
[features]
|
|
17
|
+
memories = true
|
|
18
|
+
|
|
19
|
+
[memories]
|
|
20
|
+
dedicated_tools = true
|
|
21
|
+
max_rollout_age_days = 30
|
|
22
|
+
|
|
23
|
+
[agents]
|
|
24
|
+
max_threads = 12
|
|
25
|
+
max_depth = 2
|
|
26
|
+
|
|
27
|
+
[tui]
|
|
28
|
+
status_line_use_colors = true
|
|
29
|
+
status_line = [
|
|
30
|
+
"model-with-reasoning",
|
|
31
|
+
"current-dir",
|
|
32
|
+
"git-branch",
|
|
33
|
+
"context-used",
|
|
34
|
+
"five-hour-limit",
|
|
35
|
+
"weekly-limit",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[plugins."docks@docks"]
|
|
39
|
+
enabled = true
|
|
40
|
+
|
|
41
|
+
[plugins."session-relay@docks"]
|
|
42
|
+
enabled = true
|
|
43
|
+
|
|
44
|
+
[plugins."effect-kit@docks"]
|
|
45
|
+
enabled = true
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docks",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "DocksDocks"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "docks",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "git-subdir",
|
|
11
|
+
"url": "https://github.com/DocksDocks/docks.git",
|
|
12
|
+
"path": "./plugins/docks",
|
|
13
|
+
"ref": "main"
|
|
14
|
+
},
|
|
15
|
+
"policy": {
|
|
16
|
+
"installation": "AVAILABLE",
|
|
17
|
+
"authentication": "ON_INSTALL"
|
|
18
|
+
},
|
|
19
|
+
"category": "Productivity"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "session-relay",
|
|
23
|
+
"source": {
|
|
24
|
+
"source": "git-subdir",
|
|
25
|
+
"url": "https://github.com/DocksDocks/docks.git",
|
|
26
|
+
"path": "./plugins/session-relay",
|
|
27
|
+
"ref": "main"
|
|
28
|
+
},
|
|
29
|
+
"policy": {
|
|
30
|
+
"installation": "AVAILABLE",
|
|
31
|
+
"authentication": "ON_INSTALL"
|
|
32
|
+
},
|
|
33
|
+
"category": "Productivity"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "effect-kit",
|
|
37
|
+
"source": {
|
|
38
|
+
"source": "git-subdir",
|
|
39
|
+
"url": "https://github.com/DocksDocks/docks.git",
|
|
40
|
+
"path": "./plugins/effect-kit",
|
|
41
|
+
"ref": "main"
|
|
42
|
+
},
|
|
43
|
+
"policy": {
|
|
44
|
+
"installation": "AVAILABLE",
|
|
45
|
+
"authentication": "ON_INSTALL"
|
|
46
|
+
},
|
|
47
|
+
"category": "Productivity"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|