tribunal-kit 1.0.0 → 2.4.2

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 (127) hide show
  1. package/.agent/.shared/ui-ux-pro-max/README.md +3 -3
  2. package/.agent/ARCHITECTURE.md +205 -10
  3. package/.agent/GEMINI.md +37 -7
  4. package/.agent/agents/accessibility-reviewer.md +134 -0
  5. package/.agent/agents/ai-code-reviewer.md +129 -0
  6. package/.agent/agents/frontend-specialist.md +3 -0
  7. package/.agent/agents/game-developer.md +21 -21
  8. package/.agent/agents/logic-reviewer.md +12 -0
  9. package/.agent/agents/mobile-reviewer.md +79 -0
  10. package/.agent/agents/orchestrator.md +56 -26
  11. package/.agent/agents/performance-reviewer.md +36 -0
  12. package/.agent/agents/supervisor-agent.md +156 -0
  13. package/.agent/agents/swarm-worker-contracts.md +166 -0
  14. package/.agent/agents/swarm-worker-registry.md +92 -0
  15. package/.agent/rules/GEMINI.md +134 -5
  16. package/.agent/scripts/bundle_analyzer.py +259 -0
  17. package/.agent/scripts/dependency_analyzer.py +247 -0
  18. package/.agent/scripts/lint_runner.py +188 -0
  19. package/.agent/scripts/patch_skills_meta.py +177 -0
  20. package/.agent/scripts/patch_skills_output.py +285 -0
  21. package/.agent/scripts/schema_validator.py +279 -0
  22. package/.agent/scripts/security_scan.py +224 -0
  23. package/.agent/scripts/session_manager.py +144 -3
  24. package/.agent/scripts/skill_integrator.py +234 -0
  25. package/.agent/scripts/strengthen_skills.py +220 -0
  26. package/.agent/scripts/swarm_dispatcher.py +317 -0
  27. package/.agent/scripts/test_runner.py +192 -0
  28. package/.agent/scripts/test_swarm_dispatcher.py +163 -0
  29. package/.agent/skills/agent-organizer/SKILL.md +132 -0
  30. package/.agent/skills/agentic-patterns/SKILL.md +335 -0
  31. package/.agent/skills/api-patterns/SKILL.md +226 -50
  32. package/.agent/skills/app-builder/SKILL.md +215 -52
  33. package/.agent/skills/architecture/SKILL.md +176 -31
  34. package/.agent/skills/bash-linux/SKILL.md +150 -134
  35. package/.agent/skills/behavioral-modes/SKILL.md +152 -160
  36. package/.agent/skills/brainstorming/SKILL.md +148 -101
  37. package/.agent/skills/brainstorming/dynamic-questioning.md +10 -0
  38. package/.agent/skills/clean-code/SKILL.md +139 -134
  39. package/.agent/skills/code-review-checklist/SKILL.md +177 -80
  40. package/.agent/skills/config-validator/SKILL.md +165 -0
  41. package/.agent/skills/csharp-developer/SKILL.md +107 -0
  42. package/.agent/skills/database-design/SKILL.md +252 -29
  43. package/.agent/skills/deployment-procedures/SKILL.md +122 -175
  44. package/.agent/skills/devops-engineer/SKILL.md +134 -0
  45. package/.agent/skills/devops-incident-responder/SKILL.md +98 -0
  46. package/.agent/skills/documentation-templates/SKILL.md +175 -121
  47. package/.agent/skills/dotnet-core-expert/SKILL.md +103 -0
  48. package/.agent/skills/edge-computing/SKILL.md +213 -0
  49. package/.agent/skills/frontend-design/SKILL.md +76 -0
  50. package/.agent/skills/frontend-design/color-system.md +18 -0
  51. package/.agent/skills/frontend-design/typography-system.md +18 -0
  52. package/.agent/skills/game-development/SKILL.md +69 -0
  53. package/.agent/skills/geo-fundamentals/SKILL.md +158 -99
  54. package/.agent/skills/github-operations/SKILL.md +354 -0
  55. package/.agent/skills/i18n-localization/SKILL.md +158 -96
  56. package/.agent/skills/intelligent-routing/SKILL.md +89 -285
  57. package/.agent/skills/intelligent-routing/router-manifest.md +65 -0
  58. package/.agent/skills/lint-and-validate/SKILL.md +229 -27
  59. package/.agent/skills/llm-engineering/SKILL.md +258 -0
  60. package/.agent/skills/local-first/SKILL.md +203 -0
  61. package/.agent/skills/mcp-builder/SKILL.md +159 -111
  62. package/.agent/skills/mobile-design/SKILL.md +102 -282
  63. package/.agent/skills/nextjs-react-expert/SKILL.md +143 -227
  64. package/.agent/skills/nodejs-best-practices/SKILL.md +201 -254
  65. package/.agent/skills/observability/SKILL.md +285 -0
  66. package/.agent/skills/parallel-agents/SKILL.md +124 -118
  67. package/.agent/skills/performance-profiling/SKILL.md +143 -89
  68. package/.agent/skills/plan-writing/SKILL.md +133 -97
  69. package/.agent/skills/platform-engineer/SKILL.md +135 -0
  70. package/.agent/skills/powershell-windows/SKILL.md +167 -104
  71. package/.agent/skills/python-patterns/SKILL.md +149 -361
  72. package/.agent/skills/python-pro/SKILL.md +114 -0
  73. package/.agent/skills/react-specialist/SKILL.md +107 -0
  74. package/.agent/skills/readme-builder/SKILL.md +270 -0
  75. package/.agent/skills/realtime-patterns/SKILL.md +296 -0
  76. package/.agent/skills/red-team-tactics/SKILL.md +136 -134
  77. package/.agent/skills/rust-pro/SKILL.md +237 -173
  78. package/.agent/skills/seo-fundamentals/SKILL.md +134 -82
  79. package/.agent/skills/server-management/SKILL.md +155 -104
  80. package/.agent/skills/sql-pro/SKILL.md +104 -0
  81. package/.agent/skills/systematic-debugging/SKILL.md +156 -79
  82. package/.agent/skills/tailwind-patterns/SKILL.md +163 -205
  83. package/.agent/skills/tdd-workflow/SKILL.md +148 -88
  84. package/.agent/skills/test-result-analyzer/SKILL.md +299 -0
  85. package/.agent/skills/testing-patterns/SKILL.md +141 -114
  86. package/.agent/skills/trend-researcher/SKILL.md +228 -0
  87. package/.agent/skills/ui-ux-pro-max/SKILL.md +107 -0
  88. package/.agent/skills/ui-ux-researcher/SKILL.md +234 -0
  89. package/.agent/skills/vue-expert/SKILL.md +118 -0
  90. package/.agent/skills/vulnerability-scanner/SKILL.md +228 -188
  91. package/.agent/skills/web-design-guidelines/SKILL.md +148 -33
  92. package/.agent/skills/webapp-testing/SKILL.md +171 -122
  93. package/.agent/skills/whimsy-injector/SKILL.md +349 -0
  94. package/.agent/skills/workflow-optimizer/SKILL.md +219 -0
  95. package/.agent/workflows/api-tester.md +279 -0
  96. package/.agent/workflows/audit.md +168 -0
  97. package/.agent/workflows/brainstorm.md +65 -19
  98. package/.agent/workflows/changelog.md +144 -0
  99. package/.agent/workflows/create.md +67 -14
  100. package/.agent/workflows/debug.md +122 -30
  101. package/.agent/workflows/deploy.md +82 -31
  102. package/.agent/workflows/enhance.md +59 -27
  103. package/.agent/workflows/fix.md +143 -0
  104. package/.agent/workflows/generate.md +84 -20
  105. package/.agent/workflows/migrate.md +163 -0
  106. package/.agent/workflows/orchestrate.md +66 -17
  107. package/.agent/workflows/performance-benchmarker.md +305 -0
  108. package/.agent/workflows/plan.md +76 -33
  109. package/.agent/workflows/preview.md +73 -17
  110. package/.agent/workflows/refactor.md +153 -0
  111. package/.agent/workflows/review-ai.md +140 -0
  112. package/.agent/workflows/review.md +83 -16
  113. package/.agent/workflows/session.md +154 -0
  114. package/.agent/workflows/status.md +74 -18
  115. package/.agent/workflows/strengthen-skills.md +99 -0
  116. package/.agent/workflows/swarm.md +194 -0
  117. package/.agent/workflows/test.md +80 -31
  118. package/.agent/workflows/tribunal-backend.md +55 -13
  119. package/.agent/workflows/tribunal-database.md +62 -18
  120. package/.agent/workflows/tribunal-frontend.md +58 -12
  121. package/.agent/workflows/tribunal-full.md +70 -11
  122. package/.agent/workflows/tribunal-mobile.md +123 -0
  123. package/.agent/workflows/tribunal-performance.md +152 -0
  124. package/.agent/workflows/ui-ux-pro-max.md +100 -82
  125. package/README.md +117 -62
  126. package/bin/tribunal-kit.js +542 -288
  127. package/package.json +10 -6
@@ -1,129 +1,181 @@
1
1
  ---
2
2
  name: seo-fundamentals
3
3
  description: SEO fundamentals, E-E-A-T, Core Web Vitals, and Google algorithm principles.
4
- allowed-tools: Read, Glob, Grep
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ version: 1.0.0
6
+ last-updated: 2026-03-12
7
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
5
8
  ---
6
9
 
7
10
  # SEO Fundamentals
8
11
 
9
- > Principles for search engine visibility.
12
+ > SEO is not a trick. It is the practice of making content genuinely useful
13
+ > for the people searching for it, and technically accessible to the crawlers that index it.
10
14
 
11
15
  ---
12
16
 
13
- ## 1. E-E-A-T Framework
17
+ ## What Search Engines Actually Rank
14
18
 
15
- | Principle | Signals |
16
- |-----------|---------|
17
- | **Experience** | First-hand knowledge, real examples |
18
- | **Expertise** | Credentials, depth of knowledge |
19
- | **Authoritativeness** | Backlinks, mentions, industry recognition |
20
- | **Trustworthiness** | HTTPS, transparency, accurate info |
19
+ Google's stated ranking factors, simplified:
20
+
21
+ 1. **Relevance** does the content match the search intent?
22
+ 2. **Quality** is it accurate, original, and valuable?
23
+ 3. **Authority** do other credible sources link to it?
24
+ 4. **Experience** is the page fast and easy to use?
25
+
26
+ The manipulation era is over. Keyword stuffing gets pages penalized. Thin AI-generated content is actively filtered. The only reliable long-term SEO is making something worth ranking.
21
27
 
22
28
  ---
23
29
 
24
- ## 2. Core Web Vitals
30
+ ## E-E-A-T Framework
31
+
32
+ Google evaluates content on Experience, Expertise, Authoritativeness, and Trustworthiness.
25
33
 
26
- | Metric | Target | Measures |
27
- |--------|--------|----------|
28
- | **LCP** | < 2.5s | Loading performance |
29
- | **INP** | < 200ms | Interactivity |
30
- | **CLS** | < 0.1 | Visual stability |
34
+ | Signal | What It Means | How to Demonstrate |
35
+ |---|---|---|
36
+ | Experience | First-hand use of the topic | Case studies, screenshots, real examples |
37
+ | Expertise | Deep knowledge of the domain | Accurate detail, citations, author credentials |
38
+ | Authoritativeness | Recognized by others in the field | External links, mentions, speaking/publishing |
39
+ | Trustworthiness | Safe and reliable site | HTTPS, privacy policy, correct contact info |
40
+
41
+ E-E-A-T matters most for YMYL content (health, finance, legal, safety).
31
42
 
32
43
  ---
33
44
 
34
- ## 3. Technical SEO Principles
45
+ ## Technical SEO Checklist
35
46
 
36
- ### Site Structure
47
+ ### Page-Level Requirements
37
48
 
38
- | Element | Purpose |
39
- |---------|---------|
40
- | XML sitemap | Help crawling |
41
- | robots.txt | Control access |
42
- | Canonical tags | Prevent duplicates |
43
- | HTTPS | Security signal |
49
+ ```html
50
+ <!-- Title: 50–60 chars, includes primary keyword -->
51
+ <title>Tribunal Agent Kit Anti-Hallucination AI Tools</title>
44
52
 
45
- ### Performance
53
+ <!-- Description: 120–160 chars, actionable, includes keyword -->
54
+ <meta name="description" content="Install the Tribunal Kit with npx tribunal-kit init.
55
+ 27 specialist agents and 17 slash commands for Cursor, Windsurf, and Antigravity.">
46
56
 
47
- | Factor | Impact |
48
- |--------|--------|
49
- | Page speed | Core Web Vital |
50
- | Mobile-friendly | Ranking factor |
51
- | Clean URLs | Crawlability |
57
+ <!-- One H1 per page — matches the title intent -->
58
+ <h1>Anti-Hallucination Agent Kit for AI IDEs</h1>
52
59
 
53
- ---
60
+ <!-- Canonical — prevent duplicate content -->
61
+ <link rel="canonical" href="https://yoursite.com/page">
54
62
 
55
- ## 4. Content SEO Principles
63
+ <!-- Open Graph (social sharing) -->
64
+ <meta property="og:title" content="...">
65
+ <meta property="og:description" content="...">
66
+ <meta property="og:image" content="https://yoursite.com/og-image.jpg">
67
+ ```
56
68
 
57
- ### Page Elements
69
+ ### Core Web Vitals (2025 Targets)
58
70
 
59
- | Element | Best Practice |
60
- |---------|---------------|
61
- | Title tag | 50-60 chars, keyword front |
62
- | Meta description | 150-160 chars, compelling |
63
- | H1 | One per page, main keyword |
64
- | H2-H6 | Logical hierarchy |
65
- | Alt text | Descriptive, not stuffed |
71
+ | Metric | Good | Needs Work | Poor |
72
+ |---|---|---|---|
73
+ | LCP (Largest Contentful Paint) | < 2.5s | 2.5–4s | > 4s |
74
+ | INP (Interaction to Next Paint) | < 200ms | 200–500ms | > 500ms |
75
+ | CLS (Cumulative Layout Shift) | < 0.1 | 0.1–0.25 | > 0.25 |
66
76
 
67
- ### Content Quality
77
+ **Most common LCP fix:** The hero image or heading is the LCP element. Preload it:
78
+ ```html
79
+ <link rel="preload" href="/hero.webp" as="image" fetchpriority="high">
80
+ ```
68
81
 
69
- | Factor | Importance |
70
- |--------|------------|
71
- | Depth | Comprehensive coverage |
72
- | Freshness | Regular updates |
73
- | Uniqueness | Original value |
74
- | Readability | Clear writing |
82
+ **Most common CLS fix:** Images without explicit width/height cause layout shifts:
83
+ ```html
84
+ <img src="..." width="800" height="450" alt="...">
85
+ ```
75
86
 
76
87
  ---
77
88
 
78
- ## 5. Schema Markup Types
79
-
80
- | Type | Use |
81
- |------|-----|
82
- | Article | Blog posts, news |
83
- | Organization | Company info |
84
- | Person | Author profiles |
85
- | FAQPage | Q&A content |
86
- | Product | E-commerce |
87
- | Review | Ratings |
88
- | BreadcrumbList | Navigation |
89
+ ## Content Structure
90
+
91
+ ```
92
+ Page structure that works:
93
+ H1: Primary topic (one per page)
94
+ H2: Major sections
95
+ H3: Subsections
96
+
97
+ Content patterns that help:
98
+ - Answer the question in the first paragraph
99
+ - Use tables and lists for comparative or step-by-step info
100
+ - Add FAQ sections for long-tail queries
101
+ - Internal links to related content
102
+ - External links to authoritative sources
103
+ ```
89
104
 
90
105
  ---
91
106
 
92
- ## 6. AI Content Guidelines
107
+ ## What Not to Do
108
+
109
+ - **Keyword stuffing** — unreadable text written for bots; penalized
110
+ - **Thin content** — pages with nothing to say; filtered
111
+ - **Duplicate content** — same content on multiple URLs without canonical; splits authority
112
+ - **Hidden text** — same color as background, `display:none` with keywords; penalized
113
+ - **Link schemes** — buying links; can result in manual penalty
93
114
 
94
- ### What Google Looks For
115
+ ---
95
116
 
96
- | ✅ Do | ❌ Don't |
97
- |-------|----------|
98
- | AI draft + human edit | Publish raw AI content |
99
- | Add original insights | Copy without value |
100
- | Expert review | Skip fact-checking |
101
- | Follow E-E-A-T | Keyword stuffing |
117
+ ## Scripts
118
+
119
+ | Script | Purpose | Run With |
120
+ |---|---|---|
121
+ | `scripts/seo_checker.py` | Audits page-level technical SEO | `python scripts/seo_checker.py <url>` |
102
122
 
103
123
  ---
104
124
 
105
- ## 7. Ranking Factors (Prioritized)
125
+ ## Output Format
126
+
127
+ When this skill produces a recommendation or design decision, structure your output as:
128
+
129
+ ```
130
+ ━━━ Seo Fundamentals Recommendation ━━━━━━━━━━━━━━━━
131
+ Decision: [what was chosen / proposed]
132
+ Rationale: [why — one concise line]
133
+ Trade-offs: [what is consciously accepted]
134
+ Next action: [concrete next step for the user]
135
+ ─────────────────────────────────────────────────
136
+ Pre-Flight: ✅ All checks passed
137
+ or ❌ [blocking item that must be resolved first]
138
+ ```
139
+
106
140
 
107
- | Priority | Factor |
108
- |----------|--------|
109
- | 1 | Quality, relevant content |
110
- | 2 | Backlinks from authority sites |
111
- | 3 | Page experience (Core Web Vitals) |
112
- | 4 | Mobile optimization |
113
- | 5 | Technical SEO fundamentals |
114
141
 
115
142
  ---
116
143
 
117
- ## 8. Measurement
144
+ ## 🤖 LLM-Specific Traps
145
+
146
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
118
147
 
119
- | Metric | Tool |
120
- |--------|------|
121
- | Rankings | Search Console, Ahrefs |
122
- | Traffic | Analytics |
123
- | Core Web Vitals | PageSpeed Insights |
124
- | Indexing | Search Console |
125
- | Backlinks | Ahrefs, Semrush |
148
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
149
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
150
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
151
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
152
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
126
153
 
127
154
  ---
128
155
 
129
- > **Remember:** SEO is a long-term game. Quality content + technical excellence + patience = results.
156
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
157
+
158
+ **Slash command: `/review` or `/tribunal-full`**
159
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
160
+
161
+ ### ❌ Forbidden AI Tropes
162
+
163
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
164
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
165
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
166
+
167
+ ### ✅ Pre-Flight Self-Audit
168
+
169
+ Review these questions before confirming output:
170
+ ```
171
+ ✅ Did I rely ONLY on real, verified tools and methods?
172
+ ✅ Is this solution appropriately scoped to the user's constraints?
173
+ ✅ Did I handle potential failure modes and edge cases?
174
+ ✅ Have I avoided generic boilerplate that doesn't add value?
175
+ ```
176
+
177
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
178
+
179
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
180
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
181
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -1,161 +1,212 @@
1
1
  ---
2
2
  name: server-management
3
3
  description: Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.
4
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ version: 1.0.0
6
+ last-updated: 2026-03-12
7
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
5
8
  ---
6
9
 
7
- # Server Management
10
+ # Server Management Principles
8
11
 
9
- > Server management principles for production operations.
10
- > **Learn to THINK, not memorize commands.**
12
+ > A server you can't observe is a server you can't operate.
13
+ > Monitoring is not optional — it is how you find out about problems before your users do.
11
14
 
12
15
  ---
13
16
 
14
- ## 1. Process Management Principles
17
+ ## Process Management
15
18
 
16
- ### Tool Selection
19
+ Never run Node.js or Python processes directly in production with `node app.js`. Use a process manager.
17
20
 
18
- | Scenario | Tool |
19
- |----------|------|
20
- | **Node.js app** | PM2 (clustering, reload) |
21
- | **Any app** | systemd (Linux native) |
22
- | **Containers** | Docker/Podman |
23
- | **Orchestration** | Kubernetes, Docker Swarm |
21
+ | Tool | Best For | Why |
22
+ |---|---|---|
23
+ | PM2 | Single-server Node.js | Auto-restart, log rotation, cluster mode |
24
+ | systemd | Linux servers, any language | Native to most Linux distros, reliable |
25
+ | Supervisor | Python, Ruby, any language | Simple config, battle-tested |
26
+ | Docker (+restart policy) | Containerized apps | Portable, consistent across environments |
24
27
 
25
- ### Process Management Goals
28
+ **Core requirement:** If the process crashes, it restarts automatically. If it can't restart, you are alerted.
26
29
 
27
- | Goal | What It Means |
28
- |------|---------------|
29
- | **Restart on crash** | Auto-recovery |
30
- | **Zero-downtime reload** | No service interruption |
31
- | **Clustering** | Use all CPU cores |
32
- | **Persistence** | Survive server reboot |
30
+ ```bash
31
+ # PM2 example — stays running, auto-restarts, survives reboots
32
+ pm2 start app.js --name "api" --instances max
33
+ pm2 save
34
+ pm2 startup # generates the command to run at boot
35
+ ```
33
36
 
34
37
  ---
35
38
 
36
- ## 2. Monitoring Principles
39
+ ## What to Monitor
37
40
 
38
- ### What to Monitor
41
+ The minimum viable monitoring stack:
39
42
 
40
- | Category | Key Metrics |
41
- |----------|-------------|
42
- | **Availability** | Uptime, health checks |
43
- | **Performance** | Response time, throughput |
44
- | **Errors** | Error rate, types |
45
- | **Resources** | CPU, memory, disk |
43
+ | Signal | What To Alert On |
44
+ |---|---|
45
+ | Process health | Process is not running |
46
+ | Response time | P95 latency > SLA threshold |
47
+ | Error rate | Error rate > 2x baseline |
48
+ | Disk usage | > 80% full |
49
+ | Memory | Growing without bound (memory leak) |
50
+ | CPU | Sustained > 80% for more than 5 minutes |
46
51
 
47
- ### Alert Severity Strategy
52
+ **Alert on symptoms, not just causes.** "Error rate spiked" is a better alert than "CPU is high" — users don't feel CPU, they feel slow responses and errors.
48
53
 
49
- | Level | Response |
50
- |-------|----------|
51
- | **Critical** | Immediate action |
52
- | **Warning** | Investigate soon |
53
- | **Info** | Review daily |
54
+ ---
55
+
56
+ ## Log Management
57
+
58
+ Logs are useless without structure. Structured logs can be queried and aggregated.
59
+
60
+ ```ts
61
+ // ❌ Unstructured — hard to query
62
+ console.log(`User ${userId} failed to login at ${new Date()}`);
63
+
64
+ // ✅ Structured — can be filtered, aggregated, alerted on
65
+ logger.warn('login_failed', {
66
+ userId,
67
+ ip: req.ip,
68
+ reason: 'invalid_password',
69
+ timestamp: new Date().toISOString(),
70
+ });
71
+ ```
54
72
 
55
- ### Monitoring Tool Selection
73
+ **Log levels, used correctly:**
74
+ - `ERROR` — something failed that requires attention
75
+ - `WARN` — something unexpected but non-fatal happened
76
+ - `INFO` — key business events (user registered, payment processed)
77
+ - `DEBUG` — useful for troubleshooting, never on in production by default
56
78
 
57
- | Need | Options |
58
- |------|---------|
59
- | Simple/Free | PM2 metrics, htop |
60
- | Full observability | Grafana, Datadog |
61
- | Error tracking | Sentry |
62
- | Uptime | UptimeRobot, Pingdom |
79
+ **Never log:**
80
+ - Passwords, tokens, or full credit card numbers
81
+ - PII without a documented retention policy
82
+ - Full request bodies on auth endpoints
63
83
 
64
84
  ---
65
85
 
66
- ## 3. Log Management Principles
86
+ ## Scaling Decision Framework
67
87
 
68
- ### Log Strategy
88
+ Before scaling, answer:
69
89
 
70
- | Log Type | Purpose |
71
- |----------|---------|
72
- | **Application logs** | Debug, audit |
73
- | **Access logs** | Traffic analysis |
74
- | **Error logs** | Issue detection |
90
+ **Is the bottleneck identified?**
91
+ - Profile first. Is it CPU, memory, database, or network?
92
+ - Scaling horizontally when the bottleneck is a single database query helps nothing.
75
93
 
76
- ### Log Principles
94
+ | Bottleneck | Scaling Approach |
95
+ |---|---|
96
+ | CPU-bound app logic | Horizontal scale (more instances) |
97
+ | Memory limit | Vertical scale (more RAM per instance) |
98
+ | I/O-bound (DB, external calls) | Connection pooling, caching, async patterns |
99
+ | Database reads | Read replicas, query optimization, caching |
100
+ | Database writes | Sharding, write queuing, schema redesign |
77
101
 
78
- 1. **Rotate logs** to prevent disk fill
79
- 2. **Structured logging** (JSON) for parsing
80
- 3. **Appropriate levels** (error/warn/info/debug)
81
- 4. **No sensitive data** in logs
102
+ **Cached responses don't need scaling.** Add caching before adding instances.
82
103
 
83
104
  ---
84
105
 
85
- ## 4. Scaling Decisions
106
+ ## Nginx Configuration Essentials
107
+
108
+ ```nginx
109
+ server {
110
+ listen 80;
111
+ server_name example.com;
112
+
113
+ # Redirect HTTP → HTTPS
114
+ return 301 https://$host$request_uri;
115
+ }
116
+
117
+ server {
118
+ listen 443 ssl;
119
+ server_name example.com;
120
+
121
+ # Security headers
122
+ add_header X-Frame-Options DENY;
123
+ add_header X-Content-Type-Options nosniff;
124
+ add_header Strict-Transport-Security "max-age=31536000" always;
125
+
126
+ # Proxy to Node.js app
127
+ location / {
128
+ proxy_pass http://127.0.0.1:3000;
129
+ proxy_set_header Host $host;
130
+ proxy_set_header X-Real-IP $remote_addr;
131
+ proxy_set_header X-Forwarded-Proto https;
132
+ }
133
+
134
+ # Serve static files directly (don't proxy to Node)
135
+ location /static/ {
136
+ root /var/www/myapp;
137
+ expires 1y;
138
+ add_header Cache-Control "public, immutable";
139
+ }
140
+ }
141
+ ```
86
142
 
87
- ### When to Scale
143
+ ---
88
144
 
89
- | Symptom | Solution |
90
- |---------|----------|
91
- | High CPU | Add instances (horizontal) |
92
- | High memory | Increase RAM or fix leak |
93
- | Slow response | Profile first, then scale |
94
- | Traffic spikes | Auto-scaling |
145
+ ## Backup Strategy
95
146
 
96
- ### Scaling Strategy
147
+ The 3-2-1 rule:
148
+ - **3** copies of data
149
+ - **2** on different storage media
150
+ - **1** offsite (different data center, cloud region)
97
151
 
98
- | Type | When to Use |
99
- |------|-------------|
100
- | **Vertical** | Quick fix, single instance |
101
- | **Horizontal** | Sustainable, distributed |
102
- | **Auto** | Variable traffic |
152
+ Test restores on a schedule a backup you've never restored is a backup you don't know works.
103
153
 
104
154
  ---
105
155
 
106
- ## 5. Health Check Principles
156
+ ## Output Format
107
157
 
108
- ### What Constitutes Healthy
158
+ When this skill produces a recommendation or design decision, structure your output as:
109
159
 
110
- | Check | Meaning |
111
- |-------|---------|
112
- | **HTTP 200** | Service responding |
113
- | **Database connected** | Data accessible |
114
- | **Dependencies OK** | External services reachable |
115
- | **Resources OK** | CPU/memory not exhausted |
160
+ ```
161
+ ━━━ Server Management Recommendation ━━━━━━━━━━━━━━━━
162
+ Decision: [what was chosen / proposed]
163
+ Rationale: [why one concise line]
164
+ Trade-offs: [what is consciously accepted]
165
+ Next action: [concrete next step for the user]
166
+ ─────────────────────────────────────────────────
167
+ Pre-Flight: ✅ All checks passed
168
+ or ❌ [blocking item that must be resolved first]
169
+ ```
116
170
 
117
- ### Health Check Implementation
118
171
 
119
- - Simple: Just return 200
120
- - Deep: Check all dependencies
121
- - Choose based on load balancer needs
122
172
 
123
173
  ---
124
174
 
125
- ## 6. Security Principles
175
+ ## 🤖 LLM-Specific Traps
176
+
177
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
126
178
 
127
- | Area | Principle |
128
- |------|-----------|
129
- | **Access** | SSH keys only, no passwords |
130
- | **Firewall** | Only needed ports open |
131
- | **Updates** | Regular security patches |
132
- | **Secrets** | Environment vars, not files |
133
- | **Audit** | Log access and changes |
179
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
180
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
181
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
182
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
183
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
134
184
 
135
185
  ---
136
186
 
137
- ## 7. Troubleshooting Priority
187
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
138
188
 
139
- When something's wrong:
189
+ **Slash command: `/review` or `/tribunal-full`**
190
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
140
191
 
141
- 1. **Check if running** (process status)
142
- 2. **Check logs** (error messages)
143
- 3. **Check resources** (disk, memory, CPU)
144
- 4. **Check network** (ports, DNS)
145
- 5. **Check dependencies** (database, APIs)
192
+ ### Forbidden AI Tropes
146
193
 
147
- ---
194
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
195
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
196
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
148
197
 
149
- ## 8. Anti-Patterns
198
+ ### Pre-Flight Self-Audit
150
199
 
151
- | Don't | Do |
152
- |----------|-------|
153
- | Run as root | Use non-root user |
154
- | Ignore logs | Set up log rotation |
155
- | Skip monitoring | Monitor from day one |
156
- | Manual restarts | Auto-restart config |
157
- | No backups | Regular backup schedule |
200
+ Review these questions before confirming output:
201
+ ```
202
+ Did I rely ONLY on real, verified tools and methods?
203
+ Is this solution appropriately scoped to the user's constraints?
204
+ Did I handle potential failure modes and edge cases?
205
+ Have I avoided generic boilerplate that doesn't add value?
206
+ ```
158
207
 
159
- ---
208
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
160
209
 
161
- > **Remember:** A well-managed server is boring. That's the goal.
210
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
211
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
212
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.