generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 7
agent: Add create-package skill #747
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
Open
grypez
wants to merge
1
commit into
main
Choose a base branch
from
grypez/add-skill-create-package
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+65
−1
Open
Changes from all commits
Commits
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 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,6 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": ["Skill(code-review)", "Skill(glossary)"], | ||
| "allow": ["Skill(code-review)", "Skill(create-package)", "Skill(glossary)"], | ||
| "deny": ["Read(**/.env)", "Read(**/.env.*)"] | ||
| } | ||
| } |
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,64 @@ | ||||||||
| --- | ||||||||
| name: create-package | ||||||||
| description: Create a new monorepo package using the create-package CLI | ||||||||
| --- | ||||||||
|
|
||||||||
| # Create Package Skill | ||||||||
|
|
||||||||
| Use this skill when the user asks to create a new package in the monorepo. | ||||||||
|
|
||||||||
| ## Overview | ||||||||
|
|
||||||||
| The `yarn create-package` command automates the creation of new monorepo packages by: | ||||||||
|
|
||||||||
| - Generating package scaffolding from the template package | ||||||||
| - Setting up the package structure, configuration files, and dependencies | ||||||||
| - Creating package.json with the provided name and description | ||||||||
|
|
||||||||
| ## Required Arguments | ||||||||
|
|
||||||||
| - `--name` (or `-n`): The package name. Will be prefixed with "@ocap/" if not provided. | ||||||||
| - `--description` (or `-d`): A short description of the package for package.json | ||||||||
|
|
||||||||
| ## Usage Pattern | ||||||||
|
|
||||||||
| 1. Ask the user for the package name and description if not provided | ||||||||
| 2. Run `yarn create-package --name <package-name> --description "<description>"` | ||||||||
| 3. After successful creation, remind the user to: | ||||||||
| - Add coverage thresholds to the root `vitest.config.ts` file | ||||||||
| - Add any additional dependencies using `yarn workspace @ocap/<package-name> add <dep>` | ||||||||
| - If adding monorepo packages as dependencies, update the `references` array in the package's `tsconfig.json` and `tsconfig.build.json` | ||||||||
|
|
||||||||
| ## Example | ||||||||
|
|
||||||||
| ```bash | ||||||||
| yarn create-package --name my-package --description "A package for handling my feature" | ||||||||
| ``` | ||||||||
|
|
||||||||
| This creates a new package at `packages/my-package` with the name `@ocap/my-package`. | ||||||||
|
|
||||||||
| ## Post-Creation Steps | ||||||||
|
|
||||||||
| Always remind the user of these manual steps after package creation: | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| 1. **Add coverage thresholds** to root `vitest.config.ts`: | ||||||||
|
|
||||||||
| - The CLI cannot modify .ts config files automatically | ||||||||
| - Add appropriate coverage thresholds for the new package | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| 2. **Add dependencies** if needed: | ||||||||
|
|
||||||||
| ```bash | ||||||||
| yarn workspace @ocap/<package-name> add <dependency> | ||||||||
| ``` | ||||||||
|
|
||||||||
| 3. **Update TypeScript references** if adding monorepo dependencies: | ||||||||
| - Add to `references` array in `tsconfig.json` | ||||||||
| - Add to `references` array in `tsconfig.build.json` | ||||||||
|
|
||||||||
| ## Notes | ||||||||
|
|
||||||||
| - The package name will automatically be prefixed with "@ocap/" if not provided | ||||||||
| - The created package is private by default | ||||||||
| - The template is located at `packages/template-package/` | ||||||||
| - All placeholder values in the template will be replaced with actual values | ||||||||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.