Skip to content

Commit 449a9c5

Browse files
theCodeDriftclaude
andcommitted
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
1 parent d9857e4 commit 449a9c5

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎openspec/specs/cli-rules/spec.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Purpose
44

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.
66

77
## Requirements
88

99
### Requirement: Rules subcommand group exists
1010

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.
1212

1313
The previous plural form `taskless rules <subcommand>` SHALL NOT work in v0.7.0 — there is no compatibility alias.
1414

@@ -82,12 +82,12 @@ The API calls for rule generation (`POST /cli/api/request` and `GET /cli/api/req
8282

8383
### Requirement: Rules create writes rule files to disk
8484

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.)
8686

8787
#### Scenario: Both branches write rule files
8888

8989
- **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
9191

9292
### Requirement: Rules create writes test files to disk
9393

@@ -256,7 +256,7 @@ The generated JSON Schema file SHALL be importable by the CLI bundle via Vite. T
256256

257257
#### Scenario: Schema imported in verify command
258258

259-
- **WHEN** the `rule verify` command needs the ast-grep schema
259+
- **WHEN** the `verify` command needs the ast-grep schema
260260
- **THEN** it SHALL import the schema from `../generated/ast-grep-rule-schema.json`
261261
- **AND** the schema object SHALL be available synchronously at runtime
262262

@@ -266,8 +266,8 @@ When `taskless rule create --anonymous` is invoked, the CLI SHALL execute the lo
266266

267267
1. NOT submit any request to the Taskless API
268268
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/`
271271
5. NOT write a metadata sidecar (the API-backed branch does)
272272
6. Return the same output format as the API-backed branch (paths to created files)
273273

@@ -288,7 +288,7 @@ When `taskless rule improve --anonymous` is invoked, the CLI SHALL execute the l
288288

289289
1. NOT submit any request to the Taskless API iterate endpoint
290290
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
292292
4. Return the same output format as the API-backed branch
293293

294294
#### Scenario: rule improve --anonymous skips API

0 commit comments

Comments
 (0)