devhive 0.1.19__tar.gz → 0.1.20__tar.gz
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.
- {devhive-0.1.19 → devhive-0.1.20}/PKG-INFO +1 -1
- {devhive-0.1.19 → devhive-0.1.20}/devhive/cli.py +75 -55
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/task_orchestrator.py +2 -2
- {devhive-0.1.19 → devhive-0.1.20}/devhive/server.py +4 -4
- {devhive-0.1.19 → devhive-0.1.20}/devhive.egg-info/PKG-INFO +1 -1
- {devhive-0.1.19 → devhive-0.1.20}/pyproject.toml +1 -1
- {devhive-0.1.19 → devhive-0.1.20}/setup.py +1 -1
- {devhive-0.1.19 → devhive-0.1.20}/LICENSE +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/README.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/__init__.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/__init__.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/architect.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/archivist.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/auditor.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/base_agent.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/ceo.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/developer.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/explorer.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/proposal.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/qa.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/agents/task_agent.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/__init__.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/artifact_manager.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/context_optimizer.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/context_router.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/dependency_manager.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/llm.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/memory_store.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/project_state_manager.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/prompt_builder.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/core/task_queue.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/auditor/owasp_security_audit.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/auditor/performance_bottlenecks.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/developer/backend-architect.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/developer/backend-security-coder.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/explorer/edge_case_hunter.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/explorer/nfr_checklist.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/global/inclusive_language.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/global/json_strictness.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/skills/global/security_mandates.md +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/utils/__init__.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/utils/filesystem.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive/utils/validation.py +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive.egg-info/SOURCES.txt +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive.egg-info/dependency_links.txt +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive.egg-info/entry_points.txt +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive.egg-info/requires.txt +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/devhive.egg-info/top_level.txt +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/setup.cfg +0 -0
- {devhive-0.1.19 → devhive-0.1.20}/tests/test_parallel_development.py +0 -0
|
@@ -5,55 +5,55 @@ import json
|
|
|
5
5
|
import os
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
|
-
# Try to find default
|
|
9
|
-
# This assumes the package structure allows finding the file in the root
|
|
8
|
+
# Try to find default skill file location relative to package
|
|
10
9
|
PACKAGE_ROOT = Path(__file__).parent.parent
|
|
11
|
-
|
|
10
|
+
DEFAULT_SKILL_PATH = PACKAGE_ROOT / "skills" / "devhive_workflow.md"
|
|
12
11
|
|
|
13
|
-
def
|
|
14
|
-
"""Reads the
|
|
15
|
-
if
|
|
16
|
-
return
|
|
12
|
+
def get_default_skill_content():
|
|
13
|
+
"""Reads the devhive_workflow.md content from the package source."""
|
|
14
|
+
if DEFAULT_SKILL_PATH.exists():
|
|
15
|
+
return DEFAULT_SKILL_PATH.read_text()
|
|
17
16
|
|
|
18
|
-
# Fallback content if file is
|
|
19
|
-
return """# DevHive
|
|
17
|
+
# Fallback content if file is missing
|
|
18
|
+
return """# DevHive Workflow Orchestrator
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
Your goal is to manage the full software development lifecycle using the DevHive MCP server tools.
|
|
20
|
+
This skill defines the autonomous execution loop for the DevHive AI software development pipeline.
|
|
23
21
|
|
|
24
|
-
## Core
|
|
22
|
+
## Core Rules
|
|
23
|
+
1. **Autonomous Execution**: Run the entire DevHive pipeline autonomously. Do not stop to ask the user for permission between each agent step unless an unrecoverable error occurs or the Explorer agent explicitly asks a `clarification_question`.
|
|
24
|
+
2. **Subagent Delegation**: You MUST use the `Task` tool with `subagent_type="general"` to execute the prompts generated by the MCP server. Do not execute the prompts yourself in the main context.
|
|
25
|
+
3. **Strict JSON**: The DevHive MCP server expects strict JSON. Instruct the subagent to output ONLY valid JSON without markdown formatting.
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
- Use `devhive_start_pipeline(project_name, requirements)` to initialize a project or get the next task.
|
|
28
|
-
- If the project already exists, this will resume from the last state.
|
|
27
|
+
## The Execution Loop
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
- The output of `devhive_start_pipeline` (or `devhive_submit_result`) provides a `next_task` object containing:
|
|
32
|
-
- `agent`: The sub-agent role (e.g., Explorer, Developer).
|
|
33
|
-
- `system_prompt`: The specific instructions for this sub-agent.
|
|
34
|
-
- `user_prompt`: The context and requirements for the task.
|
|
35
|
-
- You must execute this task.
|
|
36
|
-
- **OpenCode**: Use the `Task` tool with the provided prompts.
|
|
37
|
-
- **Copilot**: Act as the sub-agent directly using the prompts.
|
|
29
|
+
When a user asks you to build a feature or start a project using DevHive, follow this exact procedure:
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
### 1. Initialization
|
|
32
|
+
Use the `devhive_start_pipeline` tool.
|
|
33
|
+
- `project_name`: A short snake_case identifier derived from the request.
|
|
34
|
+
- `requirements`: The user's full request.
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
The tool will return a JSON envelope containing `status`, `agent`, `system_prompt`, `user_prompt`, `expected_keys`, and `task_description`.
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- `devhive_search_memory`: Retrieve context from previous steps.
|
|
49
|
-
- `devhive_get_memory_stats`: Check project memory usage.
|
|
50
|
-
- `devhive_get_recent_memories`: See recent project activity.
|
|
38
|
+
### 2. Main Loop
|
|
39
|
+
While `status` is `"pending"`:
|
|
51
40
|
|
|
52
|
-
|
|
41
|
+
**A. Launch Subagent**
|
|
42
|
+
Use the `Task` tool with `subagent_type="general"`.
|
|
43
|
+
- `description`: The `task_description` from the envelope.
|
|
44
|
+
- `prompt`: Combine the `system_prompt` and `user_prompt` from the envelope. Append this CRITICAL instruction: *"You must ONLY output valid JSON containing these exact keys: {expected_keys}. Do not include any other text, markdown formatting, or explanations."*
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
46
|
+
**B. Submit Result**
|
|
47
|
+
Once the subagent returns its JSON output, use the `devhive_submit_result` tool.
|
|
48
|
+
- `project_name`: The current project name.
|
|
49
|
+
- `agent_name`: The `agent` from the current envelope.
|
|
50
|
+
- `llm_response`: The raw JSON output from the subagent.
|
|
51
|
+
|
|
52
|
+
**C. Process Server Response**
|
|
53
|
+
The tool will return a new envelope:
|
|
54
|
+
- If `status` == `"success"`: Print a brief update to the user. If `next_task` is present, update your envelope and repeat the loop.
|
|
55
|
+
- If `status` == `"error"`: The envelope has an error message. Launch the subagent again, provide the error and the previous output, and ask it to fix the JSON structure. Retry up to 3 times.
|
|
56
|
+
- If `status` == `"complete"`: The pipeline is finished. Give the user a final summary and exit the loop.
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
59
|
def configure():
|
|
@@ -68,24 +68,24 @@ def configure():
|
|
|
68
68
|
print("Invalid choice. Please type 'opencode', 'copilot', or 'both'.")
|
|
69
69
|
|
|
70
70
|
# 2. Locate source file
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
cwd_skill = Path("skills/devhive_workflow.md").resolve()
|
|
72
|
+
pkg_skill = DEFAULT_SKILL_PATH.resolve()
|
|
73
73
|
|
|
74
74
|
source_to_use = None
|
|
75
75
|
|
|
76
|
-
if
|
|
77
|
-
print(f"[+] Found
|
|
78
|
-
source_to_use =
|
|
79
|
-
elif
|
|
80
|
-
print(f"[+] Found
|
|
81
|
-
source_to_use =
|
|
76
|
+
if cwd_skill.exists():
|
|
77
|
+
print(f"[+] Found skill file in current directory: {cwd_skill}")
|
|
78
|
+
source_to_use = cwd_skill
|
|
79
|
+
elif pkg_skill.exists():
|
|
80
|
+
print(f"[+] Found skill file in package: {pkg_skill}")
|
|
81
|
+
source_to_use = pkg_skill
|
|
82
82
|
else:
|
|
83
|
-
print("[-]
|
|
84
|
-
print("[*] Using embedded default
|
|
85
|
-
temp_path = Path("
|
|
83
|
+
print("[-] skills/devhive_workflow.md not found.")
|
|
84
|
+
print("[*] Using embedded default skill prompt.")
|
|
85
|
+
temp_path = Path("devhive_workflow.md").resolve()
|
|
86
86
|
try:
|
|
87
87
|
with open(temp_path, "w") as f:
|
|
88
|
-
f.write(
|
|
88
|
+
f.write(get_default_skill_content())
|
|
89
89
|
print(f"[+] Created temporary source file at: {temp_path}")
|
|
90
90
|
source_to_use = temp_path
|
|
91
91
|
except Exception as e:
|
|
@@ -94,16 +94,36 @@ def configure():
|
|
|
94
94
|
|
|
95
95
|
# 3. Configure OpenCode
|
|
96
96
|
if choice in ["opencode", "both"]:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
# Remove legacy agent
|
|
98
|
+
old_agent_dir = Path.home() / ".config" / "opencode" / "agents"
|
|
99
|
+
old_agent = old_agent_dir / "DevHive0119.md"
|
|
100
|
+
if old_agent.exists():
|
|
101
|
+
print(f"[*] Removing legacy OpenCode agent: {old_agent}")
|
|
102
|
+
try:
|
|
103
|
+
old_agent.unlink()
|
|
104
|
+
except Exception as e:
|
|
105
|
+
print(f"[-] Could not remove legacy agent: {e}")
|
|
106
|
+
|
|
107
|
+
dest_dir = Path.home() / ".config" / "opencode" / "skills"
|
|
108
|
+
dest_file = dest_dir / "devhive_workflow.md"
|
|
109
|
+
_copy_agent_file(source_to_use, dest_dir, dest_file, "OpenCode Skill")
|
|
100
110
|
_configure_devhive()
|
|
101
111
|
|
|
102
112
|
# 4. Configure Copilot
|
|
103
113
|
if choice in ["copilot", "both"]:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
# Remove legacy agent
|
|
115
|
+
old_agent_dir = Path.home() / ".copilot" / "agents"
|
|
116
|
+
old_agent = old_agent_dir / "DevHive.md"
|
|
117
|
+
if old_agent.exists():
|
|
118
|
+
print(f"[*] Removing legacy Copilot agent: {old_agent}")
|
|
119
|
+
try:
|
|
120
|
+
old_agent.unlink()
|
|
121
|
+
except Exception as e:
|
|
122
|
+
print(f"[-] Could not remove legacy agent: {e}")
|
|
123
|
+
|
|
124
|
+
dest_dir = Path.home() / ".copilot" / "instructions"
|
|
125
|
+
dest_file = dest_dir / "devhive_workflow.md"
|
|
126
|
+
_copy_agent_file(source_to_use, dest_dir, dest_file, "Copilot Instructions")
|
|
107
127
|
_configure_vscode_copilot(dest_file)
|
|
108
128
|
|
|
109
129
|
print("\nConfiguration complete!")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Task-based pipeline orchestrator.
|
|
3
|
-
Manages agent sequence and returns Task launch instructions for
|
|
3
|
+
Manages agent sequence and returns Task launch instructions for SDD Skill execution.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
import json
|
|
@@ -27,7 +27,7 @@ class TaskOrchestrator:
|
|
|
27
27
|
- Builds prompts using PromptBuilder
|
|
28
28
|
- Validates responses using ResponseValidator
|
|
29
29
|
- Saves artifacts using ArtifactManager
|
|
30
|
-
- Returns structured envelopes for
|
|
30
|
+
- Returns structured envelopes for Skill execution
|
|
31
31
|
"""
|
|
32
32
|
|
|
33
33
|
def __init__(self, project_name: str):
|
|
@@ -55,7 +55,7 @@ def _parse_json_response(text: str) -> Dict[str, Any]:
|
|
|
55
55
|
raise ValueError(f"Invalid JSON response: {e}")
|
|
56
56
|
|
|
57
57
|
# ============================================================================
|
|
58
|
-
# TASK-BASED WORKFLOW TOOLS (Recommended -
|
|
58
|
+
# TASK-BASED WORKFLOW TOOLS (Recommended - Use devhive_workflow skill)
|
|
59
59
|
# ============================================================================
|
|
60
60
|
|
|
61
61
|
@mcp.tool()
|
|
@@ -64,7 +64,7 @@ def devhive_start_pipeline(project_name: str, requirements: str) -> str:
|
|
|
64
64
|
Start a new DevHive pipeline with Task-based execution.
|
|
65
65
|
|
|
66
66
|
This is the RECOMMENDED way to use DevHive. It returns Task launch instructions
|
|
67
|
-
that OpenCode
|
|
67
|
+
that OpenCode should execute using the devhive_workflow skill.
|
|
68
68
|
|
|
69
69
|
Remember always read AGENTS.md if exists.
|
|
70
70
|
|
|
@@ -85,7 +85,7 @@ def devhive_start_pipeline(project_name: str, requirements: str) -> str:
|
|
|
85
85
|
|
|
86
86
|
Example:
|
|
87
87
|
result = devhive_start_pipeline("csv_export", "Add CSV export to dashboard")
|
|
88
|
-
# Use result["system_prompt"] and result["user_prompt"] with
|
|
88
|
+
# Use result["system_prompt"] and result["user_prompt"] with Task tool (general)
|
|
89
89
|
# Then call devhive_submit_result() with the Task output
|
|
90
90
|
"""
|
|
91
91
|
try:
|
|
@@ -136,7 +136,7 @@ def devhive_submit_result(project_name: str, agent_name: str, llm_response: str)
|
|
|
136
136
|
if result["status"] == "success":
|
|
137
137
|
print(result["executive_summary"])
|
|
138
138
|
next_task = result["next_task"]
|
|
139
|
-
# Use next_task with
|
|
139
|
+
# Use next_task with Task tool (general)
|
|
140
140
|
"""
|
|
141
141
|
try:
|
|
142
142
|
from devhive.core.task_orchestrator import TaskOrchestrator
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|