@mindfoldhq/trellis 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +110 -0
- package/README.md +149 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +42 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +236 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/configurators/claude.d.ts +35 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +83 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/cursor.d.ts +8 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +22 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/templates.d.ts +40 -0
- package/dist/configurators/templates.d.ts.map +1 -0
- package/dist/configurators/templates.js +67 -0
- package/dist/configurators/templates.js.map +1 -0
- package/dist/configurators/workflow.d.ts +16 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +169 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +69 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +80 -0
- package/dist/constants/paths.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/templates/agents/check.txt +120 -0
- package/dist/templates/agents/debug.txt +121 -0
- package/dist/templates/agents/dispatch.txt +201 -0
- package/dist/templates/agents/implement.txt +114 -0
- package/dist/templates/agents/index.d.ts +35 -0
- package/dist/templates/agents/index.d.ts.map +1 -0
- package/dist/templates/agents/index.js +71 -0
- package/dist/templates/agents/index.js.map +1 -0
- package/dist/templates/agents/research.txt +258 -0
- package/dist/templates/commands/claude/start.md.txt +127 -0
- package/dist/templates/commands/common/before-backend-dev.txt +13 -0
- package/dist/templates/commands/common/before-frontend-dev.txt +13 -0
- package/dist/templates/commands/common/break-loop.txt +107 -0
- package/dist/templates/commands/common/check-backend.txt +13 -0
- package/dist/templates/commands/common/check-cross-layer.txt +153 -0
- package/dist/templates/commands/common/check-frontend.txt +13 -0
- package/dist/templates/commands/common/create-command.txt +154 -0
- package/dist/templates/commands/common/finish-work.txt +129 -0
- package/dist/templates/commands/common/integrate-skill.txt +219 -0
- package/dist/templates/commands/common/onboard-developer.txt +355 -0
- package/dist/templates/commands/common/record-agent-flow.txt +62 -0
- package/dist/templates/commands/cursor/start.md.txt +94 -0
- package/dist/templates/commands/index.d.ts +46 -0
- package/dist/templates/commands/index.d.ts.map +1 -0
- package/dist/templates/commands/index.js +151 -0
- package/dist/templates/commands/index.js.map +1 -0
- package/dist/templates/extract.d.ts +22 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +34 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/hooks/index.d.ts +33 -0
- package/dist/templates/hooks/index.d.ts.map +1 -0
- package/dist/templates/hooks/index.js +53 -0
- package/dist/templates/hooks/index.js.map +1 -0
- package/dist/templates/hooks/inject-subagent-context.py +620 -0
- package/dist/templates/hooks/settings.json +16 -0
- package/dist/templates/markdown/agent-traces-index.md.txt +124 -0
- package/dist/templates/markdown/agents.md.txt +18 -0
- package/dist/templates/markdown/gitignore.txt +3 -0
- package/dist/templates/markdown/index.d.ts +26 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +33 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/init-agent.md.txt +315 -0
- package/dist/templates/markdown/structure/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/structure/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/structure/backend/index.md.txt +38 -0
- package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/structure/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/structure/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/structure/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/structure/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/structure/guides/code-reuse-thinking-guide.md.txt +92 -0
- package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +94 -0
- package/dist/templates/markdown/structure/guides/index.md.txt +79 -0
- package/dist/templates/markdown/workflow.md.txt +335 -0
- package/dist/templates/scripts/add-session.sh.txt +384 -0
- package/dist/templates/scripts/common/developer.sh.txt +130 -0
- package/dist/templates/scripts/common/git-context.sh.txt +237 -0
- package/dist/templates/scripts/common/paths.sh.txt +201 -0
- package/dist/templates/scripts/create-bootstrap.sh.txt +298 -0
- package/dist/templates/scripts/feature.sh.txt +700 -0
- package/dist/templates/scripts/get-context.sh.txt +7 -0
- package/dist/templates/scripts/get-developer.sh.txt +15 -0
- package/dist/templates/scripts/index.d.ts +25 -0
- package/dist/templates/scripts/index.d.ts.map +1 -0
- package/dist/templates/scripts/index.js +28 -0
- package/dist/templates/scripts/index.js.map +1 -0
- package/dist/templates/scripts/init-developer.sh.txt +34 -0
- package/dist/types/ai-tools.d.ts +35 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +31 -0
- package/dist/types/ai-tools.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 +186 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command templates for Trellis workflow
|
|
3
|
+
*
|
|
4
|
+
* All templates are in common/ and work with all supported AI tools.
|
|
5
|
+
* The claude/ directory is reserved for future Claude-specific commands.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync } from "fs";
|
|
8
|
+
import { dirname, join } from "path";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
import { getTemplateDirs } from "../../types/ai-tools.js";
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = dirname(__filename);
|
|
13
|
+
/**
|
|
14
|
+
* Read a command template from the specified subdirectory
|
|
15
|
+
*/
|
|
16
|
+
function readCommand(subdir, filename) {
|
|
17
|
+
const filePath = join(__dirname, subdir, filename);
|
|
18
|
+
return readFileSync(filePath, "utf-8");
|
|
19
|
+
}
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// Tool-specific Templates
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// Claude-specific commands
|
|
24
|
+
export const claudeStartTemplate = readCommand("claude", "start.md.txt");
|
|
25
|
+
// Cursor-specific commands
|
|
26
|
+
export const cursorStartTemplate = readCommand("cursor", "start.md.txt");
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// Common Templates (work with all AI tools)
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// Core workflow commands
|
|
31
|
+
export const recordAgentFlowTemplate = readCommand("common", "record-agent-flow.txt");
|
|
32
|
+
export const onboardDeveloperTemplate = readCommand("common", "onboard-developer.txt");
|
|
33
|
+
// Development check commands
|
|
34
|
+
export const checkFrontendTemplate = readCommand("common", "check-frontend.txt");
|
|
35
|
+
export const checkBackendTemplate = readCommand("common", "check-backend.txt");
|
|
36
|
+
export const checkCrossLayerTemplate = readCommand("common", "check-cross-layer.txt");
|
|
37
|
+
// Pre-development commands
|
|
38
|
+
export const beforeFrontendDevTemplate = readCommand("common", "before-frontend-dev.txt");
|
|
39
|
+
export const beforeBackendDevTemplate = readCommand("common", "before-backend-dev.txt");
|
|
40
|
+
// Work completion commands
|
|
41
|
+
export const finishWorkTemplate = readCommand("common", "finish-work.txt");
|
|
42
|
+
export const breakLoopTemplate = readCommand("common", "break-loop.txt");
|
|
43
|
+
// Utility commands
|
|
44
|
+
export const createCommandTemplate = readCommand("common", "create-command.txt");
|
|
45
|
+
export const integrateSkillTemplate = readCommand("common", "integrate-skill.txt");
|
|
46
|
+
/**
|
|
47
|
+
* All available command templates
|
|
48
|
+
*/
|
|
49
|
+
const ALL_TEMPLATES = [
|
|
50
|
+
// Claude-specific
|
|
51
|
+
{
|
|
52
|
+
name: "start",
|
|
53
|
+
content: claudeStartTemplate,
|
|
54
|
+
description: "Initialize AI agent with project context",
|
|
55
|
+
category: "claude",
|
|
56
|
+
},
|
|
57
|
+
// Cursor-specific
|
|
58
|
+
{
|
|
59
|
+
name: "start",
|
|
60
|
+
content: cursorStartTemplate,
|
|
61
|
+
description: "Initialize AI agent with project context",
|
|
62
|
+
category: "cursor",
|
|
63
|
+
},
|
|
64
|
+
// Common
|
|
65
|
+
{
|
|
66
|
+
name: "record-agent-flow",
|
|
67
|
+
content: recordAgentFlowTemplate,
|
|
68
|
+
description: "Record successful agent workflow patterns",
|
|
69
|
+
category: "common",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "onboard-developer",
|
|
73
|
+
content: onboardDeveloperTemplate,
|
|
74
|
+
description: "Onboard new developer to the project",
|
|
75
|
+
category: "common",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "check-frontend",
|
|
79
|
+
content: checkFrontendTemplate,
|
|
80
|
+
description: "Check frontend code quality",
|
|
81
|
+
category: "common",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "check-backend",
|
|
85
|
+
content: checkBackendTemplate,
|
|
86
|
+
description: "Check backend code quality",
|
|
87
|
+
category: "common",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "check-cross-layer",
|
|
91
|
+
content: checkCrossLayerTemplate,
|
|
92
|
+
description: "Check cross-layer integration",
|
|
93
|
+
category: "common",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "before-frontend-dev",
|
|
97
|
+
content: beforeFrontendDevTemplate,
|
|
98
|
+
description: "Pre-flight check before frontend development",
|
|
99
|
+
category: "common",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "before-backend-dev",
|
|
103
|
+
content: beforeBackendDevTemplate,
|
|
104
|
+
description: "Pre-flight check before backend development",
|
|
105
|
+
category: "common",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "finish-work",
|
|
109
|
+
content: finishWorkTemplate,
|
|
110
|
+
description: "Complete and document work session",
|
|
111
|
+
category: "common",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "break-loop",
|
|
115
|
+
content: breakLoopTemplate,
|
|
116
|
+
description: "Break out of repetitive patterns",
|
|
117
|
+
category: "common",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "create-command",
|
|
121
|
+
content: createCommandTemplate,
|
|
122
|
+
description: "Create a new slash command",
|
|
123
|
+
category: "common",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "integrate-skill",
|
|
127
|
+
content: integrateSkillTemplate,
|
|
128
|
+
description: "Integrate a skill into project guidelines (requires openskills)",
|
|
129
|
+
category: "common",
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
/**
|
|
133
|
+
* Get command templates available for a specific AI tool
|
|
134
|
+
*/
|
|
135
|
+
export function getTemplatesForTool(tool) {
|
|
136
|
+
const allowedDirs = getTemplateDirs(tool);
|
|
137
|
+
return ALL_TEMPLATES.filter((t) => allowedDirs.includes(t.category));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get all command templates
|
|
141
|
+
*/
|
|
142
|
+
export function getAllTemplates() {
|
|
143
|
+
return ALL_TEMPLATES;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get a specific template by name
|
|
147
|
+
*/
|
|
148
|
+
export function getTemplateByName(name) {
|
|
149
|
+
return ALL_TEMPLATES.find((t) => t.name === name);
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,WAAW,CAAC,MAAc,EAAE,QAAgB;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAW,WAAW,CACpD,QAAQ,EACR,cAAc,CACf,CAAC;AAEF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAW,WAAW,CACpD,QAAQ,EACR,cAAc,CACf,CAAC;AAEF,gFA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AQ,EAAE,QAAQ;KACnB;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EACT,iEAAiE;QACnE,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type TemplateCategory = "scripts" | "markdown" | "commands";
|
|
2
|
+
/**
|
|
3
|
+
* Read template content from a .txt file
|
|
4
|
+
* @param category - Template category ('scripts' | 'markdown' | 'commands')
|
|
5
|
+
* @param filename - Template filename (e.g., 'init-developer.sh.txt')
|
|
6
|
+
* @returns File content as string
|
|
7
|
+
*/
|
|
8
|
+
export declare function readTemplate(category: TemplateCategory, filename: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Helper to read script template
|
|
11
|
+
*/
|
|
12
|
+
export declare function readScript(filename: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Helper to read markdown template
|
|
15
|
+
*/
|
|
16
|
+
export declare function readMarkdown(filename: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Helper to read command template
|
|
19
|
+
*/
|
|
20
|
+
export declare function readCommand(filename: string): string;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +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;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
/**
|
|
7
|
+
* Read template content from a .txt file
|
|
8
|
+
* @param category - Template category ('scripts' | 'markdown' | 'commands')
|
|
9
|
+
* @param filename - Template filename (e.g., 'init-developer.sh.txt')
|
|
10
|
+
* @returns File content as string
|
|
11
|
+
*/
|
|
12
|
+
export function readTemplate(category, filename) {
|
|
13
|
+
const templatePath = path.join(__dirname, category, filename);
|
|
14
|
+
return fs.readFileSync(templatePath, "utf-8");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Helper to read script template
|
|
18
|
+
*/
|
|
19
|
+
export function readScript(filename) {
|
|
20
|
+
return readTemplate("scripts", filename);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Helper to read markdown template
|
|
24
|
+
*/
|
|
25
|
+
export function readMarkdown(filename) {
|
|
26
|
+
return readTemplate("markdown", filename);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Helper to read command template
|
|
30
|
+
*/
|
|
31
|
+
export function readCommand(filename) {
|
|
32
|
+
return readTemplate("commands", filename);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +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,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook templates for Multi-Agent Pipeline
|
|
3
|
+
*
|
|
4
|
+
* Hooks inject context into subagent prompts automatically.
|
|
5
|
+
*/
|
|
6
|
+
export declare const injectSubagentContextHook: string;
|
|
7
|
+
export declare const settingsTemplate: string;
|
|
8
|
+
/**
|
|
9
|
+
* Hook template definition
|
|
10
|
+
*/
|
|
11
|
+
export interface HookTemplate {
|
|
12
|
+
/** Hook filename */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Template content */
|
|
15
|
+
content: string;
|
|
16
|
+
/** Human-readable description */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Target path relative to .claude/ */
|
|
19
|
+
targetPath: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Settings template for hooks
|
|
23
|
+
*/
|
|
24
|
+
export declare const SETTINGS_TEMPLATE: HookTemplate;
|
|
25
|
+
/**
|
|
26
|
+
* Get all hook templates
|
|
27
|
+
*/
|
|
28
|
+
export declare function getAllHooks(): HookTemplate[];
|
|
29
|
+
/**
|
|
30
|
+
* Get settings template
|
|
31
|
+
*/
|
|
32
|
+
export declare function getSettingsTemplate(): HookTemplate;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,MAAkC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAcD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAK/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,IAAI,YAAY,EAAE,CAE5C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAElD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook templates for Multi-Agent Pipeline
|
|
3
|
+
*
|
|
4
|
+
* Hooks inject context into subagent prompts automatically.
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync } from "fs";
|
|
7
|
+
import { dirname, join } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
/**
|
|
12
|
+
* Read a hook template
|
|
13
|
+
*/
|
|
14
|
+
function readHook(filename) {
|
|
15
|
+
const filePath = join(__dirname, filename);
|
|
16
|
+
return readFileSync(filePath, "utf-8");
|
|
17
|
+
}
|
|
18
|
+
// Hook templates
|
|
19
|
+
export const injectSubagentContextHook = readHook("inject-subagent-context.py");
|
|
20
|
+
export const settingsTemplate = readHook("settings.json");
|
|
21
|
+
/**
|
|
22
|
+
* All available hook templates
|
|
23
|
+
*/
|
|
24
|
+
const ALL_HOOKS = [
|
|
25
|
+
{
|
|
26
|
+
name: "inject-subagent-context.py",
|
|
27
|
+
content: injectSubagentContextHook,
|
|
28
|
+
description: "Injects context into subagent prompts based on feature config",
|
|
29
|
+
targetPath: "hooks/inject-subagent-context.py",
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Settings template for hooks
|
|
34
|
+
*/
|
|
35
|
+
export const SETTINGS_TEMPLATE = {
|
|
36
|
+
name: "settings.json",
|
|
37
|
+
content: settingsTemplate,
|
|
38
|
+
description: "Claude Code settings with hook configuration",
|
|
39
|
+
targetPath: "settings.json",
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Get all hook templates
|
|
43
|
+
*/
|
|
44
|
+
export function getAllHooks() {
|
|
45
|
+
return ALL_HOOKS;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get settings template
|
|
49
|
+
*/
|
|
50
|
+
export function getSettingsTemplate() {
|
|
51
|
+
return SETTINGS_TEMPLATE;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,QAAQ,CAAC,QAAgB;IAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,iBAAiB;AACjB,MAAM,CAAC,MAAM,yBAAyB,GAAW,QAAQ,CACvD,4BAA4B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAW,QAAQ,CAAC,eAAe,CAAC,CAAC;AAgBlE;;GAEG;AACH,MAAM,SAAS,GAAmB;IAChC;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,yBAAyB;QAClC,WAAW,EAAE,+DAA+D;QAC5E,UAAU,EAAE,kCAAkC;KAC/C;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAiB;IAC7C,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,8CAA8C;IAC3D,UAAU,EAAE,e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