You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor!(api,cli): split resume selector from bootstrap skipping (#203)
BREAKING CHANGE: The -r flag now only sets the resume=true selector
and no longer skips rule discovery and bootstrap scripts. To achieve
the previous behavior of skipping bootstrap, users must now use both
-r and --skip-bootstrap flags together.
The change separates concerns:
- -r: Sets resume selector for task filtering
- --skip-bootstrap: Controls whether to discover rules, skills, and
run bootstrap scripts
This allows users to independently control task filtering and bootstrap
behavior, providing more flexibility in workflow configurations.
API changes:
- Added WithBootstrap() option in options.go to control bootstrap
behavior programmatically
- WithResume() now only sets the resume selector and no longer affects
bootstrap discovery
- Context.doBootstrap field controls rule/skill discovery and bootstrap
script execution independently from resume selector
Copy file name to clipboardExpand all lines: docs/reference/cli.md
+30-14Lines changed: 30 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,21 +221,37 @@ coding-context -a copilot -w implement-feature
221
221
**Type:** Boolean flag
222
222
**Default:** False
223
223
224
-
Enable resume mode. This does two things:
225
-
1. Skips outputting all rule files (saves tokens)
226
-
2. Automatically adds `-s resume=true` selector
224
+
Set the resume selector to "true". This automatically adds `-s resume=true` selector, which can be used to filter tasks by their frontmatter `resume` field.
227
225
228
-
Use this when continuing work in a new session where context has already been established.
226
+
**Note:** This flag only sets the selector. To skip rule discovery and bootstrap scripts, use the `--skip-bootstrap` flag instead.
229
227
230
228
**Example:**
231
229
```bash
232
-
# Initial session
233
-
coding-context -s resume=false fix-bug | ai-agent
234
-
235
-
# Resume session
230
+
# Set resume selector to select resume-specific tasks
236
231
coding-context -r fix-bug | ai-agent
232
+
233
+
# Equivalent to:
234
+
coding-context -s resume=true fix-bug | ai-agent
235
+
```
236
+
237
+
### `--skip-bootstrap`
238
+
239
+
**Type:** Boolean flag
240
+
**Default:** False (bootstrap enabled by default)
241
+
242
+
Skip bootstrap: skip discovering rules, skills, and running bootstrap scripts. When present, rule discovery, skill discovery, and bootstrap script execution are skipped.
243
+
244
+
**Example:**
245
+
```bash
246
+
# Skip rule discovery and bootstrap (saves tokens and time)
**Note:** This flag is independent of the `-r` flag. Use `-r` to set the resume selector, and `--skip-bootstrap` to skip bootstrap operations.
254
+
239
255
### `-s <key>=<value>`
240
256
241
257
**Type:** Key-value pair
@@ -296,12 +312,12 @@ coding-context -w fix-bug
296
312
# Combine with other options
297
313
coding-context -a copilot -w -s languages=go -p issue=123 fix-bug
298
314
299
-
# Resume mode with write rules: rules are skipped, only task output to stdout
300
-
coding-context -a copilot -w -r fix-bug
315
+
# Resume selector with bootstrap disabled: rules are skipped, only task output to stdout
316
+
coding-context -a copilot -w -r --skip-bootstrap fix-bug
301
317
```
302
318
303
-
**Note on Resume Mode:**
304
-
When using `-w` with `-r` (resume mode), no rules file is written since rules are not collected in resume mode. Only the task prompt is output to stdout.
319
+
**Note on Bootstrap:**
320
+
When using `-w` with `--skip-bootstrap` (bootstrap disabled), no rules file is written since rules are not collected. Only the task prompt is output to stdout.
305
321
306
322
**Use case:**
307
323
This mode is particularly useful when working with AI coding agents that read rules from specific configuration files. Instead of including all rules in the prompt (consuming tokens), you can write them to the agent's config file once and only send the task prompt.
flag.BoolVar(&writeRules, "w", false, "Write rules to the agent's user rules path and only print the prompt to stdout. Requires agent (via task 'agent' field or -a flag).")
37
39
flag.Var(&agent, "a", "Target agent to use. Required when using -w to write rules to the agent's user rules path. Supported agents: cursor, opencode, copilot, claude, gemini, augment, windsurf, codex.")
38
40
flag.Var(¶ms, "p", "Parameter to substitute in the prompt. Can be specified multiple times as key=value.")
@@ -87,6 +89,7 @@ func main() {
87
89
codingcontext.WithSearchPaths(searchPaths...),
88
90
codingcontext.WithLogger(logger),
89
91
codingcontext.WithResume(resume),
92
+
codingcontext.WithBootstrap(!skipBootstrap), // Invert: skipBootstrap=false means bootstrap enabled
90
93
codingcontext.WithAgent(agent),
91
94
codingcontext.WithManifestURL(manifestURL),
92
95
codingcontext.WithUserPrompt(userPrompt),
@@ -107,8 +110,8 @@ func main() {
107
110
os.Exit(1)
108
111
}
109
112
110
-
// Skip writing rules file in resume mode since no rules are collected
111
-
if!resume {
113
+
// Skip writing rules file if bootstrap is disabled since no rules are collected
114
+
if!skipBootstrap {
112
115
relativePath:=result.Agent.UserRulePath()
113
116
ifrelativePath=="" {
114
117
logger.Error("Error", "error", fmt.Errorf("no user rule path available for agent"))
0 commit comments