acp-vscode 0.3.3 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +80 -0
- package/.github/workflows/ci.yml +2 -0
- package/.github/workflows/release.yml +10 -6
- package/README.md +35 -13
- package/__tests__/commands-actions.test.js +0 -2
- package/__tests__/fetcher-nested-and-default.test.js +461 -0
- package/__tests__/fetcher-verbose-integration.test.js +274 -0
- package/__tests__/fetcher-verbose.test.js +316 -0
- package/__tests__/fetcher.test.js +5 -5
- package/__tests__/install-command-multi.test.js +0 -1
- package/package.json +2 -2
- package/scripts/quality-checks.sh +93 -0
- package/scripts/release.sh +89 -0
- package/src/commands/install.js +16 -9
- package/src/commands/list.js +16 -3
- package/src/commands/search.js +12 -5
- package/src/commands/uninstall.js +0 -19
- package/src/fetcher.js +162 -34
- package/src/installer.js +3 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Copilot Instructions for acp-vscode
|
|
2
|
+
|
|
3
|
+
These instructions guide AI assistants (like GitHub Copilot) in maintaining code quality and best practices for the acp-vscode project.
|
|
4
|
+
|
|
5
|
+
## Quality Checks
|
|
6
|
+
|
|
7
|
+
After making any major changes to the codebase, **you must run the quality checks script and ensure all checks pass**:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
./scripts/quality-checks.sh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This script runs:
|
|
14
|
+
- **ESLint** - Validates code style and best practices
|
|
15
|
+
- **Jest Tests** - Ensures all unit tests pass
|
|
16
|
+
- **package.json Validation** - Verifies the package configuration is valid
|
|
17
|
+
|
|
18
|
+
### When to Run Quality Checks
|
|
19
|
+
|
|
20
|
+
Run quality checks after:
|
|
21
|
+
- Implementing new features
|
|
22
|
+
- Fixing bugs
|
|
23
|
+
- Refactoring code
|
|
24
|
+
- Adding or modifying tests
|
|
25
|
+
- Updating dependencies
|
|
26
|
+
- Making any changes to source files
|
|
27
|
+
|
|
28
|
+
### Fixing Quality Check Failures
|
|
29
|
+
|
|
30
|
+
If any quality check fails:
|
|
31
|
+
|
|
32
|
+
1. **Read the error output carefully** - Identify the specific files and line numbers that failed
|
|
33
|
+
2. **Fix the issues incrementally** - Make small, focused changes to address each failure
|
|
34
|
+
3. **Re-run the quality checks** - After each fix, run the quality checks again to verify the change
|
|
35
|
+
4. **Iterate until all checks pass** - Continue fixing and testing until `./scripts/quality-checks.sh` exits with code 0
|
|
36
|
+
|
|
37
|
+
### ESLint Failures
|
|
38
|
+
|
|
39
|
+
If ESLint fails:
|
|
40
|
+
- Review the linting rules in the project configuration
|
|
41
|
+
- Fix code style issues (indentation, spacing, naming conventions)
|
|
42
|
+
- Follow the existing code style patterns in the codebase
|
|
43
|
+
- Many ESLint errors can be automatically fixed with: `npm run lint -- --fix`
|
|
44
|
+
|
|
45
|
+
### Jest Test Failures
|
|
46
|
+
|
|
47
|
+
If tests fail:
|
|
48
|
+
- Run the test suite with: `npm test`
|
|
49
|
+
- Review the test output to understand what assertions failed
|
|
50
|
+
- Update or add tests to cover the new code
|
|
51
|
+
- Ensure backward compatibility with existing tests
|
|
52
|
+
- Do not disable or skip tests to make them pass
|
|
53
|
+
|
|
54
|
+
## Code Quality Standards
|
|
55
|
+
|
|
56
|
+
### Guidelines
|
|
57
|
+
|
|
58
|
+
- **Consistency** - Follow the existing code style and patterns in the codebase
|
|
59
|
+
- **Testing** - All new features should have corresponding tests
|
|
60
|
+
- **Documentation** - Update README.md and other documentation as needed
|
|
61
|
+
- **Git Hygiene** - Make atomic, well-described commits
|
|
62
|
+
|
|
63
|
+
### Before Submitting Changes
|
|
64
|
+
|
|
65
|
+
1. Run `./scripts/quality-checks.sh` and ensure all checks pass
|
|
66
|
+
2. Verify no new warnings or errors were introduced
|
|
67
|
+
3. Test the changes manually if applicable
|
|
68
|
+
4. Review the changes for clarity and correctness
|
|
69
|
+
|
|
70
|
+
## References
|
|
71
|
+
|
|
72
|
+
- CI/CD Pipeline: [.github/workflows/ci.yml](./workflows/ci.yml)
|
|
73
|
+
- Release Process: [scripts/release.sh](../scripts/release.sh)
|
|
74
|
+
- Quality Checks: [scripts/quality-checks.sh](../scripts/quality-checks.sh)
|
|
75
|
+
|
|
76
|
+
## Related Configuration Files
|
|
77
|
+
|
|
78
|
+
- [package.json](../../package.json) - Project metadata and scripts
|
|
79
|
+
- [jest.config.cjs](../../jest.config.cjs) - Jest test configuration
|
|
80
|
+
- [.eslintrc or similar]() - ESLint configuration (if present)
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -5,9 +5,9 @@ name: Release
|
|
|
5
5
|
# Then push the tag: `git push --follow-tags` (or `git push origin vX.Y.Z`).
|
|
6
6
|
# - Alternatively, use a release manager like `semantic-release` to automate versioning and changelogs.
|
|
7
7
|
# - This workflow runs when a tag matching `v*.*.*` is pushed. Ensure you create/tag using the v-prefixed semver format.
|
|
8
|
-
# -
|
|
9
|
-
#
|
|
10
|
-
#
|
|
8
|
+
# - This workflow uses Trusted Publishing (OIDC) for npm - no NPM_TOKEN secret needed!
|
|
9
|
+
# - Provenance attestations are automatically generated when using trusted publishing.
|
|
10
|
+
# - The default `GITHUB_TOKEN` is provided automatically by Actions for creating releases.
|
|
11
11
|
|
|
12
12
|
on:
|
|
13
13
|
push:
|
|
@@ -21,6 +21,8 @@ jobs:
|
|
|
21
21
|
permissions:
|
|
22
22
|
contents: write # needed to create a release
|
|
23
23
|
packages: write # not strictly required for npm but useful if you use GitHub Packages
|
|
24
|
+
id-token: write # Required for OIDC
|
|
25
|
+
|
|
24
26
|
steps:
|
|
25
27
|
# Fetch full history so tags and changelog generation work correctly
|
|
26
28
|
- uses: actions/checkout@v4
|
|
@@ -29,15 +31,17 @@ jobs:
|
|
|
29
31
|
- name: Use Node.js
|
|
30
32
|
uses: actions/setup-node@v4
|
|
31
33
|
with:
|
|
32
|
-
node-version: '
|
|
34
|
+
node-version: '22'
|
|
33
35
|
registry-url: 'https://registry.npmjs.org'
|
|
36
|
+
- name: Upgrade npm for trusted publishing
|
|
37
|
+
run: npm install -g npm@latest
|
|
34
38
|
- name: Install
|
|
35
39
|
run: npm ci
|
|
40
|
+
- name: Run linting
|
|
41
|
+
run: npm run lint
|
|
36
42
|
- name: Run tests
|
|
37
43
|
run: npm test
|
|
38
44
|
- name: Publish to npm
|
|
39
|
-
env:
|
|
40
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
41
45
|
run: npm publish
|
|
42
46
|
- name: Create GitHub Release
|
|
43
47
|
# Create a GitHub Release for the pushed tag. Uses the git ref by default.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# acp-vscode
|
|
2
2
|
|
|
3
|
-
acp-vscode is a small CLI to fetch and install
|
|
3
|
+
acp-vscode is a small CLI to fetch and install agents, prompts, instructions and skills from the GitHub "awesome-copilot" repository into your VS Code workspace or VS Code User profile.
|
|
4
4
|
|
|
5
5
|
Install (when published):
|
|
6
6
|
|
|
@@ -14,9 +14,9 @@ Commands:
|
|
|
14
14
|
- install <workspace|user> [names...]
|
|
15
15
|
- target: `workspace` or `user`
|
|
16
16
|
- names: optional list of ids or names to install (supports `repo:id` form)
|
|
17
|
-
- type: specify with the option `--type <type>` (prompts|
|
|
17
|
+
- type: specify with the option `--type <type>` (prompts|agents|instructions|skills|chatmodes|all). Note: `chatmodes` is legacy/deprecated (use `agents` instead). For backwards compatibility you can still pass the type as the first positional name (e.g. `install workspace prompts p1 p2`). The `install` command also accepts a deliberate typo alias `--referesh` (alias for `--refresh`) to preserve historical behavior.
|
|
18
18
|
- list [type]
|
|
19
|
-
- list items available. type can be `prompts`, `
|
|
19
|
+
- list items available. type can be `prompts`, `agents`, `instructions`, `skills`, `chatmodes` (legacy), or `all`
|
|
20
20
|
- search <query>
|
|
21
21
|
- search across items
|
|
22
22
|
- uninstall <workspace|user> <type> [names...]
|
|
@@ -102,6 +102,9 @@ acp-vscode list --refresh
|
|
|
102
102
|
- Offline testing / injecting a local index
|
|
103
103
|
- For tests or offline usage you can set `ACP_INDEX_JSON` to a JSON string representing the index. This bypasses network fetching entirely and the CLI will use the provided index verbatim.
|
|
104
104
|
|
|
105
|
+
- Nested folder support
|
|
106
|
+
- The CLI automatically scans for prompts, agents, instructions, and skills at any folder depth. Items can be organized at the root level (`prompts/`, `agents/`, etc.) or in nested folders like `.github/prompts/`, `workflows/prompts/`, etc.
|
|
107
|
+
|
|
105
108
|
- Multiple upstream repos
|
|
106
109
|
- To index multiple repos set `ACP_REPOS_JSON` to a JSON array of repo descriptors. Example:
|
|
107
110
|
|
|
@@ -126,7 +129,9 @@ You can inject a full, pre-built index via the `ACP_INDEX_JSON` environment vari
|
|
|
126
129
|
{
|
|
127
130
|
"prompts": [{ "id": "p1", "name": "Prompt 1", "repo": "r1", "url": "https://..." }],
|
|
128
131
|
"chatmodes": [],
|
|
129
|
-
"
|
|
132
|
+
"agents": [],
|
|
133
|
+
"instructions": [],
|
|
134
|
+
"skills": []
|
|
130
135
|
}
|
|
131
136
|
```
|
|
132
137
|
|
|
@@ -136,6 +141,8 @@ ACP_REPOS_JSON
|
|
|
136
141
|
|
|
137
142
|
To support multiple upstream repos, set `ACP_REPOS_JSON` to a JSON array describing the repositories to index. Each repo object should contain at least an `id` and a `treeUrl`. Optionally include `rawBase` (the base URL to fetch raw file contents).
|
|
138
143
|
|
|
144
|
+
**Important:** The default awesome-copilot repo is always included alongside your configured repos unless you explicitly set `ACP_EXCLUDE_DEFAULT_REPO=true` (environment variable). This means your custom repos are *additive* to the default, not replacements.
|
|
145
|
+
|
|
139
146
|
Example:
|
|
140
147
|
|
|
141
148
|
```json
|
|
@@ -150,13 +157,28 @@ When multiple repos contain files with the same `id`, the fetcher adds an `_conf
|
|
|
150
157
|
Local repo file (acp-repos.json)
|
|
151
158
|
-------------------------------
|
|
152
159
|
|
|
153
|
-
In addition to `ACP_REPOS_JSON` the CLI will look for a file named `acp-repos.json` in
|
|
160
|
+
In addition to `ACP_REPOS_JSON` the CLI will look for a file named `acp-repos.json` in a local configuration directory and use it to populate the upstream repo list if the environment variable is not set. In normal usage (when `NODE_ENV` is not `development` or `test`), this file is expected at `~/.acp/acp-repos.json`. When `NODE_ENV` is set to `development` or `test`, the CLI instead looks for `./acp-repos.json` in the current working directory; this behavior exists primarily to support local development and automated tests. This file should contain the same JSON array format as `ACP_REPOS_JSON` and is useful for per-user configuration without exporting environment variables. **Like `ACP_REPOS_JSON`, the default awesome-copilot repo is always included alongside repos from this file unless you set `ACP_EXCLUDE_DEFAULT_REPO=true`.** Precedence when building the repos list is:
|
|
161
|
+
|
|
162
|
+
1. `ACP_REPOS_JSON` environment variable (highest priority) — default repo is always added
|
|
163
|
+
2. Local `acp-repos.json` file (if `ACP_REPOS_JSON` not set): in `~/.acp/acp-repos.json` by default, or `./acp-repos.json` when `NODE_ENV` is `development` or `test` — default repo is always added
|
|
164
|
+
3. Built-in default repo (github/awesome-copilot) — used as fallback
|
|
165
|
+
|
|
166
|
+
To exclude the default awesome-copilot repo entirely, set the `ACP_EXCLUDE_DEFAULT_REPO` environment variable to `true` or `1`.
|
|
167
|
+
|
|
168
|
+
ACP_EXCLUDE_DEFAULT_REPO
|
|
154
169
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
170
|
+
By default, the awesome-copilot repository is always included in the index regardless of whether you've configured custom repos via `ACP_REPOS_JSON` or `acp-repos.json`. This makes custom repos *additive* rather than replacements.
|
|
171
|
+
|
|
172
|
+
If you want to exclude the default awesome-copilot repo, set `ACP_EXCLUDE_DEFAULT_REPO=true` or `ACP_EXCLUDE_DEFAULT_REPO=1`:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Exclude default repo and use only custom repos
|
|
176
|
+
export ACP_EXCLUDE_DEFAULT_REPO=true
|
|
177
|
+
export ACP_REPOS_JSON='[{"id":"myrepo","treeUrl":"...","rawBase":"..."}]'
|
|
178
|
+
acp-vscode list
|
|
179
|
+
```
|
|
158
180
|
|
|
159
|
-
|
|
181
|
+
When this is set to any value other than `true` or `1`, the default repo will be included (default behavior).
|
|
160
182
|
|
|
161
183
|
Dry-run:
|
|
162
184
|
|
|
@@ -179,8 +201,8 @@ Commands reference
|
|
|
179
201
|
Short reference for each command, key options, and quick examples.
|
|
180
202
|
|
|
181
203
|
- install <workspace|user> [names...]
|
|
182
|
-
- Description: Install prompts/
|
|
183
|
-
- Options: `-t, --type <type>` (prompts|
|
|
204
|
+
- Description: Install prompts/agents/instructions/skills into a workspace or VS Code user profile.
|
|
205
|
+
- Options: `-t, --type <type>` (prompts|agents|instructions|skills|chatmodes|all; `chatmodes` is legacy/deprecated), `--dry-run`, `--referesh` (alias for refresh), `--verbose`
|
|
184
206
|
- Examples:
|
|
185
207
|
- Install all prompts into the current workspace:
|
|
186
208
|
- `acp-vscode install workspace prompts`
|
|
@@ -188,10 +210,10 @@ Short reference for each command, key options, and quick examples.
|
|
|
188
210
|
- `acp-vscode install user --type instructions "Instruction Name"`
|
|
189
211
|
|
|
190
212
|
- list [type]
|
|
191
|
-
- Description: List available items. Type can be `prompts`, `
|
|
213
|
+
- Description: List available items. Type can be `prompts`, `agents`, `instructions`, `skills`, `chatmodes` (legacy), or `all` (default).
|
|
192
214
|
- Options: `-r, --refresh` (clear caches and refetch), `-j, --json`, `--verbose`
|
|
193
215
|
- Examples:
|
|
194
|
-
- `acp-vscode list
|
|
216
|
+
- `acp-vscode list agents`
|
|
195
217
|
- `acp-vscode list --json`
|
|
196
218
|
|
|
197
219
|
- search <query>
|