Clifier
Generate a reusable website-automation package, not a one-off script. Default to
a Deno CLI plus a runtime-neutral client library. Keep the result concise,
polished, and JSR-ready.
Bias toward small, sharp, readable software: production-ready, highly usable,
and free of wasted motion.
Use references progressively. Read only what the current step needs:
- command surface:
references/cli-command-patterns.md
- site investigation:
references/investigation-workflow.md
- runtime choice:
references/fetch-vs-playwright.md
- auth/session reuse:
references/auth-and-session.md
- docs/output: references/output-and-docs.md
- JSR packaging: references/jsr-publishing.md
Workflow
- Define the CLI first.
- Investigate the site with
playwright-cli.
- Prove or disprove
fetch.
- Decide on
fetch, hybrid, or playwright-cli-backed browser automation.
- Generate from
assets/templates/deno-cli/.
- Validate the happy path and publishability.
Define The CLI
Read references/cli-command-patterns.md
before naming commands.
- Prefer product nouns, then verbs.
- Use direct top-level verbs only for cross-cutting commands such as
login.
- Prefer
@cliffy/command for Deno CLIs.
- Keep the CLI thin: parse flags, call library code, format output, and handle
Deno-specific filesystem or session work.
- Always include a root
-v, --version flag.
- Keep the surface small, predictable, and guessable from the product
vocabulary.
- Make the happy path obvious from
--help.
- Map meaningful UI controls to flags before finalizing commands.
- Give high-value explicit flags a shorthand alias when it is clear and
memorable, such as
--session-path/-s and --out/-o.
- Put global flags before the command path in docs, help examples, and
agent-facing snippets, such as
tool-name --json --session-path ~/.auth/acme@my-tool.json jobs get <job-id>.
Keep command-specific flags near the command they configure, such as
tool-name --json jobs download <job-id> --out ./downloads.
- Keep operational commands non-interactive after auth/bootstrap.
- Emit stable IDs from create-style commands and accept them directly in
follow-up commands.
- Keep only commands that deliver real value. Do not keep
doctor, login, or
other template-era commands unless the real tool needs them.
Investigate
Read
references/investigation-workflow.md
before implementing.
- Use
playwright-cli for discovery and for unavoidable browser automation. Do
not build the generated package around the vanilla Playwright runtime.
- Default to Chrome unless the user or site requires another browser.
- Reproduce one real happy-path run.
- Capture only the requests, identifiers, auth inputs, downloads, and UI
controls that matter.
- Ask the user for manual login, MFA, sample inputs, or copied cookies or
headers when needed.
- Clean up temporary investigation artifacts unless they are intentionally
reused by the generated tool.
Choose Runtime
Read references/fetch-vs-playwright.md
before deciding.
- Prefer
fetch.
- Use hybrid only when
playwright-cli is needed for login or bootstrap and the
saved state can be translated into the exact runtime cookies, headers, tokens,
CSRF values, or other inputs that fetch needs.
- Use
playwright-cli-backed browser automation only after a serious failed
attempt to make fetch or hybrid work.
- Explain briefly what was investigated, how auth works at runtime, and why the
chosen runtime is the simplest robust option.
- Validate at least one authenticated
fetch request before calling a hybrid
design production-ready.
Handle Auth
Read references/auth-and-session.md when auth
is required.
- Prefer explicit flags and environment variables.
- Do not add a general config file by default.
- For browser-login flows, default session storage to
~/.auth/<project_namespace>@<project_repo>.json, resolving ~ through the
OS home directory. For a JSR name such as @acme/my-tool, use
~/.auth/acme@my-tool.json.
- Keep
--session-path, -s <path> as the explicit override on login and later
authenticated commands.
- When a tool supports multiple auth bootstrap methods, prefer an
auth noun
group and validate any automatic cookie discovery against the target site.
- Never assume browser storage state is sufficient for plain
fetch; prove how
runtime auth is constructed.
- Keep secrets out of normal output,
--json output, and repo files.
Generate The Tool
Start from assets/templates/deno-cli/.
- Prefer the simplest clear implementation.
- Keep the package root for the library and export the CLI from
./cli.
- Keep
mod.ts as the public library root and cli.ts as the Deno CLI
entrypoint.
- Keep code compact and readable.
- Prefer expressive names and straightforward structure.
- Keep runtime-neutral client code under
lib/.
- Include
deno compile tasks for all supported Deno targets.
- Keep compiled binaries under
bin/.
- Make
compile the aggregate task that builds every supported target, and add
one task per target for direct use.
- Include Deno helper task(s) for reading
deno.json.version and comparing it
to the previous git ref used by the release workflow.
- Include a GitHub Actions release workflow that watches
deno.json.version,
uses the Deno version helper task(s), compiles all targets, creates a GitHub
Release with the binaries, and publishes to JSR.
- Include
name, version, exports, and deno publish --dry-run validation.
- Treat
deno.json as the single source of truth for package and CLI version
metadata. Do not duplicate the version string in cli.ts.
- Avoid indirection unless it earns its keep.
- Make the intent obvious from names, control flow, and file layout.
- Prefer code that is easy to scan over clever or aggressively compressed code.
- Favor direct solutions over ceremony, helper churn, or architecture that only
serves the template.
- Detect missing mandatory runtime dependencies and print exact install
instructions when a command needs them.
- Remove template placeholder text, example commands, and unused support files
from the final generated package.
- Remove scaffolding layers that do not improve usability.
Finish
Read references/output-and-docs.md while
polishing the result.
- Deliver concise human output, stable JSON, useful errors, and clear next-step
affordances.
- Include a root
README.md and a root COMMANDS.md.
- Make
COMMANDS.md a cheat sheet: short, scan-friendly, and centered on
copy-pasteable CLI invocations rather than prose.
- Keep command names, help text, docs, and examples aligned.
- When the tool depends on
playwright-cli, browser binaries, or other
non-bundled runtime dependencies, validate the missing-dependency path too.
- Validate
--help, deno task check, the happy path, and
deno publish --dry-run.
- Validate a real invocation path users will actually use, not only local task
wrappers.
1---2name: clifier3description: Create production-ready website-automation CLI packages in TypeScript for Deno, including a CLI plus companion client library, for repeatable website workflows such as scraping, form submission, downloads, login/bootstrap flows, session reuse, stable JSON output, and optional `deno compile` packaging. Use when the Agent needs to turn a website task into a reusable tool.4---56# Clifier78Generate a reusable website-automation package, not a one-off script. Default to9a Deno CLI plus a runtime-neutral client library. Keep the result concise,10polished, and JSR-ready.1112Bias toward small, sharp, readable software: production-ready, highly usable,13and free of wasted motion.1415Use references progressively. Read only what the current step needs:1617- command surface:18 [references/cli-command-patterns.md](references/cli-command-patterns.md)19- site investigation:20 [references/investigation-workflow.md](references/investigation-workflow.md)21- runtime choice:22 [references/fetch-vs-playwright.md](references/fetch-vs-playwright.md)23- auth/session reuse:24 [references/auth-and-session.md](references/auth-and-session.md)25- docs/output: [references/output-and-docs.md](references/output-and-docs.md)26- JSR packaging: [references/jsr-publishing.md](references/jsr-publishing.md)2728## Workflow29301. Define the CLI first.312. Investigate the site with `playwright-cli`.323. Prove or disprove `fetch`.334. Decide on `fetch`, hybrid, or `playwright-cli`-backed browser automation.345. Generate from `assets/templates/deno-cli/`.356. Validate the happy path and publishability.3637## Define The CLI3839Read [references/cli-command-patterns.md](references/cli-command-patterns.md)40before naming commands.4142- Prefer product nouns, then verbs.43- Use direct top-level verbs only for cross-cutting commands such as `login`.44- Prefer `@cliffy/command` for Deno CLIs.45- Keep the CLI thin: parse flags, call library code, format output, and handle46 Deno-specific filesystem or session work.47- Always include a root `-v, --version` flag.48- Keep the surface small, predictable, and guessable from the product49 vocabulary.50- Make the happy path obvious from `--help`.51- Map meaningful UI controls to flags before finalizing commands.52- Give high-value explicit flags a shorthand alias when it is clear and53 memorable, such as `--session-path`/`-s` and `--out`/`-o`.54- Put global flags before the command path in docs, help examples, and55 agent-facing snippets, such as56 `tool-name --json --session-path ~/.auth/acme@my-tool.json jobs get <job-id>`.57 Keep command-specific flags near the command they configure, such as58 `tool-name --json jobs download <job-id> --out ./downloads`.59- Keep operational commands non-interactive after auth/bootstrap.60- Emit stable IDs from create-style commands and accept them directly in61 follow-up commands.62- Keep only commands that deliver real value. Do not keep `doctor`, `login`, or63 other template-era commands unless the real tool needs them.6465## Investigate6667Read68[references/investigation-workflow.md](references/investigation-workflow.md)69before implementing.7071- Use `playwright-cli` for discovery and for unavoidable browser automation. Do72 not build the generated package around the vanilla Playwright runtime.73- Default to Chrome unless the user or site requires another browser.74- Reproduce one real happy-path run.75- Capture only the requests, identifiers, auth inputs, downloads, and UI76 controls that matter.77- Ask the user for manual login, MFA, sample inputs, or copied cookies or78 headers when needed.79- Clean up temporary investigation artifacts unless they are intentionally80 reused by the generated tool.8182## Choose Runtime8384Read [references/fetch-vs-playwright.md](references/fetch-vs-playwright.md)85before deciding.8687- Prefer `fetch`.88- Use hybrid only when `playwright-cli` is needed for login or bootstrap and the89 saved state can be translated into the exact runtime cookies, headers, tokens,90 CSRF values, or other inputs that `fetch` needs.91- Use `playwright-cli`-backed browser automation only after a serious failed92 attempt to make `fetch` or hybrid work.93- Explain briefly what was investigated, how auth works at runtime, and why the94 chosen runtime is the simplest robust option.95- Validate at least one authenticated `fetch` request before calling a hybrid96 design production-ready.9798## Handle Auth99100Read [references/auth-and-session.md](references/auth-and-session.md) when auth101is required.102103- Prefer explicit flags and environment variables.104- Do not add a general config file by default.105- For browser-login flows, default session storage to106 `~/.auth/<project_namespace>@<project_repo>.json`, resolving `~` through the107 OS home directory. For a JSR name such as `@acme/my-tool`, use108 `~/.auth/acme@my-tool.json`.109- Keep `--session-path, -s <path>` as the explicit override on `login` and later110 authenticated commands.111- When a tool supports multiple auth bootstrap methods, prefer an `auth` noun112 group and validate any automatic cookie discovery against the target site.113- Never assume browser storage state is sufficient for plain `fetch`; prove how114 runtime auth is constructed.115- Keep secrets out of normal output, `--json` output, and repo files.116117## Generate The Tool118119Start from `assets/templates/deno-cli/`.120121- Prefer the simplest clear implementation.122- Keep the package root for the library and export the CLI from `./cli`.123- Keep `mod.ts` as the public library root and `cli.ts` as the Deno CLI124 entrypoint.125- Keep code compact and readable.126- Prefer expressive names and straightforward structure.127- Keep runtime-neutral client code under `lib/`.128- Include `deno compile` tasks for all supported Deno targets.129- Keep compiled binaries under `bin/`.130- Make `compile` the aggregate task that builds every supported target, and add131 one task per target for direct use.132- Include Deno helper task(s) for reading `deno.json.version` and comparing it133 to the previous git ref used by the release workflow.134- Include a GitHub Actions release workflow that watches `deno.json.version`,135 uses the Deno version helper task(s), compiles all targets, creates a GitHub136 Release with the binaries, and publishes to JSR.137- Include `name`, `version`, `exports`, and `deno publish --dry-run` validation.138- Treat `deno.json` as the single source of truth for package and CLI version139 metadata. Do not duplicate the version string in `cli.ts`.140- Avoid indirection unless it earns its keep.141- Make the intent obvious from names, control flow, and file layout.142- Prefer code that is easy to scan over clever or aggressively compressed code.143- Favor direct solutions over ceremony, helper churn, or architecture that only144 serves the template.145- Detect missing mandatory runtime dependencies and print exact install146 instructions when a command needs them.147- Remove template placeholder text, example commands, and unused support files148 from the final generated package.149- Remove scaffolding layers that do not improve usability.150151## Finish152153Read [references/output-and-docs.md](references/output-and-docs.md) while154polishing the result.155156- Deliver concise human output, stable JSON, useful errors, and clear next-step157 affordances.158- Include a root `README.md` and a root `COMMANDS.md`.159- Make `COMMANDS.md` a cheat sheet: short, scan-friendly, and centered on160 copy-pasteable CLI invocations rather than prose.161- Keep command names, help text, docs, and examples aligned.162- When the tool depends on `playwright-cli`, browser binaries, or other163 non-bundled runtime dependencies, validate the missing-dependency path too.164- Validate `--help`, `deno task check`, the happy path, and165 `deno publish --dry-run`.166- Validate a real invocation path users will actually use, not only local task167 wrappers.