cortex-agents 1.1.0 → 2.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.
- package/.opencode/agents/build.md +97 -11
- package/.opencode/agents/debug.md +24 -2
- package/.opencode/agents/devops.md +1 -2
- package/.opencode/agents/fullstack.md +1 -2
- package/.opencode/agents/plan.md +16 -7
- package/.opencode/agents/security.md +1 -2
- package/.opencode/agents/testing.md +1 -2
- package/.opencode/skills/api-design/SKILL.md +348 -0
- package/.opencode/skills/architecture-patterns/SKILL.md +323 -0
- package/.opencode/skills/backend-development/SKILL.md +329 -0
- package/.opencode/skills/code-quality/SKILL.md +12 -0
- package/.opencode/skills/database-design/SKILL.md +347 -0
- package/.opencode/skills/deployment-automation/SKILL.md +7 -0
- package/.opencode/skills/design-patterns/SKILL.md +295 -0
- package/.opencode/skills/desktop-development/SKILL.md +295 -0
- package/.opencode/skills/frontend-development/SKILL.md +210 -0
- package/.opencode/skills/mobile-development/SKILL.md +407 -0
- package/.opencode/skills/performance-optimization/SKILL.md +330 -0
- package/.opencode/skills/testing-strategies/SKILL.md +33 -0
- package/README.md +309 -111
- package/dist/cli.js +264 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -0
- package/dist/plugin.js +3 -2
- package/dist/registry.d.ts +45 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +140 -0
- package/dist/tools/cortex.d.ts.map +1 -1
- package/dist/tools/cortex.js +3 -4
- package/dist/tools/docs.d.ts +52 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +328 -0
- package/dist/tools/task.d.ts +20 -0
- package/dist/tools/task.d.ts.map +1 -0
- package/dist/tools/task.js +302 -0
- package/dist/tools/worktree.d.ts +32 -0
- package/dist/tools/worktree.d.ts.map +1 -1
- package/dist/tools/worktree.js +403 -2
- package/dist/utils/plan-extract.d.ts +37 -0
- package/dist/utils/plan-extract.d.ts.map +1 -0
- package/dist/utils/plan-extract.js +137 -0
- package/dist/utils/propagate.d.ts +22 -0
- package/dist/utils/propagate.d.ts.map +1 -0
- package/dist/utils/propagate.js +64 -0
- package/dist/utils/worktree-detect.d.ts +20 -0
- package/dist/utils/worktree-detect.d.ts.map +1 -0
- package/dist/utils/worktree-detect.js +42 -0
- package/package.json +17 -7
- package/.opencode/skills/web-development/SKILL.md +0 -122
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Information about the current worktree context.
|
|
3
|
+
*/
|
|
4
|
+
export interface WorktreeInfo {
|
|
5
|
+
/** True if the current directory is a linked worktree (not the main working tree) */
|
|
6
|
+
isWorktree: boolean;
|
|
7
|
+
/** The current branch name */
|
|
8
|
+
currentBranch: string;
|
|
9
|
+
/** The absolute path to the main working tree (null if detection fails) */
|
|
10
|
+
mainWorktreePath: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Detect whether the current git directory is a linked worktree.
|
|
14
|
+
*
|
|
15
|
+
* Uses the canonical method: compare resolved absolute paths of
|
|
16
|
+
* `git rev-parse --git-dir` vs `--git-common-dir`.
|
|
17
|
+
* In a linked worktree these differ; in the main tree they're identical.
|
|
18
|
+
*/
|
|
19
|
+
export declare function detectWorktreeInfo(cwd: string): Promise<WorktreeInfo>;
|
|
20
|
+
//# sourceMappingURL=worktree-detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-detect.d.ts","sourceRoot":"","sources":["../../src/utils/worktree-detect.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,UAAU,EAAE,OAAO,CAAC;IACpB,8BAA8B;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAqC3E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
/**
|
|
3
|
+
* Detect whether the current git directory is a linked worktree.
|
|
4
|
+
*
|
|
5
|
+
* Uses the canonical method: compare resolved absolute paths of
|
|
6
|
+
* `git rev-parse --git-dir` vs `--git-common-dir`.
|
|
7
|
+
* In a linked worktree these differ; in the main tree they're identical.
|
|
8
|
+
*/
|
|
9
|
+
export async function detectWorktreeInfo(cwd) {
|
|
10
|
+
const result = {
|
|
11
|
+
isWorktree: false,
|
|
12
|
+
currentBranch: "",
|
|
13
|
+
mainWorktreePath: null,
|
|
14
|
+
};
|
|
15
|
+
// Get current branch
|
|
16
|
+
try {
|
|
17
|
+
const branch = await Bun.$ `git -C ${cwd} branch --show-current`.quiet().text();
|
|
18
|
+
result.currentBranch = branch.trim();
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
result.currentBranch = "(unknown)";
|
|
22
|
+
}
|
|
23
|
+
// Compare git-dir and git-common-dir
|
|
24
|
+
try {
|
|
25
|
+
const gitDirRaw = await Bun.$ `git -C ${cwd} rev-parse --git-dir`.quiet().text();
|
|
26
|
+
const commonDirRaw = await Bun.$ `git -C ${cwd} rev-parse --git-common-dir`.quiet().text();
|
|
27
|
+
// Resolve both to absolute paths for reliable comparison
|
|
28
|
+
const absGitDir = path.resolve(cwd, gitDirRaw.trim());
|
|
29
|
+
const absCommonDir = path.resolve(cwd, commonDirRaw.trim());
|
|
30
|
+
result.isWorktree = absGitDir !== absCommonDir;
|
|
31
|
+
// If it's a worktree, the main working tree is one level above the common .git dir
|
|
32
|
+
if (result.isWorktree) {
|
|
33
|
+
// git-common-dir points to the main repo's .git directory
|
|
34
|
+
// The main worktree is its parent
|
|
35
|
+
result.mainWorktreePath = path.dirname(absCommonDir);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// If detection fails, assume not a worktree
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortex-agents",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "Supercharge OpenCode with structured workflows, intelligent agents, and automated development practices",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "tsc",
|
|
17
17
|
"prepare": "npm run build",
|
|
18
|
-
"postinstall": "echo 'Run: npx cortex-agents install'"
|
|
18
|
+
"postinstall": "echo 'Run: npx cortex-agents install && npx cortex-agents configure'"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
21
21
|
"opencode",
|
|
@@ -27,17 +27,23 @@
|
|
|
27
27
|
"coding",
|
|
28
28
|
"worktree",
|
|
29
29
|
"git",
|
|
30
|
-
"planning"
|
|
30
|
+
"planning",
|
|
31
|
+
"mermaid",
|
|
32
|
+
"documentation",
|
|
33
|
+
"notifications",
|
|
34
|
+
"workflow",
|
|
35
|
+
"pull-request",
|
|
36
|
+
"developer-tools"
|
|
31
37
|
],
|
|
32
38
|
"author": "",
|
|
33
39
|
"license": "Apache-2.0",
|
|
34
40
|
"repository": {
|
|
35
41
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/
|
|
42
|
+
"url": "https://github.com/ps-carvalho/cortex-agents"
|
|
37
43
|
},
|
|
38
|
-
"homepage": "https://github.com/
|
|
44
|
+
"homepage": "https://github.com/ps-carvalho/cortex-agents#readme",
|
|
39
45
|
"bugs": {
|
|
40
|
-
"url": "https://github.com/
|
|
46
|
+
"url": "https://github.com/ps-carvalho/cortex-agents/issues"
|
|
41
47
|
},
|
|
42
48
|
"engines": {
|
|
43
49
|
"node": ">=18.0.0"
|
|
@@ -49,7 +55,11 @@
|
|
|
49
55
|
"@opencode-ai/plugin": "^1.0.0",
|
|
50
56
|
"@types/bun": "^1.3.9",
|
|
51
57
|
"@types/node": "^20.0.0",
|
|
58
|
+
"@types/prompts": "^2.4.9",
|
|
52
59
|
"bun-types": "^1.0.0",
|
|
53
60
|
"typescript": "^5.0.0"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"prompts": "^2.4.2"
|
|
54
64
|
}
|
|
55
65
|
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: web-development
|
|
3
|
-
description: Full-stack web development patterns, best practices, and architectural guidance for modern web applications
|
|
4
|
-
license: Apache-2.0
|
|
5
|
-
compatibility: opencode
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Web Development Skill
|
|
9
|
-
|
|
10
|
-
This skill provides comprehensive guidance for building modern web applications.
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
Use this skill when:
|
|
15
|
-
- Starting a new web project
|
|
16
|
-
- Adding features to existing web apps
|
|
17
|
-
- Refactoring frontend or backend code
|
|
18
|
-
- Designing APIs
|
|
19
|
-
- Choosing technology stack
|
|
20
|
-
|
|
21
|
-
## Frontend Architecture
|
|
22
|
-
|
|
23
|
-
### Component Design
|
|
24
|
-
- Single Responsibility Principle
|
|
25
|
-
- Composition over inheritance
|
|
26
|
-
- Controlled vs uncontrolled components
|
|
27
|
-
- Container/Presentational pattern
|
|
28
|
-
- Custom hooks for reusable logic
|
|
29
|
-
|
|
30
|
-
### State Management
|
|
31
|
-
- Local state (useState, useReducer)
|
|
32
|
-
- Global state (Redux, Zustand, Context)
|
|
33
|
-
- Server state (React Query, SWR)
|
|
34
|
-
- Form state (React Hook Form)
|
|
35
|
-
- URL state (React Router)
|
|
36
|
-
|
|
37
|
-
### Performance Optimization
|
|
38
|
-
- Memoization (useMemo, useCallback, React.memo)
|
|
39
|
-
- Code splitting and lazy loading
|
|
40
|
-
- Virtualization for long lists
|
|
41
|
-
- Image optimization
|
|
42
|
-
- Bundle size monitoring
|
|
43
|
-
|
|
44
|
-
### Styling Approaches
|
|
45
|
-
- CSS-in-JS (styled-components, emotion)
|
|
46
|
-
- Utility-first CSS (Tailwind)
|
|
47
|
-
- CSS Modules
|
|
48
|
-
- SCSS/Sass
|
|
49
|
-
- CSS Variables for theming
|
|
50
|
-
|
|
51
|
-
## Backend Architecture
|
|
52
|
-
|
|
53
|
-
### API Design
|
|
54
|
-
- RESTful principles
|
|
55
|
-
- GraphQL schema design
|
|
56
|
-
- Versioning strategies
|
|
57
|
-
- Pagination patterns
|
|
58
|
-
- Filtering and sorting
|
|
59
|
-
|
|
60
|
-
### Database Patterns
|
|
61
|
-
- Repository pattern
|
|
62
|
-
- Unit of Work
|
|
63
|
-
- CQRS (Command Query Responsibility Segregation)
|
|
64
|
-
- Event sourcing
|
|
65
|
-
- Database migrations
|
|
66
|
-
|
|
67
|
-
### Authentication & Authorization
|
|
68
|
-
- JWT implementation
|
|
69
|
-
- Session-based auth
|
|
70
|
-
- OAuth 2.0 / OpenID Connect
|
|
71
|
-
- Role-based access control
|
|
72
|
-
- API key management
|
|
73
|
-
|
|
74
|
-
### Error Handling
|
|
75
|
-
- Consistent error responses
|
|
76
|
-
- HTTP status codes
|
|
77
|
-
- Error logging and monitoring
|
|
78
|
-
- User-friendly error messages
|
|
79
|
-
- Retry strategies
|
|
80
|
-
|
|
81
|
-
## Fullstack Patterns
|
|
82
|
-
|
|
83
|
-
### Data Flow
|
|
84
|
-
- Unidirectional data flow
|
|
85
|
-
- State normalization
|
|
86
|
-
- Optimistic updates
|
|
87
|
-
- Real-time updates (WebSockets, SSE)
|
|
88
|
-
- Offline-first architecture
|
|
89
|
-
|
|
90
|
-
### Security
|
|
91
|
-
- Input validation and sanitization
|
|
92
|
-
- Output encoding
|
|
93
|
-
- CSRF protection
|
|
94
|
-
- Content Security Policy
|
|
95
|
-
- Secure headers
|
|
96
|
-
|
|
97
|
-
### Testing Strategy
|
|
98
|
-
- Unit tests for business logic
|
|
99
|
-
- Integration tests for APIs
|
|
100
|
-
- Component tests for UI
|
|
101
|
-
- E2E tests for critical paths
|
|
102
|
-
- Visual regression testing
|
|
103
|
-
|
|
104
|
-
## Technology Recommendations
|
|
105
|
-
|
|
106
|
-
### Frontend Stacks
|
|
107
|
-
- React + TypeScript + Vite + Tailwind
|
|
108
|
-
- Vue 3 + TypeScript + Vite + Pinia
|
|
109
|
-
- Next.js (fullstack React)
|
|
110
|
-
- SvelteKit
|
|
111
|
-
|
|
112
|
-
### Backend Stacks
|
|
113
|
-
- Node.js + Express/Fastify/NestJS
|
|
114
|
-
- Python + FastAPI/Django
|
|
115
|
-
- Go + Gin/Echo
|
|
116
|
-
- Rust + Actix/Axum
|
|
117
|
-
|
|
118
|
-
### Databases
|
|
119
|
-
- PostgreSQL (relational)
|
|
120
|
-
- MongoDB (document)
|
|
121
|
-
- Redis (cache/sessions)
|
|
122
|
-
- Elasticsearch (search)
|