clikit-plugin 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 +46 -0
- package/README.md +282 -0
- package/command/commit.md +137 -0
- package/command/create.md +150 -0
- package/command/debug.md +185 -0
- package/command/design.md +82 -0
- package/command/handoff.md +95 -0
- package/command/import-plan.md +175 -0
- package/command/init.md +112 -0
- package/command/issue.md +110 -0
- package/command/plan.md +205 -0
- package/command/pr.md +174 -0
- package/command/research.md +103 -0
- package/command/resume.md +80 -0
- package/command/review-codebase.md +228 -0
- package/command/review.md +135 -0
- package/command/ship.md +109 -0
- package/command/start.md +77 -0
- package/command/status.md +123 -0
- package/command/verify.md +79 -0
- package/command/vision.md +142 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +103 -0
- package/dist/clikit.schema.json +423 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/config.d.ts +118 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/hooks/auto-format.d.ts +30 -0
- package/dist/hooks/auto-format.d.ts.map +1 -0
- package/dist/hooks/comment-checker.d.ts +17 -0
- package/dist/hooks/comment-checker.d.ts.map +1 -0
- package/dist/hooks/compaction.d.ts +60 -0
- package/dist/hooks/compaction.d.ts.map +1 -0
- package/dist/hooks/empty-message-sanitizer.d.ts +9 -0
- package/dist/hooks/empty-message-sanitizer.d.ts.map +1 -0
- package/dist/hooks/env-context.d.ts +43 -0
- package/dist/hooks/env-context.d.ts.map +1 -0
- package/dist/hooks/git-guard.d.ts +14 -0
- package/dist/hooks/git-guard.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +35 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/ritual-enforcer.d.ts +29 -0
- package/dist/hooks/ritual-enforcer.d.ts.map +1 -0
- package/dist/hooks/security-check.d.ts +20 -0
- package/dist/hooks/security-check.d.ts.map +1 -0
- package/dist/hooks/session-notification.d.ts +23 -0
- package/dist/hooks/session-notification.d.ts.map +1 -0
- package/dist/hooks/subagent-question-blocker.d.ts +11 -0
- package/dist/hooks/subagent-question-blocker.d.ts.map +1 -0
- package/dist/hooks/swarm-enforcer.d.ts +31 -0
- package/dist/hooks/swarm-enforcer.d.ts.map +1 -0
- package/dist/hooks/todo-enforcer.d.ts +19 -0
- package/dist/hooks/todo-enforcer.d.ts.map +1 -0
- package/dist/hooks/truncator.d.ts +28 -0
- package/dist/hooks/truncator.d.ts.map +1 -0
- package/dist/hooks/typecheck-gate.d.ts +31 -0
- package/dist/hooks/typecheck-gate.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5785 -0
- package/dist/skills/index.d.ts +9 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/tools/beads-memory-sync.d.ts +17 -0
- package/dist/tools/beads-memory-sync.d.ts.map +1 -0
- package/dist/tools/context-summary.d.ts +21 -0
- package/dist/tools/context-summary.d.ts.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/memory.d.ts +56 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/observation.d.ts +28 -0
- package/dist/tools/observation.d.ts.map +1 -0
- package/dist/tools/quick-research.d.ts +16 -0
- package/dist/tools/quick-research.d.ts.map +1 -0
- package/dist/tools/swarm.d.ts +57 -0
- package/dist/tools/swarm.d.ts.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -0
- package/memory/_templates/handoff.md +114 -0
- package/memory/_templates/plan.md +135 -0
- package/memory/_templates/prd.md +147 -0
- package/memory/_templates/research.md +108 -0
- package/memory/_templates/review.md +117 -0
- package/memory/_templates/spec.md +116 -0
- package/memory/beads/.gitkeep +0 -0
- package/memory/handoffs/.gitkeep +0 -0
- package/memory/plans/.gitkeep +0 -0
- package/memory/prds/.gitkeep +0 -0
- package/memory/research/.gitkeep +0 -0
- package/memory/reviews/.gitkeep +0 -0
- package/memory/specs/.gitkeep +0 -0
- package/package.json +64 -0
- package/skill/accessibility-audit/SKILL.md +115 -0
- package/skill/beads/SKILL.md +56 -0
- package/skill/beads-bridge/SKILL.md +45 -0
- package/skill/brainstorming/SKILL.md +41 -0
- package/skill/chrome-devtools/SKILL.md +36 -0
- package/skill/cloudflare/SKILL.md +96 -0
- package/skill/condition-based-waiting/SKILL.md +92 -0
- package/skill/deep-research/SKILL.md +130 -0
- package/skill/defense-in-depth/SKILL.md +89 -0
- package/skill/design-system-audit/SKILL.md +136 -0
- package/skill/development-lifecycle/SKILL.md +58 -0
- package/skill/dispatching-parallel-agents/SKILL.md +94 -0
- package/skill/executing-plans/SKILL.md +54 -0
- package/skill/figma/SKILL.md +34 -0
- package/skill/finishing-a-development-branch/SKILL.md +127 -0
- package/skill/frontend-aesthetics/SKILL.md +63 -0
- package/skill/gemini-large-context/SKILL.md +80 -0
- package/skill/mockup-to-code/SKILL.md +98 -0
- package/skill/mqdh/SKILL.md +54 -0
- package/skill/notebooklm/SKILL.md +71 -0
- package/skill/playwright/SKILL.md +37 -0
- package/skill/playwriter/SKILL.md +56 -0
- package/skill/polar/SKILL.md +39 -0
- package/skill/receiving-code-review/SKILL.md +47 -0
- package/skill/requesting-code-review/SKILL.md +47 -0
- package/skill/resend/SKILL.md +85 -0
- package/skill/ritual-workflow/SKILL.md +101 -0
- package/skill/root-cause-tracing/SKILL.md +73 -0
- package/skill/session-management/SKILL.md +53 -0
- package/skill/sharing-skills/SKILL.md +50 -0
- package/skill/source-code-research/SKILL.md +138 -0
- package/skill/subagent-driven-development/SKILL.md +69 -0
- package/skill/supabase/SKILL.md +80 -0
- package/skill/supabase-postgres-best-practices/SKILL.md +168 -0
- package/skill/swarm-coordination/SKILL.md +54 -0
- package/skill/systematic-debugging/SKILL.md +58 -0
- package/skill/test-driven-development/SKILL.md +53 -0
- package/skill/testing-anti-patterns/SKILL.md +100 -0
- package/skill/testing-skills-with-subagents/SKILL.md +102 -0
- package/skill/ui-ux-research/SKILL.md +93 -0
- package/skill/using-git-worktrees/SKILL.md +129 -0
- package/skill/v0/SKILL.md +67 -0
- package/skill/v1-run/SKILL.md +85 -0
- package/skill/vercel-react-best-practices/SKILL.md +174 -0
- package/skill/verification-before-completion/SKILL.md +55 -0
- package/skill/visual-analysis/SKILL.md +113 -0
- package/skill/writing-plans/SKILL.md +55 -0
- package/skill/writing-skills/SKILL.md +68 -0
- package/src/agents/AGENTS.md +46 -0
- package/src/agents/build.md +170 -0
- package/src/agents/explore.md +113 -0
- package/src/agents/general.md +92 -0
- package/src/agents/index.ts +64 -0
- package/src/agents/librarian.md +116 -0
- package/src/agents/looker.md +107 -0
- package/src/agents/oracle.md +138 -0
- package/src/agents/plan.md +78 -0
- package/src/agents/review.md +98 -0
- package/src/agents/scout.md +84 -0
- package/src/agents/vision.md +159 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "CliKit Plugin Configuration",
|
|
4
|
+
"description": "Configuration for CliKit OpenCode plugin",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"disabled_agents": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"items": { "type": "string" },
|
|
10
|
+
"description": "List of agent names to disable",
|
|
11
|
+
"examples": [["scout"]]
|
|
12
|
+
},
|
|
13
|
+
"disabled_commands": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": { "type": "string" },
|
|
16
|
+
"description": "List of command names to disable",
|
|
17
|
+
"examples": [["debug", "import-plan"]]
|
|
18
|
+
},
|
|
19
|
+
"agents": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Override settings for specific agents",
|
|
22
|
+
"additionalProperties": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"model": { "type": "string", "description": "Override model for this agent" },
|
|
26
|
+
"temperature": { "type": "number", "minimum": 0, "maximum": 2 },
|
|
27
|
+
"top_p": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
28
|
+
"mode": { "enum": ["subagent", "primary", "all"] },
|
|
29
|
+
"disabled": { "type": "boolean", "description": "Disable this agent" },
|
|
30
|
+
"color": { "type": "string", "description": "Agent color in UI" },
|
|
31
|
+
"maxSteps": { "type": "integer", "minimum": 1, "description": "Maximum steps for agent" },
|
|
32
|
+
"tools": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": { "type": "boolean" }
|
|
35
|
+
},
|
|
36
|
+
"permission": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"description": "Permission overrides for this agent",
|
|
39
|
+
"properties": {
|
|
40
|
+
"edit": { "enum": ["ask", "allow", "deny"] },
|
|
41
|
+
"bash": {
|
|
42
|
+
"oneOf": [
|
|
43
|
+
{ "enum": ["ask", "allow", "deny"] },
|
|
44
|
+
{ "type": "object", "additionalProperties": { "enum": ["ask", "allow", "deny"] } }
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"webfetch": { "enum": ["ask", "allow", "deny"] },
|
|
48
|
+
"doom_loop": { "enum": ["ask", "allow", "deny"] },
|
|
49
|
+
"external_directory": { "enum": ["ask", "allow", "deny"] }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"commands": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"description": "Override settings for specific commands",
|
|
58
|
+
"additionalProperties": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"properties": {
|
|
61
|
+
"agent": { "type": "string", "description": "Agent to use for this command" },
|
|
62
|
+
"model": { "type": "string", "description": "Model to use for this command" },
|
|
63
|
+
"subtask": { "type": "boolean", "description": "Run as subtask" },
|
|
64
|
+
"description": { "type": "string", "description": "Command description" },
|
|
65
|
+
"template": { "type": "string", "description": "Command template/prompt" }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"lsp": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"description": "LSP server configurations to inject into OpenCode",
|
|
72
|
+
"additionalProperties": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": ["command"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"command": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "type": "string" },
|
|
79
|
+
"description": "Command and arguments to start the LSP server"
|
|
80
|
+
},
|
|
81
|
+
"extensions": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": { "type": "string" },
|
|
84
|
+
"description": "File extensions this LSP handles (e.g., ['.ts', '.tsx'])"
|
|
85
|
+
},
|
|
86
|
+
"priority": { "type": "integer", "description": "Priority when multiple LSPs match (higher = preferred)" },
|
|
87
|
+
"disabled": { "type": "boolean", "description": "Disable this LSP server" },
|
|
88
|
+
"env": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"additionalProperties": { "type": "string" },
|
|
91
|
+
"description": "Environment variables for the LSP process"
|
|
92
|
+
},
|
|
93
|
+
"initialization": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"description": "LSP initialization options"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"examples": [{
|
|
100
|
+
"typescript": {
|
|
101
|
+
"command": ["typescript-language-server", "--stdio"],
|
|
102
|
+
"extensions": [".ts", ".tsx", ".js", ".jsx"]
|
|
103
|
+
}
|
|
104
|
+
}]
|
|
105
|
+
},
|
|
106
|
+
"hooks": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"properties": {
|
|
109
|
+
"session_logging": {
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"default": true,
|
|
112
|
+
"description": "Enable session lifecycle logging"
|
|
113
|
+
},
|
|
114
|
+
"tool_logging": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"default": false,
|
|
117
|
+
"description": "Enable tool execution logging"
|
|
118
|
+
},
|
|
119
|
+
"todo_enforcer": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"description": "Todo continuation enforcer - warns when todos are incomplete",
|
|
122
|
+
"properties": {
|
|
123
|
+
"enabled": {
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"default": true,
|
|
126
|
+
"description": "Enable todo completion checking"
|
|
127
|
+
},
|
|
128
|
+
"warn_on_incomplete": {
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"default": true,
|
|
131
|
+
"description": "Log warning when todos are incomplete"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"empty_message_sanitizer": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"description": "Empty message sanitizer - prevents API errors from empty outputs",
|
|
138
|
+
"properties": {
|
|
139
|
+
"enabled": {
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"default": true,
|
|
142
|
+
"description": "Enable empty message sanitization"
|
|
143
|
+
},
|
|
144
|
+
"log_empty": {
|
|
145
|
+
"type": "boolean",
|
|
146
|
+
"default": true,
|
|
147
|
+
"description": "Log when empty messages are detected"
|
|
148
|
+
},
|
|
149
|
+
"placeholder": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"default": "(No output)",
|
|
152
|
+
"description": "Placeholder text for empty outputs"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"git_guard": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"description": "Blocks dangerous git commands (force push, hard reset, rm -rf)",
|
|
159
|
+
"properties": {
|
|
160
|
+
"enabled": {
|
|
161
|
+
"type": "boolean",
|
|
162
|
+
"default": true,
|
|
163
|
+
"description": "Enable git command guard"
|
|
164
|
+
},
|
|
165
|
+
"allow_force_with_lease": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"default": true,
|
|
168
|
+
"description": "Allow --force-with-lease as a safer alternative"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"security_check": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"description": "Scans for secrets and credentials before git commits",
|
|
175
|
+
"properties": {
|
|
176
|
+
"enabled": {
|
|
177
|
+
"type": "boolean",
|
|
178
|
+
"default": true,
|
|
179
|
+
"description": "Enable secret scanning"
|
|
180
|
+
},
|
|
181
|
+
"block_commits": {
|
|
182
|
+
"type": "boolean",
|
|
183
|
+
"default": false,
|
|
184
|
+
"description": "Block commits when secrets are detected (vs. warn only)"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"subagent_question_blocker": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"description": "Prevents subagents from asking clarifying questions",
|
|
191
|
+
"properties": {
|
|
192
|
+
"enabled": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"default": true,
|
|
195
|
+
"description": "Enable subagent question blocking"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"comment_checker": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"description": "Detects excessive AI-generated comments in code",
|
|
202
|
+
"properties": {
|
|
203
|
+
"enabled": {
|
|
204
|
+
"type": "boolean",
|
|
205
|
+
"default": true,
|
|
206
|
+
"description": "Enable comment density checking"
|
|
207
|
+
},
|
|
208
|
+
"threshold": {
|
|
209
|
+
"type": "number",
|
|
210
|
+
"default": 0.3,
|
|
211
|
+
"minimum": 0,
|
|
212
|
+
"maximum": 1,
|
|
213
|
+
"description": "Comment-to-code ratio threshold (0.3 = 30%)"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"env_context": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"description": "Injects project structure, git branch, and build system info",
|
|
220
|
+
"properties": {
|
|
221
|
+
"enabled": {
|
|
222
|
+
"type": "boolean",
|
|
223
|
+
"default": true,
|
|
224
|
+
"description": "Enable environment context injection"
|
|
225
|
+
},
|
|
226
|
+
"include_git": {
|
|
227
|
+
"type": "boolean",
|
|
228
|
+
"default": true,
|
|
229
|
+
"description": "Include git branch and status"
|
|
230
|
+
},
|
|
231
|
+
"include_package": {
|
|
232
|
+
"type": "boolean",
|
|
233
|
+
"default": true,
|
|
234
|
+
"description": "Include package.json info"
|
|
235
|
+
},
|
|
236
|
+
"include_structure": {
|
|
237
|
+
"type": "boolean",
|
|
238
|
+
"default": true,
|
|
239
|
+
"description": "Include project directory structure"
|
|
240
|
+
},
|
|
241
|
+
"max_depth": {
|
|
242
|
+
"type": "integer",
|
|
243
|
+
"default": 2,
|
|
244
|
+
"minimum": 1,
|
|
245
|
+
"maximum": 5,
|
|
246
|
+
"description": "Max depth for directory structure scan"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"auto_format": {
|
|
251
|
+
"type": "object",
|
|
252
|
+
"description": "Runs project formatter after file edits (prettier, biome, dprint)",
|
|
253
|
+
"properties": {
|
|
254
|
+
"enabled": {
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"default": false,
|
|
257
|
+
"description": "Enable auto-formatting (off by default)"
|
|
258
|
+
},
|
|
259
|
+
"formatter": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"enum": ["prettier", "biome", "dprint"],
|
|
262
|
+
"description": "Override formatter (auto-detected if not set)"
|
|
263
|
+
},
|
|
264
|
+
"extensions": {
|
|
265
|
+
"type": "array",
|
|
266
|
+
"items": { "type": "string" },
|
|
267
|
+
"description": "File extensions to format (e.g., ['.ts', '.tsx'])"
|
|
268
|
+
},
|
|
269
|
+
"log": {
|
|
270
|
+
"type": "boolean",
|
|
271
|
+
"default": true,
|
|
272
|
+
"description": "Log format operations"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"typecheck_gate": {
|
|
277
|
+
"type": "object",
|
|
278
|
+
"description": "Runs TypeScript type checking after .ts/.tsx file edits",
|
|
279
|
+
"properties": {
|
|
280
|
+
"enabled": {
|
|
281
|
+
"type": "boolean",
|
|
282
|
+
"default": false,
|
|
283
|
+
"description": "Enable typecheck gate (off by default)"
|
|
284
|
+
},
|
|
285
|
+
"tsconfig": {
|
|
286
|
+
"type": "string",
|
|
287
|
+
"description": "Path to tsconfig.json (auto-detected if not set)"
|
|
288
|
+
},
|
|
289
|
+
"log": {
|
|
290
|
+
"type": "boolean",
|
|
291
|
+
"default": true,
|
|
292
|
+
"description": "Log typecheck results"
|
|
293
|
+
},
|
|
294
|
+
"block_on_error": {
|
|
295
|
+
"type": "boolean",
|
|
296
|
+
"default": false,
|
|
297
|
+
"description": "Block file writes when type errors are found"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"session_notification": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"description": "Desktop notifications when sessions complete or error",
|
|
304
|
+
"properties": {
|
|
305
|
+
"enabled": {
|
|
306
|
+
"type": "boolean",
|
|
307
|
+
"default": true,
|
|
308
|
+
"description": "Enable desktop notifications"
|
|
309
|
+
},
|
|
310
|
+
"on_idle": {
|
|
311
|
+
"type": "boolean",
|
|
312
|
+
"default": true,
|
|
313
|
+
"description": "Notify when session goes idle"
|
|
314
|
+
},
|
|
315
|
+
"on_error": {
|
|
316
|
+
"type": "boolean",
|
|
317
|
+
"default": true,
|
|
318
|
+
"description": "Notify on session errors"
|
|
319
|
+
},
|
|
320
|
+
"title_prefix": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"default": "OpenCode",
|
|
323
|
+
"description": "Prefix for notification titles"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"truncator": {
|
|
328
|
+
"type": "object",
|
|
329
|
+
"description": "Dynamic output truncation to prevent context overflow",
|
|
330
|
+
"properties": {
|
|
331
|
+
"enabled": {
|
|
332
|
+
"type": "boolean",
|
|
333
|
+
"default": true,
|
|
334
|
+
"description": "Enable output truncation"
|
|
335
|
+
},
|
|
336
|
+
"max_output_chars": {
|
|
337
|
+
"type": "integer",
|
|
338
|
+
"default": 30000,
|
|
339
|
+
"description": "Maximum output characters before truncation"
|
|
340
|
+
},
|
|
341
|
+
"max_output_lines": {
|
|
342
|
+
"type": "integer",
|
|
343
|
+
"default": 500,
|
|
344
|
+
"description": "Maximum output lines before truncation"
|
|
345
|
+
},
|
|
346
|
+
"preserve_head_lines": {
|
|
347
|
+
"type": "integer",
|
|
348
|
+
"default": 50,
|
|
349
|
+
"description": "Lines to preserve from the start"
|
|
350
|
+
},
|
|
351
|
+
"preserve_tail_lines": {
|
|
352
|
+
"type": "integer",
|
|
353
|
+
"default": 50,
|
|
354
|
+
"description": "Lines to preserve from the end"
|
|
355
|
+
},
|
|
356
|
+
"log": {
|
|
357
|
+
"type": "boolean",
|
|
358
|
+
"default": true,
|
|
359
|
+
"description": "Log truncation events"
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"compaction": {
|
|
364
|
+
"type": "object",
|
|
365
|
+
"description": "Preserves beads state and memory during context compaction",
|
|
366
|
+
"properties": {
|
|
367
|
+
"enabled": {
|
|
368
|
+
"type": "boolean",
|
|
369
|
+
"default": true,
|
|
370
|
+
"description": "Enable compaction state preservation"
|
|
371
|
+
},
|
|
372
|
+
"include_beads_state": {
|
|
373
|
+
"type": "boolean",
|
|
374
|
+
"default": true,
|
|
375
|
+
"description": "Include beads-village task state"
|
|
376
|
+
},
|
|
377
|
+
"include_memory_refs": {
|
|
378
|
+
"type": "boolean",
|
|
379
|
+
"default": true,
|
|
380
|
+
"description": "Include recent memory references"
|
|
381
|
+
},
|
|
382
|
+
"include_todo_state": {
|
|
383
|
+
"type": "boolean",
|
|
384
|
+
"default": true,
|
|
385
|
+
"description": "Include current todo list state"
|
|
386
|
+
},
|
|
387
|
+
"max_state_chars": {
|
|
388
|
+
"type": "integer",
|
|
389
|
+
"default": 5000,
|
|
390
|
+
"description": "Maximum characters for compaction context"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"swarm_enforcer": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"description": "Enforces task isolation for multi-agent swarms",
|
|
397
|
+
"properties": {
|
|
398
|
+
"enabled": {
|
|
399
|
+
"type": "boolean",
|
|
400
|
+
"default": false,
|
|
401
|
+
"description": "Enable swarm enforcement (off by default)"
|
|
402
|
+
},
|
|
403
|
+
"strict_file_locking": {
|
|
404
|
+
"type": "boolean",
|
|
405
|
+
"default": true,
|
|
406
|
+
"description": "Only allow edits to reserved files"
|
|
407
|
+
},
|
|
408
|
+
"block_unreserved_edits": {
|
|
409
|
+
"type": "boolean",
|
|
410
|
+
"default": false,
|
|
411
|
+
"description": "Block edits to unreserved files (vs. warn)"
|
|
412
|
+
},
|
|
413
|
+
"log": {
|
|
414
|
+
"type": "boolean",
|
|
415
|
+
"default": true,
|
|
416
|
+
"description": "Log enforcement decisions"
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkC9C,wBAAgB,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAoB5D;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAElE"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { AgentConfig, CommandConfig } from "./types";
|
|
2
|
+
export interface AgentOverride {
|
|
3
|
+
model?: string;
|
|
4
|
+
temperature?: number;
|
|
5
|
+
mode?: "subagent" | "primary" | "all";
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
tools?: Record<string, boolean>;
|
|
8
|
+
permission?: AgentConfig["permission"];
|
|
9
|
+
}
|
|
10
|
+
export interface LspServerConfig {
|
|
11
|
+
command: string[];
|
|
12
|
+
extensions?: string[];
|
|
13
|
+
priority?: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
initialization?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface TodoEnforcerHookConfig {
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
warn_on_incomplete?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface EmptyMessageSanitizerHookConfig {
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
log_empty?: boolean;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GitGuardHookConfig {
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
allow_force_with_lease?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface SecurityCheckHookConfig {
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
block_commits?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface SubagentQuestionBlockerHookConfig {
|
|
36
|
+
enabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface CommentCheckerHookConfig {
|
|
39
|
+
enabled?: boolean;
|
|
40
|
+
threshold?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface EnvContextHookConfig {
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
include_git?: boolean;
|
|
45
|
+
include_package?: boolean;
|
|
46
|
+
include_structure?: boolean;
|
|
47
|
+
max_depth?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface AutoFormatHookConfig {
|
|
50
|
+
enabled?: boolean;
|
|
51
|
+
formatter?: string;
|
|
52
|
+
extensions?: string[];
|
|
53
|
+
log?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface TypeCheckGateHookConfig {
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
tsconfig?: string;
|
|
58
|
+
log?: boolean;
|
|
59
|
+
block_on_error?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface SessionNotificationHookConfig {
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
on_idle?: boolean;
|
|
64
|
+
on_error?: boolean;
|
|
65
|
+
title_prefix?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface TruncatorHookConfig {
|
|
68
|
+
enabled?: boolean;
|
|
69
|
+
max_output_chars?: number;
|
|
70
|
+
max_output_lines?: number;
|
|
71
|
+
preserve_head_lines?: number;
|
|
72
|
+
preserve_tail_lines?: number;
|
|
73
|
+
log?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface CompactionHookConfig {
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
include_beads_state?: boolean;
|
|
78
|
+
include_memory_refs?: boolean;
|
|
79
|
+
include_todo_state?: boolean;
|
|
80
|
+
max_state_chars?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface SwarmEnforcerHookConfig {
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
strict_file_locking?: boolean;
|
|
85
|
+
block_unreserved_edits?: boolean;
|
|
86
|
+
log?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface HooksConfig {
|
|
89
|
+
session_logging?: boolean;
|
|
90
|
+
tool_logging?: boolean;
|
|
91
|
+
todo_enforcer?: TodoEnforcerHookConfig;
|
|
92
|
+
empty_message_sanitizer?: EmptyMessageSanitizerHookConfig;
|
|
93
|
+
git_guard?: GitGuardHookConfig;
|
|
94
|
+
security_check?: SecurityCheckHookConfig;
|
|
95
|
+
subagent_question_blocker?: SubagentQuestionBlockerHookConfig;
|
|
96
|
+
comment_checker?: CommentCheckerHookConfig;
|
|
97
|
+
env_context?: EnvContextHookConfig;
|
|
98
|
+
auto_format?: AutoFormatHookConfig;
|
|
99
|
+
typecheck_gate?: TypeCheckGateHookConfig;
|
|
100
|
+
session_notification?: SessionNotificationHookConfig;
|
|
101
|
+
truncator?: TruncatorHookConfig;
|
|
102
|
+
compaction?: CompactionHookConfig;
|
|
103
|
+
swarm_enforcer?: SwarmEnforcerHookConfig;
|
|
104
|
+
}
|
|
105
|
+
export interface CliKitConfig {
|
|
106
|
+
disabled_agents?: string[];
|
|
107
|
+
disabled_commands?: string[];
|
|
108
|
+
agents?: Record<string, AgentOverride>;
|
|
109
|
+
commands?: Record<string, Partial<CommandConfig>>;
|
|
110
|
+
lsp?: Record<string, LspServerConfig>;
|
|
111
|
+
hooks?: HooksConfig;
|
|
112
|
+
}
|
|
113
|
+
declare function getUserConfigDir(): string;
|
|
114
|
+
export declare function loadCliKitConfig(projectDirectory: string): CliKitConfig;
|
|
115
|
+
export declare function filterAgents(agents: Record<string, AgentConfig>, config: CliKitConfig): Record<string, AgentConfig>;
|
|
116
|
+
export declare function filterCommands(commands: Record<string, CommandConfig>, config: CliKitConfig): Record<string, CommandConfig>;
|
|
117
|
+
export { getUserConfigDir };
|
|
118
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG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
*
|
|
4
|
+
* Runs the project's formatter after file edits.
|
|
5
|
+
* Detects prettier, biome, dprint, or other formatters from project config.
|
|
6
|
+
* Runs on tool.execute.after for edit/write tools.
|
|
7
|
+
*/
|
|
8
|
+
export interface AutoFormatConfig {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
formatter?: string;
|
|
11
|
+
extensions?: string[];
|
|
12
|
+
log?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface FormatResult {
|
|
15
|
+
formatted: boolean;
|
|
16
|
+
file: string;
|
|
17
|
+
formatter: string;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
type FormatterEntry = {
|
|
21
|
+
name: string;
|
|
22
|
+
configFiles: string[];
|
|
23
|
+
command: (file: string) => string;
|
|
24
|
+
};
|
|
25
|
+
export declare function detectFormatter(projectDir: string): FormatterEntry | undefined;
|
|
26
|
+
export declare function shouldFormat(filePath: string, extensions?: string[]): boolean;
|
|
27
|
+
export declare function runFormatter(filePath: string, projectDir: string, formatterOverride?: string): FormatResult;
|
|
28
|
+
export declare function formatAutoFormatLog(result: FormatResult): string;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=auto-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-format.d.ts","sourceRoot":"","sources":["../../src/hooks/auto-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACnC,CAAC;AAsBF,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CA2B9E;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAI7E;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,MAAM,GACzB,YAAY,CAmCd;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAKhE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comment Checker Hook
|
|
3
|
+
*
|
|
4
|
+
* Detects excessive AI-generated comments in code output.
|
|
5
|
+
* AI code should be indistinguishable from human-written code.
|
|
6
|
+
* Runs on tool.execute.after for edit/write tools.
|
|
7
|
+
*/
|
|
8
|
+
export interface CommentCheckResult {
|
|
9
|
+
excessive: boolean;
|
|
10
|
+
count: number;
|
|
11
|
+
totalLines: number;
|
|
12
|
+
ratio: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function checkCommentDensity(content: string, threshold?: number): CommentCheckResult;
|
|
15
|
+
export declare function hasExcessiveAIComments(content: string): boolean;
|
|
16
|
+
export declare function formatCommentWarning(result: CommentCheckResult): string;
|
|
17
|
+
//# sourceMappingURL=comment-checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-checker.d.ts","sourceRoot":"","sources":["../../src/hooks/comment-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,kBAAkB,CAkDhG;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAS/D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAGvE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compaction Hook
|
|
3
|
+
*
|
|
4
|
+
* Injects beads-village state and memory references when a session
|
|
5
|
+
* is being compacted (context window nearing limit). Ensures critical
|
|
6
|
+
* state survives compaction so agents don't lose task context.
|
|
7
|
+
* Runs on session.idle / compaction event.
|
|
8
|
+
*
|
|
9
|
+
* Beads state: reads from .beads/metadata.json + .reservations/
|
|
10
|
+
* Memory refs: scans .opencode/memory/ subdirs for .md files
|
|
11
|
+
*/
|
|
12
|
+
export interface CompactionConfig {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
include_beads_state?: boolean;
|
|
15
|
+
include_memory_refs?: boolean;
|
|
16
|
+
include_todo_state?: boolean;
|
|
17
|
+
max_state_chars?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface BeadsState {
|
|
20
|
+
currentTask?: string;
|
|
21
|
+
taskId?: string;
|
|
22
|
+
reservedFiles?: string[];
|
|
23
|
+
agentId?: string;
|
|
24
|
+
team?: string;
|
|
25
|
+
inProgressCount?: number;
|
|
26
|
+
openCount?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface MemoryRef {
|
|
29
|
+
key: string;
|
|
30
|
+
summary: string;
|
|
31
|
+
timestamp: number;
|
|
32
|
+
category: string;
|
|
33
|
+
}
|
|
34
|
+
export interface CompactionPayload {
|
|
35
|
+
beads?: BeadsState;
|
|
36
|
+
memories?: MemoryRef[];
|
|
37
|
+
todos?: Array<{
|
|
38
|
+
id: string;
|
|
39
|
+
content: string;
|
|
40
|
+
status: string;
|
|
41
|
+
}>;
|
|
42
|
+
sessionSummary?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Read beads-village state from the actual beads infrastructure:
|
|
46
|
+
* - .beads/metadata.json for DB config
|
|
47
|
+
* - .reservations/ for active file locks
|
|
48
|
+
* - `bd ls` command for current task status (if bd CLI available)
|
|
49
|
+
*/
|
|
50
|
+
export declare function readBeadsState(projectDir: string): BeadsState | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Read memory references from .opencode/memory/ subdirectories.
|
|
53
|
+
* Scans for .md files in subdirs: specs/, plans/, research/, reviews/, handoffs/, beads/
|
|
54
|
+
* Extracts title from first heading or filename.
|
|
55
|
+
*/
|
|
56
|
+
export declare function readMemoryRefs(projectDir: string, limit?: number): MemoryRef[];
|
|
57
|
+
export declare function buildCompactionBlock(payload: CompactionPayload, maxChars?: number): string;
|
|
58
|
+
export declare function collectCompactionPayload(projectDir: string, config?: CompactionConfig): CompactionPayload;
|
|
59
|
+
export declare function formatCompactionLog(payload: CompactionPayload): string;
|
|
60
|
+
//# sourceMappingURL=compaction.d.ts.map
|