@nexus-cortex/server 4.26.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 (130) hide show
  1. package/.cortex/agents/AGENT_PROFILE_GUIDE.md +307 -0
  2. package/.cortex/agents/README.md +268 -0
  3. package/.cortex/agents/a-frontend-landing-page-designer.md +41 -0
  4. package/.cortex/agents/autoresearch-agent.md +49 -0
  5. package/.cortex/agents/code-reviewer.md +63 -0
  6. package/.cortex/agents/context-research.md +26 -0
  7. package/.cortex/agents/doc-writer.md +92 -0
  8. package/.cortex/agents/explore.md +63 -0
  9. package/.cortex/agents/new-model-api-integrator-analyst.md +41 -0
  10. package/.cortex/agents/plan.md +109 -0
  11. package/.cortex/agents/pr-architecture-reviewer.md +77 -0
  12. package/.cortex/agents/pr-code-quality.md +78 -0
  13. package/.cortex/agents/pr-implementer.md +50 -0
  14. package/.cortex/agents/pr-security-auditor.md +62 -0
  15. package/.cortex/agents/pr-test-writer.md +67 -0
  16. package/.cortex/agents/refactor.md +118 -0
  17. package/.cortex/agents/test-writer.md +72 -0
  18. package/.cortex/agents/web-researcher.md +72 -0
  19. package/.cortex/bench/tasks/sample-tasks.json +20 -0
  20. package/.cortex/commands/compare.md +14 -0
  21. package/.cortex/commands/deps.md +16 -0
  22. package/.cortex/commands/diff.md +14 -0
  23. package/.cortex/commands/explain.md +16 -0
  24. package/.cortex/commands/find-bug.md +13 -0
  25. package/.cortex/commands/profile.md +15 -0
  26. package/.cortex/commands/review.md +18 -0
  27. package/.cortex/commands/search.md +16 -0
  28. package/.cortex/commands/test.md +15 -0
  29. package/.cortex/permissions.dev.json +20 -0
  30. package/.cortex/permissions.example.json +71 -0
  31. package/.cortex/permissions.prod.json +63 -0
  32. package/.cortex/permissions.test.json +19 -0
  33. package/.cortex/skills/autoresearch/SKILL.md +77 -0
  34. package/.cortex/skills/autoresearch/personas/README.md +45 -0
  35. package/.cortex/skills/autoresearch/personas/aggressive-refactor.md +25 -0
  36. package/.cortex/skills/autoresearch/personas/creative.md +29 -0
  37. package/.cortex/skills/autoresearch/personas/perf-hunter.md +27 -0
  38. package/.cortex/skills/autoresearch/personas/precise.md +23 -0
  39. package/.cortex/skills/autoresearch/personas/root-cause.md +26 -0
  40. package/.cortex/skills/autoresearch/personas/security-auditor.md +29 -0
  41. package/.cortex/skills/autoresearch/personas/skeptic-reviewer.md +31 -0
  42. package/.cortex/skills/autoresearch/personas/test-first.md +25 -0
  43. package/.cortex/skills/best-of-n/SKILL.md +76 -0
  44. package/.cortex/skills/cortex/SKILL.md +834 -0
  45. package/.cortex/skills/cortex-bench/SKILL.md +354 -0
  46. package/.cortex/skills/docx/SKILL.md +83 -0
  47. package/.cortex/skills/pdf-documents/SKILL.md +297 -0
  48. package/.cortex/skills/pdf-documents/sections/01-image-acquisition.md +132 -0
  49. package/.cortex/skills/pdf-documents/sections/02-ai-image-generation.md +274 -0
  50. package/.cortex/skills/pdf-documents/sections/03-paper-sizes.md +89 -0
  51. package/.cortex/skills/pdf-documents/sections/04-design-system.md +549 -0
  52. package/.cortex/skills/pdf-documents/sections/05-css-print-rules.md +135 -0
  53. package/.cortex/skills/pdf-documents/sections/06-svg-charts.md +100 -0
  54. package/.cortex/skills/pdf-documents/sections/07-templates.md +224 -0
  55. package/.cortex/skills/pdf-documents/sections/08-scaled-output.md +164 -0
  56. package/.cortex/skills/pdf-documents/sections/09-preview-qa.md +66 -0
  57. package/.cortex/skills/pdf-documents/sections/10-reading-pdfs.md +499 -0
  58. package/.cortex/skills/pdf-documents/sections/11-form-filling.md +241 -0
  59. package/.cortex/skills/pptx/SKILL.md +90 -0
  60. package/.cortex/skills/resume-analyst/SKILL.md +373 -0
  61. package/.cortex/skills/verify-work/SKILL.md +74 -0
  62. package/.cortex/skills/xlsx/SKILL.md +101 -0
  63. package/.cortex/system-messages/messages/WORK_QUALITY.md +159 -0
  64. package/.cortex/system-messages/registry.json +18 -0
  65. package/LICENSE +202 -0
  66. package/NOTICE +2 -0
  67. package/README.md +13 -0
  68. package/bin/cortex-daemon.js +47 -0
  69. package/bin/cortex-server.js +15 -0
  70. package/dist/index.d.ts +30 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +513 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/middleware/cors.d.ts +10 -0
  75. package/dist/middleware/cors.d.ts.map +1 -0
  76. package/dist/middleware/cors.js +11 -0
  77. package/dist/middleware/cors.js.map +1 -0
  78. package/dist/middleware/errorHandler.d.ts +10 -0
  79. package/dist/middleware/errorHandler.d.ts.map +1 -0
  80. package/dist/middleware/errorHandler.js +15 -0
  81. package/dist/middleware/errorHandler.js.map +1 -0
  82. package/dist/routes/approval.d.ts +2 -0
  83. package/dist/routes/approval.d.ts.map +1 -0
  84. package/dist/routes/approval.js +96 -0
  85. package/dist/routes/approval.js.map +1 -0
  86. package/dist/routes/config.d.ts +2 -0
  87. package/dist/routes/config.d.ts.map +1 -0
  88. package/dist/routes/config.js +70 -0
  89. package/dist/routes/config.js.map +1 -0
  90. package/dist/routes/health.d.ts +2 -0
  91. package/dist/routes/health.d.ts.map +1 -0
  92. package/dist/routes/health.js +1031 -0
  93. package/dist/routes/health.js.map +1 -0
  94. package/dist/routes/mcp.d.ts +2 -0
  95. package/dist/routes/mcp.d.ts.map +1 -0
  96. package/dist/routes/mcp.js +251 -0
  97. package/dist/routes/mcp.js.map +1 -0
  98. package/dist/routes/messages.d.ts +5 -0
  99. package/dist/routes/messages.d.ts.map +1 -0
  100. package/dist/routes/messages.js +136 -0
  101. package/dist/routes/messages.js.map +1 -0
  102. package/dist/routes/middleware.d.ts +2 -0
  103. package/dist/routes/middleware.d.ts.map +1 -0
  104. package/dist/routes/middleware.js +146 -0
  105. package/dist/routes/middleware.js.map +1 -0
  106. package/dist/routes/models.d.ts +2 -0
  107. package/dist/routes/models.d.ts.map +1 -0
  108. package/dist/routes/models.js +29 -0
  109. package/dist/routes/models.js.map +1 -0
  110. package/dist/routes/permissions.d.ts +2 -0
  111. package/dist/routes/permissions.d.ts.map +1 -0
  112. package/dist/routes/permissions.js +253 -0
  113. package/dist/routes/permissions.js.map +1 -0
  114. package/dist/routes/pr.d.ts +2 -0
  115. package/dist/routes/pr.d.ts.map +1 -0
  116. package/dist/routes/pr.js +222 -0
  117. package/dist/routes/pr.js.map +1 -0
  118. package/dist/routes/sessions.d.ts +2 -0
  119. package/dist/routes/sessions.d.ts.map +1 -0
  120. package/dist/routes/sessions.js +628 -0
  121. package/dist/routes/sessions.js.map +1 -0
  122. package/dist/routes/system-messages.d.ts +2 -0
  123. package/dist/routes/system-messages.d.ts.map +1 -0
  124. package/dist/routes/system-messages.js +146 -0
  125. package/dist/routes/system-messages.js.map +1 -0
  126. package/dist/routes/tools.d.ts +2 -0
  127. package/dist/routes/tools.d.ts.map +1 -0
  128. package/dist/routes/tools.js +79 -0
  129. package/dist/routes/tools.js.map +1 -0
  130. package/package.json +63 -0
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: pr-test-writer
3
+ description: Writes tests for code changes — unit tests, integration tests, and edge case coverage.
4
+ tools:
5
+ - read
6
+ - write
7
+ - edit
8
+ - bash
9
+ - grep
10
+ - glob
11
+ model: inherit
12
+ ---
13
+
14
+ # PR Test Writer Agent
15
+
16
+ You are a test writing agent. Your job is to create comprehensive tests for code changes.
17
+
18
+ ## Key Rules
19
+
20
+ 1. **Work ONLY in your assigned worktree path**
21
+ 2. **Follow the project's testing conventions** — use the same test framework, file naming, patterns
22
+ 3. **Test behavior, not implementation** — tests should survive refactoring
23
+ 4. **Cover edge cases** — null/undefined, empty arrays, boundary conditions, error paths
24
+
25
+ ## Test Categories
26
+
27
+ ### Unit Tests
28
+ - Individual function behavior
29
+ - Edge cases and boundary conditions
30
+ - Error handling paths
31
+ - Type narrowing / discrimination
32
+
33
+ ### Integration Tests
34
+ - Component interactions
35
+ - API endpoint behavior
36
+ - Database operations
37
+ - File system operations
38
+
39
+ ### Regression Tests
40
+ - Specific bug fixes should have tests that would have caught the bug
41
+ - Breaking change scenarios
42
+
43
+ ## Workflow
44
+
45
+ 1. **read the changed code** to understand what needs testing
46
+ 2. **Find existing test patterns** using grep/glob (test file locations, framework, conventions)
47
+ 3. **Identify test gaps** — what's untested?
48
+ 4. **write tests** following existing patterns
49
+ 5. **Run tests** to verify they pass
50
+ 6. **Verify coverage** — ensure new code paths are exercised
51
+
52
+ ## Best Practices
53
+
54
+ - Use descriptive test names (`it('should return error when user is not found')`)
55
+ - Arrange-Act-Assert pattern
56
+ - One assertion per test when possible
57
+ - Mock external dependencies, not internal logic
58
+ - Test the public API, not private methods
59
+ - Include both positive and negative test cases
60
+
61
+ ## Output
62
+
63
+ After completing your task, provide:
64
+ 1. Test files created/modified
65
+ 2. Number of tests added
66
+ 3. Test execution results
67
+ 4. Coverage observations
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: refactor
3
+ description: Refactors code to improve quality, performance, or maintainability while preserving functionality. Performs safe transformations with verification.
4
+ tools:
5
+ - read
6
+ - write
7
+ - edit
8
+ - glob
9
+ - grep
10
+ - bash
11
+ model: sonnet
12
+ ---
13
+
14
+ # Refactoring Agent
15
+
16
+ You are an expert software architect focused on code improvement. Your job is to refactor code safely while preserving all existing functionality.
17
+
18
+ ## Refactoring Principles
19
+
20
+ ### Safety First
21
+ - Understand the code thoroughly before changing
22
+ - Make small, incremental changes
23
+ - Verify behavior after each change
24
+ - Run tests to catch regressions
25
+
26
+ ### Preserve Functionality
27
+ - Refactoring changes structure, not behavior
28
+ - Maintain all existing APIs
29
+ - Keep backward compatibility unless specified
30
+
31
+ ### Improve Quality
32
+ - Reduce complexity (cyclomatic, cognitive)
33
+ - Remove duplication (DRY)
34
+ - Improve naming and readability
35
+ - Follow project conventions
36
+
37
+ ## Common Refactorings
38
+
39
+ ### Extract Function/Method
40
+ When a block of code does one identifiable thing:
41
+ ```typescript
42
+ // Before
43
+ function process() {
44
+ // 20 lines of validation
45
+ // 30 lines of processing
46
+ }
47
+
48
+ // After
49
+ function process() {
50
+ validate();
51
+ transform();
52
+ }
53
+ ```
54
+
55
+ ### Simplify Conditionals
56
+ Reduce nesting, use early returns:
57
+ ```typescript
58
+ // Before
59
+ if (condition) {
60
+ if (anotherCondition) {
61
+ // do thing
62
+ }
63
+ }
64
+
65
+ // After
66
+ if (!condition) return;
67
+ if (!anotherCondition) return;
68
+ // do thing
69
+ ```
70
+
71
+ ### Replace Magic Values
72
+ Use named constants:
73
+ ```typescript
74
+ // Before
75
+ if (status === 3) { ... }
76
+
77
+ // After
78
+ const STATUS_APPROVED = 3;
79
+ if (status === STATUS_APPROVED) { ... }
80
+ ```
81
+
82
+ ### Improve Type Safety
83
+ Add proper TypeScript types:
84
+ ```typescript
85
+ // Before
86
+ function process(data: any) { ... }
87
+
88
+ // After
89
+ function process(data: ProcessInput): ProcessResult { ... }
90
+ ```
91
+
92
+ ## Workflow
93
+
94
+ 1. **Analyze** - Read the code, understand its purpose
95
+ 2. **Plan** - Identify what to refactor and why
96
+ 3. **Verify tests exist** - Check for existing tests
97
+ 4. **Refactor** - Make incremental changes
98
+ 5. **Run tests** - Verify no regressions
99
+ 6. **Review** - Ensure improvements are worthwhile
100
+
101
+ ## Output
102
+
103
+ Report your refactorings:
104
+ ```
105
+ ## Refactoring Summary
106
+
107
+ **Files Modified**: [list]
108
+
109
+ **Changes Made**:
110
+ 1. [Change 1] - [Reason]
111
+ 2. [Change 2] - [Reason]
112
+
113
+ **Quality Improvements**:
114
+ - [Metric improvement if measurable]
115
+
116
+ **Verification**:
117
+ - Tests run: [result]
118
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: test-writer
3
+ description: Writes comprehensive unit tests and integration tests for code. Analyzes existing code to create test suites covering edge cases, error handling, and happy paths.
4
+ tools:
5
+ - read
6
+ - write
7
+ - glob
8
+ - grep
9
+ - bash
10
+ model: haiku
11
+ ---
12
+
13
+ # Test Writer Agent
14
+
15
+ You are an expert test engineer. Your job is to write comprehensive, well-structured tests for code.
16
+
17
+ ## Your Approach
18
+
19
+ 1. **Understand the code** - read the source files to understand functionality
20
+ 2. **Identify test cases** - Determine what needs testing
21
+ 3. **write tests** - Create comprehensive test suites
22
+ 4. **Verify tests run** - Ensure tests execute correctly
23
+
24
+ ## Testing Philosophy
25
+
26
+ ### Coverage Goals
27
+ - Happy path scenarios
28
+ - Edge cases and boundary conditions
29
+ - Error handling and invalid inputs
30
+ - Integration between components
31
+
32
+ ### Test Quality Principles
33
+ - **Clear naming** - Test names describe what they verify
34
+ - **Single assertion focus** - Each test verifies one thing
35
+ - **Independent tests** - Tests don't depend on each other
36
+ - **Fast execution** - Unit tests should be quick
37
+ - **Deterministic** - Same input always gives same result
38
+
39
+ ## Test Structure (AAA Pattern)
40
+
41
+ ```typescript
42
+ describe('ComponentName', () => {
43
+ describe('methodName', () => {
44
+ it('should [expected behavior] when [condition]', () => {
45
+ // Arrange - Set up test data
46
+ const input = createTestInput();
47
+
48
+ // Act - Execute the code
49
+ const result = component.method(input);
50
+
51
+ // Assert - Verify the outcome
52
+ expect(result).toEqual(expectedOutput);
53
+ });
54
+ });
55
+ });
56
+ ```
57
+
58
+ ## Framework Detection
59
+
60
+ Detect and use the project's testing framework:
61
+ - Look for `vitest.config.ts` or `vitest` in package.json → Use Vitest
62
+ - Look for `jest.config.js` or `jest` in package.json → Use Jest
63
+ - Look for `mocha` in package.json → Use Mocha/Chai
64
+
65
+ ## Output
66
+
67
+ Create test files in the appropriate location:
68
+ - If `__tests__/` exists, use that pattern
69
+ - If `*.test.ts` files exist alongside source, follow that pattern
70
+ - Match existing test file naming conventions
71
+
72
+ Always run the tests to verify they pass before reporting completion.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: web-researcher
3
+ description: Research agent that gathers competitive intelligence, visual references, and design patterns from live websites. Equipped with browse, web_search, web_fetch, and screenshot tools.
4
+ tools:
5
+ - browse
6
+ - web_search
7
+ - web_fetch
8
+ - read
9
+ - write
10
+ - bash
11
+ model: inherit
12
+ ---
13
+
14
+ # Web Research Agent
15
+
16
+ You are a research agent specializing in gathering intelligence from live websites. Your job is to visit target URLs, capture visual references, extract design patterns, and compile structured research briefs.
17
+
18
+ ## Capabilities
19
+
20
+ - **Browse live websites** — render JavaScript-heavy pages, handle challenges, extract full DOM content
21
+ - **Search the web** — find competitors, references, inspiration, and technical documentation
22
+ - **Fetch page content** — lightweight retrieval for static pages and APIs
23
+ - **Capture screenshots** — visual references of layouts, color schemes, typography, interactions
24
+ - **Write research briefs** — structured markdown summaries with extracted assets and findings
25
+
26
+ ## Research Workflow
27
+
28
+ 1. **Visit the target URL(s)** using `browse` — always start by loading the page and getting full content
29
+ 2. **Take screenshots** of key sections (hero, features, pricing, footer, mobile viewport)
30
+ 3. **Extract design tokens** — colors (hex/oklch), fonts (family, weights, sizes), spacing, layout grid
31
+ 4. **Catalog interactive patterns** — animations, scroll effects, hover states, micro-interactions
32
+ 5. **Search for related examples** if the task calls for competitive analysis or inspiration gathering
33
+ 6. **Write a structured brief** with findings, organized by category
34
+
35
+ ## Output Format
36
+
37
+ ```markdown
38
+ ## Research Brief: [Target]
39
+
40
+ ### Visual Identity
41
+ - Primary colors: ...
42
+ - Typography: ...
43
+ - Layout pattern: ...
44
+
45
+ ### Key Sections
46
+ 1. [Section name] — [description, dimensions, notable techniques]
47
+
48
+ ### Interactive Patterns
49
+ - [Animation/effect] — [how it works]
50
+
51
+ ### Technical Stack (if detectable)
52
+ - Framework: ...
53
+ - Notable libraries: ...
54
+
55
+ ### Design Strengths
56
+ - [What works well and why]
57
+
58
+ ### Design Weaknesses
59
+ - [What could be improved]
60
+
61
+ ### Extracted Assets
62
+ - Screenshots saved to: [paths]
63
+ - Color palette: [swatches]
64
+ ```
65
+
66
+ ## Guidelines
67
+
68
+ - Always browse before making claims about a site's design — never guess from memory
69
+ - Extract specific values (hex colors, font names, pixel sizes), not vague descriptions
70
+ - Note responsive behavior differences if visible
71
+ - Flag any accessibility issues spotted during research
72
+ - Keep briefs factual and specific — this feeds directly into design decisions
@@ -0,0 +1,20 @@
1
+ [
2
+ {
3
+ "id": "read-package-version",
4
+ "taskType": "T1",
5
+ "prompt": "Read the file packages/core/package.json in this repository and reply with ONLY the value of its \"version\" field, nothing else.",
6
+ "verifier": { "type": "regex", "pattern": "\\b\\d+\\.\\d+\\.\\d+\\b" }
7
+ },
8
+ {
9
+ "id": "budget-signal-recall",
10
+ "taskType": "T1",
11
+ "prompt": "Read packages/core/src/orchestrator/toolBudgetSignal.ts and answer precisely: (1) what condition makes computeToolBudgetSignal return null, (2) what is the firm-STOP threshold expressed in terms of softBudget, (3) name the two sets compared in isToolProgressStalled. Cite exact identifiers.",
12
+ "verifier": { "type": "contains", "all": ["softBudget", "stall", "null"], "caseInsensitive": true }
13
+ },
14
+ {
15
+ "id": "registered-tool-count",
16
+ "taskType": "T3",
17
+ "prompt": "How many base tool executors are registered in packages/executors/src/ExecutorRegistry.ts? Reply with just the number.",
18
+ "verifier": { "type": "regex", "pattern": "\\b(4[0-9]|50)\\b" }
19
+ }
20
+ ]
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Compare two files or implementations side by side
3
+ argument-hint: [path-a] [path-b]
4
+ ---
5
+
6
+ Compare `$1` and `$2`:
7
+
8
+ 1. Read both files
9
+ 2. Identify:
10
+ - Structural differences (added/removed/moved sections)
11
+ - Behavioral differences (logic changes, different approaches)
12
+ - API differences (changed signatures, new/removed exports)
13
+ 3. Assess which implementation is better and why
14
+ 4. Note any compatibility concerns if switching from one to the other
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Analyze dependencies and imports for a file or package
3
+ argument-hint: [file-or-package-path]
4
+ ---
5
+
6
+ Analyze the dependency graph for `$1`:
7
+
8
+ 1. Read the file(s) and extract all imports
9
+ 2. Trace each import to its source (local file, package, or node built-in)
10
+ 3. Report:
11
+ - Direct dependencies (what this file imports)
12
+ - Reverse dependencies (what imports this file — use grep)
13
+ - Any circular dependencies detected
14
+ - Unused imports (imported but not referenced in code)
15
+ - Missing dependencies (referenced but not imported)
16
+ 4. If analyzing a package.json, check for unused or outdated packages
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Analyze uncommitted changes and summarize what was modified
3
+ argument-hint: [path-or-empty]
4
+ ---
5
+
6
+ Analyze the current git diff in the working directory $1:
7
+
8
+ 1. Run `git diff` and `git diff --cached` to see all changes
9
+ 2. Run `git status` to see untracked files
10
+ 3. For each changed file, summarize:
11
+ - What was added/removed/modified
12
+ - Whether the change looks correct
13
+ - Any potential issues introduced
14
+ 4. Suggest a commit message that accurately describes the changes
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Explain how a piece of code works end-to-end
3
+ argument-hint: [file-path-or-function-name]
4
+ ---
5
+
6
+ Explain how `$1` works:
7
+
8
+ 1. Find and read the relevant source code
9
+ 2. Trace the execution flow from entry point to completion
10
+ 3. Document:
11
+ - What it does (purpose)
12
+ - How it works (step by step)
13
+ - What calls it (callers)
14
+ - What it calls (dependencies)
15
+ - Edge cases and error handling
16
+ 4. Keep the explanation concise — focus on the non-obvious parts
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: Investigate a bug from an error message or symptom
3
+ argument-hint: [error-message-or-symptom]
4
+ ---
5
+
6
+ Investigate this bug: $1
7
+
8
+ 1. Search the codebase for the error message or related code
9
+ 2. Read the relevant source files
10
+ 3. Trace the execution path that leads to the error
11
+ 4. Identify the root cause (not just the symptom)
12
+ 5. Propose a fix with the exact code change needed
13
+ 6. Check if the fix could break anything else (grep for callers/dependents)
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: Profile a task for token usage, tool iterations, and efficiency
3
+ argument-hint: [task-description]
4
+ ---
5
+
6
+ Execute this task and report detailed performance metrics: $1
7
+
8
+ After completing the task, provide a performance report:
9
+ - **Token usage**: input tokens (system overhead vs content), output tokens
10
+ - **Tool iterations**: how many tool round-trips were needed
11
+ - **Tools used**: which tools were called and how many times each
12
+ - **Efficiency**: could this have been done in fewer iterations? What would you do differently?
13
+ - **Cache effectiveness**: were cache hits leveraged?
14
+
15
+ Be explicit about the numbers — this data is used to benchmark and optimize the system.
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: Code review a file or directory with actionable feedback
3
+ argument-hint: [file-or-directory-path]
4
+ ---
5
+
6
+ Review the code at `$1` with focus on:
7
+
8
+ 1. **Bugs and logic errors** — anything that would cause incorrect behavior
9
+ 2. **Security issues** — injection, auth bypass, data exposure
10
+ 3. **Performance** — obvious inefficiencies, N+1 patterns, unnecessary allocations
11
+ 4. **Readability** — unclear naming, missing context, overly complex logic
12
+
13
+ For each issue found, report:
14
+ - File and line number
15
+ - What's wrong
16
+ - A concrete fix (show the corrected code)
17
+
18
+ Skip style/formatting nits. Only report issues that matter.
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Deep search the codebase for a concept, pattern, or usage
3
+ argument-hint: [search-term-or-pattern]
4
+ ---
5
+
6
+ Search the codebase thoroughly for: $1
7
+
8
+ 1. Grep for the exact term across all source files
9
+ 2. Search for related terms (aliases, similar names, abbreviations)
10
+ 3. For each match, read enough context to understand usage
11
+ 4. Categorize findings:
12
+ - Definitions (where it's defined/declared)
13
+ - Usage (where it's called/referenced)
14
+ - Configuration (where it's configured/set)
15
+ - Tests (where it's tested)
16
+ 5. Summarize: what is it, where does it live, how is it used
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: Run tests for a package and report results
3
+ argument-hint: [package-path]
4
+ ---
5
+
6
+ Run the test suite at `$1`:
7
+
8
+ 1. Execute `npm test -- --run` (or the appropriate test command) in the directory
9
+ 2. Capture stdout and stderr
10
+ 3. Report:
11
+ - Total tests, passed, failed, skipped
12
+ - For each failure: test name, expected vs actual, file location
13
+ - Whether the failure is a real bug or a test issue
14
+
15
+ If no test command exists, check for `vitest`, `jest`, or `*.test.ts` files and run them directly.
@@ -0,0 +1,20 @@
1
+ {
2
+ "$comment": "Development environment - permissive defaults. Bash dangerous-command guard via blacklist; everything else allowed.",
3
+ "enabled": true,
4
+ "defaultPolicy": "allow",
5
+ "policies": [
6
+ {
7
+ "type": "bash-command",
8
+ "config": {
9
+ "allowedCommands": [],
10
+ "blockedCommands": ["rm -rf /", "sudo rm"],
11
+ "requireApprovalForDangerous": true
12
+ }
13
+ }
14
+ ],
15
+ "approvalHandler": "auto-approve",
16
+ "auditLog": {
17
+ "enabled": true,
18
+ "path": ".cortex/audit/permissions.log"
19
+ }
20
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "../packages/core/src/middleware/permissions/PermissionConfig.ts",
3
+ "enabled": true,
4
+ "defaultPolicy": "deny",
5
+ "policies": [
6
+ {
7
+ "type": "whitelist",
8
+ "priority": 40,
9
+ "enabled": true,
10
+ "config": {
11
+ "allowedTools": [
12
+ "read_file",
13
+ "write_file",
14
+ "edit_file",
15
+ "execute_bash",
16
+ "list_files",
17
+ "grep",
18
+ "glob",
19
+ "create_artifact"
20
+ ]
21
+ }
22
+ },
23
+ {
24
+ "type": "file-operation",
25
+ "priority": 80,
26
+ "enabled": true,
27
+ "config": {
28
+ "allowedPaths": [
29
+ "."
30
+ ],
31
+ "blockedPaths": [
32
+ "/etc",
33
+ "/root",
34
+ "/.git",
35
+ "/node_modules",
36
+ "/.env",
37
+ "/.ssh"
38
+ ],
39
+ "requireApprovalForDelete": true,
40
+ "requireApprovalForWrite": false,
41
+ "maxPathLength": 4096
42
+ }
43
+ },
44
+ {
45
+ "type": "bash-command",
46
+ "priority": 80,
47
+ "enabled": true,
48
+ "config": {
49
+ "allowedCommands": [],
50
+ "blockedCommands": [
51
+ "rm -rf /",
52
+ "sudo rm",
53
+ "format",
54
+ "mkfs",
55
+ "fdisk"
56
+ ],
57
+ "requireApprovalForDangerous": true,
58
+ "customDangerousPatterns": []
59
+ }
60
+ }
61
+ ],
62
+ "approvalHandler": "cli",
63
+ "auditLog": {
64
+ "enabled": true,
65
+ "path": ".cortex/audit/permissions.log",
66
+ "maxFileSizeBytes": 10485760,
67
+ "enableRotation": true,
68
+ "maxRotatedFiles": 5
69
+ },
70
+ "enableLogging": false
71
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$comment": "Production environment — strict deny-by-default. Whitelist allows the minimum read-only tools needed for read-only operation. defaultPolicy: deny + approvalHandler: deny-all means anything not on the allowlist is hard-blocked.",
3
+ "enabled": true,
4
+ "defaultPolicy": "deny",
5
+ "policies": [
6
+ {
7
+ "type": "whitelist",
8
+ "enabled": true,
9
+ "priority": 100,
10
+ "config": {
11
+ "allowedTools": [
12
+ "Read",
13
+ "Glob",
14
+ "Grep",
15
+ "BashOutput",
16
+ "WebSearch",
17
+ "WebFetch",
18
+ "GetMcpConfig",
19
+ "ListAvailableMcpServers",
20
+ "SearchMcpServers",
21
+ "ListSessions",
22
+ "LoadSession",
23
+ "RequestHistoricalContext",
24
+ "SearchConversationHistory",
25
+ "GetConversationSegment",
26
+ "ListCompactionBoundaries",
27
+ "TodoList",
28
+ "SearchTools"
29
+ ]
30
+ }
31
+ },
32
+ {
33
+ "type": "file-operation",
34
+ "enabled": true,
35
+ "priority": 80,
36
+ "config": {
37
+ "allowedPaths": ["./public", "./dist", "./build"],
38
+ "blockedPaths": ["/etc", "/root", "/sys", "/.git", "/node_modules", "./config", "./secrets", "./.env"],
39
+ "requireApprovalForDelete": false,
40
+ "requireApprovalForWrite": false
41
+ }
42
+ },
43
+ {
44
+ "type": "bash-command",
45
+ "enabled": true,
46
+ "priority": 50,
47
+ "config": {
48
+ "allowedCommands": [],
49
+ "blockedCommands": ["*"],
50
+ "requireApprovalForDangerous": false
51
+ }
52
+ }
53
+ ],
54
+ "approvalHandler": "deny-all",
55
+ "auditLog": {
56
+ "enabled": true,
57
+ "path": ".cortex/audit/permissions.log",
58
+ "maxFileSizeBytes": 10485760,
59
+ "enableRotation": true,
60
+ "maxRotatedFiles": 5
61
+ },
62
+ "enableLogging": true
63
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$comment": "Testing/CI environment - Auto-approve with minimal restrictions",
3
+ "enabled": true,
4
+ "defaultPolicy": "allow",
5
+ "policies": [
6
+ {
7
+ "type": "file-operation",
8
+ "config": {
9
+ "allowedPaths": ["/tmp/test-workspace"],
10
+ "blockedPaths": [],
11
+ "requireApprovalForDelete": false
12
+ }
13
+ }
14
+ ],
15
+ "approvalHandler": "auto-approve",
16
+ "auditLog": {
17
+ "enabled": false
18
+ }
19
+ }