All skills
Skillintermediate

AST & File Utilities Reference

Helpers available from `../utils/index.js`. Use these instead of writing custom AST traversal.

Claude Code Knowledge Pack7/10/2026

Overview

AST & File Utilities Reference

Helpers available from ../utils/index.js. Use these instead of writing custom AST traversal.

ast-utils.ts

Class/Interface detection

FunctionReturnsUse when
isNodeTypeClass(node)booleanCheck if class implements INodeType or extends Node
isCredentialTypeClass(node)booleanCheck if class implements ICredentialType

Property finding

FunctionReturnsUse when
findClassProperty(node, name)`PropertyDefinition \null`
findObjectProperty(obj, name)`Property \null`
findJsonProperty(obj, name)`Property \null`
findArrayLiteralProperty(obj, name)`Property \null`

Value extraction

FunctionReturnsUse when
getLiteralValue(node)`string \boolean \
getStringLiteralValue(node)`string \null`
getBooleanLiteralValue(node)`boolean \null`
getModulePath(node)`string \null`

Array operations

FunctionReturnsUse when
hasArrayLiteralValue(arr, value)booleanCheck if array contains a specific string literal
extractCredentialInfoFromArray(element)`{ name, testedBy } \null`
extractCredentialNameFromArray(element)`string \null`

Method matching

FunctionReturnsUse when
isThisHelpersAccess(node)booleanMatch this.helpers member expression
isThisMethodCall(node, method)booleanMatch this.methodName(...) calls
isThisHelpersMethodCall(node, method)booleanMatch this.helpers.methodName(...) calls

Similarity

FunctionReturnsUse when
findSimilarStrings(target, candidates, maxDistance?)string[]Suggest similar names (Levenshtein distance)

file-utils.ts

Path operations

FunctionUse when
isContainedWithin(child, parent)Check path is within a directory
safeJoinPath(base, ...parts)Join paths with traversal prevention

Package.json

FunctionReturnsUse when
findPackageJson(startDir)`string \null`
readPackageJsonN8n(startDir)`N8nPackageJson \null`
readPackageJsonCredentials(startDir)Set<string>Get credential names from package.json
readPackageJsonNodes(startDir)string[]Get resolved node file paths

File system

FunctionUse when
validateIconPath(filePath, iconValue)Check icon file exists and is SVG
extractCredentialNameFromFile(filePath)Parse credential class name from file
fileExistsWithCaseSync(filePath)Case-sensitive existence check
findSimilarSvgFiles(dir, name)Suggest similar SVG filenames

Credential verification

FunctionUse when
areAllCredentialUsagesTestedByNodes(startDir)Check all credentials have testedBy