Extension Design
Designextension-designExtension Design is an Agent Skill for design published in the rcarmo/piclaw repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Design and audit Pi extensions safely (avoid workspace source imports).
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/rcarmo/piclaw/blob/HEAD/skel/.pi/skills/extension-design/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/extension-design, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Extension design notes
Use this when creating or reviewing extensions to avoid the broken import pattern.
Avoid this pattern
Do not import from the workspace source tree (for example /workspace/piclaw/runtime/src/... or /workspace/.../node_modules).
The running agent uses the installed package, and workspace paths can drift or break after reloads.
Use the installed package instead
Reference the installed dist paths, for example:
import { createBatchExecTool } from "/home/agent/.bun/install/global/node_modules/piclaw/dist/tools/context-tools.js";
Safety checklist
- Use installed dist paths (not workspace source).
- Avoid touching the DB before init.
- Wrap tool handlers in
try/catchto avoid crashes. - Guard filesystem access and
saveToolOutputcalls. - Keep dependencies minimal and explicit.
Quick audit
rg -n "/workspace/piclaw/runtime/src|/workspace/.*/node_modules" /workspace/.pi/extensions
Update skel when changing extensions
cp /workspace/.pi/extensions/<name>.ts /workspace/piclaw/skel/.pi/extensions/<name>.ts