@maggit/claude-workspace 0.1.1
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 +21 -0
- package/README.md +228 -0
- package/assets/claude-md/default.md +34 -0
- package/assets/claude-md/engineering-exec.md +34 -0
- package/assets/claude-md/indie-maker.md +33 -0
- package/assets/claude-md/marketing.md +33 -0
- package/assets/profiles/default.json +46 -0
- package/assets/profiles/engineering-exec.json +42 -0
- package/assets/profiles/indie-maker.json +32 -0
- package/assets/profiles/marketing.json +27 -0
- package/assets/skills/adr/SKILL.md +66 -0
- package/assets/skills/apidoc/SKILL.md +78 -0
- package/assets/skills/changelog/SKILL.md +54 -0
- package/assets/skills/commit/SKILL.md +18 -0
- package/assets/skills/completetodo/SKILL.md +75 -0
- package/assets/skills/createtodo/SKILL.md +79 -0
- package/assets/skills/deadcode/SKILL.md +56 -0
- package/assets/skills/debug/SKILL.md +62 -0
- package/assets/skills/deps/SKILL.md +66 -0
- package/assets/skills/e2e/SKILL.md +68 -0
- package/assets/skills/eng-spec/SKILL.md +93 -0
- package/assets/skills/envcheck/SKILL.md +65 -0
- package/assets/skills/explain/SKILL.md +52 -0
- package/assets/skills/landing-page-copy/SKILL.md +95 -0
- package/assets/skills/meeting-notes/SKILL.md +90 -0
- package/assets/skills/migration/SKILL.md +61 -0
- package/assets/skills/openpr/SKILL.md +143 -0
- package/assets/skills/opentodos/SKILL.md +79 -0
- package/assets/skills/perf/SKILL.md +58 -0
- package/assets/skills/prd/SKILL.md +71 -0
- package/assets/skills/readme/SKILL.md +55 -0
- package/assets/skills/rebase/SKILL.md +59 -0
- package/assets/skills/release/SKILL.md +64 -0
- package/assets/skills/release-plan/SKILL.md +107 -0
- package/assets/skills/requirements/SKILL.md +77 -0
- package/assets/skills/seo-brief/SKILL.md +88 -0
- package/assets/skills/standup/SKILL.md +48 -0
- package/assets/skills/storecontext/SKILL.md +76 -0
- package/assets/skills/summary/SKILL.md +72 -0
- package/assets/skills/test/SKILL.md +55 -0
- package/assets/skills/testcoverage/SKILL.md +57 -0
- package/assets/skills/todo/SKILL.md +84 -0
- package/assets/templates/DECISION_RECORD_TEMPLATE.md +59 -0
- package/assets/templates/ENG_SPEC_TEMPLATE.md +84 -0
- package/assets/templates/PRD_TEMPLATE.md +72 -0
- package/assets/templates/PROJECT_INDEX_TEMPLATE.md +65 -0
- package/assets/templates/WEEKLY_REVIEW_TEMPLATE.md +57 -0
- package/assets/vault/README.md +34 -0
- package/assets/vault/_index.md +27 -0
- package/dist/bin.js +888 -0
- package/dist/bin.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: changelog
|
|
3
|
+
description: "Generate a changelog from git history. Use when the user says /changelog, asks to generate a changelog, wants a summary of changes between tags/commits/branches, or needs a CHANGELOG.md file created or updated. Triggers: changelog, changes since, release notes from git, what changed."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog Generator
|
|
7
|
+
|
|
8
|
+
Generate a well-structured changelog from git history.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Detect the repository root via `git rev-parse --show-toplevel`.
|
|
13
|
+
2. Determine the range:
|
|
14
|
+
- If the user specifies two refs (tags, branches, SHAs), use that range.
|
|
15
|
+
- Otherwise, find the latest tag with `git describe --tags --abbrev=0` and use `<latest-tag>..HEAD`.
|
|
16
|
+
- If no tags exist, use the full history.
|
|
17
|
+
3. Collect commits with `git log --pretty=format:"%H|%s|%an|%ad" --date=short <range>`.
|
|
18
|
+
4. Categorize each commit by its conventional-commit prefix or keywords:
|
|
19
|
+
- **Added** — `feat`, `add`
|
|
20
|
+
- **Fixed** — `fix`, `bugfix`, `patch`
|
|
21
|
+
- **Changed** — `refactor`, `update`, `change`
|
|
22
|
+
- **Deprecated** — `deprecate`
|
|
23
|
+
- **Removed** — `remove`, `delete`
|
|
24
|
+
- **Security** — `security`, `vuln`
|
|
25
|
+
- **Performance** — `perf`
|
|
26
|
+
- **Documentation** — `docs`
|
|
27
|
+
- **Other** — anything that doesn't match
|
|
28
|
+
5. Format output following [Keep a Changelog](https://keepachangelog.com/) conventions.
|
|
29
|
+
6. If a `CHANGELOG.md` already exists, prepend the new section below the title. Otherwise create a new file.
|
|
30
|
+
|
|
31
|
+
## Output Format
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# Changelog
|
|
35
|
+
|
|
36
|
+
## [<version-or-range>] - YYYY-MM-DD
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
- Description of feature (SHA short)
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- Description of fix (SHA short)
|
|
43
|
+
|
|
44
|
+
...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Guidelines
|
|
48
|
+
|
|
49
|
+
- Use imperative mood in descriptions ("Add feature" not "Added feature").
|
|
50
|
+
- Include short SHA (7 chars) for traceability.
|
|
51
|
+
- Group by category, then sort chronologically within each group.
|
|
52
|
+
- Omit empty categories.
|
|
53
|
+
- If the user requests a specific format (e.g., plain text, JSON), adapt accordingly.
|
|
54
|
+
- For monorepos, offer to scope by directory path using `git log -- <path>`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit
|
|
3
|
+
description: Generate a commit message and commit staged changes
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash, Read
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Commit Changes
|
|
9
|
+
|
|
10
|
+
1. Run `git diff --cached` to see what's staged
|
|
11
|
+
2. If nothing is staged, run `git status` and tell the user
|
|
12
|
+
3. Generate a commit message using conventional commits format:
|
|
13
|
+
- `<type>(<scope>): <subject>`
|
|
14
|
+
- Types: feat, fix, docs, refactor, test, chore
|
|
15
|
+
- Lowercase, imperative mood, no period
|
|
16
|
+
4. Run `git commit -m "<message>"`
|
|
17
|
+
|
|
18
|
+
If the user provided arguments ($ARGUMENTS), use them as guidance for the message.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: completetodo
|
|
3
|
+
description: "Mark TODO items as completed based on work done in the current session. Use when the user says /completetodo, asks to mark todos as done, check off tasks, complete tasks, or update todo progress. Triggers: completetodo, complete todo, mark done, check off, tasks done, finished tasks, update todos."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Complete TODO
|
|
7
|
+
|
|
8
|
+
Review the current conversation, identify work that has been completed, and mark the corresponding TODO items as done in `ContextDB/todos/`.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Scan for active TODO files:**
|
|
13
|
+
- List all files in `ContextDB/todos/`.
|
|
14
|
+
- **Skip** files prefixed with `completed-` (these are fully done).
|
|
15
|
+
- Read each remaining file and collect all open items (`- [ ]`).
|
|
16
|
+
|
|
17
|
+
2. **Match completed work against open TODOs:**
|
|
18
|
+
- Review the current conversation to understand what was accomplished.
|
|
19
|
+
- For each open TODO item, determine if the work described has been done in this session.
|
|
20
|
+
- Be thorough but conservative — only mark items as done if you're confident the work is complete, not just started.
|
|
21
|
+
|
|
22
|
+
3. **If the user provides specific items to complete:**
|
|
23
|
+
- The user may say things like "mark the auth task as done" or list specific items.
|
|
24
|
+
- Match their description to the closest open TODO item(s).
|
|
25
|
+
- If ambiguous, show the matching candidates and ask which one(s) to mark.
|
|
26
|
+
|
|
27
|
+
4. **Update the file(s):**
|
|
28
|
+
- Replace `- [ ]` with `- [x]` for each completed item.
|
|
29
|
+
- Add a completion timestamp as an inline comment:
|
|
30
|
+
```markdown
|
|
31
|
+
- [x] Implement login endpoint in `app/api/auth/route.ts` <!-- completed 2026-02-07 14:30 -->
|
|
32
|
+
```
|
|
33
|
+
- **Do not** modify any other content in the file.
|
|
34
|
+
- **Do not** remove items — completed items stay in the file as a record.
|
|
35
|
+
|
|
36
|
+
5. **Check if the entire file is now complete:**
|
|
37
|
+
- After updating, count remaining `- [ ]` items in the file.
|
|
38
|
+
- If **zero open items remain**, rename the file:
|
|
39
|
+
- From: `2026-02-07-auth-refactor-todo.md`
|
|
40
|
+
- To: `completed-2026-02-07-auth-refactor-todo.md`
|
|
41
|
+
- This signals to `/opentodos` that the file can be skipped entirely.
|
|
42
|
+
|
|
43
|
+
6. **Report to the user:**
|
|
44
|
+
- List which items were marked as done.
|
|
45
|
+
- List any items that are still open.
|
|
46
|
+
- If a file was renamed to `completed-`, mention that.
|
|
47
|
+
|
|
48
|
+
## Example
|
|
49
|
+
|
|
50
|
+
**Before:**
|
|
51
|
+
```markdown
|
|
52
|
+
- [ ] Add login endpoint
|
|
53
|
+
- [ ] Create JWT utility
|
|
54
|
+
- [x] Set up auth middleware <!-- completed 2026-02-06 10:15 -->
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**After running `/completetodo` (login endpoint was built this session):**
|
|
58
|
+
```markdown
|
|
59
|
+
- [x] Add login endpoint <!-- completed 2026-02-07 14:30 -->
|
|
60
|
+
- [ ] Create JWT utility
|
|
61
|
+
- [x] Set up auth middleware <!-- completed 2026-02-06 10:15 -->
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Guidelines
|
|
65
|
+
|
|
66
|
+
- Read the actual conversation — don't guess. Only mark items you have evidence were completed.
|
|
67
|
+
- If a task was partially done, do NOT mark it as complete. Instead, leave it open and optionally add a sub-note:
|
|
68
|
+
```markdown
|
|
69
|
+
- [ ] Implement user authentication
|
|
70
|
+
- [x] Login endpoint done <!-- completed 2026-02-07 -->
|
|
71
|
+
- [ ] Token refresh still pending
|
|
72
|
+
```
|
|
73
|
+
- Preserve the original wording of TODO items — don't rewrite them.
|
|
74
|
+
- If no TODOs match the current session's work, say so honestly.
|
|
75
|
+
- Always confirm what you're about to mark before writing, especially if the match is fuzzy.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: createtodo
|
|
3
|
+
description: "Create a TODO list in ContextDB/todos/. Use when the user says /createtodo, asks to create a todo, add tasks, make a task list, or track work items. Triggers: createtodo, create todo, add todo, new todo, task list, things to do, track tasks, add tasks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create TODO
|
|
7
|
+
|
|
8
|
+
Create or append to a TODO list stored as a Markdown file in `ContextDB/todos/`.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Determine the TODOs to add:**
|
|
13
|
+
- If the user provides explicit items → use those exactly as stated.
|
|
14
|
+
- If the user says something vague like "create a todo for what's pending" → review the current conversation and extract actionable items that are unfinished, discussed, or planned.
|
|
15
|
+
- Ask for clarification only if you truly can't determine what should go on the list.
|
|
16
|
+
|
|
17
|
+
2. **Check for an existing active TODO file for today:**
|
|
18
|
+
- Look in `ContextDB/todos/` for a file matching today's date pattern: `YYYY-MM-DD-*-todo.md` (excluding files prefixed with `completed-`).
|
|
19
|
+
- If one exists for today → **append** new items to it rather than creating a duplicate file.
|
|
20
|
+
- If none exists → create a new file.
|
|
21
|
+
|
|
22
|
+
3. **Create or update the file:**
|
|
23
|
+
- **Directory:** `ContextDB/todos/`
|
|
24
|
+
- **Filename format:** `YYYY-MM-DD-<topic>-todo.md`
|
|
25
|
+
- `<topic>` is a short kebab-case label derived from the user's request or the main theme.
|
|
26
|
+
- If no clear topic, use `general`: `2026-02-07-general-todo.md`
|
|
27
|
+
- Examples: `2026-02-07-auth-refactor-todo.md`, `2026-02-07-general-todo.md`
|
|
28
|
+
- Get the current date via `date "+%Y-%m-%d"` in bash.
|
|
29
|
+
|
|
30
|
+
4. **File format:**
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# TODO — <Topic> — YYYY-MM-DD
|
|
34
|
+
|
|
35
|
+
## Tasks
|
|
36
|
+
|
|
37
|
+
- [ ] Task description
|
|
38
|
+
- [ ] Task description with details
|
|
39
|
+
- [ ] Task description
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
<Optional section for any context, links, or background that helps understand the tasks.>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Rules for TODO items:
|
|
47
|
+
- Each item uses a Markdown checkbox: `- [ ]` (open) or `- [x]` (completed).
|
|
48
|
+
- Items should be **actionable and specific** — not vague ("fix stuff") but clear ("Fix the auth redirect bug in `lib/auth.ts`").
|
|
49
|
+
- Include file paths, function names, or specific details when relevant.
|
|
50
|
+
- You may add sub-items with indentation for complex tasks:
|
|
51
|
+
```
|
|
52
|
+
- [ ] Implement user authentication
|
|
53
|
+
- [ ] Add login endpoint in `app/api/auth/route.ts`
|
|
54
|
+
- [ ] Create JWT token utility in `lib/jwt.ts`
|
|
55
|
+
- [ ] Add auth middleware in `middleware.ts`
|
|
56
|
+
```
|
|
57
|
+
- You may add priority with a prefix: `[P0]`, `[P1]`, `[P2]` (where P0 = critical, P1 = important, P2 = nice to have).
|
|
58
|
+
- You may add categories with a prefix in **bold**: `**frontend**`, `**backend**`, `**infra**`, etc.
|
|
59
|
+
|
|
60
|
+
5. **When appending to an existing file:**
|
|
61
|
+
- Read the current file first.
|
|
62
|
+
- Add new items **below the existing items** in the `## Tasks` section.
|
|
63
|
+
- Add a separator comment so it's clear when items were added:
|
|
64
|
+
```
|
|
65
|
+
<!-- Added YYYY-MM-DD HH:MM -->
|
|
66
|
+
- [ ] New task
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
6. **Confirm to the user:**
|
|
70
|
+
- Show the filename.
|
|
71
|
+
- List the items that were added.
|
|
72
|
+
|
|
73
|
+
## Guidelines
|
|
74
|
+
|
|
75
|
+
- Never overwrite existing TODO items — only append.
|
|
76
|
+
- If the user asks to "update" a todo, read it first and ask what to change.
|
|
77
|
+
- Keep descriptions concise but unambiguous.
|
|
78
|
+
- This skill only **creates/appends** items. Use `/completetodo` to mark items done.
|
|
79
|
+
- Use `/opentodos` to review pending items.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deadcode
|
|
3
|
+
description: "Find and remove dead, unused, or unreachable code in a codebase. Use when the user says /deadcode, asks to find unused code, dead code, unreachable code, orphaned files, unused imports, unused variables, or wants to clean up a codebase. Triggers: dead code, unused, unreachable, orphan, cleanup, prune."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dead Code Detector
|
|
7
|
+
|
|
8
|
+
Find and safely remove dead, unused, or unreachable code.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Determine scope:
|
|
13
|
+
- Specific file/directory or entire project.
|
|
14
|
+
- Specific language(s) to focus on.
|
|
15
|
+
2. Identify the project type and entry points:
|
|
16
|
+
- Check for `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, etc.
|
|
17
|
+
- Identify entry points (main files, exported modules, route handlers).
|
|
18
|
+
3. Scan for dead code by category:
|
|
19
|
+
|
|
20
|
+
### Categories to Check
|
|
21
|
+
|
|
22
|
+
**Unused Imports/Requires**
|
|
23
|
+
- Scan each file for imported symbols not referenced in the file body.
|
|
24
|
+
|
|
25
|
+
**Unused Exports**
|
|
26
|
+
- Find exported functions/classes/constants and search the codebase for their usage.
|
|
27
|
+
- Use `grep -r` or equivalent to verify each export is imported elsewhere.
|
|
28
|
+
|
|
29
|
+
**Unused Variables & Parameters**
|
|
30
|
+
- Identify declared variables never read.
|
|
31
|
+
- Find function parameters never referenced in the function body.
|
|
32
|
+
- Respect `_` prefix convention for intentionally unused params.
|
|
33
|
+
|
|
34
|
+
**Unreachable Code**
|
|
35
|
+
- Code after unconditional `return`, `throw`, `break`, `continue`.
|
|
36
|
+
- Conditions that are always true/false (e.g., `if (false)`).
|
|
37
|
+
|
|
38
|
+
**Unused Files**
|
|
39
|
+
- Files not imported/required by any other file.
|
|
40
|
+
- Test files and config files should be excluded from this check.
|
|
41
|
+
|
|
42
|
+
**Commented-Out Code**
|
|
43
|
+
- Large blocks of commented code (>5 lines) that are likely stale.
|
|
44
|
+
|
|
45
|
+
4. Present findings grouped by category with file paths and line numbers.
|
|
46
|
+
5. For each finding, assess confidence (high/medium/low) based on static analysis limitations.
|
|
47
|
+
6. Remove only with user approval, starting with high-confidence items.
|
|
48
|
+
|
|
49
|
+
## Guidelines
|
|
50
|
+
|
|
51
|
+
- Never auto-delete — always present findings and ask for confirmation.
|
|
52
|
+
- Respect dynamic usage patterns: `getattr()`, `eval()`, reflection, decorators, dependency injection.
|
|
53
|
+
- Check for framework conventions (e.g., Django views referenced in urls.py, React components used in JSX).
|
|
54
|
+
- Exclude test files, config files, and type definition files from "unused" reports.
|
|
55
|
+
- For libraries/packages, exported public API should not be flagged as dead code.
|
|
56
|
+
- Note limitations: static analysis cannot catch all dynamic references.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
description: "Systematically debug issues in code. Use when the user says /debug, reports a bug, error, unexpected behavior, crash, exception, or needs help troubleshooting. Triggers: debug, bug, error, traceback, exception, crash, not working, broken, unexpected behavior, troubleshoot, investigate."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug Assistant
|
|
7
|
+
|
|
8
|
+
Systematically diagnose and fix bugs.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Gather context:**
|
|
13
|
+
- Ask for or locate the error message, traceback, or unexpected behavior description.
|
|
14
|
+
- Identify the file(s) and function(s) involved.
|
|
15
|
+
- Check recent git changes: `git log --oneline -10` and `git diff HEAD~3`.
|
|
16
|
+
|
|
17
|
+
2. **Reproduce:**
|
|
18
|
+
- Understand the reproduction steps.
|
|
19
|
+
- If a test exists, run it to confirm the failure.
|
|
20
|
+
- If no test exists, suggest a minimal reproduction.
|
|
21
|
+
|
|
22
|
+
3. **Hypothesize:**
|
|
23
|
+
- Form 2-3 hypotheses based on the error type.
|
|
24
|
+
- Rank by likelihood.
|
|
25
|
+
|
|
26
|
+
4. **Investigate top hypothesis:**
|
|
27
|
+
- Read the relevant code carefully.
|
|
28
|
+
- Trace the data flow from input to error.
|
|
29
|
+
- Check edge cases: null/undefined, empty collections, type mismatches, off-by-one, race conditions.
|
|
30
|
+
- Look at recent changes to the affected code with `git log -p -- <file>`.
|
|
31
|
+
|
|
32
|
+
5. **Identify root cause:**
|
|
33
|
+
- Distinguish symptom from cause.
|
|
34
|
+
- Check if the bug exists in other similar code paths.
|
|
35
|
+
|
|
36
|
+
6. **Fix:**
|
|
37
|
+
- Propose the minimal change that fixes the root cause.
|
|
38
|
+
- Explain why the fix works.
|
|
39
|
+
- Check for related bugs in similar patterns.
|
|
40
|
+
|
|
41
|
+
7. **Verify:**
|
|
42
|
+
- Run existing tests.
|
|
43
|
+
- Suggest a new test that would have caught this bug.
|
|
44
|
+
|
|
45
|
+
## Common Bug Patterns
|
|
46
|
+
|
|
47
|
+
| Pattern | What to check |
|
|
48
|
+
|---------|--------------|
|
|
49
|
+
| TypeError/AttributeError | Null checks, type coercion, missing fields |
|
|
50
|
+
| Off-by-one | Loop bounds, array indexing, fence-post |
|
|
51
|
+
| Race condition | Shared state, async/await, locks |
|
|
52
|
+
| State mutation | Unexpected side effects, shallow copies |
|
|
53
|
+
| Import/dependency | Version mismatches, circular imports |
|
|
54
|
+
| Environment | Missing env vars, wrong paths, permissions |
|
|
55
|
+
|
|
56
|
+
## Guidelines
|
|
57
|
+
|
|
58
|
+
- Read the actual error message carefully — it usually points to the answer.
|
|
59
|
+
- Check the simplest explanation first.
|
|
60
|
+
- Don't change code you don't understand. Read it first.
|
|
61
|
+
- One fix at a time. Verify before moving on.
|
|
62
|
+
- If the fix is a workaround, document it and note the underlying issue.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deps
|
|
3
|
+
description: "Analyze, audit, and manage project dependencies. Use when the user says /deps, asks to check dependencies, find outdated packages, audit for vulnerabilities, analyze dependency trees, or clean up unused packages. Triggers: deps, dependencies, outdated, audit, vulnerabilities, upgrade packages, dependency tree, unused packages, npm audit, pip audit."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dependency Manager
|
|
7
|
+
|
|
8
|
+
Analyze, audit, and manage project dependencies.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Detect the package ecosystem:**
|
|
13
|
+
- `package.json` → npm/yarn/pnpm
|
|
14
|
+
- `pyproject.toml` / `requirements.txt` → pip/poetry/uv
|
|
15
|
+
- `Cargo.toml` → cargo
|
|
16
|
+
- `go.mod` → Go modules
|
|
17
|
+
- `Gemfile` → bundler
|
|
18
|
+
- `pom.xml` / `build.gradle` → Maven/Gradle
|
|
19
|
+
|
|
20
|
+
2. **Run the requested analysis:**
|
|
21
|
+
|
|
22
|
+
### Outdated Dependencies
|
|
23
|
+
- `npm outdated` / `yarn outdated` / `pnpm outdated`
|
|
24
|
+
- `pip list --outdated`
|
|
25
|
+
- `cargo outdated` (if installed)
|
|
26
|
+
- `go list -u -m all`
|
|
27
|
+
- Present as a table: package, current, wanted, latest, type (major/minor/patch).
|
|
28
|
+
|
|
29
|
+
### Security Audit
|
|
30
|
+
- `npm audit` / `yarn audit` / `pnpm audit`
|
|
31
|
+
- `pip audit` / `safety check`
|
|
32
|
+
- `cargo audit`
|
|
33
|
+
- `govulncheck ./...`
|
|
34
|
+
- Categorize findings by severity (critical, high, medium, low).
|
|
35
|
+
- For each vulnerability, show: package, severity, description, fix available.
|
|
36
|
+
|
|
37
|
+
### Unused Dependencies
|
|
38
|
+
- Cross-reference declared dependencies against actual imports in the codebase.
|
|
39
|
+
- Check `devDependencies` vs runtime usage.
|
|
40
|
+
- Flag dependencies that are declared but never imported.
|
|
41
|
+
|
|
42
|
+
### Dependency Tree Analysis
|
|
43
|
+
- `npm ls --all` / `yarn why <pkg>` / `pnpm why <pkg>`
|
|
44
|
+
- `pipdeptree`
|
|
45
|
+
- Identify duplicate packages at different versions.
|
|
46
|
+
- Find heavy transitive dependencies.
|
|
47
|
+
|
|
48
|
+
### Upgrade Plan
|
|
49
|
+
For major upgrades, generate a plan:
|
|
50
|
+
```
|
|
51
|
+
1. Upgrade <package> from v2.x to v3.x
|
|
52
|
+
- Breaking changes: <list from changelog>
|
|
53
|
+
- Required code changes: <files affected>
|
|
54
|
+
- Risk: <low/medium/high>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. **Present findings with actionable recommendations.**
|
|
58
|
+
|
|
59
|
+
## Guidelines
|
|
60
|
+
|
|
61
|
+
- Always show the impact before suggesting upgrades (breaking changes, migration effort).
|
|
62
|
+
- For security vulnerabilities, prioritize by exploitability and exposure, not just CVSS score.
|
|
63
|
+
- Suggest pinning strategies: exact versions for apps, ranges for libraries.
|
|
64
|
+
- Warn about packages that are unmaintained (no commits in >1 year, deprecated).
|
|
65
|
+
- Don't auto-upgrade — always present the plan and get user confirmation.
|
|
66
|
+
- Check license compatibility if the user asks or if the project has a LICENSE file.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: e2e
|
|
3
|
+
description: "Generate end-to-end tests for applications. Use when the user says /e2e, asks for end-to-end tests, integration tests, browser tests, API tests, or wants to test a full user workflow. Triggers: e2e, end-to-end, integration test, browser test, playwright, cypress, selenium, API test, smoke test, user flow."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# E2E Test Generator
|
|
7
|
+
|
|
8
|
+
Generate end-to-end tests covering full user workflows.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Detect the E2E framework:**
|
|
13
|
+
- Check for existing config: `playwright.config.*`, `cypress.config.*`, `wdio.conf.*`.
|
|
14
|
+
- Check `package.json` for Playwright, Cypress, Selenium, Puppeteer, or similar.
|
|
15
|
+
- For API-only: check for Supertest, httpx, REST-assured.
|
|
16
|
+
- If none exists, recommend Playwright (most versatile) and help set it up.
|
|
17
|
+
|
|
18
|
+
2. **Identify the user flow to test:**
|
|
19
|
+
- Ask the user or infer from the feature being discussed.
|
|
20
|
+
- Map out the steps: navigation, input, actions, expected outcomes.
|
|
21
|
+
- Identify preconditions (auth state, seed data, feature flags).
|
|
22
|
+
|
|
23
|
+
3. **Generate the test:**
|
|
24
|
+
|
|
25
|
+
### For Browser E2E (Playwright/Cypress)
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
- Navigate to the page.
|
|
29
|
+
- Interact with elements using accessible selectors (role, label, text).
|
|
30
|
+
- Assert on visible outcomes (text content, URL, element state).
|
|
31
|
+
- Handle async loading (wait for network idle, element visibility).
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### For API E2E
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
- Set up auth headers/tokens.
|
|
38
|
+
- Make requests in the order a real client would.
|
|
39
|
+
- Assert on status codes, response bodies, and side effects.
|
|
40
|
+
- Clean up test data.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
4. **Add robustness:**
|
|
44
|
+
- Use data-testid or accessible selectors, not brittle CSS selectors.
|
|
45
|
+
- Add proper waits instead of fixed timeouts.
|
|
46
|
+
- Handle flakiness: retry logic, deterministic test data.
|
|
47
|
+
- Set up and tear down test state.
|
|
48
|
+
|
|
49
|
+
5. **Run the test** to verify it passes.
|
|
50
|
+
|
|
51
|
+
## Test Structure
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
describe('User flow: <flow name>')
|
|
55
|
+
before: Set up preconditions (login, seed data)
|
|
56
|
+
test: Step-by-step user actions with assertions
|
|
57
|
+
after: Clean up (delete test data, logout)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Guidelines
|
|
61
|
+
|
|
62
|
+
- E2E tests should mirror real user behavior — interact via the UI, not internal APIs.
|
|
63
|
+
- Keep E2E tests focused on critical paths (login, checkout, core CRUD).
|
|
64
|
+
- Use accessible selectors: `getByRole`, `getByLabel`, `getByText` over CSS.
|
|
65
|
+
- Isolate test data — don't depend on shared mutable state.
|
|
66
|
+
- E2E tests are slow; keep the suite lean. Test edge cases in unit tests.
|
|
67
|
+
- For flaky tests, add retry annotations rather than arbitrary sleeps.
|
|
68
|
+
- Include visual regression snapshots for UI-critical flows if the framework supports it.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eng-spec
|
|
3
|
+
description: "Generate an Engineering Specification. Use when the user says /eng-spec, asks to create a technical spec, engineering spec, system design document, or translate a PRD into a technical plan. Triggers: eng-spec, engineering spec, technical spec, system design, technical design, architecture spec."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Engineering Specification
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Generate a detailed engineering specification that translates product requirements into a concrete technical plan. The spec gives engineers a clear blueprint for implementation, covering architecture, data models, APIs, and operational concerns.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- After a PRD has been approved and engineering work is about to begin
|
|
15
|
+
- When a technical approach needs to be documented for review
|
|
16
|
+
- When onboarding engineers to an existing system's design
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
- **Feature or system name**: What is being specified
|
|
21
|
+
- **Product requirements or PRD**: The "what" that this spec addresses
|
|
22
|
+
- **Technical context**: Existing stack, services, constraints (optional but helpful)
|
|
23
|
+
- **Scale expectations**: Expected load, data volume, user count (optional)
|
|
24
|
+
|
|
25
|
+
## Output Format
|
|
26
|
+
|
|
27
|
+
Produce a markdown document with the following sections:
|
|
28
|
+
|
|
29
|
+
### 1. System Overview
|
|
30
|
+
A brief description of what the system or feature does and how it fits into the broader architecture. Include a high-level diagram description if helpful.
|
|
31
|
+
|
|
32
|
+
### 2. Architecture Decisions
|
|
33
|
+
List key technical decisions using the format:
|
|
34
|
+
- **Decision**: What was decided
|
|
35
|
+
- **Rationale**: Why this approach was chosen
|
|
36
|
+
- **Alternatives considered**: What else was evaluated and why it was rejected
|
|
37
|
+
|
|
38
|
+
### 3. Data Models
|
|
39
|
+
Define the core entities, their fields, types, and relationships. Use table format:
|
|
40
|
+
|
|
41
|
+
| Field | Type | Required | Description |
|
|
42
|
+
|-------|------|----------|-------------|
|
|
43
|
+
|
|
44
|
+
Include notes on indexing, constraints, and migration from existing schemas.
|
|
45
|
+
|
|
46
|
+
### 4. API Contracts
|
|
47
|
+
For each endpoint or interface, specify:
|
|
48
|
+
- Method and path (or function signature)
|
|
49
|
+
- Request parameters and body schema
|
|
50
|
+
- Response schema with status codes
|
|
51
|
+
- Authentication and authorization requirements
|
|
52
|
+
- Rate limiting or usage constraints
|
|
53
|
+
|
|
54
|
+
### 5. Error Handling
|
|
55
|
+
Define the error strategy:
|
|
56
|
+
- Error categories and codes
|
|
57
|
+
- Retry behavior and idempotency
|
|
58
|
+
- User-facing vs. internal error messages
|
|
59
|
+
- Logging and alerting requirements
|
|
60
|
+
|
|
61
|
+
### 6. Testing Strategy
|
|
62
|
+
Outline the testing approach:
|
|
63
|
+
- **Unit tests**: Key logic to cover
|
|
64
|
+
- **Integration tests**: Service boundaries to validate
|
|
65
|
+
- **End-to-end tests**: Critical user flows
|
|
66
|
+
- **Performance tests**: Load and latency benchmarks
|
|
67
|
+
|
|
68
|
+
### 7. Migration Plan
|
|
69
|
+
If this changes existing systems:
|
|
70
|
+
- Step-by-step migration sequence
|
|
71
|
+
- Data backfill requirements
|
|
72
|
+
- Feature flag strategy
|
|
73
|
+
- Rollback procedure
|
|
74
|
+
|
|
75
|
+
### 8. Security Considerations
|
|
76
|
+
Address authentication, authorization, data encryption, input validation, and any compliance requirements.
|
|
77
|
+
|
|
78
|
+
### 9. Open Questions and Risks
|
|
79
|
+
List unresolved technical questions and identified risks with proposed mitigations.
|
|
80
|
+
|
|
81
|
+
## Example
|
|
82
|
+
|
|
83
|
+
**Input**: "We need an eng spec for the PDF export feature described in the PRD. Our stack is Node.js, PostgreSQL, and AWS."
|
|
84
|
+
|
|
85
|
+
**Output**: A full engineering spec covering the architecture (async job queue with S3 storage for generated PDFs), data models (ExportJob, ExportTemplate tables), API contracts (POST /exports to trigger, GET /exports/:id to poll status, GET /exports/:id/download for retrieval), error handling (retry failed renders up to 3 times, notify user on permanent failure), testing strategy (unit tests for template rendering, integration tests for the job pipeline, load tests for concurrent generation), and migration plan (new tables, no schema changes to existing).
|
|
86
|
+
|
|
87
|
+
## Guidelines
|
|
88
|
+
|
|
89
|
+
- Be precise about data types, constraints, and expected values
|
|
90
|
+
- Separate the "happy path" from edge cases and error flows
|
|
91
|
+
- Include enough detail for an engineer to implement without ambiguity
|
|
92
|
+
- Call out dependencies on other teams or services explicitly
|
|
93
|
+
- Keep security and observability as first-class concerns, not afterthoughts
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: envcheck
|
|
3
|
+
description: "Check environment setup, dependencies, and configuration for issues. Use when the user says /envcheck, asks to verify their environment, diagnose setup issues, check prerequisites, or troubleshoot configuration problems. Triggers: envcheck, environment check, setup check, verify setup, check config, prerequisites, system requirements, doctor, health check."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Environment Check
|
|
7
|
+
|
|
8
|
+
Diagnose environment setup, dependencies, and configuration.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Detect the project type** from manifest files and directory structure.
|
|
13
|
+
|
|
14
|
+
2. **Run checks by category:**
|
|
15
|
+
|
|
16
|
+
### Runtime & Tools
|
|
17
|
+
- Language version: `node -v`, `python3 --version`, `go version`, `rustc --version`, `java -version`.
|
|
18
|
+
- Package manager: `npm -v`, `yarn -v`, `pnpm -v`, `pip --version`, `cargo --version`.
|
|
19
|
+
- Required CLI tools: `git`, `docker`, `gh`, framework CLIs.
|
|
20
|
+
- Compare against version requirements in `.nvmrc`, `.python-version`, `.tool-versions`, `engines` field, etc.
|
|
21
|
+
|
|
22
|
+
### Dependencies
|
|
23
|
+
- Are dependencies installed? Check for `node_modules/`, `venv/`, `vendor/`.
|
|
24
|
+
- Are lockfiles up to date? Compare `package.json` vs `package-lock.json` timestamps.
|
|
25
|
+
- Any missing native dependencies? (e.g., `sharp`, `bcrypt`, `psycopg2`).
|
|
26
|
+
|
|
27
|
+
### Configuration
|
|
28
|
+
- Required environment variables: scan `.env.example`, `.env.template`, or code for `process.env.*`, `os.environ.*`.
|
|
29
|
+
- Compare against actual `.env` file — report missing variables.
|
|
30
|
+
- Config file validity: JSON/YAML syntax, required fields.
|
|
31
|
+
|
|
32
|
+
### Services
|
|
33
|
+
- Database connectivity: check if expected port is open (`pg`, `mysql`, `redis`, `mongo`).
|
|
34
|
+
- Docker: `docker compose ps` if `docker-compose.yml` exists.
|
|
35
|
+
- Required services running.
|
|
36
|
+
|
|
37
|
+
### Permissions & Paths
|
|
38
|
+
- File permissions on scripts, SSH keys.
|
|
39
|
+
- PATH includes required directories.
|
|
40
|
+
- Write permissions on output directories.
|
|
41
|
+
|
|
42
|
+
3. **Present results as a checklist:**
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Environment Check Results
|
|
46
|
+
=========================
|
|
47
|
+
[PASS] Node.js v20.11.0 (required: >=18)
|
|
48
|
+
[PASS] npm v10.2.0
|
|
49
|
+
[PASS] Dependencies installed (node_modules exists)
|
|
50
|
+
[WARN] Lockfile is 3 days older than package.json — consider running npm install
|
|
51
|
+
[FAIL] Missing env var: DATABASE_URL (required by src/db.ts)
|
|
52
|
+
[FAIL] PostgreSQL not reachable on localhost:5432
|
|
53
|
+
[PASS] Docker running
|
|
54
|
+
[PASS] Git configured (user.name and user.email set)
|
|
55
|
+
|
|
56
|
+
3 passed, 1 warning, 2 failures
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Guidelines
|
|
60
|
+
|
|
61
|
+
- Use color-coded symbols: PASS, WARN, FAIL.
|
|
62
|
+
- For each failure, include the fix command or action needed.
|
|
63
|
+
- Run non-destructive checks only — never modify the environment.
|
|
64
|
+
- Check project-specific requirements first (from docs or config), then general tooling.
|
|
65
|
+
- If a `.env.example` exists, use it as the source of truth for required variables.
|