devhive 0.1.25__tar.gz → 0.1.26__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.25/devhive.egg-info → devhive-0.1.26}/PKG-INFO +1 -1
- {devhive-0.1.25 → devhive-0.1.26/devhive.egg-info}/PKG-INFO +1 -1
- {devhive-0.1.25 → devhive-0.1.26}/devhive.egg-info/SOURCES.txt +1 -0
- {devhive-0.1.25 → devhive-0.1.26}/devhive_cli/main.py +6 -1
- {devhive-0.1.25 → devhive-0.1.26}/devhive_cli/templates_backend.py +21 -62
- {devhive-0.1.25 → devhive-0.1.26}/setup.py +1 -1
- devhive-0.1.26/templates/AGENTS.backend.md +54 -0
- {devhive-0.1.25 → devhive-0.1.26}/LICENSE +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/MANIFEST.in +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/README.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/architecture-patterns/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/architecture-patterns/resources/implementation-playbook.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/backend-arthitect/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/backend-security-coder/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/docker-expert/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/frontend-design/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/frontend-developer/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/theme-showcase.pdf +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/arctic-frost.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/botanical-garden.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/desert-rose.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/forest-canopy.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/golden-hour.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/midnight-galaxy.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/modern-minimalist.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/ocean-depths.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/sunset-boulevard.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/tech-innovation.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/devhive.egg-info/dependency_links.txt +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/devhive.egg-info/entry_points.txt +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/devhive.egg-info/requires.txt +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/devhive.egg-info/top_level.txt +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/devhive_cli/__init__.py +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/setup.cfg +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_architect/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_auditor/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_backender/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_dba/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_designer/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_devops/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_explorer/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_frontender/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_orchestrator/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_perf/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_proposal/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_qa/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_releaser/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_sast/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_taskplanner/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_techwriter/SKILL.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/skills/devhive_workflow.md +0 -0
- {devhive-0.1.25 → devhive-0.1.26}/templates/AGENTS.frontend.md +0 -0
|
@@ -115,7 +115,12 @@ def init_backend():
|
|
|
115
115
|
|
|
116
116
|
iac = click.prompt("Which IaC tool are you using?", type=click.Choice(['cdk', 'terraform', 'serverless']))
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
template_path = TEMPLATES_DIR / "AGENTS.backend.md"
|
|
119
|
+
if not template_path.exists():
|
|
120
|
+
click.secho("Error: Backend template not found in the devhive package.", fg="red")
|
|
121
|
+
return
|
|
122
|
+
|
|
123
|
+
md_content = generate_backend_agents_md(template_path, language, framework, iac, use_di)
|
|
119
124
|
|
|
120
125
|
with open(dest_path, "w", encoding="utf-8") as f:
|
|
121
126
|
f.write(md_content)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
def generate_backend_agents_md(template_path: Path, language: str, framework: str, iac: str, use_di: bool) -> str:
|
|
2
5
|
stack_list = []
|
|
3
6
|
if language == 'python':
|
|
4
7
|
stack_list.append("- **Language**: Python 3.10+ (Strict Type Hinting)")
|
|
@@ -29,73 +32,21 @@ def generate_backend_agents_md(language: str, framework: str, iac: str, use_di:
|
|
|
29
32
|
stack_list.append("- **Infrastructure as Code**: Serverless Framework")
|
|
30
33
|
|
|
31
34
|
stack_section = "\n".join(stack_list)
|
|
35
|
+
iac_tool_upper = iac.upper()
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
md = f"""# Backend Architecture & AI Agent Guidelines
|
|
35
|
-
|
|
36
|
-
This `AGENTS.md` (or `GUIDELINES.md`) file serves as the strict instruction manual for OpenCode and DevHive agents. It defines the technical stack, architectural patterns, and coding conventions for this backend project.
|
|
37
|
-
|
|
38
|
-
## 🛠️ 1. Tech Stack
|
|
39
|
-
{stack_section}
|
|
40
|
-
|
|
41
|
-
## 🧠 2. OpenCode Skills to Load
|
|
42
|
-
Agents **MUST** load the following specialized skills before executing tasks:
|
|
43
|
-
- `architecture-patterns`: For maintaining clean separation of concerns and Hexagonal Architecture.
|
|
44
|
-
- `backend-architect`: For scalable API design and domain modeling.
|
|
45
|
-
- `backend-security-coder`: For secure coding practices, input validation, and auth.
|
|
46
|
-
- `devhive-devops`: For {iac.upper()} infrastructure setup.
|
|
47
|
-
|
|
48
|
-
## 📂 3. Project Structure (Hexagonal Architecture)
|
|
49
|
-
For maximum scalability, testability, and maintainability, the project MUST strictly follow Hexagonal Architecture (Ports & Adapters).
|
|
50
|
-
|
|
51
|
-
```text
|
|
52
|
-
src/
|
|
53
|
-
├── domain/ # ENTERPRISE BUSINESS RULES (No external dependencies)
|
|
54
|
-
│ ├── entities/ # Pure domain models
|
|
55
|
-
│ └── exceptions/ # Domain-specific errors
|
|
56
|
-
├── application/ # APPLICATION BUSINESS RULES (Use Cases & Ports)
|
|
57
|
-
│ ├── use_cases/ # Orchestrates domain logic
|
|
58
|
-
│ └── ports/ # Interfaces for outbound communication (Repositories, External APIs)
|
|
59
|
-
├── infrastructure/ # ADAPTERS (Database, External Services, Third-party libs)
|
|
60
|
-
│ ├── database/ # Concrete implementation of repository ports
|
|
61
|
-
│ └── di/ # Dependency Injection container/setup
|
|
62
|
-
└── presentation/ # ENTRY POINTS (Controllers, REST APIs, GraphQL, Lambdas)
|
|
63
|
-
└── controllers/ # Parses HTTP requests and calls use cases
|
|
64
|
-
|
|
65
|
-
infrastructure/ # IaC DEFINITIONS (Outside src/)
|
|
66
|
-
└── # {iac.upper()} configurations
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## 📐 4. Architectural Rules & Clean Code (CRITICAL)
|
|
70
|
-
|
|
71
|
-
1. **The Dependency Rule**: Source code dependencies MUST only point inward, toward the `domain/`.
|
|
72
|
-
- `domain/` knows nothing about anything else.
|
|
73
|
-
- `application/` depends only on `domain/`.
|
|
74
|
-
- `infrastructure/` and `presentation/` depend on `application/` and `domain/`.
|
|
75
|
-
- **Never import an infrastructure detail (like a DB model) into a use case.**
|
|
76
|
-
|
|
77
|
-
2. **Ports and Adapters**:
|
|
78
|
-
- Outbound communication (like DB queries) MUST be defined as an interface (Port) in the `application/` layer.
|
|
79
|
-
- The actual database logic MUST be implemented as an Adapter in the `infrastructure/` layer.
|
|
80
|
-
|
|
81
|
-
3. **Dependency Injection**:
|
|
82
|
-
- Use Cases must receive their dependencies (Ports) via constructor injection.
|
|
83
|
-
- The Presentation layer resolves these dependencies and passes them to the Use Cases.
|
|
84
|
-
"""
|
|
85
|
-
|
|
37
|
+
di_rules = ""
|
|
86
38
|
if language == 'node' and use_di:
|
|
87
|
-
|
|
39
|
+
di_rules = """
|
|
88
40
|
4. **InversifyJS Usage**:
|
|
89
41
|
- Decorate concrete adapters in `infrastructure/` with `@injectable()`.
|
|
90
42
|
- Bind interfaces to symbols in an `inversify.config.ts` container file.
|
|
91
43
|
- Use the container in the `presentation/` layer to resolve use cases.
|
|
92
44
|
"""
|
|
93
45
|
|
|
94
|
-
|
|
95
|
-
|
|
46
|
+
code_examples = ""
|
|
96
47
|
if language == 'python':
|
|
97
48
|
if framework == 'fastapi':
|
|
98
|
-
|
|
49
|
+
code_examples = """### Example: FastAPI + Hexagonal Architecture
|
|
99
50
|
|
|
100
51
|
**1. Port (Application Layer)**
|
|
101
52
|
*File: `src/application/ports/user_repository.py`*
|
|
@@ -165,7 +116,7 @@ def get_user(user_id: str, use_case: GetUserUseCase = Depends(get_user_use_case)
|
|
|
165
116
|
```
|
|
166
117
|
"""
|
|
167
118
|
elif framework == 'django':
|
|
168
|
-
|
|
119
|
+
code_examples = """### Example: Django + Hexagonal Architecture
|
|
169
120
|
|
|
170
121
|
**Note on Django**: Do NOT put business logic in Django Views or Models. Use Django ONLY as the `infrastructure/` and `presentation/` layers.
|
|
171
122
|
|
|
@@ -217,7 +168,7 @@ def get_user_view(request, user_id: str):
|
|
|
217
168
|
```
|
|
218
169
|
"""
|
|
219
170
|
else:
|
|
220
|
-
|
|
171
|
+
code_examples = """### Example: Pure Python + Hexagonal Architecture
|
|
221
172
|
|
|
222
173
|
**1. Port (Application Layer)**
|
|
223
174
|
*File: `src/application/ports/user_repository.py`*
|
|
@@ -262,7 +213,7 @@ def lambda_handler(event, context):
|
|
|
262
213
|
"""
|
|
263
214
|
else: # Node.js
|
|
264
215
|
if use_di:
|
|
265
|
-
|
|
216
|
+
code_examples = """### Example: Node.js + TypeScript + InversifyJS
|
|
266
217
|
|
|
267
218
|
**1. Port (Application Layer)**
|
|
268
219
|
*File: `src/application/ports/IUserRepository.ts`*
|
|
@@ -356,7 +307,7 @@ export class UserController {
|
|
|
356
307
|
```
|
|
357
308
|
"""
|
|
358
309
|
else:
|
|
359
|
-
|
|
310
|
+
code_examples = """### Example: Node.js + TypeScript (Manual DI)
|
|
360
311
|
|
|
361
312
|
**1. Port (Application Layer)**
|
|
362
313
|
*File: `src/application/ports/IUserRepository.ts`*
|
|
@@ -421,4 +372,12 @@ export class UserController {
|
|
|
421
372
|
```
|
|
422
373
|
"""
|
|
423
374
|
|
|
375
|
+
with open(template_path, 'r', encoding='utf-8') as f:
|
|
376
|
+
md = f.read()
|
|
377
|
+
|
|
378
|
+
md = md.replace("{{TECH_STACK}}", stack_section)
|
|
379
|
+
md = md.replace("{{IAC_TOOL}}", iac_tool_upper)
|
|
380
|
+
md = md.replace("{{DI_RULES}}", di_rules)
|
|
381
|
+
md = md.replace("{{CODE_EXAMPLES}}", code_examples)
|
|
382
|
+
|
|
424
383
|
return md
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Backend Architecture & AI Agent Guidelines
|
|
2
|
+
|
|
3
|
+
This `AGENTS.md` (or `GUIDELINES.md`) file serves as the strict instruction manual for OpenCode and DevHive agents. It defines the technical stack, architectural patterns, and coding conventions for this backend project.
|
|
4
|
+
|
|
5
|
+
## 🛠️ 1. Tech Stack
|
|
6
|
+
{{TECH_STACK}}
|
|
7
|
+
|
|
8
|
+
## 🧠 2. OpenCode Skills to Load
|
|
9
|
+
Agents **MUST** load the following specialized skills before executing tasks:
|
|
10
|
+
- `architecture-patterns`: For maintaining clean separation of concerns and Hexagonal Architecture.
|
|
11
|
+
- `backend-architect`: For scalable API design and domain modeling.
|
|
12
|
+
- `backend-security-coder`: For secure coding practices, input validation, and auth.
|
|
13
|
+
- `devhive-devops`: For {{IAC_TOOL}} infrastructure setup.
|
|
14
|
+
|
|
15
|
+
## 📂 3. Project Structure (Hexagonal Architecture)
|
|
16
|
+
For maximum scalability, testability, and maintainability, the project MUST strictly follow Hexagonal Architecture (Ports & Adapters).
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
src/
|
|
20
|
+
├── domain/ # ENTERPRISE BUSINESS RULES (No external dependencies)
|
|
21
|
+
│ ├── entities/ # Pure domain models
|
|
22
|
+
│ └── exceptions/ # Domain-specific errors
|
|
23
|
+
├── application/ # APPLICATION BUSINESS RULES (Use Cases & Ports)
|
|
24
|
+
│ ├── use_cases/ # Orchestrates domain logic
|
|
25
|
+
│ └── ports/ # Interfaces for outbound communication (Repositories, External APIs)
|
|
26
|
+
├── infrastructure/ # ADAPTERS (Database, External Services, Third-party libs)
|
|
27
|
+
│ ├── database/ # Concrete implementation of repository ports
|
|
28
|
+
│ └── di/ # Dependency Injection container/setup
|
|
29
|
+
└── presentation/ # ENTRY POINTS (Controllers, REST APIs, GraphQL, Lambdas)
|
|
30
|
+
└── controllers/ # Parses HTTP requests and calls use cases
|
|
31
|
+
|
|
32
|
+
infrastructure/ # IaC DEFINITIONS (Outside src/)
|
|
33
|
+
└── # {{IAC_TOOL}} configurations
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 📐 4. Architectural Rules & Clean Code (CRITICAL)
|
|
37
|
+
|
|
38
|
+
1. **The Dependency Rule**: Source code dependencies MUST only point inward, toward the `domain/`.
|
|
39
|
+
- `domain/` knows nothing about anything else.
|
|
40
|
+
- `application/` depends only on `domain/`.
|
|
41
|
+
- `infrastructure/` and `presentation/` depend on `application/` and `domain/`.
|
|
42
|
+
- **Never import an infrastructure detail (like a DB model) into a use case.**
|
|
43
|
+
|
|
44
|
+
2. **Ports and Adapters**:
|
|
45
|
+
- Outbound communication (like DB queries) MUST be defined as an interface (Port) in the `application/` layer.
|
|
46
|
+
- The actual database logic MUST be implemented as an Adapter in the `infrastructure/` layer.
|
|
47
|
+
|
|
48
|
+
3. **Dependency Injection**:
|
|
49
|
+
- Use Cases must receive their dependencies (Ports) via constructor injection.
|
|
50
|
+
- The Presentation layer resolves these dependencies and passes them to the Use Cases.
|
|
51
|
+
{{DI_RULES}}
|
|
52
|
+
## 💻 5. Code Examples
|
|
53
|
+
|
|
54
|
+
{{CODE_EXAMPLES}}
|
|
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
|
{devhive-0.1.25 → devhive-0.1.26}/community_skills/theme-factory/themes/modern-minimalist.md
RENAMED
|
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
|