cast-code 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/LICENSE +21 -0
- package/README.md +217 -0
- package/dist/app.module.js +45 -0
- package/dist/app.module.js.map +1 -0
- package/dist/common/common.module.js +49 -0
- package/dist/common/common.module.js.map +1 -0
- package/dist/common/constants/index.js +105 -0
- package/dist/common/constants/index.js.map +1 -0
- package/dist/common/index.js +24 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/services/config.service.js +119 -0
- package/dist/common/services/config.service.js.map +1 -0
- package/dist/common/services/llm.service.js +56 -0
- package/dist/common/services/llm.service.js.map +1 -0
- package/dist/common/services/markdown-parser.service.js +101 -0
- package/dist/common/services/markdown-parser.service.js.map +1 -0
- package/dist/common/services/markdown-renderer.service.js +220 -0
- package/dist/common/services/markdown-renderer.service.js.map +1 -0
- package/dist/common/services/multi-llm.service.js +115 -0
- package/dist/common/services/multi-llm.service.js.map +1 -0
- package/dist/common/types/index.js +20 -0
- package/dist/common/types/index.js.map +1 -0
- package/dist/common/types/markdown.types.js +6 -0
- package/dist/common/types/markdown.types.js.map +1 -0
- package/dist/main.js +84 -0
- package/dist/main.js.map +1 -0
- package/dist/modules/agents/agents.module.js +43 -0
- package/dist/modules/agents/agents.module.js.map +1 -0
- package/dist/modules/agents/definitions/architect.md +35 -0
- package/dist/modules/agents/definitions/backend.md +43 -0
- package/dist/modules/agents/definitions/coder.md +34 -0
- package/dist/modules/agents/definitions/devops.md +42 -0
- package/dist/modules/agents/definitions/frontend.md +46 -0
- package/dist/modules/agents/definitions/reviewer.md +35 -0
- package/dist/modules/agents/definitions/tester.md +41 -0
- package/dist/modules/agents/index.js +23 -0
- package/dist/modules/agents/index.js.map +1 -0
- package/dist/modules/agents/services/agent-loader.service.js +150 -0
- package/dist/modules/agents/services/agent-loader.service.js.map +1 -0
- package/dist/modules/agents/services/agent-registry.service.js +108 -0
- package/dist/modules/agents/services/agent-registry.service.js.map +1 -0
- package/dist/modules/agents/types/agent.types.js +6 -0
- package/dist/modules/agents/types/agent.types.js.map +1 -0
- package/dist/modules/agents/types/index.js +20 -0
- package/dist/modules/agents/types/index.js.map +1 -0
- package/dist/modules/config/config.module.js +38 -0
- package/dist/modules/config/config.module.js.map +1 -0
- package/dist/modules/config/index.js +24 -0
- package/dist/modules/config/index.js.map +1 -0
- package/dist/modules/config/services/config-commands.service.js +405 -0
- package/dist/modules/config/services/config-commands.service.js.map +1 -0
- package/dist/modules/config/services/config-manager.service.js +175 -0
- package/dist/modules/config/services/config-manager.service.js.map +1 -0
- package/dist/modules/config/services/init-config.service.js +238 -0
- package/dist/modules/config/services/init-config.service.js.map +1 -0
- package/dist/modules/config/types/config.types.js +163 -0
- package/dist/modules/config/types/config.types.js.map +1 -0
- package/dist/modules/config/types/index.js +20 -0
- package/dist/modules/config/types/index.js.map +1 -0
- package/dist/modules/core/core.module.js +60 -0
- package/dist/modules/core/core.module.js.map +1 -0
- package/dist/modules/core/index.js +22 -0
- package/dist/modules/core/index.js.map +1 -0
- package/dist/modules/core/services/deep-agent.service.js +575 -0
- package/dist/modules/core/services/deep-agent.service.js.map +1 -0
- package/dist/modules/core/services/plan-mode.service.js +225 -0
- package/dist/modules/core/services/plan-mode.service.js.map +1 -0
- package/dist/modules/git/git.module.js +48 -0
- package/dist/modules/git/git.module.js.map +1 -0
- package/dist/modules/git/index.js +23 -0
- package/dist/modules/git/index.js.map +1 -0
- package/dist/modules/git/services/code-review.service.js +330 -0
- package/dist/modules/git/services/code-review.service.js.map +1 -0
- package/dist/modules/git/services/commit-generator.service.js +403 -0
- package/dist/modules/git/services/commit-generator.service.js.map +1 -0
- package/dist/modules/git/services/index.js +21 -0
- package/dist/modules/git/services/index.js.map +1 -0
- package/dist/modules/git/services/monorepo-detector.service.js +338 -0
- package/dist/modules/git/services/monorepo-detector.service.js.map +1 -0
- package/dist/modules/git/services/pr-generator.service.js +429 -0
- package/dist/modules/git/services/pr-generator.service.js.map +1 -0
- package/dist/modules/git/services/release-notes.service.js +426 -0
- package/dist/modules/git/services/release-notes.service.js.map +1 -0
- package/dist/modules/git/types/git.types.js +6 -0
- package/dist/modules/git/types/git.types.js.map +1 -0
- package/dist/modules/git/types/index.js +20 -0
- package/dist/modules/git/types/index.js.map +1 -0
- package/dist/modules/mcp/catalog/mcp-templates.js +606 -0
- package/dist/modules/mcp/catalog/mcp-templates.js.map +1 -0
- package/dist/modules/mcp/index.js +23 -0
- package/dist/modules/mcp/index.js.map +1 -0
- package/dist/modules/mcp/mcp.module.js +35 -0
- package/dist/modules/mcp/mcp.module.js.map +1 -0
- package/dist/modules/mcp/services/mcp-client.service.js +289 -0
- package/dist/modules/mcp/services/mcp-client.service.js.map +1 -0
- package/dist/modules/mcp/services/mcp-registry.service.js +197 -0
- package/dist/modules/mcp/services/mcp-registry.service.js.map +1 -0
- package/dist/modules/mcp/types/index.js +20 -0
- package/dist/modules/mcp/types/index.js.map +1 -0
- package/dist/modules/mcp/types/mcp.types.js +6 -0
- package/dist/modules/mcp/types/mcp.types.js.map +1 -0
- package/dist/modules/memory/index.js +23 -0
- package/dist/modules/memory/index.js.map +1 -0
- package/dist/modules/memory/memory.module.js +35 -0
- package/dist/modules/memory/memory.module.js.map +1 -0
- package/dist/modules/memory/services/memory-tools.service.js +78 -0
- package/dist/modules/memory/services/memory-tools.service.js.map +1 -0
- package/dist/modules/memory/services/memory.service.js +169 -0
- package/dist/modules/memory/services/memory.service.js.map +1 -0
- package/dist/modules/memory/types/index.js +20 -0
- package/dist/modules/memory/types/index.js.map +1 -0
- package/dist/modules/memory/types/memory.types.js +6 -0
- package/dist/modules/memory/types/memory.types.js.map +1 -0
- package/dist/modules/mentions/index.js +22 -0
- package/dist/modules/mentions/index.js.map +1 -0
- package/dist/modules/mentions/mentions.module.js +32 -0
- package/dist/modules/mentions/mentions.module.js.map +1 -0
- package/dist/modules/mentions/services/mentions.service.js +336 -0
- package/dist/modules/mentions/services/mentions.service.js.map +1 -0
- package/dist/modules/mentions/types/index.js +20 -0
- package/dist/modules/mentions/types/index.js.map +1 -0
- package/dist/modules/mentions/types/mention.types.js +19 -0
- package/dist/modules/mentions/types/mention.types.js.map +1 -0
- package/dist/modules/permissions/index.js +23 -0
- package/dist/modules/permissions/index.js.map +1 -0
- package/dist/modules/permissions/permissions.module.js +35 -0
- package/dist/modules/permissions/permissions.module.js.map +1 -0
- package/dist/modules/permissions/services/permission.service.js +269 -0
- package/dist/modules/permissions/services/permission.service.js.map +1 -0
- package/dist/modules/permissions/services/prompt.service.js +116 -0
- package/dist/modules/permissions/services/prompt.service.js.map +1 -0
- package/dist/modules/permissions/types/permission.types.js +32 -0
- package/dist/modules/permissions/types/permission.types.js.map +1 -0
- package/dist/modules/project/index.js +24 -0
- package/dist/modules/project/index.js.map +1 -0
- package/dist/modules/project/project.module.js +38 -0
- package/dist/modules/project/project.module.js.map +1 -0
- package/dist/modules/project/services/project-analyzer.service.js +1063 -0
- package/dist/modules/project/services/project-analyzer.service.js.map +1 -0
- package/dist/modules/project/services/project-context.service.js +62 -0
- package/dist/modules/project/services/project-context.service.js.map +1 -0
- package/dist/modules/project/services/project-loader.service.js +147 -0
- package/dist/modules/project/services/project-loader.service.js.map +1 -0
- package/dist/modules/project/types/index.js +20 -0
- package/dist/modules/project/types/index.js.map +1 -0
- package/dist/modules/project/types/project.types.js +6 -0
- package/dist/modules/project/types/project.types.js.map +1 -0
- package/dist/modules/repl/index.js +21 -0
- package/dist/modules/repl/index.js.map +1 -0
- package/dist/modules/repl/repl.module.js +66 -0
- package/dist/modules/repl/repl.module.js.map +1 -0
- package/dist/modules/repl/services/commands/agent-commands.service.js +196 -0
- package/dist/modules/repl/services/commands/agent-commands.service.js.map +1 -0
- package/dist/modules/repl/services/commands/git-commands.service.js +500 -0
- package/dist/modules/repl/services/commands/git-commands.service.js.map +1 -0
- package/dist/modules/repl/services/commands/mcp-commands.service.js +579 -0
- package/dist/modules/repl/services/commands/mcp-commands.service.js.map +1 -0
- package/dist/modules/repl/services/commands/project-commands.service.js +226 -0
- package/dist/modules/repl/services/commands/project-commands.service.js.map +1 -0
- package/dist/modules/repl/services/commands/repl-commands.service.js +254 -0
- package/dist/modules/repl/services/commands/repl-commands.service.js.map +1 -0
- package/dist/modules/repl/services/repl.service.js +647 -0
- package/dist/modules/repl/services/repl.service.js.map +1 -0
- package/dist/modules/repl/services/smart-input.js +544 -0
- package/dist/modules/repl/services/smart-input.js.map +1 -0
- package/dist/modules/repl/services/welcome-screen.service.js +117 -0
- package/dist/modules/repl/services/welcome-screen.service.js.map +1 -0
- package/dist/modules/repl/utils/prompts-with-esc.js +187 -0
- package/dist/modules/repl/utils/prompts-with-esc.js.map +1 -0
- package/dist/modules/repl/utils/theme.js +185 -0
- package/dist/modules/repl/utils/theme.js.map +1 -0
- package/dist/modules/skills/definitions/general/file-operations.md +60 -0
- package/dist/modules/skills/definitions/general/git-operations.md +59 -0
- package/dist/modules/skills/definitions/general/planning.md +86 -0
- package/dist/modules/skills/definitions/general/search.md +59 -0
- package/dist/modules/skills/definitions/specialized/api-design.md +85 -0
- package/dist/modules/skills/definitions/specialized/database-operations.md +78 -0
- package/dist/modules/skills/definitions/specialized/frontend-bootstrap.md +71 -0
- package/dist/modules/skills/definitions/specialized/react-patterns.md +77 -0
- package/dist/modules/skills/definitions/specialized/testing-strategies.md +79 -0
- package/dist/modules/skills/index.js +23 -0
- package/dist/modules/skills/index.js.map +1 -0
- package/dist/modules/skills/services/skill-loader.service.js +130 -0
- package/dist/modules/skills/services/skill-loader.service.js.map +1 -0
- package/dist/modules/skills/services/skill-registry.service.js +96 -0
- package/dist/modules/skills/services/skill-registry.service.js.map +1 -0
- package/dist/modules/skills/skills.module.js +38 -0
- package/dist/modules/skills/skills.module.js.map +1 -0
- package/dist/modules/skills/types/index.js +20 -0
- package/dist/modules/skills/types/index.js.map +1 -0
- package/dist/modules/skills/types/skill.types.js +6 -0
- package/dist/modules/skills/types/skill.types.js.map +1 -0
- package/dist/modules/tasks/index.js +24 -0
- package/dist/modules/tasks/index.js.map +1 -0
- package/dist/modules/tasks/services/plan-executor.service.js +199 -0
- package/dist/modules/tasks/services/plan-executor.service.js.map +1 -0
- package/dist/modules/tasks/services/plan-mode.service.js +118 -0
- package/dist/modules/tasks/services/plan-mode.service.js.map +1 -0
- package/dist/modules/tasks/services/plan-persistence.service.js +148 -0
- package/dist/modules/tasks/services/plan-persistence.service.js.map +1 -0
- package/dist/modules/tasks/services/task-management.service.js +255 -0
- package/dist/modules/tasks/services/task-management.service.js.map +1 -0
- package/dist/modules/tasks/services/task-tools.service.js +270 -0
- package/dist/modules/tasks/services/task-tools.service.js.map +1 -0
- package/dist/modules/tasks/tasks.module.js +49 -0
- package/dist/modules/tasks/tasks.module.js.map +1 -0
- package/dist/modules/tasks/types/task.types.js +21 -0
- package/dist/modules/tasks/types/task.types.js.map +1 -0
- package/dist/modules/tools/index.js +24 -0
- package/dist/modules/tools/index.js.map +1 -0
- package/dist/modules/tools/services/filesystem-tools.service.js +450 -0
- package/dist/modules/tools/services/filesystem-tools.service.js.map +1 -0
- package/dist/modules/tools/services/search-tools.service.js +63 -0
- package/dist/modules/tools/services/search-tools.service.js.map +1 -0
- package/dist/modules/tools/services/shell-tools.service.js +194 -0
- package/dist/modules/tools/services/shell-tools.service.js.map +1 -0
- package/dist/modules/tools/services/tools-registry.service.js +83 -0
- package/dist/modules/tools/services/tools-registry.service.js.map +1 -0
- package/dist/modules/tools/tools.module.js +46 -0
- package/dist/modules/tools/tools.module.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: file-operations
|
|
3
|
+
description: Read, write, and edit files in the filesystem
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- write_file
|
|
7
|
+
- edit_file
|
|
8
|
+
- glob
|
|
9
|
+
- ls
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# File Operations — Domain Knowledge
|
|
13
|
+
|
|
14
|
+
This skill teaches you how to work with files effectively. Study this to learn patterns, avoid mistakes, and make better decisions.
|
|
15
|
+
|
|
16
|
+
## Core Principle: Read → Understand → Edit → Verify
|
|
17
|
+
|
|
18
|
+
Every file operation follows this cycle. NEVER skip steps.
|
|
19
|
+
|
|
20
|
+
## Tool Mastery
|
|
21
|
+
|
|
22
|
+
### read_file
|
|
23
|
+
- **When**: Before ANY edit, to answer questions, to verify changes
|
|
24
|
+
- **Pattern**: Read the whole file first, then specific sections with offset/limit for large files
|
|
25
|
+
- **Anti-pattern**: Reading 5 lines of a 500-line file and guessing the rest
|
|
26
|
+
|
|
27
|
+
### write_file
|
|
28
|
+
- **When**: Creating NEW files only. Never for existing files.
|
|
29
|
+
- **Anti-pattern**: Using write_file on existing files (overwrites everything — use edit_file)
|
|
30
|
+
|
|
31
|
+
### edit_file
|
|
32
|
+
- **When**: Modifying existing files with precise string replacement
|
|
33
|
+
- **Critical**: The `old_string` must be UNIQUE in the file. Include 2-3 surrounding lines for uniqueness.
|
|
34
|
+
- **Anti-pattern**: Providing just `const x = 1` when there are 5 similar lines
|
|
35
|
+
- **Tip**: Use `replace_all=true` ONLY when renaming across the entire file
|
|
36
|
+
|
|
37
|
+
### glob
|
|
38
|
+
- **When**: Finding files by name pattern. Always the FIRST step in discovery.
|
|
39
|
+
- **Key patterns**: `**/*.ts`, `src/**/*.service.ts`, `*.{js,ts,jsx,tsx}`
|
|
40
|
+
|
|
41
|
+
### ls
|
|
42
|
+
- **When**: Quick directory overview, understanding project structure
|
|
43
|
+
|
|
44
|
+
## Decision Framework
|
|
45
|
+
|
|
46
|
+
| Situation | Tool | Why |
|
|
47
|
+
|-----------|------|-----|
|
|
48
|
+
| What's in this file? | read_file | Direct content access |
|
|
49
|
+
| Find all test files | glob `**/*.test.ts` | Pattern matching |
|
|
50
|
+
| Fix this line | read_file → edit_file | Must read first |
|
|
51
|
+
| Create a new util | write_file | New file creation |
|
|
52
|
+
| Find where X is defined | glob → grep → read_file | Progressive narrowing |
|
|
53
|
+
|
|
54
|
+
## Common Mistakes
|
|
55
|
+
|
|
56
|
+
1. **Editing without reading** — You WILL get the old_string wrong
|
|
57
|
+
2. **Assuming file structure** — Always verify with ls or glob first
|
|
58
|
+
3. **Overwriting with write_file** — Use edit_file for existing files
|
|
59
|
+
4. **Non-unique old_string** — Add more context lines to make it unique
|
|
60
|
+
5. **Not verifying after edit** — Always re-read to confirm changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-operations
|
|
3
|
+
description: Git version control operations
|
|
4
|
+
tools:
|
|
5
|
+
- shell
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Git Operations — Domain Knowledge
|
|
9
|
+
|
|
10
|
+
This skill teaches you how to work with Git safely and effectively. Study this to learn safe workflows, commit conventions, and recovery techniques.
|
|
11
|
+
|
|
12
|
+
## Core Principle: Check → Stage → Commit → Verify
|
|
13
|
+
|
|
14
|
+
Always know the state before changing it.
|
|
15
|
+
|
|
16
|
+
## Safe Workflow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. git status # What's the current state?
|
|
20
|
+
2. git diff # What exactly changed?
|
|
21
|
+
3. git add <specific files> # Stage only what's needed
|
|
22
|
+
4. git diff --staged # Verify what's being committed
|
|
23
|
+
5. git commit -m "clear message" # Commit with intent
|
|
24
|
+
6. git status # Verify clean state
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commit Message Convention
|
|
28
|
+
|
|
29
|
+
Types: feat, fix, refactor, docs, test, chore, style, perf
|
|
30
|
+
Rule: First line < 50 chars, imperative mood ("Add feature" not "Added feature")
|
|
31
|
+
|
|
32
|
+
## DANGER ZONE — Commands That Need User Confirmation
|
|
33
|
+
|
|
34
|
+
| Command | Risk |
|
|
35
|
+
|---------|------|
|
|
36
|
+
| `git push --force` | Overwrites remote history |
|
|
37
|
+
| `git reset --hard` | Destroys local changes |
|
|
38
|
+
| `git clean -f` | Deletes untracked files |
|
|
39
|
+
| `git branch -D` | Force-deletes a branch |
|
|
40
|
+
| `git checkout .` | Discards all unstaged changes |
|
|
41
|
+
|
|
42
|
+
## Safe Commands (No Confirmation Needed)
|
|
43
|
+
|
|
44
|
+
- `git status`, `git log`, `git diff`, `git branch`
|
|
45
|
+
- `git add <specific_file>` (not `git add -A`)
|
|
46
|
+
- `git commit -m "message"` (with proper message)
|
|
47
|
+
- `git stash` / `git stash pop`
|
|
48
|
+
- `git fetch`
|
|
49
|
+
|
|
50
|
+
## Recovery Techniques
|
|
51
|
+
|
|
52
|
+
| Problem | Solution |
|
|
53
|
+
|---------|----------|
|
|
54
|
+
| Wrong commit message | `git commit --amend` (if not pushed) |
|
|
55
|
+
| Committed wrong file | `git reset HEAD~1` (soft) → re-stage |
|
|
56
|
+
| Need to undo last commit | `git reset --soft HEAD~1` |
|
|
57
|
+
| Accidentally deleted file | `git checkout -- <file>` |
|
|
58
|
+
| Find when bug introduced | `git bisect start` |
|
|
59
|
+
| See who changed a line | `git blame <file>` |
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: planning
|
|
3
|
+
description: Task planning and decomposition
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- glob
|
|
7
|
+
- enter_plan_mode
|
|
8
|
+
- exit_plan_mode
|
|
9
|
+
- task_create
|
|
10
|
+
- task_update
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Planning — Domain Knowledge
|
|
14
|
+
|
|
15
|
+
This skill teaches you how to plan complex work before executing it. Study this to learn when to plan, how to decompose tasks, and how to create actionable plans.
|
|
16
|
+
|
|
17
|
+
## Core Principle: Think Before You Act
|
|
18
|
+
|
|
19
|
+
The time you spend planning saves 5x the time you'd waste fixing mistakes.
|
|
20
|
+
|
|
21
|
+
## When to Plan (Decision Framework)
|
|
22
|
+
|
|
23
|
+
| Situation | Plan needed? | Why |
|
|
24
|
+
|-----------|-------------|-----|
|
|
25
|
+
| Fix a typo | No | Single, obvious change |
|
|
26
|
+
| Add a function to existing file | No | Clear scope |
|
|
27
|
+
| Add a new feature (3+ files) | **YES** | Multiple touchpoints |
|
|
28
|
+
| Refactor a module | **YES** | Ripple effects |
|
|
29
|
+
| Change an API contract | **YES** | Breaking changes possible |
|
|
30
|
+
| Debug a complex bug | Maybe | Investigate first, plan the fix |
|
|
31
|
+
| User says "implement X" where X is vague | **YES** | Need to clarify scope |
|
|
32
|
+
|
|
33
|
+
## Planning Process
|
|
34
|
+
|
|
35
|
+
### Phase 1: Discovery (BEFORE plan_mode)
|
|
36
|
+
1. `glob` to understand project structure
|
|
37
|
+
2. `read_file` key files (entry points, configs, relevant modules)
|
|
38
|
+
3. `grep` to find related code and patterns
|
|
39
|
+
4. Identify ALL files that will be touched
|
|
40
|
+
|
|
41
|
+
### Phase 2: Plan (IN plan_mode)
|
|
42
|
+
1. `enter_plan_mode` — signals you're planning, not executing
|
|
43
|
+
2. List every file to create/modify with specific changes
|
|
44
|
+
3. Order by dependency (don't modify callers before callees)
|
|
45
|
+
4. Identify risks and edge cases
|
|
46
|
+
5. Define verification steps
|
|
47
|
+
6. `exit_plan_mode` — present plan for user approval
|
|
48
|
+
|
|
49
|
+
### Phase 3: Execute (AFTER approval)
|
|
50
|
+
1. Create tasks with `task_create` for each step
|
|
51
|
+
2. Execute sequentially, marking tasks complete
|
|
52
|
+
3. Verify after each step
|
|
53
|
+
4. Run tests at the end
|
|
54
|
+
|
|
55
|
+
## Plan Template
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
## Goal
|
|
59
|
+
[What we're achieving]
|
|
60
|
+
|
|
61
|
+
## Changes
|
|
62
|
+
1. **file1.ts** — [what changes and why]
|
|
63
|
+
2. **file2.ts** — [what changes and why]
|
|
64
|
+
|
|
65
|
+
## Order of Operations
|
|
66
|
+
1. First: [foundation changes]
|
|
67
|
+
2. Then: [dependent changes]
|
|
68
|
+
3. Finally: [verification]
|
|
69
|
+
|
|
70
|
+
## Risks
|
|
71
|
+
- [What could go wrong and mitigation]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Task Decomposition Rules
|
|
75
|
+
|
|
76
|
+
### Good tasks are:
|
|
77
|
+
- **Specific**: "Add validateEmail function to utils/validation.ts"
|
|
78
|
+
- **Independent**: Can be verified in isolation when possible
|
|
79
|
+
- **Small**: 1-2 file changes per task
|
|
80
|
+
- **Ordered**: Dependencies are explicit
|
|
81
|
+
|
|
82
|
+
### Anti-patterns:
|
|
83
|
+
- "Implement everything" (too vague)
|
|
84
|
+
- "Fix the code" (what code? what fix?)
|
|
85
|
+
- Tasks that can't be verified
|
|
86
|
+
- Skipping the planning step for complex work
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description: Search for patterns and content in the codebase
|
|
4
|
+
tools:
|
|
5
|
+
- grep
|
|
6
|
+
- glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Search — Domain Knowledge
|
|
10
|
+
|
|
11
|
+
This skill teaches you how to find anything in a codebase efficiently. Study this to learn search strategies and progressive narrowing techniques.
|
|
12
|
+
|
|
13
|
+
## Core Principle: Broad → Narrow → Precise
|
|
14
|
+
|
|
15
|
+
Never start with a narrow search. Cast a wide net first, then refine.
|
|
16
|
+
|
|
17
|
+
## Search Strategy Matrix
|
|
18
|
+
|
|
19
|
+
| I need to find... | First try | Fallback |
|
|
20
|
+
|-------------------|-----------|----------|
|
|
21
|
+
| A file by name | `glob **/*filename*` | `glob **/*.ext` |
|
|
22
|
+
| A function definition | `grep "function name\|const name"` | Per-file type search |
|
|
23
|
+
| Where X is used | `grep "X"` files_with_matches | `grep "import.*X"` |
|
|
24
|
+
| A config value | `glob **/*.{json,yaml,toml,env}` | `grep "KEY_NAME"` |
|
|
25
|
+
| Dead code | `grep "export.*FuncName"` then `grep "FuncName"` (compare counts) | |
|
|
26
|
+
|
|
27
|
+
## Regex Patterns Every Developer Needs
|
|
28
|
+
|
|
29
|
+
### Finding Definitions
|
|
30
|
+
- `class\s+ClassName` — Class definition
|
|
31
|
+
- `function\s+funcName` — Function declaration
|
|
32
|
+
- `const\s+funcName\s*=` — Arrow function
|
|
33
|
+
- `interface\s+InterfaceName` — TypeScript interface
|
|
34
|
+
- `export\s+(default\s+)?` — Exports
|
|
35
|
+
|
|
36
|
+
### Finding Usage
|
|
37
|
+
- `import.*{.*Name.*}.*from` — Named imports
|
|
38
|
+
- `new\s+ClassName` — Instantiation
|
|
39
|
+
- `Name\(` — Function calls
|
|
40
|
+
|
|
41
|
+
### Finding Problems
|
|
42
|
+
- `TODO|FIXME|HACK|XXX` — Developer notes
|
|
43
|
+
- `console\.(log|error|warn)` — Debug output
|
|
44
|
+
- `\.catch\(\s*\)` — Empty catch blocks
|
|
45
|
+
|
|
46
|
+
## Progressive Narrowing Technique
|
|
47
|
+
|
|
48
|
+
1. **Discover**: `glob "**/*.ts"` → understand the file landscape
|
|
49
|
+
2. **Locate**: `grep "pattern"` with `output_mode=files_with_matches` → find candidate files
|
|
50
|
+
3. **Context**: `grep "pattern"` with `context_lines=5` on specific files → see surrounding code
|
|
51
|
+
4. **Read**: `read_file` the most promising candidates → full understanding
|
|
52
|
+
|
|
53
|
+
## Common Mistakes
|
|
54
|
+
|
|
55
|
+
1. **Too specific too early** — Search for parts of the string, not the exact thing
|
|
56
|
+
2. **Wrong file types** — Search `.ts` AND `.tsx` and `.js`
|
|
57
|
+
3. **Case sensitivity** — Always consider case-insensitive first
|
|
58
|
+
4. **Giving up after one miss** — Try synonyms, partial matches, different patterns
|
|
59
|
+
5. **Not using context_lines** — A match without context is often useless
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-design
|
|
3
|
+
description: REST and GraphQL API design patterns
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- write_file
|
|
7
|
+
- edit_file
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# API Design — Domain Knowledge
|
|
11
|
+
|
|
12
|
+
This skill teaches you how to design clean, consistent APIs. Study this to learn REST conventions, error handling patterns, and API best practices.
|
|
13
|
+
|
|
14
|
+
## REST Conventions
|
|
15
|
+
|
|
16
|
+
### HTTP Methods
|
|
17
|
+
| Method | Purpose | Idempotent | Body |
|
|
18
|
+
|--------|---------|------------|------|
|
|
19
|
+
| GET | Read | Yes | No |
|
|
20
|
+
| POST | Create | No | Yes |
|
|
21
|
+
| PUT | Replace | Yes | Yes |
|
|
22
|
+
| PATCH | Partial update | Yes | Yes |
|
|
23
|
+
| DELETE | Remove | Yes | No |
|
|
24
|
+
|
|
25
|
+
### URL Structure
|
|
26
|
+
- `/users` — Collection (GET all, POST create)
|
|
27
|
+
- `/users/:id` — Single resource (GET, PUT, PATCH, DELETE)
|
|
28
|
+
- `/users/:id/posts` — Nested resource
|
|
29
|
+
- Never: `/getUser`, `/createUser` (verbs in URLs)
|
|
30
|
+
|
|
31
|
+
### Status Codes (Know These)
|
|
32
|
+
| Code | Meaning | When |
|
|
33
|
+
|------|---------|------|
|
|
34
|
+
| 200 | OK | Successful GET, PUT, PATCH |
|
|
35
|
+
| 201 | Created | Successful POST |
|
|
36
|
+
| 204 | No Content | Successful DELETE |
|
|
37
|
+
| 400 | Bad Request | Validation failure |
|
|
38
|
+
| 401 | Unauthorized | Missing/invalid auth |
|
|
39
|
+
| 403 | Forbidden | Valid auth, no permission |
|
|
40
|
+
| 404 | Not Found | Resource doesn't exist |
|
|
41
|
+
| 409 | Conflict | Duplicate, version mismatch |
|
|
42
|
+
| 422 | Unprocessable | Valid syntax, invalid semantics |
|
|
43
|
+
| 500 | Server Error | Unexpected failure |
|
|
44
|
+
|
|
45
|
+
## Response Envelope Pattern
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"data": { ... },
|
|
50
|
+
"meta": { "page": 1, "totalPages": 10, "total": 100 },
|
|
51
|
+
"errors": []
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Error Response Pattern
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"error": {
|
|
60
|
+
"code": "VALIDATION_FAILED",
|
|
61
|
+
"message": "Human-readable description",
|
|
62
|
+
"details": [
|
|
63
|
+
{ "field": "email", "message": "Invalid format" }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## API Design Checklist
|
|
70
|
+
|
|
71
|
+
1. **Consistent naming** — plural nouns, kebab-case
|
|
72
|
+
2. **Pagination** — offset/limit or cursor-based for lists
|
|
73
|
+
3. **Filtering** — query params: `?status=active&sort=-created`
|
|
74
|
+
4. **Versioning** — URL path `/api/v1/` (simplest)
|
|
75
|
+
5. **Auth** — Bearer token in Authorization header
|
|
76
|
+
6. **Rate limiting** — Return 429 with Retry-After header
|
|
77
|
+
7. **CORS** — Configure allowed origins explicitly
|
|
78
|
+
|
|
79
|
+
## Common Mistakes
|
|
80
|
+
|
|
81
|
+
1. **Verbs in URLs** — Use HTTP methods instead
|
|
82
|
+
2. **Inconsistent response format** — Always same envelope
|
|
83
|
+
3. **200 for errors** — Use proper status codes
|
|
84
|
+
4. **No pagination** — Always paginate collections
|
|
85
|
+
5. **Leaking internals** — Don't expose DB IDs or stack traces
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-operations
|
|
3
|
+
description: Database design and query optimization
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- write_file
|
|
7
|
+
- edit_file
|
|
8
|
+
- shell
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Database Operations — Domain Knowledge
|
|
12
|
+
|
|
13
|
+
This skill teaches you database design, query optimization, and safe migration practices. Study this to make good data modeling decisions.
|
|
14
|
+
|
|
15
|
+
## Schema Design Principles
|
|
16
|
+
|
|
17
|
+
### Normalization Rules
|
|
18
|
+
- **1NF**: Atomic values, no repeating groups
|
|
19
|
+
- **2NF**: No partial dependencies on composite keys
|
|
20
|
+
- **3NF**: No transitive dependencies
|
|
21
|
+
|
|
22
|
+
### When to Denormalize
|
|
23
|
+
| Situation | Denormalize? | Technique |
|
|
24
|
+
|-----------|-------------|-----------|
|
|
25
|
+
| Read-heavy, write-rare | Yes | Materialized view / computed column |
|
|
26
|
+
| Reporting/analytics | Yes | Star schema / denormalized table |
|
|
27
|
+
| Real-time dashboard | Yes | Pre-aggregated cache |
|
|
28
|
+
| OLTP with consistency needs | No | Keep normalized |
|
|
29
|
+
|
|
30
|
+
## Query Optimization
|
|
31
|
+
|
|
32
|
+
### Indexing Decision Framework
|
|
33
|
+
| Query pattern | Index type |
|
|
34
|
+
|---------------|------------|
|
|
35
|
+
| `WHERE col = value` | B-tree index on col |
|
|
36
|
+
| `WHERE col1 = X AND col2 = Y` | Composite index (col1, col2) |
|
|
37
|
+
| `WHERE col LIKE 'prefix%'` | B-tree (prefix only) |
|
|
38
|
+
| `ORDER BY col` | Index on col |
|
|
39
|
+
| `WHERE col IN (...)` | B-tree index on col |
|
|
40
|
+
| Full-text search | GIN / Full-text index |
|
|
41
|
+
|
|
42
|
+
### Performance Diagnosis
|
|
43
|
+
1. `EXPLAIN ANALYZE` the slow query
|
|
44
|
+
2. Look for: Seq Scan (missing index), Nested Loop (N+1), Sort (missing index)
|
|
45
|
+
3. Add index → re-explain → verify improvement
|
|
46
|
+
|
|
47
|
+
### Common Performance Issues
|
|
48
|
+
| Problem | Symptom | Fix |
|
|
49
|
+
|---------|---------|-----|
|
|
50
|
+
| N+1 queries | Many identical queries | Eager loading / JOIN |
|
|
51
|
+
| Missing index | Seq Scan on large table | Add appropriate index |
|
|
52
|
+
| Over-fetching | SELECT * on wide table | Select specific columns |
|
|
53
|
+
| Lock contention | Timeout errors | Shorter transactions |
|
|
54
|
+
|
|
55
|
+
## Migration Safety
|
|
56
|
+
|
|
57
|
+
### Safe Operations (can run anytime)
|
|
58
|
+
- Add nullable column
|
|
59
|
+
- Add index CONCURRENTLY
|
|
60
|
+
- Create new table
|
|
61
|
+
- Add constraint with NOT VALID
|
|
62
|
+
|
|
63
|
+
### Dangerous Operations (need careful planning)
|
|
64
|
+
| Operation | Risk | Safe approach |
|
|
65
|
+
|-----------|------|---------------|
|
|
66
|
+
| Drop column | Data loss | Deploy code first, drop later |
|
|
67
|
+
| Rename column | Breaks queries | Add new, migrate, drop old |
|
|
68
|
+
| Change type | Data corruption | Add new column, backfill, swap |
|
|
69
|
+
| Add NOT NULL | Fails on existing nulls | Backfill first, then constrain |
|
|
70
|
+
|
|
71
|
+
## ORM vs Raw SQL
|
|
72
|
+
|
|
73
|
+
| Use ORM when... | Use Raw SQL when... |
|
|
74
|
+
|-----------------|---------------------|
|
|
75
|
+
| Standard CRUD | Complex aggregations |
|
|
76
|
+
| Migrations | Performance-critical queries |
|
|
77
|
+
| Type safety needed | Database-specific features |
|
|
78
|
+
| Rapid prototyping | Bulk operations |
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-bootstrap
|
|
3
|
+
description: Bootstrap full frontend projects from Figma and product requirements
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- write_file
|
|
7
|
+
- edit_file
|
|
8
|
+
- glob
|
|
9
|
+
- grep
|
|
10
|
+
- ls
|
|
11
|
+
- shell
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Frontend Bootstrap from Figma
|
|
15
|
+
|
|
16
|
+
Use this skill when the goal is to turn a prototype into a complete frontend foundation quickly.
|
|
17
|
+
|
|
18
|
+
## Outcome Targets
|
|
19
|
+
|
|
20
|
+
- Deliver a runnable frontend scaffold with routing, layout, and core pages.
|
|
21
|
+
- Generate reusable UI primitives before page-specific components.
|
|
22
|
+
- Apply consistent styling through design tokens and theme variables.
|
|
23
|
+
- Keep architecture ready for backend integration.
|
|
24
|
+
|
|
25
|
+
## Figma-to-Code Workflow
|
|
26
|
+
|
|
27
|
+
1. Map screens and flows:
|
|
28
|
+
- Identify all top-level screens in the prototype.
|
|
29
|
+
- Capture navigation structure and page hierarchy.
|
|
30
|
+
- Note critical interaction states (loading, empty, error, success).
|
|
31
|
+
|
|
32
|
+
2. Extract design system:
|
|
33
|
+
- Color palette, typography scale, spacing scale, border radius, shadow set.
|
|
34
|
+
- Component variants for button, input, select, table, modal, card, badge, tabs.
|
|
35
|
+
- Breakpoints and responsive behavior.
|
|
36
|
+
|
|
37
|
+
3. Plan project structure:
|
|
38
|
+
- `src/app` or `src/pages` for routes/screens.
|
|
39
|
+
- `src/components/ui` for primitives.
|
|
40
|
+
- `src/components/features` for domain components.
|
|
41
|
+
- `src/styles` for tokens/theme/global styles.
|
|
42
|
+
- `src/lib` for utilities and configuration.
|
|
43
|
+
|
|
44
|
+
4. Generate in layers:
|
|
45
|
+
- First: tokens/theme + base layout + routes.
|
|
46
|
+
- Second: UI primitives and variants.
|
|
47
|
+
- Third: screen composition using primitives.
|
|
48
|
+
- Fourth: stubs for API services and typed contracts.
|
|
49
|
+
|
|
50
|
+
5. Validate consistency:
|
|
51
|
+
- Verify token usage over hardcoded values.
|
|
52
|
+
- Verify responsive layout across mobile/tablet/desktop.
|
|
53
|
+
- Verify accessibility basics: semantic roles, labels, focus, contrast.
|
|
54
|
+
|
|
55
|
+
## Heuristics for Common Elements
|
|
56
|
+
|
|
57
|
+
- Table-heavy screens:
|
|
58
|
+
- Create reusable `DataTable` with column config, pagination, loading and empty states.
|
|
59
|
+
- Form-heavy screens:
|
|
60
|
+
- Create form field wrappers with validation message and helper text support.
|
|
61
|
+
- Modal-heavy flows:
|
|
62
|
+
- Standardize modal shell, close behavior, keyboard handling, and action footer.
|
|
63
|
+
- Dashboard screens:
|
|
64
|
+
- Prioritize layout grid and card primitives before chart wiring.
|
|
65
|
+
|
|
66
|
+
## Integration Readiness
|
|
67
|
+
|
|
68
|
+
- Keep API and data fetching behind dedicated service/hooks layers.
|
|
69
|
+
- Use mock data adapters initially to unblock UI.
|
|
70
|
+
- Preserve clear boundaries so backend integration only replaces adapters and endpoints.
|
|
71
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-patterns
|
|
3
|
+
description: React component patterns and best practices
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- write_file
|
|
7
|
+
- edit_file
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# React Patterns — Domain Knowledge
|
|
11
|
+
|
|
12
|
+
This skill teaches you React best practices, component architecture, and performance patterns. Study this to write idiomatic React code.
|
|
13
|
+
|
|
14
|
+
## Component Architecture Decision Tree
|
|
15
|
+
|
|
16
|
+
| Need | Pattern | Why |
|
|
17
|
+
|------|---------|-----|
|
|
18
|
+
| Simple display | Functional component | No state needed |
|
|
19
|
+
| Local state | useState/useReducer | Component-level reactivity |
|
|
20
|
+
| Shared state | Context + useContext | Cross-component without prop drilling |
|
|
21
|
+
| Server data | React Query / SWR | Cache, refetch, loading states |
|
|
22
|
+
| Side effects | useEffect with cleanup | Subscriptions, timers, API calls |
|
|
23
|
+
| Reusable logic | Custom hooks | Extract and share behavior |
|
|
24
|
+
|
|
25
|
+
## Component Patterns
|
|
26
|
+
|
|
27
|
+
### Functional Components (always prefer)
|
|
28
|
+
```tsx
|
|
29
|
+
interface Props {
|
|
30
|
+
title: string;
|
|
31
|
+
onClick?: () => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function MyComponent({ title, onClick }: Props) {
|
|
35
|
+
return <button onClick={onClick}>{title}</button>;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Custom Hooks (extract reusable logic)
|
|
40
|
+
```tsx
|
|
41
|
+
function useCounter(initial = 0) {
|
|
42
|
+
const [count, setCount] = useState(initial);
|
|
43
|
+
const increment = useCallback(() => setCount(c => c + 1), []);
|
|
44
|
+
return { count, increment };
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Composition over Inheritance
|
|
49
|
+
- Use `children` prop for flexible layouts
|
|
50
|
+
- Use render props for shared behavior
|
|
51
|
+
- Use compound components for related UI (Tabs/Tab, Select/Option)
|
|
52
|
+
|
|
53
|
+
## Performance Rules
|
|
54
|
+
|
|
55
|
+
| Problem | Solution | When |
|
|
56
|
+
|---------|----------|------|
|
|
57
|
+
| Expensive calc re-runs | `useMemo(() => calc, [deps])` | calc takes >1ms |
|
|
58
|
+
| Callback causes re-render | `useCallback(fn, [deps])` | Passed to memoized child |
|
|
59
|
+
| Component re-renders unnecessarily | `React.memo(Component)` | Props rarely change |
|
|
60
|
+
| Large bundle | `React.lazy(() => import(...))` | Route-level splitting |
|
|
61
|
+
| Long list | Virtualization (react-window) | 100+ items |
|
|
62
|
+
|
|
63
|
+
## Anti-Patterns to Avoid
|
|
64
|
+
|
|
65
|
+
1. **State for derived data** — Compute from existing state instead of storing separately
|
|
66
|
+
2. **useEffect for transforms** — Transform during render, not in effects
|
|
67
|
+
3. **Index as key** — Use stable IDs from data, not array index
|
|
68
|
+
4. **Nested ternaries in JSX** — Extract to variables or early returns
|
|
69
|
+
5. **Prop drilling 3+ levels** — Use Context or composition
|
|
70
|
+
|
|
71
|
+
## Accessibility Checklist
|
|
72
|
+
|
|
73
|
+
- Semantic HTML (`button` not `div onClick`)
|
|
74
|
+
- ARIA labels for icon-only buttons
|
|
75
|
+
- Keyboard navigation (Tab, Enter, Escape)
|
|
76
|
+
- Focus management after modals/dialogs
|
|
77
|
+
- Color contrast (4.5:1 minimum)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: testing-strategies
|
|
3
|
+
description: Testing patterns and strategies
|
|
4
|
+
tools:
|
|
5
|
+
- read_file
|
|
6
|
+
- write_file
|
|
7
|
+
- edit_file
|
|
8
|
+
- shell
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Testing Strategies — Domain Knowledge
|
|
12
|
+
|
|
13
|
+
This skill teaches you how to write effective tests. Study this to learn what to test, how to structure tests, and when to use different testing approaches.
|
|
14
|
+
|
|
15
|
+
## Testing Pyramid
|
|
16
|
+
|
|
17
|
+
| Level | Speed | Count | Coverage |
|
|
18
|
+
|-------|-------|-------|----------|
|
|
19
|
+
| Unit | Fast (ms) | Many | Functions, classes, utils |
|
|
20
|
+
| Integration | Medium (s) | Moderate | API routes, DB queries, services |
|
|
21
|
+
| E2E | Slow (s-min) | Few | Critical user flows only |
|
|
22
|
+
|
|
23
|
+
## The AAA Pattern (ALWAYS follow this)
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
test('should [behavior] when [condition]', () => {
|
|
27
|
+
// Arrange — set up the test
|
|
28
|
+
const calculator = new Calculator();
|
|
29
|
+
|
|
30
|
+
// Act — perform the action
|
|
31
|
+
const result = calculator.add(2, 3);
|
|
32
|
+
|
|
33
|
+
// Assert — verify the result
|
|
34
|
+
expect(result).toBe(5);
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## What to Test (Decision Framework)
|
|
39
|
+
|
|
40
|
+
| Code type | Test approach | Priority |
|
|
41
|
+
|-----------|---------------|----------|
|
|
42
|
+
| Pure functions | Unit test with edge cases | HIGH |
|
|
43
|
+
| API endpoints | Integration test with real DB | HIGH |
|
|
44
|
+
| UI components | Render + interaction tests | MEDIUM |
|
|
45
|
+
| Config/setup | Smoke test (does it load?) | LOW |
|
|
46
|
+
| External APIs | Mock + contract test | MEDIUM |
|
|
47
|
+
| Error paths | Unit test thrown errors | HIGH |
|
|
48
|
+
|
|
49
|
+
## Test Naming Convention
|
|
50
|
+
|
|
51
|
+
- `should [expected behavior] when [condition]`
|
|
52
|
+
- `[method] returns [result] for [input]`
|
|
53
|
+
- `throws [error] when [invalid input]`
|
|
54
|
+
|
|
55
|
+
## Mocking Rules
|
|
56
|
+
|
|
57
|
+
| Mock when... | Don't mock when... |
|
|
58
|
+
|-------------|-------------------|
|
|
59
|
+
| External API calls | Core business logic |
|
|
60
|
+
| Database in unit tests | Database in integration tests |
|
|
61
|
+
| Time (Date.now, timers) | Simple utility functions |
|
|
62
|
+
| Random values | Data transformations |
|
|
63
|
+
| File system in CI | File system in integration |
|
|
64
|
+
|
|
65
|
+
## Running Tests
|
|
66
|
+
|
|
67
|
+
- `npm test` or `npx jest` — run all tests
|
|
68
|
+
- `npm test -- --watch` — watch mode
|
|
69
|
+
- `npm test -- --coverage` — coverage report
|
|
70
|
+
- `npm test -- path/to/file` — run specific file
|
|
71
|
+
- `npx jest --testPathPattern="pattern"` — filter by pattern
|
|
72
|
+
|
|
73
|
+
## Common Mistakes
|
|
74
|
+
|
|
75
|
+
1. **Testing implementation, not behavior** — Test WHAT it does, not HOW
|
|
76
|
+
2. **Shared mutable state between tests** — Reset in beforeEach
|
|
77
|
+
3. **Not testing error cases** — Happy path + error paths
|
|
78
|
+
4. **Brittle snapshot tests** — Only snapshot stable, small components
|
|
79
|
+
5. **Skipping async cleanup** — Always await and clean up promises/timers
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./skills.module"), exports);
|
|
6
|
+
_export_star(require("./services/skill-loader.service"), exports);
|
|
7
|
+
_export_star(require("./services/skill-registry.service"), exports);
|
|
8
|
+
_export_star(require("./types"), exports);
|
|
9
|
+
function _export_star(from, to) {
|
|
10
|
+
Object.keys(from).forEach(function(k) {
|
|
11
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
12
|
+
Object.defineProperty(to, k, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function() {
|
|
15
|
+
return from[k];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return from;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/modules/skills/index.ts"],"sourcesContent":["export * from './skills.module';\nexport * from './services/skill-loader.service';\nexport * from './services/skill-registry.service';\nexport * from './types';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA"}
|