@silverassist/agents-toolkit 2.3.0 → 2.4.0
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/README.md +160 -33
- package/bin/cli.js +506 -13
- package/package.json +1 -1
- package/src/index.js +44 -9
- package/templates/shared/hooks/lint-format.json +1 -0
- package/templates/shared/hooks/validate-tsx.json +1 -0
- package/templates/shared/prompts/create-github-pr.prompt.md +147 -0
- package/templates/shared/prompts/finalize-github-pr.prompt.md +129 -0
- package/templates/shared/prompts/work-github-issue.prompt.md +1 -1
- package/templates/shared/skills/README.md +25 -3
package/src/index.js
CHANGED
|
@@ -3,45 +3,79 @@
|
|
|
3
3
|
* @module @silverassist/agents-toolkit
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export const VERSION = "2.
|
|
6
|
+
export const VERSION = "2.4.0";
|
|
7
7
|
|
|
8
8
|
export const PROMPTS = {
|
|
9
9
|
workflow: [
|
|
10
|
+
"analyze-github-issue",
|
|
10
11
|
"analyze-ticket",
|
|
12
|
+
"create-github-pr",
|
|
11
13
|
"create-plan",
|
|
12
|
-
"work-ticket",
|
|
13
|
-
"prepare-pr",
|
|
14
14
|
"create-pr",
|
|
15
|
+
"finalize-github-pr",
|
|
15
16
|
"finalize-pr",
|
|
17
|
+
"prepare-pr",
|
|
18
|
+
"prepare-release",
|
|
19
|
+
"work-github-issue",
|
|
20
|
+
"work-ticket",
|
|
21
|
+
],
|
|
22
|
+
utility: [
|
|
23
|
+
"add-tests",
|
|
24
|
+
"audit-ai-seo",
|
|
25
|
+
"fix-issues",
|
|
26
|
+
"new-wp-component",
|
|
27
|
+
"new-wp-plugin",
|
|
28
|
+
"quality-check",
|
|
29
|
+
"review-code",
|
|
16
30
|
],
|
|
17
|
-
utility: ["review-code", "fix-issues", "add-tests"],
|
|
18
31
|
};
|
|
19
32
|
|
|
20
33
|
export const PARTIALS = [
|
|
21
|
-
"
|
|
34
|
+
"documentation",
|
|
22
35
|
"git-operations",
|
|
36
|
+
"github-integration",
|
|
23
37
|
"jira-integration",
|
|
24
|
-
"documentation",
|
|
25
38
|
"pr-template",
|
|
39
|
+
"validations",
|
|
26
40
|
];
|
|
27
41
|
|
|
28
42
|
export const INSTRUCTIONS = [
|
|
29
|
-
"
|
|
43
|
+
"css-styling",
|
|
44
|
+
"documentation-language",
|
|
45
|
+
"github-workflow",
|
|
46
|
+
"php-standards",
|
|
30
47
|
"react-components",
|
|
31
48
|
"server-actions",
|
|
49
|
+
"testing-standards",
|
|
32
50
|
"tests",
|
|
33
|
-
"
|
|
51
|
+
"typescript",
|
|
52
|
+
"wordpress-plugin-architecture",
|
|
34
53
|
];
|
|
35
54
|
|
|
36
55
|
export const SKILLS = [
|
|
56
|
+
"ai-seo-optimization",
|
|
37
57
|
"component-architecture",
|
|
58
|
+
"create-component",
|
|
38
59
|
"domain-driven-design",
|
|
60
|
+
"plugin-creation",
|
|
61
|
+
"quality-checks",
|
|
62
|
+
"release-management",
|
|
63
|
+
"testing",
|
|
39
64
|
"testing-patterns",
|
|
40
|
-
"ai-seo-optimization",
|
|
41
65
|
];
|
|
42
66
|
|
|
43
67
|
export const HOOKS = ["validate-tsx", "lint-format"];
|
|
44
68
|
|
|
69
|
+
// Skills follow the `npx skills` standard: a single canonical copy lives in
|
|
70
|
+
// .agents/skills/ and each agent's skills directory symlinks to it.
|
|
71
|
+
export const SKILLS_LAYOUT = {
|
|
72
|
+
canonicalDir: ".agents/skills",
|
|
73
|
+
agentDirs: {
|
|
74
|
+
claude: ".claude/skills",
|
|
75
|
+
copilot: ".github/skills",
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
45
79
|
// Claude Code equivalents
|
|
46
80
|
export const CLAUDE_COMMANDS = [
|
|
47
81
|
"analyze-ticket",
|
|
@@ -58,4 +92,5 @@ export const CLAUDE_COMMANDS = [
|
|
|
58
92
|
export const CLAUDE_FILES = {
|
|
59
93
|
instructions: "CLAUDE.md",
|
|
60
94
|
commandsDir: ".claude/commands",
|
|
95
|
+
skillsDir: ".claude/skills",
|
|
61
96
|
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Create a pull request for the current branch linked to a GitHub issue
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create GitHub Pull Request
|
|
7
|
+
|
|
8
|
+
Create a pull request for the current branch linked to GitHub issue **#{issue-number}**.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- Run `prepare-pr` first to ensure code is ready
|
|
12
|
+
- GitHub MCP connection or `gh` CLI required
|
|
13
|
+
- Reference: `.github/prompts/_partials/pr-template.md`
|
|
14
|
+
- Reference: `.github/prompts/_partials/git-operations.md`
|
|
15
|
+
- Reference: `.github/prompts/_partials/github-integration.md`
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
### 1. Verify Current State
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git branch --show-current
|
|
23
|
+
git status
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Verify:
|
|
27
|
+
- Branch follows convention: `feature/{issue-number}-*` or `bugfix/{issue-number}-*`
|
|
28
|
+
- All changes are committed
|
|
29
|
+
- Not on protected branch
|
|
30
|
+
|
|
31
|
+
### 2. Review Changes
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
BASE_BRANCH=$(node -e "try{const c=require('./.agents-toolkit.json');console.log(c.pr?.targetBranch||c.git?.defaultBranch||'main')}catch{console.log('main')}")
|
|
35
|
+
git diff "$BASE_BRANCH" --name-only
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- Reuse `BASE_BRANCH` in all subsequent steps
|
|
39
|
+
- Summarize the changes made
|
|
40
|
+
- Identify breaking changes or migrations
|
|
41
|
+
|
|
42
|
+
### 3. Read GitHub Issue
|
|
43
|
+
|
|
44
|
+
Fetch issue **#{issue-number}** details:
|
|
45
|
+
- Get title for PR title
|
|
46
|
+
- Extract acceptance criteria
|
|
47
|
+
- Get any context from comments
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
gh issue view {issue-number} | cat
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 4. Run Final Validations
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run lint --if-present
|
|
57
|
+
npm run type-check --if-present
|
|
58
|
+
if [ -f tsconfig.json ]; then npx tsc --noEmit; fi
|
|
59
|
+
npm run test --if-present
|
|
60
|
+
npm run build --if-present
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Fix any issues before proceeding.
|
|
64
|
+
|
|
65
|
+
### 5. Push Branch
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git push -u origin $(git branch --show-current)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 6. Create Pull Request
|
|
72
|
+
|
|
73
|
+
#### PR Title
|
|
74
|
+
```
|
|
75
|
+
{Issue title}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### PR Description
|
|
79
|
+
|
|
80
|
+
Use this template:
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
## Summary
|
|
84
|
+
Brief description of what this PR accomplishes.
|
|
85
|
+
|
|
86
|
+
## Related Issue
|
|
87
|
+
Closes #{issue-number}
|
|
88
|
+
|
|
89
|
+
## Changes Made
|
|
90
|
+
- Change 1: Description
|
|
91
|
+
- Change 2: Description
|
|
92
|
+
- Change 3: Description
|
|
93
|
+
|
|
94
|
+
## Type of Change
|
|
95
|
+
- [ ] 🐛 Bug fix
|
|
96
|
+
- [ ] ✨ New feature
|
|
97
|
+
- [ ] 💥 Breaking change
|
|
98
|
+
- [ ] 📝 Documentation
|
|
99
|
+
- [ ] 🔧 Refactoring
|
|
100
|
+
|
|
101
|
+
## Testing
|
|
102
|
+
- [ ] Unit tests added/updated
|
|
103
|
+
- [ ] Manual testing performed
|
|
104
|
+
- Describe test cases here
|
|
105
|
+
|
|
106
|
+
## Screenshots
|
|
107
|
+
(If UI changes, add before/after screenshots)
|
|
108
|
+
|
|
109
|
+
## Checklist
|
|
110
|
+
- [ ] Code follows project style guidelines
|
|
111
|
+
- [ ] Self-review completed
|
|
112
|
+
- [ ] Documentation updated
|
|
113
|
+
- [ ] Tests pass locally
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Create via CLI
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
gh pr create \
|
|
120
|
+
--title "{Issue title}" \
|
|
121
|
+
--body "$(cat <<'EOF'
|
|
122
|
+
## Summary
|
|
123
|
+
...
|
|
124
|
+
|
|
125
|
+
Closes #{issue-number}
|
|
126
|
+
EOF
|
|
127
|
+
)" \
|
|
128
|
+
--base "$BASE_BRANCH" | cat
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### PR Settings
|
|
132
|
+
- **Source**: Current branch
|
|
133
|
+
- **Target**: `<base-branch>` resolved from `.agents-toolkit.json` (fallback: `main`)
|
|
134
|
+
- **Reviewers**: Based on changed files
|
|
135
|
+
|
|
136
|
+
### 7. Comment on GitHub Issue
|
|
137
|
+
|
|
138
|
+
Add a comment linking to the PR:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
gh issue comment {issue-number} --body "## Pull Request Created
|
|
142
|
+
|
|
143
|
+
PR: <pr-url>
|
|
144
|
+
Branch: \`$(git branch --show-current)\`
|
|
145
|
+
|
|
146
|
+
Work in progress. Review requested." | cat
|
|
147
|
+
```
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
agent: agent
|
|
3
|
+
description: Finalize a pull request after approval and prepare for merge
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Finalize GitHub Pull Request
|
|
7
|
+
|
|
8
|
+
Finalize PR for GitHub issue **#{issue-number}** after approval and prepare for merge.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
- PR has been approved
|
|
12
|
+
- GitHub MCP connection or `gh` CLI required
|
|
13
|
+
- Reference: `.github/prompts/_partials/git-operations.md`
|
|
14
|
+
- Reference: `.github/prompts/_partials/validations.md`
|
|
15
|
+
- Reference: `.github/prompts/_partials/github-integration.md`
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
### 1. Verify PR Status
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
gh pr view --json state,reviewDecision,statusCheckRollup | cat
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Check:
|
|
26
|
+
- All required approvals in place
|
|
27
|
+
- CI/CD pipeline passed
|
|
28
|
+
- No unresolved review comments
|
|
29
|
+
|
|
30
|
+
### 2. Address Review Comments
|
|
31
|
+
|
|
32
|
+
If there are unresolved comments:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gh pr view --json reviews,comments | cat
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- List each unresolved comment
|
|
39
|
+
- Address feedback
|
|
40
|
+
- Push additional commits if needed
|
|
41
|
+
- Request re-review if changes are significant:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
gh pr review --request-changes --body "..." | cat
|
|
45
|
+
# or after fixing:
|
|
46
|
+
gh pr review --approve | cat
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. Sync with Base Branch
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
BASE_BRANCH=$(node -e "try{const c=require('./.agents-toolkit.json');console.log(c.pr?.targetBranch||c.git?.defaultBranch||'main')}catch{console.log('main')}")
|
|
53
|
+
git fetch origin
|
|
54
|
+
git rebase "origin/${BASE_BRANCH}"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If conflicts:
|
|
58
|
+
1. Resolve each conflict
|
|
59
|
+
2. Stage resolved files: `git add <file>`
|
|
60
|
+
3. Continue rebase: `git rebase --continue`
|
|
61
|
+
|
|
62
|
+
Push updated branch:
|
|
63
|
+
```bash
|
|
64
|
+
git push --force-with-lease
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 4. Final Validations
|
|
68
|
+
|
|
69
|
+
Run complete validation suite:
|
|
70
|
+
```bash
|
|
71
|
+
npm run lint --if-present
|
|
72
|
+
npm run type-check --if-present
|
|
73
|
+
if [ -f tsconfig.json ]; then npx tsc --noEmit; fi
|
|
74
|
+
npm run test --if-present
|
|
75
|
+
npm run build --if-present
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Verify:
|
|
79
|
+
- No regressions after rebase
|
|
80
|
+
- All tests still pass
|
|
81
|
+
- No new warnings
|
|
82
|
+
|
|
83
|
+
### 5. Merge Pull Request
|
|
84
|
+
|
|
85
|
+
**Recommended merge strategy**: Squash merge
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
gh pr merge --squash --delete-branch | cat
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Final commit message format**:
|
|
92
|
+
```
|
|
93
|
+
{Issue title} (#{pr-number})
|
|
94
|
+
|
|
95
|
+
- Key change 1
|
|
96
|
+
- Key change 2
|
|
97
|
+
- Key change 3
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 6. Post-Merge Tasks
|
|
101
|
+
|
|
102
|
+
After merge is complete:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Return to base branch and sync
|
|
106
|
+
git checkout "$BASE_BRANCH"
|
|
107
|
+
git pull origin "$BASE_BRANCH"
|
|
108
|
+
|
|
109
|
+
# Delete local branch (force if squash-merged)
|
|
110
|
+
git branch -D <branch-name>
|
|
111
|
+
|
|
112
|
+
# Clean up stale references
|
|
113
|
+
git remote prune origin
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 7. Close GitHub Issue
|
|
117
|
+
|
|
118
|
+
The issue closes automatically if the PR description contains `Closes #{issue-number}`.
|
|
119
|
+
If not, close manually:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
gh issue close {issue-number} --comment "Completed in PR #<pr-number>." | cat
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 8. Clean Up
|
|
126
|
+
|
|
127
|
+
- [ ] Delete temporary planning docs from `docs/` (if applicable)
|
|
128
|
+
- [ ] Ensure final documentation is complete
|
|
129
|
+
- [ ] Verify commit history is clean
|
|
@@ -8,18 +8,39 @@ Skills are markdown files with YAML frontmatter that provide domain-specific gui
|
|
|
8
8
|
|
|
9
9
|
## Structure
|
|
10
10
|
|
|
11
|
-
Each skill lives in its own folder with a `SKILL.md` file
|
|
11
|
+
Each skill lives in its own folder with a `SKILL.md` file. Following the
|
|
12
|
+
[`npx skills`](https://github.com/vercel-labs/skills) standard, the real files
|
|
13
|
+
are installed **once** into a canonical `.agents/skills/` store, and each agent's
|
|
14
|
+
skills directory contains symlinks to it (single source of truth):
|
|
12
15
|
|
|
13
16
|
```
|
|
14
|
-
.
|
|
17
|
+
.agents/skills/ # canonical store (real files)
|
|
18
|
+
├── ai-seo-optimization/
|
|
19
|
+
│ └── SKILL.md
|
|
15
20
|
├── component-architecture/
|
|
16
21
|
│ └── SKILL.md
|
|
22
|
+
├── create-component/
|
|
23
|
+
│ └── SKILL.md
|
|
17
24
|
├── domain-driven-design/
|
|
18
25
|
│ └── SKILL.md
|
|
26
|
+
├── plugin-creation/
|
|
27
|
+
│ └── SKILL.md
|
|
28
|
+
├── quality-checks/
|
|
29
|
+
│ └── SKILL.md
|
|
30
|
+
├── release-management/
|
|
31
|
+
│ └── SKILL.md
|
|
32
|
+
├── testing/
|
|
33
|
+
│ └── SKILL.md
|
|
19
34
|
└── testing-patterns/
|
|
20
35
|
└── SKILL.md
|
|
36
|
+
|
|
37
|
+
.github/skills/ → symlinks to ../../.agents/skills/* (Copilot, Codex)
|
|
38
|
+
.claude/skills/ → symlinks to ../../.agents/skills/* (Claude Code, read natively)
|
|
21
39
|
```
|
|
22
40
|
|
|
41
|
+
Use `--copy` at install time to materialize real copies instead of symlinks
|
|
42
|
+
(symlinks also fall back to copies automatically on systems that don't support them).
|
|
43
|
+
|
|
23
44
|
## Frontmatter Format
|
|
24
45
|
|
|
25
46
|
```yaml
|
|
@@ -47,7 +68,8 @@ Skills are automatically picked up by agents when relevant to your question. You
|
|
|
47
68
|
|
|
48
69
|
## Creating Custom Skills
|
|
49
70
|
|
|
50
|
-
1. Create a folder: `.
|
|
71
|
+
1. Create a folder: `.agents/skills/your-skill-name/` (canonical store)
|
|
51
72
|
2. Create `SKILL.md` with frontmatter
|
|
73
|
+
3. Run `npx @silverassist/agents-toolkit install --skills-only` to symlink it into `.github/skills/` and `.claude/skills/`
|
|
52
74
|
3. Document patterns, examples, and conventions
|
|
53
75
|
4. Include ✅ CORRECT and ❌ INCORRECT examples
|