Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions orchestrator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/usr/bin/env python3
"""Simple orchestration runner for the project templates in this repository."""

from __future__ import annotations

import argparse
from pathlib import Path
from typing import Dict, List


ROOT = Path(__file__).resolve().parent
PROMPTS_DIR = ROOT / "prompts"


PROJECTS: Dict[str, Dict[str, object]] = {
"task-manager": {
"title": "Task Manager API",
"summary": "Spring Boot REST API for managing tasks with JWT auth and Swagger docs.",
"tech": [
"Spring Boot",
"Spring Data JPA",
"Spring Security",
"JWT",
"springdoc-openapi",
"Docker",
"Actuator",
],
"workflow": [
"Planner defines CRUD and auth tasks.",
"Researcher recommends Spring Boot, JWT, OpenAPI, and Docker best practices.",
"Coder implements task APIs, JWT filter, Swagger config, and container setup.",
"Reviewer validates correctness, security, and performance.",
"Orchestrator integrates the final solution.",
],
},
"chat-app": {
"title": "Chat App",
"summary": "Real-time messaging platform with auth, persistence, and Redis.",
"tech": [
"Node.js",
"Express",
"Socket.IO",
"MongoDB",
"Redis",
"React",
],
"workflow": [
"Planner defines messaging and auth requirements.",
"Researcher recommends Socket.IO, MongoDB, Redis, and React patterns.",
"Coder implements the API, chat flows, and frontend UX.",
"Reviewer checks real-time reliability and security.",
"Orchestrator integrates the final system.",
],
},
"note-app": {
"title": "Note App",
"summary": "Collaborative notes platform with AI summarization and semantic search.",
"tech": [
"React",
"Tailwind CSS",
"Node.js",
"Express",
"PostgreSQL",
"OpenAI API",
],
"workflow": [
"Planner defines note CRUD and collaboration tasks.",
"Researcher recommends a React + Node stack with AI summarization and search.",
"Coder implements the note APIs and frontend workflows.",
"Reviewer checks correctness, AI quality, and security.",
"Orchestrator integrates the final solution.",
],
},
}


def _read_prompt(name: str) -> str:
prompt_file = PROMPTS_DIR / f"{name}.md"
if prompt_file.exists():
return prompt_file.read_text(encoding="utf-8")
return "Prompt file not found."


def _project_aliases() -> List[str]:
return sorted(PROJECTS)


def _describe_project(project_name: str) -> str:
project = PROJECTS.get(project_name)
if not project:
raise ValueError(f"Unsupported project: {project_name}")

prompt_names = ["planner", "researcher", "coder", "reviewer", "orchestrator"]
prompt_details = [
f"- {name.title()}: {_read_prompt(name).splitlines()[0].strip() if _read_prompt(name).strip() else 'Prompt with no header'}"
for name in prompt_names
]

lines = [
f"Project: {project['title']}",
f"Alias: {project_name}",
f"Summary: {project['summary']}",
"Tech stack: " + ", ".join(project["tech"]),
"",
"Workflow:",
]
for index, step in enumerate(project["workflow"], 1):
lines.append(f"{index}. {step}")
lines.extend(["", "Agent prompts available:"])
lines.extend(prompt_details)
return "\n".join(lines)


def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description="Identify a project and orchestrate the planning/research/coding/review workflow."
)
parser.add_argument(
"project",
nargs="?",
default="task-manager",
help="Project alias to orchestrate (default: task-manager). Supported values: "
+ ", ".join(_project_aliases()),
)
return parser


def main() -> int:
parser = build_parser()
args = parser.parse_args()

project_name = args.project.strip().lower()
if project_name not in PROJECTS:
parser.error(
f"Unknown project '{project_name}'. Supported projects: {', '.join(_project_aliases())}"
)

print(_describe_project(project_name))
return 0


if __name__ == "__main__":
raise SystemExit(main())
27 changes: 27 additions & 0 deletions prompts/coder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Coder Agent Prompt

You are the Coder Agent.
- Role: Implement tasks using chosen stack.
- Input: Planner tasks + Researcher recommendations.
- Output: Code snippets + explanations.
- Constraints:
- Do not change architecture.
- Output runnable code.

## Task Manager API
- Implement Task entity, repository, service, controller.
- Add JWT filter in SecurityConfig.
- Configure Swagger UI.
- Provide Dockerfile.

## Chat App
- Implement WebSocket server with Socket.IO.
- Create user authentication endpoints.
- Build React frontend with chat UI.
- Add Redis integration.

## Note App
- Implement Note entity and CRUD endpoints.
- Integrate OpenAI API for summarization.
- Add semantic search with embeddings.
- Build collaborative frontend.
16 changes: 16 additions & 0 deletions prompts/orchestrator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Orchestrator Agent Prompt

You are the Orchestrator Agent.
- Role: Coordinate Planner, Researcher, Coder, Reviewer.
- Input: All agent outputs.
- Output: Final integrated solution.
- Constraints:
- Ensure consistency.
- Resolve conflicts.

## Workflow
1. Planner defines tasks.
2. Researcher provides best practices.
3. Coder implements.
4. Reviewer checks.
5. Orchestrator integrates into final solution.
30 changes: 30 additions & 0 deletions prompts/planner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Planner Agent Prompt

You are the Planner Agent.
- Role: Break down the project into technical tasks.
- Input: User request + project context.
- Output: Numbered task list with dependencies.
- Constraints:
- Do not write code.
- Output tasks only.

## Task Manager API Context
- Define CRUD operations for tasks.
- Add JWT authentication.
- Document with Swagger.
- Containerize with Docker.
- Add monitoring with Actuator.

## Chat App Context
- Define real-time messaging flow.
- Add authentication and user management.
- Implement WebSocket/Socket.IO.
- Add notifications and persistence.
- Ensure scalability with Redis.

## Note App Context
- Define CRUD for notes.
- Add AI summarization and semantic search.
- Implement collaboration features.
- Secure with authentication.
- Containerize and prepare for cloud deployment.
30 changes: 30 additions & 0 deletions prompts/researcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Researcher Agent Prompt

You are the Researcher Agent.
- Role: Provide best practices, libraries, and frameworks for each Planner task.
- Input: Planner task list.
- Output: Annotated recommendations (pros/cons).
- Constraints:
- Do not implement code.
- Output bullet points only.

## Task Manager API
- Spring Boot + JPA for persistence.
- JWT for authentication.
- springdoc-openapi for Swagger.
- Docker multi-stage builds.
- Actuator for monitoring.

## Chat App
- Node.js + Express for backend.
- Socket.IO for real-time messaging.
- MongoDB for persistence.
- Redis for scalability.
- React/Next.js for frontend.

## Note App
- React + TailwindCSS for UI.
- Node.js/Express for backend.
- PostgreSQL for persistence.
- OpenAI API for summarization.
- Docker for deployment.
27 changes: 27 additions & 0 deletions prompts/reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Reviewer Agent Prompt

You are the Reviewer Agent.
- Role: Check code for correctness, security, and performance.
- Input: Coder output.
- Output: Checklist with pass/fail + feedback.
- Constraints:
- Do not write new code.
- Output structured review only.

## Task Manager API
- Entity fields correct?
- JWT secure?
- Swagger documented?
- Docker optimized?

## Chat App
- WebSocket connections stable?
- Authentication secure?
- Redis integration correct?
- UI responsive?

## Note App
- CRUD endpoints functional?
- AI summarization accurate?
- Semantic search efficient?
- Collaboration secure?
Loading