Babel plugin that transforms ECMAScript object rest and spread syntax into ES5-compatible code.
85
Quality
Pending
Does it follow best practices?
Impact
85%
1.06xAverage score across 10 eval scenarios
Pending
The risk profile of this skill
A utility library that generates Abstract Syntax Tree (AST) nodes from string templates with dynamic placeholder substitution.
function add(a, b) { return a + b; } @testfunction greet(name) { return "Hello, " + name; } @testconst result = 42; @testlet data = computeValue(); @testimport { readFile, writeFile } from 'fs'; @test@generates
/**
* Generates a function declaration AST node
* @param {string} name - The function name
* @param {string[]} params - Array of parameter names
* @param {string} body - The function body expression
* @returns {object} AST node representing the function
*/
function generateFunction(name, params, body) {
// IMPLEMENTATION HERE
}
/**
* Generates a variable declaration AST node
* @param {string} kind - The declaration kind ('const', 'let', or 'var')
* @param {string} name - The variable name
* @param {string} init - The initializer expression as a string
* @returns {object} AST node representing the variable declaration
*/
function generateVariable(kind, name, init) {
// IMPLEMENTATION HERE
}
/**
* Generates a class declaration AST node
* @param {string} className - The class name
* @param {Array<{name: string, params: string[], body: string}>} methods - Array of method descriptors
* @returns {object} AST node representing the class
*/
function generateClass(className, methods) {
// IMPLEMENTATION HERE
}
/**
* Generates an import statement AST node
* @param {string[]} specifiers - Array of named import identifiers
* @param {string} source - The module source path
* @returns {object} AST node representing the import statement
*/
function generateImport(specifiers, source) {
// IMPLEMENTATION HERE
}
module.exports = {
generateFunction,
generateVariable,
generateClass,
generateImport,
};Provides template-based AST building capabilities for constructing AST nodes from string templates.
@satisfied-by
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10