171 lines
4.5 KiB
YAML
171 lines
4.5 KiB
YAML
# Tasks — Kipinä Agentic Studio → CrewAI
|
|
|
|
step_0_requirements:
|
|
description: |
|
|
REST API käyttäjähallinnalle SQLite-tietokannalla
|
|
expected_output: >-
|
|
requirements
|
|
agent: client
|
|
|
|
step_1_json_speksi:
|
|
description: |
|
|
**PROJECT NAME:** User Management REST API
|
|
|
|
**GOAL:** To develop a RESTful API for managing users using an SQLite database.
|
|
|
|
**CORE FEATURES:**
|
|
1. Register new users with username, email, and password.
|
|
2. Authenticate users to gain access to the system.
|
|
3. Update user profile information (email, password).
|
|
4. Delete existing users.
|
|
5. Retrieve all registered users.
|
|
6. Retrieve a specific user by ID.
|
|
7. Search for users based on partial usernames or emails.
|
|
|
|
**DATA MODEL:**
|
|
- **User:**
|
|
- UserID (Integer, Primary Key)
|
|
- Username (String, Unique)
|
|
- Email (String, Unique)
|
|
- PasswordHash (String)
|
|
|
|
**API ENDPOINTS:**
|
|
1. **POST /users/register**: Register a new user.
|
|
- Request Body:
|
|
{
|
|
"username": "johndoe",
|
|
"email": "john@example.com",
|
|
"password": "securepassword"
|
|
}
|
|
2. **POST /auth/login**: Authenticate a user and return a token.
|
|
- Request Body:
|
|
{
|
|
"username": "johndoe",
|
|
"password": "securepassword"
|
|
}
|
|
3. **PUT /users/{UserID}**: Update a specific user's profile.
|
|
- Path Parameter: UserID (Integer)
|
|
- Request Body:
|
|
{
|
|
"email": "newjohn@example.com",
|
|
"password": "newsecurepassword"
|
|
}
|
|
4. **DELETE /users/{UserID}**: Delete a specific user.
|
|
- Path Parameter: UserID (Integer)
|
|
5. **GET /users**: Retrieve all registered users.
|
|
6. **GET /users/{UserID}**: Retrieve a specific user by ID.
|
|
7. **GET /users/search?query={searchTerm}**: Search for users based on partial usernames or emails.
|
|
|
|
**CONSTRAINTS:**
|
|
- Must use SQLite as the database.
|
|
- No authentication is needed to view all users, but authentication is required to update or delete any user.
|
|
expected_output: >-
|
|
JSON-speksi
|
|
agent: manager
|
|
|
|
step_2_models_py:
|
|
description: |
|
|
Generated from spec: ["User"]
|
|
expected_output: >-
|
|
models.py
|
|
agent: data
|
|
|
|
step_3_schemas_py:
|
|
description: |
|
|
Generated from spec: ["User"]
|
|
expected_output: >-
|
|
schemas.py
|
|
agent: coder
|
|
|
|
step_4_main_py:
|
|
description: |
|
|
Generated from spec: ["User"]
|
|
expected_output: >-
|
|
main.py
|
|
agent: coder
|
|
|
|
step_5_test_main_py:
|
|
description: |
|
|
Generated from spec: ["User"]
|
|
expected_output: >-
|
|
test_main.py
|
|
agent: qa
|
|
|
|
step_6_pyproject_toml:
|
|
description: |
|
|
Generated from spec: ["User"]
|
|
expected_output: >-
|
|
pyproject.toml
|
|
agent: coder
|
|
|
|
step_7_dockerfile:
|
|
description: |
|
|
Generated from spec: ["User"]
|
|
expected_output: >-
|
|
Dockerfile
|
|
agent: tester
|
|
|
|
step_8_validointi:
|
|
description: |
|
|
validateProjectCode(files)
|
|
expected_output: >-
|
|
validointi
|
|
agent: qa
|
|
|
|
step_9_readme_md:
|
|
description: |
|
|
You are an independent technical observer and risk analyst.
|
|
|
|
EVALUATE THE PROJECT FOR:
|
|
1. ARCHITECTURE: Is the file structure logical? Are responsibilities separated?
|
|
2. SECURITY: SQL injection risks? Input validation? Authentication?
|
|
3. RELIABILITY: Error handling? Database connection management? Edge cases?
|
|
4. MAINTAINABILITY: Consistent naming? Clear code structure? Would a new developer understand this?
|
|
|
|
OUTPUT FORMAT:
|
|
- RISK: [critical/high/medium/low] Description
|
|
- List max 3-5 most important findings
|
|
- End with overall assessment: "SHIP IT" or "NEEDS WORK: reason"
|
|
|
|
Write a project report in clean markdown for: REST API käyttäjähallinnalle SQLite-tietokannalla
|
|
|
|
FIRST LINE must be exactly one of:
|
|
VERDICT: GREEN
|
|
VERDICT: ORANGE
|
|
VERDICT: RED
|
|
|
|
Then write this report:
|
|
|
|
# REST API käyttäjähallinnalle SQLite-tietokannalla
|
|
|
|
## Overview
|
|
One paragraph describing what this project does.
|
|
|
|
## Files
|
|
| File | Purpose |
|
|
|------|---------|
|
|
| models.py | ... |
|
|
| schemas.py | ... |
|
|
| main.py | ... |
|
|
| test_main.py | ... |
|
|
| pyproject.toml | ... |
|
|
| Dockerfile | ... |
|
|
|
|
## Quick Start
|
|
```bash
|
|
git clone <repo>
|
|
cd project
|
|
uv sync
|
|
uv run uvicorn main:app --reload
|
|
```
|
|
|
|
## Docker
|
|
```bash
|
|
docker build -t rest-api-k-ytt-j-hallinnalle-sqlite-tietokannalla .
|
|
docker run -p 8000:8000 rest-api-k-ytt-j-hallinnalle-sqlite-tietokannalla
|
|
```
|
|
# ... (truncated)
|
|
expected_output: >-
|
|
README.md
|
|
agent: observer
|