[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DE44MGDN4JBT4P68AC19PP":3,"skill-same:01M7DE44MGDN4JBT4P68AC19PP":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":13,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":28,"ownerDescription":31,"updatedAt":32,"install":33,"resources":45},"01M7DE44MGDN4JBT4P68AC19PP","cli-shell",null,"How choliba's command line is built — the composition root in main.ts, the shell's container and command table, one ShellModule per package, ShellIo for arguments and exit codes, and how to add a command or an agent provider and test it with runShell. Use when creating or changing a command, a service, a shell module or an agent provider, or when asked where that code goes.","choliba\u002Fcholiba","choliba","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F338821208?v=4","01M7DE3KHNAJBVRZJ3HVHWYRY0","01M7DE3KJQKW94AMEY9HE4N03T",0,"MIT","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fcli-shell\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cli-shell\ndescription: How choliba's command line is built — the composition root in main.ts, the shell's container and command table, one ShellModule per package, ShellIo for arguments and exit codes, and how to add a command or an agent provider and test it with runShell. Use when creating or changing a command, a service, a shell module or an agent provider, or when asked where that code goes.\nargument-hint: 'What you are building (command, service, provider...) and in which package.'\nuser-invocable: true\ndisable-model-invocation: false\n---\n\n# The shell\n\n`packages\u002Fcholiba\u002Fsrc\u002Fmain.ts` is the composition root. It reads the process and Bun into a `Platform` and a\n`Runtime`, strips the global flags, and runs `createCholibaShell(platform, runtime).run()`. There is no HTTP and\nno decorator. The workspace stays `packages\u002F*`: each package exports one `ShellModule`, and the app lists them.\n\nNames, layers and which folder is a module: the `code-standard` skill. What the user sees (flags, stdout, exit\ncodes, pt-BR): `cli-guidelines`.\n\n## Where code goes\n\n- **One feature per folder.** `\u003Cfeature>.service.ts` (a plain class), one `\u003Caction>.command.ts` per command (its\n  pt-BR `CommandEntry` inside it), `dto\u002F\u003Caction>.dto.ts` (a class with a constructor, never `field!`),\n  `interfaces\u002F*.interface.ts`, `\u003Cfeature>.constants.ts` (tokens from `token\u003CT>()`). The domain logic stays in\n  plain functions; the service calls them. The package's `\u003Cfeature>-shell.ts` registers the factories and lists\n  the commands.\n- **One entry per package.** `@choliba\u002F\u003Cpkg>` (`src\u002Findex.ts`) exports the functions, the types, the tokens and\n  the `ShellModule`. The Playwright runner loads that entry with its own Babel, which rejects a parameter\n  decorator, so the barrel has none. The runner's typecheck also has no Bun types: a function that wraps\n  `Bun.spawn` takes a structural type, and the real `Bun.spawn` is read only in `main.ts`.\n- **Another package is reached only through `.`.** Never through a folder, and a package never imports its own\n  entry from inside. A folder is reached only through its `index.ts`.\n\n## What every command uses (`@choliba\u002Fshell` and `@choliba\u002Fkernel`)\n\n- **`PLATFORM`** (`@choliba\u002Fkernel`): the process, registered by `createShell` from what `main.ts` built (argv already without\n  `--no-color`, cwd, env, stdout, stderr, clock, signals, spawn, which, git). Only `main.ts` reads Bun and\n  `process`. Jest runs on Node, so nothing else may.\n- **`CONFIG`** and **`THEME`** (`@choliba\u002Fshell`): a `ConfigService` and a `ThemeService`, registered by `baseShell` from\n  `PLATFORM`. Another package's factory asks for them with `container.get(CONFIG)`.\n- **`RUNTIME`**: the app's own token (`packages\u002Fcholiba`), registered by `cholibaShell`. It is how `check`,\n  `lint`, `format` and `setup` run ESLint, Prettier and the deferred setup step.\n- **`ShellIo`**: the arguments as typed (`io.args('projects', 'list')`), stdout (`write`, `printHelp`), stderr\n  (`fail`, `usageError`) and the exit code (`exit`). A command reads its own words; it does not reparse the\n  global flags, which `main.ts` already removed.\n- **`ShellCommand`**: `name` (the first word), optional `aliases`, `help(container)` (the root entries, omitted\n  when the command stays out of `--help`) and `run(container, io)`. With `verb` (`run`, `new`, `list`), `name` is\n  the type after the verb (`{ verb: 'run', name: 'agent' }` is `choliba run agent`), and `help` gives its entry in\n  the verb's help.\n\n## Steps for a new command\n\n1. Read `cli-guidelines` and write the failing spec first (`references\u002Ftesting.md`).\n2. The logic as plain functions in the feature folder. The service calls them with what its factory reads from\n   the container.\n3. The command object: `help` returns a `CommandEntry` (name, the line `--help` lists, group, spec). `run` reads\n   `io.args('\u003Cname>')`, calls the service, then `io.exit(code)`, `io.fail(message)` or `io.usageError(message, program)`.\n   Its own `--help` prints `entryHelp(entry)`.\n4. Register the service with `container.provide(TOKEN, (container) => new Service(...))` in the package's\n   `ShellModule`, and add the command to that module's `commands`. The root lists it from `help` with no change\n   to the app, in the order of `CHOLIBA_ORDER` when the name is there. A command that is one more type of a verb\n   (something to run, create or list) takes that `verb` instead of a new first word (`cli-guidelines`, rule 16).\n   A command with no `help` does not appear in `--help` (`terminal`).\n5. `bun run check`. After a tool config change, `bash .agents\u002Fskills\u002Fquality-gates\u002Fscripts\u002Fverify.sh`.\n\n## Adding an agent provider\n\n1. `packages\u002Fproviders\u002Fsrc\u002F\u003Cprovider>\u002F\u003Cid>-agent.provider.ts`: a plain class `extends AgentProvider` with `id`,\n   `binaries`, `autoPriority`, `buildArgs`, `createParser` (and the optional hooks), exported from\n   `providers\u002Findex.ts`.\n2. Add an instance to the list `agentsShell` builds `AGENT_PROVIDERS` from (`choliba\u002Fsrc\u002Fagents\u002Fagents\u002Fagents-shell.ts`):\n   `--provider \u003Cid>`, `--\u003Cid>`, `auto`'s order and completion follow with no other change.\n3. Specs: its args and parser, and the registry spec, which the new provider must not break.\n\n## The root and the verbs\n\nAt most one module has `root` (the app's `cholibaShell`): empty line and `help` print the sorted help,\n`help \u003Cwords…>` the help of the command they name, `version` prints `version()`, and `__complete`, `__describe` and\n`__entries` answer before any command lookup. `shell.has('__complete')` stays false: those words are not\n`ShellCommand`s.\n\nThe root declares its `verbs` (`CHOLIBA_VERBS`: `run`, `new`, `list`, each with its line in `--help`). The shell\nbuilds each verb from the commands that name it: `choliba run --help` lists their entries, `choliba run agent …`\nruns the `agent` type with `io.args('run', 'agent')`, and a missing or unknown type is a usage error that suggests\nthe closest one. A first word that is neither a command nor a verb is a usage error with a suggestion too; there\nis no fallback. Two roots, a verb that is also a command, a command under a verb the root does not declare, or two\ncommands claiming one word (or one type of a verb) throw when the shell is built.\n\nA spec that runs a package's verb commands without the app adds `VERBS_ROOT` from `@choliba\u002Fshell\u002Ftesting`.\n\n## Tests\n\n`references\u002Ftesting.md`: `runShell([module], fakePlatform({ argv }))` for a command line, `new Service(...)` for\na service, `@choliba\u002Fkernel\u002Ftesting` and `@choliba\u002Fshell\u002Ftesting` for internal fakes. The installed\n`choliba\u002Fcore\u002Ftesting` facade combines them. Never `bun test`.\n","# The shell\n\n`packages\u002Fcholiba\u002Fsrc\u002Fmain.ts` is the composition root. It reads the process and Bun into a `Platform` and a\n`Runtime`, strips the global flags, and runs `createCholibaShell(platform, runtime).run()`. There is no HTTP and\nno decorator. The workspace stays `packages\u002F*`: each package exports one `ShellModule`, and the app lists them.\n\nNames, layers and which folder is a module: the `code-standard` skill. What the user sees (flags, stdout, exit\ncodes, pt-BR): `cli-guidelines`.\n\n## Where code goes\n\n- **One feature per folder.** `\u003Cfeature>.service.ts` (a plain class), one `\u003Caction>.command.ts` per command (its\n  pt-BR `CommandEntry` inside it), `dto\u002F\u003Caction>.dto.ts` (a class with a constructor, never `field!`),\n  `interfaces\u002F*.interface.ts`, `\u003Cfeature>.constants.ts` (tokens from `token\u003CT>()`). The domain logic stays in\n  plain functions; the service calls them. The package's `\u003Cfeature>-shell.ts` registers the factories and lists\n  the commands.\n- **One entry per package.** `@choliba\u002F\u003Cpkg>` (`src\u002Findex.ts`) exports the functions, the types, the tokens and\n  the `ShellModule`. The Playwright runner loads that entry with its own Babel, which rejects a parameter\n  decorator, so the barrel has none. The runner's typecheck also has no Bun types: a function that wraps\n  `Bun.spawn` takes a structural type, and the real `Bun.spawn` is read only in `main.ts`.\n- **Another package is reached only through `.`.** Never through a folder, and a package never imports its own\n  entry from inside. A folder is reached only through its `index.ts`.\n\n## What every command uses (`@choliba\u002Fshell` and `@choliba\u002Fkernel`)\n\n- **`PLATFORM`** (`@choliba\u002Fkernel`): the process, registered by `createShell` from what `main.ts` built (argv already without\n  `--no-color`, cwd, env, stdout, stderr, clock, signals, spawn, which, git). Only `main.ts` reads Bun and\n  `process`. Jest runs on Node, so nothing else may.\n- **`CONFIG`** and **`THEME`** (`@choliba\u002Fshell`): a `ConfigService` and a `ThemeService`, registered by `baseShell` from\n  `PLATFORM`. Another package's factory asks for them with `container.get(CONFIG)`.\n- **`RUNTIME`**: the app's own token (`packages\u002Fcholiba`), registered by `cholibaShell`. It is how `check`,\n  `lint`, `format` and `setup` run ESLint, Prettier and the deferred setup step.\n- **`ShellIo`**: the arguments as typed (`io.args('projects', 'list')`), stdout (`write`, `printHelp`), stderr\n  (`fail`, `usageError`) and the exit code (`exit`). A command reads its own words; it does not reparse the\n  global flags, which `main.ts` already removed.\n- **`ShellCommand`**: `name` (the first word), optional `aliases`, `help(container)` (the root entries, omitted\n  when the command stays out of `--help`) and `run(container, io)`. With `verb` (`run`, `new`, `list`), `name` is\n  the type after the verb (`{ verb: 'run', name: 'agent' }` is `choliba run agent`), and `help` gives its entry in\n  the verb's help.\n\n## Steps for a new command\n\n1. Read `cli-guidelines` and write the failing spec first (`references\u002Ftesting.md`).\n2. The logic as plain functions in the feature folder. The service calls them with what its factory reads from\n   the container.\n3. The command object: `help` returns a `CommandEntry` (name, the line `--help` lists, group, spec). `run` reads\n   `io.args('\u003Cname>')`, calls the service, then `io.exit(code)`, `io.fail(message)` or `io.usageError(message, program)`.\n   Its own `--help` prints `entryHelp(entry)`.\n4. Register the service with `container.provide(TOKEN, (container) => new Service(...))` in the package's\n   `ShellModule`, and add the command to that module's `commands`. The root lists it from `help` with no change\n   to the app, in the order of `CHOLIBA_ORDER` when the name is there. A command that is one more type of a verb\n   (something to run, create or list) takes that `verb` instead of a new first word (`cli-guidelines`, rule 16).\n   A command with no `help` does not appear in `--help` (`terminal`).\n5. `bun run check`. After a tool config change, `bash .agents\u002Fskills\u002Fquality-gates\u002Fscripts\u002Fverify.sh`.\n\n## Adding an agent provider\n\n1. `packages\u002Fproviders\u002Fsrc\u002F\u003Cprovider>\u002F\u003Cid>-agent.provider.ts`: a plain class `extends AgentProvider` with `id`,\n   `binaries`, `autoPriority`, `buildArgs`, `createParser` (and the optional hooks), exported from\n   `providers\u002Findex.ts`.\n2. Add an instance to the list `agentsShell` builds `AGENT_PROVIDERS` from (`choliba\u002Fsrc\u002Fagents\u002Fagents\u002Fagents-shell.ts`):\n   `--provider \u003Cid>`, `--\u003Cid>`, `auto`'s order and completion follow with no other change.\n3. Specs: its args and parser, and the registry spec, which the new provider must not break.\n\n## The root and the verbs\n\nAt most one module has `root` (the app's `cholibaShell`): empty line and `help` print the sorted help,\n`help \u003Cwords…>` the help of the command they name, `version` prints `version()`, and `__complete`, `__describe` and\n`__entries` answer before any command lookup. `shell.has('__complete')` stays false: those words are not\n`ShellCommand`s.\n\nThe root declares its `verbs` (`CHOLIBA_VERBS`: `run`, `new`, `list`, each with its line in `--help`). The shell\nbuilds each verb from the commands that name it: `choliba run --help` lists their entries, `choliba run agent …`\nruns the `agent` type with `io.args('run', 'agent')`, and a missing or unknown type is a usage error that suggests\nthe closest one. A first word that is neither a command nor a verb is a usage error with a suggestion too; there\nis no fallback. Two roots, a verb that is also a command, a command under a verb the root does not declare, or two\ncommands claiming one word (or one type of a verb) throw when the shell is built.\n\nA spec that runs a package's verb commands without the app adds `VERBS_ROOT` from `@choliba\u002Fshell\u002Ftesting`.\n\n## Tests\n\n`references\u002Ftesting.md`: `runShell([module], fakePlatform({ argv }))` for a command line, `new Service(...)` for\na service, `@choliba\u002Fkernel\u002Ftesting` and `@choliba\u002Fshell\u002Ftesting` for internal fakes. The installed\n`choliba\u002Fcore\u002Ftesting` facade combines them. Never `bun test`.\n",{"name":5,"description":7,"argument-hint":23,"user-invocable":24,"disable-model-invocation":19},"What you are building (command, service, provider...) and in which package.",true,"master","f87255e7db440871b20678ad28b99f8f8f97713b",".agents\u002Fskills\u002Fcli-shell","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba","https:\u002F\u002Fcholiba.github.io\u002F","https:\u002F\u002Fgithub.com\u002Fcholiba","Observe com atenção. Aja com precisão. Deixe evidências. · Testes E2E multiprojeto com Playwright, operados por agentes. ","2026-10-25 06:45:16",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":24},[35,38,41],{"tool":36,"command":37},"npx","npx skills add choliba\u002Fcholiba --skill cli-shell",{"tool":39,"command":40},"bunx","bunx skills add choliba\u002Fcholiba --skill cli-shell",{"tool":42,"command":43},"pnpm","pnpm dlx skills add choliba\u002Fcholiba --skill cli-shell","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fcli-shell\u002FSKILL.md",[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Ftesting.md","REFERENCE","参考文档",1502,"https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fcli-shell\u002Freferences\u002Ftesting.md",[53,60,65,72,79,86],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M7DE5ZNQN6XDSJ7R5321P71X","dummy-skill","Skill de teste, usada pelo agente echo das fixtures.","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002Fpackages\u002Fengine\u002Fsrc\u002F__tests__\u002Ffixtures\u002Fskills\u002Fdummy-skill\u002FSKILL.md",[],[],{"skillNo":61,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7DE5Y9NV84DZ74RY0GS707V","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002Fpackages\u002Fcholiba\u002Fsrc\u002F__tests__\u002Ffixtures\u002Fskills\u002Fdummy-skill\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7DE5TNY8A3A32S7NDAPT355","playwright-trace","Inspect Playwright trace files from the command line — list actions, view requests, console, errors, snapshots and screenshots.","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.choliba\u002Fskills\u002Fplaywright-trace\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7DE5NVA52PVZCK0N85VGAZH","playwright-component-testing","Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime. Use when asked to test React or Vue components in isolation with Playwright, or to migrate off @playwright\u002Fexperimental-ct-react \u002F -vue.","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.choliba\u002Fskills\u002Fplaywright-component-testing\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7DE5J3XRSREJV0YENFWSM3T","playwright-cli","Automate browser interactions, test web pages and work with Playwright tests.","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.choliba\u002Fskills\u002Fplaywright-cli\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7DE5G496VD7W01VRYWXSJ12","quality-gates","https:\u002F\u002Fgithub.com\u002Fcholiba\u002Fcholiba\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fquality-gates\u002FSKILL.md",[],[]]