@fifine/aim-studio 0.0.2 → 0.0.3
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/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +123 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +91 -65
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/aim/scripts/common/paths.py +3 -2
- package/dist/templates/aim/scripts/export.py +427 -0
- package/dist/templates/claude/commands/aim/export.md +89 -115
- package/dist/templates/claude/commands/aim/onboard.md +10 -8
- package/dist/templates/claude/commands/aim/start.md +104 -37
- package/dist/templates/claude/hooks/inject-subagent-context.py +6 -10
- package/dist/templates/claude/hooks/session-start.py +134 -24
- package/dist/templates/markdown/index.d.ts +5 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +6 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/cli/directory-structure.md.txt +71 -0
- package/dist/templates/markdown/spec/cli/error-handling.md.txt +91 -0
- package/dist/templates/markdown/spec/cli/index.md.txt +37 -0
- package/dist/templates/markdown/spec/cli/options-flags.md.txt +71 -0
- package/dist/templates/markdown/spec/cli/output-formatting.md.txt +93 -0
- package/dist/utils/project-detector.d.ts +1 -1
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +20 -0
- package/dist/utils/project-detector.js.map +1 -1
- package/package.json +1 -1
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/break-loop.md +0 -125
- package/dist/templates/claude/commands/trellis/check-backend.md +0 -13
- package/dist/templates/claude/commands/trellis/check-cross-layer.md +0 -153
- package/dist/templates/claude/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/claude/commands/trellis/create-command.md +0 -154
- package/dist/templates/claude/commands/trellis/finish-work.md +0 -129
- package/dist/templates/claude/commands/trellis/integrate-skill.md +0 -219
- package/dist/templates/claude/commands/trellis/onboard.md +0 -358
- package/dist/templates/claude/commands/trellis/parallel.md +0 -193
- package/dist/templates/claude/commands/trellis/record-session.md +0 -62
- package/dist/templates/claude/commands/trellis/start.md +0 -280
- package/dist/templates/claude/commands/trellis/update-spec.md +0 -285
- package/dist/templates/trellis/gitignore.txt +0 -29
- package/dist/templates/trellis/index.d.ts +0 -49
- package/dist/templates/trellis/index.d.ts.map +0 -1
- package/dist/templates/trellis/index.js +0 -92
- package/dist/templates/trellis/index.js.map +0 -1
- package/dist/templates/trellis/scripts/__init__.py +0 -5
- package/dist/templates/trellis/scripts/add_session.py +0 -392
- package/dist/templates/trellis/scripts/common/__init__.py +0 -80
- package/dist/templates/trellis/scripts/common/cli_adapter.py +0 -435
- package/dist/templates/trellis/scripts/common/developer.py +0 -190
- package/dist/templates/trellis/scripts/common/git_context.py +0 -383
- package/dist/templates/trellis/scripts/common/paths.py +0 -347
- package/dist/templates/trellis/scripts/common/phase.py +0 -253
- package/dist/templates/trellis/scripts/common/registry.py +0 -366
- package/dist/templates/trellis/scripts/common/task_queue.py +0 -255
- package/dist/templates/trellis/scripts/common/task_utils.py +0 -178
- package/dist/templates/trellis/scripts/common/worktree.py +0 -219
- package/dist/templates/trellis/scripts/create_bootstrap.py +0 -290
- package/dist/templates/trellis/scripts/get_context.py +0 -16
- package/dist/templates/trellis/scripts/get_developer.py +0 -26
- package/dist/templates/trellis/scripts/init_developer.py +0 -51
- package/dist/templates/trellis/scripts/multi_agent/__init__.py +0 -5
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +0 -403
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +0 -329
- package/dist/templates/trellis/scripts/multi_agent/plan.py +0 -233
- package/dist/templates/trellis/scripts/multi_agent/start.py +0 -461
- package/dist/templates/trellis/scripts/multi_agent/status.py +0 -817
- package/dist/templates/trellis/scripts/task.py +0 -1056
- package/dist/templates/trellis/scripts-shell-archive/add-session.sh +0 -384
- package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +0 -129
- package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +0 -263
- package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +0 -208
- package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +0 -150
- package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +0 -247
- package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +0 -142
- package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +0 -151
- package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +0 -128
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +0 -299
- package/dist/templates/trellis/scripts-shell-archive/get-context.sh +0 -7
- package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +0 -15
- package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +0 -34
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +0 -396
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +0 -241
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +0 -207
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +0 -317
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +0 -828
- package/dist/templates/trellis/scripts-shell-archive/task.sh +0 -1204
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/workflow.md +0 -416
- package/dist/templates/trellis/worktree.yaml +0 -47
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# CLI Error Handling
|
|
2
|
+
|
|
3
|
+
> How errors are handled and reported.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Document your CLI's error handling patterns, exit codes, and error messages.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Exit Codes
|
|
14
|
+
|
|
15
|
+
| Code | Meaning |
|
|
16
|
+
|------|---------|
|
|
17
|
+
| `0` | Success |
|
|
18
|
+
| `1` | General error |
|
|
19
|
+
| `2` | Misuse of command |
|
|
20
|
+
| `3` | Internal error |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Error Categories
|
|
25
|
+
|
|
26
|
+
| Category | Exit Code | Example |
|
|
27
|
+
|----------|-----------|---------|
|
|
28
|
+
| Validation | `2` | Missing required argument |
|
|
29
|
+
| Not Found | `2` | File/directory not found |
|
|
30
|
+
| Permission | `2` | Cannot write to directory |
|
|
31
|
+
| Internal | `3` | Unexpected exception |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Error Message Format
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
❌ Error: <short description>
|
|
39
|
+
<detailed explanation (optional)>
|
|
40
|
+
<suggestion/fix (optional)>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Example
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
❌ Error: Template not found
|
|
47
|
+
Template "react" does not exist
|
|
48
|
+
Run "aim template list" to see available templates
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Patterns
|
|
54
|
+
|
|
55
|
+
### Throwing Errors
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { error as consoleError, exit } from 'node:process';
|
|
59
|
+
|
|
60
|
+
function validateArgs(args: string[]) {
|
|
61
|
+
if (!args.length) {
|
|
62
|
+
consoleError('Error: Missing required argument');
|
|
63
|
+
exit(2);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Try-Catch with Exit
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
try {
|
|
72
|
+
await doSomething();
|
|
73
|
+
} catch (err) {
|
|
74
|
+
consoleError(`Error: ${err.message}`);
|
|
75
|
+
exit(1);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Anti-Patterns
|
|
82
|
+
|
|
83
|
+
- ❌ Silent failures
|
|
84
|
+
- ❌ Stack traces exposed to users
|
|
85
|
+
- ❌ No error suggestions
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Add Your Examples
|
|
90
|
+
|
|
91
|
+
Replace with your actual error handling patterns.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# CLI Tool Development Guidelines
|
|
2
|
+
|
|
3
|
+
> Best practices for CLI tool development in this project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This directory contains guidelines for CLI tool 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) | Command organization, module layout | TODO |
|
|
18
|
+
| [Options & Flags](./options-flags.md) | Global options, flags, environment variables | TODO |
|
|
19
|
+
| [Output Formatting](./output-formatting.md) | Output formats, colors, user feedback | TODO |
|
|
20
|
+
| [Error Handling](./error-handling.md) | Error codes, messages, exit statuses | TODO |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## How to Fill These Guidelines
|
|
25
|
+
|
|
26
|
+
For each guideline file:
|
|
27
|
+
|
|
28
|
+
1. Document your project's **actual conventions** (not ideals)
|
|
29
|
+
2. Include **code examples** from your codebase
|
|
30
|
+
3. List **forbidden patterns** and why
|
|
31
|
+
4. Add **common mistakes** your team has made
|
|
32
|
+
|
|
33
|
+
The goal is to help AI assistants and new team members understand how YOUR project works.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
**Language**: All documentation should be written in **English**.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# CLI Options & Flags
|
|
2
|
+
|
|
3
|
+
> How command-line options and flags are defined.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Document your CLI's options, flags, and environment variables.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Global Options
|
|
14
|
+
|
|
15
|
+
| Option | Alias | Description | Default |
|
|
16
|
+
|--------|-------|-------------|---------|
|
|
17
|
+
| `--help` | `-h` | Show help | - |
|
|
18
|
+
| `--version` | `-v` | Show version | - |
|
|
19
|
+
| `--verbose` | - | Enable verbose output | `false` |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Environment Variables
|
|
24
|
+
|
|
25
|
+
| Variable | Description | Default |
|
|
26
|
+
|----------|-------------|---------|
|
|
27
|
+
| `AIM_HOME` | AIM Studio home directory | `~/.aim-studio` |
|
|
28
|
+
| `AIM_CONFIG` | Config file path | `~/.aim-studio/config.json` |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Command-Specific Options
|
|
33
|
+
|
|
34
|
+
### init Command
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
aim init -u username --template react
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Option | Alias | Description |
|
|
41
|
+
|--------|-------|-------------|
|
|
42
|
+
| `--user` | `-u` | Developer username |
|
|
43
|
+
| `--template` | - | Template to use |
|
|
44
|
+
| `--force` | - | Overwrite existing files |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Patterns
|
|
49
|
+
|
|
50
|
+
### Option Definition
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
// Example: using commander.js
|
|
54
|
+
program
|
|
55
|
+
.option('-u, --user <name>', 'Developer username')
|
|
56
|
+
.option('-t, --template <template>', 'Template name')
|
|
57
|
+
.option('-f, --force', 'Overwrite existing files');
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Anti-Patterns
|
|
63
|
+
|
|
64
|
+
- ❌ Too many required options
|
|
65
|
+
- ❌ Inconsistent option names (`--user` vs `--username`)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Add Your Examples
|
|
70
|
+
|
|
71
|
+
Replace with your actual option definitions.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# CLI Output Formatting
|
|
2
|
+
|
|
3
|
+
> How the CLI formats and presents output to users.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Document your CLI's output conventions including colors, formatting, and user feedback.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Output Types
|
|
14
|
+
|
|
15
|
+
| Type | Use Case |
|
|
16
|
+
|------|----------|
|
|
17
|
+
| `console.log` | Normal output, confirmations |
|
|
18
|
+
| `console.error` | Errors, warnings |
|
|
19
|
+
| `chalk` | Colored output for emphasis |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Color Conventions
|
|
24
|
+
|
|
25
|
+
| Color | Usage |
|
|
26
|
+
|-------|-------|
|
|
27
|
+
| `cyan` | Primary information, headers |
|
|
28
|
+
| `green` | Success messages, confirmations |
|
|
29
|
+
| `yellow` | Warnings |
|
|
30
|
+
| `red` | Errors |
|
|
31
|
+
| `gray` | Secondary information |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Example Output
|
|
36
|
+
|
|
37
|
+
### Success
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
✅ Project initialized successfully!
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Error
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
❌ Error: Directory already exists
|
|
47
|
+
Use --force to overwrite
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Progress
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
📦 Downloading template...
|
|
54
|
+
345.2 KB / 345.2 KB
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Patterns
|
|
60
|
+
|
|
61
|
+
### Using Chalk
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import chalk from 'chalk';
|
|
65
|
+
|
|
66
|
+
console.log(chalk.green('✓ ') + 'Success message');
|
|
67
|
+
console.log(chalk.red('✗ ') + 'Error message');
|
|
68
|
+
console.log(chalk.cyan('ℹ ') + 'Info message');
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Progress Indicators
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
// Using ora for spinners
|
|
75
|
+
import ora from 'ora';
|
|
76
|
+
|
|
77
|
+
const spinner = ora('Loading...').start();
|
|
78
|
+
spinner.succeed('Done!');
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Anti-Patterns
|
|
84
|
+
|
|
85
|
+
- ❌ No error messages
|
|
86
|
+
- ❌ Inconsistent colors
|
|
87
|
+
- ❌ Too much output (noise)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Add Your Examples
|
|
92
|
+
|
|
93
|
+
Replace with your actual output patterns.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project type detected by analyzing project files
|
|
3
3
|
*/
|
|
4
|
-
export type ProjectType = "frontend" | "backend" | "fullstack" | "story" | "unknown";
|
|
4
|
+
export type ProjectType = "frontend" | "backend" | "fullstack" | "story" | "cli" | "unknown";
|
|
5
5
|
/**
|
|
6
6
|
* Detect project type by analyzing project files
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../src/utils/project-detector.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../src/utils/project-detector.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,SAAS,GACT,WAAW,GACX,OAAO,GACP,KAAK,GACL,SAAS,CAAC;AA6Kd;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CA8B1D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAenE"}
|
|
@@ -97,6 +97,17 @@ const BACKEND_DEPS = [
|
|
|
97
97
|
"flask",
|
|
98
98
|
"django",
|
|
99
99
|
];
|
|
100
|
+
/**
|
|
101
|
+
* Files that indicate a CLI tool project (not frontend/backend)
|
|
102
|
+
*/
|
|
103
|
+
const CLI_INDICATORS = [
|
|
104
|
+
// Node.js CLI tools
|
|
105
|
+
"bin/aim.js",
|
|
106
|
+
"bin/trellis.js",
|
|
107
|
+
"bin/cli.js",
|
|
108
|
+
// Python CLI tools (click, typer, argparse)
|
|
109
|
+
"pyproject.toml", // Check for CLI tools in dependencies
|
|
110
|
+
];
|
|
100
111
|
/**
|
|
101
112
|
* Check if a file exists in the project directory
|
|
102
113
|
*/
|
|
@@ -150,6 +161,9 @@ function checkPackageJson(cwd) {
|
|
|
150
161
|
* @returns Detected project type
|
|
151
162
|
*/
|
|
152
163
|
export function detectProjectType(cwd) {
|
|
164
|
+
// Check for CLI tool indicators first (has bin/ directory)
|
|
165
|
+
const hasCliFiles = CLI_INDICATORS.some((f) => fileExists(cwd, f));
|
|
166
|
+
const hasBinDir = fs.existsSync(path.join(cwd, "bin"));
|
|
153
167
|
// Check for file indicators
|
|
154
168
|
const hasFrontendFiles = FRONTEND_INDICATORS.some((f) => fileExists(cwd, f));
|
|
155
169
|
const hasBackendFiles = BACKEND_INDICATORS.some((f) => fileExists(cwd, f));
|
|
@@ -157,6 +171,10 @@ export function detectProjectType(cwd) {
|
|
|
157
171
|
const { hasFrontend: hasFrontendDeps, hasBackend: hasBackendDeps } = checkPackageJson(cwd);
|
|
158
172
|
const isFrontend = hasFrontendFiles || hasFrontendDeps;
|
|
159
173
|
const isBackend = hasBackendFiles || hasBackendDeps;
|
|
174
|
+
// CLI tool detection: has bin/ directory but no frontend/backend indicators
|
|
175
|
+
if ((hasCliFiles || hasBinDir) && !isFrontend && !isBackend) {
|
|
176
|
+
return "cli";
|
|
177
|
+
}
|
|
160
178
|
if (isFrontend && isBackend) {
|
|
161
179
|
return "fullstack";
|
|
162
180
|
}
|
|
@@ -181,6 +199,8 @@ export function getProjectTypeDescription(type) {
|
|
|
181
199
|
return "Fullstack project (frontend + backend)";
|
|
182
200
|
case "story":
|
|
183
201
|
return "Story project (Comic/Novel creation)";
|
|
202
|
+
case "cli":
|
|
203
|
+
return "CLI tool project (command-line interface)";
|
|
184
204
|
case "unknown":
|
|
185
205
|
return "Unknown project type (defaults to fullstack)";
|
|
186
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-detector.js","sourceRoot":"","sources":["../../src/utils/project-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"project-detector.js","sourceRoot":"","sources":["../../src/utils/project-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAa7B;;GAEG;AACH,MAAM,mBAAmB,GAAG;IAC1B,sCAAsC;IACtC,cAAc,EAAE,uCAAuC;IACvD,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,kBAAkB;IAClB,o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AAkC;IAClC,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,GAChE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAExB,MAAM,UAAU,GAAG,gBAAgB,IAAI,eAAe,CAAC;IACvD,MAAM,SAAS,GAAG,eAAe,IAAI,cAAc,CAAC;IAEpD,4EAA4E;IAC5E,IAAI,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;QAC5B,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,OAAO,UAAU,CAAC;IACpB,CAAC;SAAM,IAAI,SAAS,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAiB;IACzD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU;YACb,OAAO,mCAAmC,CAAC;QAC7C,KAAK,SAAS;YACZ,OAAO,mCAAmC,CAAC;QAC7C,KAAK,WAAW;YACd,OAAO,wCAAwC,CAAC;QAClD,KAAK,OAAO;YACV,OAAO,sCAAsC,CAAC;QAChD,KAAK,KAAK;YACR,OAAO,2CAA2C,CAAC;QACrD,KAAK,SAAS;YACZ,OAAO,8CAA8C,CAAC;IAC1D,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Read the backend development guidelines before starting your development task.
|
|
2
|
-
|
|
3
|
-
Execute these steps:
|
|
4
|
-
1. Read `.trellis/spec/backend/index.md` to understand available guidelines
|
|
5
|
-
2. Based on your task, read the relevant guideline files:
|
|
6
|
-
- Database work → `.trellis/spec/backend/database-guidelines.md`
|
|
7
|
-
- Error handling → `.trellis/spec/backend/error-handling.md`
|
|
8
|
-
- Logging → `.trellis/spec/backend/logging-guidelines.md`
|
|
9
|
-
- Type questions → `.trellis/spec/backend/type-safety.md`
|
|
10
|
-
3. Understand the coding standards and patterns you need to follow
|
|
11
|
-
4. Then proceed with your development plan
|
|
12
|
-
|
|
13
|
-
This step is **mandatory** before writing any backend code.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Read the frontend development guidelines before starting your development task.
|
|
2
|
-
|
|
3
|
-
Execute these steps:
|
|
4
|
-
1. Read `.trellis/spec/frontend/index.md` to understand available guidelines
|
|
5
|
-
2. Based on your task, read the relevant guideline files:
|
|
6
|
-
- Component work → `.trellis/spec/frontend/component-guidelines.md`
|
|
7
|
-
- Hook work → `.trellis/spec/frontend/hook-guidelines.md`
|
|
8
|
-
- State management → `.trellis/spec/frontend/state-management.md`
|
|
9
|
-
- Type questions → `.trellis/spec/frontend/type-safety.md`
|
|
10
|
-
3. Understand the coding standards and patterns you need to follow
|
|
11
|
-
4. Then proceed with your development plan
|
|
12
|
-
|
|
13
|
-
This step is **mandatory** before writing any frontend code.
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# Break the Loop - Deep Bug Analysis
|
|
2
|
-
|
|
3
|
-
When debug is complete, use this command for deep analysis to break the "fix bug -> forget -> repeat" cycle.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Analysis Framework
|
|
8
|
-
|
|
9
|
-
Analyze the bug you just fixed from these 5 dimensions:
|
|
10
|
-
|
|
11
|
-
### 1. Root Cause Category
|
|
12
|
-
|
|
13
|
-
Which category does this bug belong to?
|
|
14
|
-
|
|
15
|
-
| Category | Characteristics | Example |
|
|
16
|
-
|----------|-----------------|---------|
|
|
17
|
-
| **A. Missing Spec** | No documentation on how to do it | New feature without checklist |
|
|
18
|
-
| **B. Cross-Layer Contract** | Interface between layers unclear | API returns different format than expected |
|
|
19
|
-
| **C. Change Propagation Failure** | Changed one place, missed others | Changed function signature, missed call sites |
|
|
20
|
-
| **D. Test Coverage Gap** | Unit test passes, integration fails | Works alone, breaks when combined |
|
|
21
|
-
| **E. Implicit Assumption** | Code relies on undocumented assumption | Timestamp seconds vs milliseconds |
|
|
22
|
-
|
|
23
|
-
### 2. Why Fixes Failed (if applicable)
|
|
24
|
-
|
|
25
|
-
If you tried multiple fixes before succeeding, analyze each failure:
|
|
26
|
-
|
|
27
|
-
- **Surface Fix**: Fixed symptom, not root cause
|
|
28
|
-
- **Incomplete Scope**: Found root cause, didn't cover all cases
|
|
29
|
-
- **Tool Limitation**: grep missed it, type check wasn't strict
|
|
30
|
-
- **Mental Model**: Kept looking in same layer, didn't think cross-layer
|
|
31
|
-
|
|
32
|
-
### 3. Prevention Mechanisms
|
|
33
|
-
|
|
34
|
-
What mechanisms would prevent this from happening again?
|
|
35
|
-
|
|
36
|
-
| Type | Description | Example |
|
|
37
|
-
|------|-------------|---------|
|
|
38
|
-
| **Documentation** | Write it down so people know | Update thinking guide |
|
|
39
|
-
| **Architecture** | Make the error impossible structurally | Type-safe wrappers |
|
|
40
|
-
| **Compile-time** | TypeScript strict, no any | Signature change causes compile error |
|
|
41
|
-
| **Runtime** | Monitoring, alerts, scans | Detect orphan entities |
|
|
42
|
-
| **Test Coverage** | E2E tests, integration tests | Verify full flow |
|
|
43
|
-
| **Code Review** | Checklist, PR template | "Did you check X?" |
|
|
44
|
-
|
|
45
|
-
### 4. Systematic Expansion
|
|
46
|
-
|
|
47
|
-
What broader problems does this bug reveal?
|
|
48
|
-
|
|
49
|
-
- **Similar Issues**: Where else might this problem exist?
|
|
50
|
-
- **Design Flaw**: Is there a fundamental architecture issue?
|
|
51
|
-
- **Process Flaw**: Is there a development process improvement?
|
|
52
|
-
- **Knowledge Gap**: Is the team missing some understanding?
|
|
53
|
-
|
|
54
|
-
### 5. Knowledge Capture
|
|
55
|
-
|
|
56
|
-
Solidify insights into the system:
|
|
57
|
-
|
|
58
|
-
- [ ] Update `.trellis/spec/guides/` thinking guides
|
|
59
|
-
- [ ] Update `.trellis/spec/backend/` or `frontend/` docs
|
|
60
|
-
- [ ] Create issue record (if applicable)
|
|
61
|
-
- [ ] Create feature ticket for root fix
|
|
62
|
-
- [ ] Update check commands if needed
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Output Format
|
|
67
|
-
|
|
68
|
-
Please output analysis in this format:
|
|
69
|
-
|
|
70
|
-
```markdown
|
|
71
|
-
## Bug Analysis: [Short Description]
|
|
72
|
-
|
|
73
|
-
### 1. Root Cause Category
|
|
74
|
-
- **Category**: [A/B/C/D/E] - [Category Name]
|
|
75
|
-
- **Specific Cause**: [Detailed description]
|
|
76
|
-
|
|
77
|
-
### 2. Why Fixes Failed (if applicable)
|
|
78
|
-
1. [First attempt]: [Why it failed]
|
|
79
|
-
2. [Second attempt]: [Why it failed]
|
|
80
|
-
...
|
|
81
|
-
|
|
82
|
-
### 3. Prevention Mechanisms
|
|
83
|
-
| Priority | Mechanism | Specific Action | Status |
|
|
84
|
-
|----------|-----------|-----------------|--------|
|
|
85
|
-
| P0 | ... | ... | TODO/DONE |
|
|
86
|
-
|
|
87
|
-
### 4. Systematic Expansion
|
|
88
|
-
- **Similar Issues**: [List places with similar problems]
|
|
89
|
-
- **Design Improvement**: [Architecture-level suggestions]
|
|
90
|
-
- **Process Improvement**: [Development process suggestions]
|
|
91
|
-
|
|
92
|
-
### 5. Knowledge Capture
|
|
93
|
-
- [ ] [Documents to update / tickets to create]
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Core Philosophy
|
|
99
|
-
|
|
100
|
-
> **The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.**
|
|
101
|
-
|
|
102
|
-
Three levels of insight:
|
|
103
|
-
1. **Tactical**: How to fix THIS bug
|
|
104
|
-
2. **Strategic**: How to prevent THIS CLASS of bugs
|
|
105
|
-
3. **Philosophical**: How to expand thinking patterns
|
|
106
|
-
|
|
107
|
-
30 minutes of analysis saves 30 hours of future debugging.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## After Analysis: Immediate Actions
|
|
112
|
-
|
|
113
|
-
**IMPORTANT**: After completing the analysis above, you MUST immediately:
|
|
114
|
-
|
|
115
|
-
1. **Update spec/guides** - Don't just list TODOs, actually update the relevant files:
|
|
116
|
-
- If it's a cross-platform issue → update `cross-platform-thinking-guide.md`
|
|
117
|
-
- If it's a cross-layer issue → update `cross-layer-thinking-guide.md`
|
|
118
|
-
- If it's a code reuse issue → update `code-reuse-thinking-guide.md`
|
|
119
|
-
- If it's domain-specific → update `backend/*.md` or `frontend/*.md`
|
|
120
|
-
|
|
121
|
-
2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/`
|
|
122
|
-
|
|
123
|
-
3. **Commit the spec updates** - This is the primary output, not just the analysis text
|
|
124
|
-
|
|
125
|
-
> **The analysis is worthless if it stays in chat. The value is in the updated specs.**
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Check if the code you just wrote follows the backend development guidelines.
|
|
2
|
-
|
|
3
|
-
Execute these steps:
|
|
4
|
-
1. Run `git status` to see modified files
|
|
5
|
-
2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
|
|
6
|
-
3. Based on what you changed, read the relevant guideline files:
|
|
7
|
-
- Database changes → `.trellis/spec/backend/database-guidelines.md`
|
|
8
|
-
- Error handling → `.trellis/spec/backend/error-handling.md`
|
|
9
|
-
- Logging changes → `.trellis/spec/backend/logging-guidelines.md`
|
|
10
|
-
- Type changes → `.trellis/spec/backend/type-safety.md`
|
|
11
|
-
- Any changes → `.trellis/spec/backend/quality-guidelines.md`
|
|
12
|
-
4. Review your code against the guidelines
|
|
13
|
-
5. Report any violations and fix them if found
|