CI/CD Integration
Relevant source files
The following files were used as context for generating this wiki page:
The CI/CD Integration module in SkillKit provides a robust framework for automating the validation, testing, and deployment of AI agent skills. Its primary purpose is to ensure that specialized instruction files (SKILL.md) maintain high quality and structural integrity as they are modified or added to a repository. By integrating with popular DevOps platforms like GitHub, GitLab, and CircleCI, the system allows teams to enforce "Verification Gates" that prevent faulty or non-compliant skills from reaching production agents.
This module works in tandem with the Skill Testing Framework and Verification Gates to provide automated checkpoints. It leverages the skillkit validate and skillkit test commands to perform static analysis and functional verification within automated pipelines.
Sources: packages/core/src/cicd/index.ts:1-7, README.md:144-150, packages/core/src/methodology/packs/planning/verification-gates/SKILL.md:1-15
System Architecture and Workflow
The CI/CD integration follows a template-driven architecture where pre-defined configurations are injected into the local development environment or remote pipeline runners. The workflow typically begins with local validation via pre-commit hooks and culminates in comprehensive testing within a remote CI environment.
CI/CD Workflow Diagram
The following diagram illustrates the flow from a developer's local commit to the final validation in a remote repository.
Automation Templates
SkillKit provides built-in templates for various platforms. These templates are accessible via the skillkit cicd command and are designed to minimize the configuration overhead for developers.
Supported Platforms and Templates
| Platform | Template Variable | File Type | Purpose |
|---|---|---|---|
| GitHub Actions | GITHUB_ACTION_TEMPLATE | YAML | Automates validation on push/PR to specific skill paths. |
| GitLab CI | GITLAB_CI_TEMPLATE | YAML | Configures test stages and artifact collection for GitLab. |
| CircleCI | CIRCLECI_CONFIG_TEMPLATE | YAML | Defines Docker-based jobs for skill validation. |
| Git Hooks | PRE_COMMIT_HOOK_TEMPLATE | Bash | Runs local checks before code is committed to Git. |
| pre-commit | PRE_COMMIT_CONFIG_TEMPLATE | YAML | Integration for the pre-commit.com framework. |
Sources: packages/core/src/cicd/templates.ts:11-235, e2e/commands-settings.e2e.test.ts:303-345
Template Retrieval Logic
The getCICDTemplate function serves as the central API for retrieving these configurations based on a provider name.
export function getCICDTemplate(name: string): string | null {
switch (name.toLowerCase()) {
case 'github':
case 'github-action':
return GITHUB_ACTION_TEMPLATE;
case 'gitlab':
case 'gitlab-ci':
return GITLAB_CI_TEMPLATE;
// ... handles other cases
}
}
Sources: packages/core/src/cicd/templates.ts:241-262
Implementation of Verification Gates
Verification gates are formalized checkpoints within the CI/CD pipeline. These gates categorize validation into automated and manual processes to ensure multifaceted quality control.
Automated CI Gates
The following logic is embedded within the provided CI templates to enforce quality:
- Static Validation: Executes
skillkit validateto ensure YAML frontmatter is present, names are lowercase, and descriptions meet length requirements. - Functional Testing: Executes
skillkit test --jsonto run assertions defined for the skills. - Result Analysis: Uses tools like
jqto parse JSON test outputs and determine the exit status of the pipeline.
Sources: packages/core/src/cicd/templates.ts:46-70, packages/core/src/methodology/packs/planning/verification-gates/SKILL.md:105-125
Local Pre-commit Hook Flow
The local pre-commit hook acts as the first line of defense. It identifies staged files and only runs validation if changes are detected in relevant directories (e.g., .claude/skills/, .cursor/skills/).
Configuration and Usage
Users initialize CI/CD integration through the CLI. The command skillkit cicd init --provider <name> generates the necessary configuration files in the project root or relevant subdirectories (e.g., .github/workflows/).
CLI Command Options
| Option | Type | Description |
|---|---|---|
--provider | string | The CI/CD platform (e.g., github, gitlab, circleci). |
--dry-run | boolean | Previews the template without writing to disk. |
--json | boolean | Outputs template information in JSON format. |
Sources: e2e/commands-settings.e2e.test.ts:315-345, packages/core/src/cicd/templates.ts:267-275
Conclusion
CI/CD Integration in SkillKit bridges the gap between manual skill authoring and automated production environments. By utilizing standardized templates for GitHub, GitLab, and local Git hooks, the system ensures that AI agent instructions are consistently validated and tested. This automation is critical for maintaining the reliability of "Verification Gates," allowing developers to catch errors early in the lifecycle and maintain a high standard for portable AI agent skills.
Sources: README.md:144-150, packages/core/src/methodology/packs/planning/verification-gates/SKILL.md:160-180