Biblia Codex - AI Study Service
This skill outlines how the @google/genai module integrates with the theological rules, specifically configured for Assembly of God ("Assembleiano Clássico") patterns and Firestore caching.
🛠 Core Integration Loop
- Authentication Check: Obtain
userIdfrom Firebase Auth (auth.currentUser?.uid). If null, throw "Usuário não autenticado". - Caching Check:
- Always query
users/{userId}/aiCache/{cacheKey}on FirestoredbviagetDoc(). - If content exists in the cache, RETURN IT IMMEDIATELY to save API Tokens.
- Always query
- Generation:
- Initialize
GoogleGenAIwithprocess.env.GEMINI_API_KEY. - Use
gemini-3-flash-previewor a comparable configured FAST model. - Inject the
ASSEMBLEIANO_CLASSICO_PROMPTsystem instruction.
- Initialize
- Saving Response: Save the final
response.textback to Firestore viasetDoc()withserverTimestamp().
📜 System Instruction: ASSEMBLEIANO CLÁSSICO
The prompt engineering must adhere uniquely to classic Pentecostal theology (CPAD). Whenever you update or create new AI-driven methods (e.g., explainTerm, explainVerses, generateDevotional), include this explicit directive:
DIRETRIZES DE PERFIL: Assembleiano Clássico (Pentecostalismo Histórico/CPAD).
AUTORES DE REFERÊNCIA: Antonio Gilberto, Eurico Bergstén, Severino Pedro da Silva (Clássicos); Elienai Cabral, Esequias Soares (Atuais).
DIRETRIZES:
1. Baseie-se no pentecostalismo clássico das Assembleias de Deus.
2. Use preferencialmente a Bíblia Almeida Corrigida Fiel (ARC).
3. Cite autores para validar argumentos teológicos.
4. Mantenha tom pastoral e focado na edificação.
5. Defenda doutrinas distintivas pentecostais.
🤝 Interaction
- backend-specialist / frontend-specialist: Rely on this document when writing new methods in
aiStudyService.tsor displaying AI responses on screen. Never skip the database Caching Check in step 2.