Skip to content

docs(openspec): export knowledge prompts as @taskless/cli/prompts - #70

Draft
thecodedrift wants to merge 6 commits into
mainfrom
openspec/export-knowledge-prompts
Draft

docs(openspec): export knowledge prompts as @taskless/cli/prompts#70
thecodedrift wants to merge 6 commits into
mainfrom
openspec/export-knowledge-prompts

Conversation

@thecodedrift

@thecodedrift thecodedrift commented Jul 28, 2026

Copy link
Copy Markdown
Member

Draft — not ready for review. Spec only; no implementation yet. Opened to keep the work on the remote.

Exposes the CLI's help/*.txt knowledge recipes as an importable @taskless/cli/prompts, so the generator can source routing guidance from the same text the CLI serves rather than a local copy that drifts.

Prompts are functions returning fully-rendered text, not raw strings. Every %(KEY)s resolves inside the package — CLI_VERSION from the build version, INPUT_SCHEMA from the Zod source, PACKAGE_MANAGER_DLX as an agent-fill marker — so no consumer handles a template dialect. PromptOptions carries anonymous, packageManagerDlx, and header; header: false drops the version-bearing first line, which would otherwise sit in an LLM consumer's prompt-cache key and be invalidated by every CLI publish. The help command shares both the embedded source and the render path, so the two surfaces cannot diverge.

TOPICS ships with static only. route, remote, detect, existing, and rule-meta are recorded as internal — each verified unreachable server-side, since route picks a pre-service authoring destination, remote.txt states the service owns rule-type selection, and detect documents a subprocess. Topic names are semver-tracked public API, so exporting one speculatively spends that promise for nothing. A completeness check fails CI when a recipe file is neither exported nor explicitly internal.

stack: openspec-archived will be red until the change is implemented and archived. That is expected: archiving now would delete the spec before anything is built against it.

Where this sits

Each change is independently landable: one OpenSpec change, one PR, archived on merge. The archive gate requires it — a tip PR must leave openspec/changes/ empty — so nothing here is stacked and none of these depend on a shared branch.

PR Change Prerequisites
#70 (this PR) knowledge prompt export none
#72 Vale binary packages none
#73 partition rules by engine none
#71 Vale engine + engine-selection topic #73 (executes the vale/ directory it scaffolds) and #72 (needs a binary to resolve)

Only #71 has prerequisites. The other three can land in any order.

#70 and #71 are coupled by exactly one line: whichever lands second adds the engine-selection topic to TOPICS. Ordering between them doesn't matter.

Downstream, the generator's decision router (TSKL-279) needs a published release containing #70 and #71. It consumes a normal release — no prerelease, no path dependency — so it waits without blocking anything here.

Fixes OSS-20

thecodedrift and others added 6 commits July 29, 2026 12:02
…rompts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LdEhGzeQfSGJM3nKKNj7Bp
Prompts become render functions returning fully-rendered text rather
than raw placeholder-bearing strings — every %(KEY)s resolves inside
the package, and rendering carries applyCliInvocation so the export
cannot diverge from `taskless help` under non-prod builds.

Confirms @taskless/cli/prompts as the published subpath, and adds a
completeness check requirement so topic membership stays an explicit
list that a new or deleted recipe file cannot silently change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
The cloud consumer established that only `static` is reachable
server-side: `route` decides a pre-service authoring destination,
`remote` states the service owns rule-type selection, and `detect` /
`existing` / `rule-meta` are local-only. TOPICS ships minimal and the
rest stay internal, since an exported name is a promise held for a
major. Recorded as D6, correcting an earlier six-topic assumption this
design had read off the consumer's draft rather than the recipes.

Adds PromptOptions.header (default true) so a consumer can drop the
version-bearing header line, which would otherwise sit in an LLM
prompt-cache key and be invalidated by every CLI publish.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
The consumer retracted its prerelease request, preferring to wait for
a stable version over pinning a moving one against an API that isn't
semver-stable yet. Nothing downstream now waits on this change, so it
releases at whatever cadence suits this repo.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
Two units, each independently safe: a pure refactor that must leave
help output byte-identical, then the new export surface nothing
depends on yet. Splitting them keeps the risky part — touching a
shipped command — reviewed apart from the new public API.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
@thecodedrift
thecodedrift force-pushed the openspec/export-knowledge-prompts branch from dbbd881 to 27116b9 Compare July 29, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changeset PR intentionally ships no release note (bypasses the changeset requirement)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant