Skip to content

feat(cli): Add route/existing/static/remote authoring recipes - #25

Merged
thecodedrift merged 23 commits into
feat/local-rule-detectfrom
feat/local-rule-recipes
Jun 15, 2026
Merged

feat(cli): Add route/existing/static/remote authoring recipes#25
thecodedrift merged 23 commits into
feat/local-rule-detectfrom
feat/local-rule-recipes

Conversation

@thecodedrift

@thecodedrift thecodedrift commented Jun 11, 2026

Copy link
Copy Markdown
Member

Add the four routing recipes that the Taskless skill fetches as the rule-authoring front door. They are plain .txt recipes auto-embedded via the existing import.meta.glob step and resolve through taskless help <topic>.

  • route carries the confidence-gated contract: run detect, write the rationale before naming a destination, commit to a local path on reasonable confidence, ask the user when multiple paths fit (noting that remote costs a generation + login), and treat try-verify-escalate as a failure fallback that prompts-and-confirms before calling the service — never a silent fall-through.
  • existing authors a rule in a linter the repo already uses, in that tool's dialect, sourcing knowledge from the repo first and the web second. Author-only: the user's own toolchain runs it; taskless check does not execute external linters.
  • static authors a verified local ast-grep rule in the canonical on-disk shape (so check/improve/verify treat it identically to service output), and cleans up an abandoned candidate when escalating.
  • remote collects inputs, requires auth, and delegates to the existing rule create backend — the service decides static vs runtime; the recipe never makes that call locally.

route only decides local-vs-remote; static-vs-runtime stays with the service (owned upstream by the Runtime Rules project).

Stacked on #24. Help-index registration + telemetry for these topics lands in the next PR.

Refs TSKL Runtime Rules


Stack generated by Git Town

Add the four routing recipes the skill fetches as the rule-authoring
front door. `route` runs detect, requires the agent to write its
rationale before naming a destination, commits local on reasonable
confidence, asks when multiple paths fit, and treats try-verify-escalate
as a failure fallback that prompts-and-confirms before spending a
generation. `existing` authors in a detected linter's dialect (repo-first
knowledge, web fallback, author-only). `static` authors a verified local
ast-grep rule in the canonical on-disk shape, cleaning up an abandoned
candidate on escalation. `remote` collects inputs and delegates to the
rule create backend, letting the service decide static vs runtime.

Recipes are auto-embedded via the existing import.meta.glob step and all
four resolve through `taskless help <topic>`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds four new embedded CLI help recipes (route, existing, static, remote) to serve as the “rule authoring front door” for Taskless, documenting the local-first routing and authoring flows and how to escalate to the service-backed generation path.

Changes:

  • Added new help topics: route, existing, static, and remote under packages/cli/src/help/.
  • Documented routing rationale + confirmation-gated escalation behavior in route.
  • Updated the openspec change checklist to mark the routing recipe tasks as completed.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/cli/src/help/static.txt New local ast-grep authoring recipe with verify loop and escalation guidance
packages/cli/src/help/route.txt New routing recipe describing detect-driven rationale and destination selection
packages/cli/src/help/remote.txt New service-backed generation recipe delegating to rule create
packages/cli/src/help/existing.txt New recipe for authoring rules in an already-configured repo linter
openspec/changes/local-rule-routing/tasks.md Marks the routing recipe tasks as completed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cli/src/help/static.txt Outdated
Comment thread packages/cli/src/help/remote.txt Outdated
Comment thread packages/cli/src/help/remote.txt Outdated
Comment thread packages/cli/src/help/remote.txt Outdated
List route/existing/static/remote under an "Authoring recipes" section
of the `taskless help` no-arg index so an agent can discover the
rule-authoring front door. The existing help command already emits
help_<topic> intent telemetry generically, so the routing topics inherit
it. Add integration tests for index listing and topic resolution, plus
an in-process test asserting help_route/existing/static/remote capture.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thecodedrift
thecodedrift marked this pull request as ready for review June 11, 2026 23:48
thecodedrift and others added 7 commits June 11, 2026 17:12
Add a JSON example of `detect --json` output to the route recipe's scan
step, so the agent sees the shape it consumes (linters, languages,
frameworks, ruleStyles) — parity with how info/check recipes show their
--json output. Addresses review feedback on the routing layer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tighten route.txt step 3 to match the cli-rule-routing spec: choosing
`remote` requires a positive belief the request cannot be solved locally
(cross-file/semantic), not mere lack of confidence. Genuine uncertainty
routes to a clarifying question, never to a generation-spending remote.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat/local-rule-detect:
  docs(openspec): Clarify detect output schema is internal, not published
  docs(openspec): Address review feedback on local-rule-routing contract
* feat/local-rule-recipes:
  docs(cli): Align route recipe with the three-state contract
  docs(cli): Show detect output shape in the route recipe
  docs(openspec): Clarify detect output schema is internal, not published
  docs(openspec): Address review feedback on local-rule-routing contract
PR #25 review:
- remote.txt: stop advertising runtime rules / check.ts as current
  behavior, since runtime-rule support isn't shipped end-to-end yet.
  Reframe the recipe around gathering inputs and delegating to
  `rule create`; the service owns rule-type selection and today writes
  ast-grep rules under .taskless/rules/.
- static.txt: instruct writing the matching `id` field in the test file
  (alongside valid/invalid), as rule create --anonymous and the CLI's
  test-file writer do and ast-grep test filtering expects.
- route.txt: update the detect output example to the renamed `evidence`
  field (follows the detect rename on PR #24).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat/local-rule-detect:
  fix(cli): Harden detect against malformed manifests and false positives
* feat/local-rule-recipes:
  docs(cli): Address review on routing recipes
  fix(cli): Harden detect against malformed manifests and false positives
* feat/local-rule-detect:
  ci(openspec): Skip the archive check on non-tip stacked PRs (#31)
  docs(openspec): Clarify detect output schema is internal, not published
  docs(openspec): Address review feedback on local-rule-routing contract
  docs(openspec): Propose local-rule-routing change
  chore(skill): Refine the stacked-PR archive-check guidance
  chore(skill): Scope iterate-pr archive check to the stack tip
  chore(config): Allow git-town in project settings
* feat/local-rule-recipes:
  ci(openspec): Skip the archive check on non-tip stacked PRs (#31)
  docs(openspec): Clarify detect output schema is internal, not published
  docs(openspec): Address review feedback on local-rule-routing contract
  docs(openspec): Propose local-rule-routing change
  chore(skill): Refine the stacked-PR archive-check guidance
  chore(skill): Scope iterate-pr archive check to the stack tip
  chore(config): Allow git-town in project settings

@thecodedrift thecodedrift left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. This is a docs-only change and the help files are simply documentation work

thecodedrift and others added 9 commits June 13, 2026 20:29
* feat/local-rule-detect:
  feat(cli): Make detect monorepo-aware; languages → linters; drop frameworks
* feat/local-rule-recipes:
  feat(cli): Make detect monorepo-aware; languages → linters; drop frameworks
Drop the frameworks field from the detect output example and note the scan
is monorepo-aware (evidence can carry a sub-package path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat/local-rule-recipes:
  docs(cli): Update route recipe detect example for the new shape
* feat/local-rule-detect:
  feat(cli): Add linters for already-detected Go, Rust, and PHP
* feat/local-rule-recipes:
  feat(cli): Add linters for already-detected Go, Rust, and PHP
* feat/local-rule-detect: (21 commits)
  refactor(cli): Uppercase the acronym in CLIConfig
  refactor(cli): Uppercase the acronym in CLIErrorEnvelope too
  fix(cli): Carry the CLIErrorCode rename into auth.ts
  docs(openspec): Uppercase CLIError/CLIErrorCode in the change contract
  docs(openspec): Uppercase CLIError/CLIErrorCode in the analytics spec
  refactor(cli): Uppercase the CLI acronym in CliError/CliErrorCode
  docs(openspec): Sync corrected check/help spec into the archived capability
  fix(cli): Resolve cli_run identity at invocation start, not end
  test(cli): Prove help_* removal once via a source scan, not per-test
  test(cli): Assert no legacy help_* event on served-topic and index paths
  refactor(cli): Single-pass check counts; robust cli_installed assertion
  fix(cli): Only emit cli_rule_created/improved when rules are written
  fix(cli): Resolve cli_run identity fresh; tighten cli_error + drop cli_version
  docs(openspec): Address review on the telemetry contract
  ci(openspec): Skip the archive check on non-tip stacked PRs
  chore(openspec): Archive restructure-cli-telemetry and sync specs
  feat(cli): Collapse help_* into cli_help { topic }; drop cli_info
  feat(cli): Concrete auth + lifecycle events; drop start/_completed pairs
  feat(cli): Emit concrete rule events; drop rule start/_completed pairs
  feat(cli): Emit cli_run once per invocation from the runner
  ...
* feat/local-rule-recipes: (21 commits)
  refactor(cli): Uppercase the acronym in CLIConfig
  refactor(cli): Uppercase the acronym in CLIErrorEnvelope too
  fix(cli): Carry the CLIErrorCode rename into auth.ts
  docs(openspec): Uppercase CLIError/CLIErrorCode in the change contract
  docs(openspec): Uppercase CLIError/CLIErrorCode in the analytics spec
  refactor(cli): Uppercase the CLI acronym in CliError/CliErrorCode
  docs(openspec): Sync corrected check/help spec into the archived capability
  fix(cli): Resolve cli_run identity at invocation start, not end
  test(cli): Prove help_* removal once via a source scan, not per-test
  test(cli): Assert no legacy help_* event on served-topic and index paths
  refactor(cli): Single-pass check counts; robust cli_installed assertion
  fix(cli): Only emit cli_rule_created/improved when rules are written
  fix(cli): Resolve cli_run identity fresh; tighten cli_error + drop cli_version
  docs(openspec): Address review on the telemetry contract
  ci(openspec): Skip the archive check on non-tip stacked PRs
  chore(openspec): Archive restructure-cli-telemetry and sync specs
  feat(cli): Collapse help_* into cli_help { topic }; drop cli_info
  feat(cli): Concrete auth + lifecycle events; drop start/_completed pairs
  feat(cli): Emit concrete rule events; drop rule start/_completed pairs
  feat(cli): Emit cli_run once per invocation from the runner
  ...
help.ts now emits cli_help { topic } instead of per-topic help_<topic> (the
taxonomy on main). Update the routing-topic assertions to match so this branch
is green/consistent with the tip's #39 resolution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat/local-rule-detect:
  chore(cli): Drop cli_detect on the detect branch (telemetry taxonomy)
* feat/local-rule-recipes:
  chore(cli): Drop cli_detect on the detect branch (telemetry taxonomy)
feat(cli): Surface routing recipes in the help index
@thecodedrift
thecodedrift merged commit 4358c80 into feat/local-rule-detect Jun 15, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants