Skip to content

docs: add claude skills for linting, pre-PR checks, running tests, se…#109

Merged
GingerGraham merged 3 commits into
mainfrom
adding-skills
Apr 20, 2026
Merged

docs: add claude skills for linting, pre-PR checks, running tests, se…#109
GingerGraham merged 3 commits into
mainfrom
adding-skills

Conversation

@GingerGraham
Copy link
Copy Markdown
Owner

This pull request adds a comprehensive set of skills documentation for the bash-logger repository, covering linting, testing, pre-PR checks, security review, and commit conventions. These skill guides provide clear, standardized workflows and checklists to ensure code quality, security, and maintainability throughout the development lifecycle.

Skills documentation added:

Linting and code quality:

  • Added .claude/skills/linting-code/SKILL.md detailing how to lint shell scripts and Markdown files using pre-commit, including tool configuration, command usage, key linting rules, and interpreting failures.

Testing:

  • Added .claude/skills/running-tests/SKILL.md explaining how to discover, select, and run the test suites, map code changes to relevant tests, and interpret test output, with best practices and common mistakes to avoid.

Pre-PR workflow:

  • Added .claude/skills/pre-pr-checks/SKILL.md outlining the full pre-PR gate sequence: linting, targeted and full tests, code review checklist, commit message audit, PR description requirements, and branch hygiene.

Security review:

  • Added .claude/skills/security-review/SKILL.md providing a detailed security review checklist covering input sanitization, file system safety, config parsing, environment variables, journal command validation, sensitive data handling, and script name sanitization, with mappings to test suites.

Commit and PR conventions:

  • Added .claude/skills/writing-commits/SKILL.md specifying the Conventional Commits format, PR title/body structure, and common mistakes, ensuring consistent commit history and changelog generation.…curity review, writing commits, and writing tests

…curity review, writing commits, and writing tests
Copilot AI review requested due to automatic review settings April 20, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a set of “skills” Markdown guides under .claude/skills/ to standardize contributor workflows for linting, testing, pre-PR checks, security review, and commit/PR conventions in the bash-logger repo.

Changes:

  • Add a “linting-code” skill documenting the repo’s pre-commit lint workflow (ShellCheck + MarkdownLint).
  • Add “running-tests” + “writing-tests” skills covering suite selection, runner usage, and test authoring patterns.
  • Add “pre-pr-checks”, “security-review”, and “writing-commits” skills for consistent PR hygiene, security review, and semantic commit/PR formatting.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
.claude/skills/linting-code/SKILL.md Documents how to run linting via Make/pre-commit and interpret common failures.
.claude/skills/running-tests/SKILL.md Documents how to discover and run targeted/full test suites and read output.
.claude/skills/writing-tests/SKILL.md Provides a workflow for adding tests/suites and using assertion helpers.
.claude/skills/pre-pr-checks/SKILL.md Defines a pre-PR gate checklist (lint, tests, commit audit, branch hygiene).
.claude/skills/security-review/SKILL.md Adds a security review checklist mapped to repo-specific functions/tests.
.claude/skills/writing-commits/SKILL.md Documents Conventional Commits / semantic-release commit + PR conventions.

Comment thread .claude/skills/writing-tests/SKILL.md Outdated
Comment on lines +101 to +102
assert_command_succeeds "some_function arg" || return
assert_command_fails "some_function bad_arg" || return
Comment thread .claude/skills/writing-tests/SKILL.md Outdated
@@ -0,0 +1,133 @@
---
name: writing-tests
description: Adds new tests to the bash-logger test suite. Covers creating new test suites, adding tests to existing suites, correct use of assertions, isolation patterns, and the mandatory call registration pattern. Use this skill whenever writing, extending, or fixing tests in the tests/ directory.
Comment thread .claude/skills/pre-pr-checks/SKILL.md Outdated
make lint
```

Fix all ShellCheck and MarkdownLint failures. MarkdownLint auto-fixes most issues and re-stages files — review them before continuing.
Comment thread .claude/skills/linting-code/SKILL.md Outdated

### MarkdownLint

MarkdownLint runs with `--fix` — most formatting issues auto-correct and the file is re-staged. Violations that cannot be auto-fixed (long lines, wrong list markers) require manual edits.
Comment thread .claude/skills/security-review/SKILL.md Outdated
Comment on lines +59 to +60
* After any file creation: check `-L` (reject symlinks), `-f` (must be regular file), `-w`
(must be writable). These three checks are mandatory in that order.
Comment thread .claude/skills/writing-commits/SKILL.md Outdated
@@ -0,0 +1,155 @@
---
name: writing-commits
description: Generates correctly formatted commit messages and pull request descriptions for this repository. Uses Conventional Commits / semantic-release format with issue references. Use this skill whenever writing, reviewing, or amending a commit message or drafting a PR title and body.
Comment thread .claude/skills/running-tests/SKILL.md Outdated
@@ -0,0 +1,110 @@
---
name: running-tests
description: Runs the bash-logger test suite — either the full suite or a targeted subset. Use this skill whenever running, selecting, or interpreting tests in this repository. Covers discovering available suites, choosing which to run after a change, correct invocation syntax, and reading test output.
Comment thread .claude/skills/pre-pr-checks/SKILL.md Outdated
@@ -0,0 +1,98 @@
---
name: pre-pr-checks
description: Runs the full gate sequence before raising a pull request on bash-logger. Covers linting, targeted tests, full test suite, code review checklist, commit message audit, PR description requirements, and branch hygiene. Use this skill before pushing to a shared branch or opening a PR.
Comment thread .claude/skills/security-review/SKILL.md Outdated
@@ -0,0 +1,240 @@
---
name: security-review
description: Reviews code changes in bash-logger for security issues across all protected domains. Use this skill whenever adding new features that handle external input, changing sanitization behaviour, adding config options, or reviewing a PR for security. Covers input sanitization, file system safety, config injection, environment variable attacks, journal command validation, sensitive data handling, and unsafe flag governance.
Comment thread .claude/skills/linting-code/SKILL.md Outdated
@@ -0,0 +1,91 @@
---
name: linting-code
description: Lints shell scripts and Markdown files in the bash-logger repository using the project's configured toolchain. Use this skill whenever checking code quality, fixing linting errors, or running lint as part of a pre-commit or pre-PR workflow.
@GingerGraham
Copy link
Copy Markdown
Owner Author

@copilot apply changes based on the comments in this thread

- Fold YAML front-matter description lines to stay within 200-char limit
- Fix assert helper names: assert_command_succeeds/fails -> assert_success/failure
- Clarify MarkdownLint auto-fix wording: files are not auto-staged, must git add
- Update file validation order in security-review to include -e check (-L -> -e -> -f -> -w)

Agent-Logs-Url: https://github.com/GingerGraham/bash-logger/sessions/9bfa25b1-a2a2-4c7b-8b51-0d3bc1a68cf5

Co-authored-by: GingerGraham <34165628+GingerGraham@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in commit 53215e6:

  • Folded all 6 YAML front-matter description: fields using YAML > block scalar so every line stays within the 200-character MD013 limit — confirmed with make lint-markdown (passes cleanly).
  • Fixed assert_command_succeeds/assert_command_failsassert_success/assert_failure in writing-tests/SKILL.md to match the actual helpers in test_helpers.sh.
  • Updated MarkdownLint auto-fix wording in both linting-code/SKILL.md and pre-pr-checks/SKILL.md to clarify that pre-commit does not re-stage modified files — contributors must git add the auto-fixed files manually before re-running.
  • Updated file validation order in security-review/SKILL.md from -L → -f → -w to -L → -e → -f → -w, matching the actual init_logger implementation (and updated the checklist item at the bottom to match).

@GingerGraham GingerGraham merged commit a29f38d into main Apr 20, 2026
5 checks passed
@GingerGraham GingerGraham deleted the adding-skills branch April 20, 2026 09:49
GingerGraham pushed a commit that referenced this pull request May 27, 2026
## [2.5.2](2.5.1...2.5.2) (2026-05-27)

### Bug Fixes

* match typeset in readonly guard for zsh compatibility ([#115](#115))

### Documentation

* add claude skills for linting, pre-PR checks, running tests, se… ([#109](#109))
* establish AGENTS.md as canonical agent instruction file ([#110](#110))
@GingerGraham
Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 2.5.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants