Repository navigation
chore: tighten agent hook, instructions and report tooling - #68
Merged
Merged
Conversation
An unparseable payload no longer denies every bash call, and heredoc scripts for python, node, ruby or perl that open files for writing are now denied. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrites always-loaded instruction files to their repo-specific rules, removes changelog guidance that conflicted with Release Please, lets the contribution skill run tests, de-duplicates the testing docs, drops a stale script count, documents billing-report jq gotchas, and adds tools/screenshot-html.sh for visual report checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Improves the agent environment based on a retrospective of the enterprise billing report work:
block-file-writes-via-bashhook now allows the command when it cannot parse the payload, instead of denying every bash call. It also denies python, node, ruby or perl heredoc scripts that open files for writing..shfiles.make-repo-contributionskill runs the documented checks and reports their results instead of asking the user to run them.copilot-instructions.mdnow points toAGENTS.mdinstead of duplicating it, and the stale "All 18 scripts" count is gone.docs/script-behaviors.mddocuments the billing report's jq constraints: no apostrophes in the single-quoted program, andmlabelbecauselabelis a reserved word.tools/screenshot-html.shrenders an HTML report to PNG at screen and print widths for visual checks.Changes
<domain>/github-<name>/github-<name>.shlib/github-common.sh.github/hooks/scripts/block-file-writes-via-bash.shandtests/test_hooks.bats.github/instructions/(four always-loaded files rewritten).github/skills/make-repo-contribution/SKILL.md.github/copilot-instructions.md,AGENTS.md,docs/script-behaviors.mdtools/screenshot-html.shHow to test
The hook tests cover heredoc, tee and interpreter writes, the object
toolArgsform, and an invalid JSON payload. The screenshot tool prints the paths of the screen and print PNGs.Validation run:
shellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash tools/screenshot-html.sh .github/hooks/scripts/block-file-writes-via-bash.sh: passedbats tests/: passed (148 tests, 0 failures)./tools/screenshot-html.sh <report.html>: produced both PNGs; no-argument run exits 1 and--helpexits 0Checklist
set -euo pipefailis the first executable line after the# ===headerlib/github-common.shviaSCRIPT_DIR(not applicable: no API calls)require_env_var(not applicable: no env vars)validate_github_token(orvalidate_tokenfor secondary tokens) (not applicable)validate_slug(not applicable)sleepadded between repo-level operations to respect rate limits (not applicable)AGENTS.md)shellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash <script>)