Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/Morrison-Lab/ai-config --skill testコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SKILL.md を表示中
| name | test |
| description | Run unit or revdep tests. |
| user-invocable | true |
| allowed-tools | ["Bash","Read"] |
Verify an MR's changes by running the appropriate tests — either local unit tests or a downstream pipeline in a consumer/revdep repo.
Inspect the repo to decide which testing path applies:
| Signal | Strategy |
|---|---|
Repo has tests/ or testthat/ or a test framework | Unit tests — run locally |
| Repo is a CI template provider (like HACtions) with no local tests | Downstream — trigger pipeline in a revdep |
| Both exist | Run local tests first, then downstream if relevant |
For HACtions specifically: there are no local unit tests. The test
strategy is to trigger a pipeline in a revdep like test.hac (project 1611)
that exercises the templates.
Before running a script whose success path can mutate an external service (uploads, releases, deployments, secret rotation), inspect every ambient authentication source it can inherit: environment variables, process options, credential helpers, and keyrings. Omitting the script's explicit login call is not isolation; an earlier session may already have populated one of those sources.
# R package
Rscript -e 'devtools::test()'
# Python
pytest
# Node
npm test
# Shell (bash -n syntax check at minimum)
for f in scripts/*.sh scripts/lib/*.sh; do bash -n "$f"; done
Report pass/fail. If tests fail, investigate and fix before proceeding.
A pass and fail count says nothing about the tests that never executed, so "43 pass, 0 fail" can be exactly accurate while the suite has not been verified. Report all three numbers, and treat a non-zero skip count as an unmeasured population: say what was skipped and why before citing the run as evidence.
Then ask what made them skip.
A skip is usually keyed on a missing optional dependency
(skip_if_not_installed(), pytest.importorskip), so an invocation that
bypasses environment setup silently shrinks the suite while leaving the
reported numbers looking healthy.
In an R package, R_PROFILE_USER=/dev/null skips renv/activate.R and
therefore the project library, so packages the tests gate on are absent and
their tests skip.
The same applies to any --no-config flag, a bare interpreter, or a
container built without the optional extras.
Before citing a run as verification, confirm it ran in the project's real environment. Re-run without the bypass when the skip count is non-zero.
When the change is to shared infrastructure (CI templates, shared scripts), test it in a consumer repo.
REVDEPS.md for consumer repostest.hac, project 1611) over
production reposThe consumer must already reference the MR's branch (or the floating tag must have been slid). Two approaches:
Option A — Trigger pipeline via API (preferred for template repos):
# Trigger a pipeline on the consumer's default branch
glab api --method POST "projects/<CONSUMER_PROJECT_ID>/pipeline" \
-f "ref=main" 2>&1 | cat
Option B — If the consumer needs to reference the MR branch:
Create a temporary MR on the consumer that points include: ref: to the
feature branch, or use a CI variable override if the consumer supports it.
# Get the pipeline ID from the trigger response, then poll
glab api "projects/<CONSUMER_PROJECT_ID>/pipelines/<PIPELINE_ID>" \
--jq '.status' 2>&1 | cat
Poll every 30–60 seconds until status is success, failed, or canceled.
Summarize what was tested and the outcome:
Always include the skip count for a unit-test run, per step 3.
✅ Tests passed:
- devtools::test(): 40 pass, 0 fail, 0 skip
- bash -n syntax check: all scripts OK
- test.hac pipeline #NNNN: success (jobs: lint ✓, check-package ✓, claude-review ✓)
— or —
❌ Tests failed:
- test.hac pipeline #NNNN: failed
- Failing job: lint (exit code 1)
- Error: <summary>
If tests fail, investigate the failure and either fix it or report the issue to the user.
bash -n syntax checks
for shell scripts, or a dry-run/lint of whatever the repo contains.v2 was already moved to include the
MR's changes, a simple pipeline trigger on the consumer's main will
pick up the new templates automatically.include: ref: <branch> override.| Test bed | Project ID | What it exercises |
|---|---|---|
| test.hac | 1611 | HACtions CI templates (lint, check-package, claude-review, etc.) |
The row above is the repository owner's own test bed; project ID
1611is specific to that GitLab instance. Replace this table with your own downstream revdep repos and their project IDs.