ci-lint-check
Run pre-commit CI lint validation locally before pushing to avoid GitHub Actions failures.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 2
01 前言 Front Matter
- name
- ci-lint-check
- author
- gitricko, Hermes Agent
- license
- MIT
- version
- 0.1.0
- metadata
- { "hermes": { "tags": [ "ci", "lint", "pre-commit", "github-actions", "validation" ], "related_skills": [ "codespace-persistent-symlinks", "memory-automation" ] } }
- platforms
- [ "linux" ]
- description
- Run pre-commit CI lint validation locally before pushing to avoid GitHub Actions failures.
02 资源文件 2
- 参考文档references/dev-prod-parity.md1.2 KB
- 脚本scripts/ci_lint_check.sh7.6 KB
03 SKILL.md 正文
CI Lint Check Skill
Run the full CI lint validation locally before committing or creating a PR. This mirrors the lint-check job in .github/workflows/ci.yml and catches all format/validation issues that would fail CI.
When to Use
- Before every commit that touches
skills/**,wiki/**,mnemon/**,memories/**, or*.sh - Before creating a PR to ensure CI passes
- When CI fails and you need to debug locally
Prerequisites
markdownlint-cli(auto-installed by script)python3(for Mnemon seed validation)bash(for shell syntax checks)
How to Run
# Quick one-liner (runs all checks):
bash skills/ci-lint-check/scripts/ci_lint_check.sh
# Or step by step:
bash skills/ci-lint-check/scripts/ci_lint_check.sh --markdown-only
bash skills/ci-lint-check/scripts/ci_lint_check.sh --skills-only
bash skills/ci-lint-check/scripts/ci_lint_check.sh --wiki-only
bash skills/ci-lint-check/scripts/ci_lint_check.sh --mnemon-only
bash skills/ci-lint-check/scripts/ci_lint_check.sh --shell-only
bash skills/ci-lint-check/scripts/ci_lint_check.sh --symlink-only
What It Validates
| Check | Files | CI Job |
|---|---|---|
| Markdown lint | wiki/*.md, skills/*/SKILL.md, .hermes.md, README.md |
lint-check |
| SKILL.md structure | All skills in skills/*/SKILL.md |
lint-check |
| Wiki INDEX.md consistency | Every .md in wiki/ referenced in INDEX.md |
lint-check |
| Mnemon seed.json | mnemon/seed.json schema |
lint-check |
| Root shell syntax | *.sh |
lint-check |
| Skill shell syntax | skills/*/scripts/*.sh |
lint-check |
| Symlink persistence | Tracked dirs + boot script symlink logic | lint-check |
Procedure
1. Install dependencies (first run only)
npm install -g markdownlint-cli
2. Run full validation
bash skills/ci-lint-check/scripts/ci_lint_check.sh
3. Fix any reported issues
- Markdown lint: fix reported line/column issues
- SKILL.md: ensure YAML frontmatter with
name:field - Wiki: add missing articles to INDEX.md table
- Mnemon:
python3 mnemon/validate-seed.py mnemon/seed.json - Shell:
bash -n <script>to see syntax errors - Symlinks: ensure boot scripts create proper symlinks
4. Commit and push
git add -A
git commit -m "your message"
git push
CI Behavior
| Changed Paths | CI Job | Duration |
|---|---|---|
skills/** |
lint-check |
~30s |
wiki/** |
lint-check |
~30s |
mnemon/** |
lint-check |
~30s |
memories/** |
lint-check |
~30s |
*.sh |
lint-check |
~30s |
.github/workflows/**, install.sh, boot.sh, self-check.sh |
full-build |
~15min |
Only infrastructure changes trigger full-build. Content changes (skills, wiki, mnemon, memories, shell scripts) run the fast lint-check only.
Dev/Prod Parity Principle
The local script IS the CI job. The lint-check workflow step delegates entirely to ci_lint_check.sh:
- name: Run local CI lint check script
run: |
npm install -g markdownlint-cli
bash skills/ci-lint-check/scripts/ci_lint_check.sh
This guarantees identical validation in both environments. Never duplicate validation logic in CI YAML — the skill script is the single source of truth.
Pitfalls
- Don't skip this — CI will fail and you'll waste time debugging in GitHub Actions
- Run from repo root — paths are relative to
/workspaces/.minions - markdownlint config is embedded in the script (matches CI config)
- Mnemon seed validation requires the validator script to exist
- Symlink check validates boot script logic, not actual runtime symlinks
- MD034 / no-bare-urls — version-like strings (
omniroute@3.8.x) and bare URLs both triggerMD034/no-bare-urls Bare URL used. Wrap versions in backticks (`omniroute@3.8.x`) and real URLs in<...>;ci_lint_check.shLINTCONF now sets"MD034": false— keep local config in sync with CI or Lint fails on CI despite passing locally. - MD056 / table column count — unescaped
|inside a markdown table cell splits the row (Expected: 3; Actual: 5). Escape every|as\|so||becomes\|\|and the 3-col table stays at 4 pipes. Runbash skills/ci-lint-check/scripts/ci_lint_check.sh --markdown-onlybefore pushing anySKILL.mdedit — catches MD056/MD013 without a CI round-trip. - Invalid job ID silently kills the ENTIRE workflow — GitHub Actions job IDs must start with a letter or
_(alphanumeric/_/-only). A violating ID (e.g.9router-model-check) fails the whole workflow at dispatch: the run showscompleted/failurewith zero jobs, no logs (HTTP 404), created-at == updated-at, and the API annotations endpoint returns 404 — the error only appears in the PR's Checks tab. DTS, real-install and every other job never start. After anyci.ymledit, check the PR Checks tab for an "Invalid workflow file" note and rename the ID (e.g.router-model-check). The displayname:field is unconstrained — only the ID matters.
Integration with Git Hooks (Optional)
Add to .git/hooks/pre-commit:
#!/bin/bash
bash skills/ci-lint-check/scripts/ci_lint_check.sh || exit 1
References
.github/workflows/ci.yml— source of truth for CI jobswiki/github-actions-testing-plan.md— CI design docskills/codespace-persistent-symlinks/SKILL.md— symlink architecture
Known Limitations
- Symlink check (7/7) requires
boot.shto contain the skills/memories wiring patterns (Phases 16–18). Until then, run with--shell-onlyor--skills-onlyto skip. - Markdown lint (1/7) requires
markdownlint-cli(npm install -g markdownlint-cli). CI installs it automatically.
Verification
# Should output "=== ALL CHECKS PASSED ==="
bash skills/ci-lint-check/scripts/ci_lint_check.sh
For Future Agents
MANDATORY: Run this skill before ANY commit or PR that modifies:
- Skills (
skills/**) - Wiki (
wiki/**) - Mnemon (
mnemon/**) - Memories (
memories/**) - Devcontainer shell scripts (
*.sh)
# One command before commit:
bash skills/ci-lint-check/scripts/ci_lint_check.sh
04 同仓库更多 Skills
version-single-source
Use when adding a new component dependency or versioning a binary in install/boot scripts.
tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
shell-path-login
Use when a binary or script works in one shell context but not another (interactive vs non-interactive login vs non-login shell).
self-update-fix
Fix a failing dependency update PR. Use when a self-update PR's CI fails, or when invoked by scripts/self-update-fix.sh.
pr-change-log
Use when a multi-commit PR needs its description written/updated, or when closing out a long branch with many fix commits.
persistent-knowledge
Persistent skills/knowledge in Codespace via symlinks.