@mindfoldhq/trellis 0.1.1 → 0.1.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/{templates/agents/bodies → .claude/agents}/check.md +7 -0
- package/dist/{templates/agents/bodies → .claude/agents}/debug.md +7 -0
- package/dist/{templates/agents/bodies → .claude/agents}/dispatch.md +11 -8
- package/dist/{templates/agents/bodies → .claude/agents}/implement.md +7 -0
- package/dist/.claude/agents/plan.md +396 -0
- package/dist/{templates/agents/bodies → .claude/agents}/research.md +7 -0
- package/dist/{templates/commands/common/check-cross-layer.txt → .claude/commands/check-cross-layer.md} +29 -29
- package/dist/{templates → .claude}/hooks/inject-subagent-context.py +63 -0
- package/dist/.cursor/commands/before-backend-dev.md +13 -0
- package/dist/.cursor/commands/before-frontend-dev.md +13 -0
- package/dist/.cursor/commands/break-loop.md +107 -0
- package/dist/.cursor/commands/check-backend.md +13 -0
- package/dist/.cursor/commands/check-cross-layer.md +153 -0
- package/dist/.cursor/commands/check-frontend.md +13 -0
- package/dist/.cursor/commands/create-command.md +154 -0
- package/dist/.cursor/commands/finish-work.md +129 -0
- package/dist/.cursor/commands/integrate-skill.md +219 -0
- package/dist/.cursor/commands/onboard-developer.md +355 -0
- package/dist/.cursor/commands/record-agent-flow.md +62 -0
- package/dist/.trellis/scripts/common/phase.sh +150 -0
- package/dist/{templates/scripts/feature.sh.txt → .trellis/scripts/feature.sh} +8 -3
- package/dist/{templates/scripts/multi-agent/cleanup.sh.txt → .trellis/scripts/multi-agent/cleanup.sh} +107 -18
- package/dist/.trellis/scripts/multi-agent/create-pr.sh +241 -0
- package/dist/.trellis/scripts/multi-agent/plan.sh +232 -0
- package/dist/{templates/scripts/multi-agent/start.sh.txt → .trellis/scripts/multi-agent/start.sh} +21 -0
- package/dist/{templates/scripts/multi-agent/status.sh.txt → .trellis/scripts/multi-agent/status.sh} +282 -10
- package/dist/.trellis/structure/backend/database-guidelines.md +51 -0
- package/dist/.trellis/structure/backend/directory-structure.md +209 -0
- package/dist/.trellis/structure/backend/error-handling.md +278 -0
- package/dist/.trellis/structure/backend/index.md +38 -0
- package/dist/.trellis/structure/backend/logging-guidelines.md +266 -0
- package/dist/.trellis/structure/backend/quality-guidelines.md +313 -0
- package/dist/.trellis/structure/frontend/component-guidelines.md +59 -0
- package/dist/.trellis/structure/frontend/directory-structure.md +54 -0
- package/dist/.trellis/structure/frontend/hook-guidelines.md +51 -0
- package/dist/.trellis/structure/frontend/index.md +39 -0
- package/dist/.trellis/structure/frontend/quality-guidelines.md +51 -0
- package/dist/.trellis/structure/frontend/state-management.md +51 -0
- package/dist/.trellis/structure/frontend/type-safety.md +51 -0
- package/dist/.trellis/structure/guides/code-reuse-thinking-guide.md +92 -0
- package/dist/.trellis/structure/guides/cross-layer-thinking-guide.md +94 -0
- package/dist/.trellis/structure/guides/index.md +79 -0
- package/dist/{templates/scripts/worktree.yaml.txt → .trellis/worktree.yaml} +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -16
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/claude.d.ts +17 -17
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +29 -59
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/cursor.d.ts +3 -3
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +11 -15
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/opencode.d.ts +11 -10
- package/dist/configurators/opencode.d.ts.map +1 -1
- package/dist/configurators/opencode.js +14 -33
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/workflow.d.ts +7 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +30 -99
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/extract.d.ts +73 -8
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +149 -10
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/markdown/gitignore.txt +6 -1
- package/dist/templates/markdown/index.d.ts +5 -1
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +54 -26
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/structure/backend/directory-structure.md.txt +6 -6
- package/dist/templates/markdown/structure/backend/error-handling.md.txt +8 -8
- package/dist/templates/markdown/structure/backend/index.md.txt +5 -5
- package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +8 -8
- package/dist/templates/markdown/structure/frontend/index.md.txt +6 -6
- package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +5 -5
- package/dist/templates/markdown/structure/guides/index.md.txt +7 -7
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/package.json +1 -1
- package/dist/configurators/templates.d.ts +0 -40
- package/dist/configurators/templates.d.ts.map +0 -1
- package/dist/configurators/templates.js +0 -67
- package/dist/configurators/templates.js.map +0 -1
- package/dist/templates/agents/index.d.ts +0 -42
- package/dist/templates/agents/index.d.ts.map +0 -1
- package/dist/templates/agents/index.js +0 -148
- package/dist/templates/agents/index.js.map +0 -1
- package/dist/templates/agents/metadata.d.ts +0 -48
- package/dist/templates/agents/metadata.d.ts.map +0 -1
- package/dist/templates/agents/metadata.js +0 -101
- package/dist/templates/agents/metadata.js.map +0 -1
- package/dist/templates/commands/index.d.ts +0 -48
- package/dist/templates/commands/index.d.ts.map +0 -1
- package/dist/templates/commands/index.js +0 -167
- package/dist/templates/commands/index.js.map +0 -1
- package/dist/templates/commands/opencode/start.md.txt +0 -127
- package/dist/templates/hooks/index.d.ts +0 -33
- package/dist/templates/hooks/index.d.ts.map +0 -1
- package/dist/templates/hooks/index.js +0 -53
- package/dist/templates/hooks/index.js.map +0 -1
- package/dist/templates/scripts/index.d.ts +0 -36
- package/dist/templates/scripts/index.d.ts.map +0 -1
- package/dist/templates/scripts/index.js +0 -41
- package/dist/templates/scripts/index.js.map +0 -1
- /package/dist/{templates/commands/common/before-backend-dev.txt → .claude/commands/before-backend-dev.md} +0 -0
- /package/dist/{templates/commands/common/before-frontend-dev.txt → .claude/commands/before-frontend-dev.md} +0 -0
- /package/dist/{templates/commands/common/break-loop.txt → .claude/commands/break-loop.md} +0 -0
- /package/dist/{templates/commands/common/check-backend.txt → .claude/commands/check-backend.md} +0 -0
- /package/dist/{templates/commands/common/check-frontend.txt → .claude/commands/check-frontend.md} +0 -0
- /package/dist/{templates/commands/common/create-command.txt → .claude/commands/create-command.md} +0 -0
- /package/dist/{templates/commands/common/finish-work.txt → .claude/commands/finish-work.md} +0 -0
- /package/dist/{templates/commands/common/integrate-skill.txt → .claude/commands/integrate-skill.md} +0 -0
- /package/dist/{templates/commands/common/onboard-developer.txt → .claude/commands/onboard-developer.md} +0 -0
- /package/dist/{templates/commands/claude/parallel.md.txt → .claude/commands/parallel.md} +0 -0
- /package/dist/{templates/commands/common/record-agent-flow.txt → .claude/commands/record-agent-flow.md} +0 -0
- /package/dist/{templates/commands/claude/start.md.txt → .claude/commands/start.md} +0 -0
- /package/dist/{templates/hooks → .claude}/settings.json +0 -0
- /package/dist/{templates/commands/cursor/start.md.txt → .cursor/commands/start.md} +0 -0
- /package/dist/{templates/markdown/agent-traces-index.md.txt → .trellis/agent-traces/index.md} +0 -0
- /package/dist/{templates/scripts/add-session.sh.txt → .trellis/scripts/add-session.sh} +0 -0
- /package/dist/{templates/scripts/common/developer.sh.txt → .trellis/scripts/common/developer.sh} +0 -0
- /package/dist/{templates/scripts/common/git-context.sh.txt → .trellis/scripts/common/git-context.sh} +0 -0
- /package/dist/{templates/scripts/common/paths.sh.txt → .trellis/scripts/common/paths.sh} +0 -0
- /package/dist/{templates/scripts/common/worktree.sh.txt → .trellis/scripts/common/worktree.sh} +0 -0
- /package/dist/{templates/scripts/create-bootstrap.sh.txt → .trellis/scripts/create-bootstrap.sh} +0 -0
- /package/dist/{templates/scripts/get-context.sh.txt → .trellis/scripts/get-context.sh} +0 -0
- /package/dist/{templates/scripts/get-developer.sh.txt → .trellis/scripts/get-developer.sh} +0 -0
- /package/dist/{templates/scripts/init-developer.sh.txt → .trellis/scripts/init-developer.sh} +0 -0
- /package/dist/{templates/markdown/workflow.md.txt → .trellis/workflow.md} +0 -0
- /package/dist/templates/markdown/{agents.md.txt → agents.md} +0 -0
- /package/dist/templates/markdown/{init-agent.md.txt → init-agent.md} +0 -0
|
@@ -1,22 +1,87 @@
|
|
|
1
1
|
type TemplateCategory = "scripts" | "markdown" | "commands";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Get the path to the .trellis directory.
|
|
4
|
+
*
|
|
5
|
+
* This works in both:
|
|
6
|
+
* - Development: reads from project root .trellis/
|
|
7
|
+
* - Installed package: reads from dist/.trellis/
|
|
8
|
+
*
|
|
9
|
+
* The directory structure is:
|
|
10
|
+
* - Development: src/templates/extract.ts -> ../../.trellis
|
|
11
|
+
* - Built: dist/templates/extract.js -> ../.trellis
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTrellisSourcePath(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get the path to the .cursor directory.
|
|
16
|
+
*
|
|
17
|
+
* This works in both:
|
|
18
|
+
* - Development: reads from project root .cursor/
|
|
19
|
+
* - Installed package: reads from dist/.cursor/
|
|
20
|
+
*
|
|
21
|
+
* The directory structure is:
|
|
22
|
+
* - Development: src/templates/extract.ts -> ../../.cursor
|
|
23
|
+
* - Built: dist/templates/extract.js -> ../.cursor
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCursorSourcePath(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the path to the .claude directory.
|
|
28
|
+
*
|
|
29
|
+
* This works in both:
|
|
30
|
+
* - Development: reads from project root .claude/
|
|
31
|
+
* - Installed package: reads from dist/.claude/
|
|
32
|
+
*
|
|
33
|
+
* The directory structure is:
|
|
34
|
+
* - Development: src/templates/extract.ts -> ../../.claude
|
|
35
|
+
* - Built: dist/templates/extract.js -> ../.claude
|
|
36
|
+
*/
|
|
37
|
+
export declare function getClaudeSourcePath(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Read a file from the .trellis directory
|
|
40
|
+
* @param relativePath - Path relative to .trellis/ (e.g., 'scripts/feature.sh')
|
|
41
|
+
* @returns File content as string
|
|
42
|
+
*/
|
|
43
|
+
export declare function readTrellisFile(relativePath: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Read template content from a .txt file in commands directory
|
|
46
|
+
* @param category - Template category (only 'commands' uses .txt files now)
|
|
47
|
+
* @param filename - Template filename (e.g., 'common/finish-work.txt')
|
|
6
48
|
* @returns File content as string
|
|
7
49
|
*/
|
|
8
50
|
export declare function readTemplate(category: TemplateCategory, filename: string): string;
|
|
9
51
|
/**
|
|
10
|
-
* Helper to read script template
|
|
52
|
+
* Helper to read script template from .trellis/scripts/
|
|
53
|
+
* @param relativePath - Path relative to .trellis/scripts/ (e.g., 'feature.sh')
|
|
11
54
|
*/
|
|
12
|
-
export declare function readScript(
|
|
55
|
+
export declare function readScript(relativePath: string): string;
|
|
13
56
|
/**
|
|
14
|
-
* Helper to read markdown template
|
|
57
|
+
* Helper to read markdown template from .trellis/
|
|
58
|
+
* @param relativePath - Path relative to .trellis/ (e.g., 'workflow.md')
|
|
15
59
|
*/
|
|
16
|
-
export declare function readMarkdown(
|
|
60
|
+
export declare function readMarkdown(relativePath: string): string;
|
|
17
61
|
/**
|
|
18
|
-
* Helper to read command template
|
|
62
|
+
* Helper to read command template (these still use .txt files in src/templates/commands/)
|
|
19
63
|
*/
|
|
20
64
|
export declare function readCommand(filename: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Read a file from the .cursor directory (dogfooding)
|
|
67
|
+
* @param relativePath - Path relative to .cursor/ (e.g., 'commands/start.md')
|
|
68
|
+
* @returns File content as string
|
|
69
|
+
*/
|
|
70
|
+
export declare function readCursorFile(relativePath: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Read a file from the .claude directory (dogfooding)
|
|
73
|
+
* @param relativePath - Path relative to .claude/ (e.g., 'commands/start.md')
|
|
74
|
+
* @returns File content as string
|
|
75
|
+
*/
|
|
76
|
+
export declare function readClaudeFile(relativePath: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Copy a directory from .trellis/ to target, making scripts executable
|
|
79
|
+
* @param srcRelativePath - Source path relative to .trellis/ (e.g., 'scripts')
|
|
80
|
+
* @param destPath - Absolute destination path
|
|
81
|
+
* @param options - Copy options
|
|
82
|
+
*/
|
|
83
|
+
export declare function copyTrellisDir(srcRelativePath: string, destPath: string, options?: {
|
|
84
|
+
executable?: boolean;
|
|
85
|
+
}): void;
|
|
21
86
|
export {};
|
|
22
87
|
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAOA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAOA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAoB7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAgB5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAgB5C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,IAAI,CAIN"}
|
|
@@ -4,9 +4,94 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
const __filename = fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = path.dirname(__filename);
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Get the path to the .trellis directory.
|
|
8
|
+
*
|
|
9
|
+
* This works in both:
|
|
10
|
+
* - Development: reads from project root .trellis/
|
|
11
|
+
* - Installed package: reads from dist/.trellis/
|
|
12
|
+
*
|
|
13
|
+
* The directory structure is:
|
|
14
|
+
* - Development: src/templates/extract.ts -> ../../.trellis
|
|
15
|
+
* - Built: dist/templates/extract.js -> ../.trellis
|
|
16
|
+
*/
|
|
17
|
+
export function getTrellisSourcePath() {
|
|
18
|
+
// In development: __dirname is src/templates
|
|
19
|
+
// In production: __dirname is dist/templates
|
|
20
|
+
// Either way, go up to find .trellis at the package root
|
|
21
|
+
// First, try the production path (dist/templates -> dist/.trellis)
|
|
22
|
+
const prodPath = path.join(__dirname, "..", ".trellis");
|
|
23
|
+
if (fs.existsSync(prodPath)) {
|
|
24
|
+
return prodPath;
|
|
25
|
+
}
|
|
26
|
+
// Fall back to development path (src/templates -> ../../.trellis)
|
|
27
|
+
const devPath = path.join(__dirname, "..", "..", ".trellis");
|
|
28
|
+
if (fs.existsSync(devPath)) {
|
|
29
|
+
return devPath;
|
|
30
|
+
}
|
|
31
|
+
throw new Error("Could not find .trellis directory. Expected at dist/.trellis or project root.");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the path to the .cursor directory.
|
|
35
|
+
*
|
|
36
|
+
* This works in both:
|
|
37
|
+
* - Development: reads from project root .cursor/
|
|
38
|
+
* - Installed package: reads from dist/.cursor/
|
|
39
|
+
*
|
|
40
|
+
* The directory structure is:
|
|
41
|
+
* - Development: src/templates/extract.ts -> ../../.cursor
|
|
42
|
+
* - Built: dist/templates/extract.js -> ../.cursor
|
|
43
|
+
*/
|
|
44
|
+
export function getCursorSourcePath() {
|
|
45
|
+
// First, try the production path (dist/templates -> dist/.cursor)
|
|
46
|
+
const prodPath = path.join(__dirname, "..", ".cursor");
|
|
47
|
+
if (fs.existsSync(prodPath)) {
|
|
48
|
+
return prodPath;
|
|
49
|
+
}
|
|
50
|
+
// Fall back to development path (src/templates -> ../../.cursor)
|
|
51
|
+
const devPath = path.join(__dirname, "..", "..", ".cursor");
|
|
52
|
+
if (fs.existsSync(devPath)) {
|
|
53
|
+
return devPath;
|
|
54
|
+
}
|
|
55
|
+
throw new Error("Could not find .cursor directory. Expected at dist/.cursor or project root.");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the path to the .claude directory.
|
|
59
|
+
*
|
|
60
|
+
* This works in both:
|
|
61
|
+
* - Development: reads from project root .claude/
|
|
62
|
+
* - Installed package: reads from dist/.claude/
|
|
63
|
+
*
|
|
64
|
+
* The directory structure is:
|
|
65
|
+
* - Development: src/templates/extract.ts -> ../../.claude
|
|
66
|
+
* - Built: dist/templates/extract.js -> ../.claude
|
|
67
|
+
*/
|
|
68
|
+
export function getClaudeSourcePath() {
|
|
69
|
+
// First, try the production path (dist/templates -> dist/.claude)
|
|
70
|
+
const prodPath = path.join(__dirname, "..", ".claude");
|
|
71
|
+
if (fs.existsSync(prodPath)) {
|
|
72
|
+
return prodPath;
|
|
73
|
+
}
|
|
74
|
+
// Fall back to development path (src/templates -> ../../.claude)
|
|
75
|
+
const devPath = path.join(__dirname, "..", "..", ".claude");
|
|
76
|
+
if (fs.existsSync(devPath)) {
|
|
77
|
+
return devPath;
|
|
78
|
+
}
|
|
79
|
+
throw new Error("Could not find .claude directory. Expected at dist/.claude or project root.");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Read a file from the .trellis directory
|
|
83
|
+
* @param relativePath - Path relative to .trellis/ (e.g., 'scripts/feature.sh')
|
|
84
|
+
* @returns File content as string
|
|
85
|
+
*/
|
|
86
|
+
export function readTrellisFile(relativePath) {
|
|
87
|
+
const trellisPath = getTrellisSourcePath();
|
|
88
|
+
const filePath = path.join(trellisPath, relativePath);
|
|
89
|
+
return fs.readFileSync(filePath, "utf-8");
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Read template content from a .txt file in commands directory
|
|
93
|
+
* @param category - Template category (only 'commands' uses .txt files now)
|
|
94
|
+
* @param filename - Template filename (e.g., 'common/finish-work.txt')
|
|
10
95
|
* @returns File content as string
|
|
11
96
|
*/
|
|
12
97
|
export function readTemplate(category, filename) {
|
|
@@ -14,21 +99,75 @@ export function readTemplate(category, filename) {
|
|
|
14
99
|
return fs.readFileSync(templatePath, "utf-8");
|
|
15
100
|
}
|
|
16
101
|
/**
|
|
17
|
-
* Helper to read script template
|
|
102
|
+
* Helper to read script template from .trellis/scripts/
|
|
103
|
+
* @param relativePath - Path relative to .trellis/scripts/ (e.g., 'feature.sh')
|
|
18
104
|
*/
|
|
19
|
-
export function readScript(
|
|
20
|
-
return
|
|
105
|
+
export function readScript(relativePath) {
|
|
106
|
+
return readTrellisFile(`scripts/${relativePath}`);
|
|
21
107
|
}
|
|
22
108
|
/**
|
|
23
|
-
* Helper to read markdown template
|
|
109
|
+
* Helper to read markdown template from .trellis/
|
|
110
|
+
* @param relativePath - Path relative to .trellis/ (e.g., 'workflow.md')
|
|
24
111
|
*/
|
|
25
|
-
export function readMarkdown(
|
|
26
|
-
return
|
|
112
|
+
export function readMarkdown(relativePath) {
|
|
113
|
+
return readTrellisFile(relativePath);
|
|
27
114
|
}
|
|
28
115
|
/**
|
|
29
|
-
* Helper to read command template
|
|
116
|
+
* Helper to read command template (these still use .txt files in src/templates/commands/)
|
|
30
117
|
*/
|
|
31
118
|
export function readCommand(filename) {
|
|
32
119
|
return readTemplate("commands", filename);
|
|
33
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Read a file from the .cursor directory (dogfooding)
|
|
123
|
+
* @param relativePath - Path relative to .cursor/ (e.g., 'commands/start.md')
|
|
124
|
+
* @returns File content as string
|
|
125
|
+
*/
|
|
126
|
+
export function readCursorFile(relativePath) {
|
|
127
|
+
const cursorPath = getCursorSourcePath();
|
|
128
|
+
const filePath = path.join(cursorPath, relativePath);
|
|
129
|
+
return fs.readFileSync(filePath, "utf-8");
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Read a file from the .claude directory (dogfooding)
|
|
133
|
+
* @param relativePath - Path relative to .claude/ (e.g., 'commands/start.md')
|
|
134
|
+
* @returns File content as string
|
|
135
|
+
*/
|
|
136
|
+
export function readClaudeFile(relativePath) {
|
|
137
|
+
const claudePath = getClaudeSourcePath();
|
|
138
|
+
const filePath = path.join(claudePath, relativePath);
|
|
139
|
+
return fs.readFileSync(filePath, "utf-8");
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Copy a directory from .trellis/ to target, making scripts executable
|
|
143
|
+
* @param srcRelativePath - Source path relative to .trellis/ (e.g., 'scripts')
|
|
144
|
+
* @param destPath - Absolute destination path
|
|
145
|
+
* @param options - Copy options
|
|
146
|
+
*/
|
|
147
|
+
export function copyTrellisDir(srcRelativePath, destPath, options) {
|
|
148
|
+
const trellisPath = getTrellisSourcePath();
|
|
149
|
+
const srcPath = path.join(trellisPath, srcRelativePath);
|
|
150
|
+
copyDirRecursive(srcPath, destPath, options);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Recursively copy directory with options
|
|
154
|
+
*/
|
|
155
|
+
function copyDirRecursive(src, dest, options) {
|
|
156
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
157
|
+
for (const entry of fs.readdirSync(src)) {
|
|
158
|
+
const srcPath = path.join(src, entry);
|
|
159
|
+
const destPath = path.join(dest, entry);
|
|
160
|
+
const stat = fs.statSync(srcPath);
|
|
161
|
+
if (stat.isDirectory()) {
|
|
162
|
+
copyDirRecursive(srcPath, destPath, options);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
fs.copyFileSync(srcPath, destPath);
|
|
166
|
+
// Make shell scripts executable
|
|
167
|
+
if (options?.executable && entry.endsWith(".sh")) {
|
|
168
|
+
fs.chmodSync(destPath, 0o755);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
34
173
|
//# sourceMappingURL=extract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAI3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,QAA0B,EAC1B,QAAgB;IAEhB,MAAM,YAAY,GAAG,IAAI,CAAC,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,CAAC;IACxD,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CACvB,GAAW,EACX,IAAY,EACZ,OAAkC;IAElC,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExC,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACvB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACnC,gCAAgC;YAChC,IAAI,OAAO,EAAE,UAAU,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjD,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Markdown templates for Trellis workflow
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* Some templates are dogfooded from .trellis/ (workflow.md, .gitignore, agent-traces/index.md)
|
|
5
|
+
* Others are standalone templates in src/templates/markdown/ (init-agent.md, agents.md)
|
|
6
|
+
* Structure templates use .md.txt extension as they are generic templates for new projects.
|
|
4
7
|
*/
|
|
5
8
|
export declare const agentProgressIndexContent: string;
|
|
6
9
|
export declare const workflowMdContent: string;
|
|
7
10
|
export declare const workflowGitignoreContent: string;
|
|
8
11
|
export declare const initAgentContent: string;
|
|
9
12
|
export declare const agentsMdContent: string;
|
|
13
|
+
export declare const worktreeYamlContent: string;
|
|
10
14
|
export declare const backendIndexContent: string;
|
|
11
15
|
export declare const backendDirectoryStructureContent: string;
|
|
12
16
|
export declare const backendDatabaseGuidelinesContent: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuBH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,MAAuC,CAAC;AAGxE,eAAO,MAAM,wBAAwB,EAAE,MACH,CAAC;AAOrC,eAAO,MAAM,gBAAgB,EAAE,MAA2C,CAAC;AAC3E,eAAO,MAAM,eAAe,EAAE,MAAuC,CAAC;AAGtE,eAAO,MAAM,mBAAmB,EAAE,MACM,CAAC;AAQzC,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,MAElD,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC"}
|
|
@@ -1,33 +1,61 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Markdown templates for Trellis workflow
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* Some templates are dogfooded from .trellis/ (workflow.md, .gitignore, agent-traces/index.md)
|
|
5
|
+
* Others are standalone templates in src/templates/markdown/ (init-agent.md, agents.md)
|
|
6
|
+
* Structure templates use .md.txt extension as they are generic templates for new projects.
|
|
4
7
|
*/
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { readTrellisFile } from "../extract.js";
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
14
|
+
/**
|
|
15
|
+
* Read a template file from src/templates/markdown/
|
|
16
|
+
*/
|
|
17
|
+
function readLocalTemplate(filename) {
|
|
18
|
+
const filePath = join(__dirname, filename);
|
|
19
|
+
return readFileSync(filePath, "utf-8");
|
|
20
|
+
}
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// Dogfooded files (from .trellis/)
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Agent progress index (from .trellis/agent-traces/index.md)
|
|
25
|
+
export const agentProgressIndexContent = readTrellisFile("agent-traces/index.md");
|
|
26
|
+
// Workflow documentation (from .trellis/workflow.md)
|
|
27
|
+
export const workflowMdContent = readTrellisFile("workflow.md");
|
|
28
|
+
// Gitignore (template file - .gitignore is ignored by npm)
|
|
29
|
+
export const workflowGitignoreContent = readLocalTemplate("gitignore.txt");
|
|
30
|
+
// =============================================================================
|
|
31
|
+
// Standalone templates (not dogfooded)
|
|
32
|
+
// =============================================================================
|
|
33
|
+
// Root files for new projects
|
|
34
|
+
export const initAgentContent = readLocalTemplate("init-agent.md");
|
|
35
|
+
export const agentsMdContent = readLocalTemplate("agents.md");
|
|
36
|
+
// Worktree config template (generic, not dogfooded from Trellis project)
|
|
37
|
+
export const worktreeYamlContent = readLocalTemplate("worktree.yaml.txt");
|
|
38
|
+
// =============================================================================
|
|
39
|
+
// Structure templates (generic templates from .txt files)
|
|
40
|
+
// These are NOT dogfooded - they are generic templates for new projects
|
|
41
|
+
// =============================================================================
|
|
14
42
|
// Backend structure (multi-doc format)
|
|
15
|
-
export const backendIndexContent =
|
|
16
|
-
export const backendDirectoryStructureContent =
|
|
17
|
-
export const backendDatabaseGuidelinesContent =
|
|
18
|
-
export const backendLoggingGuidelinesContent =
|
|
19
|
-
export const backendQualityGuidelinesContent =
|
|
20
|
-
export const backendErrorHandlingContent =
|
|
43
|
+
export const backendIndexContent = readLocalTemplate("structure/backend/index.md.txt");
|
|
44
|
+
export const backendDirectoryStructureContent = readLocalTemplate("structure/backend/directory-structure.md.txt");
|
|
45
|
+
export const backendDatabaseGuidelinesContent = readLocalTemplate("structure/backend/database-guidelines.md.txt");
|
|
46
|
+
export const backendLoggingGuidelinesContent = readLocalTemplate("structure/backend/logging-guidelines.md.txt");
|
|
47
|
+
export const backendQualityGuidelinesContent = readLocalTemplate("structure/backend/quality-guidelines.md.txt");
|
|
48
|
+
export const backendErrorHandlingContent = readLocalTemplate("structure/backend/error-handling.md.txt");
|
|
21
49
|
// Frontend structure (multi-doc format)
|
|
22
|
-
export const frontendIndexContent =
|
|
23
|
-
export const frontendDirectoryStructureContent =
|
|
24
|
-
export const frontendTypeSafetyContent =
|
|
25
|
-
export const frontendHookGuidelinesContent =
|
|
26
|
-
export const frontendComponentGuidelinesContent =
|
|
27
|
-
export const frontendQualityGuidelinesContent =
|
|
28
|
-
export const frontendStateManagementContent =
|
|
50
|
+
export const frontendIndexContent = readLocalTemplate("structure/frontend/index.md.txt");
|
|
51
|
+
export const frontendDirectoryStructureContent = readLocalTemplate("structure/frontend/directory-structure.md.txt");
|
|
52
|
+
export const frontendTypeSafetyContent = readLocalTemplate("structure/frontend/type-safety.md.txt");
|
|
53
|
+
export const frontendHookGuidelinesContent = readLocalTemplate("structure/frontend/hook-guidelines.md.txt");
|
|
54
|
+
export const frontendComponentGuidelinesContent = readLocalTemplate("structure/frontend/component-guidelines.md.txt");
|
|
55
|
+
export const frontendQualityGuidelinesContent = readLocalTemplate("structure/frontend/quality-guidelines.md.txt");
|
|
56
|
+
export const frontendStateManagementContent = readLocalTemplate("structure/frontend/state-management.md.txt");
|
|
29
57
|
// Guides structure
|
|
30
|
-
export const guidesIndexContent =
|
|
31
|
-
export const guidesCrossLayerThinkingGuideContent =
|
|
32
|
-
export const guidesCodeReuseThinkingGuideContent =
|
|
58
|
+
export const guidesIndexContent = readLocalTemplate("structure/guides/index.md.txt");
|
|
59
|
+
export const guidesCrossLayerThinkingGuideContent = readLocalTemplate("structure/guides/cross-layer-thinking-guide.md.txt");
|
|
60
|
+
export const guidesCodeReuseThinkingGuideContent = readLocalTemplate("structure/guides/code-reuse-thinking-guide.md.txt");
|
|
33
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,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8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,iBAAiB,CACvE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAW,iBAAiB,CACtE,6CAA6C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAW,iBAAiB,CACtE,6CAA6C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAW,iBAAiB,CAClE,yCAAyC,CAC1C,CAAC;AAEF,wCAAwC;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAW,iBAAiB,CAC3D,iCAAiC,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAAW,iBAAiB,CACxE,+CAA+C,CAChD,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAW,iBAAiB,CAChE,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAW,iBAAiB,CACpE,2CAA2C,CAC5C,CAAC;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAW,iBAAiB,CACzE,gDAAgD,CACjD,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,iBAAiB,CACvE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAW,iBAAiB,CACrE,4CAA4C,CAC7C,CAAC;AAEF,mBAAmB;AACnB,MAAM,CAAC,MAAM,kBAAkB,GAAW,iBAAiB,CACzD,+BAA+B,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,oCAAoC,GAAW,iBAAiB,CAC3E,oDAAoD,CACrD,CAAC;AACF,MAAM,CAAC,MAAM,mCAAmC,GAAW,iBAAiB,CAC1E,mDAAmD,CACpD,CAAC"}
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
Document your project's backend directory structure here.
|
|
11
11
|
|
|
12
12
|
Questions to answer:
|
|
13
|
-
-
|
|
14
|
-
- Where does business logic
|
|
15
|
-
-
|
|
16
|
-
-
|
|
13
|
+
- How are modules/packages organized?
|
|
14
|
+
- Where does business logic live?
|
|
15
|
+
- Where are API endpoints defined?
|
|
16
|
+
- How are utilities and helpers organized?
|
|
17
17
|
-->
|
|
18
18
|
|
|
19
19
|
(To be filled by the team)
|
|
@@ -24,7 +24,7 @@ Questions to answer:
|
|
|
24
24
|
|
|
25
25
|
```
|
|
26
26
|
<!-- Replace with your actual structure -->
|
|
27
|
-
|
|
27
|
+
src/
|
|
28
28
|
├── ...
|
|
29
29
|
└── ...
|
|
30
30
|
```
|
|
@@ -33,7 +33,7 @@ server/
|
|
|
33
33
|
|
|
34
34
|
## Module Organization
|
|
35
35
|
|
|
36
|
-
<!-- How should new features be organized? -->
|
|
36
|
+
<!-- How should new features/modules be organized? -->
|
|
37
37
|
|
|
38
38
|
(To be filled by the team)
|
|
39
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Error Handling
|
|
2
2
|
|
|
3
|
-
> How errors are handled in this project
|
|
3
|
+
> How errors are handled in this project.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
Document your project's error handling conventions here.
|
|
11
11
|
|
|
12
12
|
Questions to answer:
|
|
13
|
-
- What error types do you
|
|
13
|
+
- What error types do you define?
|
|
14
|
+
- How are errors propagated?
|
|
14
15
|
- How are errors logged?
|
|
15
16
|
- How are errors returned to clients?
|
|
16
|
-
- How do you handle unexpected errors?
|
|
17
17
|
-->
|
|
18
18
|
|
|
19
19
|
(To be filled by the team)
|
|
@@ -22,23 +22,23 @@ Questions to answer:
|
|
|
22
22
|
|
|
23
23
|
## Error Types
|
|
24
24
|
|
|
25
|
-
<!-- Custom error classes
|
|
25
|
+
<!-- Custom error classes/types -->
|
|
26
26
|
|
|
27
27
|
(To be filled by the team)
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
## Error
|
|
31
|
+
## Error Handling Patterns
|
|
32
32
|
|
|
33
|
-
<!--
|
|
33
|
+
<!-- Try-catch patterns, error propagation -->
|
|
34
34
|
|
|
35
35
|
(To be filled by the team)
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## API Error Responses
|
|
40
40
|
|
|
41
|
-
<!--
|
|
41
|
+
<!-- Standard error response format -->
|
|
42
42
|
|
|
43
43
|
(To be filled by the team)
|
|
44
44
|
|
|
@@ -14,11 +14,11 @@ This directory contains guidelines for backend development. Fill in each file wi
|
|
|
14
14
|
|
|
15
15
|
| Guide | Description | Status |
|
|
16
16
|
|-------|-------------|--------|
|
|
17
|
-
| [Directory Structure](./directory-structure.md) | Module organization and file layout |
|
|
18
|
-
| [Database Guidelines](./database-guidelines.md) | ORM patterns, queries, migrations |
|
|
19
|
-
| [Error Handling](./error-handling.md) | Error types, handling strategies |
|
|
20
|
-
| [Quality Guidelines](./quality-guidelines.md) | Code standards, forbidden patterns |
|
|
21
|
-
| [Logging Guidelines](./logging-guidelines.md) | Structured logging, log levels |
|
|
17
|
+
| [Directory Structure](./directory-structure.md) | Module organization and file layout | To fill |
|
|
18
|
+
| [Database Guidelines](./database-guidelines.md) | ORM patterns, queries, migrations | To fill |
|
|
19
|
+
| [Error Handling](./error-handling.md) | Error types, handling strategies | To fill |
|
|
20
|
+
| [Quality Guidelines](./quality-guidelines.md) | Code standards, forbidden patterns | To fill |
|
|
21
|
+
| [Logging Guidelines](./logging-guidelines.md) | Structured logging, log levels | To fill |
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -11,9 +11,9 @@ Document your project's logging conventions here.
|
|
|
11
11
|
|
|
12
12
|
Questions to answer:
|
|
13
13
|
- What logging library do you use?
|
|
14
|
-
- What log levels
|
|
15
|
-
- What
|
|
16
|
-
-
|
|
14
|
+
- What are the log levels and when to use each?
|
|
15
|
+
- What should be logged?
|
|
16
|
+
- What should NOT be logged (PII, secrets)?
|
|
17
17
|
-->
|
|
18
18
|
|
|
19
19
|
(To be filled by the team)
|
|
@@ -22,15 +22,15 @@ Questions to answer:
|
|
|
22
22
|
|
|
23
23
|
## Log Levels
|
|
24
24
|
|
|
25
|
-
<!-- When to use each
|
|
25
|
+
<!-- When to use each level: debug, info, warn, error -->
|
|
26
26
|
|
|
27
27
|
(To be filled by the team)
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Structured Logging
|
|
32
32
|
|
|
33
|
-
<!--
|
|
33
|
+
<!-- Log format, required fields -->
|
|
34
34
|
|
|
35
35
|
(To be filled by the team)
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ Questions to answer:
|
|
|
38
38
|
|
|
39
39
|
## What to Log
|
|
40
40
|
|
|
41
|
-
<!--
|
|
41
|
+
<!-- Important events to log -->
|
|
42
42
|
|
|
43
43
|
(To be filled by the team)
|
|
44
44
|
|
|
@@ -46,6 +46,6 @@ Questions to answer:
|
|
|
46
46
|
|
|
47
47
|
## What NOT to Log
|
|
48
48
|
|
|
49
|
-
<!-- Sensitive data, PII,
|
|
49
|
+
<!-- Sensitive data, PII, secrets -->
|
|
50
50
|
|
|
51
51
|
(To be filled by the team)
|
|
@@ -14,12 +14,12 @@ This directory contains guidelines for frontend development. Fill in each file w
|
|
|
14
14
|
|
|
15
15
|
| Guide | Description | Status |
|
|
16
16
|
|-------|-------------|--------|
|
|
17
|
-
| [Directory Structure](./directory-structure.md) | Module organization and file layout |
|
|
18
|
-
| [Component Guidelines](./component-guidelines.md) | Component patterns, props, composition |
|
|
19
|
-
| [Hook Guidelines](./hook-guidelines.md) | Custom hooks, data fetching patterns |
|
|
20
|
-
| [State Management](./state-management.md) | Local state, global state, server state |
|
|
21
|
-
| [Quality Guidelines](./quality-guidelines.md) | Code standards, forbidden patterns |
|
|
22
|
-
| [Type Safety](./type-safety.md) | Type patterns, validation |
|
|
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
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -22,7 +22,7 @@ Common cross-layer bugs:
|
|
|
22
22
|
Draw out how data moves:
|
|
23
23
|
|
|
24
24
|
```
|
|
25
|
-
Source
|
|
25
|
+
Source -> Transform -> Store -> Retrieve -> Transform -> Display
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
For each arrow, ask:
|
|
@@ -34,10 +34,10 @@ For each arrow, ask:
|
|
|
34
34
|
|
|
35
35
|
| Boundary | Common Issues |
|
|
36
36
|
|----------|---------------|
|
|
37
|
-
| API
|
|
38
|
-
| Service
|
|
39
|
-
| Backend
|
|
40
|
-
| Component
|
|
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
41
|
|
|
42
42
|
### Step 3: Define Contracts
|
|
43
43
|
|