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
{{ message }}
Repository navigation
Commit 449a9c5
Browse filesBrowse the repository at this point in the historyBrowse files
docs(openspec): align cli-rules with the rule-directory layout
Two self-contradictions the strict-validation pass left behind.
The create requirements still wrote rules to the flat
`.taskless/rules/<id>.yml` and tests to `.taskless/rule-tests/<id>.yml`,
while delete had already been repathed to the rule directory. `files.ts`
agrees with delete, so create was the stale one.
The new "`taskless rule verify` SHALL NOT exist" requirement was
contradicted three lines up, where the surface list still advertised it,
and again where two scenarios named it as a live command.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jwc9FFroR3mTZ4hLiSkkX3
Copy file name to clipboardExpand all lines: openspec/specs/cli-rules/spec.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
3
3
## Purpose
4
4
5
-
Defines the `rules` subcommand group for the Taskless CLI, including `create`, `improve`, `delete`, and `verify` subcommands for managing ast-grep rules. Also documents the server-side API contract for rule generation endpoints.
5
+
Defines the `rules` subcommand group for the Taskless CLI, including `create`, `improve`, `delete`, and `meta` subcommands for managing ast-grep rules. Also documents the server-side API contract for rule generation endpoints.
6
6
7
7
## Requirements
8
8
9
9
### Requirement: Rules subcommand group exists
10
10
11
-
The CLI SHALL expose the rule operations under the `rule` (singular) subcommand group. The user-facing surface SHALL be `taskless rule create`, `taskless rule improve`, `taskless rule delete`, `taskless rule verify`, and `taskless rule meta`. The internal source filename (`packages/cli/src/commands/rules.ts`) MAY remain plural — only the user-visible subcommand name changes.
11
+
The CLI SHALL expose the rule operations under the `rule` (singular) subcommand group. The user-facing surface SHALL be `taskless rule create`, `taskless rule improve`, `taskless rule delete`, and `taskless rule meta`. Rule validation is not part of this group — it is addressed by path through the top-level `verify` and `test` commands, specified by the `cli-rule-validation` capability. The internal source filename (`packages/cli/src/commands/rules.ts`) MAY remain plural — only the user-visible subcommand name changes.
12
12
13
13
The previous plural form `taskless rules <subcommand>` SHALL NOT work in v0.7.0 — there is no compatibility alias.
14
14
@@ -82,12 +82,12 @@ The API calls for rule generation (`POST /cli/api/request` and `GET /cli/api/req
82
82
83
83
### Requirement: Rules create writes rule files to disk
84
84
85
-
`taskless rule create` SHALL write the generated rule file to `.taskless/rules/<id>.yml` regardless of whether `--anonymous` was set. The agent invoking the command SHALL NOT be expected to write rule files itself. (Renamed to singular; this strengthens the existing requirement to apply to both branches.)
85
+
`taskless rule create` SHALL write the generated rule file into the rule's own directory, at `.taskless/rules/sg/<id>/<id>.yml`, regardless of whether `--anonymous` was set. The agent invoking the command SHALL NOT be expected to write rule files itself. (Renamed to singular; this strengthens the existing requirement to apply to both branches.)
86
86
87
87
#### Scenario: Both branches write rule files
88
88
89
89
-**WHEN**`taskless rule create` succeeds (with or without `--anonymous`)
90
-
-**THEN**`.taskless/rules/<id>.yml` SHALL exist on disk
90
+
-**THEN**`.taskless/rules/sg/<id>/<id>.yml` SHALL exist on disk
91
91
92
92
### Requirement: Rules create writes test files to disk
93
93
@@ -256,7 +256,7 @@ The generated JSON Schema file SHALL be importable by the CLI bundle via Vite. T
256
256
257
257
#### Scenario: Schema imported in verify command
258
258
259
-
-**WHEN** the `rule verify` command needs the ast-grep schema
259
+
-**WHEN** the `verify` command needs the ast-grep schema
260
260
-**THEN** it SHALL import the schema from `../generated/ast-grep-rule-schema.json`
261
261
-**AND** the schema object SHALL be available synchronously at runtime
262
262
@@ -266,8 +266,8 @@ When `taskless rule create --anonymous` is invoked, the CLI SHALL execute the lo
266
266
267
267
1. NOT submit any request to the Taskless API
268
268
2. Generate the ast-grep rule using local logic (Claude SDK, agent-driven generation, or whatever the migrated implementation prefers — see design.md)
269
-
3. Write the rule file to `.taskless/rules/<id>.yml`
270
-
4. Write any generated test files to `.taskless/rule-tests/<id>.yml`
269
+
3. Write the rule file to `.taskless/rules/sg/<id>/<id>.yml`
270
+
4. Write any generated test files into that rule's own directory, under `.taskless/rules/sg/<id>/.tests/`
271
271
5. NOT write a metadata sidecar (the API-backed branch does)
272
272
6. Return the same output format as the API-backed branch (paths to created files)
273
273
@@ -288,7 +288,7 @@ When `taskless rule improve --anonymous` is invoked, the CLI SHALL execute the l
288
288
289
289
1. NOT submit any request to the Taskless API iterate endpoint
290
290
2. Update the rule file in place using local logic
291
-
3. Support the verify feedback loop by exposing the `rule verify` primitive that the agent invokes between edits
291
+
3. Support the verify feedback loop by exposing the top-level `verify` primitive that the agent invokes between edits
292
292
4. Return the same output format as the API-backed branch
0 commit comments