Repository navigation
Agent hook for src file modification - #844
Open
dario-coscia wants to merge 1 commit into
Open
dario-coscia wants to merge 1 commit into
dario-coscia wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Summary of Changes
Goal
Relax the old “never modify source code” rule and add automatic approval prompts when an agent edits files under
pina/,tests/, ordocs/.Shared instruction
.opencode/skills/RULES.md, added a single shared rule:opencode
.opencode/commands/pina-agentic.mdpina/,tests/,docs/..opencode/opencode.json(new).opencode/plugin/source-edit-guard.ts(new)permission.askre-assertsaskfor protected source paths.tool.execute.beforeshows a warning toast before an edit/write/patch.edit,write, andpatchtools.Claude Code
.claude/settings.json(new)PreToolUsehook for:Edit|Write|MultiEdit|NotebookEdit..claude/hooks/source_edit_guard.py(new)file_path/notebook_path.{ "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "ask", "permissionDecisionReason": "Modifying source file ..." } }Tool support
PreToolUsehookRULES.md/AGENTS.mdVerification
This PR fixes #842.
Checklist