.cursor/skills/xfi-create-archetype/SKILL.md
Guide for creating a new X-Fidelity archetype configuration. Use when defining project templates, configuring rule sets, or setting up dependency requirements.
npx skillsauth add zotoio/x-fidelity xfi-create-archetypeInstall 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.
This skill guides you through creating a new archetype configuration for X-Fidelity.
An archetype is a project template that defines:
Archetype Creation:
- [ ] Step 1: Define archetype purpose
- [ ] Step 2: Create archetype JSON
- [ ] Step 3: Select rules to include
- [ ] Step 4: Configure dependency versions
- [ ] Step 5: Define directory structure
- [ ] Step 6: Set file patterns
- [ ] Step 7: Create exemptions file
- [ ] Step 8: Test the archetype
packages/x-fidelity-democonfig/src/
├── {archetype-name}.json # Main archetype config
├── {archetype-name}-exemptions.json # Default exemptions
└── {archetype-name}-exemptions/ # Team/project exemptions
├── team1-{archetype-name}-exemptions.json
└── project1-{archetype-name}-exemptions.json
Before creating, determine:
File: packages/x-fidelity-democonfig/src/{archetype-name}.json
{
"name": "my-archetype",
"rules": [
"sensitiveLogging-iterative",
"missingRequiredFiles-global"
],
"config": {
"blacklistPatterns": [
".*\\/node_modules\\/.*",
".*\\/\\..*"
],
"whitelistPatterns": [
".*\\.(ts|js)$"
]
}
}
{
"name": "my-archetype",
"rules": [
"sensitiveLogging-iterative",
"outdatedFramework-global",
"missingRequiredFiles-global",
"nonStandardDirectoryStructure-global",
"functionComplexity-iterative"
],
"config": {
"minimumDependencyVersions": {
"typescript": "5.0.0",
"react": "18.2.0"
},
"standardStructure": {
"src": {
"components": null,
"utils": null
},
"package.json": null,
"README.md": null
},
"blacklistPatterns": [
".*\\/\\..*",
".*\\.(log|lock|txt)$",
".*\\/(dist|coverage|build|node_modules)(\\/.*|$)"
],
"whitelistPatterns": [
".*\\.(ts|tsx|js|jsx|json)$",
".*\\/README\\.md$"
],
"requiredFiles": [
"README.md",
"package.json"
],
"sensitiveFileFalsePositives": [
"src/test/**"
],
"notifications": {
"enabled": true,
"providers": ["email"],
"recipients": {
"email": ["[email protected]"]
},
"codeOwners": true,
"notifyOnSuccess": true,
"notifyOnFailure": true
}
}
}
| Suffix | Type | Runs |
|--------|------|------|
| -global | Global | Once per repository |
| -iterative | Iterative | Once per matching file |
Check packages/x-fidelity-democonfig/src/rules/ for available rules.
Code Quality:
functionComplexity-iterative - Cyclomatic complexity checkfunctionCount-iterative - Function count per fileSecurity:
sensitiveLogging-iterative - Detect credential loggingnoDatabases-iterative - Prevent database config in codeDependencies:
outdatedFramework-global - Version requirement checkStructure:
missingRequiredFiles-global - Required file checknonStandardDirectoryStructure-global - Directory layoutReact:
reactHooksDependency-iterative - Hook dependency arraysreactHooksMigration-global - Migration patterns{
"minimumDependencyVersions": {
"react": "18.2.0", // Exact version
"typescript": ">=5.0.0", // Minimum version
"next": "^13.0.0", // Compatible version
"node": ">=18.0.0 <23.0.0", // Range
"@types/react": ">=18.0.0" // Scoped packages
}
}
| Operator | Meaning |
|----------|---------|
| 1.2.3 | Exact version |
| >=1.2.3 | Minimum version |
| ^1.2.3 | Compatible (same major) |
| ~1.2.3 | Approximate (same minor) |
| <1.2.3 | Less than |
| 1.0.0 - 2.0.0 | Range |
| 1.0.0 \|\| 2.0.0 | Either version |
{
"standardStructure": {
"src": { // Required directory
"components": null, // Required subdirectory
"utils": null,
"config": null
},
"tests": null, // Required directory
"package.json": null, // Required file
"README.md": null
}
}
null = terminal (file or empty directory)Files matching these patterns are skipped:
{
"blacklistPatterns": [
".*\\/\\..*", // Hidden files
".*\\.(log|lock|txt)$", // Log files
".*\\/(node_modules|dist|build)(\\/.*|$)" // Build dirs
]
}
Only files matching these patterns are analyzed:
{
"whitelistPatterns": [
".*\\.(ts|tsx|js|jsx)$", // TypeScript/JavaScript
".*\\.(json|yml|yaml)$", // Config files
".*\\/README\\.md$" // Specific file
]
}
Patterns use Java regex syntax:
.* - Any characters\\. - Literal dot$ - End of string\\/ - Path separator(a|b) - Either a or bFile: packages/x-fidelity-democonfig/src/{archetype-name}-exemptions.json
[
{
"repoUrl": "*",
"rule": "sensitiveLogging-iterative",
"expirationDate": "2025-12-31",
"reason": "Known pattern allowed in all repos"
}
]
File: packages/x-fidelity-democonfig/src/{archetype-name}-exemptions/team1-{archetype-name}-exemptions.json
[
{
"repoUrl": "[email protected]:org/repo.git",
"rule": "functionComplexity-iterative",
"expirationDate": "2025-06-30",
"reason": "Legacy code refactor scheduled for Q2"
}
]
| Field | Required | Description |
|-------|----------|-------------|
| repoUrl | Yes | Git URL or * for all |
| rule | Yes | Rule name to exempt |
| expirationDate | Yes | YYYY-MM-DD format |
| reason | Yes | Justification |
# Run with your archetype
cd /path/to/test/project
xfi --archetype my-archetype --configServer local
# Debug mode
xfi --archetype my-archetype --configServer local --debug
xfi --archetype my-archetype --debug 2>&1 | grep -E "(rule|trigger)"
{
"notifications": {
"enabled": true,
"providers": ["email", "slack"],
"recipients": {
"email": ["[email protected]"],
"slack": ["#quality-alerts"]
},
"codeOwners": true,
"notifyOnSuccess": true,
"notifyOnFailure": true,
"customTemplates": {
"success": "All checks passed! ✅",
"failure": "Issues found: ${totalIssues}"
}
}
}
Available in notification templates:
${archetype} - Archetype name${fileCount} - Files analyzed${executionTime} - Analysis duration${totalIssues} - Issue count${warningCount} - Warning count${errorCount} - Error count${fatalityCount} - Fatality count${affectedFiles} - Files with issuesReference existing archetypes:
node-fullstack - Full-featured Node.js templatejava-microservice - Java Spring Boot template| Purpose | Location |
|---------|----------|
| Archetypes | packages/x-fidelity-democonfig/src/*.json |
| Rules | packages/x-fidelity-democonfig/src/rules/ |
| Exemptions | packages/x-fidelity-democonfig/src/*-exemptions/ |
| Config schema | packages/x-fidelity-types/src/config.ts |
documentation
Guide for managing X-Fidelity releases using the unified release system. Use when releasing, versioning, troubleshooting release issues, or writing commit messages.
documentation
Guide for executing engineering plans through coordinated subagent work. Use when executing existing plans from knowledge/plans/ directory.
development
Guide for updating X-Fidelity documentation including README and website. Use when updating docs, adding new features to documentation, or ensuring docs stay in sync with code.
tools
Guide for debugging X-Fidelity analysis issues. Use when troubleshooting analysis failures, rule evaluation problems, VSCode extension issues, or unexpected results.