backend-new-route

Add backend routes and services to the Think TARS Flask backend.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/freddomingues/think-tars --skill backend-new-route
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-new-route
Source: https://github.com/freddomingues/think-tars/tree/main/.cursor/skills/backend-new-route
Command: npx skills add https://github.com/freddomingues/think-tars --skill backend-new-route

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Este Skill oferece uma abordagem estruturada para adicionar novas rotas ou serviços no backend do Think TARS, garantindo consistência entre demos, blueprints e a arquitetura geral.

Core Features & Use Cases

  • Decidir onde colocar a nova rota: em rotas de demos (backend/routes.py) com sua lógica em backend/services.py, ou criar um novo Blueprint em backend/ para domínios diferentes.
  • Criar a função de serviço e a nova rota correspondente, com parâmetros claros e métodos HTTP adequados, retornando JSON válido.
  • Documentar o contrato e a convenção de nomenclatura em uma skill de referência (por exemplo, backend-api-demos) para facilitar o reuse entre equipes.

Quick Start

Crie uma nova rota HTTP no backend seguindo estas etapas: (1) implemente a função de serviço em backend/services.py, (2) registre a rota em backend/routes.py com o decorator @bp.route(...) e retorne JSON, (3) se necessário, crie ou use um Blueprint e registre em app/main.py, (4) documente a API em uma skill de referências.

Frequently Asked Questions about backend-new-route

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new backend route to a Flask app?

To add a new backend route, implement the service function in your services file, register the endpoint using the @bp.route decorator in routes.py, and return valid JSON. If building a distinct domain, create a new Blueprint and register it in your main app file.

When should I create a new Flask Blueprint instead of adding to existing routes?

Create a new Flask Blueprint when introducing a different application domain, keeping logic modular and testable. For simple demo extensions, add HTTP endpoints directly to existing routes.py and their corresponding logic to services.py.

What is the best way to structure backend services and routes in Flask?

Structure backend services and routes by separating logic into services.py and exposing them via HTTP endpoints in routes.py. Use clear parameters, adequate HTTP methods, and valid JSON returns to ensure endpoints remain consistent and testable.

Do I need to document API contracts after creating new HTTP endpoints?

Yes, you need to document API contracts and naming conventions in a reference skill after creating new HTTP endpoints. This ensures consistent reuse across teams and clarifies the expected request parameters and JSON response structures.

How do I register a new Flask Blueprint in the application?

Register a new Flask Blueprint by defining it in the backend directory and wiring it into the app/main.py file. This connects your modular service logic to the core application architecture.

Can I use this approach to build demo routes for my backend API?

Yes, you can build demo routes by adding HTTP endpoints to backend/routes.py and placing the execution logic in backend/services.py. This ensures your API demos follow the established architectural conventions.