xiaohongshu
xiaohongshu
Integrações SEFAZ (NF-e/CT-e/MDF-e) no padrão FiscalZen: DistDFe, Manifestação e eventos — com certificados A1, SOAP, retry/backoff e persistência no produto.
Full skill instructions
"type": "module")@fiscalzen/sefaz-client (NF-e/CT-e/MDF-e)@fiscalzen/xml-parser (usado pelo sefaz-client e api)✅ Regra: alterações de SEFAZ geralmente tocam packages/ (cliente) e/ou apps/api/ (orquestração + persistência).
Aplicar mudanças relacionadas a SEFAZ mantendo consistência com a codebase:
@fiscalzen/sefaz-client) em vez de reimplementar SOAP/assinatura/certificadopackages/sefaz-client/src/client.ts → política de timeout/retry/backoff, https.Agent, dispose(), loggingpackages/sefaz-client/src/soap-client.ts + src/soap/envelope.ts → SOAP + envelopepackages/sefaz-client/src/services/* → implementações por domínio:
nfe-distdfe.ts (DistDFe NF-e)cte-distdfe.ts, mdfe-distdfe.ts (DistDFe CT-e/MDF-e)manifestacao.ts (eventos do destinatário)event-query.ts (consulta eventos)cte-events.ts (eventos CT-e)packages/sefaz-client/src/types.ts → contratos + erros tipados (SefazError, TimeoutError, CertificadoError, etc.)packages/sefaz-client/src/certificate.ts → A1 (PFX), cache/invalidação, validaçõespackages/sefaz-client/src/signature.ts → digest/assinatura (helpers)apps/api/src/modules/manifestacao/service.ts → fluxo real de manifestação + persistênciaapps/api/src/modules/certificates/* → validação de certificados (gate antes de SEFAZ)apps/api/src/modules/documents/* → documento + status/manifestaçõesapps/api/src/jobs/queues.ts → criação/agenda de jobs SEFAZapps/api/src/modules/nsu/* + packages/database/src/schema/nsu-control.ts → controle de NSU/syncSe a chamada vier do apps/api, não chame SEFAZ sem passar pelo gate:
company.certificate e company.certificatePassword existemrejectUnauthorized)No apps/api, problemas da SEFAZ devem virar erro de serviço externo (padrão do projeto), mantendo mensagem útil.
packages/sefaz-client/src/client.ts✅ Regra: se você precisar mudar retry/backoff/timeout, faça no client (não espalhe retry pelos services).
Recomendação de implementação consistente:
SoapClient / SefazClient (abstração interna)docZip e:
@fiscalzen/xml-parserDistDFeResponse consistentensu e ultNSU sempre como string com 15 dígitos (padStart(15,'0'))CertificadoA1 no formato do @fiscalzen/sefaz-clientenv.SEFAZ_AMBIENTEsucesso=false: lançar ExternalServiceError('SEFAZ', xMotivo)documentEvents + atualizar documents.manifestacaovalidateParams (CNPJ/chave)sucesso=false da SEFAZ → ExternalServiceErrorManifestação (produto)
“Aplique a skill
fiscalzen-sefazpara ajustar o fluxo de manifestação emapps/api.
Preserve o gate de certificado + multi-tenant e mapeie falhas SEFAZ para erro externo padrão. Atualize persistência emdocumentEventsedocuments.manifestacao.”
DistDFe (pacote)
“Aplique a skill
fiscalzen-sefazpara modificarpackages/sefaz-client/src/services/nfe-distdfe.ts.
Preserve validações, padStart(15) e parsing docZip com@fiscalzen/xml-parser. Se tratar 656, preferir política central no client.”
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience