@fifine/aim-studio 0.0.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/LICENSE +21 -0
- package/README.md +159 -0
- package/bin/aim.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +89 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +513 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/update.d.ts +27 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +1275 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/configurators/claude.d.ts +32 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +98 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/index.d.ts +51 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +113 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/shared.d.ts +12 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +21 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/workflow.d.ts +28 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +147 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +68 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +77 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +54 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +160 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.0.1.json +9 -0
- package/dist/migrations/manifests/0.1.9.json +30 -0
- package/dist/migrations/manifests/0.2.0.json +49 -0
- package/dist/migrations/manifests/0.2.12.json +9 -0
- package/dist/migrations/manifests/0.2.13.json +9 -0
- package/dist/migrations/manifests/0.2.14.json +175 -0
- package/dist/migrations/manifests/0.2.15.json +33 -0
- package/dist/migrations/manifests/0.3.0-beta.0.json +278 -0
- package/dist/migrations/manifests/0.3.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.7.json +11 -0
- package/dist/migrations/manifests/0.3.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.2.json +9 -0
- package/dist/templates/CLAUDE.md +71 -0
- package/dist/templates/aim/gitignore.txt +29 -0
- package/dist/templates/aim/index.d.ts +49 -0
- package/dist/templates/aim/index.d.ts.map +1 -0
- package/dist/templates/aim/index.js +92 -0
- package/dist/templates/aim/index.js.map +1 -0
- package/dist/templates/aim/scripts/__init__.py +5 -0
- package/dist/templates/aim/scripts/add_session.py +392 -0
- package/dist/templates/aim/scripts/common/__init__.py +80 -0
- package/dist/templates/aim/scripts/common/cli_adapter.py +435 -0
- package/dist/templates/aim/scripts/common/developer.py +190 -0
- package/dist/templates/aim/scripts/common/git_context.py +383 -0
- package/dist/templates/aim/scripts/common/paths.py +347 -0
- package/dist/templates/aim/scripts/common/phase.py +253 -0
- package/dist/templates/aim/scripts/common/registry.py +366 -0
- package/dist/templates/aim/scripts/common/task_queue.py +255 -0
- package/dist/templates/aim/scripts/common/task_utils.py +178 -0
- package/dist/templates/aim/scripts/common/worktree.py +219 -0
- package/dist/templates/aim/scripts/create_bootstrap.py +290 -0
- package/dist/templates/aim/scripts/get_context.py +16 -0
- package/dist/templates/aim/scripts/get_developer.py +26 -0
- package/dist/templates/aim/scripts/init_developer.py +51 -0
- package/dist/templates/aim/scripts/multi_agent/__init__.py +5 -0
- package/dist/templates/aim/scripts/multi_agent/cleanup.py +403 -0
- package/dist/templates/aim/scripts/multi_agent/create_pr.py +329 -0
- package/dist/templates/aim/scripts/multi_agent/plan.py +233 -0
- package/dist/templates/aim/scripts/multi_agent/start.py +461 -0
- package/dist/templates/aim/scripts/multi_agent/status.py +817 -0
- package/dist/templates/aim/scripts/task.py +1068 -0
- package/dist/templates/aim/scripts-shell-archive/add-session.sh +384 -0
- package/dist/templates/aim/scripts-shell-archive/common/developer.sh +129 -0
- package/dist/templates/aim/scripts-shell-archive/common/git-context.sh +263 -0
- package/dist/templates/aim/scripts-shell-archive/common/paths.sh +208 -0
- package/dist/templates/aim/scripts-shell-archive/common/phase.sh +150 -0
- package/dist/templates/aim/scripts-shell-archive/common/registry.sh +247 -0
- package/dist/templates/aim/scripts-shell-archive/common/task-queue.sh +142 -0
- package/dist/templates/aim/scripts-shell-archive/common/task-utils.sh +151 -0
- package/dist/templates/aim/scripts-shell-archive/common/worktree.sh +128 -0
- package/dist/templates/aim/scripts-shell-archive/create-bootstrap.sh +299 -0
- package/dist/templates/aim/scripts-shell-archive/get-context.sh +7 -0
- package/dist/templates/aim/scripts-shell-archive/get-developer.sh +15 -0
- package/dist/templates/aim/scripts-shell-archive/init-developer.sh +34 -0
- package/dist/templates/aim/scripts-shell-archive/multi-agent/cleanup.sh +396 -0
- package/dist/templates/aim/scripts-shell-archive/multi-agent/create-pr.sh +241 -0
- package/dist/templates/aim/scripts-shell-archive/multi-agent/plan.sh +207 -0
- package/dist/templates/aim/scripts-shell-archive/multi-agent/start.sh +317 -0
- package/dist/templates/aim/scripts-shell-archive/multi-agent/status.sh +828 -0
- package/dist/templates/aim/scripts-shell-archive/task.sh +1204 -0
- package/dist/templates/aim/tasks/.gitkeep +0 -0
- package/dist/templates/aim/workflow.md +258 -0
- package/dist/templates/aim/worktree.yaml +47 -0
- package/dist/templates/claude/agents/check.md +122 -0
- package/dist/templates/claude/agents/debug.md +106 -0
- package/dist/templates/claude/agents/dispatch.md +230 -0
- package/dist/templates/claude/agents/implement.md +96 -0
- package/dist/templates/claude/agents/plan.md +396 -0
- package/dist/templates/claude/agents/research.md +120 -0
- package/dist/templates/claude/agents/story.md +53 -0
- package/dist/templates/claude/commands/aim/before-backend-dev.md +13 -0
- package/dist/templates/claude/commands/aim/before-frontend-dev.md +13 -0
- package/dist/templates/claude/commands/aim/break-loop.md +153 -0
- package/dist/templates/claude/commands/aim/check-backend.md +13 -0
- package/dist/templates/claude/commands/aim/check-cross-layer.md +153 -0
- package/dist/templates/claude/commands/aim/check-frontend.md +13 -0
- package/dist/templates/claude/commands/aim/check-story.md +59 -0
- package/dist/templates/claude/commands/aim/create-command.md +154 -0
- package/dist/templates/claude/commands/aim/export.md +187 -0
- package/dist/templates/claude/commands/aim/finish-work.md +104 -0
- package/dist/templates/claude/commands/aim/integrate-skill.md +219 -0
- package/dist/templates/claude/commands/aim/onboard.md +358 -0
- package/dist/templates/claude/commands/aim/parallel.md +217 -0
- package/dist/templates/claude/commands/aim/portrait.md +170 -0
- package/dist/templates/claude/commands/aim/record-session.md +92 -0
- package/dist/templates/claude/commands/aim/start.md +112 -0
- package/dist/templates/claude/commands/aim/story.md +140 -0
- package/dist/templates/claude/commands/aim/update-spec.md +285 -0
- package/dist/templates/claude/commands/aim/visualize.md +182 -0
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/break-loop.md +125 -0
- package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
- package/dist/templates/claude/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/claude/commands/trellis/create-command.md +154 -0
- package/dist/templates/claude/commands/trellis/finish-work.md +129 -0
- package/dist/templates/claude/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/claude/commands/trellis/onboard.md +358 -0
- package/dist/templates/claude/commands/trellis/parallel.md +193 -0
- package/dist/templates/claude/commands/trellis/record-session.md +62 -0
- package/dist/templates/claude/commands/trellis/start.md +280 -0
- package/dist/templates/claude/commands/trellis/update-spec.md +285 -0
- package/dist/templates/claude/hooks/inject-subagent-context.py +772 -0
- package/dist/templates/claude/hooks/ralph-loop.py +388 -0
- package/dist/templates/claude/hooks/session-start.py +142 -0
- package/dist/templates/claude/index.d.ts +54 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +85 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +41 -0
- package/dist/templates/extract.d.ts +68 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +128 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/markdown/agents.md +25 -0
- package/dist/templates/markdown/gitignore.txt +12 -0
- package/dist/templates/markdown/index.d.ts +32 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +58 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/index.md +40 -0
- package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/script-conventions.md +467 -0
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +118 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +92 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +94 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +394 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +319 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +89 -0
- package/dist/templates/markdown/spec/story/character.md.txt +95 -0
- package/dist/templates/markdown/spec/story/index.md.txt +31 -0
- package/dist/templates/markdown/spec/story/script.md.txt +313 -0
- package/dist/templates/markdown/spec/story/world.md.txt +92 -0
- package/dist/templates/markdown/workspace-index.md +123 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/trellis/gitignore.txt +29 -0
- package/dist/templates/trellis/index.d.ts +49 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +92 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +392 -0
- package/dist/templates/trellis/scripts/common/__init__.py +80 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +435 -0
- package/dist/templates/trellis/scripts/common/developer.py +190 -0
- package/dist/templates/trellis/scripts/common/git_context.py +383 -0
- package/dist/templates/trellis/scripts/common/paths.py +347 -0
- package/dist/templates/trellis/scripts/common/phase.py +253 -0
- package/dist/templates/trellis/scripts/common/registry.py +366 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +255 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +178 -0
- package/dist/templates/trellis/scripts/common/worktree.py +219 -0
- package/dist/templates/trellis/scripts/create_bootstrap.py +290 -0
- package/dist/templates/trellis/scripts/get_context.py +16 -0
- package/dist/templates/trellis/scripts/get_developer.py +26 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/templates/trellis/scripts/multi_agent/__init__.py +5 -0
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +403 -0
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +329 -0
- package/dist/templates/trellis/scripts/multi_agent/plan.py +233 -0
- package/dist/templates/trellis/scripts/multi_agent/start.py +461 -0
- package/dist/templates/trellis/scripts/multi_agent/status.py +817 -0
- package/dist/templates/trellis/scripts/task.py +1056 -0
- package/dist/templates/trellis/scripts-shell-archive/add-session.sh +384 -0
- package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +129 -0
- package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +263 -0
- package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +208 -0
- package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +150 -0
- package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +247 -0
- package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +142 -0
- package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +151 -0
- package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +128 -0
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +299 -0
- package/dist/templates/trellis/scripts-shell-archive/get-context.sh +7 -0
- package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +15 -0
- package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +34 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +396 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +241 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +207 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +317 -0
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +828 -0
- package/dist/templates/trellis/scripts-shell-archive/task.sh +1204 -0
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/workflow.md +416 -0
- package/dist/templates/trellis/worktree.yaml +47 -0
- package/dist/types/ai-tools.d.ts +48 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +32 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/types/migration.d.ts +86 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/compare-versions.d.ts +12 -0
- package/dist/utils/compare-versions.d.ts.map +1 -0
- package/dist/utils/compare-versions.js +76 -0
- package/dist/utils/compare-versions.js.map +1 -0
- package/dist/utils/file-writer.d.ts +23 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +140 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/project-detector.d.ts +16 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +188 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +51 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -0
- package/dist/utils/template-fetcher.js +174 -0
- package/dist/utils/template-fetcher.js.map +1 -0
- package/dist/utils/template-hash.d.ts +78 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +239 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Hook Guidelines
|
|
2
|
+
|
|
3
|
+
> How hooks are used in this project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
Document your project's hook conventions here.
|
|
11
|
+
|
|
12
|
+
Questions to answer:
|
|
13
|
+
- What custom hooks do you have?
|
|
14
|
+
- How do you handle data fetching?
|
|
15
|
+
- What are the naming conventions?
|
|
16
|
+
- How do you share stateful logic?
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
(To be filled by the team)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Custom Hook Patterns
|
|
24
|
+
|
|
25
|
+
<!-- How to create and structure custom hooks -->
|
|
26
|
+
|
|
27
|
+
(To be filled by the team)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Data Fetching
|
|
32
|
+
|
|
33
|
+
<!-- How data fetching is handled (React Query, SWR, etc.) -->
|
|
34
|
+
|
|
35
|
+
(To be filled by the team)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Naming Conventions
|
|
40
|
+
|
|
41
|
+
<!-- Hook naming rules (use*, etc.) -->
|
|
42
|
+
|
|
43
|
+
(To be filled by the team)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Common Mistakes
|
|
48
|
+
|
|
49
|
+
<!-- Hook-related mistakes your team has made -->
|
|
50
|
+
|
|
51
|
+
(To be filled by the team)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Frontend Development Guidelines
|
|
2
|
+
|
|
3
|
+
> Best practices for frontend development in this project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This directory contains guidelines for frontend development. Fill in each file with your project's specific conventions.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Guidelines Index
|
|
14
|
+
|
|
15
|
+
| Guide | Description | Status |
|
|
16
|
+
|-------|-------------|--------|
|
|
17
|
+
| [Directory Structure](./directory-structure.md) | Module organization and file layout | To fill |
|
|
18
|
+
| [Component Guidelines](./component-guidelines.md) | Component patterns, props, composition | To fill |
|
|
19
|
+
| [Hook Guidelines](./hook-guidelines.md) | Custom hooks, data fetching patterns | To fill |
|
|
20
|
+
| [State Management](./state-management.md) | Local state, global state, server state | To fill |
|
|
21
|
+
| [Quality Guidelines](./quality-guidelines.md) | Code standards, forbidden patterns | To fill |
|
|
22
|
+
| [Type Safety](./type-safety.md) | Type patterns, validation | To fill |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## How to Fill These Guidelines
|
|
27
|
+
|
|
28
|
+
For each guideline file:
|
|
29
|
+
|
|
30
|
+
1. Document your project's **actual conventions** (not ideals)
|
|
31
|
+
2. Include **code examples** from your codebase
|
|
32
|
+
3. List **forbidden patterns** and why
|
|
33
|
+
4. Add **common mistakes** your team has made
|
|
34
|
+
|
|
35
|
+
The goal is to help AI assistants and new team members understand how YOUR project works.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
**Language**: All documentation should be written in **English**.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Quality Guidelines
|
|
2
|
+
|
|
3
|
+
> Code quality standards for frontend development.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
Document your project's quality standards here.
|
|
11
|
+
|
|
12
|
+
Questions to answer:
|
|
13
|
+
- What patterns are forbidden?
|
|
14
|
+
- What linting rules do you enforce?
|
|
15
|
+
- What are your testing requirements?
|
|
16
|
+
- What code review standards apply?
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
(To be filled by the team)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Forbidden Patterns
|
|
24
|
+
|
|
25
|
+
<!-- Patterns that should never be used and why -->
|
|
26
|
+
|
|
27
|
+
(To be filled by the team)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Required Patterns
|
|
32
|
+
|
|
33
|
+
<!-- Patterns that must always be used -->
|
|
34
|
+
|
|
35
|
+
(To be filled by the team)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Testing Requirements
|
|
40
|
+
|
|
41
|
+
<!-- What level of testing is expected -->
|
|
42
|
+
|
|
43
|
+
(To be filled by the team)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Code Review Checklist
|
|
48
|
+
|
|
49
|
+
<!-- What reviewers should check -->
|
|
50
|
+
|
|
51
|
+
(To be filled by the team)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# State Management
|
|
2
|
+
|
|
3
|
+
> How state is managed in this project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
Document your project's state management conventions here.
|
|
11
|
+
|
|
12
|
+
Questions to answer:
|
|
13
|
+
- What state management solution do you use?
|
|
14
|
+
- How is local vs global state decided?
|
|
15
|
+
- How do you handle server state?
|
|
16
|
+
- What are the patterns for derived state?
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
(To be filled by the team)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## State Categories
|
|
24
|
+
|
|
25
|
+
<!-- Local state, global state, server state, URL state -->
|
|
26
|
+
|
|
27
|
+
(To be filled by the team)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## When to Use Global State
|
|
32
|
+
|
|
33
|
+
<!-- Criteria for promoting state to global -->
|
|
34
|
+
|
|
35
|
+
(To be filled by the team)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Server State
|
|
40
|
+
|
|
41
|
+
<!-- How server data is cached and synchronized -->
|
|
42
|
+
|
|
43
|
+
(To be filled by the team)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Common Mistakes
|
|
48
|
+
|
|
49
|
+
<!-- State management mistakes your team has made -->
|
|
50
|
+
|
|
51
|
+
(To be filled by the team)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Type Safety
|
|
2
|
+
|
|
3
|
+
> Type safety patterns in this project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
Document your project's type safety conventions here.
|
|
11
|
+
|
|
12
|
+
Questions to answer:
|
|
13
|
+
- What type system do you use?
|
|
14
|
+
- How are types organized?
|
|
15
|
+
- What validation library do you use?
|
|
16
|
+
- How do you handle type inference?
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
(To be filled by the team)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Type Organization
|
|
24
|
+
|
|
25
|
+
<!-- Where types are defined, shared types vs local types -->
|
|
26
|
+
|
|
27
|
+
(To be filled by the team)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Validation
|
|
32
|
+
|
|
33
|
+
<!-- Runtime validation patterns (Zod, Yup, io-ts, etc.) -->
|
|
34
|
+
|
|
35
|
+
(To be filled by the team)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Common Patterns
|
|
40
|
+
|
|
41
|
+
<!-- Type utilities, generics, type guards -->
|
|
42
|
+
|
|
43
|
+
(To be filled by the team)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Forbidden Patterns
|
|
48
|
+
|
|
49
|
+
<!-- any, type assertions, etc. -->
|
|
50
|
+
|
|
51
|
+
(To be filled by the team)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Code Reuse Thinking Guide
|
|
2
|
+
|
|
3
|
+
> **Purpose**: Stop and think before creating new code - does it already exist?
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
**Duplicated code is the #1 source of inconsistency bugs.**
|
|
10
|
+
|
|
11
|
+
When you copy-paste or rewrite existing logic:
|
|
12
|
+
- Bug fixes don't propagate
|
|
13
|
+
- Behavior diverges over time
|
|
14
|
+
- Codebase becomes harder to understand
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Before Writing New Code
|
|
19
|
+
|
|
20
|
+
### Step 1: Search First
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Search for similar function names
|
|
24
|
+
grep -r "functionName" .
|
|
25
|
+
|
|
26
|
+
# Search for similar logic
|
|
27
|
+
grep -r "keyword" .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Step 2: Ask These Questions
|
|
31
|
+
|
|
32
|
+
| Question | If Yes... |
|
|
33
|
+
|----------|-----------|
|
|
34
|
+
| Does a similar function exist? | Use or extend it |
|
|
35
|
+
| Is this pattern used elsewhere? | Follow the existing pattern |
|
|
36
|
+
| Could this be a shared utility? | Create it in the right place |
|
|
37
|
+
| Am I copying code from another file? | **STOP** - extract to shared |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Common Duplication Patterns
|
|
42
|
+
|
|
43
|
+
### Pattern 1: Copy-Paste Functions
|
|
44
|
+
|
|
45
|
+
**Bad**: Copying a validation function to another file
|
|
46
|
+
|
|
47
|
+
**Good**: Extract to shared utilities, import where needed
|
|
48
|
+
|
|
49
|
+
### Pattern 2: Similar Components
|
|
50
|
+
|
|
51
|
+
**Bad**: Creating a new component that's 80% similar to existing
|
|
52
|
+
|
|
53
|
+
**Good**: Extend existing component with props/variants
|
|
54
|
+
|
|
55
|
+
### Pattern 3: Repeated Constants
|
|
56
|
+
|
|
57
|
+
**Bad**: Defining the same constant in multiple files
|
|
58
|
+
|
|
59
|
+
**Good**: Single source of truth, import everywhere
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## When to Abstract
|
|
64
|
+
|
|
65
|
+
**Abstract when**:
|
|
66
|
+
- Same code appears 3+ times
|
|
67
|
+
- Logic is complex enough to have bugs
|
|
68
|
+
- Multiple people might need this
|
|
69
|
+
|
|
70
|
+
**Don't abstract when**:
|
|
71
|
+
- Only used once
|
|
72
|
+
- Trivial one-liner
|
|
73
|
+
- Abstraction would be more complex than duplication
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## After Batch Modifications
|
|
78
|
+
|
|
79
|
+
When you've made similar changes to multiple files:
|
|
80
|
+
|
|
81
|
+
1. **Review**: Did you catch all instances?
|
|
82
|
+
2. **Search**: Run grep to find any missed
|
|
83
|
+
3. **Consider**: Should this be abstracted?
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Checklist Before Commit
|
|
88
|
+
|
|
89
|
+
- [ ] Searched for existing similar code
|
|
90
|
+
- [ ] No copy-pasted logic that should be shared
|
|
91
|
+
- [ ] Constants defined in one place
|
|
92
|
+
- [ ] Similar patterns follow same structure
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Template File Registration (Trellis-specific)
|
|
97
|
+
|
|
98
|
+
When adding new files to `src/templates/trellis/scripts/`:
|
|
99
|
+
|
|
100
|
+
**CRITICAL**: New script files must be registered in THREE places:
|
|
101
|
+
|
|
102
|
+
1. **`src/templates/trellis/index.ts`**:
|
|
103
|
+
- Add `export const xxxScript = readTemplate("scripts/path/file.py");`
|
|
104
|
+
- Add to `getAllScripts()` Map
|
|
105
|
+
|
|
106
|
+
2. **`src/commands/update.ts`**:
|
|
107
|
+
- Add to import statement
|
|
108
|
+
- Add to `collectTemplateFiles()` Map
|
|
109
|
+
|
|
110
|
+
**Why this matters**: Without registration, `trellis update` won't sync the file to user projects. Bug fixes and features won't propagate.
|
|
111
|
+
|
|
112
|
+
### Quick Checklist for New Scripts
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# After adding a new .py file, verify:
|
|
116
|
+
grep -l "newFileName" src/templates/trellis/index.ts # Should match
|
|
117
|
+
grep -l "newFileName" src/commands/update.ts # Should match
|
|
118
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Code Reuse Thinking Guide
|
|
2
|
+
|
|
3
|
+
> **Purpose**: Stop and think before creating new code - does it already exist?
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
**Duplicated code is the #1 source of inconsistency bugs.**
|
|
10
|
+
|
|
11
|
+
When you copy-paste or rewrite existing logic:
|
|
12
|
+
- Bug fixes don't propagate
|
|
13
|
+
- Behavior diverges over time
|
|
14
|
+
- Codebase becomes harder to understand
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Before Writing New Code
|
|
19
|
+
|
|
20
|
+
### Step 1: Search First
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Search for similar function names
|
|
24
|
+
grep -r "functionName" .
|
|
25
|
+
|
|
26
|
+
# Search for similar logic
|
|
27
|
+
grep -r "keyword" .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Step 2: Ask These Questions
|
|
31
|
+
|
|
32
|
+
| Question | If Yes... |
|
|
33
|
+
|----------|-----------|
|
|
34
|
+
| Does a similar function exist? | Use or extend it |
|
|
35
|
+
| Is this pattern used elsewhere? | Follow the existing pattern |
|
|
36
|
+
| Could this be a shared utility? | Create it in the right place |
|
|
37
|
+
| Am I copying code from another file? | **STOP** - extract to shared |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Common Duplication Patterns
|
|
42
|
+
|
|
43
|
+
### Pattern 1: Copy-Paste Functions
|
|
44
|
+
|
|
45
|
+
**Bad**: Copying a validation function to another file
|
|
46
|
+
|
|
47
|
+
**Good**: Extract to shared utilities, import where needed
|
|
48
|
+
|
|
49
|
+
### Pattern 2: Similar Components
|
|
50
|
+
|
|
51
|
+
**Bad**: Creating a new component that's 80% similar to existing
|
|
52
|
+
|
|
53
|
+
**Good**: Extend existing component with props/variants
|
|
54
|
+
|
|
55
|
+
### Pattern 3: Repeated Constants
|
|
56
|
+
|
|
57
|
+
**Bad**: Defining the same constant in multiple files
|
|
58
|
+
|
|
59
|
+
**Good**: Single source of truth, import everywhere
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## When to Abstract
|
|
64
|
+
|
|
65
|
+
**Abstract when**:
|
|
66
|
+
- Same code appears 3+ times
|
|
67
|
+
- Logic is complex enough to have bugs
|
|
68
|
+
- Multiple people might need this
|
|
69
|
+
|
|
70
|
+
**Don't abstract when**:
|
|
71
|
+
- Only used once
|
|
72
|
+
- Trivial one-liner
|
|
73
|
+
- Abstraction would be more complex than duplication
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## After Batch Modifications
|
|
78
|
+
|
|
79
|
+
When you've made similar changes to multiple files:
|
|
80
|
+
|
|
81
|
+
1. **Review**: Did you catch all instances?
|
|
82
|
+
2. **Search**: Run grep to find any missed
|
|
83
|
+
3. **Consider**: Should this be abstracted?
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Checklist Before Commit
|
|
88
|
+
|
|
89
|
+
- [ ] Searched for existing similar code
|
|
90
|
+
- [ ] No copy-pasted logic that should be shared
|
|
91
|
+
- [ ] Constants defined in one place
|
|
92
|
+
- [ ] Similar patterns follow same structure
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Cross-Layer Thinking Guide
|
|
2
|
+
|
|
3
|
+
> **Purpose**: Think through data flow across layers before implementing.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
**Most bugs happen at layer boundaries**, not within layers.
|
|
10
|
+
|
|
11
|
+
Common cross-layer bugs:
|
|
12
|
+
- API returns format A, frontend expects format B
|
|
13
|
+
- Database stores X, service transforms to Y, but loses data
|
|
14
|
+
- Multiple layers implement the same logic differently
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Before Implementing Cross-Layer Features
|
|
19
|
+
|
|
20
|
+
### Step 1: Map the Data Flow
|
|
21
|
+
|
|
22
|
+
Draw out how data moves:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Source → Transform → Store → Retrieve → Transform → Display
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For each arrow, ask:
|
|
29
|
+
- What format is the data in?
|
|
30
|
+
- What could go wrong?
|
|
31
|
+
- Who is responsible for validation?
|
|
32
|
+
|
|
33
|
+
### Step 2: Identify Boundaries
|
|
34
|
+
|
|
35
|
+
| Boundary | Common Issues |
|
|
36
|
+
|----------|---------------|
|
|
37
|
+
| API ↔ Service | Type mismatches, missing fields |
|
|
38
|
+
| Service ↔ Database | Format conversions, null handling |
|
|
39
|
+
| Backend ↔ Frontend | Serialization, date formats |
|
|
40
|
+
| Component ↔ Component | Props shape changes |
|
|
41
|
+
|
|
42
|
+
### Step 3: Define Contracts
|
|
43
|
+
|
|
44
|
+
For each boundary:
|
|
45
|
+
- What is the exact input format?
|
|
46
|
+
- What is the exact output format?
|
|
47
|
+
- What errors can occur?
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Common Cross-Layer Mistakes
|
|
52
|
+
|
|
53
|
+
### Mistake 1: Implicit Format Assumptions
|
|
54
|
+
|
|
55
|
+
**Bad**: Assuming date format without checking
|
|
56
|
+
|
|
57
|
+
**Good**: Explicit format conversion at boundaries
|
|
58
|
+
|
|
59
|
+
### Mistake 2: Scattered Validation
|
|
60
|
+
|
|
61
|
+
**Bad**: Validating the same thing in multiple layers
|
|
62
|
+
|
|
63
|
+
**Good**: Validate once at the entry point
|
|
64
|
+
|
|
65
|
+
### Mistake 3: Leaky Abstractions
|
|
66
|
+
|
|
67
|
+
**Bad**: Component knows about database schema
|
|
68
|
+
|
|
69
|
+
**Good**: Each layer only knows its neighbors
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Checklist for Cross-Layer Features
|
|
74
|
+
|
|
75
|
+
Before implementation:
|
|
76
|
+
- [ ] Mapped the complete data flow
|
|
77
|
+
- [ ] Identified all layer boundaries
|
|
78
|
+
- [ ] Defined format at each boundary
|
|
79
|
+
- [ ] Decided where validation happens
|
|
80
|
+
|
|
81
|
+
After implementation:
|
|
82
|
+
- [ ] Tested with edge cases (null, empty, invalid)
|
|
83
|
+
- [ ] Verified error handling at each boundary
|
|
84
|
+
- [ ] Checked data survives round-trip
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## When to Create Flow Documentation
|
|
89
|
+
|
|
90
|
+
Create detailed flow docs when:
|
|
91
|
+
- Feature spans 3+ layers
|
|
92
|
+
- Multiple teams are involved
|
|
93
|
+
- Data format is complex
|
|
94
|
+
- Feature has caused bugs before
|