From c808b39b5653f415fd1206c8c38ac45c47599d0d Mon Sep 17 00:00:00 2001 From: burakbozan Date: Tue, 13 Oct 2026 18:50:22 +0300 Subject: [PATCH] prompts added --- orchestrator.py | 143 ++++++++++++++++++++++++++++++++++++++++ prompts/coder.md | 27 ++++++++ prompts/orchestrator.md | 16 +++++ prompts/planner.md | 30 +++++++++ prompts/researcher.md | 30 +++++++++ prompts/reviewer.md | 27 ++++++++ 6 files changed, 273 insertions(+) create mode 100644 orchestrator.py create mode 100644 prompts/coder.md create mode 100644 prompts/orchestrator.md create mode 100644 prompts/planner.md create mode 100644 prompts/researcher.md create mode 100644 prompts/reviewer.md diff --git a/orchestrator.py b/orchestrator.py new file mode 100644 index 0000000..f07e567 --- /dev/null +++ b/orchestrator.py @@ -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()) diff --git a/prompts/coder.md b/prompts/coder.md new file mode 100644 index 0000000..32bbd4c --- /dev/null +++ b/prompts/coder.md @@ -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. diff --git a/prompts/orchestrator.md b/prompts/orchestrator.md new file mode 100644 index 0000000..172dfcd --- /dev/null +++ b/prompts/orchestrator.md @@ -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. diff --git a/prompts/planner.md b/prompts/planner.md new file mode 100644 index 0000000..4422b0e --- /dev/null +++ b/prompts/planner.md @@ -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. diff --git a/prompts/researcher.md b/prompts/researcher.md new file mode 100644 index 0000000..8c57665 --- /dev/null +++ b/prompts/researcher.md @@ -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. diff --git a/prompts/reviewer.md b/prompts/reviewer.md new file mode 100644 index 0000000..cbe5aa0 --- /dev/null +++ b/prompts/reviewer.md @@ -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?