Add tool

From hoangsonww/Forge-Agentic-Coding-CLI · View interactive version

Add tool is an AI agent skill from the GitHub repository hoangsonww/Forge-Agentic-Coding-CLI. Scaffold a new Forge tool end-to-end — type, implementation, registration, permission/risk classification, and unit test. Use when adding anything to src/tools/.

How to use this skill

Skill file

/add-tool — add a new Forge tool

Adding a tool touches four places. Do all four in one change, or the tool

is half-registered.

Tool name: $ARGUMENTS (kebab-case, e.g. read-manifest).

1. Implementation — `src/tools/$ARGUMENTS.ts`

../types/errors.

classifyCommandRisk.

src/permissions/manager.ts before the side-effecting call, not

after.

programmer errors.

2. Registration — `src/tools/registry.ts` (indirectly)

Follow the existing pattern used by sibling tools: export a register

helper or a tool constant and wire it up wherever registerTool is

called at startup. Read one existing tool (e.g. src/tools/read-file.ts)

before writing yours.

3. Unit test — `test/unit/$ARGUMENTS.test.ts`

At minimum, cover:

Use vi.mock for the permission manager and sandbox boundaries. No

real filesystem writes outside os.tmpdir().

4. Documentation

If the tool is user-visible, add a row to the tools table in

docs/ARCHITECTURE.md (it lists all 18 tools today). Update the count in

README.md "At a glance" if it changed.

Verification

Run /verify when you're done. The test count should increase by the

number of tests you added.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.