@silverassist/agents-toolkit 2.0.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.
Files changed (51) hide show
  1. package/LICENSE +135 -0
  2. package/README.md +388 -0
  3. package/bin/cli.js +940 -0
  4. package/package.json +52 -0
  5. package/src/index.js +58 -0
  6. package/templates/agents/AGENTS.codex.md +195 -0
  7. package/templates/agents/AGENTS.md +195 -0
  8. package/templates/agents/CLAUDE.md +213 -0
  9. package/templates/agents/copilot-instructions.md +83 -0
  10. package/templates/shared/instructions/css-styling.instructions.md +142 -0
  11. package/templates/shared/instructions/documentation-language.instructions.md +216 -0
  12. package/templates/shared/instructions/github-workflow.instructions.md +245 -0
  13. package/templates/shared/instructions/php-standards.instructions.md +293 -0
  14. package/templates/shared/instructions/react-components.instructions.md +196 -0
  15. package/templates/shared/instructions/server-actions.instructions.md +429 -0
  16. package/templates/shared/instructions/testing-standards.instructions.md +264 -0
  17. package/templates/shared/instructions/tests.instructions.md +103 -0
  18. package/templates/shared/instructions/typescript.instructions.md +106 -0
  19. package/templates/shared/instructions/wordpress-plugin-architecture.instructions.md +238 -0
  20. package/templates/shared/prompts/README.md +129 -0
  21. package/templates/shared/prompts/_partials/README.md +57 -0
  22. package/templates/shared/prompts/_partials/documentation.md +203 -0
  23. package/templates/shared/prompts/_partials/git-operations.md +171 -0
  24. package/templates/shared/prompts/_partials/github-integration.md +100 -0
  25. package/templates/shared/prompts/_partials/jira-integration.md +155 -0
  26. package/templates/shared/prompts/_partials/pr-template.md +216 -0
  27. package/templates/shared/prompts/_partials/validations.md +87 -0
  28. package/templates/shared/prompts/add-tests.prompt.md +151 -0
  29. package/templates/shared/prompts/analyze-github-issue.prompt.md +73 -0
  30. package/templates/shared/prompts/analyze-ticket.prompt.md +63 -0
  31. package/templates/shared/prompts/create-plan.prompt.md +118 -0
  32. package/templates/shared/prompts/create-pr.prompt.md +139 -0
  33. package/templates/shared/prompts/finalize-pr.prompt.md +150 -0
  34. package/templates/shared/prompts/fix-issues.prompt.md +92 -0
  35. package/templates/shared/prompts/new-wp-component.prompt.md +51 -0
  36. package/templates/shared/prompts/new-wp-plugin.prompt.md +46 -0
  37. package/templates/shared/prompts/prepare-pr.prompt.md +123 -0
  38. package/templates/shared/prompts/prepare-release.prompt.md +74 -0
  39. package/templates/shared/prompts/quality-check.prompt.md +45 -0
  40. package/templates/shared/prompts/review-code.prompt.md +81 -0
  41. package/templates/shared/prompts/work-github-issue.prompt.md +96 -0
  42. package/templates/shared/prompts/work-ticket.prompt.md +98 -0
  43. package/templates/shared/skills/README.md +53 -0
  44. package/templates/shared/skills/component-architecture/SKILL.md +321 -0
  45. package/templates/shared/skills/create-component/SKILL.md +714 -0
  46. package/templates/shared/skills/domain-driven-design/SKILL.md +277 -0
  47. package/templates/shared/skills/plugin-creation/SKILL.md +1094 -0
  48. package/templates/shared/skills/quality-checks/SKILL.md +493 -0
  49. package/templates/shared/skills/release-management/SKILL.md +649 -0
  50. package/templates/shared/skills/testing/SKILL.md +682 -0
  51. package/templates/shared/skills/testing-patterns/SKILL.md +243 -0
@@ -0,0 +1,123 @@
1
+ ---
2
+ agent: agent
3
+ description: Prepare code for a pull request by running all validations
4
+ ---
5
+
6
+ # Prepare for Pull Request
7
+
8
+ Prepare the current branch for a pull request by running all validations.
9
+
10
+ ## Prerequisites
11
+ - Reference: `.github/prompts/_partials/validations.md`
12
+ - Reference: `.github/prompts/_partials/git-operations.md`
13
+
14
+ ## Steps
15
+
16
+ ### 1. Check Branch Status
17
+
18
+ ```bash
19
+ BASE_BRANCH=$(node -e "try{const c=require('./.agents-toolkit.json');console.log(c.pr?.targetBranch||c.git?.defaultBranch||'main')}catch{console.log('main')}")
20
+ git branch --show-current
21
+ git status
22
+ git log --oneline -5
23
+ ```
24
+
25
+ Verify:
26
+ - Not on protected branch (main, dev, stg, master, `${BASE_BRANCH}`)
27
+ - All changes are committed
28
+ - Branch follows naming: `feature/TICKET-*` or `bugfix/TICKET-*`
29
+
30
+ ### 2. Code Quality Checks
31
+
32
+ #### Lint Check
33
+ ```bash
34
+ npm run lint --if-present
35
+ ```
36
+ - Fix auto-fixable: `npm run lint --if-present -- --fix`
37
+ - Report issues needing manual fix
38
+
39
+ #### Type Check
40
+ ```bash
41
+ npm run type-check --if-present
42
+ if [ -f tsconfig.json ]; then npx tsc --noEmit; fi
43
+ ```
44
+ - Fix any TypeScript errors
45
+ - Ensure no `any` types introduced
46
+
47
+ ### 3. Run Test Suite
48
+
49
+ ```bash
50
+ npm run test --if-present
51
+ npm run build --if-present
52
+ ```
53
+ - Review test results
54
+ - Check coverage report
55
+ - Fix any failing tests
56
+
57
+ ### 4. Code Review Checks
58
+
59
+ Verify:
60
+ - [ ] No `console.log` or debug statements
61
+ - [ ] No sensitive data exposed (API keys, secrets)
62
+ - [ ] No `any` types introduced
63
+ - [ ] JSDoc comments on new/modified functions
64
+ - [ ] Props interfaces documented
65
+
66
+ ### 5. Review Changes
67
+
68
+ ```bash
69
+ git diff --stat
70
+ git diff "$BASE_BRANCH" --name-only
71
+ ```
72
+
73
+ Check:
74
+ - Files changed align with ticket scope
75
+ - No unintended changes
76
+ - README/docs updated if needed
77
+
78
+ ### 6. Commit Hygiene
79
+
80
+ Verify commit messages:
81
+ - Follow format: `TICKET-ID: Description`
82
+ - Use present tense, imperative mood
83
+ - No merge commits (rebase on base branch if needed)
84
+
85
+ If merge commits are present, rebase non-interactively on base branch:
86
+ ```bash
87
+ git fetch origin
88
+ git rebase "origin/${BASE_BRANCH}"
89
+ ```
90
+
91
+ ### 7. Documentation Check
92
+
93
+ - [ ] JSDoc comments on new functions
94
+ - [ ] README updated if needed
95
+ - [ ] Inline comments for complex logic
96
+ - [ ] Component props documented
97
+
98
+ ## Output: Readiness Report
99
+
100
+ ### ✅ Passed Checks
101
+ - List all passed checks
102
+
103
+ ### ⚠️ Warnings
104
+ - Issues to address but not blockers
105
+
106
+ ### ❌ Blockers
107
+ - Must fix before proceeding
108
+
109
+ ### 📁 Changed Files
110
+ - List all modified files
111
+
112
+ ### 📝 Summary
113
+ Brief summary for PR description
114
+
115
+ ### 👥 Suggested Reviewers
116
+ Based on changed files:
117
+ - @reviewer1 (reason)
118
+ - @reviewer2 (reason)
119
+
120
+ ## Next Steps
121
+ - Fix any blockers
122
+ - Address warnings
123
+ - Use `create-pr` to create the pull request
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Prepare a new release for a Silver Assist WordPress plugin (version bump, changelog, tag, PR)
3
+ agent: agent
4
+ tools:
5
+ - run_in_terminal
6
+ - read_file
7
+ - replace_string_in_file
8
+ - create_file
9
+ ---
10
+
11
+ # Prepare Release
12
+
13
+ Prepare a new version release for the current Silver Assist plugin.
14
+
15
+ ## Inputs
16
+
17
+ Ask the user:
18
+ 1. **Version type** — Is this a `patch`, `minor`, or `major` release? (default: patch)
19
+ 2. **Changelog entry** — What changed? (or offer to generate from recent commits)
20
+
21
+ ## Steps
22
+
23
+ 1. **Detect plugin** — Find the plugin root, main plugin file, and current version.
24
+
25
+ 2. **Determine new version** — Based on the version type, calculate the next semantic version.
26
+
27
+ 3. **Run quality checks** — Execute `./scripts/run-quality-checks.sh --skip-wp-setup phpcs phpstan` to verify the code is clean before release. Do NOT proceed if checks fail.
28
+
29
+ 4. **Update version** — Run the version update script:
30
+ ```bash
31
+ ./scripts/update-version.sh X.Y.Z
32
+ ```
33
+ Or if the plugin uses the simple variant:
34
+ ```bash
35
+ ./scripts/update-version-simple.sh X.Y.Z
36
+ ```
37
+ This updates the version in the main plugin file, `readme.txt` (if present), and `composer.json`.
38
+
39
+ 5. **Update CHANGELOG.md** — Add a new entry at the top following this format:
40
+ ```markdown
41
+ ## [X.Y.Z] - YYYY-MM-DD
42
+
43
+ ### Added/Changed/Fixed
44
+ - Description of change
45
+ ```
46
+
47
+ 6. **Create release branch and commit** — Following the branch naming convention:
48
+ ```bash
49
+ git checkout -b release/vX.Y.Z
50
+ git add -A
51
+ git commit -m "chore: bump version to X.Y.Z"
52
+ ```
53
+
54
+ 7. **Push and create PR** — Push the branch and create a PR:
55
+ ```bash
56
+ git push origin release/vX.Y.Z
57
+ gh pr create --title "Release vX.Y.Z" --body "## Changes\n\n- changelog entry" | cat
58
+ ```
59
+
60
+ 8. **Post-merge instructions** — Remind the user:
61
+ - After merging the PR, create the tag from the main/master branch:
62
+ ```bash
63
+ git checkout main && git pull
64
+ git tag vX.Y.Z
65
+ git push origin vX.Y.Z
66
+ ```
67
+ - The GitHub Actions release workflow will automatically build the ZIP and create the GitHub Release.
68
+
69
+ ## Important
70
+
71
+ - **NEVER reuse an existing tag** — tags are immutable. If a tag exists, bump to the next version.
72
+ - The release-management skill has full documentation — use it for troubleshooting.
73
+ - Some plugins use `master` instead of `main` (e.g., silver-assist-post-revalidate).
74
+ - Always verify the default branch with `git branch --show-current` or `gh repo view --json defaultBranchRef | cat`.
@@ -0,0 +1,45 @@
1
+ ---
2
+ description: Run code quality checks (PHPCS, PHPStan, PHPUnit) on a Silver Assist WordPress plugin
3
+ agent: agent
4
+ tools:
5
+ - run_in_terminal
6
+ - read_file
7
+ - replace_string_in_file
8
+ ---
9
+
10
+ # Quality Check
11
+
12
+ Run the full quality check suite on the current Silver Assist plugin.
13
+
14
+ ## Steps
15
+
16
+ 1. **Detect the plugin** — Identify the plugin root directory from the current workspace or active file. Look for `composer.json` and the main plugin PHP file.
17
+
18
+ 2. **Ensure dependencies** — Verify `vendor/` exists. If not, run `composer install`.
19
+
20
+ 3. **Run PHPCS** — Execute `vendor/bin/phpcs` to check WordPress Coding Standards compliance.
21
+ - If errors are found, first attempt auto-fix with `vendor/bin/phpcbf`.
22
+ - Re-run `vendor/bin/phpcs` and report remaining errors that need manual fixes.
23
+
24
+ 4. **Run PHPStan** — Execute `vendor/bin/phpstan analyse --memory-limit=1G` for static analysis at level 8.
25
+ - Report any type errors with file locations and suggested fixes.
26
+
27
+ 5. **Run PHPUnit** — Execute `vendor/bin/phpunit` to run the test suite.
28
+ - If the WordPress Test Suite is not available, note which tests failed and why.
29
+
30
+ 6. **Summary** — Provide a clear summary table:
31
+
32
+ | Check | Status | Issues |
33
+ |---------|--------|--------|
34
+ | PHPCS | ✅/❌ | Count |
35
+ | PHPStan | ✅/❌ | Count |
36
+ | PHPUnit | ✅/❌ | Count |
37
+
38
+ If all checks pass, confirm the plugin is ready for commit/release.
39
+ If any check fails, provide actionable fix suggestions.
40
+
41
+ ## Important
42
+
43
+ - Always run checks from the **plugin root directory** (where `composer.json` is).
44
+ - Use `| cat` after commands to avoid pager issues.
45
+ - The quality-checks skill has full documentation on rules and common errors — use it if needed.
@@ -0,0 +1,81 @@
1
+ ---
2
+ agent: agent
3
+ description: Quick code review of current changes
4
+ ---
5
+
6
+ # Quick Code Review
7
+
8
+ Perform a quick code review of the current changes.
9
+
10
+ ## Steps
11
+
12
+ ### 1. Get Changed Files
13
+
14
+ ```bash
15
+ git diff --name-only HEAD~1
16
+ # or for unstaged changes:
17
+ git diff --name-only
18
+ ```
19
+
20
+ ### 2. Review Each File
21
+
22
+ For each changed file:
23
+
24
+ #### Code Quality
25
+ - [ ] No `console.log` or debug statements
26
+ - [ ] No `any` types
27
+ - [ ] No hardcoded values (use constants)
28
+ - [ ] No commented-out code
29
+
30
+ #### Style & Conventions
31
+ - [ ] Follows project naming conventions
32
+ - [ ] Imports organized alphabetically
33
+ - [ ] Proper TypeScript types
34
+ - [ ] Consistent formatting
35
+
36
+ #### Logic
37
+ - [ ] No nested ternaries
38
+ - [ ] Early returns used appropriately
39
+ - [ ] Error handling in place
40
+ - [ ] Edge cases considered
41
+
42
+ #### Documentation
43
+ - [ ] JSDoc on new functions
44
+ - [ ] Complex logic has comments
45
+ - [ ] Props interfaces documented
46
+
47
+ ### 3. Security Check
48
+
49
+ - [ ] No sensitive data (API keys, secrets)
50
+ - [ ] No exposed credentials
51
+ - [ ] No unsafe user input handling
52
+
53
+ ### 4. Performance
54
+
55
+ - [ ] No unnecessary re-renders (React)
56
+ - [ ] Efficient data structures
57
+ - [ ] No memory leaks potential
58
+
59
+ ## Output
60
+
61
+ ### Review Summary
62
+
63
+ | File | Status | Issues |
64
+ |------|--------|--------|
65
+ | file1.ts | ✅/⚠️/❌ | issue description |
66
+ | file2.tsx | ✅/⚠️/❌ | issue description |
67
+
68
+ ### Issues Found
69
+
70
+ #### ❌ Critical (must fix)
71
+ - Issue 1: Description and fix
72
+
73
+ #### ⚠️ Warnings (should fix)
74
+ - Warning 1: Description and suggestion
75
+
76
+ #### 💡 Suggestions (nice to have)
77
+ - Suggestion 1: Improvement idea
78
+
79
+ ### Overall
80
+ - **Status**: Ready / Needs Work
81
+ - **Recommendation**: Summary
@@ -0,0 +1,96 @@
1
+ ---
2
+ agent: agent
3
+ description: Start working on a GitHub issue with full workflow setup
4
+ ---
5
+
6
+ # Work on GitHub Issue
7
+
8
+ Start working on GitHub issue **#{issue-number}** in repository **{owner}/{repo}** with complete workflow setup.
9
+
10
+ ## Prerequisites
11
+
12
+ - GitHub MCP connection or `gh` CLI required
13
+ - Reference: `.github/prompts/_partials/github-integration.md`
14
+ - Reference: `.github/prompts/_partials/git-operations.md`
15
+
16
+ ## Steps
17
+
18
+ ### 1. Read Complete Issue
19
+
20
+ Fetch issue **#{issue-number}** with all details:
21
+ - Title and description
22
+ - Labels and priority
23
+ - Current state
24
+ - All comments for context
25
+ - Acceptance criteria
26
+
27
+ ### 2. Analyze Project Context
28
+
29
+ Read project conventions:
30
+ - `AGENTS.md` — Agent instructions (Copilot/Codex)
31
+ - `CLAUDE.md` — Agent instructions (Claude Code)
32
+ - `copilot-instructions.md` or `.github/copilot-instructions.md` — Project guidelines
33
+ - `.github/instructions/` — File-type specific instructions
34
+ - `docs/` — Related documentation
35
+
36
+ ### 3. Analyze Technical Impact
37
+
38
+ Search codebase for:
39
+ - Related components
40
+ - Existing patterns
41
+ - Files to modify
42
+ - Dependencies
43
+
44
+ ### 4. Create Work Plan
45
+
46
+ Create planning document at `docs/{feature-name}-plan.md`:
47
+ - Problem statement
48
+ - Current architecture
49
+ - Proposed changes
50
+ - Phase breakdown
51
+ - Testing strategy
52
+
53
+ ### 5. Create Working Branch
54
+
55
+ From latest `main`:
56
+ ```bash
57
+ git checkout main
58
+ git pull origin main
59
+ git checkout -b feature/{issue-number}-short-description
60
+ # or for bugs:
61
+ git checkout -b fix/{issue-number}-short-description
62
+ ```
63
+
64
+ ### 6. Initial Commit
65
+
66
+ ```bash
67
+ git add docs/{feature-name}-plan.md
68
+ git commit -m "docs: Add implementation plan for #{issue-number}"
69
+ ```
70
+
71
+ ### 7. Update GitHub Issue
72
+
73
+ Add comment to the issue:
74
+ ```markdown
75
+ ## Development Started
76
+ - Branch: `feature/{issue-number}-description`
77
+ - Plan: `docs/{feature-name}-plan.md`
78
+
79
+ ## Phases
80
+ - [ ] Phase 1: ...
81
+ - [ ] Phase 2: ...
82
+ ```
83
+
84
+ ## Output
85
+
86
+ Report:
87
+ 1. ✅ Issue summary
88
+ 2. ✅ Branch created
89
+ 3. ✅ Planning document created
90
+ 4. ✅ Ready to start implementation
91
+
92
+ ## Next Steps
93
+
94
+ - Begin implementation following the plan
95
+ - Use `prepare-pr` when ready for review
96
+ - Use `create-pr` to submit pull request
@@ -0,0 +1,98 @@
1
+ ---
2
+ agent: agent
3
+ description: Start working on a Jira ticket with full workflow setup
4
+ ---
5
+
6
+ # Work on Jira Ticket
7
+
8
+ Start working on Jira ticket **{ticket-id}** with complete workflow setup.
9
+
10
+ ## Prerequisites
11
+ - Atlassian MCP connection required
12
+ - Reference: `.github/prompts/_partials/jira-integration.md`
13
+ - Reference: `.github/prompts/_partials/git-operations.md`
14
+
15
+ ## Steps
16
+
17
+ ### 1. Verify Jira Access
18
+ - Use `getAccessibleAtlassianResources` to confirm connectivity
19
+ - Get the correct cloud ID
20
+
21
+ ### 2. Read Complete Ticket
22
+
23
+ Fetch ticket **{ticket-id}** with all details:
24
+ - Summary and description
25
+ - Issue type and priority
26
+ - Current status
27
+ - All comments for context
28
+ - Acceptance criteria
29
+
30
+ ### 3. Analyze Project Context
31
+
32
+ Read project conventions:
33
+ - `AGENTS.md` - Main agent workflow guidelines
34
+ - `.github/copilot-instructions.md` - Additional project guidelines (if present)
35
+ - `.github/instructions/` - File-type specific instructions
36
+ - `docs/` - Related documentation
37
+
38
+ ### 4. Analyze Technical Impact
39
+
40
+ Search codebase for:
41
+ - Related components
42
+ - Existing patterns
43
+ - Files to modify
44
+ - Dependencies
45
+
46
+ ### 5. Create Work Plan
47
+
48
+ Create planning document at `docs/{feature-name}-plan.md`:
49
+ - Problem statement
50
+ - Current architecture
51
+ - Proposed changes
52
+ - Phase breakdown
53
+ - Testing strategy
54
+
55
+ ### 6. Create Working Branch
56
+
57
+ Resolve base branch from config, then branch from latest base:
58
+ ```bash
59
+ BASE_BRANCH=$(node -e "try{const c=require('./.agents-toolkit.json');console.log(c.pr?.targetBranch||c.git?.defaultBranch||'main')}catch{console.log('main')}")
60
+ git checkout "$BASE_BRANCH"
61
+ git pull origin "$BASE_BRANCH"
62
+ git checkout -b feature/{ticket-id}-short-description
63
+ # or for bugs:
64
+ git checkout -b bugfix/{ticket-id}-short-description
65
+ ```
66
+
67
+ ### 7. Initial Commit
68
+
69
+ ```bash
70
+ git add docs/{feature-name}-plan.md
71
+ git commit -m "{ticket-id}: Add implementation plan"
72
+ ```
73
+
74
+ ### 8. Update Jira Ticket
75
+
76
+ Add comment with development started:
77
+ ```markdown
78
+ ## Development Started
79
+ - Branch: `feature/{ticket-id}-description`
80
+ - Plan: `docs/{feature-name}-plan.md`
81
+
82
+ ## Phases
83
+ - [ ] Phase 1: ...
84
+ - [ ] Phase 2: ...
85
+ ```
86
+
87
+ ## Output
88
+
89
+ Report:
90
+ 1. ✅ Jira ticket summary
91
+ 2. ✅ Branch created
92
+ 3. ✅ Planning document created
93
+ 4. ✅ Ready to start implementation
94
+
95
+ ## Next Steps
96
+ - Begin implementation following the plan
97
+ - Use `prepare-pr` when ready for review
98
+ - Use `create-pr` to submit pull request
@@ -0,0 +1,53 @@
1
+ # Skills
2
+
3
+ Skills are specialized knowledge guides that GitHub Copilot, Claude Code, and Codex can use to understand project-specific patterns and conventions.
4
+
5
+ ## What are Skills?
6
+
7
+ Skills are markdown files with YAML frontmatter that provide domain-specific guidance. Unlike prompts (which are actions) or instructions (which are general guidelines), skills are **deep knowledge bases** for specific topics.
8
+
9
+ ## Structure
10
+
11
+ Each skill lives in its own folder with a `SKILL.md` file:
12
+
13
+ ```
14
+ .github/skills/
15
+ ├── component-architecture/
16
+ │ └── SKILL.md
17
+ ├── domain-driven-design/
18
+ │ └── SKILL.md
19
+ └── testing-patterns/
20
+ └── SKILL.md
21
+ ```
22
+
23
+ ## Frontmatter Format
24
+
25
+ ```yaml
26
+ ---
27
+ name: skill-name
28
+ description: When to use this skill. Agents use this to decide relevance.
29
+ ---
30
+ ```
31
+
32
+ ## Available Skills
33
+
34
+ | Skill | Description |
35
+ |-------|-------------|
36
+ | `component-architecture` | React component patterns, folder structure, naming conventions |
37
+ | `domain-driven-design` | DDD principles, domain organization, barrel exports |
38
+ | `testing-patterns` | Jest + RTL patterns for Next.js 15 and Server Actions |
39
+
40
+ ## Usage
41
+
42
+ Skills are automatically picked up by agents when relevant to your question. You can also reference them explicitly:
43
+
44
+ ```
45
+ @workspace Use the component-architecture skill to create a new payment form component
46
+ ```
47
+
48
+ ## Creating Custom Skills
49
+
50
+ 1. Create a folder: `.github/skills/your-skill-name/`
51
+ 2. Create `SKILL.md` with frontmatter
52
+ 3. Document patterns, examples, and conventions
53
+ 4. Include ✅ CORRECT and ❌ INCORRECT examples