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
| Function | Returns | Use when |
|---|---|---|
isNodeTypeClass(node) | boolean | Check if class implements INodeType or extends Node |
isCredentialTypeClass(node) | boolean | Check if class implements ICredentialType |
Property finding
| Function | Returns | Use when |
|---|---|---|
findClassProperty(node, name) | `PropertyDefinition \ | null` |
findObjectProperty(obj, name) | `Property \ | null` |
findJsonProperty(obj, name) | `Property \ | null` |
findArrayLiteralProperty(obj, name) | `Property \ | null` |
Value extraction
| Function | Returns | Use when |
|---|---|---|
getLiteralValue(node) | `string \ | boolean \ |
getStringLiteralValue(node) | `string \ | null` |
getBooleanLiteralValue(node) | `boolean \ | null` |
getModulePath(node) | `string \ | null` |
Array operations
| Function | Returns | Use when |
|---|---|---|
hasArrayLiteralValue(arr, value) | boolean | Check if array contains a specific string literal |
extractCredentialInfoFromArray(element) | `{ name, testedBy } \ | null` |
extractCredentialNameFromArray(element) | `string \ | null` |
Method matching
| Function | Returns | Use when |
|---|---|---|
isThisHelpersAccess(node) | boolean | Match this.helpers member expression |
isThisMethodCall(node, method) | boolean | Match this.methodName(...) calls |
isThisHelpersMethodCall(node, method) | boolean | Match this.helpers.methodName(...) calls |
Similarity
| Function | Returns | Use when |
|---|---|---|
findSimilarStrings(target, candidates, maxDistance?) | string[] | Suggest similar names (Levenshtein distance) |
file-utils.ts
Path operations
| Function | Use when |
|---|---|
isContainedWithin(child, parent) | Check path is within a directory |
safeJoinPath(base, ...parts) | Join paths with traversal prevention |
Package.json
| Function | Returns | Use 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
| Function | Use 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
| Function | Use when |
|---|---|
areAllCredentialUsagesTestedByNodes(startDir) | Check all credentials have testedBy |