sinapse-ai 9.3.0 → 10.0.0-rc.1
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/.claude/CLAUDE.md +60 -341
- package/.claude/hooks/enforce-git-push-authority.sh +25 -4
- package/.claude/hooks/verify-packages.cjs +83 -0
- package/.claude/rules/agent-authority.md +6 -0
- package/.claude/rules/agent-handoff.md +5 -0
- package/.claude/rules/cross-squad-routing.md +5 -0
- package/.claude/rules/hook-governance.md +7 -0
- package/.claude/rules/mandatory-delegation.md +24 -0
- package/.claude/rules/mcp-usage.md +3 -1
- package/.claude/rules/project-intelligence.md +63 -0
- package/.claude/rules/safe-collaboration.md +14 -2
- package/.claude/rules/security-data-protection.md +27 -0
- package/.claude/rules/squad-awareness.md +96 -68
- package/.claude/rules/tool-examples.md +6 -0
- package/.claude/rules/workflow-execution.md +7 -0
- package/.codex/agents/analyst.md +342 -71
- package/.codex/agents/architect.md +533 -68
- package/.codex/agents/data-engineer.md +530 -106
- package/.codex/agents/developer.md +657 -0
- package/.codex/agents/devops.md +639 -69
- package/.codex/agents/product-lead.md +362 -0
- package/.codex/agents/project-lead.md +405 -0
- package/.codex/agents/quality-gate.md +538 -0
- package/.codex/agents/sinapse-orqx.md +9 -7
- package/.codex/agents/sprint-lead.md +315 -0
- package/.codex/agents/squad-creator.md +402 -0
- package/.codex/agents/ux-design-expert.md +523 -0
- package/.codex/delegation-matrix.json +756 -44
- package/.codex/handoff-packet.schema.json +30 -6
- package/.sinapse-ai/core/code-intel/registry-syncer.js +56 -3
- package/.sinapse-ai/core/ids/registry-updater.js +6 -1
- package/.sinapse-ai/core/orchestration/terminal-spawner.js +2 -2
- package/.sinapse-ai/data/entity-registry.yaml +1024 -771
- package/.sinapse-ai/data/registry-update-log.jsonl +44 -0
- package/.sinapse-ai/development/agents/analyst.md +90 -0
- package/.sinapse-ai/development/agents/architect.md +78 -0
- package/.sinapse-ai/development/agents/data-engineer.md +38 -0
- package/.sinapse-ai/development/agents/developer.md +97 -0
- package/.sinapse-ai/development/agents/devops.md +121 -0
- package/.sinapse-ai/development/agents/product-lead.md +27 -0
- package/.sinapse-ai/development/agents/project-lead.md +28 -0
- package/.sinapse-ai/development/agents/quality-gate.md +89 -0
- package/.sinapse-ai/development/agents/sprint-lead/MEMORY.md +8 -0
- package/.sinapse-ai/development/agents/sprint-lead.md +28 -0
- package/.sinapse-ai/development/agents/squad-creator.md +58 -0
- package/.sinapse-ai/development/agents/ux-design-expert.md +28 -0
- package/.sinapse-ai/development/checklists/agent-quality-gate.md +27 -0
- package/.sinapse-ai/development/checklists/brownfield-compatibility-checklist.md +20 -0
- package/.sinapse-ai/development/checklists/code-review-checklist.md +106 -0
- package/.sinapse-ai/development/checklists/issue-triage-checklist.md +9 -0
- package/.sinapse-ai/development/checklists/memory-audit-checklist.md +16 -0
- package/.sinapse-ai/development/checklists/pr-quality-checklist.md +72 -0
- package/.sinapse-ai/development/checklists/security-deployment-checklist.md +54 -0
- package/.sinapse-ai/development/checklists/self-critique-checklist.md +19 -1
- package/.sinapse-ai/development/knowledge-base/agent-communication-protocol.md +127 -0
- package/.sinapse-ai/development/knowledge-base/database-scaling-patterns.md +374 -0
- package/.sinapse-ai/development/knowledge-base/environment-deployment-patterns.md +353 -0
- package/.sinapse-ai/development/knowledge-base/gotchas-patterns.md +224 -0
- package/.sinapse-ai/development/knowledge-base/infrastructure-decision-framework.md +221 -0
- package/.sinapse-ai/development/knowledge-base/security-pre-deploy-checklist.md +410 -0
- package/.sinapse-ai/development/knowledge-base/software-architecture-patterns.md +299 -0
- package/.sinapse-ai/development/knowledge-base/token-economy-guide.md +198 -0
- package/.sinapse-ai/development/skills/captcha-handler.md +82 -0
- package/.sinapse-ai/development/skills/chrome-brain.md +81 -0
- package/.sinapse-ai/development/skills/debug.md +57 -0
- package/.sinapse-ai/development/skills/deploy-readiness.md +93 -0
- package/.sinapse-ai/development/skills/fast-review.md +69 -0
- package/.sinapse-ai/development/skills/model-router.md +92 -0
- package/.sinapse-ai/development/skills/research-synthesis.md +77 -0
- package/.sinapse-ai/development/skills/security-scan.md +73 -0
- package/.sinapse-ai/development/skills/sinapse-methodology.md +175 -0
- package/.sinapse-ai/development/skills/story-fast-track.md +71 -0
- package/.sinapse-ai/development/skills/verify.md +53 -0
- package/.sinapse-ai/development/tasks/environment-promotion-pipeline.md +582 -0
- package/.sinapse-ai/development/tasks/generate-agent-handoff.md +223 -0
- package/.sinapse-ai/development/tasks/infrastructure-assessment.md +432 -0
- package/.sinapse-ai/development/tasks/load-testing-setup.md +611 -0
- package/.sinapse-ai/development/tasks/observability-blueprint.md +562 -0
- package/.sinapse-ai/development/templates/legal/breach-notification-tmpl.md +113 -0
- package/.sinapse-ai/development/templates/legal/privacy-policy-tmpl.md +93 -0
- package/.sinapse-ai/development/templates/legal/terms-of-service-tmpl.md +85 -0
- package/.sinapse-ai/development/templates/squad/agent-template.md +17 -4
- package/.sinapse-ai/development/templates/squad/checklist-template.md +13 -5
- package/.sinapse-ai/development/templates/squad/task-template.md +7 -0
- package/.sinapse-ai/development/templates/squad/workflow-template.yaml +7 -0
- package/.sinapse-ai/development/workflows/fast-track.yaml +87 -0
- package/.sinapse-ai/development/workflows/story-development-cycle.yaml +40 -1
- package/.sinapse-ai/hooks/ids-post-commit.js +22 -0
- package/.sinapse-ai/infrastructure/contracts/compatibility/README.md +42 -0
- package/.sinapse-ai/infrastructure/contracts/compatibility/sinapse-current.yaml +35 -0
- package/.sinapse-ai/infrastructure/scripts/pr-review-ai.js +16 -13
- package/.sinapse-ai/infrastructure/scripts/setup-project-infra.js +128 -0
- package/.sinapse-ai/infrastructure/scripts/test-discovery.js +8 -3
- package/.sinapse-ai/infrastructure/scripts/validate-codex-delegation.js +3 -1
- package/.sinapse-ai/infrastructure/scripts/validate-parity.js +76 -25
- package/.sinapse-ai/infrastructure/templates/config/env.example +16 -0
- package/.sinapse-ai/infrastructure/templates/config/gitignore-additions.tmpl +59 -0
- package/.sinapse-ai/infrastructure/templates/github/CODEOWNERS.template +12 -0
- package/.sinapse-ai/infrastructure/templates/github/PULL_REQUEST_TEMPLATE.md +29 -0
- package/.sinapse-ai/infrastructure/templates/github/ci-template.yml +77 -0
- package/.sinapse-ai/infrastructure/templates/github/issue-templates/bug_report.md +34 -0
- package/.sinapse-ai/infrastructure/templates/github/issue-templates/feature_request.md +19 -0
- package/.sinapse-ai/install-manifest.yaml +226 -63
- package/.sinapse-ai/internal/aiox-feature-map.md +270 -0
- package/README.md +26 -9
- package/bin/cli.js +348 -81
- package/bin/sinapse-graph.js +9 -0
- package/bin/sinapse-minimal.js +20 -9
- package/bin/sinapse.js +9 -0
- package/bin/utils/deprecation-warning.js +46 -0
- package/docs/chrome-brain-upgrade-plan.md +624 -0
- package/docs/codex-integration-process.md +22 -0
- package/docs/codex-parity-program.md +27 -0
- package/docs/framework/orqx-plan.md +1 -1
- package/docs/ide-integration.md +36 -0
- package/docs/installation/chrome-brain.md +17 -7
- package/docs/mega-upgrade-orchestration-plan.md +71 -0
- package/docs/pt/contributing.md +20 -0
- package/docs/research-synthesis-for-upgrade.md +511 -0
- package/docs/security-audit-report.md +306 -0
- package/package.json +11 -4
- package/packages/installer/src/detection/detect-project-type.js +181 -63
- package/packages/installer/src/installer/manifest-signature.js +32 -17
- package/packages/installer/src/wizard/i18n.js +12 -0
- package/packages/installer/src/wizard/index.js +119 -14
- package/packages/installer/src/wizard/questions.js +2 -3
- package/packages/installer/tests/unit/detection/detect-project-type.test.js +138 -1
- package/scripts/coverage-report-summary.js +169 -0
- package/scripts/generate-install-manifest.js +6 -2
- package/scripts/release-readiness.js +169 -0
- package/scripts/validate-install-docs.js +394 -0
- package/scripts/validate-no-external-refs.js +376 -0
- package/scripts/validate-squad-orqx.js +302 -0
- package/scripts/validate-story-meta.js +263 -0
- package/squads/claude-code-mastery/CHANGELOG.md +1 -1
- package/squads/claude-code-mastery/README.md +2 -2
- package/squads/claude-code-mastery/knowledge-base/claude-code-internals-reference.md +927 -0
- package/squads/claude-code-mastery/squad.yaml +1 -1
- package/squads/squad-artdir/README.md +90 -0
- package/squads/squad-artdir/agents/accessibility-guardian.md +184 -0
- package/squads/squad-artdir/agents/artdir-orqx.md +145 -0
- package/squads/squad-artdir/agents/color-psychologist.md +166 -0
- package/squads/squad-artdir/agents/cro-persuasion.md +161 -0
- package/squads/squad-artdir/agents/design-system-architect.md +100 -0
- package/squads/squad-artdir/agents/ia-architect.md +169 -0
- package/squads/squad-artdir/agents/interaction-designer.md +162 -0
- package/squads/squad-artdir/agents/layout-engineer.md +163 -0
- package/squads/squad-artdir/agents/motion-architect.md +185 -0
- package/squads/squad-artdir/agents/platform-aesthetic-director.md +84 -0
- package/squads/squad-artdir/agents/premium-packaging-strategist.md +107 -0
- package/squads/squad-artdir/agents/product-surface-director.md +86 -0
- package/squads/squad-artdir/agents/type-systemist.md +138 -0
- package/squads/squad-artdir/agents/visual-strategist.md +127 -0
- package/squads/squad-artdir/checklists/seven-pillars-validation-checklist.md +172 -0
- package/squads/squad-artdir/knowledge-base/case-nyo-ia-reference.md +289 -0
- package/squads/squad-artdir/knowledge-base/deliverables-templates.md +457 -0
- package/squads/squad-artdir/knowledge-base/motion-technique-catalog.md +247 -0
- package/squads/squad-artdir/knowledge-base/premium-packaging-principles.md +133 -0
- package/squads/squad-artdir/knowledge-base/psychological-toolkit.md +229 -0
- package/squads/squad-artdir/knowledge-base/saas-art-direction-canon.md +242 -0
- package/squads/squad-artdir/knowledge-base/seven-pillars-framework.md +289 -0
- package/squads/squad-artdir/knowledge-base/ten-pillars-framework.md +221 -0
- package/squads/squad-artdir/package.json +20 -0
- package/squads/squad-artdir/squad.yaml +271 -0
- package/squads/squad-artdir/tasks/audit-conversion.md +97 -0
- package/squads/squad-artdir/tasks/audit-drift-multi-surface.md +55 -0
- package/squads/squad-artdir/tasks/consult-saas-canon.md +54 -0
- package/squads/squad-artdir/tasks/create-art-direction-brief.md +110 -0
- package/squads/squad-artdir/tasks/create-premium-packaging-brief.md +61 -0
- package/squads/squad-artdir/tasks/create-wireflow.md +84 -0
- package/squads/squad-artdir/tasks/design-color-system.md +81 -0
- package/squads/squad-artdir/tasks/design-product-surface.md +60 -0
- package/squads/squad-artdir/tasks/design-token-system.md +58 -0
- package/squads/squad-artdir/tasks/diagnose-visual-language.md +92 -0
- package/squads/squad-artdir/tasks/first-5-minutes-choreography.md +65 -0
- package/squads/squad-artdir/tasks/specify-motion-system.md +84 -0
- package/squads/squad-artdir/tasks/validate-against-pillars.md +143 -0
- package/squads/squad-artdir/templates/art-direction-brief-template.md +215 -0
- package/squads/squad-artdir/workflows/conversion-audit-cycle.yaml +78 -0
- package/squads/squad-artdir/workflows/full-art-direction-cycle.yaml +98 -0
- package/squads/squad-artdir/workflows/saas-platform-art-direction-cycle.yaml +174 -0
- package/squads/squad-brand/knowledge-base/ai-visual-generation-canon.md +234 -0
- package/squads/squad-brand/knowledge-base/archetype-brand-mapping.md +12 -1
- package/squads/squad-brand/knowledge-base/brand-activism-cultural-branding.md +216 -0
- package/squads/squad-brand/knowledge-base/brand-audit-criteria.md +58 -0
- package/squads/squad-brand/knowledge-base/brand-digital-strategy.md +188 -0
- package/squads/squad-brand/knowledge-base/brand-legal-ip.md +222 -0
- package/squads/squad-brand/knowledge-base/brand-naming-framework.md +163 -0
- package/squads/squad-brand/knowledge-base/branding-master-reference.md +1001 -0
- package/squads/squad-brand/knowledge-base/color-psychology.md +25 -12
- package/squads/squad-brand/knowledge-base/employer-personal-branding.md +206 -0
- package/squads/squad-brand/knowledge-base/routing-catalog.md +34 -0
- package/squads/squad-brand/knowledge-base/sonic-branding-principles.md +6 -1
- package/squads/squad-brand/knowledge-base/typography-personality.md +34 -0
- package/squads/squad-brand/squad.yaml +20 -6
- package/squads/squad-claude/knowledge-base/context-window-optimization.md +334 -0
- package/squads/squad-claude/knowledge-base/knowledge-architecture-reference.md +403 -0
- package/squads/squad-claude/knowledge-base/memory-systems-reference.md +412 -0
- package/squads/squad-claude/knowledge-base/obsidian-claude-integration.md +423 -0
- package/squads/squad-claude/knowledge-base/retrieval-augmented-generation.md +320 -0
- package/squads/squad-claude/knowledge-base/skill-creation-patterns.md +380 -0
- package/squads/squad-claude/knowledge-base/swarm-orchestration-patterns.md +411 -0
- package/squads/squad-cloning/knowledge-base/clone-quality-assurance.md +211 -0
- package/squads/squad-cloning/knowledge-base/confidence-scoring.md +51 -0
- package/squads/squad-cloning/knowledge-base/cross-squad-deployment.md +47 -0
- package/squads/squad-cloning/knowledge-base/ethical-guidelines.md +237 -0
- package/squads/squad-cloning/knowledge-base/knowledge-graph-for-clones.md +295 -0
- package/squads/squad-cloning/knowledge-base/memory-architecture-for-clones.md +229 -0
- package/squads/squad-cloning/knowledge-base/multi-agent-deployment-patterns.md +320 -0
- package/squads/squad-cloning/knowledge-base/skill-standard-for-clones.md +262 -0
- package/squads/squad-cloning/knowledge-base/sop-extraction-guide.md +243 -0
- package/squads/squad-commercial/knowledge-base/account-based-selling.md +206 -0
- package/squads/squad-commercial/knowledge-base/ai-as-competitive-infrastructure.md +14 -0
- package/squads/squad-commercial/knowledge-base/ai-in-sales.md +199 -0
- package/squads/squad-commercial/knowledge-base/brazilian-sales-context.md +195 -0
- package/squads/squad-commercial/knowledge-base/customer-success-operations.md +83 -2
- package/squads/squad-commercial/knowledge-base/prospecting-pipeline-generation.md +69 -0
- package/squads/squad-commercial/knowledge-base/sales-enablement-playbook.md +260 -0
- package/squads/squad-commercial/knowledge-base/sales-methodology-comparison.md +185 -0
- package/squads/squad-commercial/knowledge-base/sales-revenue-master-reference.md +1123 -0
- package/squads/squad-content/knowledge-base/ai-native-content-loop.md +220 -0
- package/squads/squad-content/knowledge-base/brazilian-content-context.md +176 -0
- package/squads/squad-content/knowledge-base/competitor-analysis-methods.md +40 -1
- package/squads/squad-content/knowledge-base/content-architecture-taxonomy.md +206 -0
- package/squads/squad-content/knowledge-base/content-formats-encyclopedia.md +58 -1
- package/squads/squad-content/knowledge-base/content-references-bibliography.md +130 -0
- package/squads/squad-content/knowledge-base/content-strategy-master-reference.md +1097 -0
- package/squads/squad-content/knowledge-base/content-tech-stack.md +150 -0
- package/squads/squad-content/knowledge-base/copywriting-formulas-library.md +188 -0
- package/squads/squad-content/knowledge-base/email-newsletter-strategy.md +161 -0
- package/squads/squad-content/knowledge-base/platform-algorithm-intelligence.md +86 -1
- package/squads/squad-content/knowledge-base/signal-intelligence-v2.md +234 -0
- package/squads/squad-content/knowledge-base/social-algorithms-master-reference.md +1007 -0
- package/squads/squad-content/knowledge-base/task-ownership-map.md +235 -0
- package/squads/squad-content/knowledge-base/video-audio-content-playbook.md +218 -0
- package/squads/squad-content/squad.yaml +187 -27
- package/squads/squad-copy/knowledge-base/ai-copy-human-loop-canon.md +235 -0
- package/squads/squad-copy/knowledge-base/ai-copy-production.md +254 -0
- package/squads/squad-copy/knowledge-base/brazilian-copywriting-context.md +242 -0
- package/squads/squad-copy/knowledge-base/email-copywriting-system.md +299 -0
- package/squads/squad-copy/knowledge-base/landing-page-copy-architecture.md +267 -0
- package/squads/squad-copy/knowledge-base/power-words-catalog.md +205 -0
- package/squads/squad-copy/knowledge-base/seo-copywriting.md +255 -0
- package/squads/squad-copy/knowledge-base/video-script-copywriting.md +239 -0
- package/squads/squad-copy/squad.yaml +19 -4
- package/squads/squad-council/knowledge-base/brand-strategy-models.md +193 -0
- package/squads/squad-council/knowledge-base/growth-strategy-models.md +267 -0
- package/squads/squad-council/knowledge-base/innovation-disruption-frameworks.md +193 -0
- package/squads/squad-council/knowledge-base/market-analysis-frameworks.md +240 -0
- package/squads/squad-council/knowledge-base/organizational-leadership-models.md +212 -0
- package/squads/squad-council/knowledge-base/sales-strategy-models.md +215 -0
- package/squads/squad-courses/knowledge-base/course-launch-strategy.md +251 -0
- package/squads/squad-courses/knowledge-base/domain-advocacia-curriculum.md +385 -0
- package/squads/squad-courses/knowledge-base/domain-contabilidade-curriculum.md +266 -0
- package/squads/squad-courses/knowledge-base/platform-comparison.md +68 -0
- package/squads/squad-courses/knowledge-base/video-production-guide.md +70 -0
- package/squads/squad-cybersecurity/knowledge-base/cloud-security-reference.md +363 -0
- package/squads/squad-cybersecurity/knowledge-base/compliance-frameworks.md +273 -0
- package/squads/squad-cybersecurity/knowledge-base/database-security.md +438 -0
- package/squads/squad-cybersecurity/knowledge-base/incident-response-playbook.md +420 -0
- package/squads/squad-cybersecurity/knowledge-base/network-security-reference.md +477 -0
- package/squads/squad-cybersecurity/knowledge-base/penetration-testing-methodology.md +350 -0
- package/squads/squad-cybersecurity/knowledge-base/vulnerability-management.md +349 -0
- package/squads/squad-design/knowledge-base/brazilian-design-context.md +223 -0
- package/squads/squad-design/knowledge-base/component-api-patterns.md +208 -4
- package/squads/squad-design/knowledge-base/cross-surface-token-canon.md +209 -0
- package/squads/squad-design/knowledge-base/design-system-master-reference.md +1302 -0
- package/squads/squad-design/knowledge-base/design-systems-frameworks.md +91 -1
- package/squads/squad-design/knowledge-base/responsive-modern-css.md +96 -4
- package/squads/squad-design/knowledge-base/wcag-aria-reference.md +117 -5
- package/squads/squad-design/knowledge-base/web-performance-reference.md +127 -4
- package/squads/squad-design/squad.yaml +19 -4
- package/squads/squad-finance/knowledge-base/brazilian-taxation.md +263 -0
- package/squads/squad-finance/knowledge-base/contabilidade-master-reference.md +998 -0
- package/squads/squad-finance/knowledge-base/finance-master-reference.md +946 -0
- package/squads/squad-finance/knowledge-base/financial-reporting-analysis.md +316 -0
- package/squads/squad-finance/knowledge-base/fintech-brazilian-context.md +242 -0
- package/squads/squad-finance/knowledge-base/fpa-planning-frameworks.md +286 -0
- package/squads/squad-finance/knowledge-base/ma-and-transactions.md +285 -0
- package/squads/squad-finance/knowledge-base/risk-management.md +233 -0
- package/squads/squad-finance/knowledge-base/startups-venture-capital.md +337 -0
- package/squads/squad-growth/knowledge-base/ai-growth-playbook.md +216 -0
- package/squads/squad-growth/knowledge-base/attribution-models.md +78 -0
- package/squads/squad-growth/knowledge-base/brazilian-growth-context.md +208 -0
- package/squads/squad-growth/knowledge-base/community-led-growth.md +175 -0
- package/squads/squad-growth/knowledge-base/content-marketing-flywheel.md +190 -0
- package/squads/squad-growth/knowledge-base/email-lifecycle-framework.md +192 -0
- package/squads/squad-growth/knowledge-base/growth-frameworks-catalog.md +82 -0
- package/squads/squad-growth/knowledge-base/growth-master-reference.md +1168 -0
- package/squads/squad-growth/knowledge-base/routing-catalog.md +53 -11
- package/squads/squad-paidmedia/knowledge-base/audiences-segmentation-deep.md +285 -0
- package/squads/squad-paidmedia/knowledge-base/creative-strategy-deep.md +294 -0
- package/squads/squad-paidmedia/knowledge-base/google-ads-account-architecture.md +87 -0
- package/squads/squad-paidmedia/knowledge-base/meta-ads-campaign-architecture.md +76 -0
- package/squads/squad-paidmedia/knowledge-base/paid-media-metrics-reference.md +117 -0
- package/squads/squad-paidmedia/knowledge-base/paid-traffic-master-reference.md +1308 -0
- package/squads/squad-paidmedia/knowledge-base/routing-catalog.md +95 -18
- package/squads/squad-paidmedia/knowledge-base/traffic-masters-frameworks.md +71 -0
- package/squads/squad-product/knowledge-base/brazilian-product-context.md +284 -0
- package/squads/squad-product/knowledge-base/discovery-methodology-playbook.md +141 -0
- package/squads/squad-product/knowledge-base/pm-frameworks-reference.md +125 -9
- package/squads/squad-product/knowledge-base/product-analytics-formulas.md +72 -0
- package/squads/squad-product/knowledge-base/product-led-growth-reference.md +155 -13
- package/squads/squad-product/knowledge-base/product-market-fit-framework.md +222 -0
- package/squads/squad-product/knowledge-base/routing-catalog.md +32 -0
- package/squads/squad-research/knowledge-base/agentic-second-brain-reference.md +591 -0
- package/squads/squad-research/knowledge-base/ai-augmented-research.md +212 -0
- package/squads/squad-research/knowledge-base/brazilian-market-research-sources.md +197 -0
- package/squads/squad-research/knowledge-base/community-platforms-reference.md +786 -0
- package/squads/squad-research/knowledge-base/community-research-methods.md +194 -0
- package/squads/squad-research/knowledge-base/mixed-methods-research-design.md +168 -0
- package/squads/squad-research/knowledge-base/network-effects-analysis.md +192 -0
- package/squads/squad-research/knowledge-base/qualitative-research-deep-methods.md +202 -0
- package/squads/squad-research/knowledge-base/quantitative-research-methods.md +208 -0
- package/squads/squad-research/knowledge-base/research-frameworks-encyclopedia.md +40 -0
- package/squads/squad-research/knowledge-base/research-synthesis-frameworks.md +223 -0
- package/squads/squad-storytelling/knowledge-base/brand-mythology-framework.md +236 -0
- package/squads/squad-storytelling/knowledge-base/brazilian-storytelling-context.md +237 -0
- package/squads/squad-storytelling/knowledge-base/data-storytelling.md +232 -0
- package/squads/squad-storytelling/knowledge-base/improv-storytelling.md +226 -0
- package/squads/squad-storytelling/knowledge-base/persuasion-narrative-techniques.md +269 -0
- package/squads/squad-storytelling/knowledge-base/social-movement-narratives.md +191 -0
- package/squads/squad-storytelling/knowledge-base/video-storytelling.md +252 -0
- package/squads/claude-code-mastery/data/swarm-orchestration-patterns.yaml +0 -378
- package/squads/squad-animations/knowledge-base/framer-motion-complete-reference.md +0 -710
- package/squads/squad-animations/knowledge-base/web-animations-api-view-transitions.md +0 -478
package/.claude/CLAUDE.md
CHANGED
|
@@ -1,384 +1,103 @@
|
|
|
1
1
|
# CLAUDE.md - SINAPSE
|
|
2
2
|
|
|
3
|
-
Este arquivo configura o comportamento do Claude Code ao trabalhar neste repositório.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
8
3
|
## Constitution
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
Full doc: `.sinapse-ai/constitution.md`. Gates auto-block violations.
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
**Princípios fundamentais:**
|
|
15
|
-
|
|
16
|
-
| Artigo | Princípio | Severidade |
|
|
17
|
-
|--------|-----------|------------|
|
|
7
|
+
| Art. | Principle | Severity |
|
|
8
|
+
|------|-----------|----------|
|
|
18
9
|
| I | CLI First | NON-NEGOTIABLE |
|
|
19
10
|
| II | Agent Authority | NON-NEGOTIABLE |
|
|
20
|
-
| III | Documentation-First
|
|
11
|
+
| III | Documentation-First | NON-NEGOTIABLE |
|
|
21
12
|
| IV | No Invention | MUST |
|
|
22
13
|
| V | Quality First | MUST |
|
|
23
14
|
| VI | Absolute Imports | SHOULD |
|
|
24
|
-
| VII |
|
|
15
|
+
| VII | Metrics Accuracy | NON-NEGOTIABLE |
|
|
25
16
|
| VIII | Mandatory Delegation | NON-NEGOTIABLE |
|
|
26
17
|
| IX | Safe Collaboration | NON-NEGOTIABLE |
|
|
27
18
|
| X | Security & Data Protection | NON-NEGOTIABLE |
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
34
|
-
## Language Configuration
|
|
35
|
-
|
|
36
|
-
Language preference is handled by Claude Code's native `language` setting (v2.1.0+).
|
|
37
|
-
Configure in `~/.claude/settings.json` (global) or `.claude/settings.json` (project):
|
|
38
|
-
|
|
39
|
-
```json
|
|
40
|
-
{ "language": "portuguese" }
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
The installer writes this automatically during `npx sinapse-ai install`. No language config in `core-config.yaml`.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
48
|
-
## Premissa Arquitetural: CLI First
|
|
49
|
-
|
|
50
|
-
O SINAPSE segue uma hierarquia clara de prioridades que deve guiar **TODAS** as decisões:
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
CLI First → Observability Second → UI Third
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
| Camada | Prioridade | Descrição |
|
|
57
|
-
|--------|------------|-----------|
|
|
58
|
-
| **CLI** | Máxima | Onde a inteligência vive. Toda execução, decisões e automação. |
|
|
59
|
-
| **Observability** | Secundária | Observar e monitorar o que acontece no CLI em tempo real. |
|
|
60
|
-
| **UI** | Terciária | Gestão pontual e visualizações quando necessário. |
|
|
61
|
-
|
|
62
|
-
### Princípios Derivados
|
|
63
|
-
|
|
64
|
-
1. **A CLI é a fonte da verdade** - Dashboards apenas observam, nunca controlam
|
|
65
|
-
2. **Funcionalidades novas devem funcionar 100% via CLI** antes de ter qualquer UI
|
|
66
|
-
3. **A UI nunca deve ser requisito** para operação do sistema
|
|
67
|
-
4. **Observabilidade serve para entender** o que o CLI está fazendo, não para controlá-lo
|
|
68
|
-
5. **Ao decidir onde implementar algo**, sempre prefira CLI > Observability > UI
|
|
69
|
-
|
|
70
|
-
> **Referência formal:** Constitution Artigo I - CLI First (NON-NEGOTIABLE)
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
75
|
-
## Estrutura do Projeto
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
sinapse-ai/
|
|
79
|
-
├── .sinapse-ai/ # Core do framework
|
|
80
|
-
│ ├── core/ # Módulos principais (orchestration, memory, etc.)
|
|
81
|
-
│ ├── data/ # Knowledge base, entity registry
|
|
82
|
-
│ ├── development/ # Agents, tasks, templates, checklists, scripts
|
|
83
|
-
│ └── infrastructure/ # CI/CD templates, scripts
|
|
84
|
-
├── bin/ # CLI executables (sinapse-init.js, sinapse.js)
|
|
85
|
-
├── docs/ # Documentação
|
|
86
|
-
│ └── stories/ # Development stories (active/, completed/)
|
|
87
|
-
├── packages/ # Shared packages
|
|
88
|
-
├── pro/ # Pro submodule (proprietary)
|
|
89
|
-
├── squads/ # Squad expansions
|
|
90
|
-
└── tests/ # Testes
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
96
|
-
## Framework vs Project Boundary
|
|
97
|
-
|
|
98
|
-
O SINAPSE usa um modelo de 4 camadas (L1-L4) para separar artefatos do framework e do projeto. Deny rules em `.claude/settings.json` reforçam isso deterministicamente.
|
|
99
|
-
|
|
100
|
-
| Camada | Mutabilidade | Paths | Notas |
|
|
101
|
-
|--------|-------------|-------|-------|
|
|
102
|
-
| **L1** Framework Core | NEVER modify | `.sinapse-ai/core/`, `.sinapse-ai/constitution.md`, `bin/sinapse.js`, `bin/sinapse-init.js` | Protegido por deny rules |
|
|
103
|
-
| **L2** Framework Templates | NEVER modify | `.sinapse-ai/development/tasks/`, `.sinapse-ai/development/templates/`, `.sinapse-ai/development/checklists/`, `.sinapse-ai/development/workflows/`, `.sinapse-ai/infrastructure/` | Extend-only |
|
|
104
|
-
| **L3** Project Config | Mutable (exceptions) | `.sinapse-ai/data/`, `agents/*/MEMORY.md`, `core-config.yaml` | Allow rules permitem |
|
|
105
|
-
| **L4** Project Runtime | ALWAYS modify | `docs/stories/`, `packages/`, `squads/`, `tests/` | Trabalho do projeto |
|
|
106
|
-
|
|
107
|
-
**Toggle:** `core-config.yaml` → `boundary.frameworkProtection: true/false` controla se deny rules são ativas (default: true para projetos, false para contribuidores do framework).
|
|
108
|
-
|
|
109
|
-
> **Referência formal:** `.claude/settings.json` (deny/allow rules), `.claude/rules/agent-authority.md`
|
|
20
|
+
## CLI First
|
|
110
21
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
114
|
-
## Sistema de Agentes
|
|
115
|
-
|
|
116
|
-
### Ativação de Agentes
|
|
117
|
-
Use `@agent-name` ou `/SINAPSE:agents:agent-name`:
|
|
118
|
-
|
|
119
|
-
| Agente | Persona | Escopo Principal |
|
|
120
|
-
|--------|---------|------------------|
|
|
121
|
-
| `@developer` | Pixel | Implementacao de codigo |
|
|
122
|
-
| `@quality-gate` | Litmus | Testes e qualidade |
|
|
123
|
-
| `@architect` | Stratum | Arquitetura e design tecnico |
|
|
124
|
-
| `@project-lead` | Beacon | Product Management |
|
|
125
|
-
| `@product-lead` | Axis | Product Owner, stories/epics |
|
|
126
|
-
| `@sprint-lead` | Sync | Scrum Master |
|
|
127
|
-
| `@analyst` | Scope | Pesquisa e analise |
|
|
128
|
-
| `@data-engineer` | Tensor | Database design |
|
|
129
|
-
| `@ux-design-expert` | Mosaic | UX/UI design |
|
|
130
|
-
| `@devops` | Pipeline | CI/CD, git push (EXCLUSIVO) |
|
|
131
|
-
|
|
132
|
-
### Comandos de Agentes
|
|
133
|
-
Use prefixo `*` para comandos:
|
|
134
|
-
- `*help` - Mostrar comandos disponíveis
|
|
135
|
-
- `*create-story` - Criar story de desenvolvimento
|
|
136
|
-
- `*task {name}` - Executar task específica
|
|
137
|
-
- `*exit` - Sair do modo agente
|
|
138
|
-
|
|
139
|
-
### Mapeamento Agente → Codebase
|
|
22
|
+
`CLI First → Observability Second → UI Third`. New features MUST work 100% via CLI before any UI.
|
|
140
23
|
|
|
141
|
-
|
|
142
|
-
|--------|----------------------|
|
|
143
|
-
| `@developer` | `packages/`, `.sinapse-ai/core/`, `bin/` |
|
|
144
|
-
| `@architect` | `docs/architecture/`, system design |
|
|
145
|
-
| `@data-engineer` | `packages/db/`, migrations, schema |
|
|
146
|
-
| `@quality-gate` | `tests/`, `*.test.js`, quality gates |
|
|
147
|
-
| `@product-lead` | Stories, epics, requirements |
|
|
148
|
-
| `@devops` | `.github/`, CI/CD, git operations |
|
|
24
|
+
## Project Structure
|
|
149
25
|
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
153
|
-
## Documentation-First Development (NON-NEGOTIABLE)
|
|
154
|
-
|
|
155
|
-
1. **Pipeline automatico** - Todo briefing segue: Epic → Story → Validacao → Implementacao
|
|
156
|
-
2. **Story validada obrigatoria** - Nenhum codigo sem story com status >= Ready
|
|
157
|
-
3. **Trabalhe a partir de stories** - Todo desenvolvimento começa com uma story em `docs/stories/`
|
|
158
|
-
4. **Atualize progresso** - Marque checkboxes conforme completa: `[ ]` → `[x]`
|
|
159
|
-
5. **Rastreie mudanças** - Mantenha a seção File List na story
|
|
160
|
-
6. **Siga critérios** - Implemente exatamente o que os acceptance criteria especificam
|
|
161
|
-
|
|
162
|
-
### Workflow de Story
|
|
163
26
|
```
|
|
164
|
-
|
|
27
|
+
.sinapse-ai/ # Framework core, data, agents, tasks, templates
|
|
28
|
+
bin/ # CLI executables
|
|
29
|
+
docs/stories/ # Development stories
|
|
30
|
+
packages/ # Shared packages
|
|
31
|
+
squads/ # Squad expansions
|
|
32
|
+
tests/ # Tests
|
|
165
33
|
```
|
|
166
34
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<!-- PROJECT-CUSTOMIZED: Safe to modify for your project -->
|
|
170
|
-
## Padrões de Código
|
|
35
|
+
## Framework Boundary (L1-L4)
|
|
171
36
|
|
|
172
|
-
|
|
37
|
+
| Layer | Mutability | Key Paths |
|
|
38
|
+
|-------|-----------|-----------|
|
|
39
|
+
| L1 Core | NEVER | `.sinapse-ai/core/`, `bin/sinapse*.js` |
|
|
40
|
+
| L2 Templates | NEVER | `.sinapse-ai/development/{tasks,templates,checklists,workflows}/` |
|
|
41
|
+
| L3 Config | Mutable | `.sinapse-ai/data/`, `core-config.yaml` |
|
|
42
|
+
| L4 Runtime | ALWAYS | `docs/stories/`, `packages/`, `squads/`, `tests/` |
|
|
173
43
|
|
|
174
|
-
|
|
175
|
-
|------|-----------|---------|
|
|
176
|
-
| Componentes | PascalCase | `WorkflowList` |
|
|
177
|
-
| Hooks | prefixo `use` | `useWorkflowOperations` |
|
|
178
|
-
| Arquivos | kebab-case | `workflow-list.tsx` |
|
|
179
|
-
| Constantes | SCREAMING_SNAKE_CASE | `MAX_RETRIES` |
|
|
180
|
-
| Interfaces | PascalCase + sufixo | `WorkflowListProps` |
|
|
44
|
+
## Agents
|
|
181
45
|
|
|
182
|
-
|
|
183
|
-
**Sempre use imports absolutos.** Nunca use imports relativos.
|
|
184
|
-
```typescript
|
|
185
|
-
// ✓ Correto
|
|
186
|
-
import { useStore } from '@/stores/feature/store'
|
|
46
|
+
Use `@agent-name` or `/SINAPSE:agents:agent-name`. Commands: `*help`, `*create-story`, `*task {name}`, `*exit`.
|
|
187
47
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
48
|
+
| Agent | Persona | Scope |
|
|
49
|
+
|-------|---------|-------|
|
|
50
|
+
| @developer | Pixel | Code implementation |
|
|
51
|
+
| @quality-gate | Litmus | Testing & quality |
|
|
52
|
+
| @architect | Stratum | Architecture |
|
|
53
|
+
| @project-lead | Beacon | Product Management |
|
|
54
|
+
| @product-lead | Axis | Product Owner |
|
|
55
|
+
| @sprint-lead | Sync | Scrum Master |
|
|
56
|
+
| @analyst | Scope | Research |
|
|
57
|
+
| @data-engineer | Tensor | Database |
|
|
58
|
+
| @ux-design-expert | Mosaic | UX/UI |
|
|
59
|
+
| @devops | Pipeline | CI/CD, push (EXCLUSIVE) |
|
|
200
60
|
|
|
201
|
-
|
|
202
|
-
- Sem `any` - Use tipos apropriados ou `unknown` com type guards
|
|
203
|
-
- Sempre defina interface de props para componentes
|
|
204
|
-
- Use `as const` para objetos/arrays constantes
|
|
205
|
-
- Tipos de ref explícitos: `useRef<HTMLDivElement>(null)`
|
|
61
|
+
## Documentation-First (NON-NEGOTIABLE)
|
|
206
62
|
|
|
207
|
-
|
|
208
|
-
```typescript
|
|
209
|
-
try {
|
|
210
|
-
// Operation
|
|
211
|
-
} catch (error) {
|
|
212
|
-
logger.error(`Failed to ${operation}`, { error })
|
|
213
|
-
throw new Error(`Failed to ${operation}: ${error instanceof Error ? error.message : 'Unknown'}`)
|
|
214
|
-
}
|
|
215
|
-
```
|
|
63
|
+
Pipeline: Epic → Story → Validation → Implementation. No code without a story at status >= Ready.
|
|
216
64
|
|
|
217
|
-
|
|
65
|
+
## Code Patterns
|
|
218
66
|
|
|
219
|
-
|
|
220
|
-
|
|
67
|
+
- **Naming:** PascalCase components, `use` prefix hooks, kebab-case files, SCREAMING_SNAKE constants
|
|
68
|
+
- **Imports:** Always absolute (`@/...`), never relative. Order: React → external → UI → utils → stores → features → CSS
|
|
69
|
+
- **TypeScript:** No `any`, always define props interfaces, `as const` for constants
|
|
70
|
+
- **Commits:** Conventional Commits + story ref: `feat: feature [Story 2.1]`
|
|
71
|
+
- **Push:** Only `@devops` can push to remote
|
|
221
72
|
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
npm test # Rodar testes
|
|
225
|
-
npm run test:coverage # Testes com cobertura
|
|
226
|
-
npm run lint # ESLint
|
|
227
|
-
npm run typecheck # TypeScript
|
|
228
|
-
```
|
|
73
|
+
## Tests
|
|
229
74
|
|
|
230
|
-
### Quality Gates (Pre-Push)
|
|
231
|
-
Antes de push, todos os checks devem passar:
|
|
232
75
|
```bash
|
|
233
|
-
npm run lint
|
|
234
|
-
npm run typecheck # TypeScript
|
|
235
|
-
npm test # Jest
|
|
76
|
+
npm test && npm run lint && npm run typecheck
|
|
236
77
|
```
|
|
237
78
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
<!-- PROJECT-CUSTOMIZED: Safe to modify for your project -->
|
|
241
|
-
## Convenções Git
|
|
242
|
-
|
|
243
|
-
### Commits
|
|
244
|
-
Seguir Conventional Commits:
|
|
245
|
-
- `feat:` - Nova funcionalidade
|
|
246
|
-
- `fix:` - Correção de bug
|
|
247
|
-
- `docs:` - Documentação
|
|
248
|
-
- `test:` - Testes
|
|
249
|
-
- `chore:` - Manutenção
|
|
250
|
-
- `refactor:` - Refatoração
|
|
251
|
-
|
|
252
|
-
**Referencie story ID:** `feat: implement feature [Story 2.1]`
|
|
253
|
-
|
|
254
|
-
### Branches
|
|
255
|
-
- `main` - Branch principal
|
|
256
|
-
- `feat/*` - Features
|
|
257
|
-
- `fix/*` - Correções
|
|
258
|
-
- `docs/*` - Documentação
|
|
259
|
-
|
|
260
|
-
### Push Authority
|
|
261
|
-
**Apenas `@devops` pode fazer push para remote.**
|
|
79
|
+
## Tool Usage
|
|
262
80
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
266
|
-
## Otimização Claude Code
|
|
267
|
-
|
|
268
|
-
### Uso de Ferramentas
|
|
269
|
-
| Tarefa | Use | Não Use |
|
|
270
|
-
|--------|-----|---------|
|
|
271
|
-
| Buscar conteúdo | `Grep` tool | `grep`/`rg` no bash |
|
|
272
|
-
| Ler arquivos | `Read` tool | `cat`/`head`/`tail` |
|
|
273
|
-
| Editar arquivos | `Edit` tool | `sed`/`awk` |
|
|
274
|
-
| Buscar arquivos | `Glob` tool | `find` |
|
|
275
|
-
| Operações complexas | `Task` tool | Múltiplos comandos manuais |
|
|
81
|
+
Use Grep (not grep), Read (not cat), Edit (not sed), Glob (not find). Prefer native tools over MCP. Tool registry: `.sinapse-ai/data/tool-registry.yaml`.
|
|
276
82
|
|
|
277
|
-
|
|
278
|
-
- Prefira chamadas de ferramentas em batch
|
|
279
|
-
- Use execução paralela para operações independentes
|
|
280
|
-
- Cache dados frequentemente acessados durante a sessão
|
|
83
|
+
## Context Management
|
|
281
84
|
|
|
282
|
-
### Context Management (NOG-18 + TOK-4A)
|
|
283
|
-
- Use `/compact` when context feels heavy or approaching limits
|
|
284
|
-
- Context brackets (SYNAPSE) replaced by native compaction
|
|
285
|
-
- Agent memory persists in `.sinapse-ai/development/agents/{id}/MEMORY.md`
|
|
286
85
|
- Rules with `paths:` frontmatter only load when working on matching files
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
- Rastreie progresso da story durante a sessão
|
|
291
|
-
- Atualize checkboxes imediatamente após completar tasks
|
|
292
|
-
- Mantenha contexto da story atual sendo trabalhada
|
|
293
|
-
- Salve estado importante antes de operações longas
|
|
294
|
-
|
|
295
|
-
### Recuperação de Erros
|
|
296
|
-
- Sempre forneça sugestões de recuperação para falhas
|
|
297
|
-
- Inclua contexto do erro em mensagens ao usuário
|
|
298
|
-
- Sugira procedimentos de rollback quando apropriado
|
|
299
|
-
- Documente quaisquer correções manuais necessárias
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
<!-- PROJECT-CUSTOMIZED: Safe to modify for your project -->
|
|
304
|
-
## Comandos Frequentes
|
|
305
|
-
|
|
306
|
-
### Desenvolvimento
|
|
307
|
-
```bash
|
|
308
|
-
npm run dev # Iniciar desenvolvimento
|
|
309
|
-
npm test # Rodar testes
|
|
310
|
-
npm run lint # Verificar estilo
|
|
311
|
-
npm run typecheck # Verificar tipos
|
|
312
|
-
npm run build # Build produção
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### SINAPSE
|
|
316
|
-
```bash
|
|
317
|
-
npx sinapse-ai install # Instalar SINAPSE
|
|
318
|
-
npx sinapse-ai doctor # Diagnóstico do sistema
|
|
319
|
-
npx sinapse-ai info # Informações do sistema
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
### Dashboard (apps/dashboard/)
|
|
323
|
-
```bash
|
|
324
|
-
cd apps/dashboard
|
|
325
|
-
npm install
|
|
326
|
-
npm run dev # Desenvolvimento
|
|
327
|
-
npm run build # Build produção
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
<!-- FRAMEWORK-OWNED: Generated by SINAPSE installer, do not customize -->
|
|
333
|
-
## MCP Usage
|
|
334
|
-
|
|
335
|
-
Ver `.claude/rules/mcp-usage.md` para regras detalhadas.
|
|
336
|
-
|
|
337
|
-
**Resumo:**
|
|
338
|
-
- Preferir ferramentas nativas do Claude Code sobre MCP
|
|
339
|
-
- MCP Docker Gateway apenas quando explicitamente necessário
|
|
340
|
-
- `@devops` gerencia toda infraestrutura MCP
|
|
341
|
-
|
|
342
|
-
---
|
|
86
|
+
- Agent handoff compacts to ~379 tokens on switch
|
|
87
|
+
- Agent memory in `.sinapse-ai/development/agents/{id}/MEMORY.md`
|
|
88
|
+
- **Memory as hints:** Memory entries are hints, NOT ground truth. Always verify against actual codebase before acting on remembered facts.
|
|
343
89
|
|
|
344
|
-
|
|
345
|
-
## Tool Selection Guidance
|
|
90
|
+
## Token Economy & Response Format (NON-NEGOTIABLE)
|
|
346
91
|
|
|
347
|
-
|
|
92
|
+
Auto-applied to all agents: `~/.claude/rules/token-economy.md` + `~/.claude/rules/response-format.md`. Compact at 60%, model route haiku/sonnet/opus, no preamble, no trailing summary.
|
|
348
93
|
|
|
349
|
-
|
|
350
|
-
|------|-------------|---------|
|
|
351
|
-
| **1** (Always) | Session start | Read, Write, Edit, Bash, Grep, Glob, Task |
|
|
352
|
-
| **2** (Deferred) | Agent activation | git, coderabbit, context7, supabase |
|
|
353
|
-
| **3** (Deferred) | Via tool search | EXA, Playwright, Apify, Nogic, Code-Graph |
|
|
94
|
+
## Delegation & Anti-Hallucination
|
|
354
95
|
|
|
355
|
-
|
|
356
|
-
-
|
|
357
|
-
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
- Non-essential servers (EXA, Apify, Playwright) load on-demand via tool search
|
|
361
|
-
|
|
362
|
-
**Tool Examples (TOK-4B):** Concrete input examples improve tool selection accuracy by +18pp. See `.claude/rules/tool-examples.md` for examples of top-10 tools. Full registry: `.sinapse-ai/data/mcp-tool-examples.yaml`. ADR-5: examples for always-loaded tools only, search for deferred tools.
|
|
363
|
-
|
|
364
|
-
**Runtime capabilities:** `.sinapse/runtime-capabilities.json` (generated by capability-detection.js)
|
|
365
|
-
|
|
366
|
-
---
|
|
367
|
-
|
|
368
|
-
<!-- PROJECT-CUSTOMIZED: Safe to modify for your project -->
|
|
369
|
-
## Debug
|
|
370
|
-
|
|
371
|
-
### Habilitar Debug
|
|
372
|
-
```bash
|
|
373
|
-
export SINAPSE_DEBUG=true
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
### Logs
|
|
377
|
-
```bash
|
|
378
|
-
tail -f .sinapse/logs/agent.log
|
|
379
|
-
```
|
|
96
|
+
- Persona switch for sequential work, sub-agent only for parallel (20K+ tokens each)
|
|
97
|
+
- Model routing: `haiku` routine, `sonnet` standard, `opus` complex
|
|
98
|
+
- Sub-agents announce their model for visual verification via statusline
|
|
99
|
+
- `npm view {pkg}` before adding deps. Cite file:line for claims.
|
|
100
|
+
- Mark uncertain claims with [NEEDS VERIFICATION]. Compact at 60%.
|
|
380
101
|
|
|
381
102
|
---
|
|
382
|
-
|
|
383
|
-
*SINAPSE Claude Code Configuration v4.0*
|
|
384
|
-
*CLI First | Observability Second | UI Third*
|
|
103
|
+
*SINAPSE v6.0 — CLI First | Observability Second | UI Third*
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# enforce-git-push-authority.sh
|
|
3
|
-
# PreToolUse hook: blocks "git push" commands in Bash tool
|
|
4
|
-
#
|
|
3
|
+
# PreToolUse hook: blocks "git push" commands in Bash tool unless active agent is @devops
|
|
4
|
+
# Detects active agent via .sinapse/session-state.json (same pattern as enforce-delegation.cjs)
|
|
5
5
|
# Uses node (not jq) for JSON parsing — works on Windows/Git Bash
|
|
6
|
-
# FAIL-CLOSED: if parsing fails, blocks the command
|
|
7
|
-
# Hardened
|
|
6
|
+
# FAIL-CLOSED: if parsing fails OR session-state is missing/unreadable, blocks the command
|
|
7
|
+
# Hardened v3: adds real agent detection (Story 10.15), retains indirect-execution checks
|
|
8
8
|
|
|
9
9
|
INPUT=$(cat)
|
|
10
10
|
|
|
11
|
+
# Resolve project root consistently with other hooks
|
|
12
|
+
PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
|
13
|
+
|
|
14
|
+
# Detect active agent from session state (fail-closed: empty string on any error)
|
|
15
|
+
AGENT=$(node -e "
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
try {
|
|
19
|
+
const p = path.join(process.argv[1], '.sinapse', 'session-state.json');
|
|
20
|
+
const s = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
21
|
+
console.log(s.lastAgent || '');
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.log('');
|
|
24
|
+
}
|
|
25
|
+
" "$PROJECT_ROOT" 2>/dev/null)
|
|
26
|
+
|
|
27
|
+
# If active agent is @devops, allow the command immediately (AC 1)
|
|
28
|
+
if [ "$AGENT" = "devops" ]; then
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
11
32
|
# Extract command from JSON using node (available on all SINAPSE systems)
|
|
12
33
|
COMMAND=$(echo "$INPUT" | node -e "
|
|
13
34
|
let d='';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* verify-packages.cjs — Slopsquatting Prevention Hook
|
|
4
|
+
*
|
|
5
|
+
* Blocks `npm install`/`npm add` commands that reference packages
|
|
6
|
+
* not found on the npm registry. Prevents installation of hallucinated
|
|
7
|
+
* (fabricated) packages that attackers may register with malicious code.
|
|
8
|
+
*
|
|
9
|
+
* Research: 19.7% of packages recommended by LLMs are fabricated.
|
|
10
|
+
* Source: arXiv study, 576K samples across 16 models.
|
|
11
|
+
*
|
|
12
|
+
* Hook type: PreToolUse (Bash)
|
|
13
|
+
* Exit 0 = allow, Exit 2 = block
|
|
14
|
+
*/
|
|
15
|
+
'use strict';
|
|
16
|
+
|
|
17
|
+
const { execSync } = require('child_process');
|
|
18
|
+
|
|
19
|
+
let input = '';
|
|
20
|
+
process.stdin.setEncoding('utf8');
|
|
21
|
+
process.stdin.on('data', (d) => { input += d; });
|
|
22
|
+
process.stdin.on('end', () => {
|
|
23
|
+
try {
|
|
24
|
+
const data = JSON.parse(input);
|
|
25
|
+
const command = (data.tool_input && data.tool_input.command) || '';
|
|
26
|
+
|
|
27
|
+
// Only check direct npm install/add commands (not text in PR bodies, etc.)
|
|
28
|
+
// Skip if command is gh, curl, echo, or other non-npm commands
|
|
29
|
+
const trimmed = command.trim();
|
|
30
|
+
if (trimmed.startsWith('gh ') || trimmed.startsWith('curl ') || trimmed.startsWith('echo ')) process.exit(0);
|
|
31
|
+
const installMatch = trimmed.match(/^npm\s+(install|add|i)\s+(.+)/m);
|
|
32
|
+
if (!installMatch) process.exit(0);
|
|
33
|
+
|
|
34
|
+
const argsStr = installMatch[2];
|
|
35
|
+
|
|
36
|
+
// Extract package names, skipping flags (--save-dev, -D, etc.)
|
|
37
|
+
const tokens = argsStr.split(/\s+/).filter(t => !t.startsWith('-'));
|
|
38
|
+
if (tokens.length === 0) process.exit(0);
|
|
39
|
+
|
|
40
|
+
const failed = [];
|
|
41
|
+
for (const token of tokens) {
|
|
42
|
+
// Strip version specifier: pkg@1.0.0 -> pkg, @org/pkg@^2 -> @org/pkg
|
|
43
|
+
let pkgName;
|
|
44
|
+
if (token.startsWith('@')) {
|
|
45
|
+
// Scoped package: @org/pkg@version
|
|
46
|
+
const slashIdx = token.indexOf('/');
|
|
47
|
+
if (slashIdx === -1) continue; // malformed, skip
|
|
48
|
+
const afterSlash = token.substring(slashIdx + 1);
|
|
49
|
+
const atIdx = afterSlash.indexOf('@');
|
|
50
|
+
pkgName = atIdx > 0
|
|
51
|
+
? token.substring(0, slashIdx + 1 + atIdx)
|
|
52
|
+
: token;
|
|
53
|
+
} else {
|
|
54
|
+
const atIdx = token.indexOf('@');
|
|
55
|
+
pkgName = atIdx > 0 ? token.substring(0, atIdx) : token;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Skip if it looks like a local path or URL
|
|
59
|
+
if (pkgName.startsWith('.') || pkgName.startsWith('/') || pkgName.includes('://')) continue;
|
|
60
|
+
if (pkgName.endsWith('.tgz') || pkgName.endsWith('.tar.gz')) continue;
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
execSync(`npm view "${pkgName}" name`, { timeout: 8000, stdio: 'pipe' });
|
|
64
|
+
} catch {
|
|
65
|
+
failed.push(pkgName);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (failed.length > 0) {
|
|
70
|
+
const names = failed.map(n => `'${n}'`).join(', ');
|
|
71
|
+
const msg = failed.length === 1
|
|
72
|
+
? `BLOCKED: Package ${names} not found on npm. This may be a hallucinated package (slopsquatting).`
|
|
73
|
+
: `BLOCKED: Packages ${names} not found on npm. These may be hallucinated packages (slopsquatting).`;
|
|
74
|
+
process.stderr.write(msg + '\n');
|
|
75
|
+
process.exit(2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
process.exit(0);
|
|
79
|
+
} catch {
|
|
80
|
+
// Fail-open: if hook crashes, allow the operation
|
|
81
|
+
process.exit(0);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- ".claude/hooks/**"
|
|
4
|
+
- ".claude/settings.json"
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# Hook Governance Rules
|
|
2
8
|
|
|
3
9
|
> Applies to ALL agents. Hooks are the enforcement layer of the Constitution.
|
|
@@ -8,6 +14,7 @@
|
|
|
8
14
|
| Hook | Purpose | Behavior |
|
|
9
15
|
|------|---------|----------|
|
|
10
16
|
| `enforce-git-push-authority.sh` | Art. II — Only @devops can push | BLOCK (deny) |
|
|
17
|
+
| `verify-packages.cjs` | Security — Block hallucinated npm packages (slopsquatting) | BLOCK (exit 2) |
|
|
11
18
|
| `sql-governance.py` | Security — Block dangerous SQL | BLOCK (exit 2) |
|
|
12
19
|
| `enforce-delegation.cjs` | Art. VIII — Orchestrators can't execute | BLOCK (exit 2) |
|
|
13
20
|
|
|
@@ -91,6 +91,30 @@ Everything OUTSIDE their orchestration domain MUST be delegated.
|
|
|
91
91
|
- Saying "vou fazer isso eu mesmo" instead of delegating
|
|
92
92
|
- Absorbing a request and executing it instead of routing
|
|
93
93
|
|
|
94
|
+
## Universal Auto-Routing (users should NEVER call agents manually)
|
|
95
|
+
|
|
96
|
+
Users are NOT AI experts. The system MUST understand natural language and route automatically.
|
|
97
|
+
|
|
98
|
+
**On EVERY user message (not just orchestrator):**
|
|
99
|
+
1. Detect the domain of the request
|
|
100
|
+
2. If a specialist exists → delegate automatically (no confirmation needed)
|
|
101
|
+
3. Brief acknowledgment: "Delegando para @specialist..."
|
|
102
|
+
4. Return the result to the user
|
|
103
|
+
|
|
104
|
+
**Auto-detect project state on first interaction:**
|
|
105
|
+
- Check for `.sinapse-ai/` → SINAPSE-managed (continue SDC)
|
|
106
|
+
- Check for `package.json` or `.git` → Brownfield (run quick tech scan first)
|
|
107
|
+
- Empty directory → Greenfield (ask project type, scaffold)
|
|
108
|
+
|
|
109
|
+
**Cross-agent handoff (automatic, never ask user):**
|
|
110
|
+
- Agent needs git push → auto-delegate to @devops
|
|
111
|
+
- Agent needs tests → auto-delegate to @quality-gate
|
|
112
|
+
- Agent needs schema → auto-delegate to @data-engineer
|
|
113
|
+
- Agent needs story → auto-create via fast-track or @sprint-lead
|
|
114
|
+
- Agent needs architecture decision → auto-delegate to @architect
|
|
115
|
+
|
|
94
116
|
## Enforcement
|
|
95
117
|
|
|
96
118
|
Any response from an orchestrator that contains direct domain work (code, schema, copy, etc.) without having first delegated to the appropriate specialist is a **constitutional violation** and must be corrected immediately.
|
|
119
|
+
|
|
120
|
+
Any response that asks the user to manually invoke an agent (showing `@agent-name` or `/SINAPSE:agents:...` commands) instead of auto-routing is a **UX violation** — the system should just do it.
|