@rfxlamia/skillkit 1.0.0 → 1.2.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.
- package/agents/agents/creative-copywriter.md +212 -0
- package/agents/agents/dario-amodei.md +135 -0
- package/agents/agents/doc-simplifier.md +63 -0
- package/agents/agents/kotlin-pro.md +433 -0
- package/agents/agents/red-team.md +136 -0
- package/agents/agents/sam-altman.md +121 -0
- package/agents/agents/seo-manager.md +184 -0
- package/package.json +7 -2
- package/skills/quick-spec/tests/__pycache__/test_skill.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skillkit/.claude/settings.local.json +7 -0
- package/skills/skillkit/scripts/__pycache__/decision_helper.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/__pycache__/test_generator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-314.pyc +0 -0
- package/skills/skillkit-help/SKILL.md +81 -0
- package/skills/skillkit-help/knowledge/application/09-case-studies.md +257 -0
- package/skills/skillkit-help/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skillkit-help/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skillkit-help/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skillkit-help/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skillkit-help/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skillkit-help/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skillkit-help/template/SKILL.md +52 -0
- package/skills/skills/adversarial-review/SKILL.md +219 -0
- package/skills/skills/baby-education/SKILL.md +260 -0
- package/skills/skills/baby-education/references/advanced-techniques.md +323 -0
- package/skills/skills/baby-education/references/transformations.md +345 -0
- package/skills/skills/been-there-done-that/SKILL.md +455 -0
- package/skills/skills/been-there-done-that/references/analysis-patterns.md +162 -0
- package/skills/skills/been-there-done-that/references/git-commands.md +132 -0
- package/skills/skills/been-there-done-that/references/tree-insertion-logic.md +145 -0
- package/skills/skills/coolhunter/SKILL.md +270 -0
- package/skills/skills/coolhunter/assets/elicitation-methods.csv +51 -0
- package/skills/skills/coolhunter/knowledge/elicitation-methods.md +312 -0
- package/skills/skills/coolhunter/references/workflow-execution.md +238 -0
- package/skills/skills/coolhunter/workflow-plan-coolhunter.md +232 -0
- package/skills/skills/creative-copywriting/SKILL.md +324 -0
- package/skills/skills/creative-copywriting/databases/README.md +60 -0
- package/skills/skills/creative-copywriting/databases/carousel-structures.csv +16 -0
- package/skills/skills/creative-copywriting/databases/emotional-arcs.csv +11 -0
- package/skills/skills/creative-copywriting/databases/hook-formulas.csv +51 -0
- package/skills/skills/creative-copywriting/databases/power-words.csv +201 -0
- package/skills/skills/creative-copywriting/databases/psychological-triggers.csv +21 -0
- package/skills/skills/creative-copywriting/databases/read-more-patterns.csv +26 -0
- package/skills/skills/creative-copywriting/databases/swipe-triggers.csv +31 -0
- package/skills/skills/creative-copywriting/references/carousel-psychology.md +223 -0
- package/skills/skills/creative-copywriting/references/hook-anatomy.md +169 -0
- package/skills/skills/creative-copywriting/references/power-word-science.md +134 -0
- package/skills/skills/creative-copywriting/references/storytelling-frameworks.md +157 -0
- package/skills/skills/diverse-content-gen/SKILL.md +201 -0
- package/skills/skills/diverse-content-gen/references/advanced-techniques.md +320 -0
- package/skills/skills/diverse-content-gen/references/research-findings.md +379 -0
- package/skills/skills/diverse-content-gen/references/task-workflows.md +241 -0
- package/skills/skills/diverse-content-gen/references/tool-integration.md +419 -0
- package/skills/skills/diverse-content-gen/references/troubleshooting.md +426 -0
- package/skills/skills/diverse-content-gen/references/vs-core-technique.md +240 -0
- package/skills/skills/framework-critical-thinking/SKILL.md +220 -0
- package/skills/skills/framework-critical-thinking/references/bias_detector.md +375 -0
- package/skills/skills/framework-critical-thinking/references/fallback_handler.md +239 -0
- package/skills/skills/framework-critical-thinking/references/memory_curator.md +161 -0
- package/skills/skills/framework-critical-thinking/references/metacognitive_monitor.md +297 -0
- package/skills/skills/framework-critical-thinking/references/producer_critic_orchestrator.md +333 -0
- package/skills/skills/framework-critical-thinking/references/reasoning_router.md +235 -0
- package/skills/skills/framework-critical-thinking/references/reasoning_validator.md +97 -0
- package/skills/skills/framework-critical-thinking/references/reflection_trigger.md +78 -0
- package/skills/skills/framework-critical-thinking/references/self_verification.md +388 -0
- package/skills/skills/framework-critical-thinking/references/uncertainty_quantifier.md +207 -0
- package/skills/skills/framework-initiative/SKILL.md +231 -0
- package/skills/skills/framework-initiative/references/examples.md +150 -0
- package/skills/skills/framework-initiative/references/impact-analysis.md +157 -0
- package/skills/skills/framework-initiative/references/intent-patterns.md +145 -0
- package/skills/skills/framework-initiative/references/star-framework.md +165 -0
- package/skills/skills/humanize-docs/SKILL.md +203 -0
- package/skills/skills/humanize-docs/references/advanced-techniques.md +13 -0
- package/skills/skills/humanize-docs/references/core-transformations.md +368 -0
- package/skills/skills/humanize-docs/references/detection-patterns.md +400 -0
- package/skills/skills/humanize-docs/references/examples-gallery.md +374 -0
- package/skills/skills/imagine/SKILL.md +190 -0
- package/skills/skills/imagine/references/artstyle-corporate-memphis.md +625 -0
- package/skills/skills/imagine/references/artstyle-crewdson-hyperrealism.md +295 -0
- package/skills/skills/imagine/references/artstyle-iphone-social-media.md +426 -0
- package/skills/skills/imagine/references/artstyle-sciencesaru.md +276 -0
- package/skills/skills/pre-deploy-checklist/README.md +26 -0
- package/skills/skills/pre-deploy-checklist/SKILL.md +153 -0
- package/skills/skills/pre-deploy-checklist/references/checklist-categories.md +174 -0
- package/skills/skills/pre-deploy-checklist/references/domain-prompts.md +216 -0
- package/skills/skills/prompt-engineering/SKILL.md +209 -0
- package/skills/skills/prompt-engineering/references/advanced-combinations.md +444 -0
- package/skills/skills/prompt-engineering/references/chain-of-thought.md +140 -0
- package/skills/skills/prompt-engineering/references/decision_matrix.md +220 -0
- package/skills/skills/prompt-engineering/references/few-shot.md +346 -0
- package/skills/skills/prompt-engineering/references/json-format.md +270 -0
- package/skills/skills/prompt-engineering/references/natural-language.md +420 -0
- package/skills/skills/prompt-engineering/references/pitfalls.md +365 -0
- package/skills/skills/prompt-engineering/references/prompt-chaining.md +498 -0
- package/skills/skills/prompt-engineering/references/react.md +108 -0
- package/skills/skills/prompt-engineering/references/self-consistency.md +322 -0
- package/skills/skills/prompt-engineering/references/tree-of-thoughts.md +386 -0
- package/skills/skills/prompt-engineering/references/xml-format.md +220 -0
- package/skills/skills/prompt-engineering/references/yaml-format.md +488 -0
- package/skills/skills/prompt-engineering/references/zero-shot.md +74 -0
- package/skills/skills/quick-spec/SKILL.md +280 -0
- package/skills/skills/quick-spec/assets/tech-spec-template.md +74 -0
- package/skills/skills/quick-spec/references/step-01-understand.md +189 -0
- package/skills/skills/quick-spec/references/step-02-investigate.md +144 -0
- package/skills/skills/quick-spec/references/step-03-generate.md +128 -0
- package/skills/skills/quick-spec/references/step-04-review.md +173 -0
- package/skills/skills/quick-spec/tests/__pycache__/test_skill.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skills/quick-spec/tests/test_scenarios.md +83 -0
- package/skills/skills/quick-spec/tests/test_skill.py +136 -0
- package/skills/skills/readme-expert/SKILL.md +538 -0
- package/skills/skills/readme-expert/knowledge/INDEX.md +192 -0
- package/skills/skills/readme-expert/knowledge/application/quality-standards.md +470 -0
- package/skills/skills/readme-expert/knowledge/application/script-executor.md +604 -0
- package/skills/skills/readme-expert/knowledge/application/template-library.md +822 -0
- package/skills/skills/readme-expert/knowledge/foundation/codebase-scanner.md +361 -0
- package/skills/skills/readme-expert/knowledge/foundation/validation-checklist.md +481 -0
- package/skills/skills/red-teaming/SKILL.md +321 -0
- package/skills/skills/red-teaming/references/ai-llm-redteam.md +517 -0
- package/skills/skills/red-teaming/references/attack-techniques.md +410 -0
- package/skills/skills/red-teaming/references/cybersecurity-redteam.md +383 -0
- package/skills/skills/red-teaming/references/tools-frameworks.md +446 -0
- package/skills/skills/releasing/.skillkit-mode +1 -0
- package/skills/skills/releasing/SKILL.md +225 -0
- package/skills/skills/releasing/references/version-detection.md +108 -0
- package/skills/skills/screenwriter/SKILL.md +273 -0
- package/skills/skills/screenwriter/references/advanced-techniques.md +216 -0
- package/skills/skills/screenwriter/references/pipeline-integration.md +266 -0
- package/skills/skills/skillkit/.claude/settings.local.json +7 -0
- package/skills/skills/skillkit/.claude-plugin/plugin.json +27 -0
- package/skills/skills/skillkit/CHANGELOG.md +484 -0
- package/skills/skills/skillkit/SKILL.md +511 -0
- package/skills/skills/skillkit/commands/skillkit.md +6 -0
- package/skills/skills/skillkit/commands/validate-plan.md +6 -0
- package/skills/skills/skillkit/commands/verify.md +6 -0
- package/skills/skills/skillkit/knowledge/INDEX.md +352 -0
- package/skills/skills/skillkit/knowledge/application/09-case-studies.md +257 -0
- package/skills/skills/skillkit/knowledge/application/10-technical-architecture.md +324 -0
- package/skills/skills/skillkit/knowledge/application/11-adoption-strategy.md +267 -0
- package/skills/skills/skillkit/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skills/skillkit/knowledge/application/13-competitive-landscape.md +198 -0
- package/skills/skills/skillkit/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skills/skillkit/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skills/skillkit/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skills/skillkit/knowledge/foundation/04-hybrid-patterns.md +308 -0
- package/skills/skills/skillkit/knowledge/foundation/05-token-economics.md +275 -0
- package/skills/skills/skillkit/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skills/skillkit/knowledge/foundation/07-security-concerns.md +322 -0
- package/skills/skills/skillkit/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skills/skillkit/knowledge/plugin-guide.md +614 -0
- package/skills/skills/skillkit/knowledge/tools/14-validation-tools-guide.md +150 -0
- package/skills/skills/skillkit/knowledge/tools/15-cost-tools-guide.md +157 -0
- package/skills/skills/skillkit/knowledge/tools/16-security-tools-guide.md +122 -0
- package/skills/skills/skillkit/knowledge/tools/17-pattern-tools-guide.md +161 -0
- package/skills/skills/skillkit/knowledge/tools/18-decision-helper-guide.md +243 -0
- package/skills/skills/skillkit/knowledge/tools/19-test-generator-guide.md +275 -0
- package/skills/skills/skillkit/knowledge/tools/20-split-skill-guide.md +149 -0
- package/skills/skills/skillkit/knowledge/tools/21-quality-scorer-guide.md +226 -0
- package/skills/skills/skillkit/knowledge/tools/22-migration-helper-guide.md +356 -0
- package/skills/skills/skillkit/knowledge/tools/23-subagent-creation-guide.md +448 -0
- package/skills/skills/skillkit/knowledge/tools/24-behavioral-testing-guide.md +122 -0
- package/skills/skills/skillkit/references/proposal-generation.md +982 -0
- package/skills/skills/skillkit/references/rationalization-catalog.md +75 -0
- package/skills/skills/skillkit/references/research-methodology.md +661 -0
- package/skills/skills/skillkit/references/section-2-full-creation-workflow.md +452 -0
- package/skills/skills/skillkit/references/section-3-validation-workflow-existing-skill.md +63 -0
- package/skills/skills/skillkit/references/section-4-decision-workflow-skills-vs-subagents.md +64 -0
- package/skills/skills/skillkit/references/section-5-migration-workflow-doc-to-skill.md +58 -0
- package/skills/skills/skillkit/references/section-6-subagent-creation-workflow.md +499 -0
- package/skills/skills/skillkit/references/section-7-knowledge-reference-map.md +72 -0
- package/skills/skills/skillkit/scripts/__pycache__/decision_helper.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/test_generator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skills/skillkit/scripts/decision_helper.py +799 -0
- package/skills/skills/skillkit/scripts/init_skill.py +400 -0
- package/skills/skills/skillkit/scripts/init_subagent.py +231 -0
- package/skills/skills/skillkit/scripts/migration_helper.py +669 -0
- package/skills/skills/skillkit/scripts/package_skill.py +211 -0
- package/skills/skills/skillkit/scripts/pattern_detector.py +381 -0
- package/skills/skills/skillkit/scripts/pattern_detector_new.py +382 -0
- package/skills/skills/skillkit/scripts/pressure_tester.py +157 -0
- package/skills/skills/skillkit/scripts/quality_scorer.py +999 -0
- package/skills/skills/skillkit/scripts/quick_validate.py +100 -0
- package/skills/skills/skillkit/scripts/security_scanner.py +474 -0
- package/skills/skills/skillkit/scripts/split_skill.py +540 -0
- package/skills/skills/skillkit/scripts/test_generator.py +695 -0
- package/skills/skills/skillkit/scripts/token_estimator.py +493 -0
- package/skills/skills/skillkit/scripts/utils/__init__.py +49 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/budget_tracker.py +388 -0
- package/skills/skills/skillkit/scripts/utils/output_formatter.py +263 -0
- package/skills/skills/skillkit/scripts/utils/reference_validator.py +401 -0
- package/skills/skills/skillkit/scripts/validate_skill.py +594 -0
- package/skills/skills/skillkit/tests/test_behavioral.py +39 -0
- package/skills/skills/skillkit/tests/test_scenarios.md +83 -0
- package/skills/skills/skillkit/tests/test_skill.py +136 -0
- package/skills/skills/skillkit-help/SKILL.md +81 -0
- package/skills/skills/skillkit-help/knowledge/application/09-case-studies.md +257 -0
- package/skills/skills/skillkit-help/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skills/skillkit-help/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skills/skillkit-help/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skills/skillkit-help/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skills/skillkit-help/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skills/skillkit-help/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skills/skillkit-help/template/SKILL.md +52 -0
- package/skills/skills/social-media-seo/SKILL.md +278 -0
- package/skills/skills/social-media-seo/databases/caption-styles.csv +31 -0
- package/skills/skills/social-media-seo/databases/engagement-tactics.csv +16 -0
- package/skills/skills/social-media-seo/databases/hashtag-strategies.csv +21 -0
- package/skills/skills/social-media-seo/databases/hook-formulas.csv +26 -0
- package/skills/skills/social-media-seo/databases/keyword-clusters.csv +11 -0
- package/skills/skills/social-media-seo/databases/thread-structures.csv +26 -0
- package/skills/skills/social-media-seo/databases/viral-patterns.csv +21 -0
- package/skills/skills/social-media-seo/references/analytics-guide.md +321 -0
- package/skills/skills/social-media-seo/references/instagram-seo.md +235 -0
- package/skills/skills/social-media-seo/references/threads-seo.md +305 -0
- package/skills/skills/social-media-seo/references/x-twitter-seo.md +337 -0
- package/skills/skills/social-media-seo/scripts/query_database.py +191 -0
- package/skills/skills/storyteller/SKILL.md +241 -0
- package/skills/skills/storyteller/references/transformation-methodology.md +293 -0
- package/skills/skills/storyteller/references/visual-vocabulary.md +177 -0
- package/skills/skills/thread-pro/SKILL.md +162 -0
- package/skills/skills/thread-pro/anti-ai-patterns.md +120 -0
- package/skills/skills/thread-pro/hook-formulas.md +138 -0
- package/skills/skills/thread-pro/references/anti-ai-patterns.md +120 -0
- package/skills/skills/thread-pro/references/hook-formulas.md +138 -0
- package/skills/skills/thread-pro/references/thread-structures.md +240 -0
- package/skills/skills/thread-pro/references/voice-injection.md +130 -0
- package/skills/skills/thread-pro/thread-structures.md +240 -0
- package/skills/skills/thread-pro/voice-injection.md +130 -0
- package/skills/skills/tinkering/SKILL.md +251 -0
- package/skills/skills/tinkering/references/graduation-checklist.md +100 -0
- package/skills/skills/validate-plan/.skillkit-mode +1 -0
- package/skills/skills/validate-plan/SKILL.md +406 -0
- package/skills/skills/validate-plan/references/dry-principles.md +251 -0
- package/skills/skills/validate-plan/references/gap-analysis-guide.md +320 -0
- package/skills/skills/validate-plan/references/tdd-patterns.md +413 -0
- package/skills/skills/validate-plan/references/yagni-checklist.md +330 -0
- package/skills/skills/verify-before-ship/.skillkit-mode +1 -0
- package/skills/skills/verify-before-ship/SKILL.md +116 -0
- package/skills/skills/verify-before-ship/references/anti-rationalization.md +212 -0
- package/skills/skills/verify-before-ship/references/verification-gates.md +305 -0
- package/skills-manifest.json +8 -2
- package/src/banner.js +1 -1
- package/src/cli.js +15 -4
- package/src/install.js +45 -29
- package/src/install.test.js +75 -7
- package/src/picker.js +15 -4
- package/src/picker.test.js +36 -1
- package/src/scope.js +8 -39
- package/src/scope.test.js +9 -13
- package/src/tools.js +76 -0
- package/src/tools.test.js +80 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# Transformation Examples: Before & After
|
|
2
|
+
|
|
3
|
+
> **Safety Note:** This file contains intentionally insecure code examples for educational purposes only. Examples marked with ❌ demonstrate bad practices that should NOT be used in production. All passwords, API keys, and secrets shown are fictional examples used to teach security concepts.
|
|
4
|
+
|
|
5
|
+
## Example 1: Explaining Docker
|
|
6
|
+
|
|
7
|
+
### ❌ Before (Technical-first)
|
|
8
|
+
|
|
9
|
+
"Docker is a containerization platform that uses OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files, sharing the host OS kernel. This makes them more lightweight than traditional VMs."
|
|
10
|
+
|
|
11
|
+
**Problems:**
|
|
12
|
+
- Jargon overload (containerization, OS-level virtualization, kernel)
|
|
13
|
+
- No concrete reference point
|
|
14
|
+
- Abstract concepts without context
|
|
15
|
+
|
|
16
|
+
### ✅ After (Baby Education Style)
|
|
17
|
+
|
|
18
|
+
"Imagine shipping physical products:
|
|
19
|
+
|
|
20
|
+
**Without Docker (old way):**
|
|
21
|
+
You send a recipe to someone. They need to:
|
|
22
|
+
- Buy the exact ingredients you used
|
|
23
|
+
- Install the same cooking equipment
|
|
24
|
+
- Hope their kitchen setup matches yours
|
|
25
|
+
Result: 'It works on my machine' problem
|
|
26
|
+
|
|
27
|
+
**With Docker (new way):**
|
|
28
|
+
You send a fully-equipped food truck with:
|
|
29
|
+
- All ingredients already inside
|
|
30
|
+
- All cooking equipment installed
|
|
31
|
+
- Everything configured exactly as you set it up
|
|
32
|
+
Result: It works the same everywhere
|
|
33
|
+
|
|
34
|
+
That 'food truck' is a Docker container - a package with your code + everything it needs to run. The 'parking lot' where food trucks can operate is your computer (or server).
|
|
35
|
+
|
|
36
|
+
Technical terms:
|
|
37
|
+
- Container = food truck (isolated environment with everything inside)
|
|
38
|
+
- Image = blueprint for building the food truck
|
|
39
|
+
- Docker = the system that manages all the food trucks"
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Example 2: Explaining API Rate Limiting
|
|
44
|
+
|
|
45
|
+
### ❌ Before (Technical-first)
|
|
46
|
+
|
|
47
|
+
"Rate limiting is implemented to prevent API abuse and ensure fair usage. The server tracks requests per client using tokens or sliding window algorithms, returning 429 Too Many Requests when the threshold is exceeded."
|
|
48
|
+
|
|
49
|
+
**Problems:**
|
|
50
|
+
- No context for WHY it exists
|
|
51
|
+
- Technical implementation details before concept
|
|
52
|
+
- Assumes knowledge of HTTP status codes
|
|
53
|
+
|
|
54
|
+
### ✅ After (Baby Education Style)
|
|
55
|
+
|
|
56
|
+
"You know how buffets have rules like 'one plate at a time'?
|
|
57
|
+
|
|
58
|
+
API rate limiting is the same concept:
|
|
59
|
+
|
|
60
|
+
**The Problem Without Limits:**
|
|
61
|
+
Imagine if one person could take 1000 plates simultaneously at a buffet. Nobody else gets food. The kitchen can't keep up. The buffet shuts down.
|
|
62
|
+
|
|
63
|
+
**The Solution (Rate Limiting):**
|
|
64
|
+
'You can get 100 items per hour, max 10 items per minute'
|
|
65
|
+
|
|
66
|
+
In API terms:
|
|
67
|
+
- You (client) request data from the buffet (API server)
|
|
68
|
+
- The server says 'Sure, but only 1000 requests per hour'
|
|
69
|
+
- If you exceed this, server says 'Slow down' (error code 429)
|
|
70
|
+
|
|
71
|
+
Why this matters for your code:
|
|
72
|
+
```javascript
|
|
73
|
+
// Bad: Rapid-fire requests (will get blocked)
|
|
74
|
+
for (let i = 0; i < 10000; i++) {
|
|
75
|
+
fetch('/api/data');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Good: Respect the limits with delays
|
|
79
|
+
async function fetchWithDelay() {
|
|
80
|
+
for (let i = 0; i < 10000; i++) {
|
|
81
|
+
await fetch('/api/data');
|
|
82
|
+
await sleep(100); // Wait 100ms between requests
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Real-world analogy: It's like waiting in line at a coffee shop instead of screaming your order 50 times at the barista."
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Example 3: Debugging `undefined is not a function`
|
|
92
|
+
|
|
93
|
+
### ❌ Before (Technical-first)
|
|
94
|
+
|
|
95
|
+
"This error occurs when you attempt to invoke a method on an undefined reference. Common causes include typos in method names, calling methods on objects that don't support them, or scope issues with 'this' binding."
|
|
96
|
+
|
|
97
|
+
**Problems:**
|
|
98
|
+
- Doesn't help beginner locate the actual issue
|
|
99
|
+
- Technical jargon (invoke, reference, scope, binding)
|
|
100
|
+
- No actionable debugging steps
|
|
101
|
+
|
|
102
|
+
### ✅ After (Baby Education Style)
|
|
103
|
+
|
|
104
|
+
**Error:** `TypeError: undefined is not a function`
|
|
105
|
+
|
|
106
|
+
**Translation:**
|
|
107
|
+
Your code tried to call something as if it were a function, but it's actually `undefined` (doesn't exist).
|
|
108
|
+
|
|
109
|
+
**Analogy:**
|
|
110
|
+
It's like yelling "Hey Siri!" to a lamp. You're treating the lamp like it can respond, but it's not a smart device - it doesn't have that function.
|
|
111
|
+
|
|
112
|
+
**Common Causes:**
|
|
113
|
+
|
|
114
|
+
**1. Typo in function name**
|
|
115
|
+
```javascript
|
|
116
|
+
// You wrote:
|
|
117
|
+
myArray.pus(item); // ❌ typo: 'pus' doesn't exist
|
|
118
|
+
|
|
119
|
+
// Should be:
|
|
120
|
+
myArray.push(item); // ✅
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**2. Function doesn't exist yet**
|
|
124
|
+
```javascript
|
|
125
|
+
// Function is defined AFTER you call it:
|
|
126
|
+
greet(); // ❌ undefined at this point
|
|
127
|
+
function greet() { console.log("hi"); }
|
|
128
|
+
|
|
129
|
+
// Move definition before call:
|
|
130
|
+
function greet() { console.log("hi"); }
|
|
131
|
+
greet(); // ✅
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**3. Wrong object type**
|
|
135
|
+
```javascript
|
|
136
|
+
let num = 42;
|
|
137
|
+
num.toUpperCase(); // ❌ numbers don't have toUpperCase
|
|
138
|
+
// (that's a string method)
|
|
139
|
+
|
|
140
|
+
let text = "42";
|
|
141
|
+
text.toUpperCase(); // ✅ works for strings
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**How to Debug:**
|
|
145
|
+
1. Look at the line number in the error
|
|
146
|
+
2. Find what you're trying to call (ends with `()`)
|
|
147
|
+
3. Add `console.log()` before that line to check if it exists:
|
|
148
|
+
```javascript
|
|
149
|
+
console.log(typeof myFunction); // Should show "function"
|
|
150
|
+
myFunction(); // If it shows "undefined", that's your problem
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Prevention:**
|
|
154
|
+
Use your editor's autocomplete - if the function doesn't appear in autocomplete suggestions, it probably doesn't exist or has a typo."
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Example 4: Explaining `git merge` vs `git rebase`
|
|
159
|
+
|
|
160
|
+
### ❌ Before (Technical-first)
|
|
161
|
+
|
|
162
|
+
"Merge creates a merge commit that joins two branches, preserving history. Rebase rewrites commit history by replaying commits from one branch onto another, resulting in a linear history but altering commit SHAs."
|
|
163
|
+
|
|
164
|
+
**Problems:**
|
|
165
|
+
- Assumes understanding of "commit history" and "SHAs"
|
|
166
|
+
- Doesn't explain when to use each
|
|
167
|
+
- No visual component
|
|
168
|
+
|
|
169
|
+
### ✅ After (Baby Education Style)
|
|
170
|
+
|
|
171
|
+
**The Scenario:**
|
|
172
|
+
You and your friend are both editing the same story.
|
|
173
|
+
|
|
174
|
+
**git merge (keep both story paths):**
|
|
175
|
+
```
|
|
176
|
+
Your version: Friend's version:
|
|
177
|
+
Chapter 1 Chapter 1
|
|
178
|
+
Chapter 2 Chapter 2 (different)
|
|
179
|
+
Chapter 3 Chapter 3
|
|
180
|
+
|
|
181
|
+
After merge:
|
|
182
|
+
Chapter 1
|
|
183
|
+
Chapter 2 (yours)
|
|
184
|
+
Chapter 2 (friend's) ← merge point noted
|
|
185
|
+
Chapter 3
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Like taking both versions and saying "here's where we combined our work."
|
|
189
|
+
|
|
190
|
+
**git rebase (make one continuous story):**
|
|
191
|
+
```
|
|
192
|
+
Rewrite history so it looks like your friend went first:
|
|
193
|
+
Chapter 1
|
|
194
|
+
Chapter 2 (friend's)
|
|
195
|
+
Chapter 2 (yours, but rewritten as if friend's didn't exist when you wrote it)
|
|
196
|
+
Chapter 3
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Like editing your chapters to fit perfectly after your friend's, as if you wrote them sequentially.
|
|
200
|
+
|
|
201
|
+
**When to use:**
|
|
202
|
+
|
|
203
|
+
Use **merge** when:
|
|
204
|
+
- Working on shared/public branches
|
|
205
|
+
- You want to preserve exact history of who did what when
|
|
206
|
+
- Multiple people touching the same code
|
|
207
|
+
|
|
208
|
+
Use **rebase** when:
|
|
209
|
+
- Cleaning up your own local branch before sharing
|
|
210
|
+
- You want a clean, linear story
|
|
211
|
+
- You haven't pushed the branch yet
|
|
212
|
+
|
|
213
|
+
**Golden Rule:**
|
|
214
|
+
Never rebase public branches (it's like editing published chapters - confuses everyone who already read them)
|
|
215
|
+
|
|
216
|
+
**Commands:**
|
|
217
|
+
```bash
|
|
218
|
+
# Merge (safe for public branches)
|
|
219
|
+
git checkout main
|
|
220
|
+
git merge feature-branch
|
|
221
|
+
|
|
222
|
+
# Rebase (only for your local unpublished work)
|
|
223
|
+
git checkout feature-branch
|
|
224
|
+
git rebase main
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Example 5: Understanding Environment Variables
|
|
230
|
+
|
|
231
|
+
### ❌ Before (Technical-first)
|
|
232
|
+
|
|
233
|
+
"Environment variables are dynamic-named values stored in the operating system that affect running processes. They provide configuration data to applications without hardcoding values in source code."
|
|
234
|
+
|
|
235
|
+
**Problems:**
|
|
236
|
+
- Abstract definition
|
|
237
|
+
- Doesn't explain the security/practical benefit
|
|
238
|
+
- No clear "why" or "when"
|
|
239
|
+
|
|
240
|
+
### ✅ After (Baby Education Style)
|
|
241
|
+
|
|
242
|
+
**Analogy:**
|
|
243
|
+
Environment variables are like sticky notes you put on your computer that your code can read.
|
|
244
|
+
|
|
245
|
+
**Why This Matters:**
|
|
246
|
+
|
|
247
|
+
Imagine you write code like this:
|
|
248
|
+
```javascript
|
|
249
|
+
const password = "mySecretPassword123"; // ❌ BAD IDEA
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Problems:**
|
|
253
|
+
1. Anyone who sees your code sees your password
|
|
254
|
+
2. If you share code on GitHub, password is public
|
|
255
|
+
3. Different computers (dev, production) need different passwords
|
|
256
|
+
|
|
257
|
+
**Solution: Environment Variables**
|
|
258
|
+
|
|
259
|
+
Instead, create a secret sticky note (`.env` file):
|
|
260
|
+
```
|
|
261
|
+
DATABASE_PASSWORD=mySecretPassword123
|
|
262
|
+
API_KEY=abc123xyz
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Your code reads the sticky note:
|
|
266
|
+
```javascript
|
|
267
|
+
const password = process.env.DATABASE_PASSWORD; // ✅ Safe
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Benefits:**
|
|
271
|
+
1. ✅ Code doesn't contain secrets
|
|
272
|
+
2. ✅ Each computer can have different sticky notes
|
|
273
|
+
3. ✅ You can share code without sharing passwords
|
|
274
|
+
|
|
275
|
+
**Real-World Flow:**
|
|
276
|
+
|
|
277
|
+
On your computer:
|
|
278
|
+
- Create `.env` file with your dev database password
|
|
279
|
+
- Add `.env` to `.gitignore` (so it never uploads to GitHub)
|
|
280
|
+
- Code reads from `.env`
|
|
281
|
+
|
|
282
|
+
On production server:
|
|
283
|
+
- Different `.env` file with production database password
|
|
284
|
+
- Same code, different config - works everywhere
|
|
285
|
+
|
|
286
|
+
**Common Mistake:**
|
|
287
|
+
```javascript
|
|
288
|
+
// ❌ Accidentally committing secrets
|
|
289
|
+
git add .env // DON'T DO THIS
|
|
290
|
+
|
|
291
|
+
// ✅ Ignore secrets file
|
|
292
|
+
echo ".env" >> .gitignore
|
|
293
|
+
git add .gitignore
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Think of it like this: Your code is a recipe that says "add the secret sauce." The `.env` file is where you write down what that secret sauce is - and everyone can have their own recipe for it."
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Common Mistake Patterns & Corrections
|
|
301
|
+
|
|
302
|
+
### Mistake 1: Using Passive Voice
|
|
303
|
+
|
|
304
|
+
❌ "The function should be called after initialization"
|
|
305
|
+
✅ "Call the function after you initialize"
|
|
306
|
+
|
|
307
|
+
### Mistake 2: Unexplained Acronyms
|
|
308
|
+
|
|
309
|
+
❌ "Configure the CORS policy"
|
|
310
|
+
✅ "Configure CORS (Cross-Origin Resource Sharing) - the security rule that controls which websites can access your API"
|
|
311
|
+
|
|
312
|
+
### Mistake 3: Assuming Knowledge
|
|
313
|
+
|
|
314
|
+
❌ "Just use a reducer"
|
|
315
|
+
✅ "Use a reducer - a function that takes current state and an action, then returns new state. Think of it like a calculator: you input current number + operation, it outputs the result."
|
|
316
|
+
|
|
317
|
+
### Mistake 4: No Context for "Why"
|
|
318
|
+
|
|
319
|
+
❌ "Always use strict mode"
|
|
320
|
+
✅ "Use strict mode - it's like spell-check for JavaScript. It catches common mistakes like using variables before declaring them."
|
|
321
|
+
|
|
322
|
+
### Mistake 5: Multiple Concepts at Once
|
|
323
|
+
|
|
324
|
+
❌ "This async function returns a promise that resolves with the fetched data after the API call completes"
|
|
325
|
+
|
|
326
|
+
✅ (Break into steps)
|
|
327
|
+
"This function talks to an API.
|
|
328
|
+
Since talking to APIs takes time (like sending a letter), it's 'async' - it doesn't block your code while waiting.
|
|
329
|
+
It returns a Promise - think of it as a 'I'll get back to you' note.
|
|
330
|
+
When the API finally responds, the Promise 'resolves' with the data."
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Quick Transformation Checklist
|
|
335
|
+
|
|
336
|
+
When converting technical explanations:
|
|
337
|
+
|
|
338
|
+
1. ✅ Start with "Imagine..." or "You know how..."
|
|
339
|
+
2. ✅ Use everyday analogies before technical terms
|
|
340
|
+
3. ✅ Show concrete examples with comments
|
|
341
|
+
4. ✅ Explain the "why" before the "how"
|
|
342
|
+
5. ✅ Use "you" and "we" instead of "one must"
|
|
343
|
+
6. ✅ Break complex sentences into simple steps
|
|
344
|
+
7. ✅ Add context for jargon you can't avoid
|
|
345
|
+
8. ✅ Celebrate small wins ("See? Not so scary!")
|