skills/artemisai/data-processor/SKILL.md
Process and transform arrays of data with common operations like filtering, mapping, and aggregation
npx skillsauth add aiskillstore/marketplace data-processorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A general-purpose data processing skill for transforming arrays of objects. This skill demonstrates the token efficiency benefits of code execution - instead of describing transformations in natural language, write code once and reuse it.
Processes arrays of data with common transformations:
Use this skill when you need to:
Token Efficiency: Processing 1000 records in code uses ~500 tokens. Describing the same operations in natural language would use ~50,000 tokens.
/**
* Data Processor - General purpose data transformation
* @param {Array} data - Array of objects to process
* @param {Object} operations - Operations to apply
* @returns {Object} Processed data and statistics
*/
async function processData(data, operations = {}) {
if (!Array.isArray(data)) {
throw new Error('Data must be an array');
}
let result = [...data];
const stats = {
inputCount: data.length,
operations: [],
};
// Filter operation
if (operations.filter) {
const beforeCount = result.length;
result = result.filter(operations.filter);
stats.operations.push({
type: 'filter',
recordsRemoved: beforeCount - result.length
});
}
// Map operation (transform fields)
if (operations.map) {
result = result.map(operations.map);
stats.operations.push({ type: 'map' });
}
// Sort operation
if (operations.sort) {
const { field, order = 'asc' } = operations.sort;
result.sort((a, b) => {
const aVal = a[field];
const bVal = b[field];
const comparison = aVal < bVal ? -1 : aVal > bVal ? 1 : 0;
return order === 'asc' ? comparison : -comparison;
});
stats.operations.push({ type: 'sort', field, order });
}
// Aggregate operation
if (operations.aggregate) {
const { field, operation: aggOp } = operations.aggregate;
const values = result.map(r => r[field]).filter(v => v != null);
let aggregateResult;
switch (aggOp) {
case 'sum':
aggregateResult = values.reduce((sum, v) => sum + v, 0);
break;
case 'average':
aggregateResult = values.reduce((sum, v) => sum + v, 0) / values.length;
break;
case 'count':
aggregateResult = values.length;
break;
case 'min':
aggregateResult = Math.min(...values);
break;
case 'max':
aggregateResult = Math.max(...values);
break;
default:
throw new Error(`Unknown aggregate operation: ${aggOp}`);
}
stats.aggregateResult = {
field,
operation: aggOp,
value: aggregateResult
};
}
// Remove duplicates
if (operations.unique) {
const { field } = operations.unique;
const seen = new Set();
const beforeCount = result.length;
result = result.filter(item => {
const key = item[field];
if (seen.has(key)) return false;
seen.add(key);
return true;
});
stats.operations.push({
type: 'unique',
field,
duplicatesRemoved: beforeCount - result.length
});
}
stats.outputCount = result.length;
return {
data: result,
stats
};
}
module.exports = processData;
const processData = require('/skills/data-processor.js');
const salesData = [
{ id: 1, amount: 150, status: 'completed' },
{ id: 2, amount: 200, status: 'pending' },
{ id: 3, amount: 175, status: 'completed' },
{ id: 4, amount: 225, status: 'completed' }
];
const result = await processData(salesData, {
filter: (record) => record.status === 'completed',
sort: { field: 'amount', order: 'desc' }
});
console.log(result);
// Output:
// {
// data: [
// { id: 4, amount: 225, status: 'completed' },
// { id: 3, amount: 175, status: 'completed' },
// { id: 1, amount: 150, status: 'completed' }
// ],
// stats: {
// inputCount: 4,
// operations: [
// { type: 'filter', recordsRemoved: 1 },
// { type: 'sort', field: 'amount', order: 'desc' }
// ],
// outputCount: 3
// }
// }
const processData = require('/skills/data-processor.js');
const orders = [
{ orderId: 1, total: 100 },
{ orderId: 2, total: 150 },
{ orderId: 3, total: 200 }
];
const result = await processData(orders, {
aggregate: { field: 'total', operation: 'sum' }
});
console.log(result.stats.aggregateResult);
// Output: { field: 'total', operation: 'sum', value: 450 }
const processData = require('/skills/data-processor.js');
const customers = [
{ name: ' John Doe ', email: '[email protected]', age: 30 },
{ name: 'Jane Smith', email: '[email protected]', age: 25 },
{ name: ' John Doe ', email: '[email protected]', age: 30 } // duplicate
];
const result = await processData(customers, {
map: (customer) => ({
name: customer.name.trim(),
email: customer.email.toLowerCase(),
age: customer.age
}),
unique: { field: 'email' },
filter: (customer) => customer.age >= 25,
sort: { field: 'age', order: 'asc' }
});
console.log(result.data);
// Output:
// [
// { name: 'Jane Smith', email: '[email protected]', age: 25 },
// { name: 'John Doe', email: '[email protected]', age: 30 }
// ]
This skill works great in combination with MCP tools:
// Fetch data from an MCP tool
const rawData = await callMCPTool('database__query', {
query: 'SELECT * FROM customers WHERE created_date > "2024-01-01"'
});
// Process with the skill
const processData = require('/skills/data-processor.js');
const result = await processData(rawData, {
filter: (r) => r.status === 'active',
sort: { field: 'revenue', order: 'desc' },
aggregate: { field: 'revenue', operation: 'sum' }
});
// Save results
await callMCPTool('storage__save', {
key: 'processed_customers',
value: result.data
});
// Return summary to agent (not full data)
return {
processedRecords: result.stats.outputCount,
totalRevenue: result.stats.aggregateResult.value
};
/workspace after each major operation/skills and use across multiple tasksvalidator - Validate data before processingexporter - Export processed data to various formatsaggregator - Advanced statistical aggregationsThis skill can process:
All operations use efficient JavaScript array methods with O(n) or O(n log n) complexity.
Inspired by: The Anthropic skills pattern for token-efficient data processing. See Code Execution with MCP for the philosophy behind this approach.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.