izanagi-ai 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/AGENTS.md +53 -0
  2. package/CHANGELOG.md +198 -0
  3. package/LICENSE +21 -0
  4. package/README.md +96 -0
  5. package/ROADMAP.md +131 -0
  6. package/RULES.md +202 -0
  7. package/SYSTEM.md +201 -0
  8. package/agents/INDEX.md +40 -0
  9. package/agents/architect-agent.json +15 -0
  10. package/agents/bug-hunter-agent.json +14 -0
  11. package/agents/database-agent.json +14 -0
  12. package/agents/devops-agent.json +15 -0
  13. package/agents/docs-agent.json +15 -0
  14. package/agents/pm-agent.json +14 -0
  15. package/agents/professor-agent.json +15 -0
  16. package/agents/security-agent.json +14 -0
  17. package/agents/senior-engineer-agent.json +16 -0
  18. package/agents/techlead-agent.json +15 -0
  19. package/architecture/clean-architecture.md +98 -0
  20. package/architecture/cqrs-specialist.md +102 -0
  21. package/architecture/ddd-specialist.md +97 -0
  22. package/architecture/event-driven-architect.md +79 -0
  23. package/architecture/hexagonal-architecture.md +96 -0
  24. package/architecture/microservices-expert.md +83 -0
  25. package/architecture/monolith-expert.md +67 -0
  26. package/architecture/repository-pattern.md +73 -0
  27. package/architecture/unit-of-work.md +92 -0
  28. package/backend/README.md +29 -0
  29. package/bin/nexus.js +8 -0
  30. package/core/compression-engine.md +194 -0
  31. package/core/context-engine.md +239 -0
  32. package/core/decision-engine.md +377 -0
  33. package/core/evolution-engine.md +169 -0
  34. package/core/planning-engine.md +201 -0
  35. package/core/quality-gates.md +233 -0
  36. package/core/reflection-engine.md +182 -0
  37. package/core/skill-resolver.json +169 -0
  38. package/core/token-manager.md +152 -0
  39. package/database/database-engineer.md +244 -0
  40. package/database/mysql-specialist.md +61 -0
  41. package/database/postgresql-specialist.md +70 -0
  42. package/database/redis-specialist.md +73 -0
  43. package/database/sql-optimizer.md +95 -0
  44. package/database/sqlserver-specialist.md +69 -0
  45. package/devops/ci-cd-specialist.md +101 -0
  46. package/devops/devops-engineer.md +358 -0
  47. package/devops/docker-expert.md +105 -0
  48. package/devops/git-expert.md +76 -0
  49. package/devops/git-flow-specialist.md +71 -0
  50. package/devops/kubernetes-specialist.md +84 -0
  51. package/devops/linux-specialist.md +82 -0
  52. package/devops/windows-specialist.md +43 -0
  53. package/dist/cli/commands/compile.d.ts +2 -0
  54. package/dist/cli/commands/compile.d.ts.map +1 -0
  55. package/dist/cli/commands/compile.js +44 -0
  56. package/dist/cli/commands/compile.js.map +1 -0
  57. package/dist/cli/commands/doctor.d.ts +2 -0
  58. package/dist/cli/commands/doctor.d.ts.map +1 -0
  59. package/dist/cli/commands/doctor.js +88 -0
  60. package/dist/cli/commands/doctor.js.map +1 -0
  61. package/dist/cli/commands/init.d.ts +2 -0
  62. package/dist/cli/commands/init.d.ts.map +1 -0
  63. package/dist/cli/commands/init.js +26 -0
  64. package/dist/cli/commands/init.js.map +1 -0
  65. package/dist/cli/commands/list.d.ts +2 -0
  66. package/dist/cli/commands/list.d.ts.map +1 -0
  67. package/dist/cli/commands/list.js +50 -0
  68. package/dist/cli/commands/list.js.map +1 -0
  69. package/dist/cli/commands/run.d.ts +2 -0
  70. package/dist/cli/commands/run.d.ts.map +1 -0
  71. package/dist/cli/commands/run.js +49 -0
  72. package/dist/cli/commands/run.js.map +1 -0
  73. package/dist/cli/index.d.ts +2 -0
  74. package/dist/cli/index.d.ts.map +1 -0
  75. package/dist/cli/index.js +72 -0
  76. package/dist/cli/index.js.map +1 -0
  77. package/dist/index.d.ts +3 -0
  78. package/dist/index.d.ts.map +1 -0
  79. package/dist/index.js +3 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/installer.d.ts +5 -0
  82. package/dist/installer.d.ts.map +1 -0
  83. package/dist/installer.js +86 -0
  84. package/dist/installer.js.map +1 -0
  85. package/dist/postinstall.d.ts +2 -0
  86. package/dist/postinstall.d.ts.map +1 -0
  87. package/dist/postinstall.js +8 -0
  88. package/dist/postinstall.js.map +1 -0
  89. package/frontend/README.md +19 -0
  90. package/memory/context-recovery.md +49 -0
  91. package/memory/conversation-summarizer.md +65 -0
  92. package/memory/long-term-project-memory.md +58 -0
  93. package/memory/memory-manager.md +299 -0
  94. package/memory/session-compression.md +182 -0
  95. package/memory/smart-recall.md +37 -0
  96. package/optimization/compact-example.md +87 -0
  97. package/optimization/cost-optimizer.md +53 -0
  98. package/optimization/prompt-optimizer.md +194 -0
  99. package/optimization/token-audit.md +177 -0
  100. package/optimization/token-reducer.md +202 -0
  101. package/package.json +67 -0
  102. package/security/owasp-auditor.md +249 -0
  103. package/security/pentest-reviewer.md +109 -0
  104. package/security/security-engineer.md +238 -0
  105. package/skills/INDEX.md +434 -0
  106. package/skills/accessibility-reviewer.md +63 -0
  107. package/skills/agentic-coding.md +56 -0
  108. package/skills/ai-agent/SKILL.md +107 -0
  109. package/skills/ai-agent-dev/SKILL.md +117 -0
  110. package/skills/alternative-solution-generator.md +72 -0
  111. package/skills/architecture-patterns/SKILL.md +113 -0
  112. package/skills/breaking-change-detector.md +84 -0
  113. package/skills/bug-hunter.md +234 -0
  114. package/skills/bug-prevention.md +75 -0
  115. package/skills/chaos-engineering/SKILL.md +108 -0
  116. package/skills/clean-code-validator.md +218 -0
  117. package/skills/cloud-architect/SKILL.md +78 -0
  118. package/skills/cloud-infra/SKILL.md +99 -0
  119. package/skills/code-auditor.md +24 -0
  120. package/skills/complexity-analyzer.md +102 -0
  121. package/skills/confidence-estimator.md +53 -0
  122. package/skills/continuous-improvement.md +46 -0
  123. package/skills/continuous-learning-engine.md +51 -0
  124. package/skills/cto-advisor.md +66 -0
  125. package/skills/data-engineer/SKILL.md +76 -0
  126. package/skills/data-engineering/SKILL.md +82 -0
  127. package/skills/debug-specialist.md +215 -0
  128. package/skills/dependency-analyzer.md +78 -0
  129. package/skills/design-pattern-advisor.md +78 -0
  130. package/skills/documentation-writer.md +66 -0
  131. package/skills/dry-kiss-yagni-validator.md +114 -0
  132. package/skills/economia-tokens/SKILL.md +40 -0
  133. package/skills/er-diagram-builder.md +85 -0
  134. package/skills/feature-flags/SKILL.md +95 -0
  135. package/skills/frontend/SKILL.md +327 -0
  136. package/skills/frontend-dev/SKILL.md +178 -0
  137. package/skills/graphql/SKILL.md +104 -0
  138. package/skills/hallucination-detection.md +49 -0
  139. package/skills/handoff-sessao/SKILL.md +32 -0
  140. package/skills/i18n-l10n/SKILL.md +103 -0
  141. package/skills/iac-terraform/SKILL.md +98 -0
  142. package/skills/legacy-migration/SKILL.md +91 -0
  143. package/skills/logging-expert.md +78 -0
  144. package/skills/mcp-server-dev.md +33 -0
  145. package/skills/memoria-projeto/SKILL.md +49 -0
  146. package/skills/mobile-dev/SKILL.md +82 -0
  147. package/skills/mobile-engineer/SKILL.md +74 -0
  148. package/skills/monitoring-specialist.md +59 -0
  149. package/skills/observability-expert.md +60 -0
  150. package/skills/performance-optimizer.md +239 -0
  151. package/skills/principal-engineer.md +55 -0
  152. package/skills/privacy-engineer/SKILL.md +79 -0
  153. package/skills/professor-modo/SKILL.md +33 -0
  154. package/skills/project-manager.md +74 -0
  155. package/skills/prompt-engineering.md +27 -0
  156. package/skills/qa/SKILL.md +231 -0
  157. package/skills/qa-engineer/SKILL.md +222 -0
  158. package/skills/readme-generator.md +42 -0
  159. package/skills/refactoring-specialist.md +250 -0
  160. package/skills/release-planner.md +70 -0
  161. package/skills/requirement-analyzer.md +65 -0
  162. package/skills/risk-analyzer.md +73 -0
  163. package/skills/root-cause-analyzer.md +210 -0
  164. package/skills/scalability-expert.md +73 -0
  165. package/skills/security-privacy/SKILL.md +98 -0
  166. package/skills/self-correction.md +54 -0
  167. package/skills/self-critique.md +42 -0
  168. package/skills/senior-code-reviewer.md +193 -0
  169. package/skills/sequence-diagram-builder.md +56 -0
  170. package/skills/serverless-edge/SKILL.md +103 -0
  171. package/skills/software-architect.md +356 -0
  172. package/skills/solid-validator.md +332 -0
  173. package/skills/sre-reliability/SKILL.md +115 -0
  174. package/skills/staff-engineer.md +61 -0
  175. package/skills/task-planner.md +61 -0
  176. package/skills/tech-lead.md +59 -0
  177. package/skills/technical-debt-analyzer.md +81 -0
  178. package/skills/technical-writer.md +39 -0
  179. package/skills/tradeoff-analyzer.md +79 -0
  180. package/skills/uml-generator.md +72 -0
  181. package/skills/ux-reviewer.md +61 -0
  182. package/skills/wasm/SKILL.md +133 -0
  183. package/skills/web-perf-engineer/SKILL.md +75 -0
  184. package/skills/web-perf-seo/SKILL.md +111 -0
  185. package/skills/websocket-realtime/SKILL.md +107 -0
  186. package/teaching/adaptive-teaching.md +37 -0
  187. package/teaching/code-explainer.md +172 -0
  188. package/teaching/interactive-teaching.md +41 -0
  189. package/teaching/learning-tracker.md +63 -0
  190. package/teaching/mentor-mode.md +200 -0
  191. package/teaching/professor-mode.md +222 -0
  192. package/testing/e2e-test-engineer.md +68 -0
  193. package/testing/integration-test-engineer.md +74 -0
  194. package/testing/mocking-specialist.md +78 -0
  195. package/testing/unit-test-engineer.md +209 -0
@@ -0,0 +1,73 @@
1
+ # Skill: Scalability Expert
2
+
3
+ > Version 1.0.0 | Priority: High
4
+ > Dependencies: Performance Optimizer, DevOps Engineer, Software Architect
5
+ > Compatibility: ">=1.0.0"
6
+
7
+ ---
8
+
9
+ ## Identity
10
+
11
+ Scalability Expert ensures systems handle growth in users, data, and traffic without degradation. Designs horizontal scaling, caching layers, database sharding, CDN strategy, and async processing pipelines.
12
+
13
+ ---
14
+
15
+ ## Scaling Dimensions
16
+
17
+ ```yaml
18
+ horizontal: add more servers (web, API, workers)
19
+ vertical: bigger servers (limited ceiling)
20
+
21
+ cache:
22
+ - Browser: CDN for static assets
23
+ - Application: Redis for hot data
24
+ - Database: query cache, read replicas
25
+
26
+ database:
27
+ - Read replicas for read-heavy workloads
28
+ - Sharding for write-heavy workloads
29
+ - Connection pooling (PgBouncer, ProxySQL)
30
+
31
+ async:
32
+ - Queues for time-consuming tasks (email, export)
33
+ - Event-driven for decoupling services
34
+ - Stream processing for real-time data
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Horizontal Scaling Checklist
40
+
41
+ - [ ] Application is stateless (session in Redis, not local)
42
+ - [ ] Static assets served from CDN
43
+ - [ ] Database has read replicas
44
+ - [ ] Queues can scale independently
45
+ - [ ] No file storage on local disk (use S3/CDN)
46
+ - [ ] Health checks and auto-scaling configured
47
+ - [ ] Load balancer configured (round-robin or least connections)
48
+ - [ ] Cache invalidation works across nodes
49
+ - [ ] Graceful shutdown (drain connections before stopping)
50
+ - [ ] Metrics track requests per second per node
51
+
52
+ ---
53
+
54
+ ## Database Sharding
55
+
56
+ ```yaml
57
+ strategy: "modular sharding by user_id"
58
+ shards: 4
59
+ key: "user_id % 4"
60
+
61
+ challenges:
62
+ - Cross-shard queries (avoid or use fan-out)
63
+ - Rebalancing when adding shards
64
+ - Backup and restore per shard
65
+
66
+ alternative: "NoSQL (DynamoDB, CosmosDB) for automatic sharding"
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Changelog
72
+
73
+ ### 1.0.0 — Initial release. Scaling dimensions, checklist, sharding.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: security-privacy
3
+ description: |
4
+ Skill de Seguranca e Privacidade para o Portal. Aborda OWASP Top 10, LGPD/GDPR,
5
+ seguranca de APIs, authentication, authorization, cryptography e secure coding.
6
+ Use esta skill para implementar ou revisar aspectos de seguranca e protecao de dados.
7
+ ---
8
+
9
+ # Skill Security & Privacy — Portal
10
+
11
+ ## OWASP Top 10
12
+
13
+ | # | Risco | Prevencao |
14
+ |---|-------|-----------|
15
+ | 1 | Broken Access Control | RLS no Supabase, middleware de role verification |
16
+ | 2 | Cryptographic Failures | TLS 1.3, hashing (bcrypt), encryption at rest |
17
+ | 3 | Injection | Zod validation, prepared statements (Supabase), sanitizacao |
18
+ | 4 | Insecure Design | Threat modeling, security review no design |
19
+ | 5 | Security Misconfiguration | Environment-specific configs, secrets management |
20
+ | 6 | Vulnerable Components | Dependabot, `npm audit`, renovate bot |
21
+ | 7 | Auth Failures | Supabase Auth + MFA, rate limiting |
22
+ | 8 | Data Integrity Failures | CSP headers, Subresource Integrity (SRI) |
23
+ | 9 | Logging Failures | Audit logging, never log PII |
24
+ | 10 | SSRF | URL validation, allowlist de dominios |
25
+
26
+ ---
27
+
28
+ ## LGPD (Lei Geral de Protecao de Dados)
29
+
30
+ ### Direitos do Titular
31
+ - **Acesso**: API para usuario baixar seus dados
32
+ - **Correcao**: editar dados pessoais no perfil
33
+ - **Exclusao**: deletar conta + dados associados (anonimizar logs)
34
+ - **Portabilidade**: exportar dados em JSON
35
+ - **Revogacao de consentimento**: opt-out de comunicacoes
36
+
37
+ ### Obrigacoes Tecnicas
38
+ - Mapeamento de dados pessoais (o que, onde, por que, por quanto tempo)
39
+ - Consentimento explicito para coleta de dados nao essenciais
40
+ - Aviso de privacidade claro (politica de privacidade)
41
+ - DPO (Encarregado) com canal de contato
42
+ - Notificacao de vazamento em 72h (ANPD)
43
+
44
+ ---
45
+
46
+ ## Secure Coding
47
+
48
+ ### Input Validation (Zod)
49
+ ```tsx
50
+ import { z } from "zod";
51
+
52
+ const contactSchema = z.object({
53
+ name: z.string().min(2).max(100),
54
+ email: z.string().email(),
55
+ phone: z.string().regex(/^\(\d{2}\)\s\d{4,5}-\d{4}$/),
56
+ message: z.string().min(10).max(1000),
57
+ });
58
+ ```
59
+
60
+ ### CSP Headers
61
+ ```
62
+ Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' https:; font-src 'self'; connect-src 'self' https://*.supabase.co;
63
+ ```
64
+
65
+ ### API Security
66
+ - Rate limiting (express-rate-limit ou Vercel WAF)
67
+ - CORS restrito (allowlist de dominios)
68
+ - Request size limiting (10kb body max)
69
+ - Idempotency keys em mutations
70
+ - Audit logging (quem, o que, quando)
71
+
72
+ ---
73
+
74
+ ## Authentication & Authorization
75
+
76
+ ### Supabase Auth
77
+ ```tsx
78
+ // Server-side middleware
79
+ export async function middleware(req: NextRequest) {
80
+ const session = await supabase.auth.getSession();
81
+ if (!session) return NextResponse.redirect("/admin/login");
82
+ }
83
+
84
+ // RLS policy
85
+ CREATE POLICY "Admins can read all posts" ON posts
86
+ FOR SELECT USING (auth.role() = 'admin');
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Cryptography
92
+
93
+ | Uso | Algoritmo |
94
+ |-----|-----------|
95
+ | Hashing de senha | bcrypt (cost 12) |
96
+ | JWT signing | RS256 (asymmetric) |
97
+ | TLS | TLS 1.3 (min 1.2) |
98
+ | Dados sensiveis em repouso | AES-256-GCM |
@@ -0,0 +1,54 @@
1
+ # Skill: Self Correction
2
+
3
+ > Version 1.0.0 | Priority: High
4
+ > Dependencies: Reflection Engine, Evolution Engine
5
+ > Compatibility: ">=1.0.0"
6
+
7
+ ---
8
+
9
+ ## Identity
10
+
11
+ Self Correction detects when the agent has made an error in its own output, acknowledges it, explains the mistake, and provides the corrected version.
12
+
13
+ ---
14
+
15
+ ## Detection
16
+
17
+ ```yaml
18
+ detection_methods:
19
+ - User points out the error
20
+ - Contradiction detected in own output (I say X here but ~X there)
21
+ - Violation of a rule in RULES.md
22
+ - Security gate catches it (post-delivery scan)
23
+ - Code example contains syntax error
24
+ ```
25
+
26
+ ## Correction Protocol
27
+
28
+ ```
29
+ 1. Acknowledge — "I made an error in my previous response."
30
+ 2. Explain — "I suggested using X, but Y is better because..."
31
+ 3. Correct — Provide the corrected version.
32
+ 4. Prevent — Update skill/rule to prevent recurrence.
33
+ 5. Log — Record in reflection log.
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Example
39
+
40
+ ```
41
+ Previous response:
42
+ ❌ "Use localStorage for storing JWT tokens."
43
+
44
+ Self correction:
45
+ ✅ Acknowledge: I made an error. localStorage is vulnerable to XSS.
46
+ ✅ Correction: Use httpOnly cookies for JWT storage.
47
+ ✅ Prevention: Updated Security Engineer skill rule: "never suggest localStorage for tokens."
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Changelog
53
+
54
+ ### 1.0.0 — Initial release. Detection, protocol, example.
@@ -0,0 +1,42 @@
1
+ # Skill: Self Critique
2
+
3
+ > Version 1.0.0 | Priority: Medium
4
+ > Dependencies: Reflection Engine
5
+ > Compatibility: ">=1.0.0"
6
+
7
+ ---
8
+
9
+ ## Identity
10
+
11
+ Self Critique proactively reviews its own output for potential improvements before the user points them out. Aims to find at least one improvement per response.
12
+
13
+ ---
14
+
15
+ ## Critique Questions
16
+
17
+ ```
18
+ - Is this the clearest way to explain this?
19
+ - Could a beginner understand this?
20
+ - Did I include all relevant options?
21
+ - Did I explain my reasoning?
22
+ - Is there a simpler approach I missed?
23
+ - Did I consider security implications?
24
+ - Did I consider edge cases?
25
+ - Is this the most efficient solution?
26
+ ```
27
+
28
+ ## Critique Process
29
+
30
+ ```
31
+ 1. Generate initial response
32
+ 2. Run self-critique (5 questions minimum)
33
+ 3. If improvement found: revise before delivery
34
+ 4. If no improvement: deliver as is
35
+ 5. Log critique result (improvements found/none)
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Changelog
41
+
42
+ ### 1.0.0 — Initial release. Questions, process.
@@ -0,0 +1,193 @@
1
+ # Skill: Senior Code Reviewer
2
+
3
+ > Version 1.0.0
4
+ > Priority: High
5
+ > Dependencies: SOLID Validator, Clean Code Validator, Security Engineer, Performance Optimizer
6
+ > Compatibility: ">=1.0.0"
7
+
8
+ ---
9
+
10
+ ## Identity
11
+
12
+ The Senior Code Reviewer analyzes code with the eye of an experienced engineer. It checks for correctness, security, performance, style, maintainability, and testability. Every review produces a structured report with severity levels, actionable fixes, and teaching moments.
13
+
14
+ ---
15
+
16
+ ## Goals
17
+
18
+ - Catch bugs before they reach production.
19
+ - Ensure code follows project conventions and best practices.
20
+ - Identify security vulnerabilities in every review.
21
+ - Suggest performance improvements without premature optimization.
22
+ - Leave the code better than found (boy scout rule).
23
+ - Teach the author something new with every review.
24
+
25
+ ---
26
+
27
+ ## Triggers
28
+
29
+ | Condition | Action |
30
+ |-----------|--------|
31
+ | `task == "review"` | Full code review with report |
32
+ | `task == "pr"` or `task == "merge"` | PR review mode |
33
+ | User says "review this code" | Full review |
34
+ | User shares code snippet | Quick scan + review |
35
+
36
+ ---
37
+
38
+ ## Review Dimensions
39
+
40
+ | Dimension | Weight | Focus |
41
+ |-----------|--------|-------|
42
+ | Correctness | 30% | Logic, edge cases, off-by-one, null safety |
43
+ | Security | 25% | OWASP, secrets, input validation, auth |
44
+ | Maintainability | 15% | Naming, structure, comments, DRY |
45
+ | Performance | 10% | N+1 queries, loops, caching |
46
+ | Style | 10% | Conventions, formatting, consistency |
47
+ | Testability | 10% | Coupling, mocks, coverage |
48
+
49
+ ---
50
+
51
+ ## Review Report Format
52
+
53
+ ```yaml
54
+ review:
55
+ file: "app/Http/Controllers/UserController.php"
56
+ overall_score: 7.5 / 10
57
+ verdict: "APPROVED WITH COMMENTS"
58
+
59
+ findings:
60
+ - severity: "critical"
61
+ line: 42
62
+ message: "SQL injection vulnerability — using raw concatenation"
63
+ rule: "A03: Injection"
64
+ fix: "Use parameterized query: DB::select(... ?, [$id])"
65
+
66
+ - severity: "major"
67
+ line: 15
68
+ message: "Controller has too many responsibilities"
69
+ rule: "SOLID — Single Responsibility"
70
+ fix: "Extract business logic to UserService"
71
+
72
+ - severity: "minor"
73
+ line: 88
74
+ message: "Method name getUserDetails is vague"
75
+ rule: "Clean Code — Meaningful Names"
76
+ fix: "Rename to findById or loadProfile"
77
+
78
+ - severity: "nitpick"
79
+ line: 120
80
+ message: "Trailing whitespace"
81
+ rule: "PSR-12"
82
+ fix: "Auto-fixable"
83
+
84
+ positives:
85
+ - "Good use of Form Request validation"
86
+ - "Pest tests are well-structured"
87
+
88
+ teaching:
89
+ - topic: "SQL Injection Prevention"
90
+ concept: "Always use parameterized queries"
91
+ example: "DB::select('SELECT * FROM users WHERE id = ?', [$id])"
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Severity Levels
97
+
98
+ | Level | Color | Meaning | Action Required |
99
+ |-------|-------|---------|----------------|
100
+ | 🔴 Critical | Red | Bug, vulnerability, or data loss | Must fix before merge |
101
+ | 🟠 Major | Orange | Violates best practice, maintainability risk | Should fix |
102
+ | 🟡 Minor | Yellow | Style, naming, minor improvement | Consider fixing |
103
+ | ⚪ Nitpick | Gray | Trivial (whitespace, formatting) | Optional |
104
+
105
+ ---
106
+
107
+ ## Review Algorithms
108
+
109
+ ### Score Calculation
110
+
111
+ ```
112
+ score = 0
113
+ score += correctness * 0.30
114
+ score += security * 0.25
115
+ score += maintainability * 0.15
116
+ score += performance * 0.10
117
+ score += style * 0.10
118
+ score += testability * 0.10
119
+
120
+ verdict:
121
+ if score >= 9.0: "APPROVED"
122
+ elif score >= 7.0: "APPROVED WITH COMMENTS"
123
+ elif score >= 5.0: "CHANGES REQUESTED"
124
+ else: "REJECTED"
125
+ ```
126
+
127
+ ### Finding Priority
128
+
129
+ ```
130
+ priority = severity_score * impact * likelihood
131
+
132
+ severity_score:
133
+ critical: 5
134
+ major: 3
135
+ minor: 1
136
+ nitpick: 0.5
137
+
138
+ impact:
139
+ affects production: 3
140
+ affects development: 2
141
+ cosmetic only: 1
142
+
143
+ likelihood:
144
+ certain: 3
145
+ likely: 2
146
+ possible: 1
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Rules
152
+
153
+ ### Always
154
+
155
+ - ✅ Provide severity levels for every finding.
156
+ - ✅ Explain why a pattern is wrong, not just that it is wrong.
157
+ - ✅ Include positives — acknowledge what was done well.
158
+ - ✅ Offer specific, actionable fixes.
159
+ - ✅ Include at least one teaching moment per review.
160
+
161
+ ### Never
162
+
163
+ - ❌ Be dismissive or rude ("this is terrible code").
164
+ - ❌ Suggest changes without explaining the reasoning.
165
+ - ❌ Skip security review — always run OWASP checks.
166
+ - ❌ Request changes for style preferences not in the project conventions.
167
+ - ❌ Leave a review without a clear verdict.
168
+
169
+ ---
170
+
171
+ ## Metrics
172
+
173
+ | Metric | Target | How to Measure |
174
+ |--------|--------|---------------|
175
+ | Findings per review | ≥ 3 | Count findings |
176
+ | Critical findings found | 100% pre-merge | Bugs caught / total bugs |
177
+ | Actionable fix rate | ≥ 90% | Findings with specific fix / total |
178
+ | Teaching moments per review | ≥ 1 | Count teaching items |
179
+ | User satisfaction | ≥ 4.0 / 5 | Follow-up rating |
180
+
181
+ ---
182
+
183
+ ## Changelog
184
+
185
+ ### 1.0.0 (2026-07-17)
186
+
187
+ - Initial release
188
+ - 6-dimension review scoring with weights
189
+ - 4 severity levels (critical → nitpick)
190
+ - Structured YAML report format
191
+ - Priority calculation algorithm
192
+ - Positive feedback always included
193
+ - Teaching moment integration
@@ -0,0 +1,56 @@
1
+ # Skill: Sequence Diagram Builder
2
+
3
+ > Version 1.0.0 | Priority: Low
4
+ > Dependencies: UML Generator
5
+ > Compatibility: ">=1.0.0"
6
+
7
+ ---
8
+
9
+ ## Identity
10
+
11
+ Sequence Diagram Builder generates sequence diagrams from API flow descriptions. Shows request/response flow between client, API, services, and database.
12
+
13
+ ---
14
+
15
+ ## PlantUML Sequence
16
+
17
+ ```plantuml
18
+ @startuml
19
+ actor User
20
+ participant "Client" as C
21
+ participant "API" as A
22
+ participant "Service" as S
23
+ participant "Database" as DB
24
+
25
+ User -> C: Submit form
26
+ C -> A: POST /api/v1/users
27
+ A -> S: validate(request)
28
+ A -> S: create(data)
29
+ S -> DB: INSERT users
30
+ DB --> S: user
31
+ S --> A: User
32
+ A --> C: 201 JSON
33
+ C --> User: Success page
34
+ @enduml
35
+ ```
36
+
37
+ ## Mermaid Sequence
38
+
39
+ ```mermaid
40
+ sequenceDiagram
41
+ User->>Client: Submit form
42
+ Client->>API: POST /api/v1/users
43
+ API->>Service: validate(request)
44
+ API->>Service: create(data)
45
+ Service->>Database: INSERT users
46
+ Database-->>Service: user
47
+ Service-->>API: User
48
+ API-->>Client: 201 JSON
49
+ Client-->>User: Success page
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Changelog
55
+
56
+ ### 1.0.0 — Initial release. PlantUML, Mermaid sequence diagrams.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: serverless-edge
3
+ description: |
4
+ Skill de Serverless e Edge Computing para o Portal. Aborda AWS Lambda, Cloudflare
5
+ Workers, Vercel Edge Functions, serverless patterns, cold start optimization e edge caching.
6
+ Use esta skill para implementar funcionalidades serverless e edge computing.
7
+ ---
8
+
9
+ # Skill Serverless & Edge — Portal
10
+
11
+ ## Plataformas
12
+
13
+ ### Vercel Serverless Functions (Preferido)
14
+ ```tsx
15
+ // app/api/hello/route.ts
16
+ export async function GET(req: NextRequest) {
17
+ return NextResponse.json({ message: "Hello from Edge!" });
18
+ }
19
+ ```
20
+ - **Runtime**: Node.js 20, Edge Runtime
21
+ - **Max duration**: 10s (serverless), 30s (pro), 900s (Enterprise)
22
+ - **Memory**: 128MB a 1024MB
23
+ - **Cold start**: ~100ms (Node), ~50ms (Edge)
24
+
25
+ ### AWS Lambda
26
+ - **Runtime**: Node.js 20, Python 3.12
27
+ - **Max duration**: 900s
28
+ - **Memory**: 128MB a 10240MB
29
+ - **Cold start**: ~200ms (Node), ~1s (Java/.NET)
30
+ - **Triggers**: API Gateway, SQS, S3, DynamoDB Streams, EventBridge
31
+
32
+ ### Cloudflare Workers (Edge)
33
+ - **Runtime**: Service Worker API (V8 isolates)
34
+ - **Limites**: 30ms CPU por request, 128MB memory
35
+ - **Casos de uso**: redirects, rewrites, A/B testing, geolocation routing
36
+
37
+ ---
38
+
39
+ ## Serverless Patterns
40
+
41
+ ### Lambda + API Gateway
42
+ ```
43
+ Client → API Gateway → Lambda → DynamoDB/S3/External API
44
+ ```
45
+
46
+ ### Event-driven
47
+ ```
48
+ S3 Event → Lambda → Process → DynamoDB or SQS → Next Step
49
+ ```
50
+
51
+ ### Fan-out
52
+ ```
53
+ SQS → Lambda (process) → SNS → SQS A → Lambda A
54
+ → SQS B → Lambda B
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Cold Start Optimization
60
+
61
+ | Estrategia | Impacto |
62
+ |------------|---------|
63
+ | Provisioned Concurrency (Lambda) | Elimina cold start |
64
+ | Keep warm (ping regular) | Reduz (nao elimina) |
65
+ | Lighter dependencies | Reduz tempo de carga |
66
+ | SnapStart (Lambda Java) | ~90% reducao |
67
+ | Edge Runtime (Vercel) | ~50ms cold start |
68
+ | Workers (Cloudflare) | Zero cold start |
69
+
70
+ ---
71
+
72
+ ## Edge Computing
73
+
74
+ ### Edge Functions (Vercel)
75
+ - **Geolocation**: rotear conteudo por pais/regiao
76
+ - **A/B testing**: servir diferentes variantes
77
+ - **Redirects**: redirecionar por dispositivo/idioma
78
+ - **Headers**: modificar security headers no edge
79
+ - **Authentication**: verificar JWT no edge (reduz latencia)
80
+
81
+ ### Next.js Edge Middleware
82
+ ```tsx
83
+ // middleware.ts
84
+ export function middleware(req: NextRequest) {
85
+ const country = req.geo?.country ?? "BR";
86
+ const url = req.nextUrl.clone();
87
+ if (country !== "BR" && url.pathname === "/") {
88
+ url.pathname = "/internacional";
89
+ return NextResponse.redirect(url);
90
+ }
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Costs & Limits
97
+
98
+ | Recurso | Limite | Custo |
99
+ |---------|--------|-------|
100
+ | Vercel Serverless | 100k requests/mes (Hobby) | Gratuito |
101
+ | Vercel Edge | 100k requests/mes (Hobby) | Gratuito |
102
+ | AWS Lambda | 1M requests/mes | Sempre gratis |
103
+ | Cloudflare Workers | 100k requests/dia | Gratuito |