symfonia-ai-tools 1.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/README.md +489 -0
- package/bin/cli.mjs +35 -0
- package/lib/installer.mjs +495 -0
- package/lib/questions.mjs +332 -0
- package/lib/ui.mjs +76 -0
- package/lib/utils.mjs +231 -0
- package/package.json +26 -0
- package/templates/base/CLAUDE.md +34 -0
- package/templates/base/_ai/_guidelines_header.md +70 -0
- package/templates/base/_ai/context/README.md +20 -0
- package/templates/base/_ai/prompts/codereview.prompt.md +324 -0
- package/templates/base/_ai/prompts/duplicate-code-analysis.prompt.md +128 -0
- package/templates/base/_ai/prompts/figma-analysis.prompt.md +155 -0
- package/templates/base/_ai/prompts/security-review.prompt.md +46 -0
- package/templates/base/_ai/skills/README.md +80 -0
- package/templates/base/_ai/skills/TEMPLATE.md +106 -0
- package/templates/base/_ai/skills/babysit-prs/SKILL.md +105 -0
- package/templates/base/_ai/skills/debug/SKILL.md +93 -0
- package/templates/base/_ai/skills/fill-worklogs/SKILL.md +158 -0
- package/templates/base/_ai/skills/hotfix/SKILL.md +52 -0
- package/templates/base/_ai/skills/jira-task/SKILL.md +170 -0
- package/templates/base/_ai/skills/my-prs/SKILL.md +78 -0
- package/templates/base/_ai/skills/pr-dashboard/SKILL.md +43 -0
- package/templates/base/_ai/skills/pr-prepare/SKILL.md +106 -0
- package/templates/base/_ai/skills/refactor/SKILL.md +87 -0
- package/templates/base/_ai/skills/write-tests/SKILL.md +109 -0
- package/templates/base/_claude/settings.local.json +37 -0
- package/templates/base/_cursor/rules/global.mdc +7 -0
- package/templates/base/_editorconfig +18 -0
- package/templates/base/_gemini/settings.json +3 -0
- package/templates/base/_github/copilot-instructions.md +1 -0
- package/templates/base/_github/pull_request_template.md +23 -0
- package/templates/base/_gitignore +22 -0
- package/templates/base/_junie/guidelines.md +1 -0
- package/templates/base/commit-instructions.md +92 -0
- package/templates/packs/docker/_ai/instructions/docker.instructions.md +193 -0
- package/templates/packs/docker/_guidelines.md +10 -0
- package/templates/packs/docker/pack.json +8 -0
- package/templates/packs/laravel/_ai/instructions/api-resource.instructions.md +251 -0
- package/templates/packs/laravel/_ai/instructions/module.instructions.md +133 -0
- package/templates/packs/laravel/_ai/instructions/service-repository.instructions.md +215 -0
- package/templates/packs/laravel/_ai/instructions/testing.instructions.md +278 -0
- package/templates/packs/laravel/_ai/skills/migration/SKILL.md +172 -0
- package/templates/packs/laravel/_ai/skills/new-endpoint/SKILL.md +165 -0
- package/templates/packs/laravel/_ai/skills/new-module/SKILL.md +208 -0
- package/templates/packs/laravel/_ai/skills/queued-job/SKILL.md +248 -0
- package/templates/packs/laravel/_ai/skills/testing-feature/SKILL.md +196 -0
- package/templates/packs/laravel/_ai/skills/testing-manual/SKILL.md +186 -0
- package/templates/packs/laravel/_ai/skills/testing-unit/SKILL.md +200 -0
- package/templates/packs/laravel/_guidelines.md +25 -0
- package/templates/packs/laravel/pack.json +6 -0
- package/templates/packs/playwright/_ai/instructions/playwright.instructions.md +219 -0
- package/templates/packs/playwright/_ai/skills/playwright/README.md +194 -0
- package/templates/packs/playwright/_ai/skills/playwright/SKILL.md +1245 -0
- package/templates/packs/playwright/_ai/skills/playwright-codereview/SKILL.md +642 -0
- package/templates/packs/playwright/_ai/skills/playwright-record/README.md +87 -0
- package/templates/packs/playwright/_ai/skills/playwright-record/SKILL.md +564 -0
- package/templates/packs/playwright/_guidelines.md +12 -0
- package/templates/packs/playwright/pack.json +9 -0
- package/templates/packs/storybook/_ai/instructions/storybook.instructions.md +181 -0
- package/templates/packs/storybook/pack.json +6 -0
- package/templates/packs/vitest/_ai/instructions/vitest.instructions.md +688 -0
- package/templates/packs/vitest/pack.json +6 -0
- package/templates/packs/vue3/_ai/instructions/api.instructions.md +163 -0
- package/templates/packs/vue3/_ai/instructions/coding-conventions.instructions.md +160 -0
- package/templates/packs/vue3/_ai/instructions/composables.instructions.md +218 -0
- package/templates/packs/vue3/_ai/instructions/forms.instructions.md +227 -0
- package/templates/packs/vue3/_ai/instructions/store.instructions.md +504 -0
- package/templates/packs/vue3/_ai/instructions/vue.instructions.md +339 -0
- package/templates/packs/vue3/_ai/skills/api-integration/SKILL.md +195 -0
- package/templates/packs/vue3/_ai/skills/new-component/SKILL.md +133 -0
- package/templates/packs/vue3/_ai/skills/new-module/SKILL.md +177 -0
- package/templates/packs/vue3/_guidelines.md +45 -0
- package/templates/packs/vue3/pack.json +11 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Security Review
|
|
2
|
+
|
|
3
|
+
Perform a security audit of the current branch changes. Check for OWASP Top 10 vulnerabilities and common security issues.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
1. Run `git diff {{BASE_BRANCH}}...{{CURRENT_BRANCH}} --name-only` to get changed files
|
|
8
|
+
2. Read each changed file and analyze for:
|
|
9
|
+
|
|
10
|
+
### Input Validation
|
|
11
|
+
- [ ] All user input is validated and sanitized
|
|
12
|
+
- [ ] No SQL injection vectors (raw queries with string interpolation)
|
|
13
|
+
- [ ] No XSS vectors (unescaped output in HTML/templates)
|
|
14
|
+
- [ ] No command injection (user input in shell commands)
|
|
15
|
+
- [ ] No path traversal (user input in file paths)
|
|
16
|
+
|
|
17
|
+
### Authentication & Authorization
|
|
18
|
+
- [ ] Auth checks on every protected endpoint
|
|
19
|
+
- [ ] No hardcoded credentials, tokens, or API keys
|
|
20
|
+
- [ ] Secrets come from environment variables, not code
|
|
21
|
+
- [ ] Session handling is secure
|
|
22
|
+
|
|
23
|
+
### Data Exposure
|
|
24
|
+
- [ ] No sensitive data in logs (passwords, tokens, PII)
|
|
25
|
+
- [ ] API responses don't leak internal data (stack traces, DB schema)
|
|
26
|
+
- [ ] Error messages don't reveal implementation details
|
|
27
|
+
- [ ] No `.env` files or secrets in committed code
|
|
28
|
+
|
|
29
|
+
### Dependencies
|
|
30
|
+
- [ ] No known vulnerable dependencies
|
|
31
|
+
- [ ] Dependencies are pinned to specific versions
|
|
32
|
+
|
|
33
|
+
### General
|
|
34
|
+
- [ ] CORS configured correctly (not `*` in production)
|
|
35
|
+
- [ ] HTTPS enforced for external calls
|
|
36
|
+
- [ ] Rate limiting on public endpoints
|
|
37
|
+
- [ ] File uploads validated (type, size, content)
|
|
38
|
+
|
|
39
|
+
## Output
|
|
40
|
+
|
|
41
|
+
For each finding:
|
|
42
|
+
1. **Severity**: Critical / High / Medium / Low
|
|
43
|
+
2. **File:line**: exact location
|
|
44
|
+
3. **Issue**: what's wrong
|
|
45
|
+
4. **Fix**: how to fix it
|
|
46
|
+
5. **Code**: corrected code snippet
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Skills Framework
|
|
2
|
+
|
|
3
|
+
Specialized AI agent skills providing expert guidance on specific aspects of development.
|
|
4
|
+
|
|
5
|
+
## Available Skills Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.github/skills/ # GitHub Copilot skills
|
|
9
|
+
├── README.md
|
|
10
|
+
├── TEMPLATE.md
|
|
11
|
+
├── skill-name/
|
|
12
|
+
│ └── SKILL.md
|
|
13
|
+
└── another-skill/
|
|
14
|
+
└── SKILL.md
|
|
15
|
+
|
|
16
|
+
.cursor/skills/ # Cursor IDE skills
|
|
17
|
+
├── skill-name/
|
|
18
|
+
│ └── SKILL.md
|
|
19
|
+
└── another-skill/
|
|
20
|
+
└── SKILL.md
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Creating a New Skill
|
|
24
|
+
|
|
25
|
+
### 1. Copy Template
|
|
26
|
+
```bash
|
|
27
|
+
mkdir -p .github/skills/my-skill
|
|
28
|
+
cp templates/skills/TEMPLATE.md .github/skills/my-skill/SKILL.md
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2. Fill In Metadata
|
|
32
|
+
```yaml
|
|
33
|
+
---
|
|
34
|
+
name: my-skill
|
|
35
|
+
description: Clear one-sentence description
|
|
36
|
+
---
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Complete Content
|
|
40
|
+
1. Title and Overview
|
|
41
|
+
2. When to Use (5-10 specific scenarios)
|
|
42
|
+
3. Main Sections with code examples
|
|
43
|
+
4. Best Practices (do's and don'ts)
|
|
44
|
+
5. Quick Reference
|
|
45
|
+
|
|
46
|
+
### 4. Quality Checklist
|
|
47
|
+
- [ ] Front matter complete
|
|
48
|
+
- [ ] "When to Use" has 5+ scenarios
|
|
49
|
+
- [ ] At least 3 code examples
|
|
50
|
+
- [ ] Best practices with do's/don'ts
|
|
51
|
+
- [ ] Quick reference section
|
|
52
|
+
- [ ] No placeholder text
|
|
53
|
+
|
|
54
|
+
## Content Principles
|
|
55
|
+
|
|
56
|
+
1. **Specific > Generic** - Focus on project-specific patterns
|
|
57
|
+
2. **Examples > Theory** - Show, don't just tell
|
|
58
|
+
3. **Actionable > Descriptive** - Clear next steps
|
|
59
|
+
4. **Concise > Verbose** - Respect reader's time
|
|
60
|
+
|
|
61
|
+
## Using Skills in Conversations
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
"Using the playwright skill, help me write a test for login"
|
|
65
|
+
"Review this code following codereview best practices"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Skill Discovery
|
|
69
|
+
|
|
70
|
+
**By Activity**:
|
|
71
|
+
- Writing code → implementation skill
|
|
72
|
+
- Reviewing code → codereview skill
|
|
73
|
+
- Recording tests → playwright-record skill
|
|
74
|
+
- Writing tests → playwright skill
|
|
75
|
+
|
|
76
|
+
## Maintenance
|
|
77
|
+
|
|
78
|
+
- Review monthly for outdated examples
|
|
79
|
+
- Update after major project changes
|
|
80
|
+
- Deprecate obsolete skills with notice + 3 month grace period
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: [skill-name]
|
|
3
|
+
description: [One-sentence description of what this skill does and when to use it.]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# [Skill Display Name]
|
|
7
|
+
|
|
8
|
+
[2-3 sentence overview. What it helps with, who it's for, main value.]
|
|
9
|
+
|
|
10
|
+
## When to Use This Skill
|
|
11
|
+
|
|
12
|
+
Use this skill when the user:
|
|
13
|
+
|
|
14
|
+
- [Specific request pattern 1]
|
|
15
|
+
- [Specific request pattern 2]
|
|
16
|
+
- [Specific request pattern 3]
|
|
17
|
+
- [Scenario 4]
|
|
18
|
+
- [Scenario 5]
|
|
19
|
+
|
|
20
|
+
## [Main Section 1: Core Concepts]
|
|
21
|
+
|
|
22
|
+
[Primary concept or workflow]
|
|
23
|
+
|
|
24
|
+
### [Key Component]
|
|
25
|
+
|
|
26
|
+
```[language]
|
|
27
|
+
// Example code
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Key Points**:
|
|
31
|
+
- [Best practice 1]
|
|
32
|
+
- [Best practice 2]
|
|
33
|
+
|
|
34
|
+
## [Main Section 2: Practical Usage]
|
|
35
|
+
|
|
36
|
+
### Step-by-Step Guide
|
|
37
|
+
|
|
38
|
+
**Step 1: [Action]**
|
|
39
|
+
[Instructions]
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Command
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Step 2: [Action]**
|
|
46
|
+
[Instructions]
|
|
47
|
+
|
|
48
|
+
### Common Patterns
|
|
49
|
+
|
|
50
|
+
**Pattern 1: [Name]**
|
|
51
|
+
[When to use]
|
|
52
|
+
|
|
53
|
+
```[language]
|
|
54
|
+
// Example
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Best Practices
|
|
58
|
+
|
|
59
|
+
### Do's
|
|
60
|
+
1. **[Practice 1]** - [Explanation]
|
|
61
|
+
2. **[Practice 2]** - [Explanation]
|
|
62
|
+
|
|
63
|
+
### Don'ts
|
|
64
|
+
1. **[Anti-pattern 1]** - Why to avoid, what to do instead
|
|
65
|
+
2. **[Anti-pattern 2]** - Why to avoid, what to do instead
|
|
66
|
+
|
|
67
|
+
## Troubleshooting
|
|
68
|
+
|
|
69
|
+
### Common Issues
|
|
70
|
+
|
|
71
|
+
**Issue 1: [Problem]**
|
|
72
|
+
- Symptoms: [What user sees]
|
|
73
|
+
- Solution: [Steps to resolve]
|
|
74
|
+
|
|
75
|
+
## Quick Reference
|
|
76
|
+
|
|
77
|
+
### Key Commands
|
|
78
|
+
```bash
|
|
79
|
+
# [Description]
|
|
80
|
+
[command]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Cheat Sheet
|
|
84
|
+
| Concept | Usage | Example |
|
|
85
|
+
|---------|-------|---------|
|
|
86
|
+
| [Item 1] | [When] | `[code]` |
|
|
87
|
+
| [Item 2] | [When] | `[code]` |
|
|
88
|
+
|
|
89
|
+
## Resources
|
|
90
|
+
|
|
91
|
+
- **Related Skill**: `path/to/related/SKILL.md`
|
|
92
|
+
- **Documentation**: `[path]`
|
|
93
|
+
- **External**: [URL]
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
**Remember**: [Key takeaway for this skill]
|
|
98
|
+
|
|
99
|
+
<!--
|
|
100
|
+
TEMPLATE NOTES (remove when creating actual skill):
|
|
101
|
+
1. Replace all [placeholders] with actual content
|
|
102
|
+
2. Remove sections that don't apply
|
|
103
|
+
3. Keep code examples relevant and tested
|
|
104
|
+
4. Make "When to Use" specific and actionable
|
|
105
|
+
5. Provide copy-paste-ready code snippets
|
|
106
|
+
-->
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Skill: Babysit PRs
|
|
2
|
+
|
|
3
|
+
## Trigger
|
|
4
|
+
Use when user wants to monitor PRs waiting for their review, check for new pull requests, or set up recurring PR review monitoring.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
Monitor open pull requests waiting for your review. Detects hosting platform (GitHub or Bitbucket) automatically from `git remote` and sets up a polling loop.
|
|
9
|
+
|
|
10
|
+
## Step 1: Detect User and Repo
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git config user.name
|
|
14
|
+
git remote get-url origin
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Parse origin URL** to determine platform and extract workspace/repo:
|
|
18
|
+
- `git@github.com:{owner}/{repo}.git` → GitHub, owner, repo
|
|
19
|
+
- `https://github.com/{owner}/{repo}.git` → GitHub, owner, repo
|
|
20
|
+
- `git@bitbucket.org:{workspace}/{repo}.git` → Bitbucket, workspace, repo
|
|
21
|
+
- `https://bitbucket.org/{workspace}/{repo}.git` → Bitbucket, workspace, repo
|
|
22
|
+
|
|
23
|
+
Store as `{USER_NAME}`, `{OWNER}`, `{REPO}`, `{PLATFORM}`, `{TODAY}` (YYYY-MM-DD).
|
|
24
|
+
|
|
25
|
+
## Step 2: Setup Loop
|
|
26
|
+
|
|
27
|
+
1. Use CronCreate with `*/10 * * * *` and the cron prompt below (substitute values)
|
|
28
|
+
2. Confirm job ID
|
|
29
|
+
3. Run first check immediately
|
|
30
|
+
|
|
31
|
+
### Cron Prompt (template)
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Check PRs waiting for review. Platform: {PLATFORM}. Repo: {OWNER}/{REPO}. User: {USER_NAME}. Today: {TODAY}. Fetch open PRs. For each PR where author is NOT {USER_NAME}, check if {USER_NAME} already approved — skip if so. For remaining PRs, fetch the diff and do a quick summary — what changed, how big, any obvious issues. Show table: PR | Description | Verdict | Link | Action. If none: "No new PRs to review."
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Step 3: How to Check PRs
|
|
38
|
+
|
|
39
|
+
### GitHub (using `gh` CLI)
|
|
40
|
+
|
|
41
|
+
1. Fetch open PRs requesting your review:
|
|
42
|
+
```bash
|
|
43
|
+
gh pr list --repo {OWNER}/{REPO} --search "is:open review-requested:@me" --json number,title,author,headRefName,url
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. For each PR, check if you already approved:
|
|
47
|
+
```bash
|
|
48
|
+
gh pr view {number} --repo {OWNER}/{REPO} --json reviews --jq '.reviews[] | select(.author.login == "{USER_NAME}" and .state == "APPROVED")'
|
|
49
|
+
```
|
|
50
|
+
Skip PRs where you already approved.
|
|
51
|
+
|
|
52
|
+
3. For remaining PRs, fetch the diff:
|
|
53
|
+
```bash
|
|
54
|
+
gh pr diff {number} --repo {OWNER}/{REPO}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Bitbucket (using MCP)
|
|
58
|
+
|
|
59
|
+
1. Fetch open PRs:
|
|
60
|
+
```
|
|
61
|
+
mcp__mcp-bitbucket__bb_get
|
|
62
|
+
path: /repositories/{OWNER}/{REPO}/pullrequests
|
|
63
|
+
queryParams: {"pagelen": "50", "q": "state=\"OPEN\" AND created_on >= {TODAY}"}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. Filter out PRs where author matches `{USER_NAME}`.
|
|
67
|
+
|
|
68
|
+
3. For each remaining PR, fetch participants:
|
|
69
|
+
```
|
|
70
|
+
mcp__mcp-bitbucket__bb_get
|
|
71
|
+
path: /repositories/{OWNER}/{REPO}/pullrequests/{id}
|
|
72
|
+
```
|
|
73
|
+
Skip PRs where `{USER_NAME}` has `approved: true`.
|
|
74
|
+
|
|
75
|
+
4. For remaining PRs, fetch diff:
|
|
76
|
+
```
|
|
77
|
+
mcp__mcp-bitbucket__bb_get
|
|
78
|
+
path: /repositories/{OWNER}/{REPO}/pullrequests/{id}/diff
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Step 4: Present Results
|
|
82
|
+
|
|
83
|
+
| PR | Description | Verdict | Link | Action |
|
|
84
|
+
|----|-------------|---------|------|--------|
|
|
85
|
+
| **#1234** TICKET | What changed (1-2 sentences) | **LOOKS GOOD** / **CHECK** + reason | [Open PR](url) | `approve 1234` |
|
|
86
|
+
|
|
87
|
+
- **LOOKS GOOD**: small, clear change, no obvious issues
|
|
88
|
+
- **CHECK**: large change, complex logic, or something that needs closer human review
|
|
89
|
+
- After table: "Type `approve {id}` to auto-approve, or `approve all` to approve all."
|
|
90
|
+
|
|
91
|
+
## Step 5: Approve
|
|
92
|
+
|
|
93
|
+
### GitHub
|
|
94
|
+
```bash
|
|
95
|
+
gh pr review {number} --repo {OWNER}/{REPO} --approve
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Bitbucket
|
|
99
|
+
```
|
|
100
|
+
mcp__mcp-bitbucket__bb_post
|
|
101
|
+
path: /repositories/{OWNER}/{REPO}/pullrequests/{id}/approve
|
|
102
|
+
body: {}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If no PRs need review: "No new PRs to review."
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Skill: Systematic Debugging
|
|
2
|
+
|
|
3
|
+
## Trigger
|
|
4
|
+
Use when investigating a bug or unexpected behavior.
|
|
5
|
+
|
|
6
|
+
## Input
|
|
7
|
+
- Bug description / error message
|
|
8
|
+
- Steps to reproduce
|
|
9
|
+
- Expected vs actual behavior
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
### 1. Reproduce the bug
|
|
14
|
+
|
|
15
|
+
Before investigating, confirm the bug exists:
|
|
16
|
+
- Follow the exact reproduction steps
|
|
17
|
+
- Capture the error message, stack trace, or unexpected output
|
|
18
|
+
- Note the environment (dev/staging/prod, browser, etc.)
|
|
19
|
+
|
|
20
|
+
If you cannot reproduce → ask for more details. Do not guess.
|
|
21
|
+
|
|
22
|
+
### 2. Read the error
|
|
23
|
+
|
|
24
|
+
Parse the error message/stack trace:
|
|
25
|
+
- **What** failed (file, line, function)
|
|
26
|
+
- **Why** (null reference, type error, 404, timeout, etc.)
|
|
27
|
+
- **Where** in the call chain
|
|
28
|
+
|
|
29
|
+
### 3. Form a hypothesis
|
|
30
|
+
|
|
31
|
+
Based on the error, form ONE specific hypothesis:
|
|
32
|
+
- "The user object is null because the auth middleware is not applied"
|
|
33
|
+
- "The API returns 422 because field X is required but not sent"
|
|
34
|
+
|
|
35
|
+
Write it down. Do not investigate multiple hypotheses at once.
|
|
36
|
+
|
|
37
|
+
### 4. Verify hypothesis
|
|
38
|
+
|
|
39
|
+
Add minimal logging/debugging to confirm or reject:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Check logs
|
|
43
|
+
{{TEST_COMMAND}} # or check log files
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Read the relevant code carefully
|
|
47
|
+
- Check recent changes (git log, git diff)
|
|
48
|
+
- Check configuration
|
|
49
|
+
|
|
50
|
+
### 5. If hypothesis is wrong
|
|
51
|
+
|
|
52
|
+
- Document what you learned
|
|
53
|
+
- Form a new hypothesis based on new information
|
|
54
|
+
- Go back to step 4
|
|
55
|
+
|
|
56
|
+
### 6. If hypothesis is correct → fix
|
|
57
|
+
|
|
58
|
+
- Make the smallest fix possible
|
|
59
|
+
- Do not refactor surrounding code
|
|
60
|
+
- Do not fix other issues you noticed (note them separately)
|
|
61
|
+
|
|
62
|
+
### 7. Verify the fix
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Reproduce original steps - bug should be gone
|
|
66
|
+
{{TEST_COMMAND}}
|
|
67
|
+
|
|
68
|
+
# Run full test suite - nothing else should break
|
|
69
|
+
{{LINT_COMMAND}}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 8. Write regression test
|
|
73
|
+
|
|
74
|
+
Create a test that would have caught this bug:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
test_[what_was_broken]_[expected_behavior]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The test should:
|
|
81
|
+
- Fail without the fix
|
|
82
|
+
- Pass with the fix
|
|
83
|
+
|
|
84
|
+
### 9. Verification checklist
|
|
85
|
+
|
|
86
|
+
- [ ] Bug confirmed reproducible before fix
|
|
87
|
+
- [ ] Root cause identified (not just symptom)
|
|
88
|
+
- [ ] Fix is minimal and focused
|
|
89
|
+
- [ ] Original reproduction steps now pass
|
|
90
|
+
- [ ] Full test suite passes
|
|
91
|
+
- [ ] Regression test added
|
|
92
|
+
- [ ] No debug logging left in code
|
|
93
|
+
- [ ] Commit message describes the root cause
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Skill: Fill Worklogs
|
|
2
|
+
|
|
3
|
+
## Trigger
|
|
4
|
+
Use when needing to fill Jira worklogs to meet daily hour targets, when user says to log hours, fill timesheets, complete worklogs for a date or date range, or when asked about missing logged time.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
Fills Jira worklog gaps by cross-referencing git commits with existing Jira worklogs, then proposing and registering time entries to meet the daily target. Requires Jira MCP server.
|
|
9
|
+
|
|
10
|
+
## Input
|
|
11
|
+
|
|
12
|
+
Accepts flexible date inputs from the user:
|
|
13
|
+
|
|
14
|
+
| Input | Interpretation |
|
|
15
|
+
|-------|---------------|
|
|
16
|
+
| `today` | Current date only |
|
|
17
|
+
| `yesterday` | Previous workday |
|
|
18
|
+
| `this week` | Mon-Fri of current week |
|
|
19
|
+
| `last week` | Mon-Fri of previous week |
|
|
20
|
+
| `2026-03-25` | Single date |
|
|
21
|
+
| `2026-03-23 to 2026-03-27` | Date range |
|
|
22
|
+
|
|
23
|
+
Default daily target: **7h 30m** (configurable — user can override, e.g. "fill worklogs this week, 8h per day").
|
|
24
|
+
|
|
25
|
+
## Step-by-Step
|
|
26
|
+
|
|
27
|
+
### 1. Parse Dates
|
|
28
|
+
|
|
29
|
+
Convert user input to a list of **workdays** (skip weekends). Store daily target (default 7h 30m = 450 minutes).
|
|
30
|
+
|
|
31
|
+
### 2. Fetch Existing Worklogs
|
|
32
|
+
|
|
33
|
+
Search Jira for all issues with worklogs by current user in the date range:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
mcp__mcp-atlassian__jira_search(
|
|
37
|
+
jql: "worklogDate >= '{start}' AND worklogDate <= '{end}' AND worklogAuthor = currentUser()",
|
|
38
|
+
fields: "summary,worklog",
|
|
39
|
+
limit: 50
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Filter worklogs** — only count entries where `author.emailAddress` matches the user (issues may have worklogs from other people). Group by date (`started` field).
|
|
44
|
+
|
|
45
|
+
### 3. Fetch Git Commits
|
|
46
|
+
|
|
47
|
+
Get all commits by the user in the date range:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git log --all --author="$(git config user.name)" --since="{start}" --until="{end+1day}" --format="%ad | %h | %s" --date=short | sort
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Extract ticket numbers** from commit messages (pattern: `{{JIRA_PREFIX}}-\d+`). Group commits by date and ticket.
|
|
54
|
+
|
|
55
|
+
### 4. Calculate Gaps
|
|
56
|
+
|
|
57
|
+
For each workday:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
gap = daily_target - existing_worklogs_sum
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Build a structure:
|
|
64
|
+
```
|
|
65
|
+
{
|
|
66
|
+
"2026-03-24": {
|
|
67
|
+
"existing": [{"ticket": "{{JIRA_PREFIX}}-123", "hours": "2h", "comment": "..."}],
|
|
68
|
+
"commits": [{"ticket": "{{JIRA_PREFIX}}-456", "message": "Refactor service..."}],
|
|
69
|
+
"logged_minutes": 120,
|
|
70
|
+
"gap_minutes": 330
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 5. Propose Distribution
|
|
76
|
+
|
|
77
|
+
**Rules for distributing remaining hours:**
|
|
78
|
+
|
|
79
|
+
1. **Prioritize tickets with commits but no worklogs** — these represent real work that wasn't logged
|
|
80
|
+
2. **Estimate based on commit complexity:**
|
|
81
|
+
- Single small fix commit → 1h-1h30
|
|
82
|
+
- Multiple commits on same ticket → 2h-4h
|
|
83
|
+
- Large architectural change (many files, new classes) → 4h-6h
|
|
84
|
+
- Docs-only commits → 30m-1h
|
|
85
|
+
3. **Use round increments** — 30m, 1h, 1h30, 2h, 2h30, 3h, etc.
|
|
86
|
+
4. **If gap remains after commit-based tickets**, distribute to the largest ticket of the day or to parent story
|
|
87
|
+
5. **If still not enough tickets to fill the day**, ask the user which ticket to log against — do NOT invent tickets. Wait for user's answer before proceeding.
|
|
88
|
+
6. **Write realistic comments** — based on actual commit messages, not generic text
|
|
89
|
+
|
|
90
|
+
### 6. Present Proposal
|
|
91
|
+
|
|
92
|
+
Show a **per-day table** with existing + proposed entries:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
### Mon 24.03 — logged 2h00, missing +5h30
|
|
96
|
+
|
|
97
|
+
| Ticket | Current | Add | Total | Justification |
|
|
98
|
+
|--------|---------|-----|-------|---------------|
|
|
99
|
+
| {{JIRA_PREFIX}}-123 | 2h | — | 2h | |
|
|
100
|
+
| {{JIRA_PREFIX}}-456 | — | +5h30 | 5h30 | Refactor service |
|
|
101
|
+
| | | | **7h30** | |
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
End with total summary table.
|
|
105
|
+
|
|
106
|
+
### 7. Apply User Changes
|
|
107
|
+
|
|
108
|
+
If the user requests modifications, recalculate and re-present. Common adjustments:
|
|
109
|
+
|
|
110
|
+
- Move hours between tickets on the same day
|
|
111
|
+
- Change a comment
|
|
112
|
+
- Add/remove a ticket from a day
|
|
113
|
+
- Change the daily target
|
|
114
|
+
|
|
115
|
+
Re-present the updated table and ask for confirmation again.
|
|
116
|
+
|
|
117
|
+
### 8. Register Worklogs
|
|
118
|
+
|
|
119
|
+
On user confirmation, register ALL proposed worklogs:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
mcp__mcp-atlassian__jira_add_worklog(
|
|
123
|
+
issue_key: "{TICKET}",
|
|
124
|
+
time_spent: "{time}",
|
|
125
|
+
comment: "{comment}",
|
|
126
|
+
started: "{date}T{staggered_time}.000+0100"
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Stagger start times** within each day to avoid overlaps:
|
|
131
|
+
- First entry: 09:00
|
|
132
|
+
- Next: previous_start + previous_duration + 00:30 buffer
|
|
133
|
+
|
|
134
|
+
**Timezone:** Use `+0100` (CET) or `+0200` (CEST) based on date.
|
|
135
|
+
|
|
136
|
+
### 9. Summary
|
|
137
|
+
|
|
138
|
+
After all worklogs are registered, show final confirmation with per-day totals.
|
|
139
|
+
|
|
140
|
+
## Edge Cases
|
|
141
|
+
|
|
142
|
+
| Case | Handling |
|
|
143
|
+
|------|----------|
|
|
144
|
+
| Day already has >= target hours | Skip day, report "already filled" |
|
|
145
|
+
| Day has MORE than target | Warn user, don't touch |
|
|
146
|
+
| No commits found for a day | Ask user which tickets to log against |
|
|
147
|
+
| Weekend date in range | Skip automatically |
|
|
148
|
+
| User changes target mid-conversation | Recalculate all gaps |
|
|
149
|
+
|
|
150
|
+
## Common Mistakes
|
|
151
|
+
|
|
152
|
+
| Mistake | Fix |
|
|
153
|
+
|---------|-----|
|
|
154
|
+
| Counting other people's worklogs | Filter by `author.emailAddress` matching the user |
|
|
155
|
+
| Generic comments like "development work" | Use commit messages to write specific, technical comments |
|
|
156
|
+
| Not checking for DST timezone offset | CET (+0100) vs CEST (+0200) depending on date |
|
|
157
|
+
| Proposing 15m or 45m increments | Stick to 30m increments for readability |
|
|
158
|
+
| Firing worklogs before user confirms | ALWAYS wait for explicit confirmation |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Skill: Hotfix
|
|
2
|
+
|
|
3
|
+
## Trigger
|
|
4
|
+
Production bug that needs immediate fix.
|
|
5
|
+
|
|
6
|
+
## Input
|
|
7
|
+
- Bug description or error log
|
|
8
|
+
- Affected endpoint/feature
|
|
9
|
+
- Production branch name (default: `main`)
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
### 1. Create hotfix branch
|
|
14
|
+
```bash
|
|
15
|
+
git fetch origin
|
|
16
|
+
git checkout -b hotfix/{{JIRA_PREFIX}}-XXXX-short-description origin/main
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Reproduce & diagnose
|
|
20
|
+
- Read error logs and stack trace
|
|
21
|
+
- Identify the root cause (not just symptoms)
|
|
22
|
+
- Find the minimal change needed — hotfix is NOT refactoring
|
|
23
|
+
|
|
24
|
+
### 3. Implement fix
|
|
25
|
+
- Change ONLY what's necessary to fix the bug
|
|
26
|
+
- Do not refactor surrounding code
|
|
27
|
+
- Do not add features
|
|
28
|
+
- Do not update dependencies
|
|
29
|
+
|
|
30
|
+
### 4. Add regression test
|
|
31
|
+
- Write a test that fails WITHOUT the fix and passes WITH it
|
|
32
|
+
- Test covers the exact scenario from the bug report
|
|
33
|
+
|
|
34
|
+
### 5. Verify
|
|
35
|
+
```bash
|
|
36
|
+
{{TEST_COMMAND}}
|
|
37
|
+
{{LINT_COMMAND}}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 6. Prepare for merge
|
|
41
|
+
- Self-review the diff: `git diff origin/main...HEAD`
|
|
42
|
+
- Ensure the change is minimal and focused
|
|
43
|
+
- Write commit message with issue reference
|
|
44
|
+
|
|
45
|
+
## Verification Checklist
|
|
46
|
+
- [ ] Fix addresses root cause, not symptoms
|
|
47
|
+
- [ ] Only bug-related files changed (no unrelated changes)
|
|
48
|
+
- [ ] Regression test added
|
|
49
|
+
- [ ] All tests pass
|
|
50
|
+
- [ ] Lint passes
|
|
51
|
+
- [ ] Commit message references issue number
|
|
52
|
+
- [ ] Ready for cherry-pick to release branch if needed
|