OSS launch polish: fix hook paths, add OSS files, update README

- Fix slashes in agent identity causing invalid hook file paths (gt-vqhc)
- Add Prerequisites section to README (gt-vzic)
- Create CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md (gt-xbfw)
- Update Install section for future package managers (gt-7wcf)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-24 23:28:15 -08:00
parent 65d5f6823b
commit 066ef722ae
6 changed files with 176 additions and 6 deletions

View File

@@ -10,6 +10,7 @@
package wisp
import (
"strings"
"time"
)
@@ -72,6 +73,25 @@ func NewSlungWork(beadID, createdBy string) *SlungWork {
}
// HookFilename returns the filename for an agent's hook file.
// Agent identities may contain slashes (e.g., "gastown/crew/max"),
// which are replaced with underscores to create valid filenames.
func HookFilename(agent string) string {
return HookPrefix + agent + HookSuffix
safe := strings.ReplaceAll(agent, "/", "_")
return HookPrefix + safe + HookSuffix
}
// AgentFromHookFilename extracts the agent identity from a hook filename.
// Reverses the slash-to-underscore transformation done by HookFilename.
func AgentFromHookFilename(filename string) string {
if len(filename) <= len(HookPrefix)+len(HookSuffix) {
return ""
}
if filename[:len(HookPrefix)] != HookPrefix {
return ""
}
if filename[len(filename)-len(HookSuffix):] != HookSuffix {
return ""
}
safe := filename[len(HookPrefix) : len(filename)-len(HookSuffix)]
return strings.ReplaceAll(safe, "_", "/")
}