[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BXABB60RKKWKY02Z8BWRX3":3,"skill-same:01M6BXABB60RKKWKY02Z8BWRX3":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":24,"linkOnly":25,"markdownContent":26,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6BXABB60RKKWKY02Z8BWRX3","create-action",null,"use when asked to create, define, or modify an action in Agent Smith - writes the .js\u002F.py\u002F.yml file in features\u002Factions\u002F, adds the","lynxai-team\u002Fagent-smith","lynxai-team","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F251374637?v=4","01M6BXA5J9YTMDT46KAFFYCFFA","lynxai.team","01M6BXA5PK5C25QTMDWWX01H88",48,"MIT","https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Ffeatures\u002Fskills\u002Fcreate-action\u002FSKILL.md",[],[19,20,21,22,23],"create","create action","file","actions","js","2026-11-10 10:12:30",false,"---\nname: create-action\ndescription: use when asked to create, define, or modify an action in Agent Smith - writes the .js\u002F.py\u002F.yml file in features\u002Factions\u002F, adds the # tool docblock so agents can call it as a tool, and registers it with lm update\n---\n\n# Create an Action\n\nDefine, register, and verify an action — a unit of work (JS\u002FPython code or a wrapped shell command) that workflows and agents can call.\n\n## Workflow\n\n1. **Ensure a registered features directory** (first time only) — edit the conf file to add your `features\u002F` root path, then run `lm conf`. Actions are discovered from the `actions\u002F` subdirectory of each registered path (same mechanism as agents\u002Fworkflows).\n2. **Write the action file** — create `\u003Cname>.js` in `features\u002Factions\u002F` (default), or `.py` for a Python script \u002F `.yml` to wrap a shell command. The filename without extension becomes the action name.\n3. **Expose it as an agent tool** — add a `# tool` docblock at the very top of the file (see Tool docblock). Without it the action still runs from workflows, but agents cannot call it.\n4. **Register** — run `lm update`. Discovery upserts the action into the `action` table; with a docblock it also upserts a ToolSpec into the `tool` table.\n5. **(Optional) Give it to an agent** — add the action name to the agent's `toolsList`, then run `lm update` again.\n6. **Verify**:\n   - `lm update` output lists `- actions: \u003Cname>` (and `- tools: \u003Cname>` when exposed).\n   - Run it through a one-step workflow (`steps: [- action: \u003Cname>]`) with `lm \u003Cworkflow> [args...]`, or call it from an agent that has it in its `toolsList`.\n\n## Formats\n\n### JavaScript (.js) — default\n\nESM module exporting an async `action(args, options)` function. The docblock (first comment in the file) declares the tool interface:\n\n```js\n\u002F*\n# tool\nname: traffic\ndescription: Get the current road traffic conditions\narguments:\n    city:\n        description: The city or location, e.g. San Francisco, CA\n        required: true\n*\u002F\n\nasync function action(args, options) {\n    const city = Array.isArray(args) ? args[0] : args.city;\n    return { traffic: \"normal\", city };\n}\n\nexport { action }\n```\n\n- `args` shape depends on the caller: **string array** (CLI \u002F first workflow step), **tool arguments object** with the docblock's keys (agent tool call), or the **workflow context object** (later steps) — handle both.\n- `options` carries run flags: `debug`, `verbose`, `isToolCall` when called by an agent.\n- Return a string or object; in workflows an object's keys are merged into the shared context.\n- To run shell commands from JS use `utils.execute(cmd, args)` — `import { utils } from \"@agent-smith\u002Fcore\"` (see `git_diff.js` example).\n\n### YAML (.yml) — wrap a system command\n\n```yaml\n# features\u002Factions\u002Focr.yml\ntool:\n  name: ocr\n  description: Run OCR on an image file\n  arguments:\n      path:\n          description: Path to the image file\n          required: true\ncmd: \u002Fhome\u002Fme\u002Fapp\u002F.venv\u002Fbin\u002Fpython\nargs:\n  - \"\u002Fhome\u002Fme\u002Fapp\u002Focr.py\"\n```\n\n- `cmd` plus optional static `args` (all strings); runtime args are appended after them, positionally.\n- Result is the trimmed stdout string of the command.\n\n### Python (.py)\n\nPlain script run with `python3`; arguments arrive in `sys.argv[1:]`:\n\n```python\n\"\"\"\n# tool\nname: weather\ndescription: Get the current weather\narguments:\n    city:\n        description: The city or location, e.g. San Francisco, CA\n        required: true\n\"\"\"\n\nimport sys\n\nprint(f'{{\"temp\": 18, \"city\": \"{sys.argv[1]}\"}}')\n```\n\nResult is the printed stdout as a string.\n\n## Tool docblock\n\nThe docblock is what makes an action callable by agents; it defines the ToolSpec (name, description, arguments) that other agents see.\n\n- **JS**: file must start with `\u002F*` on line 1 and `# tool` on line 2; content up to the closing `*\u002F` is parsed as YAML.\n- **Python**: same, but the opening marker is a triple-quote docstring (`\"\"\"` on line 1).\n- **YAML**: a top-level `tool:` section instead of a comment.\n- Fields: `name` (overridden by the filename — keep it for documentation), `description`, `arguments` (map of arg name → `{ description, required }`).\n\n## Gotchas\n\n- **The docblock must be the first bytes of the file** — the parser checks the file starts with `\u002F*\\n# tool` (JS) or `\"\"\"\\n# tool` (Python). An import, shebang, or comment before it silently disables tool registration: the action still works from workflows, but agents get \"tool \u003Cname> not found for agent ...\".\n- **Docblock content is parsed as YAML** — write `key: value` and nested maps, not JS\u002FJSON object syntax.\n- **The docblock `name` is overridden by the filename** — renaming the file renames the tool and breaks every agent `toolsList` referencing it.\n- **Python actions return raw stdout string** — printing JSON does not make it structured; if a later workflow step needs keys, use a JS action or an adaptater that parses the output.\n- **YAML action args are all strings, appended after static `args:`** — design the wrapped command to accept them positionally; only trimmed stdout becomes the result (stderr is lost).\n- **JS actions must export exactly `action`** (async function) as ESM — the module is dynamically imported and called at run time; a different export name fails only when the action runs, not at registration.\n- **Every change requires `lm update`** — new files, edited docblocks, or new `toolsList` references are not picked up until re-registration.\n- **Do not verify with `lm \u003Caction-name>`** — actions are not standalone CLI commands in the current CLI; run them through a workflow step or an agent tool call.\n\n## References (load when needed)\n\n- Action executor (extension dispatch, args handling per format): `agent-smith\u002Fpackages\u002Fcore\u002Fsrc\u002Factions\u002Fcmd.ts`\n- Tool docblock parser (`# tool` markers, YAML parsing, name override): `agent-smith\u002Fpackages\u002Fcore\u002Fsrc\u002Ftools.ts`\n- Feature discovery (scans `actions\u002F` for .yml\u002F.js\u002F.py, table registration): `agent-smith\u002Fdocsite\u002Fpublic\u002Fdoc\u002Flibraries\u002Fcore\u002F3.feature-discovery.md`\n- User-facing action doc: `agent-smith\u002Fdocsite\u002Fpublic\u002Fdoc\u002Fterminal_client\u002F6.actions.md`\n- Real examples: `agent-smith\u002Fexamples\u002Ffeatures\u002Factions\u002Ftraffic.js`, `agent-smith\u002Fexamples\u002Ffeatures\u002Factions\u002Fweather.py`, `agent-smith-plugins\u002Fcode\u002Fgit\u002Fdist\u002Factions\u002Fgit_diff.js`\n","# Create an Action\n\nDefine, register, and verify an action — a unit of work (JS\u002FPython code or a wrapped shell command) that workflows and agents can call.\n\n## Workflow\n\n1. **Ensure a registered features directory** (first time only) — edit the conf file to add your `features\u002F` root path, then run `lm conf`. Actions are discovered from the `actions\u002F` subdirectory of each registered path (same mechanism as agents\u002Fworkflows).\n2. **Write the action file** — create `\u003Cname>.js` in `features\u002Factions\u002F` (default), or `.py` for a Python script \u002F `.yml` to wrap a shell command. The filename without extension becomes the action name.\n3. **Expose it as an agent tool** — add a `# tool` docblock at the very top of the file (see Tool docblock). Without it the action still runs from workflows, but agents cannot call it.\n4. **Register** — run `lm update`. Discovery upserts the action into the `action` table; with a docblock it also upserts a ToolSpec into the `tool` table.\n5. **(Optional) Give it to an agent** — add the action name to the agent's `toolsList`, then run `lm update` again.\n6. **Verify**:\n   - `lm update` output lists `- actions: \u003Cname>` (and `- tools: \u003Cname>` when exposed).\n   - Run it through a one-step workflow (`steps: [- action: \u003Cname>]`) with `lm \u003Cworkflow> [args...]`, or call it from an agent that has it in its `toolsList`.\n\n## Formats\n\n### JavaScript (.js) — default\n\nESM module exporting an async `action(args, options)` function. The docblock (first comment in the file) declares the tool interface:\n\n```js\n\u002F*\n# tool\nname: traffic\ndescription: Get the current road traffic conditions\narguments:\n    city:\n        description: The city or location, e.g. San Francisco, CA\n        required: true\n*\u002F\n\nasync function action(args, options) {\n    const city = Array.isArray(args) ? args[0] : args.city;\n    return { traffic: \"normal\", city };\n}\n\nexport { action }\n```\n\n- `args` shape depends on the caller: **string array** (CLI \u002F first workflow step), **tool arguments object** with the docblock's keys (agent tool call), or the **workflow context object** (later steps) — handle both.\n- `options` carries run flags: `debug`, `verbose`, `isToolCall` when called by an agent.\n- Return a string or object; in workflows an object's keys are merged into the shared context.\n- To run shell commands from JS use `utils.execute(cmd, args)` — `import { utils } from \"@agent-smith\u002Fcore\"` (see `git_diff.js` example).\n\n### YAML (.yml) — wrap a system command\n\n```yaml\n# features\u002Factions\u002Focr.yml\ntool:\n  name: ocr\n  description: Run OCR on an image file\n  arguments:\n      path:\n          description: Path to the image file\n          required: true\ncmd: \u002Fhome\u002Fme\u002Fapp\u002F.venv\u002Fbin\u002Fpython\nargs:\n  - \"\u002Fhome\u002Fme\u002Fapp\u002Focr.py\"\n```\n\n- `cmd` plus optional static `args` (all strings); runtime args are appended after them, positionally.\n- Result is the trimmed stdout string of the command.\n\n### Python (.py)\n\nPlain script run with `python3`; arguments arrive in `sys.argv[1:]`:\n\n```python\n\"\"\"\n# tool\nname: weather\ndescription: Get the current weather\narguments:\n    city:\n        description: The city or location, e.g. San Francisco, CA\n        required: true\n\"\"\"\n\nimport sys\n\nprint(f'{{\"temp\": 18, \"city\": \"{sys.argv[1]}\"}}')\n```\n\nResult is the printed stdout as a string.\n\n## Tool docblock\n\nThe docblock is what makes an action callable by agents; it defines the ToolSpec (name, description, arguments) that other agents see.\n\n- **JS**: file must start with `\u002F*` on line 1 and `# tool` on line 2; content up to the closing `*\u002F` is parsed as YAML.\n- **Python**: same, but the opening marker is a triple-quote docstring (`\"\"\"` on line 1).\n- **YAML**: a top-level `tool:` section instead of a comment.\n- Fields: `name` (overridden by the filename — keep it for documentation), `description`, `arguments` (map of arg name → `{ description, required }`).\n\n## Gotchas\n\n- **The docblock must be the first bytes of the file** — the parser checks the file starts with `\u002F*\\n# tool` (JS) or `\"\"\"\\n# tool` (Python). An import, shebang, or comment before it silently disables tool registration: the action still works from workflows, but agents get \"tool \u003Cname> not found for agent ...\".\n- **Docblock content is parsed as YAML** — write `key: value` and nested maps, not JS\u002FJSON object syntax.\n- **The docblock `name` is overridden by the filename** — renaming the file renames the tool and breaks every agent `toolsList` referencing it.\n- **Python actions return raw stdout string** — printing JSON does not make it structured; if a later workflow step needs keys, use a JS action or an adaptater that parses the output.\n- **YAML action args are all strings, appended after static `args:`** — design the wrapped command to accept them positionally; only trimmed stdout becomes the result (stderr is lost).\n- **JS actions must export exactly `action`** (async function) as ESM — the module is dynamically imported and called at run time; a different export name fails only when the action runs, not at registration.\n- **Every change requires `lm update`** — new files, edited docblocks, or new `toolsList` references are not picked up until re-registration.\n- **Do not verify with `lm \u003Caction-name>`** — actions are not standalone CLI commands in the current CLI; run them through a workflow step or an agent tool call.\n\n## References (load when needed)\n\n- Action executor (extension dispatch, args handling per format): `agent-smith\u002Fpackages\u002Fcore\u002Fsrc\u002Factions\u002Fcmd.ts`\n- Tool docblock parser (`# tool` markers, YAML parsing, name override): `agent-smith\u002Fpackages\u002Fcore\u002Fsrc\u002Ftools.ts`\n- Feature discovery (scans `actions\u002F` for .yml\u002F.js\u002F.py, table registration): `agent-smith\u002Fdocsite\u002Fpublic\u002Fdoc\u002Flibraries\u002Fcore\u002F3.feature-discovery.md`\n- User-facing action doc: `agent-smith\u002Fdocsite\u002Fpublic\u002Fdoc\u002Fterminal_client\u002F6.actions.md`\n- Real examples: `agent-smith\u002Fexamples\u002Ffeatures\u002Factions\u002Ftraffic.js`, `agent-smith\u002Fexamples\u002Ffeatures\u002Factions\u002Fweather.py`, `agent-smith-plugins\u002Fcode\u002Fgit\u002Fdist\u002Factions\u002Fgit_diff.js`\n",{"name":5,"description":7},"main","e8f77439e066ac9c34dc4ea47d83e8cf853e5b3f","packages\u002Fcore\u002Fsrc\u002Ffeatures\u002Fskills\u002Fcreate-action",3,"https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith","https:\u002F\u002Flynxai-team.github.io\u002Fagent-smith\u002F","https:\u002F\u002Fgithub.com\u002Flynxai-team","https:\u002F\u002Flynxai.team","Private AI - Take control of your cognitive infrastructure","2026-10-13 23:57:30",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add lynxai-team\u002Fagent-smith --skill create-action",{"tool":45,"command":46},"bunx","bunx skills add lynxai-team\u002Fagent-smith --skill create-action",{"tool":48,"command":49},"pnpm","pnpm dlx skills add lynxai-team\u002Fagent-smith --skill create-action","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Ffeatures\u002Fskills\u002Fcreate-action\u002FSKILL.md",true,[],[54,71,82,91,101],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":65,"publishedAt":24},"01M6BXAGXQ7HCZ1J0M2TPWW6NR","create-workflow","use when asked to create, define, or modify a workflow in Agent Smith - writes the .yml file in features\u002Fworkflows\u002F, chains actions\u002Fagents\u002Fadaptaters\u002Fcommands, registers it with lm update so it runs as `lm \u003Cname>` and can be exposed as an agent tool","https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Ffeatures\u002Fskills\u002Fcreate-workflow\u002FSKILL.md",[60],{"categoryNo":61,"categoryName":62,"taxonomyType":63,"taxonomyTypeDesc":64},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[66,67,19,21,68,22,69,70],"create workflow","workflow","update","workflows","tool",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":78,"publishedAt":24},"01M6BXAF8V7V4KDD1GGE653BMG","create-agent","use when asked to create, define, or modify an agent in YAML for Agent Smith, optionally exposes it as a subagent tool","https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Ffeatures\u002Fskills\u002Fcreate-agent\u002FSKILL.md",[77],{"categoryNo":61,"categoryName":62,"taxonomyType":63,"taxonomyTypeDesc":64},[19,79,70,80,81],"create agent","subagent","yaml",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":24},"01M6BXAD5MCK6N3SFDMRE7BAAN","create-adaptater","use when asked to create, define, or modify an adaptater (adapter) in Agent Smith - writes the .js file in features\u002Fadaptaters\u002F, registers it with lm update so workflows can use it as a data transformation step between actions and agents","https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Ffeatures\u002Fskills\u002Fcreate-adaptater\u002FSKILL.md",[],[89,19,23,90,22,21,68,69],"create adaptater","data",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":24},"01M6BXA9GZ3JJGGTMDQYTSV83J","update-doc-map","read this only when instructed to update the documentation map","https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fmaintenance\u002Fskills\u002Fupdate-doc-map\u002FSKILL.md",[],[98,99,68,100],"update doc map","doc","documentation",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":111,"publishedAt":24},"01M6BXA80V4Y1PNEHPD1CGGMQA","document-agent-smith-package","use when asked to create or update package documentation in the docsite","https:\u002F\u002Fgithub.com\u002Flynxai-team\u002Fagent-smith\u002Fblob\u002Fmain\u002Fmaintenance\u002Fskills\u002Fdocument-agent-smith-package\u002FSKILL.md",[107,110],{"categoryNo":108,"categoryName":109,"taxonomyType":63,"taxonomyTypeDesc":64},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":61,"categoryName":62,"taxonomyType":63,"taxonomyTypeDesc":64},[112,113,100,68,19],"document agent smith package","package"]