GitLab Stack Validator by rknall/claude-skills
npx skills add https://github.com/rknall/claude-skills --skill 'GitLab Stack Validator'此技能用于验证 GitLab 栈项目,确保其遵循正确的架构模式并已做好部署准备。它侧重于问题的检测和报告,并与配套技能(stack-creator、secrets-manager)协同工作以进行修复。
当用户请求以下内容时激活此技能:
此技能验证遵循以下架构原则的栈:
当用户请求栈验证时,请遵循此综合工作流程:
步骤 1:验证栈项目
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
步骤 2:收集上下文
步骤 1:必需目录
./config - 配置文件目录./secrets - 密钥存储目录./_temporary - 临时文件目录步骤 2:目录权限
步骤 3:目录所有权
步骤 4:.gitignore 验证
./secrets 或 ./secrets/*./_temporary 或 ./_temporary/*.env(不应在 git 中)步骤 1:.env 文件验证
步骤 2:.env.example 验证
步骤 3:.env 同步检查
步骤 4:环境变量安全性
步骤 1:调用 docker-validation 技能
步骤 2:栈特定 Docker 检查
secrets: 部分定义secrets: 键引用密钥(而非环境变量)depends_on步骤 3:版本检查
步骤 1:密钥目录检查
步骤 2:Docker 密钥验证
步骤 3:密钥引用验证
secrets: 部分步骤 4:环境变量与密钥
步骤 5:密钥暴露检查
步骤 1:配置目录结构
步骤 2:配置文件验证
步骤 3:配置与密钥分离
步骤 4:配置所有权
步骤 1:docker-entrypoint.sh 检测
步骤 2:脚本权限
步骤 3:脚本内容验证
步骤 4:必要性检查
步骤 1:目录检查
步骤 2:内容检查
步骤 3:使用情况验证
步骤 1:全面所有权扫描
find . -type f -user root 2>/dev/null 查找 root 拥有的文件步骤 2:问题分类
步骤 3:影响评估
步骤 1:编译所有发现
步骤 2:生成验证报告
创建具有以下结构的综合报告:
🔍 GitLab Stack 验证报告
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
栈:[目录名称]
日期:[时间戳]
模式:[严格/宽松]
📊 摘要
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ 通过:[数量]
⚠️ 警告:[数量]
❌ 关键:[数量]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 详细发现
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[对于每个验证类别]
[类别图标] [类别名称]: [状态]
[如果发现问题:]
❌ [问题描述]
位置:[文件/目录路径]
影响:[影响内容]
详情:[具体信息]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 整体状态: [通过/失败/警告]
[如果失败或警告:]
🔧 推荐操作
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[按优先级排序的所需操作列表]
1. [最关键的操作]
2. [下一个操作]
...
💡 后续步骤
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- 使用 stack-creator 技能修复结构问题
- 使用 secrets-manager 技能正确配置密钥
- 修复后重新运行验证
步骤 3:提供可操作的指导
步骤 4:导出选项
如果用户请求 JSON 输出,导出为:
{
"stack": "directory-name",
"timestamp": "ISO-8601",
"summary": {
"passed": 5,
"warnings": 2,
"critical": 1,
"status": "failed"
},
"findings": [
{
"category": "environment-variables",
"status": "critical",
"issues": [...]
}
]
}
如果项目根目录中存在 .stack-validator.yml,请遵循以下设置:
# 验证模式
strict_mode: false
# 警告是否应导致验证失败
fail_on_warnings: false
# 从验证中排除的路径
exclude_paths:
- ./vendor
- ./node_modules
- ./_temporary/cache
# 要运行的自定义验证脚本
custom_checks:
- ./scripts/custom-validation.sh
# 要跳过的特定检查
skip_checks:
- temporary-directory-empty
报告验证结果时:
这些是生产栈必须通过的标准:
User: "验证我的栈"
1. 检查 docker-compose.yml 是否存在 ✅
2. 验证目录结构
- ./config ✅
- ./secrets ✅
- ./_temporary ⚠️ (不在 .gitignore 中)
3. 验证 .env 配置
- .env 存在 ✅
- .env.example 存在 ❌ 关键
4. 运行 docker-validation 技能
- docker-compose.yml 语法 ✅
- 密钥配置 ⚠️ (使用环境变量)
5. 检查密钥管理
- ./secrets 权限 ✅
- 密钥文件存在 ✅
6. 扫描所有权问题
- 在 ./config 中发现 3 个 root 拥有的文件 ❌
7. 生成包含发现的报告
8. 建议:使用 stack-creator 添加 .env.example 并修复 .gitignore
此技能通过全面验证确保栈的质量、安全性和部署就绪性。
每周安装次数
–
仓库
GitHub 星标数
33
首次出现时间
–
安全审计
This skill validates GitLab stack projects to ensure they follow proper architecture patterns and are ready for deployment. It focuses on detection and reporting of issues, working alongside companion skills (stack-creator, secrets-manager) for remediation.
Activate this skill when the user requests:
This skill validates stacks that follow these architecture principles:
When a user requests stack validation, follow this comprehensive workflow:
Step 1: Verify Stack Project
Step 2: Gather Context
Step 1: Required Directories
./config - Configuration files directory./secrets - Secrets storage directory./_temporary - Temporary files directoryStep 2: Directory Permissions
Step 3: Directory Ownership
Step 4: .gitignore Validation
./secrets or ./secrets/*./_temporary or ./_temporary/*.env (should not be in git)Step 1: .env File Validation
Step 2: .env.example Validation
Step 3: .env Synchronization Check
Step 4: Environment Variable Security
Step 1: Invoke docker-validation Skill
Step 2: Stack-Specific Docker Checks
secrets: sectionsecrets: key (not environment variables)depends_on correctlyStep 3: Version Check
Step 1: Secrets Directory Check
Step 2: Docker Secrets Validation
Step 3: Secret References Validation
secrets: sectionStep 4: Environment Variables vs Secrets
Step 5: Secret Exposure Check
Step 1: Config Directory Structure
Step 2: Config File Validation
Step 3: Config vs Secrets Separation
Step 4: Config Ownership
Step 1: docker-entrypoint.sh Detection
Step 2: Script Permissions
Step 3: Script Content Validation
Step 4: Necessity Check
Step 1: Directory Check
Step 2: Content Check
Step 3: Usage Validation
Step 1: Comprehensive Ownership Scan
find . -type f -user root 2>/dev/null to find root-owned filesStep 2: Categorize Issues
Step 3: Impact Assessment
Step 1: Compile All Findings
Step 2: Generate Validation Report
Create a comprehensive report with this structure:
🔍 GitLab Stack Validation Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Stack: [directory name]
Date: [timestamp]
Mode: [strict/permissive]
📊 SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Passed: [count]
⚠️ Warnings: [count]
❌ Critical: [count]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 DETAILED FINDINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[For each validation category]
[Category Icon] [Category Name]: [STATUS]
[If issues found:]
❌ [Issue description]
Location: [file/directory path]
Impact: [what this affects]
Details: [specific information]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 OVERALL STATUS: [PASSED/FAILED/WARNINGS]
[If failures or warnings:]
🔧 RECOMMENDED ACTIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Prioritized list of actions needed]
1. [Most critical action]
2. [Next action]
...
💡 NEXT STEPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Use stack-creator skill to fix structural issues
- Use secrets-manager skill to properly configure secrets
- Re-run validation after fixes
Step 3: Provide Actionable Guidance
Step 4: Export Options
If user requested JSON output, export as:
{
"stack": "directory-name",
"timestamp": "ISO-8601",
"summary": {
"passed": 5,
"warnings": 2,
"critical": 1,
"status": "failed"
},
"findings": [
{
"category": "environment-variables",
"status": "critical",
"issues": [...]
}
]
}
If .stack-validator.yml exists in project root, respect these settings:
# Validation mode
strict_mode: false
# Whether warnings should fail validation
fail_on_warnings: false
# Paths to exclude from validation
exclude_paths:
- ./vendor
- ./node_modules
- ./_temporary/cache
# Custom validation scripts to run
custom_checks:
- ./scripts/custom-validation.sh
# Specific checks to skip
skip_checks:
- temporary-directory-empty
When reporting validation results:
These are must-pass criteria for production stacks:
User: "Validate my stack"
1. Check if docker-compose.yml exists ✅
2. Verify directory structure
- ./config ✅
- ./secrets ✅
- ./_temporary ⚠️ (not in .gitignore)
3. Validate .env configuration
- .env exists ✅
- .env.example exists ❌ CRITICAL
4. Run docker-validation skill
- docker-compose.yml syntax ✅
- Secrets configuration ⚠️ (using environment vars)
5. Check secrets management
- ./secrets permissions ✅
- Secret files exist ✅
6. Scan for ownership issues
- Found 3 root-owned files in ./config ❌
7. Generate report with findings
8. Suggest: Use stack-creator to add .env.example and fix .gitignore
This skill ensures stack quality, security, and deployment readiness through comprehensive validation.
Weekly Installs
–
Repository
GitHub Stars
33
First Seen
–
Security Audits
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装