# internal/adapters/corebundle

Package corebundle installs embedded managed scafld core assets into workspaces.

## CorePrompt

```go
func CorePrompt(filename string) ([]byte, error)
```

CorePrompt returns an embedded managed core prompt by filename, such as "review.md".

## HostPrivateKeyPath

```go
func HostPrivateKeyPath() (string, error)
```

HostPrivateKeyPath resolves the on-host receipt signing key path that scafld init generates. The gate signs with this same key, so init and the gate share one source of truth for the key location.

## Init

```go
func Init(ctx context.Context, root string) (Result, error)
```

Init installs managed core assets for a newly bootstrapped workspace.

## InitAgentDocs

```go
func InitAgentDocs(ctx context.Context, root string) (Result, error)
```

InitAgentDocs installs root agent docs, prepending a scafld section when needed.

## InitGitignore

```go
func InitGitignore(ctx context.Context, root string) (Result, error)
```

InitGitignore installs the scafld ignore contract into the workspace gitignore.

## InitWire

```go
func InitWire(ctx context.Context, root string, installCI bool) (Result, error)
```

InitWire installs host accountability wiring and maintains the host signing key.

## Install

```go
func Install(ctx context.Context, root string, opts Options) (Result, error)
```

Install copies embedded assets into root according to opts.

## MergeClaudeSettings

```go
func MergeClaudeSettings(current []byte, desired []byte) ([]byte, bool, bool, error)
```

MergeClaudeSettings upserts the scafld Stop hook while preserving unrelated settings.

## MergeMCPConfig

```go
func MergeMCPConfig(current []byte, desired []byte) ([]byte, bool, bool, error)
```

MergeMCPConfig upserts the scafld MCP server while preserving unrelated config.

## RefreshAgentDocs

```go
func RefreshAgentDocs(ctx context.Context, root string) (Result, error)
```

RefreshAgentDocs refreshes existing scafld sections in root agent docs.

## Update

```go
func Update(ctx context.Context, root string) (Result, error)
```

Update refreshes managed assets and unmarked workspace prompt copies.

## Options

```go
type Options struct {
	OverwriteCore         bool
	CreateProjectPrompts  bool
	RefreshProjectPrompts bool
	CreateProjectConfig   bool
	InstallLifecycleTools bool
}
```

Options controls how embedded core assets are installed.

- `OverwriteCore: bool`: 
- `CreateProjectPrompts: bool`: 
- `RefreshProjectPrompts: bool`: 
- `CreateProjectConfig: bool`: 
- `InstallLifecycleTools: bool`: 

## Result

```go
type Result struct {
	Created []string `json:"created"`
	Updated []string `json:"updated"`
	Skipped []string `json:"skipped"`
}
```

Result summarizes files created, updated, or skipped during installation.

- `Created: []string` (json:"created"): 
- `Updated: []string` (json:"updated"): 
- `Skipped: []string` (json:"skipped"):
