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.4metadata:5 source: https://skillmd.com/skills/popra/clifier6---78# Clifier910Generate a reusable website-automation package, not a one-off script. Default to11a Deno CLI plus a runtime-neutral client library. Keep the result concise,12polished, and JSR-ready.1314Bias toward small, sharp, readable software: production-ready, highly usable,15and free of wasted motion.1617Use references progressively. Read only what the current step needs:1819- command surface:20 [references/cli-command-patterns.md](references/cli-command-patterns.md)21- site investigation:22 [references/investigation-workflow.md](references/investigation-workflow.md)23- runtime choice:24 [references/fetch-vs-playwright.md](references/fetch-vs-playwright.md)25- auth/session reuse:26 [references/auth-and-session.md](references/auth-and-session.md)27- docs/output: [references/output-and-docs.md](references/output-and-docs.md)28- JSR packaging: [references/jsr-publishing.md](references/jsr-publishing.md)2930## Workflow31321. Define the CLI first.332. Investigate the site with `playwright-cli`.343. Prove or disprove `fetch`.354. Decide on `fetch`, hybrid, or `playwright-cli`-backed browser automation.365. Generate from `assets/templates/deno-cli/`.376. Validate the happy path and publishability.3839## Define The CLI4041Read [references/cli-command-patterns.md](references/cli-command-patterns.md)42before naming commands.4344- Prefer product nouns, then verbs.45- Use direct top-level verbs only for cross-cutting commands such as `login`.46- Prefer `@cliffy/command` for Deno CLIs.47- Keep the CLI thin: parse flags, call library code, format output, and handle48 Deno-specific filesystem or session work.49- Always include a root `-v, --version` flag.50- Keep the surface small, predictable, and guessable from the product51 vocabulary.52- Make the happy path obvious from `--help`.53- Map meaningful UI controls to flags before finalizing commands.54- Give high-value explicit flags a shorthand alias when it is clear and55 memorable, such as `--session-path`/`-s` and `--out`/`-o`.56- Put global flags before the command path in docs, help examples, and57 agent-facing snippets, such as58 `tool-name --json --session-path ~/.auth/acme@my-tool.json jobs get <job-id>`.59 Keep command-specific flags near the command they configure, such as60 `tool-name --json jobs download <job-id> --out ./downloads`.61- Keep operational commands non-interactive after auth/bootstrap.62- Emit stable IDs from create-style commands and accept them directly in63 follow-up commands.64- Keep only commands that deliver real value. Do not keep `doctor`, `login`, or65 other template-era commands unless the real tool needs them.6667## Investigate6869Read70[references/investigation-workflow.md](references/investigation-workflow.md)71before implementing.7273- Use `playwright-cli` for discovery and for unavoidable browser automation. Do74 not build the generated package around the vanilla Playwright runtime.75- Default to Chrome unless the user or site requires another browser.76- Reproduce one real happy-path run.77- Capture only the requests, identifiers, auth inputs, downloads, and UI78 controls that matter.79- Ask the user for manual login, MFA, sample inputs, or copied cookies or80 headers when needed.81- Clean up temporary investigation artifacts unless they are intentionally82 reused by the generated tool.8384## Choose Runtime8586Read [references/fetch-vs-playwright.md](references/fetch-vs-playwright.md)87before deciding.8889- Prefer `fetch`.90- Use hybrid only when `playwright-cli` is needed for login or bootstrap and the91 saved state can be translated into the exact runtime cookies, headers, tokens,92 CSRF values, or other inputs that `fetch` needs.93- Use `playwright-cli`-backed browser automation only after a serious failed94 attempt to make `fetch` or hybrid work.95- Explain briefly what was investigated, how auth works at runtime, and why the96 chosen runtime is the simplest robust option.97- Validate at least one authenticated `fetch` request before calling a hybrid98 design production-ready.99100## Handle Auth101102Read [references/auth-and-session.md](references/auth-and-session.md) when auth103is required.104105- Prefer explicit flags and environment variables.106- Do not add a general config file by default.107- For browser-login flows, default session storage to108 `~/.auth/<project_namespace>@<project_repo>.json`, resolving `~` through the109 OS home directory. For a JSR name such as `@acme/my-tool`, use110 `~/.auth/acme@my-tool.json`.111- Keep `--session-path, -s <path>` as the explicit override on `login` and later112 authenticated commands.113- When a tool supports multiple auth bootstrap methods, prefer an `auth` noun114 group and validate any automatic cookie discovery against the target site.115- Never assume browser storage state is sufficient for plain `fetch`; prove how116 runtime auth is constructed.117- Keep secrets out of normal output, `--json` output, and repo files.118119## Generate The Tool120121Start from `assets/templates/deno-cli/`.122123- Prefer the simplest clear implementation.124- Keep the package root for the library and export the CLI from `./cli`.125- Keep `mod.ts` as the public library root and `cli.ts` as the Deno CLI126 entrypoint.127- Keep code compact and readable.128- Prefer expressive names and straightforward structure.129- Keep runtime-neutral client code under `lib/`.130- Include `deno compile` tasks for all supported Deno targets.131- Keep compiled binaries under `bin/`.132- Make `compile` the aggregate task that builds every supported target, and add133 one task per target for direct use.134- Include Deno helper task(s) for reading `deno.json.version` and comparing it135 to the previous git ref used by the release workflow.136- Include a GitHub Actions release workflow that watches `deno.json.version`,137 uses the Deno version helper task(s), compiles all targets, creates a GitHub138 Release with the binaries, and publishes to JSR.139- Include `name`, `version`, `exports`, and `deno publish --dry-run` validation.140- Treat `deno.json` as the single source of truth for package and CLI version141 metadata. Do not duplicate the version string in `cli.ts`.142- Avoid indirection unless it earns its keep.143- Make the intent obvious from names, control flow, and file layout.144- Prefer code that is easy to scan over clever or aggressively compressed code.145- Favor direct solutions over ceremony, helper churn, or architecture that only146 serves the template.147- Detect missing mandatory runtime dependencies and print exact install148 instructions when a command needs them.149- Remove template placeholder text, example commands, and unused support files150 from the final generated package.151- Remove scaffolding layers that do not improve usability.152153## Finish154155Read [references/output-and-docs.md](references/output-and-docs.md) while156polishing the result.157158- Deliver concise human output, stable JSON, useful errors, and clear next-step159 affordances.160- Include a root `README.md` and a root `COMMANDS.md`.161- Make `COMMANDS.md` a cheat sheet: short, scan-friendly, and centered on162 copy-pasteable CLI invocations rather than prose.163- Keep command names, help text, docs, and examples aligned.164- When the tool depends on `playwright-cli`, browser binaries, or other165 non-bundled runtime dependencies, validate the missing-dependency path too.166- Validate `--help`, `deno task check`, the happy path, and167 `deno publish --dry-run`.168- Validate a real invocation path users will actually use, not only local task169 wrappers.