@hybridlabor-api/aos 4.8.0 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/.agents/{agents.md → AGENTS.md} +3 -1
  2. package/.agents/nodes.json +3 -1
  3. package/.agents/vendor-manifest.json +23 -1
  4. package/.claude/agents/godmode-media-eventtech.md +1 -1
  5. package/.claude/hooks/conventional-commits.mjs +125 -0
  6. package/.claude/hooks/env-file-protection.mjs +105 -0
  7. package/.claude/hooks/go-gate.mjs +101 -81
  8. package/.claude/hooks/memb-inject.mjs +29 -1
  9. package/.claude/settings.json +13 -0
  10. package/.claude/workflows/startcycle-dispatch.mjs +23 -1
  11. package/.opencode/agents/godmode-media-eventtech.md +1 -1
  12. package/.opencode/plugins/bdb-aos.js +31 -4
  13. package/CLAUDE.md +0 -571
  14. package/README.de.md +1 -1
  15. package/README.md +1 -1
  16. package/README.pt.md +1 -1
  17. package/THIRD_PARTY_NOTICES.md +126 -0
  18. package/bin/aos-doctor.mjs +1 -1
  19. package/docs/skills_table.md +1 -1
  20. package/installer.js +187 -55
  21. package/package.json +7 -3
  22. package/packages/aos-cli/README.md +80 -0
  23. package/packages/aos-cli/bin/aos-cli.mjs +134 -0
  24. package/packages/aos-cli/core-skills.json +12 -0
  25. package/packages/aos-cli/extensions/aos.ts +321 -0
  26. package/packages/aos-cli/package-lock.json +1923 -0
  27. package/packages/aos-cli/package.json +29 -0
  28. package/packages/aos-cli/scripts/check-theme.mjs +63 -0
  29. package/packages/aos-cli/themes/aos.json +97 -0
  30. package/scripts/build-plugin-manifest.mjs +131 -0
  31. package/scripts/validate-skills.mjs +81 -6
  32. package/skills/basic/ao-orchestrator/SKILL.md +116 -0
  33. package/skills/basic/bdb-eventagency-skill/SKILL.md +252 -0
  34. package/skills/basic/bdb-shipping-skill/SKILL.md +161 -0
  35. package/skills/basic/godmode-eventtech/SKILL.md +4 -1
  36. package/skills/global_config/agenttrail/SKILL.md +6 -1
  37. package/skills/global_config/aos-project-init/SKILL.md +2 -0
  38. package/skills/global_config/aos-project-init/assets/AGENTS.template.md +1 -1
  39. package/skills/global_config/aos-project-init/scripts/aos-project-doctor.mjs +1 -1
  40. package/skills/global_config/aos-setup/SKILL.md +1 -1
  41. package/skills/global_config/aos-setup/scripts/aos-doctor.mjs +1 -1
  42. package/skills/global_config/ask-tim/SKILL.md +7 -7
  43. package/skills/global_config/bash-script-generator/SKILL.md +201 -0
  44. package/skills/global_config/bash-script-generator/assets/templates/standard-template.sh +96 -0
  45. package/skills/global_config/bash-script-generator/docs/bash-scripting-guide.md +729 -0
  46. package/skills/global_config/bash-script-generator/docs/generation-best-practices.md +193 -0
  47. package/skills/global_config/bash-script-generator/docs/script-patterns.md +566 -0
  48. package/skills/global_config/bash-script-generator/docs/text-processing-guide.md +437 -0
  49. package/skills/global_config/bash-script-generator/examples/log-analyzer.sh +92 -0
  50. package/skills/global_config/bash-script-generator/scripts/generate_script_template.sh +123 -0
  51. package/skills/global_config/bash-script-generator/scripts/run_ci_checks.sh +172 -0
  52. package/skills/global_config/bash-script-generator/scripts/test_generator.sh +413 -0
  53. package/skills/global_config/bash-script-validator/SKILL.md +249 -0
  54. package/skills/global_config/bash-script-validator/docs/awk-reference.md +449 -0
  55. package/skills/global_config/bash-script-validator/docs/bash-reference.md +468 -0
  56. package/skills/global_config/bash-script-validator/docs/common-mistakes.md +623 -0
  57. package/skills/global_config/bash-script-validator/docs/grep-reference.md +395 -0
  58. package/skills/global_config/bash-script-validator/docs/regex-reference.md +391 -0
  59. package/skills/global_config/bash-script-validator/docs/sed-reference.md +454 -0
  60. package/skills/global_config/bash-script-validator/docs/shell-reference.md +463 -0
  61. package/skills/global_config/bash-script-validator/docs/shellcheck-reference.md +399 -0
  62. package/skills/global_config/bash-script-validator/examples/bad-bash.sh +55 -0
  63. package/skills/global_config/bash-script-validator/examples/bad-shell.sh +54 -0
  64. package/skills/global_config/bash-script-validator/examples/good-bash.sh +71 -0
  65. package/skills/global_config/bash-script-validator/examples/good-shell.sh +69 -0
  66. package/skills/global_config/bash-script-validator/scripts/run_ci_checks.sh +23 -0
  67. package/skills/global_config/bash-script-validator/scripts/shellcheck_wrapper.sh +174 -0
  68. package/skills/global_config/bash-script-validator/scripts/test_validate.sh +446 -0
  69. package/skills/global_config/bash-script-validator/scripts/validate.sh +512 -0
  70. package/skills/global_config/ci-pipeline/SKILL.md +135 -0
  71. package/skills/global_config/deja-memory/SKILL.md +3 -1
  72. package/skills/global_config/dispatching-parallel-agents/SKILL.md +170 -0
  73. package/skills/global_config/dockerfile-generator/SKILL.md +1038 -0
  74. package/skills/global_config/dockerfile-generator/examples/example.dockerignore +95 -0
  75. package/skills/global_config/dockerfile-generator/examples/golang-distroless.Dockerfile +34 -0
  76. package/skills/global_config/dockerfile-generator/examples/java-springboot.Dockerfile +45 -0
  77. package/skills/global_config/dockerfile-generator/examples/nextjs-production.Dockerfile +49 -0
  78. package/skills/global_config/dockerfile-generator/examples/nodejs-multistage.Dockerfile +55 -0
  79. package/skills/global_config/dockerfile-generator/examples/python-fastapi.Dockerfile +48 -0
  80. package/skills/global_config/dockerfile-generator/references/language_specific_guides.md +510 -0
  81. package/skills/global_config/dockerfile-generator/references/multistage_builds.md +570 -0
  82. package/skills/global_config/dockerfile-generator/references/optimization_patterns.md +492 -0
  83. package/skills/global_config/dockerfile-generator/references/security_best_practices.md +375 -0
  84. package/skills/global_config/dockerfile-generator/scripts/generate_dockerignore.sh +199 -0
  85. package/skills/global_config/dockerfile-generator/scripts/generate_golang.sh +172 -0
  86. package/skills/global_config/dockerfile-generator/scripts/generate_java.sh +185 -0
  87. package/skills/global_config/dockerfile-generator/scripts/generate_nodejs.sh +279 -0
  88. package/skills/global_config/dockerfile-generator/scripts/generate_python.sh +218 -0
  89. package/skills/global_config/dockerfile-generator/scripts/test_generator.sh +210 -0
  90. package/skills/global_config/dockerfile-validator/SKILL.md +300 -0
  91. package/skills/global_config/dockerfile-validator/examples/.dockerignore.example +34 -0
  92. package/skills/global_config/dockerfile-validator/examples/bad-example.Dockerfile +37 -0
  93. package/skills/global_config/dockerfile-validator/examples/golang-distroless.Dockerfile +50 -0
  94. package/skills/global_config/dockerfile-validator/examples/good-example.Dockerfile +52 -0
  95. package/skills/global_config/dockerfile-validator/examples/python-optimized.Dockerfile +53 -0
  96. package/skills/global_config/dockerfile-validator/examples/security-issues.Dockerfile +42 -0
  97. package/skills/global_config/dockerfile-validator/references/docker_best_practices.md +348 -0
  98. package/skills/global_config/dockerfile-validator/references/optimization_guide.md +473 -0
  99. package/skills/global_config/dockerfile-validator/references/security_checklist.md +208 -0
  100. package/skills/global_config/dockerfile-validator/scripts/dockerfile-validate.sh +699 -0
  101. package/skills/global_config/dockerfile-validator/scripts/test_validate.sh +35 -0
  102. package/skills/global_config/dockerfile-validator/tests/fixtures/copy-before-yarn-lock-read.Dockerfile +6 -0
  103. package/skills/global_config/dockerfile-validator/tests/fixtures/copy-before-yarn.Dockerfile +6 -0
  104. package/skills/global_config/dockerfile-validator/tests/fixtures/from-platform-nonroot.Dockerfile +7 -0
  105. package/skills/global_config/dockerfile-validator/tests/test_regression.sh +164 -0
  106. package/skills/global_config/finishing-a-development-branch/SKILL.md +228 -0
  107. package/skills/global_config/github-actions-generator/SKILL.md +353 -0
  108. package/skills/global_config/github-actions-generator/assets/templates/action/composite/action.yml +82 -0
  109. package/skills/global_config/github-actions-generator/assets/templates/action/docker/Dockerfile +25 -0
  110. package/skills/global_config/github-actions-generator/assets/templates/action/docker/action.yml +42 -0
  111. package/skills/global_config/github-actions-generator/assets/templates/action/docker/entrypoint.sh +27 -0
  112. package/skills/global_config/github-actions-generator/assets/templates/action/javascript/action.yml +33 -0
  113. package/skills/global_config/github-actions-generator/assets/templates/action/javascript/index.js +50 -0
  114. package/skills/global_config/github-actions-generator/assets/templates/action/javascript/package.json +27 -0
  115. package/skills/global_config/github-actions-generator/assets/templates/workflow/basic_workflow.yml +242 -0
  116. package/skills/global_config/github-actions-generator/assets/templates/workflow/reusable_workflow.yml +106 -0
  117. package/skills/global_config/github-actions-generator/examples/README.md +147 -0
  118. package/skills/global_config/github-actions-generator/examples/actions/setup-node-cached/action.yml +93 -0
  119. package/skills/global_config/github-actions-generator/examples/caching/docker-buildkit.yml +256 -0
  120. package/skills/global_config/github-actions-generator/examples/security/dependency-review.yml +62 -0
  121. package/skills/global_config/github-actions-generator/examples/security/sbom-attestation.yml +119 -0
  122. package/skills/global_config/github-actions-generator/examples/triggers/chatops-commands.yml +475 -0
  123. package/skills/global_config/github-actions-generator/examples/triggers/repository-dispatch.yml +418 -0
  124. package/skills/global_config/github-actions-generator/examples/triggers/workflow-orchestration.yml +404 -0
  125. package/skills/global_config/github-actions-generator/examples/workflows/docker-build-push.yml +68 -0
  126. package/skills/global_config/github-actions-generator/examples/workflows/go-ci.yml +161 -0
  127. package/skills/global_config/github-actions-generator/examples/workflows/monorepo-ci.yml +340 -0
  128. package/skills/global_config/github-actions-generator/examples/workflows/multi-environment-deploy.yml +406 -0
  129. package/skills/global_config/github-actions-generator/examples/workflows/nodejs-ci.yml +122 -0
  130. package/skills/global_config/github-actions-generator/examples/workflows/python-ci.yml +157 -0
  131. package/skills/global_config/github-actions-generator/examples/workflows/scheduled-tasks.yml +376 -0
  132. package/skills/global_config/github-actions-generator/references/advanced-triggers.md +917 -0
  133. package/skills/global_config/github-actions-generator/references/best-practices.md +755 -0
  134. package/skills/global_config/github-actions-generator/references/common-actions.md +715 -0
  135. package/skills/global_config/github-actions-generator/references/custom-actions.md +320 -0
  136. package/skills/global_config/github-actions-generator/references/expressions-and-contexts.md +688 -0
  137. package/skills/global_config/github-actions-generator/references/modern-features.md +421 -0
  138. package/skills/global_config/github-actions-generator/scripts/test_generator.sh +344 -0
  139. package/skills/global_config/github-actions-templates/SKILL.md +7 -0
  140. package/skills/global_config/github-actions-validator/SKILL.md +576 -0
  141. package/skills/global_config/github-actions-validator/examples/README.md +88 -0
  142. package/skills/global_config/github-actions-validator/examples/outdated-versions.yml +76 -0
  143. package/skills/global_config/github-actions-validator/examples/valid-ci.yml +79 -0
  144. package/skills/global_config/github-actions-validator/examples/with-errors.yml +47 -0
  145. package/skills/global_config/github-actions-validator/references/act_usage.md +233 -0
  146. package/skills/global_config/github-actions-validator/references/action_versions.md +122 -0
  147. package/skills/global_config/github-actions-validator/references/actionlint_usage.md +343 -0
  148. package/skills/global_config/github-actions-validator/references/common_errors.md +512 -0
  149. package/skills/global_config/github-actions-validator/references/modern_features.md +384 -0
  150. package/skills/global_config/github-actions-validator/references/runners.md +317 -0
  151. package/skills/global_config/github-actions-validator/scripts/install_tools.sh +113 -0
  152. package/skills/global_config/github-actions-validator/scripts/validate_workflow.sh +910 -0
  153. package/skills/global_config/github-actions-validator/tests/test_validate_workflow.sh +237 -0
  154. package/skills/global_config/makefile-generator/SKILL.md +614 -0
  155. package/skills/global_config/makefile-generator/assets/templates/.gitkeep +1 -0
  156. package/skills/global_config/makefile-generator/docs/makefile-structure.md +530 -0
  157. package/skills/global_config/makefile-generator/docs/optimization-guide.md +784 -0
  158. package/skills/global_config/makefile-generator/docs/patterns-guide.md +642 -0
  159. package/skills/global_config/makefile-generator/docs/security-guide.md +361 -0
  160. package/skills/global_config/makefile-generator/docs/targets-guide.md +642 -0
  161. package/skills/global_config/makefile-generator/docs/variables-guide.md +596 -0
  162. package/skills/global_config/makefile-generator/scripts/add_standard_targets.sh +539 -0
  163. package/skills/global_config/makefile-generator/scripts/generate_makefile_template.sh +690 -0
  164. package/skills/global_config/makefile-generator/test/test_helper_scripts.sh +190 -0
  165. package/skills/global_config/makefile-validator/SKILL.md +244 -0
  166. package/skills/global_config/makefile-validator/docs/bake-tool.md +1000 -0
  167. package/skills/global_config/makefile-validator/docs/best-practices.md +858 -0
  168. package/skills/global_config/makefile-validator/docs/common-mistakes.md +944 -0
  169. package/skills/global_config/makefile-validator/examples/bad-makefile.mk +77 -0
  170. package/skills/global_config/makefile-validator/examples/good-makefile.mk +103 -0
  171. package/skills/global_config/makefile-validator/scripts/test_validate.sh +382 -0
  172. package/skills/global_config/makefile-validator/scripts/validate_makefile.sh +712 -0
  173. package/skills/global_config/{MCP_Manage → mcp-manage}/SKILL.md +3 -3
  174. package/skills/global_config/plan-canvas/SKILL.md +9 -2
  175. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js +10 -2
  176. package/skills/global_config/plan-canvas/scripts/plan-canvas.js +1 -1
  177. package/skills/global_config/read-the-damn-docs/SKILL.md +175 -0
  178. package/skills/global_config/requesting-code-review/SKILL.md +98 -0
  179. package/skills/global_config/requesting-code-review/code-reviewer.md +198 -0
  180. package/skills/global_config/using-git-worktrees/SKILL.md +170 -0
  181. package/skills/global_config/verification-before-completion/SKILL.md +123 -0
  182. package/skills/global_config/writing-plans/SKILL.md +126 -46
  183. package/skills/global_config/writing-plans-legacy/SKILL.md +152 -0
  184. package/.claude/CLAUDE.md +0 -12
  185. package/mcps/RhinoMCP/docs/content/docs/getting-started/gemini.md +0 -61
  186. /package/{GEMINI.md → RULES.md} +0 -0
@@ -0,0 +1,576 @@
1
+ ---
2
+ name: github-actions-validator
3
+ description: Validate, lint, audit, fix GitHub Actions workflows (.github/workflows).
4
+ category: engineering-method
5
+ source: cc-devops-skills
6
+ date_added: "2026-09-25"
7
+ ---
8
+
9
+ # GitHub Actions Validator
10
+
11
+ ## Overview
12
+
13
+ Validate and test GitHub Actions workflows, custom actions, and public actions using industry-standard tools (actionlint and act). This skill provides comprehensive validation including syntax checking, static analysis, local workflow execution testing, and action verification with version-aware documentation lookup.
14
+
15
+ ## Trigger Phrases
16
+
17
+ Use this skill when the request includes phrases like:
18
+ - "validate this GitHub Actions workflow"
19
+ - "check my `.github/workflows/*.yml` file"
20
+ - "debug actionlint errors"
21
+ - "test this workflow locally with act"
22
+ - "verify GitHub Action versions or deprecations"
23
+
24
+ ## When to Use This Skill
25
+
26
+ Use this skill when:
27
+ - **Validating workflow files**: Checking `.github/workflows/*.yml` for syntax errors and best practices
28
+ - **Testing workflows locally**: Running workflows with `act` before pushing to GitHub
29
+ - **Debugging workflow failures**: Identifying issues in workflow configuration
30
+ - **Validating custom actions**: Checking composite, Docker, or JavaScript actions
31
+ - **Verifying public actions**: Validating usage of actions from GitHub Marketplace
32
+ - **Pre-commit validation**: Ensuring workflows are valid before committing
33
+
34
+ ## Required Execution Flow
35
+
36
+ Every validation run should follow these steps in order.
37
+
38
+ ### Step 1: Set Skill Path and Run Validation
39
+
40
+ Run commands from the repository root that contains `.github/workflows/`.
41
+
42
+ ```bash
43
+ SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
44
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" <workflow-file-or-directory>
45
+ ```
46
+
47
+ ### Step 2: Map Each Error to a Reference
48
+
49
+ For each actionlint/act error, consult the mapping table below, then extract the matching fix pattern.
50
+
51
+ ### Step 3: Apply Minimal-Quote Policy
52
+
53
+ For each issue:
54
+ 1. Include the exact error line from tool output.
55
+ 2. Quote only the smallest useful snippet from `references/` (prefer <=8 lines).
56
+ 3. Paraphrase the rest and cite the source file/section.
57
+ 4. Show corrected workflow code.
58
+
59
+ ### Step 4: Handle Unmapped Errors Explicitly
60
+
61
+ If an error does not match any mapping:
62
+ 1. Label it as `UNMAPPED`.
63
+ 2. Capture exact tool output, workflow file, and line number (if available).
64
+ 3. Check `references/common_errors.md` general sections first.
65
+ 4. If still unresolved, search official docs with the exact error string.
66
+ 5. Mark the fix as `provisional` until post-fix rerun passes.
67
+
68
+ ### Step 5: Verify Public Action Versions
69
+
70
+ For each `uses: owner/action@version`:
71
+ 1. Check `references/action_versions.md`.
72
+ 2. For unknown actions, verify against official docs.
73
+ 3. Confirm required inputs and deprecations.
74
+
75
+ Offline mode behavior:
76
+ - If network/doc lookup is unavailable, rely on `references/action_versions.md` only.
77
+ - Mark unknown actions as `UNVERIFIED-OFFLINE`.
78
+ - Do not claim "latest" version without an online verification pass.
79
+
80
+ ### Step 6: Mandatory Post-Fix Rerun
81
+
82
+ After applying fixes, rerun validation before finalizing:
83
+
84
+ ```bash
85
+ SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
86
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" <workflow-file-or-directory>
87
+ ```
88
+
89
+ ### Step 7: Provide Final Summary
90
+
91
+ Final output should include:
92
+ - Issues found and fixes applied
93
+ - Any `UNMAPPED` or `UNVERIFIED-OFFLINE` items
94
+ - Post-fix rerun command and result
95
+ - Remaining warnings/risk notes
96
+
97
+ ### Error Type to Reference File Mapping
98
+
99
+ | Error Pattern in Output | Reference File to Read | Section to Quote |
100
+ |------------------------|----------------------|------------------|
101
+ | `runs-on:`, `runner`, `ubuntu`, `macos`, `windows` | `references/runners.md` | Runner labels |
102
+ | `cron`, `schedule` | `references/common_errors.md` | Schedule Errors |
103
+ | `${{`, `expression`, `if:` | `references/common_errors.md` | Expression Errors |
104
+ | `needs:`, `job`, `dependency` | `references/common_errors.md` | Job Configuration Errors |
105
+ | `uses:`, `action`, `input` | `references/common_errors.md` | Action Errors |
106
+ | `untrusted`, `injection`, `security` | `references/common_errors.md` | Script Injection section |
107
+ | `syntax`, `yaml`, `unexpected` | `references/common_errors.md` | Syntax Errors |
108
+ | `docker`, `container` | `references/act_usage.md` | Troubleshooting |
109
+ | `@v3`, `@v4`, `deprecated`, `outdated` | `references/action_versions.md` | Version table |
110
+ | `workflow_call`, `reusable`, `oidc` | `references/modern_features.md` | Relevant section |
111
+ | `glob`, `path`, `paths:`, `pattern` | `references/common_errors.md` | Path Filter Errors |
112
+
113
+ ### Example: Complete Error Handling Workflow
114
+
115
+ **User's workflow has this error:**
116
+ ```
117
+ runs-on: ubuntu-lastest
118
+ ```
119
+
120
+ **Step 1 - Script output:**
121
+ ```
122
+ label "ubuntu-lastest" is unknown
123
+ ```
124
+
125
+ **Step 2 - Read `references/runners.md` or `references/common_errors.md`:**
126
+ Find the "Invalid Runner Label" section.
127
+
128
+ **Step 3 - Quote the fix to user:**
129
+
130
+ > **Error:** `label "ubuntu-lastest" is unknown`
131
+ >
132
+ > **Cause:** Typo in runner label (from `references/common_errors.md`):
133
+ > ```yaml
134
+ > # Bad
135
+ > runs-on: ubuntu-lastest # Typo
136
+ > ```
137
+ >
138
+ > **Fix** (from `references/common_errors.md`):
139
+ > ```yaml
140
+ > # Good
141
+ > runs-on: ubuntu-latest
142
+ > ```
143
+ >
144
+ > **Valid runner labels** (from `references/runners.md`):
145
+ > - `ubuntu-latest`, `ubuntu-24.04`, `ubuntu-22.04`
146
+ > - `windows-latest`, `windows-2025`, `windows-2022`
147
+ > - `macos-latest`, `macos-15`, `macos-14`
148
+
149
+ **Step 4 - Provide corrected code:**
150
+ ```yaml
151
+ runs-on: ubuntu-latest
152
+ ```
153
+
154
+ ## Quick Start
155
+
156
+ Set once per shell session:
157
+
158
+ ```bash
159
+ SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
160
+ ```
161
+
162
+ ### Initial Setup
163
+
164
+ ```bash
165
+ bash "$SKILL_DIR/scripts/install_tools.sh"
166
+ ```
167
+
168
+ This installs **act** (local workflow execution) and **actionlint** (static analysis) to `scripts/.tools/`.
169
+
170
+ ### Basic Validation
171
+
172
+ ```bash
173
+ # Validate a single workflow
174
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/ci.yml
175
+
176
+ # Validate all workflows
177
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/
178
+
179
+ # Lint-only (fastest)
180
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only .github/workflows/ci.yml
181
+
182
+ # Test-only with act (requires Docker)
183
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --test-only .github/workflows/
184
+ ```
185
+
186
+ ## Core Validation Workflow
187
+
188
+ ### 1. Static Analysis with actionlint
189
+
190
+ Start with static analysis to catch syntax errors and common issues:
191
+
192
+ ```bash
193
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only .github/workflows/ci.yml
194
+ ```
195
+
196
+ **What actionlint checks:** YAML syntax, schema compliance, expression syntax, runner labels, action inputs/outputs, job dependencies, CRON syntax, glob patterns, shell scripts, security vulnerabilities.
197
+
198
+ ### 2. Local Testing with act
199
+
200
+ After passing static analysis, test workflow execution:
201
+
202
+ ```bash
203
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --test-only .github/workflows/
204
+ ```
205
+
206
+ **Note:** act has limitations - see `references/act_usage.md`.
207
+
208
+ ### 3. Full Validation
209
+
210
+ ```bash
211
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/ci.yml
212
+ ```
213
+
214
+ Default behavior if tools/runtime are unavailable:
215
+ - If `act` is missing, full validation falls back to actionlint-only.
216
+ - If Docker is unavailable, full validation skips act and continues with actionlint.
217
+ - `--check-versions` works in offline/local mode using `references/action_versions.md`.
218
+
219
+ ## Validating Resource Types
220
+
221
+ ### Workflows
222
+
223
+ ```bash
224
+ # Single workflow
225
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/ci.yml
226
+
227
+ # All workflows
228
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/
229
+ ```
230
+
231
+ **Key validation points:** triggers, job configurations, runner labels, environment variables, secrets, conditionals, matrix strategies.
232
+
233
+ ### Custom Local Actions
234
+
235
+ Create a test workflow that uses the custom action, then validate:
236
+
237
+ ```bash
238
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/test-custom-action.yml
239
+ ```
240
+
241
+ ### Public Actions
242
+
243
+ When workflows use public actions (e.g., `actions/checkout@v6`):
244
+
245
+ 1. Check `references/action_versions.md` first
246
+ 2. Use official docs (or web search) for unknown actions
247
+ 3. Verify required inputs and version
248
+ 4. Check for deprecation warnings
249
+ 5. Run validation script
250
+
251
+ If offline:
252
+ - Mark unknown versions as `UNVERIFIED-OFFLINE`
253
+ - Avoid "latest/current" claims until online verification is possible
254
+
255
+ **Search format:** `"[action-name] [version] github action documentation"`
256
+
257
+ ## Reference File Consultation Guide
258
+
259
+ ### Mandatory Reference Consultation
260
+
261
+ | Situation | Reference File | Action |
262
+ |-----------|---------------|--------|
263
+ | actionlint reports any mapped error | `references/common_errors.md` | Find matching error and apply minimal quote policy |
264
+ | actionlint reports unmapped error | `references/common_errors.md` + official docs | Label as `UNMAPPED`, capture exact output and verify by rerun |
265
+ | act fails with Docker/runtime error | `references/act_usage.md` | Check Troubleshooting section |
266
+ | act fails but workflow works on GitHub | `references/act_usage.md` | Read Limitations section |
267
+ | User asks about actionlint config | `references/actionlint_usage.md` | Provide examples |
268
+ | User asks about act options | `references/act_usage.md` | Read Advanced Options |
269
+ | Security vulnerability detected | `references/common_errors.md` | Quote minimal safe fix snippet |
270
+ | Validating action versions | `references/action_versions.md` | Check version table and offline note |
271
+ | Using modern features | `references/modern_features.md` | Check syntax examples |
272
+ | Runner questions/errors | `references/runners.md` | Check labels and availability |
273
+
274
+ ### Script Output to Reference Mapping
275
+
276
+ | Output Pattern | Reference File |
277
+ |----------------|----------------|
278
+ | `[syntax-check]`, parse, YAML errors | `common_errors.md` - Syntax Errors |
279
+ | `[expression]`, `${{`, condition parsing | `common_errors.md` - Expression Errors |
280
+ | `[action]`, `uses:`, input/output mismatch | `common_errors.md` - Action Errors |
281
+ | `[events]` with CRON/schedule text | `common_errors.md` - Schedule Errors |
282
+ | `potentially untrusted`, injection warnings | `common_errors.md` - Security section |
283
+ | `[runner-label]` or unknown `runs-on` label | `runners.md` |
284
+ | `[job-needs]` dependency errors | `common_errors.md` - Job Configuration Errors |
285
+ | `[glob]`, `paths`, pattern errors | `common_errors.md` - Path Filter Errors |
286
+ | Docker/pull/image errors from act | `act_usage.md` - Troubleshooting |
287
+ | No pattern match | `common_errors.md` + official docs (label `UNMAPPED`) |
288
+
289
+ ## Reference Files Summary
290
+
291
+ | File | Content |
292
+ |------|---------|
293
+ | `references/act_usage.md` | Act tool usage, commands, options, limitations, troubleshooting |
294
+ | `references/actionlint_usage.md` | Actionlint validation categories, configuration, integration |
295
+ | `references/common_errors.md` | Common errors catalog with fixes |
296
+ | `references/action_versions.md` | Current action versions, deprecation timeline, SHA pinning |
297
+ | `references/modern_features.md` | Reusable workflows, SBOM, OIDC, environments, containers |
298
+ | `references/runners.md` | GitHub-hosted runners (ARM64, GPU, M2 Pro, deprecations) |
299
+
300
+ ## Troubleshooting
301
+
302
+ | Issue | Solution |
303
+ |-------|----------|
304
+ | "Tools not found" | Run `bash "$SKILL_DIR/scripts/install_tools.sh"` |
305
+ | "Docker daemon not running" | Start Docker or use `--lint-only` |
306
+ | "Permission denied" | Run `chmod +x "$SKILL_DIR"/scripts/*.sh` |
307
+ | act fails but GitHub works | See `references/act_usage.md` Limitations |
308
+
309
+ ### Debug Mode
310
+
311
+ ```bash
312
+ actionlint -verbose .github/workflows/ci.yml # Verbose actionlint
313
+ act -v # Verbose act
314
+ act -n # Dry-run (no execution)
315
+ ```
316
+
317
+ ## Best Practices
318
+
319
+ 1. **Always validate locally first** - Catch errors before pushing
320
+ 2. **Use actionlint in CI/CD** - Automate validation in pipelines
321
+ 3. **Pin action versions** - Use `@v6` not `@main` for stability; SHA pinning for security
322
+ 4. **Keep tools updated** - Regularly update actionlint and act
323
+ 5. **Use official docs for unknown actions** - Verify usage and versions
324
+ 6. **Check version compatibility** - See `references/action_versions.md`
325
+ 7. **Enable shellcheck** - Catch shell script issues early
326
+ 8. **Review security warnings** - Address script injection issues
327
+
328
+ ## Limitations
329
+
330
+ - **act limitations**: Not all GitHub Actions features work locally
331
+ - **Docker requirement**: act requires Docker to be running
332
+ - **Network actions**: Some GitHub API actions may fail locally
333
+ - **Private actions**: Cannot validate without access
334
+ - **Runtime behavior**: Static analysis cannot catch all issues
335
+ - **File location**: act can only validate workflows in `.github/workflows/` directory; files outside (like `examples/`) can only be validated with actionlint
336
+
337
+ ## Quick Examples
338
+
339
+ ### Example 1: Pre-commit Validation
340
+
341
+ ```bash
342
+ SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
343
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/
344
+ git add .github/workflows/ && git commit -m "Update workflows"
345
+ ```
346
+
347
+ ### Example 2: Debug Failing Workflow
348
+
349
+ ```bash
350
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only .github/workflows/failing.yml
351
+ # Fix issues
352
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/failing.yml
353
+ ```
354
+
355
+ ## Complete Worked Example: Multi-Error Workflow
356
+
357
+ This example demonstrates the **full assistant workflow** for handling multiple errors.
358
+
359
+ ### User's Problematic Workflow
360
+
361
+ ```yaml
362
+ name: Broken CI
363
+ on:
364
+ schedule:
365
+ - cron: '0 0 * * 8' # ERROR 1
366
+ jobs:
367
+ build:
368
+ runs-on: ubuntu-lastest # ERROR 2
369
+ steps:
370
+ - uses: actions/checkout@v3 # ERROR 3 (outdated)
371
+ - run: echo ${{ github.event.issue.title }} # ERROR 4 (security)
372
+ deploy:
373
+ needs: biuld # ERROR 5 (typo)
374
+ runs-on: ubuntu-latest
375
+ steps:
376
+ - run: echo "Deploying"
377
+ ```
378
+
379
+ ### Step 1: Run Validation
380
+
381
+ ```bash
382
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only workflow.yml
383
+ ```
384
+
385
+ **Output:**
386
+ ```
387
+ [ERROR] invalid CRON format "0 0 * * 8"
388
+ [ERROR] label "ubuntu-lastest" is unknown
389
+ [WARN] "github.event.issue.title" is potentially untrusted
390
+ [ERROR] job "deploy" needs job "biuld" which does not exist
391
+ ```
392
+
393
+ ### Step 2-3: Consult References and Quote Fixes
394
+
395
+ ---
396
+
397
+ **Error 1: Invalid CRON Expression**
398
+
399
+ *From `references/common_errors.md` - Schedule Errors:*
400
+
401
+ > **Cause:** Day of week 8 doesn't exist (valid: 0-6, where 0 = Sunday)
402
+ >
403
+ > ```yaml
404
+ > # Bad
405
+ > schedule:
406
+ > - cron: '0 0 * * 8' # Day 8 doesn't exist
407
+ >
408
+ > # Good
409
+ > schedule:
410
+ > - cron: '0 0 * * 0' # Sunday
411
+ > ```
412
+ >
413
+ > **CRON format:** `minute hour day month weekday`
414
+ > - Weekday: 0-6 (0 = Sunday)
415
+
416
+ **Fix:** Change `8` to `0` (Sunday) or `1-6` for Monday-Saturday.
417
+
418
+ ---
419
+
420
+ **Error 2: Invalid Runner Label**
421
+
422
+ *From `references/common_errors.md` - Job Configuration Errors and `references/runners.md`:*
423
+
424
+ > **Cause:** Typo in runner label
425
+ >
426
+ > ```yaml
427
+ > # Bad
428
+ > runs-on: ubuntu-lastest # Typo
429
+ >
430
+ > # Good
431
+ > runs-on: ubuntu-latest
432
+ > ```
433
+ >
434
+ > **Valid labels (from `references/runners.md`):**
435
+ > - `ubuntu-latest` (Ubuntu 24.04)
436
+ > - `ubuntu-24.04`, `ubuntu-22.04`
437
+ > - `macos-latest` (macOS 15)
438
+ > - `windows-latest` (Windows Server 2022)
439
+
440
+ **Fix:** Change `ubuntu-lastest` to `ubuntu-latest`.
441
+
442
+ ---
443
+
444
+ **Error 3: Outdated Action Version**
445
+
446
+ *From `references/action_versions.md`:*
447
+
448
+ > | Action | Current Version | Minimum Supported |
449
+ > |--------|----------------|-------------------|
450
+ > | `actions/checkout` | **v6** | v4 |
451
+ >
452
+ > **SHA Pinning Best Practice:**
453
+ > ```yaml
454
+ > # Recommended: SHA pinning with version comment
455
+ > - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
456
+ > ```
457
+
458
+ **Fix:** Update from `@v3` to `@v6` (or SHA-pinned version).
459
+
460
+ ---
461
+
462
+ **Error 4: Security Vulnerability (Script Injection)**
463
+
464
+ *From `references/common_errors.md` - Expression Errors:*
465
+
466
+ > **Warning:** Potential script injection via untrusted input
467
+ >
468
+ > ```yaml
469
+ > # Bad - vulnerable to injection
470
+ > run: echo ${{ github.event.issue.title }}
471
+ >
472
+ > # Good - use environment variables
473
+ > env:
474
+ > TITLE: ${{ github.event.issue.title }}
475
+ > run: echo "$TITLE"
476
+ > ```
477
+ >
478
+ > **Why:** Untrusted input (issue titles, PR bodies, commit messages) can contain malicious commands. Using environment variables sanitizes the input.
479
+
480
+ **Fix:** Pass untrusted input through environment variable.
481
+
482
+ ---
483
+
484
+ **Error 5: Undefined Job Dependency**
485
+
486
+ *From `references/common_errors.md` - Job Configuration Errors:*
487
+
488
+ > **Error:** Job 'deploy' depends on job 'biuld' which does not exist
489
+ >
490
+ > ```yaml
491
+ > # Bad
492
+ > jobs:
493
+ > build:
494
+ > runs-on: ubuntu-latest
495
+ > deploy:
496
+ > needs: biuld # Typo
497
+ >
498
+ > # Good
499
+ > jobs:
500
+ > build:
501
+ > runs-on: ubuntu-latest
502
+ > deploy:
503
+ > needs: build
504
+ > ```
505
+
506
+ **Fix:** Change `biuld` to `build`.
507
+
508
+ ---
509
+
510
+ ### Step 4: Provide Corrected Workflow
511
+
512
+ ```yaml
513
+ name: Fixed CI
514
+ on:
515
+ schedule:
516
+ - cron: '0 0 * * 0' # Fixed: Sunday (0-6 valid)
517
+ jobs:
518
+ build:
519
+ runs-on: ubuntu-latest # Fixed: typo corrected
520
+ steps:
521
+ - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - Fixed: updated version
522
+ - name: Process issue
523
+ env:
524
+ TITLE: ${{ github.event.issue.title }} # Fixed: use env var
525
+ run: echo "$TITLE"
526
+ deploy:
527
+ needs: build # Fixed: typo corrected
528
+ runs-on: ubuntu-latest
529
+ steps:
530
+ - run: echo "Deploying"
531
+ ```
532
+
533
+ ### Step 5: Mandatory Rerun
534
+
535
+ ```bash
536
+ bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only workflow.yml
537
+ ```
538
+
539
+ Expected rerun result:
540
+ - No previous errors reproduced
541
+ - Remaining warnings, if any, are documented explicitly
542
+
543
+ ### Step 6: Summary
544
+
545
+ | Error | Type | Fix Applied |
546
+ |-------|------|-------------|
547
+ | CRON `0 0 * * 8` | Schedule | Changed to `0 0 * * 0` |
548
+ | `ubuntu-lastest` | Runner | Changed to `ubuntu-latest` |
549
+ | `checkout@v3` | Outdated Action | Updated to `@v6.0.0` (SHA-pinned) |
550
+ | Direct `${{ }}` in run | Security | Wrapped in environment variable |
551
+ | `needs: biuld` | Job Dependency | Changed to `needs: build` |
552
+
553
+ **Recommendations:**
554
+ - Run `bash "$SKILL_DIR/scripts/validate_workflow.sh" --check-versions` regularly
555
+ - Use SHA pinning for all actions in production workflows
556
+ - Always pass untrusted input through environment variables
557
+
558
+ ## Done Criteria
559
+
560
+ Validation work is complete when all are true:
561
+ - Trigger matched and correct validation mode selected.
562
+ - Each mapped error includes source reference and minimal quote.
563
+ - Each unmapped error is labeled `UNMAPPED` with exact output captured.
564
+ - Public action versions are verified, or marked `UNVERIFIED-OFFLINE`.
565
+ - Post-fix rerun executed and result reported.
566
+
567
+ ## Summary
568
+
569
+ 1. **Setup**: Install tools with `install_tools.sh`
570
+ 2. **Validate**: Run `validate_workflow.sh` on workflow files
571
+ 3. **Fix**: Address issues using reference documentation
572
+ 4. **Rerun**: Verify fixes with a mandatory post-fix validation run
573
+ 5. **Search**: Use official docs to verify unknown actions
574
+ 6. **Commit**: Push validated workflows with confidence
575
+
576
+ For detailed information, consult the appropriate reference file in `references/`.
@@ -0,0 +1,88 @@
1
+ # GitHub Actions Validator - Example Workflows
2
+
3
+ This directory contains example workflow files for testing the GitHub Actions Validator skill.
4
+
5
+ ## Files
6
+
7
+ ### valid-ci.yml
8
+
9
+ A complete, valid CI pipeline that passes all validation checks.
10
+
11
+ **Purpose:** Test successful validation flow
12
+
13
+ **Usage:**
14
+ ```bash
15
+ bash scripts/validate_workflow.sh examples/valid-ci.yml
16
+ ```
17
+
18
+ **Expected Result:** All validations pass
19
+
20
+ ---
21
+
22
+ ### with-errors.yml
23
+
24
+ A workflow containing common intentional errors for testing error detection.
25
+
26
+ **Purpose:** Test error detection and reference file consultation
27
+
28
+ **Errors included (4 total, all caught by actionlint):**
29
+ 1. Invalid CRON expression (day 8 doesn't exist) — `[events]`
30
+ 2. Typo in runner label (`ubuntu-lastest` instead of `ubuntu-latest`) — `[runner-label]`
31
+ 3. Script injection vulnerability (untrusted input in script) — `[expression]`
32
+ 4. Undefined job dependency (`biuld` instead of `build`) — `[job-needs]`
33
+
34
+ **Usage:**
35
+ ```bash
36
+ bash scripts/validate_workflow.sh examples/with-errors.yml
37
+ ```
38
+
39
+ **Expected Result:** Multiple errors reported by actionlint
40
+
41
+ ---
42
+
43
+ ### outdated-versions.yml
44
+
45
+ A workflow using older action versions to test version validation.
46
+
47
+ **Purpose:** Test action version checking
48
+
49
+ **Version issues included:**
50
+ 1. `actions/checkout@v4` - OUTDATED (current: v6)
51
+ 2. `actions/setup-node@v4` - OUTDATED (current: v6)
52
+ 3. `actions/upload-artifact@v3` - DEPRECATED (minimum: v4)
53
+ 4. `docker/build-push-action@v5` - OUTDATED (current: v6)
54
+
55
+ **Usage:**
56
+ ```bash
57
+ bash scripts/validate_workflow.sh --check-versions examples/outdated-versions.yml
58
+ ```
59
+
60
+ **Expected Result:** Version warnings for outdated actions
61
+
62
+ ---
63
+
64
+ ## Testing Workflow
65
+
66
+ 1. **Test successful validation:**
67
+ ```bash
68
+ bash scripts/validate_workflow.sh examples/valid-ci.yml
69
+ ```
70
+
71
+ 2. **Test error detection:**
72
+ ```bash
73
+ bash scripts/validate_workflow.sh examples/with-errors.yml
74
+ ```
75
+
76
+ 3. **Test version checking:**
77
+ ```bash
78
+ bash scripts/validate_workflow.sh --check-versions examples/outdated-versions.yml
79
+ ```
80
+
81
+ 4. **Test all examples:**
82
+ ```bash
83
+ for file in examples/*.yml; do
84
+ echo "=== Testing: $file ==="
85
+ bash scripts/validate_workflow.sh --lint-only "$file"
86
+ echo ""
87
+ done
88
+ ```