• Will Chen's avatar
    Reorganize Claude commands and add permission hooks (#2305) · e25a24de
    Will Chen 提交于
    ## Summary
    - Move Claude commands to `dyad/` namespace (e2e-rebase, pr-fix)
    - Add new commands: fix-issue, gh-push, gh-rebase, lint, session-debug
    - Add `gh-permission-hook.py` to block destructive gh commands (except
    PRs)
    - Expand allowed bash commands in settings.json
    - Update AGENTS.md to reference `/dyad:lint` skill and fix typo
    
    ## Test plan
    - [ ] Verify commands work with `/dyad:<command>` syntax
    - [ ] Test that gh-permission-hook blocks issue modifications but allows
    PR operations
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Reorganized Claude commands under the /dyad namespace and added a GitHub
    CLI permission hook that auto-approves read-only commands plus PR and
    issue updates while blocking destructive actions. Added new skills
    (including deflaking E2E and split PR fix steps), hardened the hook, and
    added tests.
    
    - **New Features**
    - Moved e2e-rebase and pr-fix to dyad/; added fix-issue, pr-push,
    gh-rebase, lint, session-debug, deflake-e2e; split pr-fix into
    pr-fix:comments and pr-fix:actions.
      - Updated AGENTS.md to reference /dyad:lint and fixed a typo.
    
    - **Permissions**
    - Added gh-permission-hook.py (PreToolUse) for Bash gh commands;
    auto-approves read-only ops, PR modification commands, issue
    create/edit/close/reopen/comment, PR review thread ops, and PR/issue
    comment replies and updates; blocks destructive actions across issues,
    releases, gists, labels, secrets, repos, workflows, config, and auth.
    - Hardened checks: require gh as the executed command (handles
    env/sudo/command wrappers); detect shell injection (;, &&/||, &,
    newlines, ANSI-C $'…', process substitution); allow safe pipes to jq and
    common text filters (head/tail/grep/wc/sort/uniq/cut/tr) and stderr
    redirects; parse --method/-X (incl. equals syntax); allow GraphQL
    queries plus specific PR review thread/comment mutations; added unit
    tests with good/bad fixtures.
    - Updated settings.json to narrow read-only gh allowlist, expand safe
    Bash commands, and register the PreToolUse hook.
    
    <sup>Written for commit 3237d344cdc2850a97a9a4856bff54bd25be102b.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    
    
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > Streamlines Claude command suite and hardens GitHub CLI usage in the
    workspace.
    > 
    > - Reorganizes commands under `/.claude/commands/dyad/` and adds new
    skills: `deflake-e2e`, `fix-issue`, `gh-rebase`, `lint`, `pr-push`,
    `session-debug`; splits `pr-fix` into `pr-fix:comments` and
    `pr-fix:actions`
    > - Adds `/.claude/hooks/gh-permission-hook.py` to auto-approve
    read-only/PR operations and block destructive `gh` commands; supports
    GraphQL query/limited mutations and safe piping
    > - Introduces unit tests (`.claude/hooks/tests/*`) with good/bad
    command fixtures and a test runner
    > - Updates `.claude/settings.json` to expand safe Bash allowlist and
    register `PreToolUse` hook; tweaks `.gitignore` and `AGENTS.md`
    (references `/dyad:lint`)
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    3237d344cdc2850a97a9a4856bff54bd25be102b. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    ---------
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    e25a24de
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
makers 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CLAUDE.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...