skills/chatarch-package-dev/SKILL.md
Create or maintain ChatArch/chatxxx Python CLI packages with `chattool pypi init -t chatarch`, integrating external `chatstyle` and `chatenv` correctly.
npx skillsauth add cubenlp/chattool chatarch-package-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when creating or updating a standalone ChatArch / chatxxx Python CLI package.
The package should be independently installable. It is not a ChatTool plugin.
chattool pypi init chatfoo -t chatarch --project-dir ./chatfoo
Equivalent wrapper form:
chatpypi chatfoo -t chatarch --project-dir ./chatfoo
Skip optional docs or workflows only when the package does not need them:
chattool pypi init chatfoo -t chatarch --project-dir ./chatfoo --without-mkdocs --without-workflows
src/<module>/cli.py: Click CLI using ChatStyle-backed input resolution.src/<module>/__init__.py: package version and public package marker.tests/: package tests; add CLI tests as behavior grows.docs/: maintained documentation when mkdocs is enabled.mkdocs.yml: docs build config when mkdocs is enabled..github/workflows/: CI/docs/publish placeholders when workflows are enabled.AGENTS.md: agent-facing repository rules.DEVELOP.md: developer workflow and validation notes.CHANGELOG.md: date-based change record.Standalone ChatArch packages import chatstyle directly. Do not import or copy ChatTool's chattool.interaction adapter.
Use CommandSchema for recoverable missing inputs:
import click
from chatstyle import CommandField, CommandSchema, add_interactive_option, resolve_command_inputs
HELLO_SCHEMA = CommandSchema(
name="hello",
fields=(CommandField("name", prompt="name", required=True),),
)
@click.group()
def cli() -> None:
pass
@cli.command()
@click.argument("name", required=False)
@add_interactive_option
def hello(name: str | None, interactive: bool | None) -> None:
inputs = resolve_command_inputs(
schema=HELLO_SCHEMA,
provided={"name": name},
interactive=interactive,
usage="Usage: chatfoo hello [NAME] [-i|-I]",
)
click.echo(f"Hello, {inputs['name']}!")
Rules:
-i to force the command's interactive flow.-I to disable prompts and fail fast when required inputs are missing.required=True for inputs that can be recovered interactively.chatstyle, not in each business package.Use chatenv for typed env/profile storage. The business package provides only schema providers.
Minimal src/chatfoo/config.py:
from chatenv import BaseEnvConfig, EnvField
class FooConfig(BaseEnvConfig):
_title = "Foo Configuration"
_aliases = ["foo", "chatfoo"]
_storage_dir = "Foo"
FOO_API_BASE = EnvField("FOO_API_BASE", desc="Foo API base URL")
FOO_API_KEY = EnvField("FOO_API_KEY", desc="Foo API key", is_sensitive=True)
Register it in pyproject.toml:
[project.entry-points."chatenv.configs"]
chatfoo = "chatfoo.config"
Validate after installing the package in the active environment:
chatenv list
chatenv init -t foo
chatenv cat -t foo
chatenv paste --stdin --profile work
python -m pytest -q
python -m mkdocs build --strict
chatfoo --help
chatfoo hello ChatArch
chatenv list
chatenv init -t foo
chatenv cat -t foo
chattool.interaction into standalone packages.chatenv hard-code imports for a business package.$chatarch-post-init-dev for ongoing development conventions.tools
Continue development after `chatpypi` or `chattool pypi init -t chatarch` creates a project, keeping chatenv schemas, chatstyle interactive CLI behavior, docs, tests, and changelog aligned.
tools
Create staged previews of Zulip topics using read-only CLI queries, including full-thread originals, a small zh-en translation slice, and a Chinese overview in an external work directory such as ~/tmp/chattool-zulip/<channel>/<topic>. Use when asked to preview, summarize, or translate Zulip thread content.
tools
Aggregate and summarize Zulip community updates via ChatTool CLI. Use for latest Zulip news, stream/topic listing, and periodic summaries from configured streams/topics.
tools
Use `chattool pypi init` or `chatpypi` to scaffold Python packages, including ChatArch templates, then validate with pytest/build/check/probe.