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.
Files changed (74) hide show
  1. package/README.md +489 -0
  2. package/bin/cli.mjs +35 -0
  3. package/lib/installer.mjs +495 -0
  4. package/lib/questions.mjs +332 -0
  5. package/lib/ui.mjs +76 -0
  6. package/lib/utils.mjs +231 -0
  7. package/package.json +26 -0
  8. package/templates/base/CLAUDE.md +34 -0
  9. package/templates/base/_ai/_guidelines_header.md +70 -0
  10. package/templates/base/_ai/context/README.md +20 -0
  11. package/templates/base/_ai/prompts/codereview.prompt.md +324 -0
  12. package/templates/base/_ai/prompts/duplicate-code-analysis.prompt.md +128 -0
  13. package/templates/base/_ai/prompts/figma-analysis.prompt.md +155 -0
  14. package/templates/base/_ai/prompts/security-review.prompt.md +46 -0
  15. package/templates/base/_ai/skills/README.md +80 -0
  16. package/templates/base/_ai/skills/TEMPLATE.md +106 -0
  17. package/templates/base/_ai/skills/babysit-prs/SKILL.md +105 -0
  18. package/templates/base/_ai/skills/debug/SKILL.md +93 -0
  19. package/templates/base/_ai/skills/fill-worklogs/SKILL.md +158 -0
  20. package/templates/base/_ai/skills/hotfix/SKILL.md +52 -0
  21. package/templates/base/_ai/skills/jira-task/SKILL.md +170 -0
  22. package/templates/base/_ai/skills/my-prs/SKILL.md +78 -0
  23. package/templates/base/_ai/skills/pr-dashboard/SKILL.md +43 -0
  24. package/templates/base/_ai/skills/pr-prepare/SKILL.md +106 -0
  25. package/templates/base/_ai/skills/refactor/SKILL.md +87 -0
  26. package/templates/base/_ai/skills/write-tests/SKILL.md +109 -0
  27. package/templates/base/_claude/settings.local.json +37 -0
  28. package/templates/base/_cursor/rules/global.mdc +7 -0
  29. package/templates/base/_editorconfig +18 -0
  30. package/templates/base/_gemini/settings.json +3 -0
  31. package/templates/base/_github/copilot-instructions.md +1 -0
  32. package/templates/base/_github/pull_request_template.md +23 -0
  33. package/templates/base/_gitignore +22 -0
  34. package/templates/base/_junie/guidelines.md +1 -0
  35. package/templates/base/commit-instructions.md +92 -0
  36. package/templates/packs/docker/_ai/instructions/docker.instructions.md +193 -0
  37. package/templates/packs/docker/_guidelines.md +10 -0
  38. package/templates/packs/docker/pack.json +8 -0
  39. package/templates/packs/laravel/_ai/instructions/api-resource.instructions.md +251 -0
  40. package/templates/packs/laravel/_ai/instructions/module.instructions.md +133 -0
  41. package/templates/packs/laravel/_ai/instructions/service-repository.instructions.md +215 -0
  42. package/templates/packs/laravel/_ai/instructions/testing.instructions.md +278 -0
  43. package/templates/packs/laravel/_ai/skills/migration/SKILL.md +172 -0
  44. package/templates/packs/laravel/_ai/skills/new-endpoint/SKILL.md +165 -0
  45. package/templates/packs/laravel/_ai/skills/new-module/SKILL.md +208 -0
  46. package/templates/packs/laravel/_ai/skills/queued-job/SKILL.md +248 -0
  47. package/templates/packs/laravel/_ai/skills/testing-feature/SKILL.md +196 -0
  48. package/templates/packs/laravel/_ai/skills/testing-manual/SKILL.md +186 -0
  49. package/templates/packs/laravel/_ai/skills/testing-unit/SKILL.md +200 -0
  50. package/templates/packs/laravel/_guidelines.md +25 -0
  51. package/templates/packs/laravel/pack.json +6 -0
  52. package/templates/packs/playwright/_ai/instructions/playwright.instructions.md +219 -0
  53. package/templates/packs/playwright/_ai/skills/playwright/README.md +194 -0
  54. package/templates/packs/playwright/_ai/skills/playwright/SKILL.md +1245 -0
  55. package/templates/packs/playwright/_ai/skills/playwright-codereview/SKILL.md +642 -0
  56. package/templates/packs/playwright/_ai/skills/playwright-record/README.md +87 -0
  57. package/templates/packs/playwright/_ai/skills/playwright-record/SKILL.md +564 -0
  58. package/templates/packs/playwright/_guidelines.md +12 -0
  59. package/templates/packs/playwright/pack.json +9 -0
  60. package/templates/packs/storybook/_ai/instructions/storybook.instructions.md +181 -0
  61. package/templates/packs/storybook/pack.json +6 -0
  62. package/templates/packs/vitest/_ai/instructions/vitest.instructions.md +688 -0
  63. package/templates/packs/vitest/pack.json +6 -0
  64. package/templates/packs/vue3/_ai/instructions/api.instructions.md +163 -0
  65. package/templates/packs/vue3/_ai/instructions/coding-conventions.instructions.md +160 -0
  66. package/templates/packs/vue3/_ai/instructions/composables.instructions.md +218 -0
  67. package/templates/packs/vue3/_ai/instructions/forms.instructions.md +227 -0
  68. package/templates/packs/vue3/_ai/instructions/store.instructions.md +504 -0
  69. package/templates/packs/vue3/_ai/instructions/vue.instructions.md +339 -0
  70. package/templates/packs/vue3/_ai/skills/api-integration/SKILL.md +195 -0
  71. package/templates/packs/vue3/_ai/skills/new-component/SKILL.md +133 -0
  72. package/templates/packs/vue3/_ai/skills/new-module/SKILL.md +177 -0
  73. package/templates/packs/vue3/_guidelines.md +45 -0
  74. package/templates/packs/vue3/pack.json +11 -0
@@ -0,0 +1,170 @@
1
+ # Skill: Jira Task — Full Development Workflow
2
+
3
+ ## Trigger
4
+ Use when given a Jira ticket number to implement, when asked to work on a task/feature/bugfix from Jira, or when user says to pick up a ticket.
5
+
6
+ ## Overview
7
+
8
+ Automates the complete dev cycle: Jira ticket → analysis → branch → implementation → code review → PR → Jira updates. Requires Jira MCP server. Detects hosting platform (GitHub or Bitbucket) from `git remote`.
9
+
10
+ ## Step-by-Step
11
+
12
+ ### 1. Fetch Jira Ticket
13
+
14
+ Fetch ticket details and images in parallel:
15
+ ```
16
+ mcp__mcp-atlassian__jira_get_issue(issue_key: "{{JIRA_PREFIX}}-XXXXX", comment_limit: 50)
17
+ mcp__mcp-atlassian__jira_get_issue_images(issue_key: "{{JIRA_PREFIX}}-XXXXX")
18
+ ```
19
+
20
+ Extract: summary, description, status, assignee, linked issues, comments.
21
+
22
+ **Images** — analyze carefully, they often contain the actual requirements, mockups, or error screenshots not present in the text.
23
+
24
+ **Comments** — read all comments, they often contain additional context, decisions, and clarifications.
25
+
26
+ **Assignee check** — if someone else is already assigned, ask the user before taking over.
27
+
28
+ ### 2. Analyze Requirements
29
+
30
+ Read the ticket text, images, AND comments thoroughly.
31
+
32
+ **Check linked issues and parent epic** for additional context:
33
+ ```
34
+ mcp__mcp-atlassian__jira_get_issue(issue_key: "{PARENT-OR-LINKED-KEY}")
35
+ ```
36
+
37
+ Ask the user if anything is unclear — don't assume.
38
+
39
+ ### 3. Create Branch
40
+
41
+ ```bash
42
+ git fetch origin {{BASE_BRANCH}}
43
+ git checkout -b {prefix}/{{JIRA_PREFIX}}-{ticket-number}-{short-description} origin/{{BASE_BRANCH}}
44
+ ```
45
+
46
+ **Branch prefix** based on ticket type:
47
+ - Bug → `bugfix/`
48
+ - Feature/Story → `feature/`
49
+ - Hotfix → `hotfix/`
50
+
51
+ If multiple base branches exist, ask the user which one to use.
52
+
53
+ **Transition ticket to Work in Progress:**
54
+ ```
55
+ mcp__mcp-atlassian__jira_get_transitions(issue_key: "{{JIRA_PREFIX}}-XXXXX")
56
+ ```
57
+ Walk through transitions until WIP. Also assign to yourself if not already assigned.
58
+
59
+ ### 4. Explore Codebase
60
+
61
+ Use the `Explore` subagent or Glob/Grep to understand the relevant module, existing patterns, and conventions.
62
+
63
+ **Read project guidelines** — before writing any code, read `.ai/guidelines.md` for coding standards and conventions. Also check `.ai/skills/` for module-specific skills that may apply to your task.
64
+
65
+ ### 5. Implement
66
+
67
+ - **Follow `.ai/guidelines.md`** strictly
68
+ - Follow existing codebase patterns
69
+ - Add tests (mirror existing test structure)
70
+ - Add documentation if applicable
71
+
72
+ **Commit format** (from `commit-instructions.md`):
73
+ ```
74
+ {{JIRA_PREFIX}}-{number}: description of change
75
+ ```
76
+
77
+ ### 6. Code Review
78
+
79
+ Before pushing, run a self-review of all changes (`git diff origin/{{BASE_BRANCH}}...HEAD`). Check for:
80
+
81
+ 1. **Security** — SQL injection, XSS, command injection, mass assignment, IDOR, sensitive data exposure
82
+ 2. **Code quality** — dead code, duplication, naming, missing validation at system boundaries
83
+ 3. **Logic** — edge cases, off-by-one errors, null handling, race conditions
84
+ 4. **Tests** — adequate coverage, missing negative cases, brittle assertions
85
+
86
+ Fix all critical and important issues found before proceeding.
87
+
88
+ **Run tests** before pushing:
89
+ ```bash
90
+ {{TEST_COMMAND}}
91
+ ```
92
+
93
+ ### 7. Push + Create PR
94
+
95
+ **Rebase on latest base branch:**
96
+ ```bash
97
+ git fetch origin {{BASE_BRANCH}}
98
+ git rebase origin/{{BASE_BRANCH}}
99
+ ```
100
+
101
+ If conflicts arise, resolve them before pushing.
102
+
103
+ ```bash
104
+ git push -u origin {branch-name}
105
+ ```
106
+
107
+ **Create PR** — detect platform from `git remote`:
108
+
109
+ #### GitHub
110
+ ```bash
111
+ gh pr create --title "{{JIRA_PREFIX}}-{number}: {description}" --body "## Summary\n- ...\n\n## Test plan\n- [ ] ..." --base {{BASE_BRANCH}}
112
+ ```
113
+
114
+ #### Bitbucket
115
+ ```
116
+ mcp__mcp-bitbucket__bb_post(
117
+ path: "/repositories/{OWNER}/{REPO}/pullrequests",
118
+ body: {
119
+ "title": "{{JIRA_PREFIX}}-{number}: {description}",
120
+ "source": {"branch": {"name": "{branch}"}},
121
+ "destination": {"branch": {"name": "{{BASE_BRANCH}}"}},
122
+ "description": "## Summary\n- ...\n\n## Test plan\n- [ ] ...",
123
+ "close_source_branch": true
124
+ }
125
+ )
126
+ ```
127
+
128
+ ### 8. Update Jira
129
+
130
+ Do ALL of these in parallel:
131
+
132
+ **a) Add comment** with branch + PR link + what was done:
133
+ ```
134
+ mcp__mcp-atlassian__jira_add_comment(issue_key, body: "Branch: `{branch}`\nPR: {url}\n\n**What was done:**\n- ...")
135
+ ```
136
+
137
+ **b) Log worklog** (ask user for hours if not specified):
138
+ ```
139
+ mcp__mcp-atlassian__jira_add_worklog(issue_key, time_spent: "2h", comment: "...")
140
+ ```
141
+
142
+ **c) Transition status to IN REVIEW:**
143
+ ```
144
+ mcp__mcp-atlassian__jira_get_transitions(issue_key: "{{JIRA_PREFIX}}-XXXXX")
145
+ ```
146
+ Walk through transitions step by step until review status. Always call `jira_get_transitions` first — IDs vary per project.
147
+
148
+ ### 9. After PR is Merged
149
+
150
+ When the branch is merged (user confirms or PR state = MERGED):
151
+
152
+ 1. **Transition to Ready for test** (or equivalent — check available transitions)
153
+ 2. **Set fix version** if user specifies one
154
+ 3. **Assign to tester** if applicable
155
+
156
+ ### 10. Monitor PR (optional)
157
+
158
+ After creating the PR, ask the user if they want a monitoring loop. If yes, set up a 5-minute loop that checks PR state and auto-finishes Step 9 when merged.
159
+
160
+ ## Common Mistakes
161
+
162
+ | Mistake | Fix |
163
+ |---------|-----|
164
+ | Forgetting to fetch base branch before branching | Always `git fetch origin {{BASE_BRANCH}}` first |
165
+ | Assuming base branch without asking | Ask user if multiple candidates exist |
166
+ | Pushing before code review | Always self-review (including security) first |
167
+ | Not walking through Jira transitions step by step | Can't jump statuses — must transition sequentially |
168
+ | Not reading `.ai/guidelines.md` before coding | Coding standards apply — read once per task |
169
+ | Not running tests before pushing | Run test suite — don't push failing code |
170
+ | Not rebasing before push | Base branch may have moved — rebase to avoid merge conflicts |
@@ -0,0 +1,78 @@
1
+ # Skill: My PRs
2
+
3
+ ## Trigger
4
+ Use when user wants to check status of their own open PRs, see how many approvals are missing, or check for new reviewer comments.
5
+
6
+ ## Overview
7
+
8
+ Check the status of your own open pull requests — approvals, missing approvals, and new comments. Detects platform (GitHub or Bitbucket) from `git remote`.
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}`, `{OWNER}`, `{REPO}`, `{USER_NAME}`.
18
+ Store `{WEEK_AGO}` as date 7 days ago (YYYY-MM-DD).
19
+
20
+ ## Step 2: Fetch Your Open PRs
21
+
22
+ ### GitHub
23
+
24
+ ```bash
25
+ gh pr list --repo {OWNER}/{REPO} --author "@me" --state open --json number,title,headRefName,url,createdAt,reviews,comments
26
+ ```
27
+
28
+ ### Bitbucket
29
+
30
+ ```
31
+ mcp__mcp-bitbucket__bb_get
32
+ path: /repositories/{OWNER}/{REPO}/pullrequests
33
+ queryParams: {"pagelen": "50", "q": "state=\"OPEN\" AND updated_on >= {WEEK_AGO}"}
34
+ ```
35
+
36
+ Filter to only PRs where author matches `{USER_NAME}`.
37
+
38
+ ## Step 3: For Each PR, Fetch Details
39
+
40
+ ### GitHub
41
+
42
+ ```bash
43
+ gh pr view {number} --repo {OWNER}/{REPO} --json reviews,comments,reviewRequests
44
+ ```
45
+
46
+ - Count reviews where `state == "APPROVED"`
47
+ - List who approved
48
+ - Count comments from others
49
+
50
+ ### Bitbucket
51
+
52
+ Fetch participants:
53
+ ```
54
+ mcp__mcp-bitbucket__bb_get
55
+ path: /repositories/{OWNER}/{REPO}/pullrequests/{id}
56
+ ```
57
+
58
+ Fetch comments:
59
+ ```
60
+ mcp__mcp-bitbucket__bb_get
61
+ path: /repositories/{OWNER}/{REPO}/pullrequests/{id}/comments
62
+ queryParams: {"pagelen": "50", "sort": "-created_on"}
63
+ ```
64
+
65
+ Filter out your own comments. Flag unresolved ones.
66
+
67
+ ## Step 4: Present Results
68
+
69
+ | PR | Title | Approvals | Missing | Comments | Link |
70
+ |----|-------|-----------|---------|----------|------|
71
+ | **#1234** | Short title | 2/3 (Alice, Bob) | 1 more needed | 3 new comments | [Open PR](url) |
72
+
73
+ - **Approvals**: `{count}/{required}` + who approved
74
+ - **Missing**: how many more approvals needed, or "Ready to merge!" if enough
75
+ - **Comments**: count of comments from others, highlight if there are unresolved/recent ones
76
+ - **Link**: direct URL to PR
77
+
78
+ If no open PRs: "No open PRs found."
@@ -0,0 +1,43 @@
1
+ # Skill: PR Dashboard
2
+
3
+ ## Trigger
4
+ Use when user wants a full PR dashboard — monitors both incoming PRs waiting for review and tracks own PRs approval status, optionally sets up recurring checks.
5
+
6
+ ## Overview
7
+
8
+ Combined PR monitoring. Runs both incoming PR check and own PR status check. Can optionally set up a 10-minute polling loop.
9
+
10
+ ## Setup
11
+
12
+ 1. Detect user and repo:
13
+ ```bash
14
+ git config user.name
15
+ git remote get-url origin
16
+ ```
17
+ Parse platform, owner, repo, user name.
18
+
19
+ 2. Ask user: "Set up a recurring 10-minute check?" If yes, use CronCreate with `*/10 * * * *`.
20
+
21
+ 3. Run first check immediately.
22
+
23
+ ## How to Check
24
+
25
+ ### Section 1 — Incoming PRs
26
+
27
+ Follow the `babysit-prs` skill steps (skip loop setup). Show the incoming PRs table.
28
+
29
+ ### Section 2 — My PRs
30
+
31
+ Follow the `my-prs` skill steps. Show the my PRs table.
32
+
33
+ ### Combined Output Format
34
+
35
+ ```
36
+ ## PR Dashboard
37
+
38
+ ### Incoming PRs to review
39
+ (table from babysit-prs or "No new PRs to review.")
40
+
41
+ ### My PRs
42
+ (table from my-prs or "No open PRs found.")
43
+ ```
@@ -0,0 +1,106 @@
1
+ # Skill: Prepare Pull Request
2
+
3
+ ## Trigger
4
+ Use before pushing code and creating a pull request.
5
+
6
+ ## Input
7
+ - Branch name
8
+ - Related ticket/issue (if any)
9
+ - Target branch (default: develop)
10
+
11
+ ## Steps
12
+
13
+ ### 1. Self-review diff
14
+
15
+ ```bash
16
+ git diff {{BASE_BRANCH}}...HEAD --stat
17
+ git diff {{BASE_BRANCH}}...HEAD
18
+ ```
19
+
20
+ Check every changed file:
21
+ - [ ] No debug code (console.log, dd(), var_dump, debugger)
22
+ - [ ] No commented-out code
23
+ - [ ] No TODO/FIXME without ticket reference
24
+ - [ ] No hardcoded values that should be config
25
+ - [ ] No secrets or credentials
26
+ - [ ] No unrelated changes (scope creep)
27
+
28
+ ### 2. Verify tests pass
29
+
30
+ ```bash
31
+ {{TEST_COMMAND}}
32
+ {{LINT_COMMAND}}
33
+ {{BUILD_COMMAND}}
34
+ ```
35
+
36
+ All three must pass. Fix issues before proceeding.
37
+
38
+ ### 3. Check commit history
39
+
40
+ ```bash
41
+ git log {{BASE_BRANCH}}...HEAD --oneline
42
+ ```
43
+
44
+ Evaluate:
45
+ - Are commits atomic (one logical change each)?
46
+ - Do commit messages follow Conventional Commits?
47
+ - Are there WIP/fixup commits that should be squashed?
48
+
49
+ If cleanup needed:
50
+ ```bash
51
+ git rebase -i {{BASE_BRANCH}}
52
+ ```
53
+
54
+ ### 4. Write PR description
55
+
56
+ Structure:
57
+
58
+ ```markdown
59
+ ## What
60
+ [One sentence: what this PR does]
61
+
62
+ ## Why
63
+ [Context: ticket link, problem description]
64
+
65
+ ## How
66
+ [Key technical decisions, approach taken]
67
+
68
+ ## Testing
69
+ [How to test: steps, commands, screenshots]
70
+
71
+ ## Checklist
72
+ - [ ] Tests added/updated
73
+ - [ ] Linter passes
74
+ - [ ] Build passes
75
+ - [ ] Documentation updated (if needed)
76
+ - [ ] Breaking changes noted (if any)
77
+ ```
78
+
79
+ ### 5. Final review
80
+
81
+ Before pushing, verify:
82
+ - [ ] PR has a clear, descriptive title (Conventional Commits format)
83
+ - [ ] Description explains what AND why
84
+ - [ ] No files accidentally included (check .gitignore)
85
+ - [ ] Branch is up to date with target branch
86
+ - [ ] All CI checks will pass
87
+
88
+ ```bash
89
+ # Rebase on latest target
90
+ git fetch origin
91
+ git rebase origin/{{BASE_BRANCH}}
92
+
93
+ # Final test after rebase
94
+ {{TEST_COMMAND}}
95
+ ```
96
+
97
+ ### 6. Verification checklist
98
+
99
+ - [ ] No debug/temp code in diff
100
+ - [ ] No unrelated changes
101
+ - [ ] Tests pass
102
+ - [ ] Lint passes
103
+ - [ ] Build passes
104
+ - [ ] Commits are clean and atomic
105
+ - [ ] PR description is complete
106
+ - [ ] Branch is rebased on latest target
@@ -0,0 +1,87 @@
1
+ # Skill: Systematic Refactoring
2
+
3
+ ## Trigger
4
+ Use when refactoring code - extracting, restructuring, or simplifying without changing behavior.
5
+
6
+ ## Input
7
+ - Target file(s) or module
8
+ - Goal (extract, simplify, split, rename, etc.)
9
+ - Constraints (backward compatibility, etc.)
10
+
11
+ ## Steps
12
+
13
+ ### 1. Understand current code
14
+
15
+ - Read all files involved
16
+ - Identify public API (what other code depends on)
17
+ - List all callers/imports of the code being refactored
18
+ - Run existing tests to confirm green baseline
19
+
20
+ ```bash
21
+ # Run tests before ANY changes
22
+ {{TEST_COMMAND}}
23
+ ```
24
+
25
+ ### 2. Plan refactoring
26
+
27
+ Document:
28
+ - **What** changes (file, function, class)
29
+ - **Why** (duplication, complexity, readability, single responsibility)
30
+ - **Impact** - list files that import/use the target code
31
+ - **Risk** - what could break
32
+
33
+ ### 3. Make smallest possible change
34
+
35
+ One refactoring at a time. Do NOT combine multiple refactorings in one step.
36
+
37
+ Order of operations:
38
+ 1. Extract → test
39
+ 2. Rename → test
40
+ 3. Move → test
41
+ 4. Simplify → test
42
+
43
+ ### 4. Test after each change
44
+
45
+ ```bash
46
+ {{TEST_COMMAND}}
47
+ ```
48
+
49
+ If tests fail → revert last change, understand why, try different approach.
50
+
51
+ ### 5. Update callers
52
+
53
+ After renaming or moving:
54
+ - Update all imports
55
+ - Update all references
56
+ - Search for string references (config, route names, etc.)
57
+
58
+ ### 6. Remove dead code
59
+
60
+ After extraction/move:
61
+ - Delete original code only AFTER all callers updated
62
+ - Do not leave commented-out code
63
+ - Do not leave unused imports
64
+
65
+ ### 7. Final verification
66
+
67
+ ```bash
68
+ # Full test suite
69
+ {{TEST_COMMAND}}
70
+
71
+ # Lint
72
+ {{LINT_COMMAND}}
73
+
74
+ # Build (catch type errors)
75
+ {{BUILD_COMMAND}}
76
+ ```
77
+
78
+ ### 8. Verification checklist
79
+
80
+ - [ ] Tests pass before AND after refactoring
81
+ - [ ] No behavioral changes (same inputs → same outputs)
82
+ - [ ] All callers updated
83
+ - [ ] No dead code left
84
+ - [ ] No commented-out code
85
+ - [ ] Lint passes
86
+ - [ ] Build passes
87
+ - [ ] Each commit is one atomic refactoring step
@@ -0,0 +1,109 @@
1
+ # Skill: Write Tests for Existing Code
2
+
3
+ ## Trigger
4
+ Use when adding tests to existing code that lacks test coverage.
5
+
6
+ ## Input
7
+ - Target file(s) or module to test
8
+ - Test framework already in use
9
+ - Priority areas (critical paths, recent bugs, etc.)
10
+
11
+ ## Steps
12
+
13
+ ### 1. Analyze the code
14
+
15
+ - Read all target files
16
+ - Identify public API: exported functions, class methods, component props/events
17
+ - List dependencies and side effects (API calls, DB, file system)
18
+ - Note edge cases: nulls, empty arrays, boundary values, error states
19
+
20
+ ### 2. Categorize test types needed
21
+
22
+ - **Unit tests** — pure functions, services, utilities, stores
23
+ - **Integration tests** — components with dependencies, API calls, DB queries
24
+ - **Feature/E2E tests** — full user flows through multiple layers
25
+
26
+ Prioritize: unit > integration > e2e (more coverage per effort).
27
+
28
+ ### 3. List test cases
29
+
30
+ For each function/method, write a test case list BEFORE writing code:
31
+
32
+ ```
33
+ [function_name]
34
+ - returns expected output for valid input
35
+ - handles empty input
36
+ - handles null/undefined
37
+ - throws on invalid input
38
+ - edge case: [specific to function]
39
+ ```
40
+
41
+ Review the list — are critical paths covered? Add missing cases.
42
+
43
+ ### 4. Set up test file
44
+
45
+ ```bash
46
+ # Verify test framework works
47
+ {{TEST_COMMAND}}
48
+ ```
49
+
50
+ Create test file following project conventions:
51
+ - Mirror source file path in test directory
52
+ - Use existing test files as pattern reference
53
+ - Set up shared fixtures/factories/mocks
54
+
55
+ ### 5. Write tests — simplest first
56
+
57
+ Start with the easiest, most obvious test:
58
+ - Valid input → expected output
59
+ - No mocks needed
60
+ - Confirms test setup works
61
+
62
+ ```bash
63
+ # Run after first test to verify setup
64
+ {{TEST_COMMAND}}
65
+ ```
66
+
67
+ ### 6. Add remaining tests incrementally
68
+
69
+ For each test case from step 3:
70
+ 1. Write the test
71
+ 2. Run it
72
+ 3. Fix if red (test bug vs code bug — know the difference)
73
+
74
+ Group related tests in `describe` blocks.
75
+
76
+ ### 7. Handle dependencies
77
+
78
+ For code with external dependencies:
79
+ - **API calls** → mock HTTP client / use test server
80
+ - **Database** → use transactions / test DB / factories
81
+ - **Time** → freeze time / inject clock
82
+ - **File system** → temp directories / mock fs
83
+
84
+ Mock at the boundary, not deep inside the code.
85
+
86
+ ### 8. Verify coverage
87
+
88
+ ```bash
89
+ # Run with coverage
90
+ {{TEST_COMMAND}} --coverage
91
+ ```
92
+
93
+ Check:
94
+ - All public methods have at least one test
95
+ - Error paths are tested (not just happy path)
96
+ - Edge cases from step 1 are covered
97
+
98
+ ### 9. Verification checklist
99
+
100
+ - [ ] All public functions/methods have tests
101
+ - [ ] Happy path tested
102
+ - [ ] Error/edge cases tested
103
+ - [ ] Mocks are minimal (boundary only)
104
+ - [ ] Tests are independent (no shared mutable state)
105
+ - [ ] Tests run fast (no unnecessary waits/timeouts)
106
+ - [ ] Test names describe behavior, not implementation
107
+ - [ ] No test depends on execution order
108
+ - [ ] All tests pass
109
+ - [ ] No production code was changed
@@ -0,0 +1,37 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npx get-shit-done-cc@latest:*)",
5
+ "Bash(claude mcp:*)",
6
+ "Bash(npm search:*)",
7
+ "Bash(npm info:*)",
8
+ "Bash(npm run:*)",
9
+ "Bash(npm test:*)",
10
+ "Bash(npm install:*)",
11
+ "Bash(npx:*)",
12
+ "Bash(git status:*)",
13
+ "Bash(git diff:*)",
14
+ "Bash(git log:*)",
15
+ "Bash(git branch:*)",
16
+ "Bash(git checkout:*)",
17
+ "Bash(git add:*)",
18
+ "Bash(git stash:*)",
19
+ "Bash(git fetch:*)",
20
+ "Bash(ls:*)",
21
+ "Bash(cat:*)",
22
+ "Bash(find:*)",
23
+ "Bash(grep:*)",
24
+ "Bash(wc:*)",
25
+ "Bash(head:*)",
26
+ "Bash(tail:*)",
27
+ "Read(~/.claude/**)"
28
+ ],
29
+ "deny": [
30
+ "Bash(rm -rf:*)",
31
+ "Bash(git push --force:*)",
32
+ "Bash(git reset --hard:*)",
33
+ "Bash(DROP TABLE:*)",
34
+ "Bash(curl * | bash:*)"
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: Global project rules
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+
7
+ Read and follow .ai/guidelines.md as mandatory context.
@@ -0,0 +1,18 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ [*.{php,py,java}]
12
+ indent_size = 4
13
+
14
+ [*.md]
15
+ trim_trailing_whitespace = false
16
+
17
+ [Makefile]
18
+ indent_style = tab
@@ -0,0 +1,3 @@
1
+ [
2
+ ".ai/guidelines.md"
3
+ ]
@@ -0,0 +1 @@
1
+ Read and follow .ai/guidelines.md as mandatory context for all work in this project.
@@ -0,0 +1,23 @@
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? Link to JIRA ticket. -->
4
+
5
+ {{JIRA_PREFIX}}-XXXX
6
+
7
+ ## Changes
8
+
9
+ -
10
+
11
+ ## Testing
12
+
13
+ - [ ] Unit tests added/updated
14
+ - [ ] Integration tests (if applicable)
15
+ - [ ] Manual testing done
16
+
17
+ ## Checklist
18
+
19
+ - [ ] Code follows project conventions (`.ai/guidelines.md`)
20
+ - [ ] No `console.log` / debug code left
21
+ - [ ] No hardcoded secrets or URLs
22
+ - [ ] CI passes: `{{CI_COMMAND}}`
23
+ - [ ] Self-reviewed the diff before requesting review