timsquad 2.1.0 → 3.4.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/README.ko.md +288 -0
- package/README.md +170 -763
- package/dist/commands/compile.d.ts +3 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +170 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/daemon.d.ts +7 -0
- package/dist/commands/daemon.d.ts.map +1 -0
- package/dist/commands/daemon.js +229 -0
- package/dist/commands/daemon.js.map +1 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +235 -14
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/full.js +2 -2
- package/dist/commands/full.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +118 -22
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/knowledge.d.ts +3 -0
- package/dist/commands/knowledge.d.ts.map +1 -0
- package/dist/commands/knowledge.js +316 -0
- package/dist/commands/knowledge.js.map +1 -0
- package/dist/commands/log.d.ts +27 -0
- package/dist/commands/log.d.ts.map +1 -1
- package/dist/commands/log.js +965 -0
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/meta-index.d.ts +3 -0
- package/dist/commands/meta-index.d.ts.map +1 -0
- package/dist/commands/meta-index.js +401 -0
- package/dist/commands/meta-index.js.map +1 -0
- package/dist/commands/metrics.d.ts.map +1 -1
- package/dist/commands/metrics.js +239 -4
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/retro.js +154 -6
- package/dist/commands/retro.js.map +1 -1
- package/dist/commands/skills.d.ts +12 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +231 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/upgrade.d.ts +8 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +292 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/workflow.d.ts +3 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +607 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/daemon/context-writer.d.ts +16 -0
- package/dist/daemon/context-writer.d.ts.map +1 -0
- package/dist/daemon/context-writer.js +35 -0
- package/dist/daemon/context-writer.js.map +1 -0
- package/dist/daemon/entry.d.ts +7 -0
- package/dist/daemon/entry.d.ts.map +1 -0
- package/dist/daemon/entry.js +17 -0
- package/dist/daemon/entry.js.map +1 -0
- package/dist/daemon/event-queue.d.ts +52 -0
- package/dist/daemon/event-queue.d.ts.map +1 -0
- package/dist/daemon/event-queue.js +255 -0
- package/dist/daemon/event-queue.js.map +1 -0
- package/dist/daemon/file-watcher.d.ts +19 -0
- package/dist/daemon/file-watcher.d.ts.map +1 -0
- package/dist/daemon/file-watcher.js +87 -0
- package/dist/daemon/file-watcher.js.map +1 -0
- package/dist/daemon/index.d.ts +29 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +296 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/jsonl-watcher.d.ts +49 -0
- package/dist/daemon/jsonl-watcher.d.ts.map +1 -0
- package/dist/daemon/jsonl-watcher.js +258 -0
- package/dist/daemon/jsonl-watcher.js.map +1 -0
- package/dist/daemon/meta-cache.d.ts +63 -0
- package/dist/daemon/meta-cache.d.ts.map +1 -0
- package/dist/daemon/meta-cache.js +249 -0
- package/dist/daemon/meta-cache.js.map +1 -0
- package/dist/daemon/session-state.d.ts +19 -0
- package/dist/daemon/session-state.d.ts.map +1 -0
- package/dist/daemon/session-state.js +132 -0
- package/dist/daemon/session-state.js.map +1 -0
- package/dist/daemon/shutdown.d.ts +21 -0
- package/dist/daemon/shutdown.d.ts.map +1 -0
- package/dist/daemon/shutdown.js +164 -0
- package/dist/daemon/shutdown.js.map +1 -0
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-composer.d.ts +38 -0
- package/dist/lib/agent-composer.d.ts.map +1 -0
- package/dist/lib/agent-composer.js +128 -0
- package/dist/lib/agent-composer.js.map +1 -0
- package/dist/lib/agent-generator.d.ts +22 -0
- package/dist/lib/agent-generator.d.ts.map +1 -0
- package/dist/lib/agent-generator.js +150 -0
- package/dist/lib/agent-generator.js.map +1 -0
- package/dist/lib/ast-parser.d.ts +11 -0
- package/dist/lib/ast-parser.d.ts.map +1 -0
- package/dist/lib/ast-parser.js +282 -0
- package/dist/lib/ast-parser.js.map +1 -0
- package/dist/lib/compile-rules.d.ts +66 -0
- package/dist/lib/compile-rules.d.ts.map +1 -0
- package/dist/lib/compile-rules.js +114 -0
- package/dist/lib/compile-rules.js.map +1 -0
- package/dist/lib/compiler.d.ts +105 -0
- package/dist/lib/compiler.d.ts.map +1 -0
- package/dist/lib/compiler.js +368 -0
- package/dist/lib/compiler.js.map +1 -0
- package/dist/lib/config.d.ts +7 -2
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +34 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/meta-index.d.ts +19 -0
- package/dist/lib/meta-index.d.ts.map +1 -0
- package/dist/lib/meta-index.js +573 -0
- package/dist/lib/meta-index.js.map +1 -0
- package/dist/lib/project.js +1 -1
- package/dist/lib/project.js.map +1 -1
- package/dist/lib/skill-generator.d.ts +32 -0
- package/dist/lib/skill-generator.d.ts.map +1 -0
- package/dist/lib/skill-generator.js +187 -0
- package/dist/lib/skill-generator.js.map +1 -0
- package/dist/lib/template.d.ts +16 -2
- package/dist/lib/template.d.ts.map +1 -1
- package/dist/lib/template.js +115 -20
- package/dist/lib/template.js.map +1 -1
- package/dist/lib/ui-index.d.ts +12 -0
- package/dist/lib/ui-index.d.ts.map +1 -0
- package/dist/lib/ui-index.js +239 -0
- package/dist/lib/ui-index.js.map +1 -0
- package/dist/lib/ui-parser.d.ts +12 -0
- package/dist/lib/ui-parser.d.ts.map +1 -0
- package/dist/lib/ui-parser.js +472 -0
- package/dist/lib/ui-parser.js.map +1 -0
- package/dist/lib/update-check.d.ts +6 -0
- package/dist/lib/update-check.d.ts.map +1 -0
- package/dist/lib/update-check.js +121 -0
- package/dist/lib/update-check.js.map +1 -0
- package/dist/lib/upgrade-backup.d.ts +33 -0
- package/dist/lib/upgrade-backup.d.ts.map +1 -0
- package/dist/lib/upgrade-backup.js +101 -0
- package/dist/lib/upgrade-backup.js.map +1 -0
- package/dist/lib/version.d.ts +19 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +35 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/lib/workflow-state.d.ts +48 -0
- package/dist/lib/workflow-state.d.ts.map +1 -0
- package/dist/lib/workflow-state.js +67 -0
- package/dist/lib/workflow-state.js.map +1 -0
- package/dist/types/config.d.ts +103 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +184 -9
- package/dist/types/config.js.map +1 -1
- package/dist/types/feedback.d.ts +7 -0
- package/dist/types/feedback.d.ts.map +1 -1
- package/dist/types/feedback.js +1 -1
- package/dist/types/feedback.js.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/meta-index.d.ts +146 -0
- package/dist/types/meta-index.d.ts.map +1 -0
- package/dist/types/meta-index.js +7 -0
- package/dist/types/meta-index.js.map +1 -0
- package/dist/types/project.d.ts +19 -3
- package/dist/types/project.d.ts.map +1 -1
- package/dist/types/project.js +23 -0
- package/dist/types/project.js.map +1 -1
- package/dist/types/task-log.d.ts +208 -0
- package/dist/types/task-log.d.ts.map +1 -0
- package/dist/types/task-log.js +6 -0
- package/dist/types/task-log.js.map +1 -0
- package/dist/types/ui-meta.d.ts +118 -0
- package/dist/types/ui-meta.d.ts.map +1 -0
- package/dist/types/ui-meta.js +7 -0
- package/dist/types/ui-meta.js.map +1 -0
- package/package.json +12 -4
- package/templates/base/agents/base/tsq-architect.md +68 -0
- package/templates/base/agents/base/tsq-dba.md +56 -0
- package/templates/base/agents/base/tsq-designer.md +72 -0
- package/templates/base/agents/base/tsq-developer.md +67 -0
- package/templates/base/agents/base/tsq-qa.md +55 -0
- package/templates/base/agents/base/tsq-security.md +65 -0
- package/templates/base/agents/overlays/domain/general-web/_common.md +11 -0
- package/templates/base/agents/overlays/domain/mobile/_common.md +13 -0
- package/templates/base/agents/overlays/platform/claude-code.md +12 -0
- package/templates/base/config.template.yaml +213 -0
- package/templates/base/knowledge/checklists/accessibility.md +37 -0
- package/templates/base/knowledge/checklists/architecture-review.md +28 -0
- package/templates/base/knowledge/checklists/database-standards.md +84 -0
- package/templates/base/knowledge/checklists/design-reference.md +97 -0
- package/templates/base/knowledge/checklists/security.md +50 -0
- package/templates/base/knowledge/checklists/ssot-validation.md +19 -0
- package/templates/base/knowledge/domains/_template.md +16 -0
- package/templates/base/knowledge/platforms/_template.md +16 -0
- package/templates/base/knowledge/templates/sequence-report.md +44 -0
- package/templates/base/knowledge/templates/task-result.md +105 -0
- package/templates/base/skills/_template/SKILL.md +59 -0
- package/templates/base/skills/_template/references/_template.md +35 -0
- package/templates/base/skills/_template/rules/_sections.md +34 -0
- package/templates/base/skills/_template/rules/_template.md +32 -0
- package/templates/base/skills/_template/scripts/_template.sh +31 -0
- package/templates/base/skills/architecture/SKILL.md +54 -0
- package/templates/base/skills/architecture/references/adr-template.md +50 -0
- package/templates/base/skills/architecture/references/api-design.md +64 -0
- package/templates/base/skills/backend/node/SKILL.md +81 -0
- package/templates/base/skills/backend/node/rules/async-patterns.md +81 -0
- package/templates/base/skills/backend/node/rules/deployment.md +33 -0
- package/templates/base/skills/backend/node/rules/env-config.md +41 -0
- package/templates/base/skills/backend/node/rules/error-handling.md +83 -0
- package/templates/base/skills/backend/node/rules/hono-app-setup.md +98 -0
- package/templates/base/skills/backend/node/rules/jwt-auth.md +76 -0
- package/templates/base/skills/backend/node/rules/middleware.md +56 -0
- package/templates/base/skills/backend/node/rules/testing.md +82 -0
- package/templates/base/skills/coding/SKILL.md +47 -0
- package/templates/base/skills/coding/rules/patterns.md +81 -0
- package/templates/base/skills/controller/SKILL.md +111 -0
- package/templates/base/skills/controller/references/README.md +35 -0
- package/templates/base/skills/controller/rules/README.md +18 -0
- package/templates/base/skills/database/SKILL.md +98 -0
- package/templates/base/skills/database/prisma/SKILL.md +57 -0
- package/templates/base/skills/database/prisma/rules/queries.md +133 -0
- package/templates/base/skills/database/prisma/rules/schema-design.md +80 -0
- package/templates/base/skills/frontend/nextjs/SKILL.md +59 -0
- package/templates/base/skills/frontend/nextjs/rules/app-router.md +138 -0
- package/templates/base/skills/frontend/react/SKILL.md +86 -0
- package/templates/base/skills/frontend/react/rules/_sections.md +88 -0
- package/templates/base/skills/frontend/react/rules/anti-patterns.md +67 -0
- package/templates/base/skills/frontend/react/rules/async-api-routes.md +38 -0
- package/templates/base/skills/frontend/react/rules/async-defer-await.md +80 -0
- package/templates/base/skills/frontend/react/rules/async-dependencies.md +36 -0
- package/templates/base/skills/frontend/react/rules/async-parallel.md +28 -0
- package/templates/base/skills/frontend/react/rules/async-suspense-boundaries.md +99 -0
- package/templates/base/skills/frontend/react/rules/bundle-barrel-imports.md +59 -0
- package/templates/base/skills/frontend/react/rules/bundle-defer-third-party.md +49 -0
- package/templates/base/skills/frontend/react/rules/bundle-dynamic-imports.md +35 -0
- package/templates/base/skills/frontend/react/rules/component-conventions.md +74 -0
- package/templates/base/skills/frontend/react/rules/js-combine-iterations.md +32 -0
- package/templates/base/skills/frontend/react/rules/js-early-exit.md +50 -0
- package/templates/base/skills/frontend/react/rules/js-index-maps.md +37 -0
- package/templates/base/skills/frontend/react/rules/js-set-map-lookups.md +24 -0
- package/templates/base/skills/frontend/react/rules/rendering-conditional-render.md +40 -0
- package/templates/base/skills/frontend/react/rules/rendering-content-visibility.md +38 -0
- package/templates/base/skills/frontend/react/rules/rendering-hoist-jsx.md +46 -0
- package/templates/base/skills/frontend/react/rules/rerender-defer-reads.md +39 -0
- package/templates/base/skills/frontend/react/rules/rerender-derived-state.md +29 -0
- package/templates/base/skills/frontend/react/rules/rerender-memo.md +44 -0
- package/templates/base/skills/frontend/react/rules/rerender-transitions.md +40 -0
- package/templates/base/skills/frontend/react/rules/server-after-nonblocking.md +73 -0
- package/templates/base/skills/frontend/react/rules/server-cache-react.md +26 -0
- package/templates/base/skills/frontend/react/rules/server-parallel-fetching.md +79 -0
- package/templates/base/skills/frontend/react/rules/state-location.md +55 -0
- package/templates/base/skills/methodology/bdd/SKILL.md +69 -0
- package/templates/base/skills/methodology/bdd/rules/gherkin-patterns.md +113 -0
- package/templates/base/skills/methodology/ddd/SKILL.md +74 -0
- package/templates/base/skills/methodology/ddd/rules/strategic-patterns.md +98 -0
- package/templates/base/skills/methodology/debugging/SKILL.md +60 -0
- package/templates/base/skills/methodology/debugging/references/root-cause-tracing.md +84 -0
- package/templates/base/skills/methodology/tdd/SKILL.md +66 -0
- package/templates/base/skills/methodology/tdd/rules/real-world-example.md +88 -0
- package/templates/base/skills/methodology/tdd/rules/techniques.md +185 -0
- package/templates/base/skills/mobile/dart/SKILL.md +69 -0
- package/templates/base/skills/mobile/dart/rules/async-patterns.md +112 -0
- package/templates/base/skills/mobile/dart/rules/code-style.md +96 -0
- package/templates/base/skills/mobile/dart/rules/null-safety.md +84 -0
- package/templates/base/skills/mobile/dart/rules/type-system.md +111 -0
- package/templates/base/skills/mobile/flutter/SKILL.md +89 -0
- package/templates/base/skills/mobile/flutter/ci-cd/SKILL.md +82 -0
- package/templates/base/skills/mobile/flutter/ci-cd/references/ci-cd-pipeline.md +314 -0
- package/templates/base/skills/mobile/flutter/ci-cd/rules/code-signing.md +106 -0
- package/templates/base/skills/mobile/flutter/ci-cd/rules/codemagic-setup.md +116 -0
- package/templates/base/skills/mobile/flutter/ci-cd/rules/fastlane-setup.md +105 -0
- package/templates/base/skills/mobile/flutter/ci-cd/rules/github-actions.md +112 -0
- package/templates/base/skills/mobile/flutter/ci-cd/rules/store-deployment.md +106 -0
- package/templates/base/skills/mobile/flutter/ci-cd/rules/versioning.md +107 -0
- package/templates/base/skills/mobile/flutter/i18n/SKILL.md +78 -0
- package/templates/base/skills/mobile/flutter/i18n/references/i18n-architecture.md +225 -0
- package/templates/base/skills/mobile/flutter/i18n/rules/arb-files.md +182 -0
- package/templates/base/skills/mobile/flutter/i18n/rules/locale-switching.md +226 -0
- package/templates/base/skills/mobile/flutter/i18n/rules/localization-setup.md +137 -0
- package/templates/base/skills/mobile/flutter/i18n/rules/plural-gender.md +159 -0
- package/templates/base/skills/mobile/flutter/i18n/rules/text-direction.md +199 -0
- package/templates/base/skills/mobile/flutter/monitoring/SKILL.md +81 -0
- package/templates/base/skills/mobile/flutter/monitoring/references/monitoring-architecture.md +269 -0
- package/templates/base/skills/mobile/flutter/monitoring/rules/analytics.md +227 -0
- package/templates/base/skills/mobile/flutter/monitoring/rules/crashlytics-setup.md +195 -0
- package/templates/base/skills/mobile/flutter/monitoring/rules/logging.md +258 -0
- package/templates/base/skills/mobile/flutter/monitoring/rules/performance-monitoring.md +248 -0
- package/templates/base/skills/mobile/flutter/monitoring/rules/sentry-integration.md +249 -0
- package/templates/base/skills/mobile/flutter/networking/SKILL.md +88 -0
- package/templates/base/skills/mobile/flutter/networking/references/api-client-architecture.md +305 -0
- package/templates/base/skills/mobile/flutter/networking/rules/caching.md +212 -0
- package/templates/base/skills/mobile/flutter/networking/rules/connectivity.md +213 -0
- package/templates/base/skills/mobile/flutter/networking/rules/dio-setup.md +159 -0
- package/templates/base/skills/mobile/flutter/networking/rules/error-handling.md +209 -0
- package/templates/base/skills/mobile/flutter/networking/rules/interceptors.md +205 -0
- package/templates/base/skills/mobile/flutter/networking/rules/retrofit-patterns.md +194 -0
- package/templates/base/skills/mobile/flutter/push-notifications/SKILL.md +87 -0
- package/templates/base/skills/mobile/flutter/push-notifications/references/notification-architecture.md +340 -0
- package/templates/base/skills/mobile/flutter/push-notifications/references/platform-setup.md +286 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/background-processing.md +308 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/deep-linking.md +217 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/fcm-setup.md +164 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/local-notifications.md +262 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/notification-handling.md +210 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/notification-permissions.md +246 -0
- package/templates/base/skills/mobile/flutter/push-notifications/rules/rich-notifications.md +320 -0
- package/templates/base/skills/mobile/flutter/references/freezed-patterns.md +162 -0
- package/templates/base/skills/mobile/flutter/references/project-structure.md +170 -0
- package/templates/base/skills/mobile/flutter/rules/animations.md +112 -0
- package/templates/base/skills/mobile/flutter/rules/architecture.md +121 -0
- package/templates/base/skills/mobile/flutter/rules/navigation-routing.md +117 -0
- package/templates/base/skills/mobile/flutter/rules/performance.md +112 -0
- package/templates/base/skills/mobile/flutter/rules/platform-adaptive.md +126 -0
- package/templates/base/skills/mobile/flutter/rules/state-management.md +110 -0
- package/templates/base/skills/mobile/flutter/rules/testing.md +131 -0
- package/templates/base/skills/mobile/flutter/rules/widget-conventions.md +122 -0
- package/templates/base/skills/mobile/flutter/security/SKILL.md +86 -0
- package/templates/base/skills/mobile/flutter/security/references/mobile-security-checklist.md +168 -0
- package/templates/base/skills/mobile/flutter/security/rules/api-key-protection.md +206 -0
- package/templates/base/skills/mobile/flutter/security/rules/authentication.md +248 -0
- package/templates/base/skills/mobile/flutter/security/rules/data-protection.md +271 -0
- package/templates/base/skills/mobile/flutter/security/rules/obfuscation.md +213 -0
- package/templates/base/skills/mobile/flutter/security/rules/secure-storage.md +171 -0
- package/templates/base/skills/mobile/flutter/security/rules/ssl-pinning.md +197 -0
- package/templates/base/skills/planning/SKILL.md +58 -0
- package/templates/base/skills/planning/references/prd-guide.md +47 -0
- package/templates/base/skills/planning/references/requirements-guide.md +46 -0
- package/templates/base/skills/prompt-engineering/SKILL.md +103 -0
- package/templates/base/skills/retrospective/SKILL.md +102 -0
- package/templates/base/skills/security/SKILL.md +55 -0
- package/templates/base/skills/security/rules/owasp-examples.md +119 -0
- package/templates/base/skills/security/scripts/check-secrets.sh +55 -0
- package/templates/base/skills/testing/SKILL.md +63 -0
- package/templates/base/skills/testing/references/testing-patterns.md +103 -0
- package/templates/base/skills/tsq-protocol/SKILL.md +51 -0
- package/templates/base/skills/typescript/SKILL.md +67 -0
- package/templates/base/skills/typescript/rules/type-patterns.md +135 -0
- package/templates/base/skills/typescript/rules/utility-types.md +76 -0
- package/templates/base/skills/ui-design/SKILL.md +70 -0
- package/templates/{common → base}/timsquad/feedback/routing-rules.yaml +1 -1
- package/templates/{common → base}/timsquad/retrospective/metrics/metrics-schema.json +46 -1
- package/templates/platforms/claude-code/CLAUDE.md.template +89 -0
- package/templates/platforms/claude-code/rules/adr-rules.md +32 -0
- package/templates/platforms/claude-code/rules/feedback-routing.md +18 -0
- package/templates/platforms/claude-code/rules/phase-management.md +23 -0
- package/templates/platforms/claude-code/rules/reporting-format.md +26 -0
- package/templates/platforms/claude-code/rules/sequence-management.md +72 -0
- package/templates/platforms/claude-code/rules/workspace-sync.md +33 -0
- package/templates/platforms/claude-code/scripts/completion-guard.sh +57 -0
- package/templates/platforms/claude-code/scripts/phase-guard.sh +79 -0
- package/templates/platforms/claude-code/settings.json +98 -0
- package/templates/project-types/api-backend/config.yaml +227 -0
- package/templates/project-types/api-backend/process/workflow.xml +214 -0
- package/templates/project-types/fintech/config.yaml +151 -0
- package/templates/project-types/fintech/process/workflow.xml +316 -0
- package/templates/project-types/infra/config.yaml +327 -0
- package/templates/project-types/infra/process/workflow.xml +296 -0
- package/templates/project-types/mobile-app/config.yaml +123 -0
- package/templates/project-types/mobile-app/process/workflow.xml +191 -0
- package/templates/project-types/platform/config.yaml +254 -0
- package/templates/project-types/platform/process/workflow.xml +254 -0
- package/templates/project-types/web-app/config.yaml +198 -0
- package/templates/project-types/web-app/process/workflow.xml +210 -0
- package/templates/project-types/web-service/config.yaml +136 -0
- package/templates/project-types/web-service/process/workflow.xml +184 -0
- package/templates/common/CLAUDE.md.template +0 -254
- package/templates/common/claude/agents/tsq-dba.md +0 -311
- package/templates/common/claude/agents/tsq-designer.md +0 -323
- package/templates/common/claude/agents/tsq-developer.md +0 -177
- package/templates/common/claude/agents/tsq-planner.md +0 -190
- package/templates/common/claude/agents/tsq-prompter.md +0 -356
- package/templates/common/claude/agents/tsq-qa.md +0 -168
- package/templates/common/claude/agents/tsq-retro.md +0 -193
- package/templates/common/claude/agents/tsq-security.md +0 -221
- package/templates/common/claude/hooks/auto-metrics.sh +0 -165
- package/templates/common/claude/hooks/auto-worklog.sh +0 -245
- package/templates/common/claude/hooks/event-logger.sh +0 -208
- package/templates/common/claude/settings.json +0 -86
- package/templates/common/claude/skills/architecture/SKILL.md +0 -123
- package/templates/common/claude/skills/backend/node/SKILL.md +0 -1015
- package/templates/common/claude/skills/coding/SKILL.md +0 -171
- package/templates/common/claude/skills/database/prisma/SKILL.md +0 -357
- package/templates/common/claude/skills/frontend/nextjs/SKILL.md +0 -279
- package/templates/common/claude/skills/frontend/react/SKILL.md +0 -1729
- package/templates/common/claude/skills/methodology/bdd/SKILL.md +0 -234
- package/templates/common/claude/skills/methodology/ddd/SKILL.md +0 -311
- package/templates/common/claude/skills/methodology/tdd/SKILL.md +0 -512
- package/templates/common/claude/skills/planning/SKILL.md +0 -90
- package/templates/common/claude/skills/security/SKILL.md +0 -234
- package/templates/common/claude/skills/testing/SKILL.md +0 -146
- package/templates/common/claude/skills/typescript/SKILL.md +0 -435
- package/templates/common/config.template.yaml +0 -132
- /package/templates/{common → base}/timsquad/architectures/clean/ARCHITECTURE.md +0 -0
- /package/templates/{common → base}/timsquad/architectures/clean/backend.xml +0 -0
- /package/templates/{common → base}/timsquad/architectures/clean/frontend.xml +0 -0
- /package/templates/{common → base}/timsquad/architectures/fsd/ARCHITECTURE.md +0 -0
- /package/templates/{common → base}/timsquad/architectures/fsd/frontend.xml +0 -0
- /package/templates/{common → base}/timsquad/architectures/hexagonal/ARCHITECTURE.md +0 -0
- /package/templates/{common → base}/timsquad/architectures/hexagonal/backend.xml +0 -0
- /package/templates/{common → base}/timsquad/constraints/competency-framework.xml +0 -0
- /package/templates/{common → base}/timsquad/constraints/ssot-schema.xml +0 -0
- /package/templates/{common → base}/timsquad/feedback/feedback-router.sh +0 -0
- /package/templates/{common → base}/timsquad/generators/data-design.xml +0 -0
- /package/templates/{common → base}/timsquad/generators/prd.xml +0 -0
- /package/templates/{common → base}/timsquad/generators/requirements.xml +0 -0
- /package/templates/{common → base}/timsquad/generators/service-spec.xml +0 -0
- /package/templates/{common → base}/timsquad/logs/_example.md +0 -0
- /package/templates/{common → base}/timsquad/logs/_template.md +0 -0
- /package/templates/{common → base}/timsquad/patterns/cqrs.xml +0 -0
- /package/templates/{common → base}/timsquad/patterns/event-sourcing.xml +0 -0
- /package/templates/{common → base}/timsquad/patterns/repository.xml +0 -0
- /package/templates/{common → base}/timsquad/process/phase-checklist.yaml +0 -0
- /package/templates/{common → base}/timsquad/process/state-machine.xml +0 -0
- /package/templates/{common → base}/timsquad/process/validation-rules.xml +0 -0
- /package/templates/{common → base}/timsquad/process/workflow-base.xml +0 -0
- /package/templates/{common → base}/timsquad/retrospective/cycle-report.template.md +0 -0
- /package/templates/{common → base}/timsquad/retrospective/patterns/failure-patterns.md +0 -0
- /package/templates/{common → base}/timsquad/retrospective/patterns/success-patterns.md +0 -0
- /package/templates/{common → base}/timsquad/retrospective/retrospective-config.xml +0 -0
- /package/templates/{common → base}/timsquad/retrospective/retrospective-state.xml +0 -0
- /package/templates/{common → base}/timsquad/ssot/adr/ADR-000-template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/adr/ADR-001-example.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/data-design.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/deployment-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/env-config.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/error-codes.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/functional-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/glossary.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/integration-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/planning.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/prd.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/requirements.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/security-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/service-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/test-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/ssot/ui-ux-spec.template.md +0 -0
- /package/templates/{common → base}/timsquad/state/workspace.xml +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: React Rule Categories
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# React Rule Categories
|
|
6
|
+
|
|
7
|
+
25개 규칙을 카테고리별로 정리. TimSquad 커스텀 + Vercel react-best-practices 통합.
|
|
8
|
+
|
|
9
|
+
## TimSquad Custom (tsq-)
|
|
10
|
+
|
|
11
|
+
**Impact:** HIGH
|
|
12
|
+
**Description:** 프로젝트 컨벤션 및 아키텍처 규칙
|
|
13
|
+
|
|
14
|
+
| Rule | Description |
|
|
15
|
+
|------|-------------|
|
|
16
|
+
| [component-conventions](component-conventions.md) | 컴포넌트 구조 템플릿, export, 크기 제한 |
|
|
17
|
+
| [state-location](state-location.md) | useState/Context/Zustand/React Query 선택 기준 |
|
|
18
|
+
| [anti-patterns](anti-patterns.md) | Props Drilling, useEffect 남용, God Component |
|
|
19
|
+
|
|
20
|
+
## Eliminating Waterfalls (async-)
|
|
21
|
+
|
|
22
|
+
**Impact:** CRITICAL
|
|
23
|
+
**Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency.
|
|
24
|
+
|
|
25
|
+
| Rule | Description |
|
|
26
|
+
|------|-------------|
|
|
27
|
+
| [async-parallel](async-parallel.md) | Promise.all for independent operations (2-10x) |
|
|
28
|
+
| [async-defer-await](async-defer-await.md) | Start async work before awaiting |
|
|
29
|
+
| [async-api-routes](async-api-routes.md) | Parallel data fetching in API routes |
|
|
30
|
+
| [async-dependencies](async-dependencies.md) | Break async dependency chains |
|
|
31
|
+
| [async-suspense-boundaries](async-suspense-boundaries.md) | Granular Suspense boundaries |
|
|
32
|
+
|
|
33
|
+
## Bundle Size (bundle-)
|
|
34
|
+
|
|
35
|
+
**Impact:** CRITICAL
|
|
36
|
+
**Description:** Reducing initial bundle size improves TTI and LCP.
|
|
37
|
+
|
|
38
|
+
| Rule | Description |
|
|
39
|
+
|------|-------------|
|
|
40
|
+
| [bundle-barrel-imports](bundle-barrel-imports.md) | Avoid barrel files, use direct imports |
|
|
41
|
+
| [bundle-dynamic-imports](bundle-dynamic-imports.md) | Dynamic import for heavy components |
|
|
42
|
+
| [bundle-defer-third-party](bundle-defer-third-party.md) | Defer non-critical third-party scripts |
|
|
43
|
+
|
|
44
|
+
## Server-Side Performance (server-)
|
|
45
|
+
|
|
46
|
+
**Impact:** HIGH
|
|
47
|
+
**Description:** Optimizing server-side rendering and data fetching.
|
|
48
|
+
|
|
49
|
+
| Rule | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| [server-cache-react](server-cache-react.md) | React cache() for request dedup |
|
|
52
|
+
| [server-parallel-fetching](server-parallel-fetching.md) | Parallel server data fetching |
|
|
53
|
+
| [server-after-nonblocking](server-after-nonblocking.md) | after() for non-blocking work |
|
|
54
|
+
|
|
55
|
+
## Re-render Optimization (rerender-)
|
|
56
|
+
|
|
57
|
+
**Impact:** MEDIUM
|
|
58
|
+
**Description:** Reducing unnecessary re-renders.
|
|
59
|
+
|
|
60
|
+
| Rule | Description |
|
|
61
|
+
|------|-------------|
|
|
62
|
+
| [rerender-memo](rerender-memo.md) | React.memo for stable components |
|
|
63
|
+
| [rerender-defer-reads](rerender-defer-reads.md) | Defer state reads to minimize scope |
|
|
64
|
+
| [rerender-derived-state](rerender-derived-state.md) | Derive state instead of syncing |
|
|
65
|
+
| [rerender-transitions](rerender-transitions.md) | useTransition for non-urgent updates |
|
|
66
|
+
|
|
67
|
+
## Rendering Performance (rendering-)
|
|
68
|
+
|
|
69
|
+
**Impact:** MEDIUM
|
|
70
|
+
**Description:** Optimizing the rendering process.
|
|
71
|
+
|
|
72
|
+
| Rule | Description |
|
|
73
|
+
|------|-------------|
|
|
74
|
+
| [rendering-content-visibility](rendering-content-visibility.md) | content-visibility: auto for large lists |
|
|
75
|
+
| [rendering-hoist-jsx](rendering-hoist-jsx.md) | Hoist JSX out of loops/conditions |
|
|
76
|
+
| [rendering-conditional-render](rendering-conditional-render.md) | Efficient conditional rendering |
|
|
77
|
+
|
|
78
|
+
## JavaScript Performance (js-)
|
|
79
|
+
|
|
80
|
+
**Impact:** LOW-MEDIUM
|
|
81
|
+
**Description:** Micro-optimizations for hot paths.
|
|
82
|
+
|
|
83
|
+
| Rule | Description |
|
|
84
|
+
|------|-------------|
|
|
85
|
+
| [js-index-maps](js-index-maps.md) | Pre-index data with Maps |
|
|
86
|
+
| [js-early-exit](js-early-exit.md) | Early return for cheaper checks first |
|
|
87
|
+
| [js-set-map-lookups](js-set-map-lookups.md) | Set/Map for O(1) lookups |
|
|
88
|
+
| [js-combine-iterations](js-combine-iterations.md) | Combine array iterations |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Anti-Patterns
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
tags: anti-pattern, performance, useEffect
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Anti-Patterns
|
|
8
|
+
|
|
9
|
+
### 1. useEffect for Derived State
|
|
10
|
+
|
|
11
|
+
**Incorrect:**
|
|
12
|
+
```tsx
|
|
13
|
+
const [items, setItems] = useState([]);
|
|
14
|
+
const [total, setTotal] = useState(0);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setTotal(items.reduce((sum, i) => sum + i.price, 0));
|
|
18
|
+
}, [items]);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Correct:**
|
|
22
|
+
```tsx
|
|
23
|
+
const total = useMemo(
|
|
24
|
+
() => items.reduce((sum, i) => sum + i.price, 0),
|
|
25
|
+
[items]
|
|
26
|
+
);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Inline Object/Array in JSX
|
|
30
|
+
|
|
31
|
+
**Incorrect:**
|
|
32
|
+
```tsx
|
|
33
|
+
// 매 렌더링마다 새 참조 → memo 무효화
|
|
34
|
+
<Child style={{ color: 'red' }} items={[1, 2, 3]} />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Correct:**
|
|
38
|
+
```tsx
|
|
39
|
+
const style = useMemo(() => ({ color: 'red' }), []);
|
|
40
|
+
const items = useMemo(() => [1, 2, 3], []);
|
|
41
|
+
<Child style={style} items={items} />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 3. Props Drilling (3+ levels)
|
|
45
|
+
|
|
46
|
+
3단계 이상 Props 전달 → Context 또는 Zustand 사용.
|
|
47
|
+
|
|
48
|
+
### 4. God Component (500+ lines)
|
|
49
|
+
|
|
50
|
+
하나의 거대한 컴포넌트 → 작은 단위로 분리, 훅으로 로직 추출.
|
|
51
|
+
|
|
52
|
+
### 5. Stale Closure in Callbacks
|
|
53
|
+
|
|
54
|
+
**Incorrect:**
|
|
55
|
+
```tsx
|
|
56
|
+
const [items, setItems] = useState(initialItems);
|
|
57
|
+
const addItems = useCallback((newItems: Item[]) => {
|
|
58
|
+
setItems([...items, ...newItems]); // items 참조 고정됨
|
|
59
|
+
}, [items]); // items 변경마다 재생성
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Correct:**
|
|
63
|
+
```tsx
|
|
64
|
+
const addItems = useCallback((newItems: Item[]) => {
|
|
65
|
+
setItems(curr => [...curr, ...newItems]); // 함수형 setState
|
|
66
|
+
}, []); // 의존성 없음, 안정적
|
|
67
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Prevent Waterfall Chains in API Routes
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: 2-10× improvement
|
|
5
|
+
tags: api-routes, server-actions, waterfalls, parallelization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Prevent Waterfall Chains in API Routes
|
|
9
|
+
|
|
10
|
+
In API routes and Server Actions, start independent operations immediately, even if you don't await them yet.
|
|
11
|
+
|
|
12
|
+
**Incorrect (config waits for auth, data waits for both):**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export async function GET(request: Request) {
|
|
16
|
+
const session = await auth()
|
|
17
|
+
const config = await fetchConfig()
|
|
18
|
+
const data = await fetchData(session.user.id)
|
|
19
|
+
return Response.json({ data, config })
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Correct (auth and config start immediately):**
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
export async function GET(request: Request) {
|
|
27
|
+
const sessionPromise = auth()
|
|
28
|
+
const configPromise = fetchConfig()
|
|
29
|
+
const session = await sessionPromise
|
|
30
|
+
const [config, data] = await Promise.all([
|
|
31
|
+
configPromise,
|
|
32
|
+
fetchData(session.user.id)
|
|
33
|
+
])
|
|
34
|
+
return Response.json({ data, config })
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Defer Await Until Needed
|
|
3
|
+
impact: HIGH
|
|
4
|
+
impactDescription: avoids blocking unused code paths
|
|
5
|
+
tags: async, await, conditional, optimization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Defer Await Until Needed
|
|
9
|
+
|
|
10
|
+
Move `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.
|
|
11
|
+
|
|
12
|
+
**Incorrect (blocks both branches):**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
async function handleRequest(userId: string, skipProcessing: boolean) {
|
|
16
|
+
const userData = await fetchUserData(userId)
|
|
17
|
+
|
|
18
|
+
if (skipProcessing) {
|
|
19
|
+
// Returns immediately but still waited for userData
|
|
20
|
+
return { skipped: true }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Only this branch uses userData
|
|
24
|
+
return processUserData(userData)
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Correct (only blocks when needed):**
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
async function handleRequest(userId: string, skipProcessing: boolean) {
|
|
32
|
+
if (skipProcessing) {
|
|
33
|
+
// Returns immediately without waiting
|
|
34
|
+
return { skipped: true }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Fetch only when needed
|
|
38
|
+
const userData = await fetchUserData(userId)
|
|
39
|
+
return processUserData(userData)
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Another example (early return optimization):**
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
// Incorrect: always fetches permissions
|
|
47
|
+
async function updateResource(resourceId: string, userId: string) {
|
|
48
|
+
const permissions = await fetchPermissions(userId)
|
|
49
|
+
const resource = await getResource(resourceId)
|
|
50
|
+
|
|
51
|
+
if (!resource) {
|
|
52
|
+
return { error: 'Not found' }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!permissions.canEdit) {
|
|
56
|
+
return { error: 'Forbidden' }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return await updateResourceData(resource, permissions)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Correct: fetches only when needed
|
|
63
|
+
async function updateResource(resourceId: string, userId: string) {
|
|
64
|
+
const resource = await getResource(resourceId)
|
|
65
|
+
|
|
66
|
+
if (!resource) {
|
|
67
|
+
return { error: 'Not found' }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const permissions = await fetchPermissions(userId)
|
|
71
|
+
|
|
72
|
+
if (!permissions.canEdit) {
|
|
73
|
+
return { error: 'Forbidden' }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return await updateResourceData(resource, permissions)
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Dependency-Based Parallelization
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: 2-10× improvement
|
|
5
|
+
tags: async, parallelization, dependencies, better-all
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Dependency-Based Parallelization
|
|
9
|
+
|
|
10
|
+
For operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.
|
|
11
|
+
|
|
12
|
+
**Incorrect (profile waits for config unnecessarily):**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
const [user, config] = await Promise.all([
|
|
16
|
+
fetchUser(),
|
|
17
|
+
fetchConfig()
|
|
18
|
+
])
|
|
19
|
+
const profile = await fetchProfile(user.id)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Correct (config and profile run in parallel):**
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { all } from 'better-all'
|
|
26
|
+
|
|
27
|
+
const { user, config, profile } = await all({
|
|
28
|
+
async user() { return fetchUser() },
|
|
29
|
+
async config() { return fetchConfig() },
|
|
30
|
+
async profile() {
|
|
31
|
+
return fetchProfile((await this.$.user).id)
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Reference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Promise.all() for Independent Operations
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: 2-10× improvement
|
|
5
|
+
tags: async, parallelization, promises, waterfalls
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Promise.all() for Independent Operations
|
|
9
|
+
|
|
10
|
+
When async operations have no interdependencies, execute them concurrently using `Promise.all()`.
|
|
11
|
+
|
|
12
|
+
**Incorrect (sequential execution, 3 round trips):**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
const user = await fetchUser()
|
|
16
|
+
const posts = await fetchPosts()
|
|
17
|
+
const comments = await fetchComments()
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Correct (parallel execution, 1 round trip):**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
const [user, posts, comments] = await Promise.all([
|
|
24
|
+
fetchUser(),
|
|
25
|
+
fetchPosts(),
|
|
26
|
+
fetchComments()
|
|
27
|
+
])
|
|
28
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Strategic Suspense Boundaries
|
|
3
|
+
impact: HIGH
|
|
4
|
+
impactDescription: faster initial paint
|
|
5
|
+
tags: async, suspense, streaming, layout-shift
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Strategic Suspense Boundaries
|
|
9
|
+
|
|
10
|
+
Instead of awaiting data in async components before returning JSX, use Suspense boundaries to show the wrapper UI faster while data loads.
|
|
11
|
+
|
|
12
|
+
**Incorrect (wrapper blocked by data fetching):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
async function Page() {
|
|
16
|
+
const data = await fetchData() // Blocks entire page
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<div>Sidebar</div>
|
|
21
|
+
<div>Header</div>
|
|
22
|
+
<div>
|
|
23
|
+
<DataDisplay data={data} />
|
|
24
|
+
</div>
|
|
25
|
+
<div>Footer</div>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The entire layout waits for data even though only the middle section needs it.
|
|
32
|
+
|
|
33
|
+
**Correct (wrapper shows immediately, data streams in):**
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
function Page() {
|
|
37
|
+
return (
|
|
38
|
+
<div>
|
|
39
|
+
<div>Sidebar</div>
|
|
40
|
+
<div>Header</div>
|
|
41
|
+
<div>
|
|
42
|
+
<Suspense fallback={<Skeleton />}>
|
|
43
|
+
<DataDisplay />
|
|
44
|
+
</Suspense>
|
|
45
|
+
</div>
|
|
46
|
+
<div>Footer</div>
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function DataDisplay() {
|
|
52
|
+
const data = await fetchData() // Only blocks this component
|
|
53
|
+
return <div>{data.content}</div>
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Sidebar, Header, and Footer render immediately. Only DataDisplay waits for data.
|
|
58
|
+
|
|
59
|
+
**Alternative (share promise across components):**
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
function Page() {
|
|
63
|
+
// Start fetch immediately, but don't await
|
|
64
|
+
const dataPromise = fetchData()
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div>
|
|
68
|
+
<div>Sidebar</div>
|
|
69
|
+
<div>Header</div>
|
|
70
|
+
<Suspense fallback={<Skeleton />}>
|
|
71
|
+
<DataDisplay dataPromise={dataPromise} />
|
|
72
|
+
<DataSummary dataPromise={dataPromise} />
|
|
73
|
+
</Suspense>
|
|
74
|
+
<div>Footer</div>
|
|
75
|
+
</div>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function DataDisplay({ dataPromise }: { dataPromise: Promise<Data> }) {
|
|
80
|
+
const data = use(dataPromise) // Unwraps the promise
|
|
81
|
+
return <div>{data.content}</div>
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function DataSummary({ dataPromise }: { dataPromise: Promise<Data> }) {
|
|
85
|
+
const data = use(dataPromise) // Reuses the same promise
|
|
86
|
+
return <div>{data.summary}</div>
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Both components share the same promise, so only one fetch occurs. Layout renders immediately while both components wait together.
|
|
91
|
+
|
|
92
|
+
**When NOT to use this pattern:**
|
|
93
|
+
|
|
94
|
+
- Critical data needed for layout decisions (affects positioning)
|
|
95
|
+
- SEO-critical content above the fold
|
|
96
|
+
- Small, fast queries where suspense overhead isn't worth it
|
|
97
|
+
- When you want to avoid layout shift (loading → content jump)
|
|
98
|
+
|
|
99
|
+
**Trade-off:** Faster initial paint vs potential layout shift. Choose based on your UX priorities.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Avoid Barrel File Imports
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: 200-800ms import cost, slow builds
|
|
5
|
+
tags: bundle, imports, tree-shaking, barrel-files, performance
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Avoid Barrel File Imports
|
|
9
|
+
|
|
10
|
+
Import directly from source files instead of barrel files to avoid loading thousands of unused modules. **Barrel files** are entry points that re-export multiple modules (e.g., `index.js` that does `export * from './module'`).
|
|
11
|
+
|
|
12
|
+
Popular icon and component libraries can have **up to 10,000 re-exports** in their entry file. For many React packages, **it takes 200-800ms just to import them**, affecting both development speed and production cold starts.
|
|
13
|
+
|
|
14
|
+
**Why tree-shaking doesn't help:** When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.
|
|
15
|
+
|
|
16
|
+
**Incorrect (imports entire library):**
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { Check, X, Menu } from 'lucide-react'
|
|
20
|
+
// Loads 1,583 modules, takes ~2.8s extra in dev
|
|
21
|
+
// Runtime cost: 200-800ms on every cold start
|
|
22
|
+
|
|
23
|
+
import { Button, TextField } from '@mui/material'
|
|
24
|
+
// Loads 2,225 modules, takes ~4.2s extra in dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Correct (imports only what you need):**
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import Check from 'lucide-react/dist/esm/icons/check'
|
|
31
|
+
import X from 'lucide-react/dist/esm/icons/x'
|
|
32
|
+
import Menu from 'lucide-react/dist/esm/icons/menu'
|
|
33
|
+
// Loads only 3 modules (~2KB vs ~1MB)
|
|
34
|
+
|
|
35
|
+
import Button from '@mui/material/Button'
|
|
36
|
+
import TextField from '@mui/material/TextField'
|
|
37
|
+
// Loads only what you use
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Alternative (Next.js 13.5+):**
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
// next.config.js - use optimizePackageImports
|
|
44
|
+
module.exports = {
|
|
45
|
+
experimental: {
|
|
46
|
+
optimizePackageImports: ['lucide-react', '@mui/material']
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Then you can keep the ergonomic barrel imports:
|
|
51
|
+
import { Check, X, Menu } from 'lucide-react'
|
|
52
|
+
// Automatically transformed to direct imports at build time
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Direct imports provide 15-70% faster dev boot, 28% faster builds, 40% faster cold starts, and significantly faster HMR.
|
|
56
|
+
|
|
57
|
+
Libraries commonly affected: `lucide-react`, `@mui/material`, `@mui/icons-material`, `@tabler/icons-react`, `react-icons`, `@headlessui/react`, `@radix-ui/react-*`, `lodash`, `ramda`, `date-fns`, `rxjs`, `react-use`.
|
|
58
|
+
|
|
59
|
+
Reference: [How we optimized package imports in Next.js](https://vercel.com/blog/how-we-optimized-package-imports-in-next-js)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Defer Non-Critical Third-Party Libraries
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: loads after hydration
|
|
5
|
+
tags: bundle, third-party, analytics, defer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Defer Non-Critical Third-Party Libraries
|
|
9
|
+
|
|
10
|
+
Analytics, logging, and error tracking don't block user interaction. Load them after hydration.
|
|
11
|
+
|
|
12
|
+
**Incorrect (blocks initial bundle):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { Analytics } from '@vercel/analytics/react'
|
|
16
|
+
|
|
17
|
+
export default function RootLayout({ children }) {
|
|
18
|
+
return (
|
|
19
|
+
<html>
|
|
20
|
+
<body>
|
|
21
|
+
{children}
|
|
22
|
+
<Analytics />
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Correct (loads after hydration):**
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import dynamic from 'next/dynamic'
|
|
33
|
+
|
|
34
|
+
const Analytics = dynamic(
|
|
35
|
+
() => import('@vercel/analytics/react').then(m => m.Analytics),
|
|
36
|
+
{ ssr: false }
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
export default function RootLayout({ children }) {
|
|
40
|
+
return (
|
|
41
|
+
<html>
|
|
42
|
+
<body>
|
|
43
|
+
{children}
|
|
44
|
+
<Analytics />
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Dynamic Imports for Heavy Components
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: directly affects TTI and LCP
|
|
5
|
+
tags: bundle, dynamic-import, code-splitting, next-dynamic
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Dynamic Imports for Heavy Components
|
|
9
|
+
|
|
10
|
+
Use `next/dynamic` to lazy-load large components not needed on initial render.
|
|
11
|
+
|
|
12
|
+
**Incorrect (Monaco bundles with main chunk ~300KB):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { MonacoEditor } from './monaco-editor'
|
|
16
|
+
|
|
17
|
+
function CodePanel({ code }: { code: string }) {
|
|
18
|
+
return <MonacoEditor value={code} />
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Correct (Monaco loads on demand):**
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import dynamic from 'next/dynamic'
|
|
26
|
+
|
|
27
|
+
const MonacoEditor = dynamic(
|
|
28
|
+
() => import('./monaco-editor').then(m => m.MonacoEditor),
|
|
29
|
+
{ ssr: false }
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
function CodePanel({ code }: { code: string }) {
|
|
33
|
+
return <MonacoEditor value={code} />
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Component Conventions
|
|
3
|
+
impact: HIGH
|
|
4
|
+
tags: component, structure, naming
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Component Conventions
|
|
8
|
+
|
|
9
|
+
프로젝트 전체에서 일관된 컴포넌트 구조를 유지하기 위한 규칙.
|
|
10
|
+
|
|
11
|
+
### Structure Template
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
// 1. 타입 정의
|
|
15
|
+
interface Props { ... }
|
|
16
|
+
|
|
17
|
+
// 2. 컴포넌트
|
|
18
|
+
export function ComponentName({ prop1, prop2 }: Props) {
|
|
19
|
+
// 3. 훅 (순서 중요 - 항상 최상위)
|
|
20
|
+
const [state, setState] = useState();
|
|
21
|
+
const { data } = useQuery();
|
|
22
|
+
const router = useRouter();
|
|
23
|
+
|
|
24
|
+
// 4. 파생 값
|
|
25
|
+
const derivedValue = useMemo(() => ..., [deps]);
|
|
26
|
+
|
|
27
|
+
// 5. 이벤트 핸들러
|
|
28
|
+
const handleClick = useCallback(() => ..., [deps]);
|
|
29
|
+
|
|
30
|
+
// 6. 이펙트 (최소화)
|
|
31
|
+
useEffect(() => ..., [deps]);
|
|
32
|
+
|
|
33
|
+
// 7. Early Return
|
|
34
|
+
if (isLoading) return <Skeleton />;
|
|
35
|
+
if (error) return <ErrorMessage error={error} />;
|
|
36
|
+
|
|
37
|
+
// 8. 메인 렌더링
|
|
38
|
+
return ( ... );
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Rules
|
|
43
|
+
|
|
44
|
+
**Incorrect:**
|
|
45
|
+
```tsx
|
|
46
|
+
// default export, 타입 미정의
|
|
47
|
+
export default function UserCard({ user, onEdit }) {
|
|
48
|
+
return <div>{user.name}</div>;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Correct:**
|
|
53
|
+
```tsx
|
|
54
|
+
interface UserCardProps {
|
|
55
|
+
user: User;
|
|
56
|
+
onEdit?: (user: User) => void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function UserCard({ user, onEdit }: UserCardProps) {
|
|
60
|
+
return (
|
|
61
|
+
<div className="user-card">
|
|
62
|
+
<Avatar src={user.avatar} alt={user.name} />
|
|
63
|
+
<h3>{user.name}</h3>
|
|
64
|
+
{onEdit && <Button onClick={() => onEdit(user)}>Edit</Button>}
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Limits
|
|
71
|
+
|
|
72
|
+
- 컴포넌트: **200줄 이하** (초과 시 분리)
|
|
73
|
+
- **named export**: `export function` (default export 금지)
|
|
74
|
+
- **forwardRef**: ref 전달이 필요한 컴포넌트는 필수
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Combine Multiple Array Iterations
|
|
3
|
+
impact: LOW-MEDIUM
|
|
4
|
+
impactDescription: reduces iterations
|
|
5
|
+
tags: javascript, arrays, loops, performance
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Combine Multiple Array Iterations
|
|
9
|
+
|
|
10
|
+
Multiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.
|
|
11
|
+
|
|
12
|
+
**Incorrect (3 iterations):**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
const admins = users.filter(u => u.isAdmin)
|
|
16
|
+
const testers = users.filter(u => u.isTester)
|
|
17
|
+
const inactive = users.filter(u => !u.isActive)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Correct (1 iteration):**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
const admins: User[] = []
|
|
24
|
+
const testers: User[] = []
|
|
25
|
+
const inactive: User[] = []
|
|
26
|
+
|
|
27
|
+
for (const user of users) {
|
|
28
|
+
if (user.isAdmin) admins.push(user)
|
|
29
|
+
if (user.isTester) testers.push(user)
|
|
30
|
+
if (!user.isActive) inactive.push(user)
|
|
31
|
+
}
|
|
32
|
+
```
|