返回 DeepSeek-Reasonix
claude_instructions.go
根目录 / internal / pluginpkg / claude_instructions.go
1 package pluginpkg
2
3 import (
4 "os"
5 "path/filepath"
6 )
7
8 func applyClaudeCompatibility(root string, manifest *Manifest) ([]string, []CompatibilityIssue) {
9 appendRootClaudeInstructions(root, manifest)
10 return appendClaudeCompatibility(root, manifest)
11 }
12
13 func appendRootClaudeInstructions(root string, manifest *Manifest) {
14 path := filepath.Join(root, claudeInstructions)
15 info, err := os.Stat(path)
16 if err != nil || !info.Mode().IsRegular() {
17 return
18 }
19 if manifest.Hooks == nil {
20 manifest.Hooks = map[string][]Hook{}
21 }
22 manifest.Hooks["SessionStart"] = append(manifest.Hooks["SessionStart"], Hook{
23 ContextFile: claudeInstructions,
24 Cwd: ".",
25 Description: "Plugin CLAUDE.md startup context from " + manifest.Name,
26 })
27 }
28
28 lines GO