opencode-deepa 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.
Files changed (45) hide show
  1. package/README.md +38 -0
  2. package/dist/cli/config-io.d.ts +23 -0
  3. package/dist/cli/config-io.d.ts.map +1 -0
  4. package/dist/cli/config-manager.d.ts +6 -0
  5. package/dist/cli/config-manager.d.ts.map +1 -0
  6. package/dist/cli/custom-skills.d.ts +26 -0
  7. package/dist/cli/custom-skills.d.ts.map +1 -0
  8. package/dist/cli/index.d.ts +3 -0
  9. package/dist/cli/index.d.ts.map +1 -0
  10. package/dist/cli/index.js +706 -0
  11. package/dist/cli/install.d.ts +3 -0
  12. package/dist/cli/install.d.ts.map +1 -0
  13. package/dist/cli/paths.d.ts +10 -0
  14. package/dist/cli/paths.d.ts.map +1 -0
  15. package/dist/cli/providers.d.ts +3 -0
  16. package/dist/cli/providers.d.ts.map +1 -0
  17. package/dist/cli/system.d.ts +7 -0
  18. package/dist/cli/system.d.ts.map +1 -0
  19. package/dist/cli/types.d.ts +37 -0
  20. package/dist/cli/types.d.ts.map +1 -0
  21. package/dist/config/agent-mcps.d.ts +19 -0
  22. package/dist/config/agent-mcps.d.ts.map +1 -0
  23. package/dist/config/mcp-types.d.ts +4 -0
  24. package/dist/config/mcp-types.d.ts.map +1 -0
  25. package/dist/index.d.ts +24 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +305 -0
  28. package/dist/index.test.d.ts +2 -0
  29. package/dist/index.test.d.ts.map +1 -0
  30. package/dist/skills/index.d.ts +53 -0
  31. package/dist/skills/index.d.ts.map +1 -0
  32. package/dist/tools/codeindexScan.d.ts +7 -0
  33. package/dist/tools/codeindexScan.d.ts.map +1 -0
  34. package/dist/tools/deepaSummary/index.d.ts +7 -0
  35. package/dist/tools/deepaSummary/index.d.ts.map +1 -0
  36. package/dist/tools/fastcode.d.ts +7 -0
  37. package/dist/tools/fastcode.d.ts.map +1 -0
  38. package/dist/tools/gitingest.d.ts +10 -0
  39. package/dist/tools/gitingest.d.ts.map +1 -0
  40. package/dist/tools/index.d.ts +5 -0
  41. package/dist/tools/index.d.ts.map +1 -0
  42. package/opencode-deepa.schema.json +74 -0
  43. package/package.json +68 -0
  44. package/src/skills/deepa-planning/SKILL.md +98 -0
  45. package/src/skills/index.ts +142 -0
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "opencode-deepa",
3
+ "version": "1.0.0",
4
+ "description": "DeepA - Orchestrator-like agent plugin for OpenCode that delegates tasks to specialist agents",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "opencode-deepa": "./dist/cli/index.js"
9
+ },
10
+ "type": "module",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "opencode",
14
+ "opencode-plugin",
15
+ "ai",
16
+ "agents",
17
+ "orchestration",
18
+ "llm"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/yourusername/opencode-deepa.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/yourusername/opencode-deepa/issues"
26
+ },
27
+ "homepage": "https://github.com/yourusername/opencode-deepa#readme",
28
+ "files": [
29
+ "dist",
30
+ "src/skills",
31
+ "opencode-deepa.schema.json",
32
+ "README.md",
33
+ "LICENSE"
34
+ ],
35
+ "scripts": {
36
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && tsc --emitDeclarationOnly && bun run generate-schema",
37
+ "generate-schema": "bun run scripts/generate-schema.ts",
38
+ "typecheck": "tsc --noEmit",
39
+ "test": "bun test",
40
+ "lint": "biome lint .",
41
+ "format": "biome format . --write",
42
+ "check": "biome check --write .",
43
+ "check:ci": "biome check .",
44
+ "dev": "bun run build && opencode",
45
+ "prepublishOnly": "bun run build",
46
+ "release:patch": "npm version patch && git push --follow-tags && npm publish",
47
+ "release:minor": "npm version minor && git push --follow-tags && npm publish",
48
+ "release:major": "npm version major && git push --follow-tags && npm publish"
49
+ },
50
+ "dependencies": {
51
+ "@ast-grep/cli": "^0.40.0",
52
+ "@modelcontextprotocol/sdk": "^1.26.0",
53
+ "@opencode-ai/plugin": "^1.2.6",
54
+ "@opencode-ai/sdk": "^1.2.6",
55
+ "vscode-jsonrpc": "^8.2.0",
56
+ "vscode-languageserver-protocol": "^3.17.5",
57
+ "zod": "^4.3.6"
58
+ },
59
+ "devDependencies": {
60
+ "@biomejs/biome": "2.4.2",
61
+ "@types/bun": "^1.3.10",
62
+ "bun-types": "1.3.9",
63
+ "typescript": "^5.9.3"
64
+ },
65
+ "trustedDependencies": [
66
+ "@ast-grep/cli"
67
+ ]
68
+ }
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: deepa-planning
3
+ description: Strategic planning and task decomposition for complex coding tasks
4
+ ---
5
+
6
+ # DeepA Planning Skill
7
+
8
+ You help users break down complex coding tasks into manageable, executable steps with clear delegation to specialist agents.
9
+
10
+ ## When to Use
11
+
12
+ - User presents a high-level goal that requires multiple steps
13
+ - Task involves architectural decisions or coordination between different parts of the codebase
14
+ - User needs a structured plan before implementation begins
15
+ - Complex task that would benefit from parallel execution by specialist agents
16
+
17
+ ## Workflow
18
+
19
+ ### Step 1: Understand the Goal
20
+
21
+ 1. **Parse the user's request** - Identify explicit requirements and implicit needs
22
+ 2. **Ask clarifying questions** - Use the `ask-questions-if-underspecified` skill if the goal is vague or has multiple interpretations
23
+ 3. **Determine success criteria** - Define what "done" looks like for this task
24
+
25
+ ### Step 2: Analyze the Codebase
26
+
27
+ 1. **Delegate to @explorer** - Discover relevant files, patterns, and existing implementations
28
+ 2. **Delegate to @librarian** - Check for relevant library documentation or API references
29
+ 3. **Review existing code** - Understand current structure, conventions, and potential integration points
30
+
31
+ ### Step 3: Create the Plan
32
+
33
+ 1. **Break down into tasks** - Divide the goal into bite-sized, independent tasks (ideal size: 20-60 minutes each)
34
+ 2. **Identify dependencies** - Determine which tasks must be sequential vs. which can run in parallel
35
+ 3. **Assign specialist agents** - For each task, determine the optimal agent (@fixer for implementation, @designer for UI, etc.)
36
+ 4. **Define deliverables** - Specify what each task should produce (code changes, documentation, tests, etc.)
37
+
38
+ ### Step 4: Present the Plan
39
+
40
+ 1. **Show the task breakdown** - List each task with estimated effort and assigned agent
41
+ 2. **Highlight parallelization opportunities** - Show which tasks can run simultaneously
42
+ 3. **Request approval** - Ask the user to confirm or adjust the plan before execution
43
+
44
+ ### Step 5: Execute and Monitor
45
+
46
+ 1. **Fire parallel research/implementation** - Delegate to specialists based on the plan
47
+ 2. **Integrate results** - Combine outputs from specialist agents
48
+ 3. **Verify completion** - Run `lsp_diagnostics` and confirm solution meets requirements
49
+ 4. **Suggest simplification** - Recommend the `simplify` skill when applicable
50
+
51
+ ## Task Format
52
+
53
+ Each task should include:
54
+ - **ID**: Unique identifier (e.g., TASK-001)
55
+ - **Description**: Clear, concise statement of what needs to be done
56
+ - **Estimated Effort**: Time range (e.g., "20-40 minutes")
57
+ - **Primary Agent**: @fixer, @designer, @explorer, @librarian, or @oracle
58
+ - **Dependencies**: List of task IDs that must complete first
59
+ - **Deliverables**: Specific outputs expected (files to modify, tests to write, etc.)
60
+
61
+ ## Example Plan
62
+
63
+ For a request like "Add user authentication to the web app":
64
+
65
+ ```
66
+ TASK-001: Design authentication flow
67
+ - Effort: 15-25 minutes
68
+ - Agent: @oracle
69
+ - Dependencies: None
70
+ - Deliverables: Authentication sequence diagram, token storage decision
71
+
72
+ TASK-002: Implement auth service
73
+ - Effort: 30-50 minutes
74
+ - Agent: @fixer
75
+ - Dependencies: TASK-001
76
+ - Deliverables: AuthService class with login/logout/token refresh methods
77
+
78
+ TASK-003: Create login/logout UI components
79
+ - Effort: 25-40 minutes
80
+ - Agent: @designer
81
+ - Dependencies: TASK-001
82
+ - Deliverables: LoginForm and LogoutButton components
83
+
84
+ TASK-004: Protect API routes
85
+ - Effort: 20-30 minutes
86
+ - Agent: @fixer
87
+ - Dependencies: TASK-002
88
+ - Deliverables: Middleware to validate tokens on protected routes
89
+
90
+ TASK-005: Add authentication tests
91
+ - Effort: 20-30 minutes
92
+ - Agent: @fixer
93
+ - Dependencies: TASK-002, TASK-003, TASK-004
94
+ - Deliverables: Unit and integration tests for auth flow
95
+ ```
96
+
97
+ Tasks 002 and 003 can run in parallel after TASK-001 completes.
98
+ Tasks 004 depends on TASK-002, and TASK-005 depends on all previous tasks.
@@ -0,0 +1,142 @@
1
+ /**
2
+ * A recommended skill to install via `npx skills add`.
3
+ */
4
+ export interface RecommendedSkill {
5
+ /** Human-readable name for prompts */
6
+ name: string;
7
+ /** GitHub repo URL for `npx skills add` */
8
+ repo: string;
9
+ /** Skill name within the repo (--skill flag) */
10
+ skillName: string;
11
+ /** List of agents that should auto-allow this skill */
12
+ allowedAgents: string[];
13
+ /** Description shown to user during install */
14
+ description: string;
15
+ /** Optional commands to run after the skill is added */
16
+ postInstallCommands?: string[];
17
+ }
18
+
19
+ /**
20
+ * List of recommended skills.
21
+ * Add new skills here to include them in the installation flow.
22
+ */
23
+ export const RECOMMENDED_SKILLS: RecommendedSkill[] = [
24
+ {
25
+ name: 'simplify',
26
+ repo: 'https://github.com/brianlovin/claude-config',
27
+ skillName: 'simplify',
28
+ allowedAgents: ['deepa', 'deepa-builder'],
29
+ description: 'YAGNI code simplification expert',
30
+ },
31
+ {
32
+ name: 'agent-browser',
33
+ repo: 'https://github.com/vercel-labs/agent-browser',
34
+ skillName: 'agent-browser',
35
+ allowedAgents: ['deepa', 'deepa-planner', 'deepa-builder'],
36
+ description: 'High-performance browser automation',
37
+ postInstallCommands: [
38
+ 'npm install -g agent-browser',
39
+ 'agent-browser install',
40
+ ],
41
+ },
42
+ {
43
+ name: 'ask-questions-if-underspecified',
44
+ repo: 'https://github.com/smartfrog/opencode-froggy',
45
+ skillName: 'ask-questions-if-underspecified',
46
+ allowedAgents: ['deepa', 'deepa-planner', 'deepa-builder'],
47
+ description: 'Clarify requirements before implementing. Use when serious doubts arise.',
48
+ },
49
+ ];
50
+
51
+ /**
52
+ * Install a skill using `npx skills add`.
53
+ * @param skill - The skill to install
54
+ * @returns True if installation succeeded, false otherwise
55
+ */
56
+ export function installSkill(skill: RecommendedSkill): boolean {
57
+ // This would normally use bun.spawnSync but we'll simplify for now
58
+ // In a real implementation, this would call the skills CLI
59
+ console.log(`Would install skill: ${skill.name} from ${skill.repo}`);
60
+ return true;
61
+ }
62
+
63
+ /**
64
+ * A skill that is managed externally (e.g. user-installed) and needs
65
+ * permission grants but is NOT installed by this plugin's CLI.
66
+ */
67
+ export interface PermissionOnlySkill {
68
+ /** Skill name — must match the name OpenCode uses for permission checks */
69
+ name: string;
70
+ /** List of agents that should auto-allow this skill */
71
+ allowedAgents: string[];
72
+ /** Human-readable description (for documentation only) */
73
+ description: string;
74
+ }
75
+
76
+ /**
77
+ * Skills managed externally (not installed by this plugin's CLI).
78
+ * Entries here only affect agent permission grants — nothing is installed.
79
+ */
80
+ export const PERMISSION_ONLY_SKILLS: PermissionOnlySkill[] = [
81
+ {
82
+ name: 'git-check',
83
+ allowedAgents: ['deepa', 'deepa-planner', 'deepa-builder'],
84
+ description: 'Check and configure git user name and email, and provide push/commit capabilities.',
85
+ },
86
+ ];
87
+
88
+ /**
89
+ * Get permission presets for a specific agent based on recommended skills.
90
+ * @param agentName - The name of the agent
91
+ * @param skillList - Optional explicit list of skills to allow (overrides recommendations)
92
+ * @returns Permission rules for the skill permission type
93
+ */
94
+ export function getSkillPermissionsForAgent(
95
+ agentName: string,
96
+ skillList?: string[],
97
+ ): Record<string, 'allow' | 'ask' | 'deny'> {
98
+ // Orchestrator gets all skills by default, others are restricted
99
+ const permissions: Record<string, 'allow' | 'ask' | 'deny'> = {
100
+ '*': agentName === 'deepa' ? 'allow' : 'deny',
101
+ };
102
+
103
+ // If the user provided an explicit skill list (even empty), honor it
104
+ if (skillList) {
105
+ permissions['*'] = 'deny';
106
+ for (const name of skillList) {
107
+ if (name === '*') {
108
+ permissions['*'] = 'allow';
109
+ } else if (name.startsWith('!')) {
110
+ permissions[name.slice(1)] = 'deny';
111
+ } else {
112
+ permissions[name] = 'allow';
113
+ }
114
+ }
115
+ return permissions;
116
+ }
117
+
118
+ // Otherwise, use recommended defaults
119
+ for (const skill of RECOMMENDED_SKILLS) {
120
+ const isAllowed =
121
+ skill.allowedAgents.includes('*') ||
122
+ skill.allowedAgents.includes(agentName);
123
+ if (isAllowed) {
124
+ permissions[skill.skillName] = 'allow';
125
+ }
126
+ }
127
+
128
+ // Apply permissions from bundled custom skills
129
+ // (none currently)
130
+
131
+ // Apply permissions for externally-managed skills (not installed by this plugin)
132
+ for (const skill of PERMISSION_ONLY_SKILLS) {
133
+ const isAllowed =
134
+ skill.allowedAgents.includes('*') ||
135
+ skill.allowedAgents.includes(agentName);
136
+ if (isAllowed) {
137
+ permissions[skill.name] = 'allow';
138
+ }
139
+ }
140
+
141
+ return permissions;
142
+ }