Install
openclaw skills install employee-skills-importerParse employee skills CSV files, identify skill categories and individual skills, look up employee IDs from an employees table, and generate idempotent SQL INSERT statements for skill_categories, skills, and employee_skills tables.
openclaw skills install employee-skills-importerThis skill automates the process of importing employee skills from CSV files into a Supabase database. It parses the CSV, checks what already exists in the database, and generates idempotent SQL scripts to insert missing data.
The skill performs a 3-step process:
The CSV must have:
Example structure:
,,,,,,.NET,,,,,Front-end,,,Java,,,
First Name,Last Name,Full Name,Unit,...,C#,ASP.net,MVC,...,JavaScript,HTML,CSS,...,Java,Spring,...
John,Doe,John Doe,Unit 1,...,5,4,3,...,6,6,5,...,0,0,...
SELECT name FROM skill_categories
INSERT INTO skill_categories (name)
VALUES ('Category1'), ('Category2'), ('Category3')
ON CONFLICT (name) DO NOTHING;
SELECT s.name, sc.name as category_name
FROM skills s
LEFT JOIN skill_categories sc ON s.category_id = sc.id
INSERT INTO skills (name, category_id)
VALUES
('C#', (SELECT id FROM skill_categories WHERE name = '.NET')),
('JavaScript', (SELECT id FROM skill_categories WHERE name = 'Front-end'))
ON CONFLICT (name) DO NOTHING;
SELECT id, first_name, last_name FROM employees
INSERT INTO employee_skills (employee_id, skill_id, years_of_experience)
VALUES
(
(SELECT id FROM employees WHERE TRIM(first_name) = 'John' AND TRIM(last_name) = 'Doe'),
(SELECT id FROM skills WHERE name = 'C#'),
5
)
ON CONFLICT (employee_id, skill_id) DO UPDATE
SET years_of_experience = EXCLUDED.years_of_experience;
skill_categories table: id (uuid), name (text, unique)skills table: id (uuid), name (text, unique), category_id (uuid FK to skill_categories)employees table: id (uuid), first_name (text), last_name (text)employee_skills table: id (uuid), employee_id (uuid FK), skill_id (uuid FK), years_of_experience (real)All generated SQL scripts use ON CONFLICT clauses to ensure they can be run multiple times without errors:
ON CONFLICT (name) DO NOTHINGON CONFLICT (employee_id, skill_id) DO UPDATE SET years_of_experience = EXCLUDED.years_of_experienceCRITICAL - Prevent Duplicate Key Violations:
ON CONFLICT DO UPDATE command cannot affect row a second timeCRITICAL - Automatic Name Correction:
null value in column "employee_id" violates not-null constraintThe skill produces three SQL scripts plus one report file:
1_insert_categories.sql
-- Insert missing skill categories
INSERT INTO skill_categories (name)
VALUES ('.NET'), ('Front-end'), ('Java')
ON CONFLICT (name) DO NOTHING;
2_insert_skills.sql
-- Insert missing skills with category mapping
INSERT INTO skills (name, category_id)
VALUES
('C#', (SELECT id FROM skill_categories WHERE name = '.NET')),
('ASP.net', (SELECT id FROM skill_categories WHERE name = '.NET')),
('JavaScript', (SELECT id FROM skill_categories WHERE name = 'Front-end'))
ON CONFLICT (name) DO NOTHING;
3_insert_employee_skills.sql
-- Insert employee skills
-- Records have been deduplicated and filtered for valid employees only
-- Using TRIM() in WHERE clause to handle whitespace in database
INSERT INTO employee_skills (employee_id, skill_id, years_of_experience)
VALUES
(
(SELECT id FROM employees WHERE TRIM(first_name) = 'John' AND TRIM(last_name) = 'Doe'),
(SELECT id FROM skills WHERE name = 'C#'),
5
),
(
(SELECT id FROM employees WHERE TRIM(first_name) = 'John' AND TRIM(last_name) = 'Doe'),
(SELECT id FROM skills WHERE name = 'JavaScript'),
6
)
ON CONFLICT (employee_id, skill_id) DO UPDATE
SET years_of_experience = EXCLUDED.years_of_experience;
When the user provides a CSV file:
Parse the CSV structure
Query existing data from Supabase
Generate Script 1: Categories
Generate Script 2: Skills
Generate Script 3: Employee Skills
Present all files to the user
User uploads CSV file and says: "Parse this employee skills CSV and generate SQL insert scripts"
Skill responds:
This skill is configured to work with the Supabase project:
The skill automatically connects to this project when executing queries.
Cause: Duplicate employee-skill pairs in the generated INSERT statement Solution: The skill now deduplicates all records before generating SQL. If you see this error, it means deduplication was not performed. Prevention: Always deduplicate by (first_name, last_name, skill) and keep the highest years value
Cause: Employee from CSV not found in database (usually due to name spelling differences or whitespace issues) Solution: The skill now:
Common issues:
How it works:
TRIM(first_name) and TRIM(last_name) in SQL to handle database whitespaceResult: This error should no longer occur as names are automatically corrected and whitespace is handled
The skill uses the following approach: