tool-creator

安装量: 41
排名: #17768

安装

npx skills add https://github.com/oimiragieo/agent-studio --skill tool-creator
Tool Creator
Create executable tool files in
.claude/tools//
. Tools are organized into categories like
cli
,
analysis
,
validation
,
integrations
, etc.
Step 0: Check for Existing Tool
Before creating, check if tool already exists:
find
.claude/tools/
-name
".*"
-type
f
If EXISTS → use
Read
to inspect the current tool file, then
Edit
to apply changes directly. Run the post-creation integration steps (Step 4) after updating.
If NEW → continue with Step 0.1.
Step 0.1: Smart Duplicate Detection (MANDATORY)
Before proceeding with creation, run the 3-layer duplicate check:
const
{
checkDuplicate
}
=
require
(
'.claude/lib/creation/duplicate-detector.cjs'
)
;
const
result
=
checkDuplicate
(
{
artifactType
:
'tool'
,
name
:
proposedName
,
description
:
proposedDescription
,
keywords
:
proposedKeywords
||
[
]
,
}
)
;
Handle results:
EXACT_MATCH
Stop creation. Route to
tool-updater
skill instead:
Skill({ skill: 'tool-updater' })
REGISTRY_MATCH
Warn user — artifact is registered but file may be missing. Investigate before creating. Ask user to confirm.
SIMILAR_FOUND
Display candidates with scores. Ask user: "Similar artifact(s) exist. Continue with new creation or update existing?"
NO_MATCH
Proceed to next step.
Override
If user explicitly passes --force , skip this check entirely. Step 0.5: Companion Check Before proceeding with creation, run the ecosystem companion check: Use companion-check.cjs from .claude/lib/creators/companion-check.cjs Call checkCompanions("tool", "{tool-name}") to identify companion artifacts Review the companion checklist — note which required/recommended companions are missing Plan to create or verify missing companions after this artifact is complete Include companion findings in post-creation integration notes This step is informational (does not block creation) but ensures the full artifact ecosystem is considered. When to Use Creating reusable command-line utilities Building analysis or validation scripts Implementing framework automation tools Adding workflow integration utilities Tool File Format Tools are CommonJS or ESM modules with:

!/usr/bin/env node

/* * Tool Name - Brief description * * Usage: * node .claude/tools//.cjs [options] * * Options: * --help Show help * --option Description / const main = async ( ) => { // Tool implementation } ; if ( require . main === module ) { main ( ) . catch ( console . error ) ; } module . exports = { main } ; Tool Categories Category Purpose Examples cli Command-line utilities validators, formatters analysis Code analysis tools complexity, dependencies validation Validation scripts schema, lint integrations External integration tools API clients, webhooks maintenance Framework maintenance cleanup, migration optimization Performance optimization indexing, caching runtime Runtime utilities config readers, loaders visualization Diagram and graph generation mermaid, graphviz workflow Workflow automation task runners, orchestrators gates Quality gates and checks coverage, security context Context management compression, handoff Creation Workflow Step 1: Validate Inputs // Validate tool name (lowercase, hyphens, no spaces) const toolName = args . name . toLowerCase ( ) . replace ( / [ ^ a - z 0 - 9 - ] / g , '-' ) ; // Validate category exists const validCategories = [ 'cli' , 'analysis' , 'validation' , 'integrations' , 'maintenance' , 'optimization' , 'runtime' , 'visualization' , 'workflow' , 'gates' , 'context' , ] ; if ( ! validCategories . includes ( args . category ) ) { throw new Error ( Invalid category. Must be one of: ${ validCategories . join ( ', ' ) } ) ; } Step 2: Create Tool File const toolPath = .claude/tools/ ${ args . category } / ${ toolName } .cjs ; // Create tool directory if it doesn't exist await mkdir ( .claude/tools/ ${ args . category } , { recursive : true } ) ; // Generate tool content const content = `

!/usr/bin/env node

/* * ${ toolName . replace ( / - / g , ' ' ) . replace ( / \b \w / g , l => l . toUpperCase ( ) ) } - ${ args . description || 'Tool description' } * * Usage: * node .claude/tools/ ${ args . category } / ${ toolName } .cjs [options] * * Options: * --help Show this help message / ${ args . implementation } if (require.main === module) { main().catch(console.error); } module.exports = { main }; ; await writeFile ( toolPath , content ) ; // Make executable (Unix-like systems) if ( process . platform !== 'win32' ) { await chmod ( toolPath , '755' ) ; } Step 3: Update Tool Catalog const catalogPath = '.claude/context/artifacts/catalogs/tool-catalog.md' ; // Add entry to catalog under appropriate category const newEntry = | ${ toolName } | ${ args . description } | .claude/tools/ ${ args . category } / ${ toolName } .cjs | active | ; // Insert into catalog preserving category structure Step 4: Run Post-Creation Integration const { runIntegrationChecklist , queueCrossCreatorReview , } = require ( '.claude/lib/creator-commons.cjs' ) ; await runIntegrationChecklist ( 'tool' , toolPath ) ; await queueCrossCreatorReview ( 'tool' , toolPath , { artifactName : toolName , createdBy : 'tool-creator' , category : args . category , } ) ; Post-Creation Integration After tool creation, run integration checklist: const { runIntegrationChecklist , queueCrossCreatorReview , } = require ( '.claude/lib/creator-commons.cjs' ) ; // 1. Run integration checklist const result = await runIntegrationChecklist ( 'tool' , '.claude/tools/<category>/<tool-name>.cjs' ) ; // 2. Queue cross-creator review await queueCrossCreatorReview ( 'tool' , '.claude/tools/<category>/<tool-name>.cjs' , { artifactName : '<tool-name>' , createdBy : 'tool-creator' , category : '<category>' , } ) ; // 3. Review impact report // Check result.mustHave for failures - address before marking complete Integration verification: Tool added to tool-catalog.md under correct category Tool file is executable (Unix) or runnable (Windows) Tool has help text and usage examples Tool passes basic smoke test Usage Examples Create Validation Tool Skill ( { skill : 'tool-creator' , args : --name schema-validator --category validation --implementation " const validateSchema = async () => { console.log('Validating schema...'); }; const main = async () => { await validateSchema(); }; " , } ) ; Create Analysis Tool Skill ( { skill : 'tool-creator' , args : --name complexity-analyzer --category analysis --implementation " const analyzeComplexity = async (filePath) => { console.log('Analyzing complexity for:', filePath); }; const main = async () => { const [,, filePath] = process.argv; await analyzeComplexity(filePath); }; " ` , } ) ;

返回排行榜