From 1bfce9c60d05f8479bb83fe8ee43f7fbaae3edda Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Wed, 13 May 2026 16:50:12 +0200 Subject: [PATCH] docs: add CLI component reuse guidance --- AGENTS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 4a235864..86dde8e9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -187,6 +187,11 @@ normal development workflow is agent-based. - Use `@clack/prompts` for interactive flows. Always handle cancellation with `isCancel` plus `cancel`, stop active spinners before exiting, and keep prompts grouped or factored so multi-step setup flows share cancellation behavior. +- When CLI behavior is shared by the `ktx setup` wizard and other `ktx` + commands, reuse or extract components in `packages/cli/src` instead of + duplicating setup-only logic. Prefer neutral helpers such as `clack.ts`, + `prompt-navigation.ts`, and command-independent prompt adapters over imports + from setup command internals. - Keep command behavior scriptable: prefer flags and config over prompts when values are supplied, and reserve prompts for interactive missing input or explicit setup flows.