Skip to content

Commit 14cb873

Browse files
author
alcholiclg
committed
Merge branch 'main' of https://github.com/modelscope/ms-agent into feat/enhance_dsv2
2 parents 5920dc4 + 4420df4 commit 14cb873

26 files changed

Lines changed: 2039 additions & 295 deletions

.github/SECURITY.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you believe you have found a security vulnerability in **MS-Agent**, please report it responsibly.
6+
7+
- **Preferred**: Use GitHub **Private Vulnerability Reporting** (Security → Advisories → Report a vulnerability), if enabled.
8+
- **Do not** open a public GitHub Issue for security reports.
9+
10+
Please include:
11+
- A clear description of the issue and impact
12+
- A minimal proof-of-concept (PoC), if possible
13+
- Affected versions/commits
14+
- Reproduction steps and environment details
15+
- Any suggested mitigations/fix ideas (optional)
16+
17+
We will acknowledge receipt as soon as possible and work with you on coordinated disclosure.
18+
19+
## Scope
20+
21+
In scope includes (but is not limited to):
22+
- Tool execution security
23+
- Prompt/document injection leading to unsafe tool usage
24+
- Arbitrary file read/write, path traversal
25+
- SSRF and internal network access through tools
26+
- Unsafe deserialization (pickle/yaml/etc.)
27+
28+
Out of scope:
29+
- Issues in third-party dependencies with no exploitable path through MS-Agent
30+
- Misconfigurations or insecure deployments not recommended by the project
31+
- Social engineering attacks that do not involve a technical vulnerability in MS-Agent
32+
33+
## Disclosure Process
34+
35+
- We will confirm receipt of your report.
36+
- We will investigate and validate the issue.
37+
- We will coordinate a fix and release.
38+
- We may publish a GitHub Security Advisory (and request a CVE when appropriate).
39+
- We will credit reporters where possible (unless you prefer to remain anonymous).

README.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -307,39 +307,6 @@ For more details, please refer to [**MS-Agent Skills**](ms_agent/skill/README.md
307307
308308
---
309309
310-
### Agent Skills
311-
312-
The **MS-Agent Skill Module** is **Implementation** of [Anthropic-Agent-Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills) Protocol.
313-
314-
#### 🔍 Intelligent Skill Retrieval
315-
- **Hybrid Search**: Combines FAISS dense retrieval with BM25 sparse retrieval
316-
- **LLM-based Filtering**: Uses LLM to filter and validate skill relevance
317-
- **Query Analysis**: Automatically determines if skills are needed for a query
318-
319-
#### 📊 DAG-based Execution
320-
- **Dependency Management**: Builds execution DAG based on skill dependencies
321-
- **Parallel Execution**: Runs independent skills concurrently
322-
- **Input/Output Linking**: Automatically passes outputs between dependent skills
323-
324-
#### 🧠 Progressive Skill Analysis
325-
- **Two-phase Analysis**: Plan first, then load resources
326-
- **Incremental Loading**: Only loads required scripts/references/resources
327-
- **Context Optimization**: Minimizes token usage while maximizing understanding
328-
- **Auto Bug Fixing**: Analyzes errors and attempts automatic fixes
329-
330-
#### 🔒 Secure Execution Environment
331-
- **Docker Sandbox**: Isolated execution using [ms-enclave](https://github.com/modelscope/ms-enclave) containers
332-
- **Local Execution**: Controlled local execution with RCE prevention
333-
- **Security Checks**: Pattern-based detection of dangerous code
334-
335-
#### 🔄 Self-Reflection & Retry
336-
- **Error Analysis**: LLM-based analysis of execution failures
337-
- **Auto-Fix**: Attempts to fix code based on error messages
338-
- **Configurable Retries**: Up to N retry attempts with fixes
339-
340-
341-
For more details, please refer to [**MS-Agent Skills**](ms_agent/skill/README.md).
342-
343310
344311
### Agentic Insight (Deep Research)
345312

docs/en/Projects/CodeGenesis.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
slug: CodeGenesis
3+
title: Code Genesis
4+
description: Ms-Agent Code Genesis Project for production-ready software project generation from natural language
5+
---
6+
7+
# Code Genesis
8+
9+
Code Genesis is an open-source multi-agent framework that generates production-ready software projects from natural language requirements. It orchestrates specialized AI agents to autonomously deliver end-to-end project generation with frontend, backend, and database integration.
10+
11+
## Overview
12+
13+
### Features
14+
15+
- **End-to-end project generation**: Automatically generates complete projects with frontend, backend, and database integration from natural language descriptions
16+
- **High-quality code**: LSP validation and dependency resolution ensure production-ready output
17+
- **Topology-aware generation**: Eliminates reference errors through dependency-driven code generation
18+
- **Automated deployment**: Deploys to EdgeOne Pages automatically with MCP integration
19+
- **Flexible workflows**: Choose between standard (7-stage) or simple (4-stage) pipelines based on project complexity
20+
21+
### Architecture
22+
23+
Code Genesis provides two configurable workflow modes:
24+
25+
#### Standard Workflow (Production-Grade)
26+
27+
![Standard Workflow](../../../projects/code_genesis/asset/workflow.jpg)
28+
29+
The standard pipeline implements a rigorous 7-stage process optimized for complex, production-ready projects:
30+
31+
```
32+
User Story → Architect → File Design → File Order → Install → Coding → Refine
33+
```
34+
35+
**Pipeline Stages**:
36+
1. **User Story Agent**: Parses user requirements into structured user stories
37+
2. **Architect Agent**: Selects technology stack and defines system architecture
38+
3. **File Design Agent**: Generates physical file structure from architectural blueprint
39+
4. **File Order Agent**: Constructs dependency DAG and topological sort for parallel code generation
40+
5. **Install Agent**: Bootstraps environment and resolves dependencies
41+
6. **Coding Agent**: Synthesizes code with LSP validation, following dependency order
42+
7. **Refine Agent**: Performs runtime validation, bug fixing, and automated deployment
43+
44+
Each agent produces structured intermediate outputs, ensuring engineering rigor throughout the pipeline.
45+
46+
#### Simple Workflow (Rapid Prototyping)
47+
48+
![Simple Workflow](../../../projects/code_genesis/asset/simple_workflow.jpg)
49+
50+
For lightweight projects or quick iterations, the simple workflow condenses the pipeline into 4 core stages:
51+
52+
```
53+
Orchestrator → Install → Coding → Refine
54+
```
55+
56+
**Streamlined Process**:
57+
1. **Orchestrator Agent**: Unified requirement analysis, architecture design, and file planning
58+
2. **Install Agent**: Dependency resolution and environment setup
59+
3. **Coding Agent**: Direct code generation with integrated file ordering
60+
4. **Refine Agent**: Validation and deployment
61+
62+
#### Workflow Comparison
63+
64+
| Aspect | Standard Workflow | Simple Workflow |
65+
|--------|-------------------|-----------------|
66+
| **Agent Stages** | 7 specialized agents | 4 consolidated agents |
67+
| **Architecture Quality** | Explicit, auditable design | Implicit, monolithic design |
68+
| **Generation Time** | Moderate (thorough planning) | Fast (direct execution) |
69+
| **Use Cases** | Production systems, complex apps | Prototypes, demos, simple tools |
70+
71+
## How to Use
72+
73+
### Installation
74+
75+
Clone the repository and prepare the environment:
76+
77+
```bash
78+
git clone https://github.com/modelscope/ms-agent
79+
cd ms-agent
80+
pip install -r requirements/code.txt
81+
pip install -e .
82+
```
83+
84+
Prepare npm environment, following https://nodejs.org/en/download. If you are using Mac, using Homebrew is recommended: https://formulae.brew.sh/formula/node
85+
86+
Make sure your installation is successful:
87+
```bash
88+
npm --version
89+
```
90+
91+
Make sure the npm installation is successful, or the npm install/build/dev will fail.
92+
93+
### Quick Start
94+
95+
Run the standard workflow:
96+
97+
```bash
98+
PYTHONPATH=. openai_api_key=your-api-key openai_base_url=your-api-url \
99+
python ms_agent/cli/cli.py run \
100+
--config projects/code_genesis \
101+
--query 'make a demo website' \
102+
--trust_remote_code true
103+
```
104+
105+
The code will be output to the `output` folder in the current directory by default.
106+
107+
### Advanced Configuration
108+
109+
#### Enable Diff-Based File Editing
110+
111+
Add `edit_file_config` to both `coding.yaml` and `refine.yaml`:
112+
113+
```yaml
114+
edit_file_config:
115+
model: morph-v3-fast # or other compatible models
116+
api_key: your-api-key
117+
base_url: https://api.morphllm.com/v1
118+
```
119+
120+
Get your model and API key from https://www.morphllm.com
121+
122+
#### Enable Automated Deployment
123+
124+
Add `edgeone-pages-mcp` configuration to `refine.yaml`:
125+
126+
```yaml
127+
mcp_servers:
128+
edgeone-pages:
129+
env:
130+
EDGEONE_PAGES_API_TOKEN: your-edgeone-token
131+
```
132+
133+
Get your `EDGEONE_PAGES_API_TOKEN` from https://pages.edgeone.ai/zh/document/pages-mcp

0 commit comments

Comments
 (0)