@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.
- package/LICENSE +135 -0
- package/README.md +388 -0
- package/bin/cli.js +940 -0
- package/package.json +52 -0
- package/src/index.js +58 -0
- package/templates/agents/AGENTS.codex.md +195 -0
- package/templates/agents/AGENTS.md +195 -0
- package/templates/agents/CLAUDE.md +213 -0
- package/templates/agents/copilot-instructions.md +83 -0
- package/templates/shared/instructions/css-styling.instructions.md +142 -0
- package/templates/shared/instructions/documentation-language.instructions.md +216 -0
- package/templates/shared/instructions/github-workflow.instructions.md +245 -0
- package/templates/shared/instructions/php-standards.instructions.md +293 -0
- package/templates/shared/instructions/react-components.instructions.md +196 -0
- package/templates/shared/instructions/server-actions.instructions.md +429 -0
- package/templates/shared/instructions/testing-standards.instructions.md +264 -0
- package/templates/shared/instructions/tests.instructions.md +103 -0
- package/templates/shared/instructions/typescript.instructions.md +106 -0
- package/templates/shared/instructions/wordpress-plugin-architecture.instructions.md +238 -0
- package/templates/shared/prompts/README.md +129 -0
- package/templates/shared/prompts/_partials/README.md +57 -0
- package/templates/shared/prompts/_partials/documentation.md +203 -0
- package/templates/shared/prompts/_partials/git-operations.md +171 -0
- package/templates/shared/prompts/_partials/github-integration.md +100 -0
- package/templates/shared/prompts/_partials/jira-integration.md +155 -0
- package/templates/shared/prompts/_partials/pr-template.md +216 -0
- package/templates/shared/prompts/_partials/validations.md +87 -0
- package/templates/shared/prompts/add-tests.prompt.md +151 -0
- package/templates/shared/prompts/analyze-github-issue.prompt.md +73 -0
- package/templates/shared/prompts/analyze-ticket.prompt.md +63 -0
- package/templates/shared/prompts/create-plan.prompt.md +118 -0
- package/templates/shared/prompts/create-pr.prompt.md +139 -0
- package/templates/shared/prompts/finalize-pr.prompt.md +150 -0
- package/templates/shared/prompts/fix-issues.prompt.md +92 -0
- package/templates/shared/prompts/new-wp-component.prompt.md +51 -0
- package/templates/shared/prompts/new-wp-plugin.prompt.md +46 -0
- package/templates/shared/prompts/prepare-pr.prompt.md +123 -0
- package/templates/shared/prompts/prepare-release.prompt.md +74 -0
- package/templates/shared/prompts/quality-check.prompt.md +45 -0
- package/templates/shared/prompts/review-code.prompt.md +81 -0
- package/templates/shared/prompts/work-github-issue.prompt.md +96 -0
- package/templates/shared/prompts/work-ticket.prompt.md +98 -0
- package/templates/shared/skills/README.md +53 -0
- package/templates/shared/skills/component-architecture/SKILL.md +321 -0
- package/templates/shared/skills/create-component/SKILL.md +714 -0
- package/templates/shared/skills/domain-driven-design/SKILL.md +277 -0
- package/templates/shared/skills/plugin-creation/SKILL.md +1094 -0
- package/templates/shared/skills/quality-checks/SKILL.md +493 -0
- package/templates/shared/skills/release-management/SKILL.md +649 -0
- package/templates/shared/skills/testing/SKILL.md +682 -0
- package/templates/shared/skills/testing-patterns/SKILL.md +243 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Prompts / Commands
|
|
2
|
+
|
|
3
|
+
Reusable prompt templates for AI agent workflows — compatible with **GitHub Copilot** (VS Code), **Claude Code**, and **Codex**.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This package provides a collection of modular, reusable prompts for common development workflows. Each prompt integrates with Jira via the Atlassian MCP.
|
|
8
|
+
|
|
9
|
+
- **GitHub Copilot**: files live in `.github/prompts/` with `.prompt.md` extension
|
|
10
|
+
- **Claude Code**: files live in `.claude/commands/` with `.md` extension (auto-converted by the CLI)
|
|
11
|
+
- **Codex**: prompts live in `.github/prompts/` as reusable workflow references
|
|
12
|
+
|
|
13
|
+
## Structure
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
prompts/
|
|
17
|
+
├── README.md # This documentation
|
|
18
|
+
├── _partials/ # Shared prompt fragments
|
|
19
|
+
│ ├── README.md # Partials documentation
|
|
20
|
+
│ ├── validations.md # Code quality validation steps
|
|
21
|
+
│ ├── git-operations.md # Git workflow operations
|
|
22
|
+
│ ├── jira-integration.md # Jira/Atlassian MCP operations
|
|
23
|
+
│ ├── documentation.md # Documentation standards
|
|
24
|
+
│ └── pr-template.md # Pull request templates
|
|
25
|
+
│
|
|
26
|
+
├── # Workflow Prompts (Main Flow)
|
|
27
|
+
├── analyze-ticket.prompt.md # 1. Analyze a Jira ticket
|
|
28
|
+
├── create-plan.prompt.md # 2. Create implementation plan
|
|
29
|
+
├── work-ticket.prompt.md # 3. Start working on a ticket
|
|
30
|
+
├── prepare-pr.prompt.md # 4. Prepare code for PR
|
|
31
|
+
├── create-pr.prompt.md # 5. Create a pull request
|
|
32
|
+
├── finalize-pr.prompt.md # 6. Finalize and merge PR
|
|
33
|
+
│
|
|
34
|
+
├── # Utility Prompts
|
|
35
|
+
├── review-code.prompt.md # Quick code review
|
|
36
|
+
├── fix-issues.prompt.md # Fix lint/type/test errors
|
|
37
|
+
└── add-tests.prompt.md # Add tests for components
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Workflow Stages
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
44
|
+
│ 1. Analyze │────▶│ 2. Plan │────▶│ 3. Work │
|
|
45
|
+
│ analyze-ticket │ │ create-plan │ │ work-ticket │
|
|
46
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
47
|
+
│
|
|
48
|
+
▼
|
|
49
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
50
|
+
│ 6. Finalize │◀────│ 5. Create PR │◀────│ 4. Prepare │
|
|
51
|
+
│ finalize-pr │ │ create-pr │ │ prepare-pr │
|
|
52
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
### GitHub Copilot (VS Code)
|
|
58
|
+
|
|
59
|
+
1. Open the Command Palette (`Cmd+Shift+P`)
|
|
60
|
+
2. Search for "GitHub Copilot: Run Prompt"
|
|
61
|
+
3. Select the desired prompt
|
|
62
|
+
4. Fill in the required variables (e.g., `{ticket-id}`)
|
|
63
|
+
|
|
64
|
+
### Claude Code
|
|
65
|
+
|
|
66
|
+
Type `/` in the chat to open the command palette and select the desired command:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
/analyze-ticket
|
|
70
|
+
/work-ticket
|
|
71
|
+
/create-pr
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Codex
|
|
75
|
+
|
|
76
|
+
Run Codex from the project root after installing with `--codex`. Use prompts in `.github/prompts/` as workflow templates and task checklists.
|
|
77
|
+
|
|
78
|
+
### Variables
|
|
79
|
+
|
|
80
|
+
Each prompt may require input variables:
|
|
81
|
+
|
|
82
|
+
| Variable | Description | Example |
|
|
83
|
+
|----------|-------------|---------|
|
|
84
|
+
| `{ticket-id}` | Jira ticket identifier | `WEB-726` |
|
|
85
|
+
| `{feature-description}` | Brief feature description | `Add font size controls` |
|
|
86
|
+
| `{feature-name}` | Kebab-case feature name | `font-accessibility` |
|
|
87
|
+
|
|
88
|
+
## Customization
|
|
89
|
+
|
|
90
|
+
### Adding Custom Prompts
|
|
91
|
+
|
|
92
|
+
1. Create a new `.prompt.md` file
|
|
93
|
+
2. Use the frontmatter format:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
---
|
|
97
|
+
agent: agent
|
|
98
|
+
description: Brief description of the prompt
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
Your prompt content here...
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Frontmatter Options
|
|
105
|
+
|
|
106
|
+
| Field | Description |
|
|
107
|
+
|-------|-------------|
|
|
108
|
+
| `description` | A short description of the prompt |
|
|
109
|
+
| `name` | The name shown after typing `/` in chat (defaults to filename) |
|
|
110
|
+
| `agent` | The agent to use: `ask`, `edit`, `agent`, or custom agent name |
|
|
111
|
+
| `model` | Language model to use (defaults to selected model) |
|
|
112
|
+
| `tools` | List of tools available for this prompt |
|
|
113
|
+
|
|
114
|
+
### Using Partials
|
|
115
|
+
|
|
116
|
+
Reference shared fragments in your prompts:
|
|
117
|
+
|
|
118
|
+
```markdown
|
|
119
|
+
## Prerequisites
|
|
120
|
+
- Reference: `.github/prompts/_partials/validations.md`
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Integration
|
|
124
|
+
|
|
125
|
+
### Required Tools/MCPs
|
|
126
|
+
|
|
127
|
+
- **Atlassian MCP**: For Jira ticket operations
|
|
128
|
+
- **Git**: For version control operations
|
|
129
|
+
- **npm/Node.js**: For running validations
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Prompts Partials Index
|
|
2
|
+
|
|
3
|
+
This directory contains reusable prompt fragments that can be referenced in main prompts.
|
|
4
|
+
|
|
5
|
+
## Available Partials
|
|
6
|
+
|
|
7
|
+
| Partial | Description | Use Case |
|
|
8
|
+
|---------|-------------|----------|
|
|
9
|
+
| `validations.md` | Code quality validation steps | Pre-PR checks, CI validation |
|
|
10
|
+
| `git-operations.md` | Git workflow operations | Branch management, commits |
|
|
11
|
+
| `jira-integration.md` | Jira/Atlassian MCP operations | Ticket reading, updates |
|
|
12
|
+
| `documentation.md` | Documentation standards | JSDoc, README, planning docs |
|
|
13
|
+
| `pr-template.md` | Pull request templates | PR creation, review |
|
|
14
|
+
|
|
15
|
+
## How to Reference
|
|
16
|
+
|
|
17
|
+
In your prompt files, reference partials like this:
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
## Prerequisites
|
|
21
|
+
- Reference: `.github/prompts/_partials/validations.md`
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The agent will read the referenced partial when needed.
|
|
25
|
+
|
|
26
|
+
## Creating New Partials
|
|
27
|
+
|
|
28
|
+
1. Create a new `.md` file in this directory
|
|
29
|
+
2. Use clear section headings with `###`
|
|
30
|
+
3. Include reusable steps with `Step:` prefix
|
|
31
|
+
4. Add this file to the README table
|
|
32
|
+
5. Reference from main prompts as needed
|
|
33
|
+
|
|
34
|
+
## Partial Structure
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
# Partial Name
|
|
38
|
+
|
|
39
|
+
Description of what this partial provides.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
When and how to use this partial.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Section 1
|
|
47
|
+
|
|
48
|
+
### Step: Step Name
|
|
49
|
+
1. First action
|
|
50
|
+
2. Second action
|
|
51
|
+
3. Third action
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Section 2
|
|
56
|
+
...
|
|
57
|
+
```
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Documentation Partial
|
|
2
|
+
|
|
3
|
+
Reusable documentation standards and steps for prompts.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Include these steps in prompts that require documentation checks or creation.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Documentation Standards
|
|
12
|
+
|
|
13
|
+
### Step: Verify Documentation
|
|
14
|
+
|
|
15
|
+
1. **Check JSDoc comments**:
|
|
16
|
+
- All new/modified functions have JSDoc
|
|
17
|
+
- Include `@param`, `@returns`, `@example` where applicable
|
|
18
|
+
- Write in English
|
|
19
|
+
|
|
20
|
+
2. **Check component documentation**:
|
|
21
|
+
- Props interfaces are defined and documented
|
|
22
|
+
- Complex logic has inline comments
|
|
23
|
+
- Component usage examples exist
|
|
24
|
+
|
|
25
|
+
3. **Check README updates**:
|
|
26
|
+
- New features documented if user-facing
|
|
27
|
+
- Configuration changes noted
|
|
28
|
+
- Breaking changes highlighted
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## JSDoc Standards
|
|
33
|
+
|
|
34
|
+
### Function Documentation
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
/**
|
|
38
|
+
* Formats a date string for display.
|
|
39
|
+
*
|
|
40
|
+
* @param date - The date to format (ISO string or Date object)
|
|
41
|
+
* @param locale - The locale for formatting (default: 'en-US')
|
|
42
|
+
* @returns Formatted date string
|
|
43
|
+
* @example
|
|
44
|
+
* formatDate('2024-01-15') // 'January 15, 2024'
|
|
45
|
+
* formatDate('2024-01-15', 'es-ES') // '15 de enero de 2024'
|
|
46
|
+
*/
|
|
47
|
+
export function formatDate(date: string | Date, locale = 'en-US'): string {
|
|
48
|
+
// implementation
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Component Documentation
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
/**
|
|
56
|
+
* User profile card displaying avatar and basic information.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* <UserCard
|
|
60
|
+
* user={{ name: 'John Doe', email: 'john@example.com' }}
|
|
61
|
+
* showEmail={true}
|
|
62
|
+
* />
|
|
63
|
+
*/
|
|
64
|
+
export default function UserCard({ user, showEmail }: UserCardProps) {
|
|
65
|
+
// implementation
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Documentation Files
|
|
72
|
+
|
|
73
|
+
### Planning Documents
|
|
74
|
+
|
|
75
|
+
Location: `docs/{feature-name}-plan.md`
|
|
76
|
+
|
|
77
|
+
Template:
|
|
78
|
+
```markdown
|
|
79
|
+
# {Feature Name} Implementation Plan
|
|
80
|
+
|
|
81
|
+
## Problem Statement
|
|
82
|
+
What problem are we solving?
|
|
83
|
+
|
|
84
|
+
## Current Architecture
|
|
85
|
+
How does it work now?
|
|
86
|
+
|
|
87
|
+
## Proposed Changes
|
|
88
|
+
What needs to change?
|
|
89
|
+
|
|
90
|
+
## Risk Assessment
|
|
91
|
+
- Risk 1: Description
|
|
92
|
+
- Mitigation: Solution
|
|
93
|
+
|
|
94
|
+
## Phase Breakdown
|
|
95
|
+
|
|
96
|
+
### Phase 1: {Name}
|
|
97
|
+
- [ ] Task 1
|
|
98
|
+
- [ ] Task 2
|
|
99
|
+
|
|
100
|
+
### Phase 2: {Name}
|
|
101
|
+
- [ ] Task 1
|
|
102
|
+
- [ ] Task 2
|
|
103
|
+
|
|
104
|
+
## Testing Strategy
|
|
105
|
+
How will we validate this works?
|
|
106
|
+
|
|
107
|
+
## Rollback Plan
|
|
108
|
+
How to revert if issues arise?
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Feature Documentation
|
|
114
|
+
|
|
115
|
+
Location: `docs/{feature-name}.md`
|
|
116
|
+
|
|
117
|
+
Template:
|
|
118
|
+
```markdown
|
|
119
|
+
# {Feature Name}
|
|
120
|
+
|
|
121
|
+
## Overview
|
|
122
|
+
Brief description of the feature.
|
|
123
|
+
|
|
124
|
+
## Usage
|
|
125
|
+
|
|
126
|
+
### Basic Usage
|
|
127
|
+
```typescript
|
|
128
|
+
// Example code
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Advanced Usage
|
|
132
|
+
```typescript
|
|
133
|
+
// More complex example
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Configuration
|
|
137
|
+
Any configuration options.
|
|
138
|
+
|
|
139
|
+
## API Reference
|
|
140
|
+
If applicable, API details.
|
|
141
|
+
|
|
142
|
+
## Troubleshooting
|
|
143
|
+
Common issues and solutions.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Step: Create Planning Document
|
|
149
|
+
|
|
150
|
+
1. **Determine file name**:
|
|
151
|
+
- Convert feature to kebab-case
|
|
152
|
+
- Pattern: `docs/{feature-name}-plan.md`
|
|
153
|
+
|
|
154
|
+
2. **Include sections**:
|
|
155
|
+
- Problem Statement
|
|
156
|
+
- Current Architecture
|
|
157
|
+
- Proposed Changes
|
|
158
|
+
- Risk Assessment
|
|
159
|
+
- Phase Breakdown
|
|
160
|
+
- Testing Strategy
|
|
161
|
+
|
|
162
|
+
3. **Commit document**:
|
|
163
|
+
```bash
|
|
164
|
+
git add docs/{feature-name}-plan.md
|
|
165
|
+
git commit -m "TICKET-ID: Add {feature} implementation plan"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Step: Create Final Documentation
|
|
171
|
+
|
|
172
|
+
1. **After implementation complete**:
|
|
173
|
+
- Create `docs/{feature-name}.md` with usage guide
|
|
174
|
+
- Update any related documentation
|
|
175
|
+
- Delete planning document if no longer needed
|
|
176
|
+
|
|
177
|
+
2. **Commit documentation**:
|
|
178
|
+
```bash
|
|
179
|
+
git add docs/
|
|
180
|
+
git commit -m "TICKET-ID: Add {feature} documentation"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Documentation Checklist
|
|
186
|
+
|
|
187
|
+
### Code Documentation
|
|
188
|
+
- [ ] JSDoc on all public functions
|
|
189
|
+
- [ ] Props interfaces documented
|
|
190
|
+
- [ ] Complex logic has comments
|
|
191
|
+
- [ ] Type definitions have descriptions
|
|
192
|
+
|
|
193
|
+
### Project Documentation
|
|
194
|
+
- [ ] Feature documented in `docs/`
|
|
195
|
+
- [ ] README updated if needed
|
|
196
|
+
- [ ] CHANGELOG updated
|
|
197
|
+
- [ ] Migration guide if breaking changes
|
|
198
|
+
|
|
199
|
+
### PR Documentation
|
|
200
|
+
- [ ] Clear PR title with ticket ID
|
|
201
|
+
- [ ] Description explains changes
|
|
202
|
+
- [ ] Testing notes included
|
|
203
|
+
- [ ] Screenshots for UI changes
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Git Operations Partial
|
|
2
|
+
|
|
3
|
+
Reusable Git workflow operations for prompts.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Include these steps in prompts that require Git operations.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Branch Operations
|
|
12
|
+
|
|
13
|
+
### Step: Resolve Base Branch
|
|
14
|
+
|
|
15
|
+
1. **Read base branch from config**:
|
|
16
|
+
```bash
|
|
17
|
+
BASE_BRANCH=$(node -e "try{const c=require('./.agents-toolkit.json');console.log(c.pr?.targetBranch||c.git?.defaultBranch||'main')}catch{console.log('main')}")
|
|
18
|
+
echo "$BASE_BRANCH"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. **Fallback behavior**:
|
|
22
|
+
- If config is missing or invalid, default to `main`
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### Step: Verify Branch Status
|
|
27
|
+
|
|
28
|
+
1. **Check current branch**:
|
|
29
|
+
- Run `git branch --show-current` to get current branch name
|
|
30
|
+
- Ensure not on protected branches: `main`, `dev`, `stg`, `master`, and `${BASE_BRANCH}`
|
|
31
|
+
|
|
32
|
+
2. **Check branch naming**:
|
|
33
|
+
- Verify branch follows convention:
|
|
34
|
+
- `feature/[TICKET-ID]-short-description`
|
|
35
|
+
- `bugfix/[TICKET-ID]-short-description`
|
|
36
|
+
|
|
37
|
+
3. **Check uncommitted changes**:
|
|
38
|
+
- Run `git status` to see working directory state
|
|
39
|
+
- Ensure all changes are committed before proceeding
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### Step: Create Working Branch
|
|
44
|
+
|
|
45
|
+
1. **Ensure on latest base branch**:
|
|
46
|
+
```bash
|
|
47
|
+
git checkout "$BASE_BRANCH"
|
|
48
|
+
git pull origin "$BASE_BRANCH"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
2. **Create new branch**:
|
|
52
|
+
```bash
|
|
53
|
+
git checkout -b feature/[TICKET-ID]-short-description
|
|
54
|
+
# or
|
|
55
|
+
git checkout -b bugfix/[TICKET-ID]-short-description
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### Step: Push Branch
|
|
61
|
+
|
|
62
|
+
1. **Push to remote**:
|
|
63
|
+
```bash
|
|
64
|
+
git push -u origin <branch-name>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. **Verify push**:
|
|
68
|
+
- Confirm branch appears in remote repository
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Sync Operations
|
|
73
|
+
|
|
74
|
+
### Step: Sync with Base Branch
|
|
75
|
+
|
|
76
|
+
1. **Fetch latest**:
|
|
77
|
+
```bash
|
|
78
|
+
git fetch origin
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
2. **Rebase on base branch**:
|
|
82
|
+
```bash
|
|
83
|
+
git rebase "origin/${BASE_BRANCH}"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
3. **Handle conflicts** (if any):
|
|
87
|
+
- Resolve each conflict file
|
|
88
|
+
- Stage resolved files: `git add <file>`
|
|
89
|
+
- Continue rebase: `git rebase --continue`
|
|
90
|
+
|
|
91
|
+
4. **Push updated branch**:
|
|
92
|
+
```bash
|
|
93
|
+
git push --force-with-lease
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Commit Operations
|
|
99
|
+
|
|
100
|
+
### Step: Review Commits
|
|
101
|
+
|
|
102
|
+
1. **View recent commits**:
|
|
103
|
+
```bash
|
|
104
|
+
git log --oneline -5
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
2. **Verify commit messages**:
|
|
108
|
+
- Follow format: `TICKET-ID: Short description`
|
|
109
|
+
- Use present tense, imperative mood
|
|
110
|
+
- Example: `WEB-726: Add font size accessibility controls`
|
|
111
|
+
|
|
112
|
+
3. **If history is noisy**:
|
|
113
|
+
- Prefer squash merge in the PR platform instead of interactive rebases
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Step: View Changes
|
|
118
|
+
|
|
119
|
+
1. **Summary of changes**:
|
|
120
|
+
```bash
|
|
121
|
+
git diff --stat
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
2. **List changed files**:
|
|
125
|
+
```bash
|
|
126
|
+
git diff "$BASE_BRANCH" --name-only
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
3. **Detailed diff**:
|
|
130
|
+
```bash
|
|
131
|
+
git diff "$BASE_BRANCH"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Cleanup Operations
|
|
137
|
+
|
|
138
|
+
### Step: Post-Merge Cleanup
|
|
139
|
+
|
|
140
|
+
1. **Delete local branch**:
|
|
141
|
+
```bash
|
|
142
|
+
git branch -d <branch-name>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
2. **Delete remote branch**:
|
|
146
|
+
```bash
|
|
147
|
+
git push origin --delete <branch-name>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
3. **Prune stale branches**:
|
|
151
|
+
```bash
|
|
152
|
+
git remote prune origin
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Branch Naming Convention
|
|
158
|
+
|
|
159
|
+
| Type | Pattern | Example |
|
|
160
|
+
|------|---------|---------|
|
|
161
|
+
| Feature | `feature/[TICKET-ID]-description` | `feature/WEB-726-font-controls` |
|
|
162
|
+
| Bugfix | `bugfix/[TICKET-ID]-description` | `bugfix/WEB-734-logo-sizing` |
|
|
163
|
+
| Hotfix | `hotfix/[TICKET-ID]-description` | `hotfix/WEB-800-critical-fix` |
|
|
164
|
+
|
|
165
|
+
## Protected Branches
|
|
166
|
+
|
|
167
|
+
These branches require PRs and cannot receive direct commits:
|
|
168
|
+
- `main` - Production
|
|
169
|
+
- `dev` - Development
|
|
170
|
+
- `stg` - Staging
|
|
171
|
+
- `master` - Legacy (if exists)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# GitHub Integration Partial
|
|
2
|
+
|
|
3
|
+
Reusable GitHub issue and PR operations for prompts.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Include these steps in prompts that require GitHub integration.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Issue Operations
|
|
12
|
+
|
|
13
|
+
### Step: Read GitHub Issue
|
|
14
|
+
|
|
15
|
+
1. **Fetch issue details**:
|
|
16
|
+
- Use `mcp_github_github_issue_read` with owner, repo, and issue number
|
|
17
|
+
- Or use `gh issue view <number> | cat` via terminal
|
|
18
|
+
|
|
19
|
+
2. **Extract key information**:
|
|
20
|
+
- **Title**: Issue title
|
|
21
|
+
- **Body**: Full description and context
|
|
22
|
+
- **Labels**: Category and priority labels
|
|
23
|
+
- **Assignees**: Who is responsible
|
|
24
|
+
- **Milestone**: Target milestone if set
|
|
25
|
+
- **State**: Open / Closed
|
|
26
|
+
|
|
27
|
+
3. **Read issue comments**:
|
|
28
|
+
- Fetch all comments for additional context
|
|
29
|
+
- Note any clarifications or updates from maintainers
|
|
30
|
+
|
|
31
|
+
4. **Identify acceptance criteria**:
|
|
32
|
+
- Look in body for "Acceptance Criteria" section
|
|
33
|
+
- List all checkable requirements
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### Step: Search Related Issues
|
|
38
|
+
|
|
39
|
+
1. **Search by label**:
|
|
40
|
+
- Use `gh issue list --label "<label>" | cat`
|
|
41
|
+
- Find related issues in the same phase or category
|
|
42
|
+
|
|
43
|
+
2. **Search by keyword**:
|
|
44
|
+
- Use `gh search issues "<keyword>" --repo owner/repo | cat`
|
|
45
|
+
- Find duplicates or related work
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Issue Update Operations
|
|
50
|
+
|
|
51
|
+
### Step: Add Comment to Issue
|
|
52
|
+
|
|
53
|
+
1. **Add progress comment**:
|
|
54
|
+
- Use `gh issue comment <number> --body "message" | cat`
|
|
55
|
+
- Include relevant links (PR, branch, etc.)
|
|
56
|
+
- Use Markdown formatting for readability
|
|
57
|
+
|
|
58
|
+
2. **Comment templates**:
|
|
59
|
+
```markdown
|
|
60
|
+
## Development Started
|
|
61
|
+
- Branch: `feature/<number>-description`
|
|
62
|
+
- PR: [Link to PR]
|
|
63
|
+
|
|
64
|
+
## Progress
|
|
65
|
+
- [x] Initial implementation
|
|
66
|
+
- [ ] Tests
|
|
67
|
+
- [ ] Documentation
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Step: Close Issue
|
|
73
|
+
|
|
74
|
+
1. **Close with comment**:
|
|
75
|
+
- Use `gh issue close <number> --comment "Completed in PR #XX" | cat`
|
|
76
|
+
|
|
77
|
+
2. **Close as not planned**:
|
|
78
|
+
- Use `gh issue close <number> --reason "not planned" --comment "Reason" | cat`
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Issue Analysis
|
|
83
|
+
|
|
84
|
+
### Step: Analyze Issue Impact
|
|
85
|
+
|
|
86
|
+
1. **Identify affected areas**:
|
|
87
|
+
- Components that need changes
|
|
88
|
+
- Files likely to be modified
|
|
89
|
+
- Dependencies and integrations
|
|
90
|
+
|
|
91
|
+
2. **Estimate complexity**:
|
|
92
|
+
- **Simple**: 1-2 files, straightforward change
|
|
93
|
+
- **Medium**: 3-5 files, some logic changes
|
|
94
|
+
- **Complex**: 6+ files, architectural changes
|
|
95
|
+
|
|
96
|
+
3. **Identify risks**:
|
|
97
|
+
- Breaking changes
|
|
98
|
+
- Migration requirements
|
|
99
|
+
- External dependencies
|
|
100
|
+
- Testing complexity
|