-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_agentic_project.py
More file actions
201 lines (172 loc) · 6.45 KB
/
Copy pathinit_agentic_project.py
File metadata and controls
201 lines (172 loc) · 6.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import os
# Конфигурация агентов (навыков)
AGENTS = {
"dev_agent": {
"title": "Development Agent",
"desc": "Code implementation, refactoring, and logic fixes.",
"content": """## 1. Think Before Coding
- State assumptions.
- Push back on complexity.
- Ask if unclear.
## 2. Simplicity First
- Minimum code to solve the problem.
- No over-engineering.
## 3. Surgical Changes
- Touch only what is necessary.
- Match existing style.
## 4. Goal-Driven Execution
- Define success criteria.
- Verify after every step.
"""
},
"wiki_agent": {
"title": "Wiki Agent",
"desc": "Knowledge management and project documentation.",
"content": """## 1. Documentation First
- Update Wiki before and after code changes.
- Maintain index.md and navigation.
## 2. Logging
- Record every major action in log.md.
- Format: [YYYY-MM-DD] | [File] | [Action].
## 3. Bug Tracking
- Log bugs in BUGS.md immediately upon discovery.
"""
},
"qa_agent": {
"title": "QA Agent",
"desc": "Bug hunting and quality assurance.",
"content": """## 1. Hunting
- Perform static analysis.
- Run automated tests (pytest).
## 2. Reporting
- Document bugs with reproduction steps.
- Verify fixes before closing.
"""
},
"build_agent": {
"title": "Build Agent",
"desc": "Packaging and distribution.",
"content": """## 1. Preparation
- Clean build directories.
- Check dependencies.
## 2. Bundling
- Use PyInstaller/PyArmor as configured.
- Verify the final executable.
"""
},
"release_agent": {
"title": "Release Agent",
"desc": "Changelog and release notes generation.",
"content": """## 1. Synthesis
- Summarize changes from log.md.
- Categorize: Features, Fixes, UX.
## 2. Formatting
- Create Changelog_vX.X.X.txt.
"""
},
"product_agent": {
"title": "Product Agent",
"desc": "Strategic planning and ideation.",
"content": """## 1. Analysis
- Audit project progress.
- Suggest next steps for the Roadmap.
## 2. Innovation
- Research trends and user needs.
"""
},
"security_agent": {
"title": "Security Agent",
"desc": "Privacy and integrity audit.",
"content": """## 1. Audit
- Check for sensitive data leaks.
- Verify code obfuscation.
"""
},
"support_agent": {
"title": "Support Agent",
"desc": "User manuals and in-app help.",
"content": """## 1. Documentation
- Keep User_Manual.md in sync with features.
- Improve in-app tooltips and labels.
"""
},
"performance_agent": {
"title": "Performance Agent",
"desc": "Optimization and resource management.",
"content": """## 1. Profiling
- Identify slow code and memory leaks.
- Optimize core loops.
"""
}
}
# Конфигурация Wiki
WIKI_FILES = {
"index.md": "# 📘 Project Wiki Index\\n\\nWelcome to the knowledge base.\\n\\n- [[ROADMAP]]\\n- [[CHECKLIST]]\\n- [[log]]",
"log.md": "# 📂 Activity Log\\n\\n## [YYYY-MM-DD HH:mm] | [Project] | [INIT] | Project initialized with Agentic Skillset.",
"CHECKLIST.md": "# ✅ Operational Checklist\\n\\n- [ ] Initialize project structure",
"ROADMAP.md": "# 🗺 Strategic Roadmap\\n\\n- **Phase 1**: Initial setup"
}
# Конфигурация мастер-правил (Gemini.md)
GEMINI_CONTENT = """# 🤖 Agentic Workflow Rules
This project is built using an agent-based architecture. ALL interactions and development MUST follow the guidelines stored in the `.agents` directory.
## 🚩 Core Mandates
1. **Agent Dominance**: Before starting any task, consult the relevant skill in `.agents/skills/`.
2. **Wiki First**: Every change must be reflected in the project Wiki (`/wiki`) using the `wiki_agent` protocols.
3. **Logging**: All major actions must be recorded in `wiki/log.md` formatted as `[YYYY-MM-DD] | [File] | [Action]`.
4. **Bug Tracking**: Any issues discovered during development must be logged in `wiki/BUGS.md` immediately.
## 🛠️ Specialized Agents
- **Wiki Agent**: Documentation, knowledge management, and archives.
- **Dev Agent**: Core logic, refactoring, and code standards.
- **QA Agent**: Systematic bug hunting and quality assurance.
- **Product Agent**: Strategy, ideation, and roadmap evolution.
- **Build Agent**: Obfuscation and bundling for production.
- **Release Agent**: Generation of professional changelogs.
- **Security Agent**: Privacy audit and software integrity.
- **Support Agent**: User manuals and in-app help systems.
- **Performance Agent**: Latency optimization and resource management.
---
**STRICT ADHERENCE TO THESE RULES IS MANDATORY.**
"""
def init_project():
print("🚀 Initializing Agentic Project Structure...")
# Создание структуры папок
dirs = [
".agents/skills",
"wiki",
"raw-sources",
"src",
"tests"
]
for d in dirs:
os.makedirs(d, exist_ok=True)
print(f"Created directory: {d}")
# Создание агентов
for name, data in AGENTS.items():
agent_dir = f".agents/skills/{name}"
os.makedirs(agent_dir, exist_ok=True)
skill_path = os.path.join(agent_dir, "SKILL.md")
with open(skill_path, "w", encoding="utf-8") as f:
f.write(f"---\\ntitle: {data['title']}\\ndescription: {data['desc']}\\n---\\n\\n# 🤖 Skill: {data['title']}\\n\\n{data['content']}")
print(f"Created Agent: {name}")
# Создание файлов Wiki
for filename, content in WIKI_FILES.items():
wiki_path = os.path.join("wiki", filename)
with open(wiki_path, "w", encoding="utf-8") as f:
f.write(content.replace("\\n", "\\n"))
print(f"Created Wiki file: {filename}")
# Создание Gemini.md (Master Rules)
if not os.path.exists("Gemini.md"):
with open("Gemini.md", "w", encoding="utf-8") as f:
f.write(GEMINI_CONTENT)
print("Created Master Rules: Gemini.md")
# Создание базовых файлов проекта
if not os.path.exists("main.py"):
with open("main.py", "w", encoding="utf-8") as f:
f.write("print('Hello from Agentic Project!')\\n")
if not os.path.exists("requirements.txt"):
with open("requirements.txt", "w", encoding="utf-8") as f:
f.write("# Project dependencies\\n")
print("\\n✨ Project initialized successfully!")
print("Happy coding with your AI team!")
if __name__ == "__main__":
init_project()