memory-journal-mcp 7.0.1 → 7.2.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 (124) hide show
  1. package/README.md +75 -66
  2. package/dist/{chunk-6J4RPJ4I.js → chunk-GR4T3SRW.js} +146 -105
  3. package/dist/{chunk-ARLH46WS.js → chunk-IWKLHSPU.js} +89 -3
  4. package/dist/{chunk-2BJHLTYP.js → chunk-ORV7ZZOE.js} +1086 -86
  5. package/dist/cli.js +30 -4
  6. package/dist/github-integration-2TFMXHIJ.js +1 -0
  7. package/dist/index.d.ts +6 -2
  8. package/dist/index.js +3 -3
  9. package/dist/{tools-FFFGXIKN.js → tools-CXR2FEB2.js} +2 -2
  10. package/package.json +2 -2
  11. package/skills/README.md +77 -0
  12. package/skills/autonomous-dev/SKILL.md +56 -0
  13. package/skills/bin/sync.js +50 -0
  14. package/skills/bun/SKILL.md +156 -0
  15. package/skills/github-commander/SKILL.md +1 -1
  16. package/skills/github-commander/workflows/code-quality-audit.md +7 -5
  17. package/skills/github-commander/workflows/issue-triage.md +13 -4
  18. package/skills/github-commander/workflows/milestone-sprint.md +9 -1
  19. package/skills/github-commander/workflows/perf-audit.md +2 -0
  20. package/skills/github-commander/workflows/pr-review.md +9 -3
  21. package/skills/github-commander/workflows/roadmap-kickoff.md +79 -0
  22. package/skills/github-commander/workflows/security-audit.md +3 -3
  23. package/skills/github-commander/workflows/update-deps.md +2 -2
  24. package/skills/gitlab/SKILL.md +115 -0
  25. package/skills/gitlab/package-lock.json +392 -0
  26. package/skills/gitlab/package.json +14 -0
  27. package/skills/gitlab/scripts/gitlab-client.ts +125 -0
  28. package/skills/gitlab/scripts/gitlab-helper.ts +80 -0
  29. package/skills/golang/SKILL.md +54 -0
  30. package/skills/mysql/SKILL.md +30 -0
  31. package/skills/package.json +48 -0
  32. package/skills/playwright-standard/SKILL.md +58 -0
  33. package/skills/playwright-standard/examples/fixtures.ts +66 -0
  34. package/skills/playwright-standard/examples/type-stubs.d.ts +10 -0
  35. package/skills/playwright-standard/references/advanced-scenarios.md +59 -0
  36. package/skills/playwright-standard/references/infrastructure.md +43 -0
  37. package/skills/postgres/SKILL.md +33 -0
  38. package/skills/react-best-practices/AGENTS.md +2883 -0
  39. package/skills/react-best-practices/README.md +127 -0
  40. package/skills/react-best-practices/SKILL.md +138 -0
  41. package/skills/react-best-practices/metadata.json +17 -0
  42. package/skills/react-best-practices/rules/_sections.md +46 -0
  43. package/skills/react-best-practices/rules/_template.md +28 -0
  44. package/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  45. package/skills/react-best-practices/rules/advanced-init-once.md +42 -0
  46. package/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
  47. package/skills/react-best-practices/rules/async-api-routes.md +35 -0
  48. package/skills/react-best-practices/rules/async-defer-await.md +80 -0
  49. package/skills/react-best-practices/rules/async-dependencies.md +48 -0
  50. package/skills/react-best-practices/rules/async-parallel.md +24 -0
  51. package/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  52. package/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  53. package/skills/react-best-practices/rules/bundle-conditional.md +37 -0
  54. package/skills/react-best-practices/rules/bundle-defer-third-party.md +48 -0
  55. package/skills/react-best-practices/rules/bundle-dynamic-imports.md +34 -0
  56. package/skills/react-best-practices/rules/bundle-preload.md +44 -0
  57. package/skills/react-best-practices/rules/client-event-listeners.md +78 -0
  58. package/skills/react-best-practices/rules/client-localstorage-schema.md +74 -0
  59. package/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  60. package/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  61. package/skills/react-best-practices/rules/js-batch-dom-css.md +110 -0
  62. package/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  63. package/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  64. package/skills/react-best-practices/rules/js-cache-storage.md +68 -0
  65. package/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  66. package/skills/react-best-practices/rules/js-early-exit.md +50 -0
  67. package/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  68. package/skills/react-best-practices/rules/js-index-maps.md +37 -0
  69. package/skills/react-best-practices/rules/js-length-check-first.md +50 -0
  70. package/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  71. package/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  72. package/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  73. package/skills/react-best-practices/rules/rendering-activity.md +24 -0
  74. package/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +38 -0
  75. package/skills/react-best-practices/rules/rendering-conditional-render.md +32 -0
  76. package/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  77. package/skills/react-best-practices/rules/rendering-hoist-jsx.md +36 -0
  78. package/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +72 -0
  79. package/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +26 -0
  80. package/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  81. package/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  82. package/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  83. package/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  84. package/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  85. package/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  86. package/skills/react-best-practices/rules/rerender-functional-setstate.md +77 -0
  87. package/skills/react-best-practices/rules/rerender-lazy-state-init.md +56 -0
  88. package/skills/react-best-practices/rules/rerender-memo-with-default-value.md +36 -0
  89. package/skills/react-best-practices/rules/rerender-memo.md +44 -0
  90. package/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  91. package/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  92. package/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  93. package/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  94. package/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  95. package/skills/react-best-practices/rules/server-auth-actions.md +96 -0
  96. package/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  97. package/skills/react-best-practices/rules/server-cache-react.md +76 -0
  98. package/skills/react-best-practices/rules/server-dedup-props.md +65 -0
  99. package/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
  100. package/skills/react-best-practices/rules/server-serialization.md +38 -0
  101. package/skills/rust/SKILL.md +86 -0
  102. package/skills/shadcn-ui/SKILL.md +72 -0
  103. package/skills/skill-builder/SKILL.md +457 -0
  104. package/skills/skill-builder/checklist.md +65 -0
  105. package/skills/sqlite/SKILL.md +38 -0
  106. package/skills/typescript/SKILL.md +453 -0
  107. package/skills/typescript/assets/eslint-template.js +102 -0
  108. package/skills/typescript/assets/tsconfig-template.json +45 -0
  109. package/skills/typescript/references/enterprise-patterns.md +531 -0
  110. package/skills/typescript/references/generics.md +493 -0
  111. package/skills/typescript/references/nestjs-integration.md +579 -0
  112. package/skills/typescript/references/react-integration.md +616 -0
  113. package/skills/typescript/references/toolchain.md +547 -0
  114. package/skills/typescript/references/type-system.md +481 -0
  115. package/skills/vitest-standard/SKILL.md +82 -0
  116. package/skills/vitest-standard/examples/service-mock.ts +60 -0
  117. package/skills/vitest-standard/examples/tdd-calculator.ts +41 -0
  118. package/skills/vitest-standard/examples/type-stubs.d.ts +18 -0
  119. package/skills/vitest-standard/references/async-and-errors.md +58 -0
  120. package/skills/vitest-standard/references/coverage-and-config.md +53 -0
  121. package/skills/vitest-standard/references/mocking.md +61 -0
  122. package/skills/vitest-standard/references/tdd-patterns.md +60 -0
  123. package/dist/github-integration-PDRLXKGM.js +0 -1
  124. package/skills/github-commander/workflows/full-audit.md +0 -134
@@ -0,0 +1,58 @@
1
+ # Async & Error Handling in Vitest
2
+
3
+ Handling promises and rejections correctly is essential for preventing flakiness and false positives.
4
+
5
+ ## Async Testing
6
+
7
+ ### Promises
8
+
9
+ Always use `await` inside your tests to ensure Vitest waits for fulfillment.
10
+
11
+ ```typescript
12
+ it('should fetch data', async () => {
13
+ const data = await fetchData()
14
+ expect(data).toEqual({ id: 1 })
15
+ })
16
+ ```
17
+
18
+ ### Async Error Handling
19
+
20
+ Use `rejects.toThrow()` to assert a promise is rejected with a specific message.
21
+
22
+ ```typescript
23
+ it('should handle API errors', async () => {
24
+ await expect(api.fetchUser('invalid')).rejects.toThrow('User not found')
25
+ })
26
+ ```
27
+
28
+ ## Error Handling Patterns
29
+
30
+ ### Synchronous Errors
31
+
32
+ Assert that calling a function throws an error directly.
33
+
34
+ ```typescript
35
+ it('should throw for negative numbers', () => {
36
+ expect(() => sqrt(-1)).toThrow('Cannot compute square root of negative')
37
+ })
38
+ ```
39
+
40
+ ### Specialized Error Types
41
+
42
+ Validate against specific error classes.
43
+
44
+ ```typescript
45
+ it('should throw TypeError', () => {
46
+ expect(() => doSomething()).toThrow(TypeError)
47
+ })
48
+
49
+ it('should throw CustomValidationError', () => {
50
+ expect(() => validate()).toThrow(ValidationError)
51
+ })
52
+ ```
53
+
54
+ ## Common Failures
55
+
56
+ - **Missing `await`**: Tests frequently pass silently because the promise was never resolved.
57
+ - **`try/catch` in tests**: Don't use `try/catch` in your test bodies. Use the `toThrow()` or `rejects.toThrow()` assertions directly.
58
+ - **Unbounded Timeouts**: Ensure your async tests can time out (default is 5s) instead of hanging your CI pipeline.
@@ -0,0 +1,53 @@
1
+ # Coverage & Configuration
2
+
3
+ Mastering Vitest configuration ensures your tests run quickly and provide the metrics needed for production delivery.
4
+
5
+ ## Configuration (vitest.config.ts)
6
+
7
+ A sample configuration for Node.js environments.
8
+
9
+ ```typescript
10
+ import { defineConfig } from 'vitest/config'
11
+
12
+ export default defineConfig({
13
+ test: {
14
+ globals: true, // Enables describe, it, expect globally
15
+ environment: 'node',
16
+ include: ['**/*.test.ts'],
17
+ coverage: {
18
+ provider: 'v8',
19
+ reporter: ['text', 'html', 'lcov'],
20
+ lines: 80, // Enforce min 80% coverage
21
+ functions: 80,
22
+ branches: 80,
23
+ statements: 80,
24
+ },
25
+ },
26
+ })
27
+ ```
28
+
29
+ ## Coverage Best Practices
30
+
31
+ ### ✅ DO:
32
+
33
+ - Aim for **80-90% coverage** as a baseline for healthy projects.
34
+ - Focus on **business logic** and critical paths.
35
+ - Test **edge cases** and error paths thoroughly.
36
+
37
+ ### ❌ DON'T:
38
+
39
+ - **Chase 100% coverage** including boilerplate code (getters/setters).
40
+ - Test **framework code** or third-party libraries.
41
+ - Write fragile tests just to increase lines covered.
42
+
43
+ ## CLI Workflow
44
+
45
+ - **`vitest`**: Run in watch mode during TDD sessions.
46
+ - **`vitest run`**: Single execution for CI/CD or pre-commit hooks.
47
+ - **`vitest run --coverage`**: Generate coverage reports.
48
+ - **`vitest u`**: Update outdated snapshots after intentional changes.
49
+
50
+ ### CI Integration
51
+
52
+ - Enable `reporters: ['default', 'junit']` for better integration with GitHub Actions or GitLab CI.
53
+ - Set `outputFile: 'junit.xml'` to capture results in CI artifacts.
@@ -0,0 +1,61 @@
1
+ # Mocking & Test Doubles
2
+
3
+ Vitest provides a rich API for isolating your code from its dependencies.
4
+
5
+ ## Test Doubles
6
+
7
+ | Type | Purpose | Use Case |
8
+ | :------- | :-------------------------------- | :---------------------------- |
9
+ | **Mock** | Verifies behavior (calls, args) | `vi.fn()` |
10
+ | **Stub** | Returns predefined values | `vi.fn().mockReturnValue(42)` |
11
+ | **Spy** | Observes a real function | `vi.spyOn(obj, 'method')` |
12
+ | **Fake** | Working simplified implementation | A `FakeDatabase` using `Map` |
13
+
14
+ ## Mocking Strategies
15
+
16
+ ### 1. Mocking Modules
17
+
18
+ Must be called at the top of your test file to intercept internal imports.
19
+
20
+ ```typescript
21
+ vi.mock('./api', () => ({
22
+ fetchUser: vi.fn().mockResolvedValue({ id: 1, name: 'John' }),
23
+ }))
24
+ ```
25
+
26
+ ### 2. Dependency Injection
27
+
28
+ Prefer passing dependencies via constructor to facilitate easy mocking.
29
+
30
+ ```typescript
31
+ class UserService {
32
+ constructor(private db: Database) {}
33
+ async getUser(id: string) {
34
+ return this.db.query('SELECT * FROM users WHERE id = ?', [id])
35
+ }
36
+ }
37
+
38
+ // Test with mock instance
39
+ const mockDb = { query: vi.fn().mockResolvedValue({ id: '123' }) }
40
+ const service = new UserService(mockDb as any)
41
+ ```
42
+
43
+ ### 3. Cleanup & Restoration
44
+
45
+ Crucial for preventing call history leaks between tests.
46
+
47
+ ```typescript
48
+ beforeEach(() => {
49
+ vi.clearAllMocks() // Resets call history
50
+ })
51
+
52
+ afterEach(() => {
53
+ vi.restoreAllMocks() // Restores original methods if spying
54
+ })
55
+ ```
56
+
57
+ ## Anti-Patterns
58
+
59
+ - **Testing implementation**: Mocking internal methods of the class under test.
60
+ - **Over-mocking**: Mocking so much that the test loses its connection to reality.
61
+ - **Mocking your own code**: Mocking other internal helpers instead of the external boundaries.
@@ -0,0 +1,60 @@
1
+ # TDD & Test Patterns
2
+
3
+ Test-Driven Development (TDD) facilitates better API design and ensures your code is testable from its inception.
4
+
5
+ ## Red-Green-Refactor Cycle
6
+
7
+ 1. **Red**: Write a failing test for a specific feature.
8
+ 2. **Green**: Write the minimal amount of code to make the test pass.
9
+ 3. **Refactor**: Clean up the code without changing its behavior.
10
+
11
+ ### Parametric Testing
12
+
13
+ Drive the same test logic with multiple data inputs.
14
+
15
+ ```typescript
16
+ describe.each([
17
+ [2, 3, 5],
18
+ [10, 5, 15],
19
+ [-1, 1, 0],
20
+ ])('Calculator.add(%i, %i)', (a, b, expected) => {
21
+ it(`should return ${expected}`, () => {
22
+ const calc = new Calculator()
23
+ expect(calc.add(a, b)).toBe(expected)
24
+ })
25
+ })
26
+ ```
27
+
28
+ ### Given-When-Then (BDD Style)
29
+
30
+ Structure tests according to behavioral scenarios.
31
+
32
+ ```typescript
33
+ describe('Shopping Cart', () => {
34
+ it('should apply discount when total exceeds $100', () => {
35
+ // Given: A cart with items totaling $120
36
+ const cart = new ShoppingCart()
37
+ cart.addItem({ price: 120, quantity: 1 })
38
+
39
+ // When: Getting the total
40
+ const total = cart.getTotal()
41
+
42
+ // Then: 10% discount applied
43
+ expect(total).toBe(108) // $120 - $12 (10%)
44
+ })
45
+ })
46
+ ```
47
+
48
+ ## Naming & File Structure
49
+
50
+ ### File Structure
51
+
52
+ - **Co-located tests**: `UserService.ts` and `UserService.test.ts` in the same directory.
53
+ - **Integration tests**: Place in a separate `tests/integration/` directory.
54
+
55
+ ### Naming Conventions
56
+
57
+ - ✅ `it('should return error on missing email')`
58
+ - ✅ `it('returns error on missing email')`
59
+ - ❌ `it('test1')`
60
+ - ❌ `it('it should work')`
@@ -1 +0,0 @@
1
- export { GitHubIntegration } from './chunk-ARLH46WS.js';
@@ -1,134 +0,0 @@
1
- # Full Audit
2
-
3
- Run a unified code quality + performance + security audit in a single pass with
4
- cross-reference analysis. Use for codebases that are already in good shape.
5
-
6
- > **When to use**: For established codebases that have likely passed individual
7
- > audits before. This prevents the "fix cascade" where a security fix introduces
8
- > a quality regression, or a performance optimization weakens validation.
9
-
10
- > **Do not use for**: First-time audits on codebases with many known issues.
11
- > Run the individual workflows (`code-quality-audit.md`, `perf-audit.md`,
12
- > `security-audit.md`) separately and fix iteratively instead.
13
-
14
- ## Phase 1 — Collect Findings (Read-Only)
15
-
16
- Run all three audits as **read-only analysis** — no fixes yet. Tag each finding
17
- by its source domain.
18
-
19
- ### 1a. Code Quality Scan
20
-
21
- Follow `code-quality-audit.md` categories 1–14. Tag every finding with `[CQ]`.
22
-
23
- ### 1b. Performance Scan
24
-
25
- Follow `perf-audit.md` sections 1–6. Tag every finding with `[PERF]`.
26
-
27
- ### 1c. Security Scan
28
-
29
- Follow `security-audit.md` phases 2–7. Tag every finding with `[SEC]`.
30
-
31
- ### 1d. Raw Findings Ledger
32
-
33
- Produce **one** consolidated table sorted by severity:
34
-
35
- | # | Tag | Severity | File | Lines | Finding | Suggested Fix |
36
- | --- | --- | -------- | ---- | ----- | ------- | ------------- |
37
-
38
- **Do not apply any fixes yet.**
39
-
40
- ## Phase 2 — Cross-Reference Analysis
41
-
42
- Review the raw ledger and identify findings that interact across domains.
43
-
44
- ### Conflict Types
45
-
46
- | Type | Example |
47
- | -------------------------- | ------------------------------------------------------------------------------- |
48
- | **Security ↔ Quality** | A `[SEC]` fix (adding validation) could introduce duplication flagged by `[CQ]` |
49
- | **Security ↔ Performance** | A `[SEC]` fix (parameterized queries, hashing) could degrade `[PERF]` |
50
- | **Performance ↔ Quality** | A `[PERF]` fix (inlining, caching) could increase complexity flagged by `[CQ]` |
51
- | **Performance ↔ Security** | A `[PERF]` fix (caching, skipping validation) could weaken a `[SEC]` boundary |
52
- | **Shared Root Cause** | Multiple findings trace to the same underlying issue |
53
- | **Fix Dependency** | One finding must be fixed before another |
54
-
55
- ### Cross-Reference Table
56
-
57
- | Linked Findings | Conflict Type | Resolution Strategy |
58
- | --------------- | ------------- | ------------------- |
59
-
60
- If no cross-references are found, state that explicitly.
61
-
62
- ## Phase 3 — Prioritized Fix Plan
63
-
64
- Produce an **ordered fix plan** that avoids cascading regressions:
65
-
66
- ### Ordering Rules
67
-
68
- 1. **Shared root causes first** — a single fix resolves multiple findings
69
- 2. **Fix dependencies next** — structural changes that unblock later fixes
70
- 3. **Security-critical** — critical/high `[SEC]` findings
71
- 4. **Cross-referenced fixes** — unified resolution strategies from Phase 2
72
- 5. **Remaining findings** — in severity order
73
-
74
- ### Fix Plan Table
75
-
76
- | Order | Finding(s) | Fix Description | Domains Resolved |
77
- | ----- | ---------- | --------------- | ---------------- |
78
-
79
- ## HITL Gate — User Approval
80
-
81
- **Stop here.** Present the Phase 2 cross-reference analysis and Phase 3 fix
82
- plan to the human for review. Do not proceed until explicitly approved.
83
-
84
- Journal the audit state:
85
-
86
- ```
87
- create_entry({
88
- content: "Full audit complete. Findings: <N total> (<CQ count> CQ, <PERF count> PERF, <SEC count> SEC). Cross-references: <N>. Awaiting approval for fix plan.",
89
- entry_type: "audit_finding",
90
- tags: ["commander", "full-audit", "summary"],
91
- })
92
- ```
93
-
94
- ## Phase 4 — Apply Fixes & Verify
95
-
96
- Apply fixes in the approved order. After **all** fixes:
97
-
98
- Run validation gates:
99
-
100
- - Gate 1: Lint + Typecheck
101
- - Gate 2: Build
102
- - Gate 3: Tests
103
-
104
- If any validation fails, identify which fix group caused it and revise.
105
-
106
- ## Phase 5 — Final Report
107
-
108
- ### Summary Table
109
-
110
- | Domain | Score (A–F) | Findings | Critical | Cross-Referenced |
111
- | ------------ | ----------- | -------- | -------- | ---------------- |
112
- | Code Quality | | | | |
113
- | Performance | | | | |
114
- | Security | | | | |
115
-
116
- ### Metrics
117
-
118
- - **Total findings**: _N_
119
- - **Cross-referenced findings**: _N_
120
- - **Cascading fixes avoided**: _N_
121
-
122
- ### Overall Score
123
-
124
- Assign an **overall health score (A–F)** considering all three domains.
125
-
126
- ## Post-Audit
127
-
128
- 1. Update changelog with fixes
129
- 2. Commit:
130
- ```bash
131
- git add <fixed files> <changelog>
132
- git diff --cached --stat
133
- git commit -m "chore: unified audit fixes"
134
- ```