generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 7
refactor(claude): Convert commands to atomic skills #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d30f9d9
chore(dependabot): Restrict GitHub Actions updates to official and Me…
rekmarks d6f672a
refactor(claude): Convert commit commands to skills
rekmarks 1a4fbe5
refactor(claude): Replace composite skills with atomic push and pr sk…
rekmarks 8eeb47b
refactor(claude): Convert check command to lint-build-test skill
rekmarks 88fbd4a
fix(claude): Use test:dev:quiet in lint-build-test skill
rekmarks d9916a9
feat(claude): Add change detection to lint-build-test skill
rekmarks e8369db
Merge branch 'main' into rekm/claude-md-updates
rekmarks fff6c78
feat(claude): Detect stacked PRs and create as draft
rekmarks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": ["Skill(code-review)", "Skill(glossary)"], | ||
| "allow": [ | ||
| "Skill(lint-build-test)", | ||
| "Skill(code-review)", | ||
| "Skill(commit)", | ||
| "Skill(glossary)", | ||
| "Skill(pr)", | ||
| "Skill(push)" | ||
| ], | ||
| "deny": ["Read(**/.env)", "Read(**/.env.*)"] | ||
| } | ||
| } |
20 changes: 6 additions & 14 deletions
20
.claude/commands/commit.md → .claude/skills/commit/SKILL.md
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| name: lint-build-test | ||
| description: How to check code by linting, building, and testing. | ||
| --- | ||
|
|
||
| When asked to check, lint, build, or test code, follow these steps: | ||
|
|
||
| ## 1. Analyze changed files | ||
|
|
||
| First, check which files have changed using `git status` or `git diff --name-only`. | ||
|
|
||
| Categorize the changes: | ||
|
|
||
| - **Source files**: `.ts`, `.js`, `.mts`, `.mjs`, `.cjs`, `.cts`, `.tsx`, `.jsx` | ||
| - **Meta files**: `.md`, `.yml`, `.yaml`, `.json`, `.html` | ||
|
|
||
| ## 2. Determine what to run | ||
|
|
||
| Based on the changed files: | ||
|
|
||
| - **No files changed**: Nothing to do. | ||
| - **Only meta files changed**: Run only `yarn lint:misc --write` (or `yarn workspace <package-name> lint:misc --write` for a specific package). | ||
| - **Source files changed**: Run the full check (see below). | ||
|
|
||
| ## 3. Run the full check (if needed) | ||
|
|
||
| ### For a specific package | ||
|
|
||
| If a package name is specified (e.g. `@metamask/ocap-kernel`): | ||
|
|
||
| 1. `yarn workspace <package-name> lint:fix` | ||
| 2. `yarn workspace <package-name> build` | ||
| 3. `yarn workspace <package-name> test:dev:quiet` | ||
|
|
||
| ### For the entire monorepo | ||
|
|
||
| If no package is specified: | ||
|
|
||
| 1. `yarn lint:fix` | ||
| 2. `yarn build` | ||
| 3. `yarn test:dev:quiet` | ||
|
|
||
| Report any errors encountered during these steps. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| name: pr | ||
| description: Creates a pull request for the current branch. | ||
| unsandboxed: true | ||
| --- | ||
|
|
||
| When asked to create a pull request, follow these steps: | ||
|
|
||
| 1. Run `git status`. If any of the following conditions apply, stop and report the errors: | ||
|
|
||
| - There are unstaged changes | ||
| - There are untracked files | ||
| - The current branch is the default branch (`main`) | ||
|
|
||
| 2. Check if this is a stacked PR: | ||
|
|
||
| - Run `git merge-base main HEAD` to find the common ancestor with main | ||
| - Run `git log --oneline <merge-base>..HEAD` to see commits since diverging from main | ||
| - Check if any parent commits are on another feature branch (not main) | ||
| - If so, run `gh pr list --head <parent-branch>` to check if that branch has an open PR | ||
| - If a parent branch has an open PR, this is a **stacked PR** | ||
|
|
||
| 3. Run `git log main..HEAD --oneline` to see the commit history. | ||
|
|
||
| 4. Run `git diff` and/or `git show` as necessary to understand the changes. | ||
|
|
||
| 5. Run `gh pr create` to create a pull request. The PR body should include: | ||
|
|
||
| - A brief narrative description of the PR | ||
| - A summary of the changes (bullet points) | ||
| - A brief description of how the code is tested (narrative, not a checklist) | ||
|
|
||
| **If this is a stacked PR**, add `--draft` to create it as a draft PR. | ||
|
|
||
| 6. Return the PR URL and any relevant information. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| name: push | ||
| description: Pushes the current branch to the remote repository. | ||
| unsandboxed: true | ||
| --- | ||
|
|
||
| When asked to push code, follow these steps: | ||
|
|
||
| 1. Run `git status` to verify there are commits to push. | ||
|
|
||
| 2. Push to the remote repository: | ||
|
|
||
| - Run `git push` to push the commits | ||
| - If the branch has no upstream, use `git push -u origin <branch-name>` | ||
|
|
||
| 3. Report the results including: | ||
| - The branch name | ||
| - The push status | ||
rekmarks marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.