mega-brain-ai 1.3.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/.antigravity/README.md +46 -0
- package/.antigravity/rules/.gitkeep +0 -0
- package/.antigravity/rules/mega-brain.md +39 -0
- package/.claude/CLAUDE.md +172 -0
- package/.claude/agents.yaml +44 -0
- package/.claude/commands/agents.md +161 -0
- package/.claude/commands/ask.md +117 -0
- package/.claude/commands/benchmark.md +224 -0
- package/.claude/commands/chat.md +343 -0
- package/.claude/commands/compare.md +116 -0
- package/.claude/commands/conclave.md +196 -0
- package/.claude/commands/config.md +133 -0
- package/.claude/commands/create-agent.md +467 -0
- package/.claude/commands/debate.md +159 -0
- package/.claude/commands/documentation/create-architecture-documentation.md +175 -0
- package/.claude/commands/dossiers.md +180 -0
- package/.claude/commands/evolve.md +223 -0
- package/.claude/commands/extract-dna.md +172 -0
- package/.claude/commands/extract-knowledge.md +507 -0
- package/.claude/commands/gsd/add-phase.md +43 -0
- package/.claude/commands/gsd/add-tests.md +41 -0
- package/.claude/commands/gsd/add-todo.md +47 -0
- package/.claude/commands/gsd/audit-milestone.md +36 -0
- package/.claude/commands/gsd/check-todos.md +45 -0
- package/.claude/commands/gsd/cleanup.md +18 -0
- package/.claude/commands/gsd/complete-milestone.md +136 -0
- package/.claude/commands/gsd/debug.md +167 -0
- package/.claude/commands/gsd/discuss-phase.md +83 -0
- package/.claude/commands/gsd/execute-phase.md +41 -0
- package/.claude/commands/gsd/health.md +22 -0
- package/.claude/commands/gsd/help.md +22 -0
- package/.claude/commands/gsd/insert-phase.md +32 -0
- package/.claude/commands/gsd/join-discord.md +18 -0
- package/.claude/commands/gsd/list-phase-assumptions.md +46 -0
- package/.claude/commands/gsd/map-codebase.md +71 -0
- package/.claude/commands/gsd/new-milestone.md +44 -0
- package/.claude/commands/gsd/new-project.md +42 -0
- package/.claude/commands/gsd/pause-work.md +38 -0
- package/.claude/commands/gsd/plan-milestone-gaps.md +34 -0
- package/.claude/commands/gsd/plan-phase.md +45 -0
- package/.claude/commands/gsd/progress.md +24 -0
- package/.claude/commands/gsd/quick.md +41 -0
- package/.claude/commands/gsd/reapply-patches.md +110 -0
- package/.claude/commands/gsd/remove-phase.md +31 -0
- package/.claude/commands/gsd/research-phase.md +189 -0
- package/.claude/commands/gsd/resume-work.md +40 -0
- package/.claude/commands/gsd/set-profile.md +34 -0
- package/.claude/commands/gsd/settings.md +36 -0
- package/.claude/commands/gsd/update.md +37 -0
- package/.claude/commands/gsd/verify-work.md +38 -0
- package/.claude/commands/inbox.md +296 -0
- package/.claude/commands/ingest-empresa.md +191 -0
- package/.claude/commands/ingest.md +183 -0
- package/.claude/commands/jarvis-briefing.md +67 -0
- package/.claude/commands/jarvis-control.md +169 -0
- package/.claude/commands/jarvis-full.md +182 -0
- package/.claude/commands/jarvis.md +212 -0
- package/.claude/commands/ler-drive.md +212 -0
- package/.claude/commands/log.md +158 -0
- package/.claude/commands/loop.md +133 -0
- package/.claude/commands/loops.md +73 -0
- package/.claude/commands/mission-autopilot.md +538 -0
- package/.claude/commands/mission.md +353 -0
- package/.claude/commands/process-inbox.md +148 -0
- package/.claude/commands/process-jarvis.md +3036 -0
- package/.claude/commands/process-video.md +131 -0
- package/.claude/commands/rag-search.md +78 -0
- package/.claude/commands/resume.md +33 -0
- package/.claude/commands/save.md +38 -0
- package/.claude/commands/scan-inbox.md +125 -0
- package/.claude/commands/setup.md +99 -0
- package/.claude/commands/system-digest.md +243 -0
- package/.claude/commands/verify.md +182 -0
- package/.claude/commands/view-dna.md +169 -0
- package/.claude/get-shit-done/VERSION +1 -0
- package/.claude/get-shit-done/bin/gsd-tools.cjs +588 -0
- package/.claude/get-shit-done/bin/lib/commands.cjs +553 -0
- package/.claude/get-shit-done/bin/lib/config.cjs +162 -0
- package/.claude/get-shit-done/bin/lib/core.cjs +411 -0
- package/.claude/get-shit-done/bin/lib/frontmatter.cjs +299 -0
- package/.claude/get-shit-done/bin/lib/init.cjs +710 -0
- package/.claude/get-shit-done/bin/lib/milestone.cjs +216 -0
- package/.claude/get-shit-done/bin/lib/phase.cjs +871 -0
- package/.claude/get-shit-done/bin/lib/roadmap.cjs +298 -0
- package/.claude/get-shit-done/bin/lib/state.cjs +679 -0
- package/.claude/get-shit-done/bin/lib/template.cjs +222 -0
- package/.claude/get-shit-done/bin/lib/verify.cjs +773 -0
- package/.claude/get-shit-done/references/checkpoints.md +776 -0
- package/.claude/get-shit-done/references/continuation-format.md +249 -0
- package/.claude/get-shit-done/references/decimal-phase-calculation.md +65 -0
- package/.claude/get-shit-done/references/git-integration.md +248 -0
- package/.claude/get-shit-done/references/git-planning-commit.md +38 -0
- package/.claude/get-shit-done/references/model-profile-resolution.md +34 -0
- package/.claude/get-shit-done/references/model-profiles.md +92 -0
- package/.claude/get-shit-done/references/phase-argument-parsing.md +61 -0
- package/.claude/get-shit-done/references/planning-config.md +196 -0
- package/.claude/get-shit-done/references/questioning.md +145 -0
- package/.claude/get-shit-done/references/tdd.md +263 -0
- package/.claude/get-shit-done/references/ui-brand.md +160 -0
- package/.claude/get-shit-done/references/verification-patterns.md +612 -0
- package/.claude/get-shit-done/templates/DEBUG.md +164 -0
- package/.claude/get-shit-done/templates/UAT.md +247 -0
- package/.claude/get-shit-done/templates/VALIDATION.md +76 -0
- package/.claude/get-shit-done/templates/codebase/architecture.md +255 -0
- package/.claude/get-shit-done/templates/codebase/concerns.md +310 -0
- package/.claude/get-shit-done/templates/codebase/conventions.md +307 -0
- package/.claude/get-shit-done/templates/codebase/integrations.md +280 -0
- package/.claude/get-shit-done/templates/codebase/stack.md +186 -0
- package/.claude/get-shit-done/templates/codebase/structure.md +285 -0
- package/.claude/get-shit-done/templates/codebase/testing.md +480 -0
- package/.claude/get-shit-done/templates/config.json +37 -0
- package/.claude/get-shit-done/templates/context.md +283 -0
- package/.claude/get-shit-done/templates/continue-here.md +78 -0
- package/.claude/get-shit-done/templates/debug-subagent-prompt.md +91 -0
- package/.claude/get-shit-done/templates/discovery.md +146 -0
- package/.claude/get-shit-done/templates/milestone-archive.md +123 -0
- package/.claude/get-shit-done/templates/milestone.md +115 -0
- package/.claude/get-shit-done/templates/phase-prompt.md +569 -0
- package/.claude/get-shit-done/templates/planner-subagent-prompt.md +117 -0
- package/.claude/get-shit-done/templates/project.md +184 -0
- package/.claude/get-shit-done/templates/requirements.md +231 -0
- package/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
- package/.claude/get-shit-done/templates/research-project/FEATURES.md +147 -0
- package/.claude/get-shit-done/templates/research-project/PITFALLS.md +200 -0
- package/.claude/get-shit-done/templates/research-project/STACK.md +120 -0
- package/.claude/get-shit-done/templates/research-project/SUMMARY.md +170 -0
- package/.claude/get-shit-done/templates/research.md +552 -0
- package/.claude/get-shit-done/templates/retrospective.md +54 -0
- package/.claude/get-shit-done/templates/roadmap.md +202 -0
- package/.claude/get-shit-done/templates/state.md +176 -0
- package/.claude/get-shit-done/templates/summary-complex.md +59 -0
- package/.claude/get-shit-done/templates/summary-minimal.md +41 -0
- package/.claude/get-shit-done/templates/summary-standard.md +48 -0
- package/.claude/get-shit-done/templates/summary.md +248 -0
- package/.claude/get-shit-done/templates/user-setup.md +311 -0
- package/.claude/get-shit-done/templates/verification-report.md +322 -0
- package/.claude/get-shit-done/workflows/add-phase.md +111 -0
- package/.claude/get-shit-done/workflows/add-tests.md +350 -0
- package/.claude/get-shit-done/workflows/add-todo.md +157 -0
- package/.claude/get-shit-done/workflows/audit-milestone.md +297 -0
- package/.claude/get-shit-done/workflows/check-todos.md +176 -0
- package/.claude/get-shit-done/workflows/cleanup.md +152 -0
- package/.claude/get-shit-done/workflows/complete-milestone.md +763 -0
- package/.claude/get-shit-done/workflows/diagnose-issues.md +219 -0
- package/.claude/get-shit-done/workflows/discovery-phase.md +289 -0
- package/.claude/get-shit-done/workflows/discuss-phase.md +542 -0
- package/.claude/get-shit-done/workflows/execute-phase.md +449 -0
- package/.claude/get-shit-done/workflows/execute-plan.md +448 -0
- package/.claude/get-shit-done/workflows/health.md +156 -0
- package/.claude/get-shit-done/workflows/help.md +489 -0
- package/.claude/get-shit-done/workflows/insert-phase.md +129 -0
- package/.claude/get-shit-done/workflows/list-phase-assumptions.md +178 -0
- package/.claude/get-shit-done/workflows/map-codebase.md +315 -0
- package/.claude/get-shit-done/workflows/new-milestone.md +382 -0
- package/.claude/get-shit-done/workflows/new-project.md +1116 -0
- package/.claude/get-shit-done/workflows/pause-work.md +122 -0
- package/.claude/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
- package/.claude/get-shit-done/workflows/plan-phase.md +569 -0
- package/.claude/get-shit-done/workflows/progress.md +381 -0
- package/.claude/get-shit-done/workflows/quick.md +453 -0
- package/.claude/get-shit-done/workflows/remove-phase.md +154 -0
- package/.claude/get-shit-done/workflows/research-phase.md +73 -0
- package/.claude/get-shit-done/workflows/resume-project.md +306 -0
- package/.claude/get-shit-done/workflows/set-profile.md +80 -0
- package/.claude/get-shit-done/workflows/settings.md +213 -0
- package/.claude/get-shit-done/workflows/transition.md +544 -0
- package/.claude/get-shit-done/workflows/update.md +219 -0
- package/.claude/get-shit-done/workflows/verify-phase.md +242 -0
- package/.claude/get-shit-done/workflows/verify-work.md +569 -0
- package/.claude/gsd-file-manifest.json +144 -0
- package/.claude/hooks/agent_creation_trigger.py +168 -0
- package/.claude/hooks/agent_index_updater.py +255 -0
- package/.claude/hooks/agent_memory_persister.py +203 -0
- package/.claude/hooks/claude_md_agent_sync.py +162 -0
- package/.claude/hooks/claude_md_guard.py +154 -0
- package/.claude/hooks/continuous_save.py +414 -0
- package/.claude/hooks/creation_validator.py +360 -0
- package/.claude/hooks/enforce_dual_location.py +501 -0
- package/.claude/hooks/enforce_plan_mode.py +220 -0
- package/.claude/hooks/gsd-check-update.js +62 -0
- package/.claude/hooks/gsd-context-monitor.js +122 -0
- package/.claude/hooks/gsd-statusline.js +108 -0
- package/.claude/hooks/inbox_age_alert.py +367 -0
- package/.claude/hooks/ledger_updater.py +303 -0
- package/.claude/hooks/memory_hints_injector.py +251 -0
- package/.claude/hooks/memory_updater.py +202 -0
- package/.claude/hooks/notification_system.py +115 -0
- package/.claude/hooks/pending_tracker.py +188 -0
- package/.claude/hooks/pipeline_checkpoint.py +583 -0
- package/.claude/hooks/post_batch_cascading.py +1740 -0
- package/.claude/hooks/post_tool_use.py +120 -0
- package/.claude/hooks/quality_watchdog.py +394 -0
- package/.claude/hooks/ralph_wiggum.py +286 -0
- package/.claude/hooks/session-source-sync.py +223 -0
- package/.claude/hooks/session_autosave_v2.py +1135 -0
- package/.claude/hooks/session_end.py +203 -0
- package/.claude/hooks/session_start.py +939 -0
- package/.claude/hooks/skill_indexer.py +48 -0
- package/.claude/hooks/skill_router.py +358 -0
- package/.claude/hooks/stop_hook_completeness.py +187 -0
- package/.claude/hooks/user_prompt_submit.py +125 -0
- package/.claude/package.json +1 -0
- package/.claude/rules/ANTHROPIC-STANDARDS.md +384 -0
- package/.claude/rules/CLAUDE-LITE.md +201 -0
- package/.claude/rules/RULE-GROUP-1.md +320 -0
- package/.claude/rules/RULE-GROUP-2.md +307 -0
- package/.claude/rules/RULE-GROUP-3.md +248 -0
- package/.claude/rules/RULE-GROUP-4.md +427 -0
- package/.claude/rules/RULE-GROUP-5.md +388 -0
- package/.claude/rules/RULE-GROUP-6.md +387 -0
- package/.claude/rules/RULE-GSD-MANDATORY.md +106 -0
- package/.claude/rules/agent-cognition.md +779 -0
- package/.claude/rules/agent-integrity.md +692 -0
- package/.claude/rules/epistemic-standards.md +333 -0
- package/.claude/rules/logging.md +53 -0
- package/.claude/rules/mcp-governance.md +128 -0
- package/.claude/rules/pipeline.md +60 -0
- package/.claude/rules/state-management.md +93 -0
- package/.claude/scripts/apply-tags.py +77 -0
- package/.claude/scripts/batch-extract-transcriptions.py +132 -0
- package/.claude/scripts/build-complete-index.py +250 -0
- package/.claude/scripts/build-planilha-index.py +170 -0
- package/.claude/scripts/complete-tag-matching.py +250 -0
- package/.claude/scripts/deduplicate-inbox.py +139 -0
- package/.claude/scripts/docx-xml-extractor.py +141 -0
- package/.claude/scripts/extract-docx-text.py +58 -0
- package/.claude/scripts/extract-single-transcription.py +74 -0
- package/.claude/scripts/extract_docx_from_gdrive.py +77 -0
- package/.claude/scripts/jarvis_orchestrator.py +5 -0
- package/.claude/scripts/organized-downloader.py +246 -0
- package/.claude/scripts/planilha-tagger.py +187 -0
- package/.claude/scripts/revert-tags.py +70 -0
- package/.claude/scripts/source-sync.py +265 -0
- package/.claude/scripts/tag-inbox-files.py +276 -0
- package/.claude/scripts/tag-inbox-v2.py +253 -0
- package/.claude/scripts/test-extraction.py +35 -0
- package/.claude/scripts/test-full-extraction.py +74 -0
- package/.claude/scripts/validate_cascading_integrity.py +409 -0
- package/.claude/settings.json +215 -0
- package/.claude/skills/DETECTION-PROTOCOL.md +217 -0
- package/.claude/skills/README.md +240 -0
- package/.claude/skills/SKILL-REGISTRY.md +283 -0
- package/.claude/skills/SKILL-SUGGESTIONS.md +114 -0
- package/.claude/skills/_TEMPLATES/SKILL-WRITER-GUIDE.md +385 -0
- package/.claude/skills/agent-creation/SKILL.md +374 -0
- package/.claude/skills/ask-company/SKILL.md +198 -0
- package/.claude/skills/brainstorming/SKILL.md +72 -0
- package/.claude/skills/chronicler/SKILL.md +146 -0
- package/.claude/skills/chronicler/chronicler_core.py +468 -0
- package/.claude/skills/code-review/SKILL.md +160 -0
- package/.claude/skills/convert-to-company-docs/SKILL.md +68 -0
- package/.claude/skills/convert-to-company-docs/convert.py +532 -0
- package/.claude/skills/dispatching-parallel-agents/SKILL.md +193 -0
- package/.claude/skills/docs-megabrain/SKILL.md +251 -0
- package/.claude/skills/executing-plans/SKILL.md +114 -0
- package/.claude/skills/executor/SKILL.md +161 -0
- package/.claude/skills/fase-2-5-tagging/SKILL.md +182 -0
- package/.claude/skills/feature-dev/SKILL.md +154 -0
- package/.claude/skills/frontend-design/SKILL.md +165 -0
- package/.claude/skills/gdrive-transcription-downloader/SKILL.md +249 -0
- package/.claude/skills/gemini-fallback/SKILL.md +67 -0
- package/.claude/skills/gemini-fallback/gemini_fetch.py +0 -0
- package/.claude/skills/gha/SKILL.md +96 -0
- package/.claude/skills/gha/gha_diagnostic.py +227 -0
- package/.claude/skills/github-workflow/SKILL.md +190 -0
- package/.claude/skills/hookify/SKILL.md +134 -0
- package/.claude/skills/hybrid-source-reading/SKILL.md +265 -0
- package/.claude/skills/jarvis/SKILL.md +546 -0
- package/.claude/skills/jarvis-briefing/SKILL.md +340 -0
- package/.claude/skills/knowledge-extraction/SKILL.md +318 -0
- package/.claude/skills/ler-planilha/SKILL.md +281 -0
- package/.claude/skills/pipeline-jarvis/SKILL.md +430 -0
- package/.claude/skills/plugin-dev/SKILL.md +176 -0
- package/.claude/skills/pr-review-toolkit/SKILL.md +178 -0
- package/.claude/skills/process-company-inbox/SKILL.md +183 -0
- package/.claude/skills/python-megabrain/SKILL.md +323 -0
- package/.claude/skills/resume/SKILL.md +61 -0
- package/.claude/skills/save/SKILL.md +87 -0
- package/.claude/skills/skill-creator-internal/SKILL.md +186 -0
- package/.claude/skills/skill-writer/SKILL.md +153 -0
- package/.claude/skills/skill-writer/examples.md +191 -0
- package/.claude/skills/skill-writer/troubleshooting.md +205 -0
- package/.claude/skills/smart-download-tagger/SKILL.md +148 -0
- package/.claude/skills/source-sync/SKILL.md +240 -0
- package/.claude/skills/sync-docs/SKILL.md +193 -0
- package/.claude/skills/sync-docs/config.json +37 -0
- package/.claude/skills/sync-docs/gdrive_sync.py +358 -0
- package/.claude/skills/sync-docs/reauth.py +71 -0
- package/.claude/skills/using-superpowers/SKILL.md +105 -0
- package/.claude/skills/verification-before-completion/SKILL.md +130 -0
- package/.claude/skills/verify/SKILL.md +154 -0
- package/.claude/skills/verify/verify_runner.py +0 -0
- package/.claude/skills/verify-6-levels/SKILL.md +234 -0
- package/.claude/skills/writing-plans/SKILL.md +184 -0
- package/.claude/templates/BATCH-LOG-TEMPLATE.md +221 -0
- package/.claudeignore +9 -0
- package/.cursor/agents.yaml +44 -0
- package/.cursor/rules/mega-brain.md +39 -0
- package/.gitattributes +19 -0
- package/.github/CODEOWNERS +8 -0
- package/.github/ISSUE_TEMPLATE/agent.md +96 -0
- package/.github/ISSUE_TEMPLATE/bug.md +67 -0
- package/.github/ISSUE_TEMPLATE/feature.md +56 -0
- package/.github/ISSUE_TEMPLATE/pipeline.md +70 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +30 -0
- package/.github/assets/banner.svg +152 -0
- package/.github/assets/logo-dark.svg +79 -0
- package/.github/assets/social-preview.png +0 -0
- package/.github/layer1-allowlist.txt +196 -0
- package/.github/layer2-manifest.txt +42 -0
- package/.github/layer3-manifest.txt +94 -0
- package/.github/workflows/claude-code-pr.yml +198 -0
- package/.github/workflows/claude-code-review.yml +57 -0
- package/.github/workflows/claude.yml +76 -0
- package/.github/workflows/publish-pro.yml +72 -0
- package/.github/workflows/publish.yml +86 -0
- package/.github/workflows/verification.yml +251 -0
- package/.gitignore +244 -0
- package/.gitleaks.toml +118 -0
- package/.windsurf/agents.yaml +44 -0
- package/.windsurf/rules/mega-brain.md +39 -0
- package/CONTRIBUTING.md +62 -0
- package/QUICK-START.md +231 -0
- package/README.md +168 -0
- package/agents/AGENT-INDEX.yaml +107 -0
- package/agents/MASTER-AGENT.md +612 -0
- package/agents/README.md +48 -0
- package/agents/_templates/INDEX.md +741 -0
- package/agents/_templates/TEMPLATE-AGENT-MD-ULTRA-ROBUSTO-V3.md +2399 -0
- package/agents/boardroom/CHECKLIST-MASTER.md +281 -0
- package/agents/boardroom/INTEGRATION-GUIDE.md +406 -0
- package/agents/boardroom/README.md +238 -0
- package/agents/boardroom/config/BOARDROOM-CONFIG.md +186 -0
- package/agents/boardroom/config/TTS-INTEGRATION.md +258 -0
- package/agents/boardroom/config/VOICE-PROFILES.md +624 -0
- package/agents/boardroom/scripts/audio_generator.py +375 -0
- package/agents/boardroom/scripts/audio_generator_edge.py +353 -0
- package/agents/boardroom/scripts/jarvis_boardroom_hook.py +415 -0
- package/agents/boardroom/scripts/notebooklm_generator.py +578 -0
- package/agents/boardroom/templates/EPISODE-TEMPLATE.md +367 -0
- package/agents/boardroom/templates/scene-templates/SCENE-AGENT-DEBATE.md +252 -0
- package/agents/boardroom/templates/scene-templates/SCENE-COUNCIL.md +270 -0
- package/agents/boardroom/templates/scene-templates/SCENE-DNA-CONSULTATION.md +126 -0
- package/agents/boardroom/templates/scene-templates/SCENE-QUESTION.md +174 -0
- package/agents/boardroom/workflows/WORKFLOW-AUDIO-GENERATION.md +421 -0
- package/agents/conclave/CRITIC.md +197 -0
- package/agents/conclave/DEVILS-ADVOCATE.md +274 -0
- package/agents/conclave/README.md +35 -0
- package/agents/conclave/SYNTHESIZER.md +293 -0
- package/agents/conclave/advogado-do-diabo/AGENT.md +502 -0
- package/agents/conclave/advogado-do-diabo/SOUL.md +100 -0
- package/agents/conclave/critico-metodologico/AGENT.md +683 -0
- package/agents/conclave/critico-metodologico/SOUL.md +107 -0
- package/agents/conclave/sintetizador/AGENT.md +571 -0
- package/agents/conclave/sintetizador/SOUL.md +94 -0
- package/agents/constitution/BASE-CONSTITUTION.md +254 -0
- package/agents/persona-registry.yaml +300 -0
- package/agents/sua-empresa/.gitkeep +0 -0
- package/agents/sua-empresa/README.md +44 -0
- package/agents/sua-empresa/_example/jds/EXAMPLE-JD.md +42 -0
- package/agents/sua-empresa/_example/org/EXAMPLE-ORG.md +32 -0
- package/agents/sua-empresa/_example/roles/EXAMPLE-ROLE.md +38 -0
- package/artifacts/README.md +11 -0
- package/artifacts/canonical/.gitkeep +0 -0
- package/artifacts/chunks/.gitkeep +0 -0
- package/artifacts/insights/.gitkeep +0 -0
- package/artifacts/narratives/.gitkeep +0 -0
- package/bin/cli.js +2 -0
- package/bin/lib/ascii-art.js +202 -0
- package/bin/lib/feature-gate.js +46 -0
- package/bin/lib/installer.js +593 -0
- package/bin/lib/license.js +59 -0
- package/bin/lib/pro-commands.js +75 -0
- package/bin/lib/setup-wizard.js +547 -0
- package/bin/lib/validate-email.js +113 -0
- package/bin/mega-brain.js +136 -0
- package/bin/pre-publish-gate.js +229 -0
- package/bin/push.js +1056 -0
- package/bin/templates/env.example +27 -0
- package/bin/utils/pro-detector.js +50 -0
- package/bin/validate-package.js +190 -0
- package/core/__init__.py +2 -0
- package/core/glossary/INDEX.md +63 -0
- package/core/glossary/digital.md +243 -0
- package/core/glossary/finance.md +49 -0
- package/core/glossary/marketing.md +69 -0
- package/core/glossary/operations.md +50 -0
- package/core/glossary/sales.md +690 -0
- package/core/intelligence/__init__.py +41 -0
- package/core/intelligence/agent_trigger.py +468 -0
- package/core/intelligence/audit_layers.py +491 -0
- package/core/intelligence/autonomous_processor.py +796 -0
- package/core/intelligence/bootstrap_registry.py +550 -0
- package/core/intelligence/business_model_detector.py +476 -0
- package/core/intelligence/dossier_trigger.py +336 -0
- package/core/intelligence/entity_normalizer.py +565 -0
- package/core/intelligence/org_chain_detector.py +411 -0
- package/core/intelligence/review_dashboard.py +338 -0
- package/core/intelligence/role_detector.py +855 -0
- package/core/intelligence/session_autosave.py +46 -0
- package/core/intelligence/skill_generator.py +601 -0
- package/core/intelligence/sow_generator.py +711 -0
- package/core/intelligence/sync_package_files.py +504 -0
- package/core/intelligence/task_orchestrator.py +780 -0
- package/core/intelligence/theme_analyzer.py +562 -0
- package/core/intelligence/tool_discovery.py +432 -0
- package/core/intelligence/validate_json_integrity.py +106 -0
- package/core/intelligence/validate_layers.py +310 -0
- package/core/intelligence/verify_classifications.py +94 -0
- package/core/intelligence/viability_scorer.py +592 -0
- package/core/jarvis/02-JARVIS-SOUL.md +390 -0
- package/core/jarvis/03-JARVIS-DNA.yaml +312 -0
- package/core/jarvis/AGENT.md +191 -0
- package/core/jarvis/agent-creator/AGENT.md +199 -0
- package/core/jarvis/agent-creator/SOUL.md +82 -0
- package/core/jarvis/agent-creator/tasks/create-agent.md +133 -0
- package/core/jarvis/agent-creator/tasks/sync-agents.md +100 -0
- package/core/jarvis/agent-creator/workflows/wf-create-agent.yaml +110 -0
- package/core/jarvis/agent-creator/workflows/wf-pipeline-trigger.yaml +111 -0
- package/core/jarvis/autonomous/benchmark/AGENT.md +347 -0
- package/core/jarvis/autonomous/benchmark/SOUL.md +78 -0
- package/core/jarvis/autonomous/critic/AGENT.md +324 -0
- package/core/jarvis/autonomous/critic/SOUL.md +78 -0
- package/core/jarvis/autonomous/evolver/AGENT.md +294 -0
- package/core/jarvis/autonomous/evolver/SOUL.md +85 -0
- package/core/jarvis/autonomous/playbook-generator/AGENT.md +399 -0
- package/core/jarvis/autonomous/playbook-generator/SOUL.md +80 -0
- package/core/patterns/_ROLE_PATTERNS.yaml +547 -0
- package/core/patterns/quality_gates.yaml +259 -0
- package/core/patterns/trigger_config.yaml +193 -0
- package/core/schemas/SCHEMA-INDEX.md +94 -0
- package/core/schemas/canonical-map.schema.json +98 -0
- package/core/schemas/chunks-state.schema.json +131 -0
- package/core/schemas/decisions-registry.schema.json +120 -0
- package/core/schemas/file-registry.schema.json +69 -0
- package/core/schemas/insights-state.schema.json +111 -0
- package/core/schemas/narratives-state.schema.json +150 -0
- package/core/tasks/CHANGELOG.md +55 -0
- package/core/tasks/TASK-REGISTRY.md +113 -0
- package/core/tasks/_templates/task-tmpl.md +105 -0
- package/core/tasks/analyze-themes.md +84 -0
- package/core/tasks/detect-role.md +82 -0
- package/core/tasks/extract-dna.md +114 -0
- package/core/tasks/normalize-entities.md +82 -0
- package/core/tasks/process-batch.md +111 -0
- package/core/tasks/validate-cascade.md +105 -0
- package/core/templates/README.md +27 -0
- package/core/templates/agents/dna-config-template.yaml +181 -0
- package/core/templates/agents/enrichment-protocol.md +408 -0
- package/core/templates/agents/memory-template.md +567 -0
- package/core/templates/agents/reasoning-model.md +331 -0
- package/core/templates/agents/soul-template.md +416 -0
- package/core/templates/agents/template-evolution.md +544 -0
- package/core/templates/debates/CONCLAVE-LOG-TEMPLATE-v2.md +309 -0
- package/core/templates/debates/conclave-log-template.md +309 -0
- package/core/templates/debates/conclave-protocol.md +518 -0
- package/core/templates/debates/debate-dynamics-config.yaml +322 -0
- package/core/templates/debates/debate-dynamics.md +613 -0
- package/core/templates/debates/debate-protocol.md +323 -0
- package/core/templates/logs/LOG-TEMPLATES.md +1068 -0
- package/core/templates/logs/batch-visual-template.md +841 -0
- package/core/templates/logs/log-structure.md +65 -0
- package/core/templates/logs/visual-diff.md +159 -0
- package/core/templates/phases/dossier-compilation.md +790 -0
- package/core/templates/phases/narrative-metabolism.md +292 -0
- package/core/templates/phases/narrative-synthesis.md +278 -0
- package/core/templates/phases/phase4-checkpoint.md +146 -0
- package/core/templates/phases/prompt-1.1-chunking.md +154 -0
- package/core/templates/phases/prompt-1.2-entity-resolution.md +186 -0
- package/core/templates/phases/prompt-2.1-dna-tags.md +208 -0
- package/core/templates/phases/prompt-2.1-insight-extraction.md +191 -0
- package/core/templates/phases/prompt-3.1-narrative.md +331 -0
- package/core/templates/phases/sources-compilation.md +340 -0
- package/core/workflows/PIPELINE-JARVIS-DOCS.md +606 -0
- package/core/workflows/wf-conclave.yaml +139 -0
- package/core/workflows/wf-extract-dna.yaml +158 -0
- package/core/workflows/wf-ingest.yaml +88 -0
- package/core/workflows/wf-pipeline-full.yaml +138 -0
- package/docs/API-KEYS-GUIDE.md +372 -0
- package/docs/INTEGRATION-POINTS.md +501 -0
- package/docs/LAYERS.md +403 -0
- package/docs/PLAN-MODE-PROTOCOL.md +388 -0
- package/docs/RESTORE-AND-INDEX.md +203 -0
- package/docs/TAG-RESOLVER-IMPLEMENTATION.md +597 -0
- package/docs/conselho.md +337 -0
- package/docs/context7-readme.md +28 -0
- package/docs/jarvis-logging-protocol.md +380 -0
- package/docs/pipeline-completa-v4.md +1315 -0
- package/docs/prompts/meta_agente_mapeamento_processos.md +297 -0
- package/docs/quick-start.md +197 -0
- package/docs/readme-ralph-cascateamento.md +207 -0
- package/docs/template-master.md +727 -0
- package/docs/templates/phase5/IMPLEMENTATION-GUIDE.md +355 -0
- package/docs/templates/phase5/MOGA-BRAIN-PHASE5-TEMPLATES.md +1284 -0
- package/docs/templates/phase5/README.md +165 -0
- package/docs/workflow-continuous-claude.md +2232 -0
- package/inbox/.gitkeep +0 -0
- package/inbox/README.md +15 -0
- package/knowledge/NAVIGATION-MAP.json +292 -0
- package/knowledge/README.md +11 -0
- package/knowledge/dna/.gitkeep +0 -0
- package/knowledge/dossiers/persons/.gitkeep +0 -0
- package/knowledge/dossiers/system/.gitkeep +0 -0
- package/knowledge/dossiers/themes/.gitkeep +0 -0
- package/knowledge/playbooks/.gitkeep +0 -0
- package/knowledge/sources/.gitkeep +0 -0
- package/logs/.gitkeep +0 -0
- package/logs/README.md +11 -0
- package/package.json +180 -0
- package/requirements.txt +4 -0
|
@@ -0,0 +1,2232 @@
|
|
|
1
|
+
# Workflow Claude Code - Boris Cherny + Continuous Claude
|
|
2
|
+
|
|
3
|
+
# **Template Universal** - Aplicável a qualquer projeto de desenvolvimento
|
|
4
|
+
|
|
5
|
+
> Este documento combina o melhor do Método Boris Cherny (criador do Claude Code @ Anthropic) com as práticas do Continuous Claude v3, criando um workflow completo e produtivo.
|
|
6
|
+
>
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 🎯 Por Que Este Workflow?
|
|
11
|
+
|
|
12
|
+
## O Problema
|
|
13
|
+
|
|
14
|
+
O método Boris Cherny original é poderoso, mas foi criado para o contexto interno da Anthropic. Ao aplicá-lo em projetos reais, desenvolvedores enfrentam: **alto consumo de tokens** em sessões longas, **falta de análise de código estruturada**, **setup limitado ao macOS**, e **ausência de templates reutilizáveis**.
|
|
15
|
+
|
|
16
|
+
## A Solução
|
|
17
|
+
|
|
18
|
+
Este workflow evolui o método original com melhorias práticas testadas em produção:
|
|
19
|
+
|
|
20
|
+
**💰 Redução de Consumo de Tokens**
|
|
21
|
+
|
|
22
|
+
O sistema de Skills carrega conhecimento **sob demanda** via activation patterns. Em vez de manter todo o contexto o tempo todo, Claude ativa apenas o conhecimento necessário para cada tarefa. Resultado: sessões mais longas com menos tokens.
|
|
23
|
+
|
|
24
|
+
**🔍 Análise de Código Profunda**
|
|
25
|
+
|
|
26
|
+
Agentes especializados fazem **análise automática** de segurança, performance e qualidade antes de cada PR. Não é só lint e typecheck — é auditoria real com severidade classificada e recomendações acionáveis.
|
|
27
|
+
|
|
28
|
+
**⚡ 6 Níveis de Verificação vs 3**
|
|
29
|
+
|
|
30
|
+
Triplicamos os pontos de feedback: hooks automáticos, testes, build, verificação visual, staging e auditoria de segurança. Mais feedback = menos erros em produção.
|
|
31
|
+
|
|
32
|
+
**📦 Templates Prontos**
|
|
33
|
+
|
|
34
|
+
Comece a produzir em minutos com templates para componentes, hooks, API routes e estrutura de testes. Sem precisar reinventar padrões a cada projeto.
|
|
35
|
+
|
|
36
|
+
**🐧 Multiplataforma**
|
|
37
|
+
|
|
38
|
+
Setup funciona em macOS, Linux e WSL. Scripts de inicialização automatizados com tmux eliminam configuração manual.
|
|
39
|
+
|
|
40
|
+
**📖 Documentação de Troubleshooting**
|
|
41
|
+
|
|
42
|
+
Problemas comuns já estão mapeados com soluções testadas. Menos tempo debugando o workflow, mais tempo desenvolvendo.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
# ⚡ O Que Mudou: Boris Original vs Este Workflow
|
|
47
|
+
|
|
48
|
+
Antes de mergulhar no conteúdo, entenda as **principais evoluções** deste workflow em relação ao método Boris Cherny original:
|
|
49
|
+
|
|
50
|
+
## Comparativo Rápido
|
|
51
|
+
|
|
52
|
+
| Aspecto | Boris Original | Este Workflow (v2.0) |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| **Memória** | Apenas [CLAUDE.md](http://CLAUDE.md) | [CLAUDE.md](http://CLAUDE.md) + Skills modulares + Agents especializados |
|
|
55
|
+
| **Agentes** | Genéricos (verify-app, code-simplifier) | Expandidos com **security-audit** e **performance-checker** |
|
|
56
|
+
| **Conhecimento** | Regras no [CLAUDE.md](http://CLAUDE.md) | Sistema de **Skills** com activation patterns |
|
|
57
|
+
| **Setup** | iTerm2 com 5 abas | **tmux** com script automatizado + suporte Linux/WSL |
|
|
58
|
+
| **Verificação** | Build + Test + Lint | **6 níveis** incluindo E2E e verificação visual |
|
|
59
|
+
| **Templates** | Não inclusos | Templates completos para **componentes, hooks e API routes** |
|
|
60
|
+
| **Troubleshooting** | Não documentado | Seção completa com **problemas comuns e soluções** |
|
|
61
|
+
| **Universalidade** | Focado em stack específico | **Template genérico** adaptável a qualquer projeto |
|
|
62
|
+
|
|
63
|
+
## 🆕 Novidades Exclusivas
|
|
64
|
+
|
|
65
|
+
### 1. Sistema de Skills (do Continuous Claude)
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Skills ≠ Agentes
|
|
69
|
+
|
|
70
|
+
• Agentes = Tarefas específicas (executam ações)
|
|
71
|
+
• Skills = Pacotes de conhecimento (informam decisões)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Skills incluem **activation patterns** - Claude sabe quando ativar cada conhecimento automaticamente.
|
|
75
|
+
|
|
76
|
+
### 2. Agentes de Segurança e Performance
|
|
77
|
+
|
|
78
|
+
Além dos agentes originais, adicionamos:
|
|
79
|
+
|
|
80
|
+
- [**security-audit.md**](http://security-audit.md): Checklist de vulnerabilidades com níveis de severidade
|
|
81
|
+
- [**performance-checker.md**](http://performance-checker.md): Análise de re-renders, memoization, bundle impact
|
|
82
|
+
|
|
83
|
+
### 3. Setup Multiplataforma
|
|
84
|
+
|
|
85
|
+
- **tmux** como alternativa ao iTerm2 (funciona em Linux/WSL)
|
|
86
|
+
- Script `claude-workspace` para inicialização automática
|
|
87
|
+
- Configuração de notificações cross-platform
|
|
88
|
+
|
|
89
|
+
### 4. Templates Prontos para Uso
|
|
90
|
+
|
|
91
|
+
- Componente React com TypeScript
|
|
92
|
+
- Custom Hook pattern
|
|
93
|
+
- API Route (Next.js App Router)
|
|
94
|
+
- Estrutura de testes
|
|
95
|
+
|
|
96
|
+
### 5. Verificação em 6 Níveis
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
Nível 1: Automático (Hooks) → Formatação, Lint, TypeCheck
|
|
100
|
+
Nível 2: Testes → Unit, Integration, E2E
|
|
101
|
+
Nível 3: Build → Compilação, Bundle analysis
|
|
102
|
+
Nível 4: Visual → Chrome extension, Storybook
|
|
103
|
+
Nível 5: Produção → Staging, Smoke tests, Monitoring
|
|
104
|
+
Nível 6: Segurança → Audit automatizado
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 6. Troubleshooting Documentado
|
|
108
|
+
|
|
109
|
+
Seção completa com:
|
|
110
|
+
|
|
111
|
+
- Problemas comuns e suas soluções
|
|
112
|
+
- Comandos de debug
|
|
113
|
+
- Dicas de otimização de contexto
|
|
114
|
+
|
|
115
|
+
## 🔄 O Que Mantivemos (Core do Boris)
|
|
116
|
+
|
|
117
|
+
✅ [**CLAUDE.md**](http://CLAUDE.md) como memória institucional - continua sendo o coração do sistema
|
|
118
|
+
|
|
119
|
+
✅ **Plan Mode obrigatório** - nunca executar sem plano aprovado
|
|
120
|
+
|
|
121
|
+
✅ **Múltiplos Claudes paralelos** - 5+ instâncias simultâneas
|
|
122
|
+
|
|
123
|
+
✅ **Compounding Engineering** - cada erro vira regra permanente
|
|
124
|
+
|
|
125
|
+
✅ **Verificação como multiplicador** - 2-3x qualidade com feedback loop
|
|
126
|
+
|
|
127
|
+
✅ **Slash commands** - /commit-push-pr, /code-simplifier, etc.
|
|
128
|
+
|
|
129
|
+
✅ **Integração GitHub** - @claude em PRs para atualizar [CLAUDE.md](http://CLAUDE.md)
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
# 📋 Índice
|
|
134
|
+
|
|
135
|
+
1. Visão Geral e Filosofia
|
|
136
|
+
2. Setup Inicial do Ambiente
|
|
137
|
+
3. Estrutura de Diretórios
|
|
138
|
+
4. [CLAUDE.md](http://CLAUDE.md) - Template Universal
|
|
139
|
+
5. Pipeline de Desenvolvimento (Plan → Execute → Verify)
|
|
140
|
+
6. Sistema de Agentes Especializados
|
|
141
|
+
7. Slash Commands Essenciais
|
|
142
|
+
8. Hooks e Automações
|
|
143
|
+
9. Skills do Continuous Claude
|
|
144
|
+
10. Integração GitHub e CI/CD
|
|
145
|
+
11. MCP Servers e Extensões
|
|
146
|
+
12. Verificação de Qualidade
|
|
147
|
+
13. Templates de Arquivos
|
|
148
|
+
14. Checklist de Implementação
|
|
149
|
+
15. Troubleshooting
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
# 1. Visão Geral e Filosofia
|
|
154
|
+
|
|
155
|
+
## 1.1 Conceito Central
|
|
156
|
+
|
|
157
|
+
O workflow combina duas abordagens poderosas:
|
|
158
|
+
|
|
159
|
+
**Boris Cherny Method**
|
|
160
|
+
|
|
161
|
+
- Múltiplos Claudes trabalhando em paralelo
|
|
162
|
+
- [CLAUDE.md](http://CLAUDE.md) como memória institucional
|
|
163
|
+
- Plan Mode obrigatório antes de execução
|
|
164
|
+
- Verificação como multiplicador de qualidade
|
|
165
|
+
|
|
166
|
+
**Continuous Claude v3**
|
|
167
|
+
|
|
168
|
+
- Skills modulares e reutilizáveis
|
|
169
|
+
- Agentes especializados por domínio
|
|
170
|
+
- Activation patterns inteligentes
|
|
171
|
+
- Self-improvement contínuo
|
|
172
|
+
|
|
173
|
+
## 1.2 Princípios Fundamentais
|
|
174
|
+
|
|
175
|
+
| Princípio | Boris | Continuous | Combinado |
|
|
176
|
+
| --- | --- | --- | --- |
|
|
177
|
+
| Paralelismo | 5-10 Claudes simultâneos | Agentes especializados | Multi-agent orchestration |
|
|
178
|
+
| Memória | [CLAUDE.md](http://CLAUDE.md) | Skills + Context | Memória hierárquica |
|
|
179
|
+
| Verificação | Tests + Build | Self-validation | Loop de feedback triplo |
|
|
180
|
+
| Aprendizado | Erros → Regras | Pattern recognition | Evolução contínua |
|
|
181
|
+
|
|
182
|
+
## 1.3 Modelo Mental
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
186
|
+
│ ORCHESTRATOR (Você) │
|
|
187
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
188
|
+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐│
|
|
189
|
+
│ │ Claude │ │ Claude │ │ Claude │ │ Claude │ │ Claude ││
|
|
190
|
+
│ │ #1 │ │ #2 │ │ #3 │ │ #4 │ │ #5 ││
|
|
191
|
+
│ │ Feature │ │ Bugs │ │ Docs │ │ Tests │ │ Explore ││
|
|
192
|
+
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘│
|
|
193
|
+
│ │ │ │ │ │ │
|
|
194
|
+
│ └────────────┴────────────┼────────────┴────────────┘ │
|
|
195
|
+
│ │ │
|
|
196
|
+
│ ┌────────────▼────────────┐ │
|
|
197
|
+
│ │ [CLAUDE.md](http://CLAUDE.md) │ │
|
|
198
|
+
│ │ (Memória Compartilhada)│ │
|
|
199
|
+
│ └─────────────────────────┘ │
|
|
200
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## 1.4 Métricas de Sucesso
|
|
204
|
+
|
|
205
|
+
| Métrica | Baseline | Com Workflow |
|
|
206
|
+
| --- | --- | --- |
|
|
207
|
+
| PRs por dia | 2-3 | 10-20+ |
|
|
208
|
+
| Qualidade (rework) | 30% | 10% |
|
|
209
|
+
| Tempo para feature | 1-2 dias | 2-4 horas |
|
|
210
|
+
| Bugs em produção | Alto | Mínimo |
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
# 2. Setup Inicial do Ambiente
|
|
215
|
+
|
|
216
|
+
## 2.1 Requisitos
|
|
217
|
+
|
|
218
|
+
**Software Necessário**
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# macOS
|
|
222
|
+
brew install --cask iterm2
|
|
223
|
+
brew install gh tmux
|
|
224
|
+
|
|
225
|
+
# Instalar Claude Code
|
|
226
|
+
npm install -g @anthropic/claude-code
|
|
227
|
+
|
|
228
|
+
# Autenticar
|
|
229
|
+
claude auth login
|
|
230
|
+
gh auth login
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Linux/WSL**
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# Instalar tmux para múltiplas sessões
|
|
237
|
+
sudo apt install tmux gh
|
|
238
|
+
|
|
239
|
+
# Claude Code
|
|
240
|
+
npm install -g @anthropic/claude-code
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## 2.2 Configuração do Terminal
|
|
244
|
+
|
|
245
|
+
**iTerm2 (Recomendado para Mac)**
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
iTerm2 → Settings → Profiles → Terminal
|
|
249
|
+
☑️ "Send notification when bell rings"
|
|
250
|
+
☑️ "Flash visual bell"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**tmux Configuration (~/.tmux.conf)**
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# Habilitar mouse
|
|
257
|
+
set -g mouse on
|
|
258
|
+
|
|
259
|
+
# Prefixo mais fácil
|
|
260
|
+
set -g prefix C-a
|
|
261
|
+
unbind C-b
|
|
262
|
+
bind C-a send-prefix
|
|
263
|
+
|
|
264
|
+
# Split intuitivo
|
|
265
|
+
bind | split-window -h
|
|
266
|
+
bind - split-window -v
|
|
267
|
+
|
|
268
|
+
# Notificações
|
|
269
|
+
set -g visual-activity on
|
|
270
|
+
set -g visual-bell on
|
|
271
|
+
|
|
272
|
+
# Status bar informativa
|
|
273
|
+
set -g status-right '#(date +%H:%M) | #S'
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## 2.3 Estrutura de Workspaces
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# Criar workspace para múltiplos checkouts
|
|
280
|
+
mkdir -p ~/dev/PROJECT_NAME-workspace
|
|
281
|
+
cd ~/dev/PROJECT_NAME-workspace
|
|
282
|
+
|
|
283
|
+
# Clonar múltiplas cópias (uma por Claude)
|
|
284
|
+
git clone <repo-url> main # Claude 1: Feature principal
|
|
285
|
+
git clone <repo-url> fixes # Claude 2: Bug fixes
|
|
286
|
+
git clone <repo-url> docs # Claude 3: Documentação
|
|
287
|
+
git clone <repo-url> tests # Claude 4: Testes
|
|
288
|
+
git clone <repo-url> explore # Claude 5: Exploração
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## 2.4 Script de Inicialização
|
|
292
|
+
|
|
293
|
+
Criar `~/bin/claude-workspace`:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
#!/bin/bash
|
|
297
|
+
# claude-workspace - Iniciar workspace com múltiplos Claudes
|
|
298
|
+
|
|
299
|
+
PROJECT=$1
|
|
300
|
+
WORKSPACE=~/dev/$PROJECT-workspace
|
|
301
|
+
|
|
302
|
+
if [ -z "$PROJECT" ]; then
|
|
303
|
+
echo "Uso: claude-workspace <nome-projeto>"
|
|
304
|
+
exit 1
|
|
305
|
+
fi
|
|
306
|
+
|
|
307
|
+
# Iniciar sessão tmux
|
|
308
|
+
tmux new-session -d -s $PROJECT -c $WORKSPACE/main
|
|
309
|
+
|
|
310
|
+
# Criar janelas para cada Claude
|
|
311
|
+
tmux new-window -t $PROJECT -n 'fixes' -c $WORKSPACE/fixes
|
|
312
|
+
tmux new-window -t $PROJECT -n 'docs' -c $WORKSPACE/docs
|
|
313
|
+
tmux new-window -t $PROJECT -n 'tests' -c $WORKSPACE/tests
|
|
314
|
+
tmux new-window -t $PROJECT -n 'explore' -c $WORKSPACE/explore
|
|
315
|
+
|
|
316
|
+
# Voltar para primeira janela
|
|
317
|
+
tmux select-window -t $PROJECT:0
|
|
318
|
+
|
|
319
|
+
# Anexar à sessão
|
|
320
|
+
tmux attach -t $PROJECT
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
# 3. Estrutura de Diretórios
|
|
326
|
+
|
|
327
|
+
## 3.1 Estrutura Padrão do Projeto
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
/seu-projeto/
|
|
331
|
+
├── .claude/
|
|
332
|
+
│ ├── settings.json # Configurações do Claude Code
|
|
333
|
+
│ ├── commands/ # Slash commands customizados
|
|
334
|
+
│ │ ├── [commit-push-pr.md](http://commit-push-pr.md)
|
|
335
|
+
│ │ ├── [code-simplifier.md](http://code-simplifier.md)
|
|
336
|
+
│ │ ├── [test-and-fix.md](http://test-and-fix.md)
|
|
337
|
+
│ │ ├── [review-changes.md](http://review-changes.md)
|
|
338
|
+
│ │ └── [quick-commit.md](http://quick-commit.md)
|
|
339
|
+
│ ├── agents/ # Sub-agentes especializados
|
|
340
|
+
│ │ ├── [verify-app.md](http://verify-app.md)
|
|
341
|
+
│ │ ├── [performance-checker.md](http://performance-checker.md)
|
|
342
|
+
│ │ ├── [security-audit.md](http://security-audit.md)
|
|
343
|
+
│ │ └── [code-reviewer.md](http://code-reviewer.md)
|
|
344
|
+
│ └── skills/ # Skills do Continuous Claude
|
|
345
|
+
│ ├── [SKILL.md](http://SKILL.md) # Índice de skills
|
|
346
|
+
│ ├── frontend/
|
|
347
|
+
│ ├── backend/
|
|
348
|
+
│ ├── testing/
|
|
349
|
+
│ └── devops/
|
|
350
|
+
├── [CLAUDE.md](http://CLAUDE.md) # Memória institucional (RAIZ)
|
|
351
|
+
├── docs/
|
|
352
|
+
│ └── guides/
|
|
353
|
+
│ └── [PIPELINE.md](http://PIPELINE.md) # Guia detalhado do pipeline
|
|
354
|
+
└── ...
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## 3.2 Arquivos Obrigatórios
|
|
358
|
+
|
|
359
|
+
| Arquivo | Propósito | Localização |
|
|
360
|
+
| --- | --- | --- |
|
|
361
|
+
| [CLAUDE.md](http://CLAUDE.md) | Memória compartilhada | Raiz do projeto |
|
|
362
|
+
| settings.json | Config do Claude Code | .claude/ |
|
|
363
|
+
| [commit-push-pr.md](http://commit-push-pr.md) | Workflow de commit | .claude/commands/ |
|
|
364
|
+
| [verify-app.md](http://verify-app.md) | Agente de verificação | .claude/agents/ |
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
# 4. [CLAUDE.md](http://CLAUDE.md) - Template Universal
|
|
369
|
+
|
|
370
|
+
## 4.1 Estrutura Recomendada
|
|
371
|
+
|
|
372
|
+
```markdown
|
|
373
|
+
# [NOME DO PROJETO] - Claude Code Guidelines
|
|
374
|
+
|
|
375
|
+
> Última atualização: [DATA]
|
|
376
|
+
> Versão: [X.Y.Z]
|
|
377
|
+
|
|
378
|
+
## 🎯 Visão do Projeto
|
|
379
|
+
|
|
380
|
+
[Descrição em 2-3 frases do que o projeto faz e seu objetivo principal]
|
|
381
|
+
|
|
382
|
+
## 🛠️ Stack Tecnológica
|
|
383
|
+
|
|
384
|
+
| Camada | Tecnologia | Versão |
|
|
385
|
+
|--------|------------|--------|
|
|
386
|
+
| Runtime | Node/Bun/Python | X.Y.Z |
|
|
387
|
+
| Framework | Next.js/Django/etc | X.Y.Z |
|
|
388
|
+
| Database | PostgreSQL/MongoDB | X.Y.Z |
|
|
389
|
+
| ORM | Prisma/Drizzle/etc | X.Y.Z |
|
|
390
|
+
|
|
391
|
+
## 📦 Package Manager
|
|
392
|
+
|
|
393
|
+
- ✅ Sempre usar: `[bun/npm/pnpm/yarn]`
|
|
394
|
+
- ❌ Nunca usar: `[alternativas não permitidas]`
|
|
395
|
+
|
|
396
|
+
## 🔧 Comandos Principais
|
|
397
|
+
|
|
398
|
+
# Desenvolvimento
|
|
399
|
+
|
|
400
|
+
[pkg] run dev
|
|
401
|
+
|
|
402
|
+
# Build
|
|
403
|
+
|
|
404
|
+
[pkg] run build
|
|
405
|
+
|
|
406
|
+
# Testes
|
|
407
|
+
|
|
408
|
+
[pkg] run test
|
|
409
|
+
|
|
410
|
+
# Lint
|
|
411
|
+
|
|
412
|
+
[pkg] run lint
|
|
413
|
+
|
|
414
|
+
# Type check
|
|
415
|
+
|
|
416
|
+
[pkg] run typecheck
|
|
417
|
+
|
|
418
|
+
## 📁 Estrutura de Pastas
|
|
419
|
+
|
|
420
|
+
src/
|
|
421
|
+
|
|
422
|
+
├── app/ # [Descrição]
|
|
423
|
+
|
|
424
|
+
├── components/ # [Descrição]
|
|
425
|
+
|
|
426
|
+
├── lib/ # [Descrição]
|
|
427
|
+
|
|
428
|
+
├── hooks/ # [Descrição]
|
|
429
|
+
|
|
430
|
+
└── types/ # [Descrição]
|
|
431
|
+
|
|
432
|
+
## ✅ Regras de Código - FAZER
|
|
433
|
+
|
|
434
|
+
1. [Regra positiva 1]
|
|
435
|
+
2. [Regra positiva 2]
|
|
436
|
+
3. [Regra positiva 3]
|
|
437
|
+
|
|
438
|
+
## ❌ Regras de Código - NÃO FAZER
|
|
439
|
+
|
|
440
|
+
1. [Proibição 1 - motivo]
|
|
441
|
+
2. [Proibição 2 - motivo]
|
|
442
|
+
3. [Proibição 3 - motivo]
|
|
443
|
+
|
|
444
|
+
## 🎨 Padrões de Naming
|
|
445
|
+
|
|
446
|
+
| Tipo | Convenção | Exemplo |
|
|
447
|
+
|------|-----------|----------|
|
|
448
|
+
| Componentes | PascalCase | `UserProfile.tsx` |
|
|
449
|
+
| Hooks | camelCase com use | `useAuth.ts` |
|
|
450
|
+
| Utils | camelCase | `formatDate.ts` |
|
|
451
|
+
| Types | PascalCase | `UserType.ts` |
|
|
452
|
+
| Constants | UPPER_SNAKE | `API_BASE_URL` |
|
|
453
|
+
|
|
454
|
+
## 🧪 Estratégia de Testes
|
|
455
|
+
|
|
456
|
+
- Unit tests: [Framework - Jest/Vitest]
|
|
457
|
+
- Integration: [Abordagem]
|
|
458
|
+
- E2E: [Framework - Playwright/Cypress]
|
|
459
|
+
|
|
460
|
+
## 🚀 Workflow de Deploy
|
|
461
|
+
|
|
462
|
+
1. Branch: `feature/xxx` → PR para `main`
|
|
463
|
+
2. CI: [Testes que rodam]
|
|
464
|
+
3. Deploy: [Ambiente e processo]
|
|
465
|
+
|
|
466
|
+
## 📝 Convenções de Commit
|
|
467
|
+
|
|
468
|
+
Formato: `tipo(escopo): descrição`
|
|
469
|
+
|
|
470
|
+
| Tipo | Uso |
|
|
471
|
+
|------|-----|
|
|
472
|
+
| feat | Nova funcionalidade |
|
|
473
|
+
| fix | Correção de bug |
|
|
474
|
+
| refactor | Refatoração |
|
|
475
|
+
| docs | Documentação |
|
|
476
|
+
| test | Testes |
|
|
477
|
+
| chore | Manutenção |
|
|
478
|
+
|
|
479
|
+
## 🐛 Erros Conhecidos e Soluções
|
|
480
|
+
|
|
481
|
+
### [Erro 1]
|
|
482
|
+
- **Problema**: [Descrição]
|
|
483
|
+
- **Solução**: [Como resolver]
|
|
484
|
+
|
|
485
|
+
### [Erro 2]
|
|
486
|
+
- **Problema**: [Descrição]
|
|
487
|
+
- **Solução**: [Como resolver]
|
|
488
|
+
|
|
489
|
+
## 📚 Padrões Aprendidos
|
|
490
|
+
|
|
491
|
+
<!-- Adicione aqui padrões descobertos durante o desenvolvimento -->
|
|
492
|
+
|
|
493
|
+
### [Data] - [Título]
|
|
494
|
+
- **Contexto**: [O que aconteceu]
|
|
495
|
+
- **Aprendizado**: [O que aprendemos]
|
|
496
|
+
- **Ação**: [Regra adicionada]
|
|
497
|
+
|
|
498
|
+
## 🔗 Links Úteis
|
|
499
|
+
|
|
500
|
+
- Repo: [URL]
|
|
501
|
+
- Docs: [URL]
|
|
502
|
+
- CI/CD: [URL]
|
|
503
|
+
- Monitoring: [URL]
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
## 4.2 Regra de Ouro do [CLAUDE.md](http://CLAUDE.md)
|
|
507
|
+
|
|
508
|
+
> **Toda vez que Claude comete um erro, adicione ao [CLAUDE.md](http://CLAUDE.md) para que não aconteça novamente.**
|
|
509
|
+
>
|
|
510
|
+
|
|
511
|
+
Exemplos de adições:
|
|
512
|
+
|
|
513
|
+
```markdown
|
|
514
|
+
## ❌ Regras de Código - NÃO FAZER
|
|
515
|
+
|
|
516
|
+
4. Nunca criar componentes com mais de 200 linhas - dividir em subcomponentes
|
|
517
|
+
5. Nunca usar `any` em TypeScript - sempre tipar corretamente
|
|
518
|
+
6. Nunca commitar diretamente na main - sempre usar feature branches
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
# 5. Pipeline de Desenvolvimento
|
|
524
|
+
|
|
525
|
+
## 5.1 O Fluxo Completo: Plan → Execute → Verify
|
|
526
|
+
|
|
527
|
+
```
|
|
528
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
529
|
+
│ PLAN MODE (Obrigatório) │
|
|
530
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
531
|
+
│ │ 1. Descrever a tarefa com contexto completo │ │
|
|
532
|
+
│ │ 2. Claude propõe plano detalhado │ │
|
|
533
|
+
│ │ 3. Revisar e iterar até aprovar │ │
|
|
534
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
535
|
+
│ ↓ │
|
|
536
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
537
|
+
│ EXECUTE (Auto-Accept) │
|
|
538
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
539
|
+
│ │ 4. Aprovar plano e mudar para auto-accept │ │
|
|
540
|
+
│ │ 5. Claude executa todas as mudanças │ │
|
|
541
|
+
│ │ 6. Monitorar progresso (hooks formatam automaticamente) │ │
|
|
542
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
543
|
+
│ ↓ │
|
|
544
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
545
|
+
│ VERIFY (Triplo Feedback) │
|
|
546
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
547
|
+
│ │ 7. Build: npm run build (erros de compilação) │ │
|
|
548
|
+
│ │ 8. Test: npm run test (regressões) │ │
|
|
549
|
+
│ │ 9. Lint: npm run lint (estilo e qualidade) │ │
|
|
550
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
551
|
+
│ ↓ │
|
|
552
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
553
|
+
│ SIMPLIFY & SHIP │
|
|
554
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
555
|
+
│ │ 10. /code-simplifier (limpar e otimizar) │ │
|
|
556
|
+
│ │ 11. /commit-push-pr (criar PR automaticamente) │ │
|
|
557
|
+
│ │ 12. Atualizar [CLAUDE.md](http://CLAUDE.md) se necessário │ │
|
|
558
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
559
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
## 5.2 Plan Mode - Detalhado
|
|
563
|
+
|
|
564
|
+
**Entrar em Plan Mode:**
|
|
565
|
+
|
|
566
|
+
```
|
|
567
|
+
Shift + Tab (duas vezes)
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
**Template de Prompt para Planejar:**
|
|
571
|
+
|
|
572
|
+
```
|
|
573
|
+
## Contexto
|
|
574
|
+
[Descreva o estado atual do código/feature]
|
|
575
|
+
|
|
576
|
+
## Problema
|
|
577
|
+
[Descreva claramente o que precisa ser resolvido]
|
|
578
|
+
|
|
579
|
+
## Objetivo
|
|
580
|
+
[Liste os resultados esperados]
|
|
581
|
+
|
|
582
|
+
## Restrições
|
|
583
|
+
- [Limitação 1]
|
|
584
|
+
- [Limitação 2]
|
|
585
|
+
|
|
586
|
+
## Arquivos Relevantes
|
|
587
|
+
- src/path/to/file.ts
|
|
588
|
+
- src/path/to/another.ts
|
|
589
|
+
|
|
590
|
+
## Requisitos Técnicos
|
|
591
|
+
1. [Requisito 1]
|
|
592
|
+
2. [Requisito 2]
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
**Exemplo Real:**
|
|
596
|
+
|
|
597
|
+
```
|
|
598
|
+
## Contexto
|
|
599
|
+
O componente BlockEngine está lento ao carregar mais de 50 blocos.
|
|
600
|
+
Atualmente renderiza todos de uma vez.
|
|
601
|
+
|
|
602
|
+
## Problema
|
|
603
|
+
Delay de 3 segundos no primeiro render.
|
|
604
|
+
Usuários reclamando de performance.
|
|
605
|
+
|
|
606
|
+
## Objetivo
|
|
607
|
+
1. Implementar lazy loading dos blocos
|
|
608
|
+
2. Adicionar virtualização para listas longas
|
|
609
|
+
3. Manter funcionalidade existente
|
|
610
|
+
|
|
611
|
+
## Restrições
|
|
612
|
+
- Não quebrar testes existentes
|
|
613
|
+
- Manter compatibilidade com API atual
|
|
614
|
+
- Bundle size não pode aumentar mais de 10KB
|
|
615
|
+
|
|
616
|
+
## Arquivos Relevantes
|
|
617
|
+
- src/components/BlockEngine.tsx
|
|
618
|
+
- src/hooks/useBlocks.ts
|
|
619
|
+
- src/types/block.ts
|
|
620
|
+
|
|
621
|
+
## Requisitos Técnicos
|
|
622
|
+
1. Usar react-window para virtualização
|
|
623
|
+
2. Implementar Intersection Observer
|
|
624
|
+
3. Adicionar skeleton loading
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
## 5.3 Verificação - A Regra Mais Importante
|
|
628
|
+
|
|
629
|
+
> "Provavelmente a coisa mais importante para ter ótimos resultados com Claude Code: **dê a Claude uma forma de verificar seu trabalho**. Se Claude tem esse feedback loop, vai 2-3x a qualidade do resultado final." — Boris Cherny
|
|
630
|
+
>
|
|
631
|
+
|
|
632
|
+
**Níveis de Verificação:**
|
|
633
|
+
|
|
634
|
+
| Nível | Ferramenta | O que pega |
|
|
635
|
+
| --- | --- | --- |
|
|
636
|
+
| 1 | TypeScript | Erros de tipo |
|
|
637
|
+
| 2 | Lint | Estilo e padrões |
|
|
638
|
+
| 3 | Tests | Regressões |
|
|
639
|
+
| 4 | Build | Erros de compilação |
|
|
640
|
+
| 5 | E2E | Fluxos quebrados |
|
|
641
|
+
| 6 | Browser | UI/UX issues |
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
# 6. Sistema de Agentes Especializados
|
|
646
|
+
|
|
647
|
+
## 6.1 Conceito de Agentes
|
|
648
|
+
|
|
649
|
+
Agentes são "mini-Claudes" especializados em tarefas específicas. Cada agente tem:
|
|
650
|
+
|
|
651
|
+
- Escopo definido
|
|
652
|
+
- Checklist próprio
|
|
653
|
+
- Comandos específicos
|
|
654
|
+
- Critérios de sucesso
|
|
655
|
+
|
|
656
|
+
## 6.2 Agente: [verify-app.md](http://verify-app.md)
|
|
657
|
+
|
|
658
|
+
```markdown
|
|
659
|
+
# Agente de Verificação da Aplicação
|
|
660
|
+
|
|
661
|
+
Você é um agente especializado em verificar que a aplicação funciona corretamente.
|
|
662
|
+
|
|
663
|
+
## Checklist de Verificação
|
|
664
|
+
|
|
665
|
+
### 1. Build
|
|
666
|
+
|
|
667
|
+
npm run build 2>&1
|
|
668
|
+
|
|
669
|
+
- [ ] Deve completar sem erros
|
|
670
|
+
- [ ] Verificar warnings relevantes
|
|
671
|
+
- [ ] Bundle size dentro do limite
|
|
672
|
+
|
|
673
|
+
### 2. Testes
|
|
674
|
+
|
|
675
|
+
npm run test 2>&1
|
|
676
|
+
|
|
677
|
+
- [ ] Todos os testes devem passar
|
|
678
|
+
- [ ] Cobertura não deve diminuir
|
|
679
|
+
- [ ] Sem testes pulados sem motivo
|
|
680
|
+
|
|
681
|
+
### 3. Lint
|
|
682
|
+
|
|
683
|
+
npm run lint 2>&1
|
|
684
|
+
|
|
685
|
+
- [ ] Zero erros
|
|
686
|
+
- [ ] Warnings documentados
|
|
687
|
+
|
|
688
|
+
### 4. TypeScript
|
|
689
|
+
|
|
690
|
+
npm run typecheck 2>&1
|
|
691
|
+
|
|
692
|
+
- [ ] Zero erros de tipo
|
|
693
|
+
- [ ] Sem suppressions novos
|
|
694
|
+
|
|
695
|
+
### 5. Verificação Visual (se aplicável)
|
|
696
|
+
- [ ] Abrir em browser
|
|
697
|
+
- [ ] Testar fluxos principais
|
|
698
|
+
- [ ] Verificar responsividade
|
|
699
|
+
|
|
700
|
+
## Output Esperado
|
|
701
|
+
|
|
702
|
+
## Relatório de Verificação
|
|
703
|
+
|
|
704
|
+
### Build
|
|
705
|
+
|
|
706
|
+
✅ Passou | ❌ Falhou
|
|
707
|
+
|
|
708
|
+
[Detalhes se falhou]
|
|
709
|
+
|
|
710
|
+
### Testes
|
|
711
|
+
|
|
712
|
+
✅ X/Y passaram | ❌ X falhas
|
|
713
|
+
|
|
714
|
+
[Lista de falhas se houver]
|
|
715
|
+
|
|
716
|
+
### Lint
|
|
717
|
+
|
|
718
|
+
✅ Limpo | ⚠️ X warnings | ❌ X erros
|
|
719
|
+
|
|
720
|
+
[Detalhes relevantes]
|
|
721
|
+
|
|
722
|
+
### TypeScript
|
|
723
|
+
|
|
724
|
+
✅ Sem erros | ❌ X erros
|
|
725
|
+
|
|
726
|
+
[Detalhes se houver]
|
|
727
|
+
|
|
728
|
+
### Veredicto Final
|
|
729
|
+
|
|
730
|
+
✅ APROVADO - Pode fazer PR
|
|
731
|
+
|
|
732
|
+
❌ REPROVADO - [Motivo principal]
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
## 6.3 Agente: [code-simplifier.md](http://code-simplifier.md)
|
|
736
|
+
|
|
737
|
+
```markdown
|
|
738
|
+
# Agente Simplificador de Código
|
|
739
|
+
|
|
740
|
+
Você é um agente especializado em simplificar e melhorar código recém-escrito.
|
|
741
|
+
|
|
742
|
+
## Análise Inicial
|
|
743
|
+
|
|
744
|
+
git diff HEAD~1 --name-only
|
|
745
|
+
|
|
746
|
+
## Critérios de Simplificação
|
|
747
|
+
|
|
748
|
+
### 1. Duplicação
|
|
749
|
+
- Identificar código repetido
|
|
750
|
+
- Extrair para funções/hooks reutilizáveis
|
|
751
|
+
- DRY (Don't Repeat Yourself)
|
|
752
|
+
|
|
753
|
+
### 2. Complexidade
|
|
754
|
+
- Funções > 30 linhas → dividir
|
|
755
|
+
- Componentes > 150 linhas → dividir
|
|
756
|
+
- Nesting > 3 níveis → refatorar
|
|
757
|
+
- Cyclomatic complexity > 10 → simplificar
|
|
758
|
+
|
|
759
|
+
### 3. Naming
|
|
760
|
+
- Variáveis descritivas
|
|
761
|
+
- Funções indicam ação
|
|
762
|
+
- Sem abreviações obscuras
|
|
763
|
+
- Consistência com codebase
|
|
764
|
+
|
|
765
|
+
### 4. TypeScript
|
|
766
|
+
- Adicionar tipos específicos
|
|
767
|
+
- Remover `any` desnecessário
|
|
768
|
+
- Usar generics quando apropriado
|
|
769
|
+
- Inferência onde possível
|
|
770
|
+
|
|
771
|
+
### 5. Performance
|
|
772
|
+
- Identificar re-renders
|
|
773
|
+
- Sugerir memoization
|
|
774
|
+
- Verificar dependências de hooks
|
|
775
|
+
- Lazy loading onde apropriado
|
|
776
|
+
|
|
777
|
+
### 6. Limpeza
|
|
778
|
+
- Remover código comentado
|
|
779
|
+
- Remover imports não usados
|
|
780
|
+
- Remover variáveis mortas
|
|
781
|
+
- Remover console.logs
|
|
782
|
+
|
|
783
|
+
## Output
|
|
784
|
+
|
|
785
|
+
Para cada melhoria:
|
|
786
|
+
1. Mostrar código atual
|
|
787
|
+
2. Explicar o problema
|
|
788
|
+
3. Mostrar solução
|
|
789
|
+
4. Aplicar mudança
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
## 6.4 Agente: [security-audit.md](http://security-audit.md)
|
|
793
|
+
|
|
794
|
+
```markdown
|
|
795
|
+
# Agente de Auditoria de Segurança
|
|
796
|
+
|
|
797
|
+
Você é um agente especializado em identificar vulnerabilidades de segurança.
|
|
798
|
+
|
|
799
|
+
## Análise
|
|
800
|
+
|
|
801
|
+
git diff HEAD~1
|
|
802
|
+
|
|
803
|
+
## Checklist de Segurança
|
|
804
|
+
|
|
805
|
+
### 1. Injeção
|
|
806
|
+
- [ ] SQL Injection (queries parametrizadas?)
|
|
807
|
+
- [ ] XSS (sanitização de input?)
|
|
808
|
+
- [ ] Command Injection (shell seguro?)
|
|
809
|
+
|
|
810
|
+
### 2. Autenticação
|
|
811
|
+
- [ ] Tokens expostos em código?
|
|
812
|
+
- [ ] Senhas hardcoded?
|
|
813
|
+
- [ ] Sessions seguras?
|
|
814
|
+
|
|
815
|
+
### 3. Dados Sensíveis
|
|
816
|
+
- [ ] Logs sem dados sensíveis?
|
|
817
|
+
- [ ] Erros não expõem internals?
|
|
818
|
+
- [ ] PII protegida?
|
|
819
|
+
|
|
820
|
+
### 4. Dependências
|
|
821
|
+
- [ ] Versões seguras?
|
|
822
|
+
- [ ] Vulnerabilidades conhecidas?
|
|
823
|
+
|
|
824
|
+
### 5. Headers & CORS
|
|
825
|
+
- [ ] CORS configurado corretamente?
|
|
826
|
+
- [ ] Headers de segurança presentes?
|
|
827
|
+
|
|
828
|
+
## Severidade
|
|
829
|
+
|
|
830
|
+
| Nível | Ação |
|
|
831
|
+
|-------|------|
|
|
832
|
+
| 🔴 Critical | Bloquear PR |
|
|
833
|
+
| 🟠 High | Resolver antes do merge |
|
|
834
|
+
| 🟡 Medium | Resolver em 1 semana |
|
|
835
|
+
| 🟢 Low | Backlog |
|
|
836
|
+
|
|
837
|
+
## Output
|
|
838
|
+
|
|
839
|
+
## Relatório de Segurança
|
|
840
|
+
|
|
841
|
+
### Vulnerabilidades Encontradas
|
|
842
|
+
|
|
843
|
+
[Lista com severidade]
|
|
844
|
+
|
|
845
|
+
### Recomendações
|
|
846
|
+
|
|
847
|
+
[Ações específicas]
|
|
848
|
+
|
|
849
|
+
### Veredicto
|
|
850
|
+
|
|
851
|
+
✅ SEGURO | ⚠️ ATENÇÃO | ❌ BLOQUEADO
|
|
852
|
+
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
## 6.5 Agente: [performance-checker.md](http://performance-checker.md)
|
|
856
|
+
|
|
857
|
+
```markdown
|
|
858
|
+
# Agente de Performance
|
|
859
|
+
|
|
860
|
+
Você é um agente especializado em análise de performance.
|
|
861
|
+
|
|
862
|
+
## Análise
|
|
863
|
+
|
|
864
|
+
git diff HEAD~1 --name-only
|
|
865
|
+
|
|
866
|
+
## Verificações
|
|
867
|
+
|
|
868
|
+
### 1. Re-renders
|
|
869
|
+
- Componentes sem React.memo que deveriam ter
|
|
870
|
+
- Props que mudam referência desnecessariamente
|
|
871
|
+
- Context providers mal posicionados
|
|
872
|
+
|
|
873
|
+
### 2. Memoization
|
|
874
|
+
- useCallback para funções em props
|
|
875
|
+
- useMemo para cálculos pesados
|
|
876
|
+
- Dependências corretas nos arrays
|
|
877
|
+
|
|
878
|
+
### 3. Lazy Loading
|
|
879
|
+
- Componentes grandes → React.lazy
|
|
880
|
+
- Rotas → lazy loading
|
|
881
|
+
- Imports dinâmicos para features opcionais
|
|
882
|
+
|
|
883
|
+
### 4. Bundle Impact
|
|
884
|
+
- Novas dependências adicionadas
|
|
885
|
+
- Tree shaking funcionando
|
|
886
|
+
- Code splitting efetivo
|
|
887
|
+
|
|
888
|
+
### 5. Data Fetching
|
|
889
|
+
- Queries cacheadas
|
|
890
|
+
- Fetches não duplicados
|
|
891
|
+
- Sem waterfall de requests
|
|
892
|
+
|
|
893
|
+
## Métricas Alvo
|
|
894
|
+
|
|
895
|
+
| Métrica | Valor |
|
|
896
|
+
|---------|-------|
|
|
897
|
+
| LCP | < 2.5s |
|
|
898
|
+
| FID | < 100ms |
|
|
899
|
+
| CLS | < 0.1 |
|
|
900
|
+
| Bundle inicial | < 200KB |
|
|
901
|
+
|
|
902
|
+
## Output
|
|
903
|
+
|
|
904
|
+
## Relatório de Performance
|
|
905
|
+
|
|
906
|
+
### Issues Encontrados
|
|
907
|
+
|
|
908
|
+
[Lista com severidade e impacto]
|
|
909
|
+
|
|
910
|
+
### Recomendações
|
|
911
|
+
|
|
912
|
+
[Soluções específicas com código]
|
|
913
|
+
|
|
914
|
+
### Estimativa de Melhoria
|
|
915
|
+
|
|
916
|
+
[Ganhos esperados]
|
|
917
|
+
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
---
|
|
921
|
+
|
|
922
|
+
# 7. Slash Commands Essenciais
|
|
923
|
+
|
|
924
|
+
## 7.1 /[commit-push-pr.md](http://commit-push-pr.md)
|
|
925
|
+
|
|
926
|
+
O comando mais usado - dezenas de vezes por dia.
|
|
927
|
+
|
|
928
|
+
```markdown
|
|
929
|
+
# Commit, Push e Criar PR
|
|
930
|
+
|
|
931
|
+
Execute o fluxo completo de commit até PR.
|
|
932
|
+
|
|
933
|
+
## Coleta de Contexto
|
|
934
|
+
|
|
935
|
+
git status
|
|
936
|
+
|
|
937
|
+
git diff --stat
|
|
938
|
+
|
|
939
|
+
git branch --show-current
|
|
940
|
+
|
|
941
|
+
git log --oneline -3
|
|
942
|
+
|
|
943
|
+
## Instruções
|
|
944
|
+
|
|
945
|
+
### 1. Stage
|
|
946
|
+
|
|
947
|
+
git add -A
|
|
948
|
+
|
|
949
|
+
### 2. Commit
|
|
950
|
+
Analise as mudanças e crie mensagem seguindo Conventional Commits:
|
|
951
|
+
- Formato: `tipo(escopo): descrição`
|
|
952
|
+
- Tipos: feat, fix, refactor, docs, test, chore, perf
|
|
953
|
+
- Escopo: módulo/componente afetado
|
|
954
|
+
- Descrição: imperativo, lowercase, sem ponto final
|
|
955
|
+
|
|
956
|
+
Exemplos:
|
|
957
|
+
- `feat(auth): add social login with Google`
|
|
958
|
+
- `fix(blocks): resolve memory leak on unmount`
|
|
959
|
+
- `refactor(api): simplify error handling`
|
|
960
|
+
|
|
961
|
+
git commit -m "[mensagem gerada]"
|
|
962
|
+
|
|
963
|
+
### 3. Push
|
|
964
|
+
|
|
965
|
+
git push -u origin $(git branch --show-current)
|
|
966
|
+
|
|
967
|
+
### 4. Criar PR
|
|
968
|
+
|
|
969
|
+
gh pr create --fill
|
|
970
|
+
|
|
971
|
+
Se precisar de mais contexto:
|
|
972
|
+
|
|
973
|
+
gh pr create --title "[título]" --body "[descrição]"
|
|
974
|
+
|
|
975
|
+
## Output
|
|
976
|
+
|
|
977
|
+
## PR Criado ✅
|
|
978
|
+
|
|
979
|
+
**Link**: [URL do PR]
|
|
980
|
+
|
|
981
|
+
**Branch**: [nome]
|
|
982
|
+
|
|
983
|
+
**Commits**: [quantidade]
|
|
984
|
+
|
|
985
|
+
### Mudanças
|
|
986
|
+
|
|
987
|
+
[Resumo das alterações]
|
|
988
|
+
```
|
|
989
|
+
|
|
990
|
+
## 7.2 /[quick-commit.md](http://quick-commit.md)
|
|
991
|
+
|
|
992
|
+
```markdown
|
|
993
|
+
# Quick Commit
|
|
994
|
+
|
|
995
|
+
Commit rápido sem criar PR.
|
|
996
|
+
|
|
997
|
+
git status
|
|
998
|
+
|
|
999
|
+
git diff --stat
|
|
1000
|
+
|
|
1001
|
+
1. Stage mudanças relevantes
|
|
1002
|
+
2. Criar commit com mensagem descritiva
|
|
1003
|
+
3. NÃO fazer push
|
|
1004
|
+
|
|
1005
|
+
Use quando:
|
|
1006
|
+
- Work in progress
|
|
1007
|
+
- Checkpoint intermediário
|
|
1008
|
+
- Múltiplos commits antes de PR
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
## 7.3 /[test-and-fix.md](http://test-and-fix.md)
|
|
1012
|
+
|
|
1013
|
+
```markdown
|
|
1014
|
+
# Testar e Corrigir
|
|
1015
|
+
|
|
1016
|
+
Execute testes e corrija falhas automaticamente.
|
|
1017
|
+
|
|
1018
|
+
npm run test 2>&1
|
|
1019
|
+
|
|
1020
|
+
## Se houver falhas:
|
|
1021
|
+
|
|
1022
|
+
1. Analisar cada erro
|
|
1023
|
+
2. Identificar causa raiz
|
|
1024
|
+
3. Implementar correção
|
|
1025
|
+
4. Re-executar testes
|
|
1026
|
+
5. Repetir até todos passarem
|
|
1027
|
+
|
|
1028
|
+
## Se todos passarem:
|
|
1029
|
+
|
|
1030
|
+
✅ Todos os [X] testes passaram
|
|
1031
|
+
|
|
1032
|
+
## Output
|
|
1033
|
+
|
|
1034
|
+
## Resultado dos Testes
|
|
1035
|
+
|
|
1036
|
+
**Status**: ✅ Passou | ❌ [X] falhas
|
|
1037
|
+
|
|
1038
|
+
**Total**: [X] testes
|
|
1039
|
+
|
|
1040
|
+
**Duração**: [X]s
|
|
1041
|
+
|
|
1042
|
+
### Correções Aplicadas (se houver)
|
|
1043
|
+
|
|
1044
|
+
1. [Descrição da correção 1]
|
|
1045
|
+
2. [Descrição da correção 2]
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
## 7.4 /[review-changes.md](http://review-changes.md)
|
|
1049
|
+
|
|
1050
|
+
```markdown
|
|
1051
|
+
# Review de Mudanças
|
|
1052
|
+
|
|
1053
|
+
Faça code review das mudanças não commitadas.
|
|
1054
|
+
|
|
1055
|
+
git diff
|
|
1056
|
+
|
|
1057
|
+
## Critérios de Review
|
|
1058
|
+
|
|
1059
|
+
### 1. Correção
|
|
1060
|
+
- O código faz o que deveria?
|
|
1061
|
+
- Edge cases tratados?
|
|
1062
|
+
- Erros handled?
|
|
1063
|
+
|
|
1064
|
+
### 2. Qualidade
|
|
1065
|
+
- Segue padrões do projeto?
|
|
1066
|
+
- Legível e manutenível?
|
|
1067
|
+
- Bem documentado?
|
|
1068
|
+
|
|
1069
|
+
### 3. Performance
|
|
1070
|
+
- Problemas óbvios?
|
|
1071
|
+
- Complexidade adequada?
|
|
1072
|
+
|
|
1073
|
+
### 4. Segurança
|
|
1074
|
+
- Vulnerabilidades?
|
|
1075
|
+
- Dados expostos?
|
|
1076
|
+
|
|
1077
|
+
### 5. Testes
|
|
1078
|
+
- Mudanças testadas?
|
|
1079
|
+
- Cobertura adequada?
|
|
1080
|
+
|
|
1081
|
+
## Output
|
|
1082
|
+
|
|
1083
|
+
## Code Review
|
|
1084
|
+
|
|
1085
|
+
### Aprovação
|
|
1086
|
+
|
|
1087
|
+
✅ APROVADO | ⚠️ APROVADO COM RESSALVAS | ❌ MUDANÇAS NECESSÁRIAS
|
|
1088
|
+
|
|
1089
|
+
### Feedback
|
|
1090
|
+
|
|
1091
|
+
[Lista de observações]
|
|
1092
|
+
|
|
1093
|
+
### Sugestões de Melhoria
|
|
1094
|
+
|
|
1095
|
+
[Lista de sugestões opcionais]
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
## 7.5 /[init-project.md](http://init-project.md)
|
|
1099
|
+
|
|
1100
|
+
```markdown
|
|
1101
|
+
# Inicializar Projeto para Claude Code
|
|
1102
|
+
|
|
1103
|
+
Configure um novo projeto com toda a estrutura necessária.
|
|
1104
|
+
|
|
1105
|
+
## Criar Estrutura
|
|
1106
|
+
|
|
1107
|
+
mkdir -p .claude/commands
|
|
1108
|
+
|
|
1109
|
+
mkdir -p .claude/agents
|
|
1110
|
+
|
|
1111
|
+
mkdir -p .claude/skills
|
|
1112
|
+
|
|
1113
|
+
## Criar Arquivos Base
|
|
1114
|
+
|
|
1115
|
+
1. Criar [CLAUDE.md](http://CLAUDE.md) com template padrão
|
|
1116
|
+
2. Criar .claude/settings.json
|
|
1117
|
+
3. Criar comandos essenciais
|
|
1118
|
+
4. Criar agentes principais
|
|
1119
|
+
|
|
1120
|
+
## Verificar
|
|
1121
|
+
|
|
1122
|
+
ls -la .claude/
|
|
1123
|
+
|
|
1124
|
+
cat [CLAUDE.md]
|
|
1125
|
+
|
|
1126
|
+
## Output
|
|
1127
|
+
|
|
1128
|
+
✅ Projeto inicializado para Claude Code
|
|
1129
|
+
|
|
1130
|
+
Arquivos criados:
|
|
1131
|
+
|
|
1132
|
+
- [CLAUDE.md](http://CLAUDE.md)
|
|
1133
|
+
- .claude/settings.json
|
|
1134
|
+
- .claude/commands/[commit-push-pr.md]
|
|
1135
|
+
- .claude/commands/[code-simplifier.md]
|
|
1136
|
+
- .claude/agents/[verify-app.md]
|
|
1137
|
+
```
|
|
1138
|
+
|
|
1139
|
+
---
|
|
1140
|
+
|
|
1141
|
+
# 8. Hooks e Automações
|
|
1142
|
+
|
|
1143
|
+
## 8.1 settings.json Completo
|
|
1144
|
+
|
|
1145
|
+
```json
|
|
1146
|
+
{
|
|
1147
|
+
"model": "opus-4.5",
|
|
1148
|
+
"thinking": true,
|
|
1149
|
+
|
|
1150
|
+
"permissions": {
|
|
1151
|
+
"allow": [
|
|
1152
|
+
"npm run *",
|
|
1153
|
+
"bun run *",
|
|
1154
|
+
"pnpm run *",
|
|
1155
|
+
"yarn *",
|
|
1156
|
+
"git status",
|
|
1157
|
+
"git diff *",
|
|
1158
|
+
"git add *",
|
|
1159
|
+
"git commit *",
|
|
1160
|
+
"git push *",
|
|
1161
|
+
"git pull",
|
|
1162
|
+
"git checkout *",
|
|
1163
|
+
"git branch *",
|
|
1164
|
+
"git log *",
|
|
1165
|
+
"gh pr *",
|
|
1166
|
+
"gh issue *",
|
|
1167
|
+
"cat *",
|
|
1168
|
+
"ls *",
|
|
1169
|
+
"tree *",
|
|
1170
|
+
"head *",
|
|
1171
|
+
"tail *",
|
|
1172
|
+
"grep *",
|
|
1173
|
+
"find *",
|
|
1174
|
+
"mkdir *",
|
|
1175
|
+
"touch *",
|
|
1176
|
+
"cp *",
|
|
1177
|
+
"mv *"
|
|
1178
|
+
],
|
|
1179
|
+
"deny": [
|
|
1180
|
+
"rm -rf /",
|
|
1181
|
+
"rm -rf ~",
|
|
1182
|
+
"sudo *",
|
|
1183
|
+
"chmod 777 *",
|
|
1184
|
+
"curl * | sh",
|
|
1185
|
+
"wget * | sh"
|
|
1186
|
+
]
|
|
1187
|
+
},
|
|
1188
|
+
|
|
1189
|
+
"hooks": {
|
|
1190
|
+
"PostToolUse": [
|
|
1191
|
+
{
|
|
1192
|
+
"matcher": "Write|Edit",
|
|
1193
|
+
"hooks": [
|
|
1194
|
+
{
|
|
1195
|
+
"type": "command",
|
|
1196
|
+
"command": "npm run format --silent || true"
|
|
1197
|
+
}
|
|
1198
|
+
]
|
|
1199
|
+
}
|
|
1200
|
+
],
|
|
1201
|
+
"Stop": [
|
|
1202
|
+
{
|
|
1203
|
+
"type": "command",
|
|
1204
|
+
"command": "npm run lint --silent || true"
|
|
1205
|
+
}
|
|
1206
|
+
],
|
|
1207
|
+
"PreCommit": [
|
|
1208
|
+
{
|
|
1209
|
+
"type": "command",
|
|
1210
|
+
"command": "npm run typecheck --silent"
|
|
1211
|
+
}
|
|
1212
|
+
]
|
|
1213
|
+
},
|
|
1214
|
+
|
|
1215
|
+
"context": {
|
|
1216
|
+
"include": [
|
|
1217
|
+
"[CLAUDE.md](http://CLAUDE.md)",
|
|
1218
|
+
"package.json",
|
|
1219
|
+
"tsconfig.json"
|
|
1220
|
+
],
|
|
1221
|
+
"exclude": [
|
|
1222
|
+
"node_modules/**",
|
|
1223
|
+
"dist/**",
|
|
1224
|
+
".git/**",
|
|
1225
|
+
"*.lock"
|
|
1226
|
+
]
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
## 8.2 Explicação dos Hooks
|
|
1232
|
+
|
|
1233
|
+
| Hook | Quando executa | Uso típico |
|
|
1234
|
+
| --- | --- | --- |
|
|
1235
|
+
| PostToolUse | Após Write/Edit | Formatação automática |
|
|
1236
|
+
| Stop | Quando Claude para | Lint final |
|
|
1237
|
+
| PreCommit | Antes de commit | Typecheck |
|
|
1238
|
+
| PrePush | Antes de push | Testes |
|
|
1239
|
+
|
|
1240
|
+
## 8.3 Scripts de Package.json Recomendados
|
|
1241
|
+
|
|
1242
|
+
```json
|
|
1243
|
+
{
|
|
1244
|
+
"scripts": {
|
|
1245
|
+
"dev": "next dev",
|
|
1246
|
+
"build": "next build",
|
|
1247
|
+
"start": "next start",
|
|
1248
|
+
"lint": "eslint . --ext .ts,.tsx",
|
|
1249
|
+
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
1250
|
+
"format": "prettier --write .",
|
|
1251
|
+
"format:check": "prettier --check .",
|
|
1252
|
+
"typecheck": "tsc --noEmit",
|
|
1253
|
+
"test": "vitest run",
|
|
1254
|
+
"test:watch": "vitest",
|
|
1255
|
+
"test:coverage": "vitest run --coverage",
|
|
1256
|
+
"validate": "npm run typecheck && npm run lint && npm run test",
|
|
1257
|
+
"prepare": "husky install"
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
```
|
|
1261
|
+
|
|
1262
|
+
---
|
|
1263
|
+
|
|
1264
|
+
# 9. Skills do Continuous Claude
|
|
1265
|
+
|
|
1266
|
+
## 9.1 Conceito de Skills
|
|
1267
|
+
|
|
1268
|
+
Skills são pacotes de conhecimento especializado que Claude pode "ativar" quando necessário. Diferente de agentes (que são tarefas), skills são conhecimentos.
|
|
1269
|
+
|
|
1270
|
+
## 9.2 Estrutura de um Skill
|
|
1271
|
+
|
|
1272
|
+
```markdown
|
|
1273
|
+
# [NOME DO SKILL]
|
|
1274
|
+
|
|
1275
|
+
## Activation Patterns
|
|
1276
|
+
|
|
1277
|
+
Quando este skill deve ser ativado:
|
|
1278
|
+
- [Pattern 1: palavras-chave ou contexto]
|
|
1279
|
+
- [Pattern 2]
|
|
1280
|
+
- [Pattern 3]
|
|
1281
|
+
|
|
1282
|
+
## Conhecimento Base
|
|
1283
|
+
|
|
1284
|
+
### [Área 1]
|
|
1285
|
+
[Informações essenciais]
|
|
1286
|
+
|
|
1287
|
+
### [Área 2]
|
|
1288
|
+
[Informações essenciais]
|
|
1289
|
+
|
|
1290
|
+
## Padrões e Templates
|
|
1291
|
+
|
|
1292
|
+
### Template 1: [Nome]
|
|
1293
|
+
|
|
1294
|
+
[template]
|
|
1295
|
+
|
|
1296
|
+
### Template 2: [Nome]
|
|
1297
|
+
|
|
1298
|
+
[template]
|
|
1299
|
+
|
|
1300
|
+
## Anti-Patterns
|
|
1301
|
+
|
|
1302
|
+
❌ [O que não fazer]
|
|
1303
|
+
❌ [O que não fazer]
|
|
1304
|
+
|
|
1305
|
+
## Referências
|
|
1306
|
+
|
|
1307
|
+
- [Link para documentação]
|
|
1308
|
+
- [Link para exemplos]
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
## 9.3 Skill: React/Next.js
|
|
1312
|
+
|
|
1313
|
+
```markdown
|
|
1314
|
+
# React/Next.js Skill
|
|
1315
|
+
|
|
1316
|
+
## Activation Patterns
|
|
1317
|
+
|
|
1318
|
+
- Criação de componentes React
|
|
1319
|
+
- Páginas Next.js
|
|
1320
|
+
- Server Components vs Client Components
|
|
1321
|
+
- App Router patterns
|
|
1322
|
+
|
|
1323
|
+
## Conhecimento Base
|
|
1324
|
+
|
|
1325
|
+
### Server vs Client Components
|
|
1326
|
+
|
|
1327
|
+
| Tipo | Quando usar | Marcação |
|
|
1328
|
+
|------|-------------|----------|
|
|
1329
|
+
| Server | Data fetching, acesso a DB | Default (sem marcação) |
|
|
1330
|
+
| Client | Interatividade, hooks, eventos | 'use client' no topo |
|
|
1331
|
+
|
|
1332
|
+
### Padrões de Componente
|
|
1333
|
+
|
|
1334
|
+
// Server Component (default)
|
|
1335
|
+
|
|
1336
|
+
export default async function Page() {
|
|
1337
|
+
|
|
1338
|
+
const data = await fetchData()
|
|
1339
|
+
|
|
1340
|
+
return <Component data={data} />
|
|
1341
|
+
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
// Client Component
|
|
1345
|
+
|
|
1346
|
+
'use client'
|
|
1347
|
+
|
|
1348
|
+
export function InteractiveComponent() {
|
|
1349
|
+
|
|
1350
|
+
const [state, setState] = useState()
|
|
1351
|
+
|
|
1352
|
+
return <button onClick={() => setState(...)}>...</button>
|
|
1353
|
+
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
### File-based Routing (App Router)
|
|
1357
|
+
|
|
1358
|
+
app/
|
|
1359
|
+
|
|
1360
|
+
├── page.tsx # /
|
|
1361
|
+
|
|
1362
|
+
├── about/page.tsx # /about
|
|
1363
|
+
|
|
1364
|
+
├── blog/
|
|
1365
|
+
|
|
1366
|
+
│ ├── page.tsx # /blog
|
|
1367
|
+
|
|
1368
|
+
│ └── [slug]/page.tsx # /blog/:slug
|
|
1369
|
+
|
|
1370
|
+
├── layout.tsx # Layout compartilhado
|
|
1371
|
+
|
|
1372
|
+
├── loading.tsx # Loading UI
|
|
1373
|
+
|
|
1374
|
+
├── error.tsx # Error boundary
|
|
1375
|
+
|
|
1376
|
+
└── not-found.tsx # 404
|
|
1377
|
+
|
|
1378
|
+
### Data Fetching Patterns
|
|
1379
|
+
|
|
1380
|
+
// Server Component - fetch direto
|
|
1381
|
+
|
|
1382
|
+
async function getData() {
|
|
1383
|
+
|
|
1384
|
+
const res = await fetch('https://api.example.com/data', {
|
|
1385
|
+
|
|
1386
|
+
cache: 'force-cache', // ou 'no-store', ou revalidate
|
|
1387
|
+
|
|
1388
|
+
})
|
|
1389
|
+
|
|
1390
|
+
return res.json()
|
|
1391
|
+
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
// Client Component - SWR ou TanStack Query
|
|
1395
|
+
|
|
1396
|
+
'use client'
|
|
1397
|
+
|
|
1398
|
+
import useSWR from 'swr'
|
|
1399
|
+
|
|
1400
|
+
function Profile() {
|
|
1401
|
+
|
|
1402
|
+
const { data, error, isLoading } = useSWR('/api/user', fetcher)
|
|
1403
|
+
|
|
1404
|
+
// ...
|
|
1405
|
+
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
## Anti-Patterns
|
|
1409
|
+
|
|
1410
|
+
❌ useState/useEffect em Server Components
|
|
1411
|
+
❌ fetch sem tratamento de erro
|
|
1412
|
+
❌ Props drilling excessivo (usar Context ou Zustand)
|
|
1413
|
+
❌ Componentes com mais de 200 linhas
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
## 9.4 Skill: TypeScript
|
|
1417
|
+
|
|
1418
|
+
```markdown
|
|
1419
|
+
# TypeScript Skill
|
|
1420
|
+
|
|
1421
|
+
## Activation Patterns
|
|
1422
|
+
|
|
1423
|
+
- Definição de tipos
|
|
1424
|
+
- Generics
|
|
1425
|
+
- Utility types
|
|
1426
|
+
- Type guards
|
|
1427
|
+
|
|
1428
|
+
## Conhecimento Base
|
|
1429
|
+
|
|
1430
|
+
### Tipos Básicos
|
|
1431
|
+
|
|
1432
|
+
// Primitivos
|
|
1433
|
+
|
|
1434
|
+
type Primitive = string | number | boolean | null | undefined
|
|
1435
|
+
|
|
1436
|
+
// Arrays
|
|
1437
|
+
|
|
1438
|
+
type StringArray = string[]
|
|
1439
|
+
|
|
1440
|
+
type NumberArray = Array<number>
|
|
1441
|
+
|
|
1442
|
+
// Objects
|
|
1443
|
+
|
|
1444
|
+
interface User {
|
|
1445
|
+
|
|
1446
|
+
id: string
|
|
1447
|
+
|
|
1448
|
+
name: string
|
|
1449
|
+
|
|
1450
|
+
email?: string // opcional
|
|
1451
|
+
|
|
1452
|
+
readonly createdAt: Date // imutável
|
|
1453
|
+
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
// Functions
|
|
1457
|
+
|
|
1458
|
+
type Handler = (event: Event) => void
|
|
1459
|
+
|
|
1460
|
+
type AsyncFetcher = <T>(url: string) => Promise<T>
|
|
1461
|
+
|
|
1462
|
+
### Utility Types
|
|
1463
|
+
|
|
1464
|
+
// Partial - todos opcionais
|
|
1465
|
+
|
|
1466
|
+
type PartialUser = Partial<User>
|
|
1467
|
+
|
|
1468
|
+
// Required - todos obrigatórios
|
|
1469
|
+
|
|
1470
|
+
type RequiredUser = Required<User>
|
|
1471
|
+
|
|
1472
|
+
// Pick - selecionar propriedades
|
|
1473
|
+
|
|
1474
|
+
type UserPreview = Pick<User, 'id' | 'name'>
|
|
1475
|
+
|
|
1476
|
+
// Omit - excluir propriedades
|
|
1477
|
+
|
|
1478
|
+
type UserWithoutEmail = Omit<User, 'email'>
|
|
1479
|
+
|
|
1480
|
+
// Record - objeto com chaves tipadas
|
|
1481
|
+
|
|
1482
|
+
type UserMap = Record<string, User>
|
|
1483
|
+
|
|
1484
|
+
### Generics
|
|
1485
|
+
|
|
1486
|
+
// Função genérica
|
|
1487
|
+
|
|
1488
|
+
function first<T>(arr: T[]): T | undefined {
|
|
1489
|
+
|
|
1490
|
+
return arr[0]
|
|
1491
|
+
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
// Interface genérica
|
|
1495
|
+
|
|
1496
|
+
interface Response<T> {
|
|
1497
|
+
|
|
1498
|
+
data: T
|
|
1499
|
+
|
|
1500
|
+
status: number
|
|
1501
|
+
|
|
1502
|
+
message: string
|
|
1503
|
+
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// Constraints
|
|
1507
|
+
|
|
1508
|
+
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
|
1509
|
+
|
|
1510
|
+
return obj[key]
|
|
1511
|
+
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
### Type Guards
|
|
1515
|
+
|
|
1516
|
+
// Type predicate
|
|
1517
|
+
|
|
1518
|
+
function isUser(value: unknown): value is User {
|
|
1519
|
+
|
|
1520
|
+
return (
|
|
1521
|
+
|
|
1522
|
+
typeof value === 'object' &&
|
|
1523
|
+
|
|
1524
|
+
value !== null &&
|
|
1525
|
+
|
|
1526
|
+
'id' in value &&
|
|
1527
|
+
|
|
1528
|
+
'name' in value
|
|
1529
|
+
|
|
1530
|
+
)
|
|
1531
|
+
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
// Discriminated unions
|
|
1535
|
+
|
|
1536
|
+
type Result<T> =
|
|
1537
|
+
|
|
1538
|
+
| { success: true; data: T } |
|
|
1539
|
+
| --- |
|
|
1540
|
+
| { success: false; error: string } |
|
|
1541
|
+
|
|
1542
|
+
function handleResult<T>(result: Result<T>) {
|
|
1543
|
+
|
|
1544
|
+
if (result.success) {
|
|
1545
|
+
|
|
1546
|
+
// [result.data](http://result.data) é T aqui
|
|
1547
|
+
|
|
1548
|
+
} else {
|
|
1549
|
+
|
|
1550
|
+
// result.error é string aqui
|
|
1551
|
+
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
## Anti-Patterns
|
|
1557
|
+
|
|
1558
|
+
❌ `any` - usar `unknown` e fazer type narrowing
|
|
1559
|
+
❌ Type assertions desnecessárias (`as`)
|
|
1560
|
+
❌ `@ts-ignore` sem comentário explicativo
|
|
1561
|
+
❌ Tipos inline complexos (extrair para type/interface)
|
|
1562
|
+
```
|
|
1563
|
+
|
|
1564
|
+
## 9.5 Skill: Testing
|
|
1565
|
+
|
|
1566
|
+
```markdown
|
|
1567
|
+
# Testing Skill
|
|
1568
|
+
|
|
1569
|
+
## Activation Patterns
|
|
1570
|
+
|
|
1571
|
+
- Criar testes unitários
|
|
1572
|
+
- Criar testes de integração
|
|
1573
|
+
- Mocking
|
|
1574
|
+
- Test coverage
|
|
1575
|
+
|
|
1576
|
+
## Conhecimento Base
|
|
1577
|
+
|
|
1578
|
+
### Estrutura de Teste (Vitest/Jest)
|
|
1579
|
+
|
|
1580
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest'
|
|
1581
|
+
|
|
1582
|
+
describe('ComponentName', () => {
|
|
1583
|
+
|
|
1584
|
+
beforeEach(() => {
|
|
1585
|
+
|
|
1586
|
+
// Setup antes de cada teste
|
|
1587
|
+
|
|
1588
|
+
})
|
|
1589
|
+
|
|
1590
|
+
it('should do something', () => {
|
|
1591
|
+
|
|
1592
|
+
// Arrange
|
|
1593
|
+
|
|
1594
|
+
const input = 'test'
|
|
1595
|
+
|
|
1596
|
+
// Act
|
|
1597
|
+
|
|
1598
|
+
const result = doSomething(input)
|
|
1599
|
+
|
|
1600
|
+
// Assert
|
|
1601
|
+
|
|
1602
|
+
expect(result).toBe('expected')
|
|
1603
|
+
|
|
1604
|
+
})
|
|
1605
|
+
|
|
1606
|
+
it('should handle edge case', () => {
|
|
1607
|
+
|
|
1608
|
+
expect(() => doSomething(null)).toThrow()
|
|
1609
|
+
|
|
1610
|
+
})
|
|
1611
|
+
|
|
1612
|
+
})
|
|
1613
|
+
|
|
1614
|
+
### Testing React Components
|
|
1615
|
+
|
|
1616
|
+
import { render, screen, fireEvent } from '@testing-library/react'
|
|
1617
|
+
|
|
1618
|
+
import { UserProfile } from './UserProfile'
|
|
1619
|
+
|
|
1620
|
+
describe('UserProfile', () => {
|
|
1621
|
+
|
|
1622
|
+
it('renders user name', () => {
|
|
1623
|
+
|
|
1624
|
+
render(<UserProfile user={{ name: 'John' }} />)
|
|
1625
|
+
|
|
1626
|
+
expect(screen.getByText('John')).toBeInTheDocument()
|
|
1627
|
+
|
|
1628
|
+
})
|
|
1629
|
+
|
|
1630
|
+
it('calls onEdit when button clicked', async () => {
|
|
1631
|
+
|
|
1632
|
+
const onEdit = vi.fn()
|
|
1633
|
+
|
|
1634
|
+
render(<UserProfile user={{ name: 'John' }} onEdit={onEdit} />)
|
|
1635
|
+
|
|
1636
|
+
[fireEvent.click](http://fireEvent.click)(screen.getByRole('button', { name: /edit/i }))
|
|
1637
|
+
|
|
1638
|
+
expect(onEdit).toHaveBeenCalledTimes(1)
|
|
1639
|
+
|
|
1640
|
+
})
|
|
1641
|
+
|
|
1642
|
+
})
|
|
1643
|
+
|
|
1644
|
+
### Mocking
|
|
1645
|
+
|
|
1646
|
+
// Mock de módulo
|
|
1647
|
+
|
|
1648
|
+
vi.mock('./api', () => ({
|
|
1649
|
+
|
|
1650
|
+
fetchUser: vi.fn().mockResolvedValue({ id: 1, name: 'John' })
|
|
1651
|
+
|
|
1652
|
+
}))
|
|
1653
|
+
|
|
1654
|
+
// Mock de função
|
|
1655
|
+
|
|
1656
|
+
const mockFn = vi.fn()
|
|
1657
|
+
|
|
1658
|
+
mockFn.mockReturnValue('value')
|
|
1659
|
+
|
|
1660
|
+
mockFn.mockResolvedValue('async value')
|
|
1661
|
+
|
|
1662
|
+
mockFn.mockImplementation((x) => x * 2)
|
|
1663
|
+
|
|
1664
|
+
// Verificar chamadas
|
|
1665
|
+
|
|
1666
|
+
expect(mockFn).toHaveBeenCalled()
|
|
1667
|
+
|
|
1668
|
+
expect(mockFn).toHaveBeenCalledWith('arg')
|
|
1669
|
+
|
|
1670
|
+
expect(mockFn).toHaveBeenCalledTimes(2)
|
|
1671
|
+
|
|
1672
|
+
## Padrões de Teste
|
|
1673
|
+
|
|
1674
|
+
| Tipo | Proporção | Foco |
|
|
1675
|
+
|------|-----------|------|
|
|
1676
|
+
| Unit | 70% | Funções isoladas |
|
|
1677
|
+
| Integration | 20% | Módulos juntos |
|
|
1678
|
+
| E2E | 10% | Fluxos completos |
|
|
1679
|
+
|
|
1680
|
+
## Anti-Patterns
|
|
1681
|
+
|
|
1682
|
+
❌ Testes que dependem de ordem de execução
|
|
1683
|
+
❌ Testes com side effects compartilhados
|
|
1684
|
+
❌ Mocking excessivo (testar implementação, não comportamento)
|
|
1685
|
+
❌ Testes flaky (resultados inconsistentes)
|
|
1686
|
+
```
|
|
1687
|
+
|
|
1688
|
+
---
|
|
1689
|
+
|
|
1690
|
+
# 10. Integração GitHub e CI/CD
|
|
1691
|
+
|
|
1692
|
+
## 10.1 GitHub Action para @claude
|
|
1693
|
+
|
|
1694
|
+
Instalar a action que permite mencionar @claude em PRs:
|
|
1695
|
+
|
|
1696
|
+
```bash
|
|
1697
|
+
claude /install-github-action
|
|
1698
|
+
```
|
|
1699
|
+
|
|
1700
|
+
## 10.2 Uso em Code Review
|
|
1701
|
+
|
|
1702
|
+
```
|
|
1703
|
+
# Em um comentário de PR:
|
|
1704
|
+
|
|
1705
|
+
@claude adiciona ao [CLAUDE.md](http://CLAUDE.md) a regra:
|
|
1706
|
+
"Nunca usar forEach para arrays grandes, preferir for...of"
|
|
1707
|
+
|
|
1708
|
+
# Claude vai:
|
|
1709
|
+
# 1. Abrir [CLAUDE.md](http://CLAUDE.md)
|
|
1710
|
+
# 2. Adicionar a regra na seção apropriada
|
|
1711
|
+
# 3. Commitar a mudança no PR
|
|
1712
|
+
```
|
|
1713
|
+
|
|
1714
|
+
## 10.3 GitHub Actions Workflow
|
|
1715
|
+
|
|
1716
|
+
```yaml
|
|
1717
|
+
# .github/workflows/ci.yml
|
|
1718
|
+
name: CI
|
|
1719
|
+
|
|
1720
|
+
on:
|
|
1721
|
+
push:
|
|
1722
|
+
branches: [main, develop]
|
|
1723
|
+
pull_request:
|
|
1724
|
+
branches: [main, develop]
|
|
1725
|
+
|
|
1726
|
+
jobs:
|
|
1727
|
+
validate:
|
|
1728
|
+
runs-on: ubuntu-latest
|
|
1729
|
+
steps:
|
|
1730
|
+
- uses: actions/checkout@v4
|
|
1731
|
+
|
|
1732
|
+
- name: Setup Node
|
|
1733
|
+
uses: actions/setup-node@v4
|
|
1734
|
+
with:
|
|
1735
|
+
node-version: '20'
|
|
1736
|
+
cache: 'npm'
|
|
1737
|
+
|
|
1738
|
+
- name: Install dependencies
|
|
1739
|
+
run: npm ci
|
|
1740
|
+
|
|
1741
|
+
- name: Type check
|
|
1742
|
+
run: npm run typecheck
|
|
1743
|
+
|
|
1744
|
+
- name: Lint
|
|
1745
|
+
run: npm run lint
|
|
1746
|
+
|
|
1747
|
+
- name: Test
|
|
1748
|
+
run: npm run test -- --coverage
|
|
1749
|
+
|
|
1750
|
+
- name: Build
|
|
1751
|
+
run: npm run build
|
|
1752
|
+
|
|
1753
|
+
- name: Upload coverage
|
|
1754
|
+
uses: codecov/codecov-action@v3
|
|
1755
|
+
if: always()
|
|
1756
|
+
|
|
1757
|
+
deploy-preview:
|
|
1758
|
+
needs: validate
|
|
1759
|
+
if: github.event_name == 'pull_request'
|
|
1760
|
+
runs-on: ubuntu-latest
|
|
1761
|
+
steps:
|
|
1762
|
+
- uses: actions/checkout@v4
|
|
1763
|
+
# Deploy preview steps...
|
|
1764
|
+
```
|
|
1765
|
+
|
|
1766
|
+
## 10.4 Compounding Engineering
|
|
1767
|
+
|
|
1768
|
+
Conceito de Dan Shipper: cada PR torna o time mais inteligente.
|
|
1769
|
+
|
|
1770
|
+
```
|
|
1771
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
1772
|
+
│ COMPOUNDING ENGINEERING │
|
|
1773
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
1774
|
+
│ │
|
|
1775
|
+
│ 1. Erro identificado durante code review │
|
|
1776
|
+
│ ↓ │
|
|
1777
|
+
│ 2. @claude adiciona regra ao [CLAUDE.md](http://CLAUDE.md) │
|
|
1778
|
+
│ ↓ │
|
|
1779
|
+
│ 3. Todos os Claudes (e humanos) aprendem │
|
|
1780
|
+
│ ↓ │
|
|
1781
|
+
│ 4. Erro nunca mais acontece │
|
|
1782
|
+
│ ↓ │
|
|
1783
|
+
│ 5. Qualidade do projeto aumenta continuamente │
|
|
1784
|
+
│ │
|
|
1785
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
1786
|
+
```
|
|
1787
|
+
|
|
1788
|
+
---
|
|
1789
|
+
|
|
1790
|
+
# 11. MCP Servers e Extensões
|
|
1791
|
+
|
|
1792
|
+
## 11.1 Configuração do .mcp.json
|
|
1793
|
+
|
|
1794
|
+
```json
|
|
1795
|
+
{
|
|
1796
|
+
"mcpServers": {
|
|
1797
|
+
"slack": {
|
|
1798
|
+
"command": "npx",
|
|
1799
|
+
"args": ["@anthropic/mcp-server-slack"],
|
|
1800
|
+
"env": {
|
|
1801
|
+
"SLACK_TOKEN": "${SLACK_TOKEN}"
|
|
1802
|
+
}
|
|
1803
|
+
},
|
|
1804
|
+
"github": {
|
|
1805
|
+
"command": "npx",
|
|
1806
|
+
"args": ["@anthropic/mcp-server-github"],
|
|
1807
|
+
"env": {
|
|
1808
|
+
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
|
|
1809
|
+
}
|
|
1810
|
+
},
|
|
1811
|
+
"notion": {
|
|
1812
|
+
"command": "npx",
|
|
1813
|
+
"args": ["@anthropic/mcp-server-notion"],
|
|
1814
|
+
"env": {
|
|
1815
|
+
"NOTION_TOKEN": "${NOTION_TOKEN}"
|
|
1816
|
+
}
|
|
1817
|
+
},
|
|
1818
|
+
"postgres": {
|
|
1819
|
+
"command": "npx",
|
|
1820
|
+
"args": ["@anthropic/mcp-server-postgres"],
|
|
1821
|
+
"env": {
|
|
1822
|
+
"DATABASE_URL": "${DATABASE_URL}"
|
|
1823
|
+
}
|
|
1824
|
+
},
|
|
1825
|
+
"sentry": {
|
|
1826
|
+
"command": "npx",
|
|
1827
|
+
"args": ["@anthropic/mcp-server-sentry"],
|
|
1828
|
+
"env": {
|
|
1829
|
+
"SENTRY_TOKEN": "${SENTRY_TOKEN}"
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
```
|
|
1835
|
+
|
|
1836
|
+
## 11.2 Casos de Uso
|
|
1837
|
+
|
|
1838
|
+
| MCP Server | Uso |
|
|
1839
|
+
| --- | --- |
|
|
1840
|
+
| Slack | Buscar discussões, postar updates |
|
|
1841
|
+
| GitHub | Criar issues, PRs, buscar código |
|
|
1842
|
+
| Notion | Ler specs, atualizar docs |
|
|
1843
|
+
| Postgres | Queries diretas, debug de dados |
|
|
1844
|
+
| Sentry | Ver erros em produção |
|
|
1845
|
+
|
|
1846
|
+
## 11.3 Chrome Extension
|
|
1847
|
+
|
|
1848
|
+
Para testes visuais automatizados:
|
|
1849
|
+
|
|
1850
|
+
```bash
|
|
1851
|
+
claude chrome install
|
|
1852
|
+
```
|
|
1853
|
+
|
|
1854
|
+
Claude pode:
|
|
1855
|
+
|
|
1856
|
+
- Abrir o app no browser
|
|
1857
|
+
- Testar UI visualmente
|
|
1858
|
+
- Verificar UX
|
|
1859
|
+
- Capturar screenshots
|
|
1860
|
+
|
|
1861
|
+
---
|
|
1862
|
+
|
|
1863
|
+
# 12. Verificação de Qualidade
|
|
1864
|
+
|
|
1865
|
+
## 12.1 Checklist de Qualidade
|
|
1866
|
+
|
|
1867
|
+
```markdown
|
|
1868
|
+
## Pre-PR Checklist
|
|
1869
|
+
|
|
1870
|
+
### Código
|
|
1871
|
+
- [ ] Build passa sem erros
|
|
1872
|
+
- [ ] Todos os testes passam
|
|
1873
|
+
- [ ] Lint sem erros
|
|
1874
|
+
- [ ] TypeScript sem erros
|
|
1875
|
+
- [ ] Sem console.logs
|
|
1876
|
+
- [ ] Sem código comentado
|
|
1877
|
+
|
|
1878
|
+
### Funcionalidade
|
|
1879
|
+
- [ ] Feature funciona como especificado
|
|
1880
|
+
- [ ] Edge cases tratados
|
|
1881
|
+
- [ ] Error handling adequado
|
|
1882
|
+
- [ ] Loading states implementados
|
|
1883
|
+
|
|
1884
|
+
### Performance
|
|
1885
|
+
- [ ] Sem re-renders desnecessários
|
|
1886
|
+
- [ ] Bundle size aceitável
|
|
1887
|
+
- [ ] Lazy loading onde apropriado
|
|
1888
|
+
|
|
1889
|
+
### Segurança
|
|
1890
|
+
- [ ] Sem dados sensíveis expostos
|
|
1891
|
+
- [ ] Input sanitizado
|
|
1892
|
+
- [ ] Auth/authz verificado
|
|
1893
|
+
|
|
1894
|
+
### Documentação
|
|
1895
|
+
- [ ] [CLAUDE.md](http://CLAUDE.md) atualizado se necessário
|
|
1896
|
+
- [ ] Comentários em código complexo
|
|
1897
|
+
- [ ] README atualizado se necessário
|
|
1898
|
+
```
|
|
1899
|
+
|
|
1900
|
+
## 12.2 Níveis de Verificação
|
|
1901
|
+
|
|
1902
|
+
```
|
|
1903
|
+
Nível 1: Automático (Hooks)
|
|
1904
|
+
├── Formatação (Prettier)
|
|
1905
|
+
├── Lint (ESLint)
|
|
1906
|
+
└── Type check (TypeScript)
|
|
1907
|
+
|
|
1908
|
+
Nível 2: Testes
|
|
1909
|
+
├── Unit tests
|
|
1910
|
+
├── Integration tests
|
|
1911
|
+
└── E2E tests (críticos)
|
|
1912
|
+
|
|
1913
|
+
Nível 3: Build
|
|
1914
|
+
├── Compilação
|
|
1915
|
+
├── Bundle analysis
|
|
1916
|
+
└── Tree shaking
|
|
1917
|
+
|
|
1918
|
+
Nível 4: Visual (Opcional)
|
|
1919
|
+
├── Chrome extension
|
|
1920
|
+
├── Storybook
|
|
1921
|
+
└── Visual regression
|
|
1922
|
+
|
|
1923
|
+
Nível 5: Produção
|
|
1924
|
+
├── Staging deploy
|
|
1925
|
+
├── Smoke tests
|
|
1926
|
+
└── Monitoring
|
|
1927
|
+
```
|
|
1928
|
+
|
|
1929
|
+
---
|
|
1930
|
+
|
|
1931
|
+
# 13. Templates de Arquivos
|
|
1932
|
+
|
|
1933
|
+
## 13.1 Template: Novo Componente React
|
|
1934
|
+
|
|
1935
|
+
```tsx
|
|
1936
|
+
// src/components/[ComponentName]/[ComponentName].tsx
|
|
1937
|
+
import { type FC } from 'react'
|
|
1938
|
+
import { cn } from '@/lib/utils'
|
|
1939
|
+
import type { [ComponentName]Props } from './types'
|
|
1940
|
+
|
|
1941
|
+
export const [ComponentName]: FC<[ComponentName]Props> = ({
|
|
1942
|
+
className,
|
|
1943
|
+
children,
|
|
1944
|
+
...props
|
|
1945
|
+
}) => {
|
|
1946
|
+
return (
|
|
1947
|
+
<div className={cn('', className)} {...props}>
|
|
1948
|
+
{children}
|
|
1949
|
+
</div>
|
|
1950
|
+
)
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
[ComponentName].displayName = '[ComponentName]'
|
|
1954
|
+
|
|
1955
|
+
// src/components/[ComponentName]/types.ts
|
|
1956
|
+
import type { HTMLAttributes, ReactNode } from 'react'
|
|
1957
|
+
|
|
1958
|
+
export interface [ComponentName]Props extends HTMLAttributes<HTMLDivElement> {
|
|
1959
|
+
children?: ReactNode
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
// src/components/[ComponentName]/index.ts
|
|
1963
|
+
export { [ComponentName] } from './[ComponentName]'
|
|
1964
|
+
export type { [ComponentName]Props } from './types'
|
|
1965
|
+
```
|
|
1966
|
+
|
|
1967
|
+
## 13.2 Template: Novo Hook
|
|
1968
|
+
|
|
1969
|
+
```tsx
|
|
1970
|
+
// src/hooks/use[HookName].ts
|
|
1971
|
+
import { useState, useCallback, useEffect } from 'react'
|
|
1972
|
+
|
|
1973
|
+
interface Use[HookName]Options {
|
|
1974
|
+
// opções do hook
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
interface Use[HookName]Return {
|
|
1978
|
+
// retorno do hook
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
export function use[HookName](options: Use[HookName]Options = {}): Use[HookName]Return {
|
|
1982
|
+
const [state, setState] = useState()
|
|
1983
|
+
|
|
1984
|
+
const handler = useCallback(() => {
|
|
1985
|
+
// lógica
|
|
1986
|
+
}, [])
|
|
1987
|
+
|
|
1988
|
+
useEffect(() => {
|
|
1989
|
+
// side effects
|
|
1990
|
+
return () => {
|
|
1991
|
+
// cleanup
|
|
1992
|
+
}
|
|
1993
|
+
}, [])
|
|
1994
|
+
|
|
1995
|
+
return {
|
|
1996
|
+
// retorno
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
```
|
|
2000
|
+
|
|
2001
|
+
## 13.3 Template: API Route (Next.js)
|
|
2002
|
+
|
|
2003
|
+
```tsx
|
|
2004
|
+
// app/api/[resource]/route.ts
|
|
2005
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2006
|
+
import { z } from 'zod'
|
|
2007
|
+
|
|
2008
|
+
const RequestSchema = z.object({
|
|
2009
|
+
// validação
|
|
2010
|
+
})
|
|
2011
|
+
|
|
2012
|
+
export async function GET(request: NextRequest) {
|
|
2013
|
+
try {
|
|
2014
|
+
// lógica
|
|
2015
|
+
return NextResponse.json({ data: result })
|
|
2016
|
+
} catch (error) {
|
|
2017
|
+
console.error('[API] Error:', error)
|
|
2018
|
+
return NextResponse.json(
|
|
2019
|
+
{ error: 'Internal server error' },
|
|
2020
|
+
{ status: 500 }
|
|
2021
|
+
)
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
export async function POST(request: NextRequest) {
|
|
2026
|
+
try {
|
|
2027
|
+
const body = await request.json()
|
|
2028
|
+
const validated = RequestSchema.parse(body)
|
|
2029
|
+
|
|
2030
|
+
// lógica
|
|
2031
|
+
|
|
2032
|
+
return NextResponse.json({ data: result }, { status: 201 })
|
|
2033
|
+
} catch (error) {
|
|
2034
|
+
if (error instanceof z.ZodError) {
|
|
2035
|
+
return NextResponse.json(
|
|
2036
|
+
{ error: 'Validation error', details: error.errors },
|
|
2037
|
+
{ status: 400 }
|
|
2038
|
+
)
|
|
2039
|
+
}
|
|
2040
|
+
console.error('[API] Error:', error)
|
|
2041
|
+
return NextResponse.json(
|
|
2042
|
+
{ error: 'Internal server error' },
|
|
2043
|
+
{ status: 500 }
|
|
2044
|
+
)
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
```
|
|
2048
|
+
|
|
2049
|
+
---
|
|
2050
|
+
|
|
2051
|
+
# 14. Checklist de Implementação
|
|
2052
|
+
|
|
2053
|
+
## Fase 1: Setup Básico (30 min)
|
|
2054
|
+
|
|
2055
|
+
- [ ] Instalar iTerm2/tmux
|
|
2056
|
+
- [ ] Configurar notificações do terminal
|
|
2057
|
+
- [ ] Instalar Claude Code CLI
|
|
2058
|
+
- [ ] Autenticar gh e claude
|
|
2059
|
+
- [ ] Criar [CLAUDE.md](http://CLAUDE.md) na raiz do projeto
|
|
2060
|
+
- [ ] Criar estrutura .claude/
|
|
2061
|
+
|
|
2062
|
+
## Fase 2: Configuração (1 hora)
|
|
2063
|
+
|
|
2064
|
+
- [ ] Criar .claude/settings.json
|
|
2065
|
+
- [ ] Criar /commit-push-pr command
|
|
2066
|
+
- [ ] Criar /code-simplifier command
|
|
2067
|
+
- [ ] Criar /test-and-fix command
|
|
2068
|
+
- [ ] Criar verify-app agent
|
|
2069
|
+
- [ ] Configurar hooks de formatação
|
|
2070
|
+
|
|
2071
|
+
## Fase 3: GitHub Integration (30 min)
|
|
2072
|
+
|
|
2073
|
+
- [ ] Instalar GitHub Action (claude /install-github-action)
|
|
2074
|
+
- [ ] Testar @claude em um PR de teste
|
|
2075
|
+
- [ ] Configurar CI/CD workflow
|
|
2076
|
+
- [ ] Setup de branch protection rules
|
|
2077
|
+
|
|
2078
|
+
## Fase 4: Workspace Paralelo (30 min)
|
|
2079
|
+
|
|
2080
|
+
- [ ] Criar workspace com múltiplos checkouts
|
|
2081
|
+
- [ ] Criar script claude-workspace
|
|
2082
|
+
- [ ] Testar 2-3 Claudes simultâneos
|
|
2083
|
+
- [ ] Configurar tmux/iTerm para workflow
|
|
2084
|
+
|
|
2085
|
+
## Fase 5: Prática Diária (Contínuo)
|
|
2086
|
+
|
|
2087
|
+
- [ ] Usar Plan Mode consistentemente
|
|
2088
|
+
- [ ] Usar /commit-push-pr regularmente
|
|
2089
|
+
- [ ] Atualizar [CLAUDE.md](http://CLAUDE.md) a cada erro
|
|
2090
|
+
- [ ] Experimentar com mais sessões paralelas
|
|
2091
|
+
- [ ] Criar novos commands para workflows repetidos
|
|
2092
|
+
|
|
2093
|
+
## Fase 6: Otimização (Contínuo)
|
|
2094
|
+
|
|
2095
|
+
- [ ] Adicionar skills específicos do projeto
|
|
2096
|
+
- [ ] Criar mais agents especializados
|
|
2097
|
+
- [ ] Adicionar MCP servers conforme necessário
|
|
2098
|
+
- [ ] Refinar [CLAUDE.md](http://CLAUDE.md) baseado em experiência
|
|
2099
|
+
- [ ] Documentar padrões descobertos
|
|
2100
|
+
|
|
2101
|
+
---
|
|
2102
|
+
|
|
2103
|
+
# 15. Troubleshooting
|
|
2104
|
+
|
|
2105
|
+
## 15.1 Problemas Comuns
|
|
2106
|
+
|
|
2107
|
+
### Claude não segue as regras do [CLAUDE.md](http://CLAUDE.md)
|
|
2108
|
+
|
|
2109
|
+
**Causa**: [CLAUDE.md](http://CLAUDE.md) muito longo ou mal estruturado.
|
|
2110
|
+
|
|
2111
|
+
**Solução**:
|
|
2112
|
+
|
|
2113
|
+
1. Manter [CLAUDE.md](http://CLAUDE.md) conciso (< 500 linhas)
|
|
2114
|
+
2. Usar formatação clara com headers
|
|
2115
|
+
3. Priorizar regras importantes no topo
|
|
2116
|
+
4. Usar emojis para destaque visual
|
|
2117
|
+
|
|
2118
|
+
### Hooks não executam
|
|
2119
|
+
|
|
2120
|
+
**Causa**: settings.json mal configurado.
|
|
2121
|
+
|
|
2122
|
+
**Solução**:
|
|
2123
|
+
|
|
2124
|
+
```bash
|
|
2125
|
+
# Verificar sintaxe
|
|
2126
|
+
cat .claude/settings.json | python -m json.tool
|
|
2127
|
+
|
|
2128
|
+
# Verificar localização
|
|
2129
|
+
ls -la .claude/
|
|
2130
|
+
```
|
|
2131
|
+
|
|
2132
|
+
### PRs com conflitos frequentes
|
|
2133
|
+
|
|
2134
|
+
**Causa**: Múltiplos Claudes trabalhando nos mesmos arquivos.
|
|
2135
|
+
|
|
2136
|
+
**Solução**:
|
|
2137
|
+
|
|
2138
|
+
1. Dividir tarefas por módulo/pasta
|
|
2139
|
+
2. Usar branches nomeadas claramente
|
|
2140
|
+
3. Fazer merges frequentes da main
|
|
2141
|
+
4. Comunicar escopo entre sessões
|
|
2142
|
+
|
|
2143
|
+
### Performance lenta do Claude
|
|
2144
|
+
|
|
2145
|
+
**Causa**: Contexto muito grande.
|
|
2146
|
+
|
|
2147
|
+
**Solução**:
|
|
2148
|
+
|
|
2149
|
+
1. Adicionar arquivos ao exclude no settings.json
|
|
2150
|
+
2. Usar .gitignore efetivo
|
|
2151
|
+
3. Limpar histórico de chat periodicamente
|
|
2152
|
+
4. Iniciar novas sessões para tarefas diferentes
|
|
2153
|
+
|
|
2154
|
+
### Claude "esquece" instruções
|
|
2155
|
+
|
|
2156
|
+
**Causa**: Contexto excedido ou sessão muito longa.
|
|
2157
|
+
|
|
2158
|
+
**Solução**:
|
|
2159
|
+
|
|
2160
|
+
1. Referir ao [CLAUDE.md](http://CLAUDE.md) explicitamente
|
|
2161
|
+
2. Iniciar nova sessão para tarefas longas
|
|
2162
|
+
3. Usar Plan Mode para recontextualizar
|
|
2163
|
+
4. Quebrar tarefas grandes em menores
|
|
2164
|
+
|
|
2165
|
+
## 15.2 Comandos de Debug
|
|
2166
|
+
|
|
2167
|
+
```bash
|
|
2168
|
+
# Verificar status do Claude Code
|
|
2169
|
+
claude --version
|
|
2170
|
+
claude status
|
|
2171
|
+
|
|
2172
|
+
# Verificar autenticação
|
|
2173
|
+
claude auth status
|
|
2174
|
+
gh auth status
|
|
2175
|
+
|
|
2176
|
+
# Logs de debug
|
|
2177
|
+
claude --debug
|
|
2178
|
+
|
|
2179
|
+
# Resetar configurações
|
|
2180
|
+
claude config reset
|
|
2181
|
+
```
|
|
2182
|
+
|
|
2183
|
+
---
|
|
2184
|
+
|
|
2185
|
+
# 📚 Referências
|
|
2186
|
+
|
|
2187
|
+
## Documentação Oficial
|
|
2188
|
+
|
|
2189
|
+
| Recurso | Link |
|
|
2190
|
+
| --- | --- |
|
|
2191
|
+
| Claude Code Docs | https://code.claude.com/docs |
|
|
2192
|
+
| Slash Commands | https://code.claude.com/docs/en/slash-commands |
|
|
2193
|
+
| Sub-agents | https://code.claude.com/docs/en/sub-agents |
|
|
2194
|
+
| Hooks | https://code.claude.com/docs/en/hooks-guide |
|
|
2195
|
+
| MCP Servers | https://code.claude.com/docs/en/mcp |
|
|
2196
|
+
|
|
2197
|
+
## Referências Externas
|
|
2198
|
+
|
|
2199
|
+
- Thread Original Boris Cherny: https://x.com/bcherny/
|
|
2200
|
+
- Compounding Engineering (Dan Shipper)
|
|
2201
|
+
- Continuous Claude v3: https://github.com/parcadei/Continuous-Claude-v3
|
|
2202
|
+
|
|
2203
|
+
---
|
|
2204
|
+
|
|
2205
|
+
# ✅ Conclusão
|
|
2206
|
+
|
|
2207
|
+
Este workflow combina o melhor de dois mundos:
|
|
2208
|
+
|
|
2209
|
+
**Do Boris Cherny:**
|
|
2210
|
+
|
|
2211
|
+
- Paralelismo com múltiplos Claudes
|
|
2212
|
+
- [CLAUDE.md](http://CLAUDE.md) como memória institucional
|
|
2213
|
+
- Plan Mode obrigatório
|
|
2214
|
+
- Verificação como multiplicador de qualidade
|
|
2215
|
+
|
|
2216
|
+
**Do Continuous Claude:**
|
|
2217
|
+
|
|
2218
|
+
- Skills modulares e reutilizáveis
|
|
2219
|
+
- Agents especializados
|
|
2220
|
+
- Self-improvement contínuo
|
|
2221
|
+
- Activation patterns inteligentes
|
|
2222
|
+
|
|
2223
|
+
**Resultado:**
|
|
2224
|
+
|
|
2225
|
+
Um desenvolvedor operando com a produtividade de um time inteiro, com qualidade consistente e aprendizado contínuo.
|
|
2226
|
+
|
|
2227
|
+
---
|
|
2228
|
+
|
|
2229
|
+
> **Versão**: 2.0
|
|
2230
|
+
**Última atualização**: Janeiro 2026
|
|
2231
|
+
**Autor**: Bruno Moreira - @zbrunomoreira
|
|
2232
|
+
>
|