-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
178 lines (150 loc) · 5.22 KB
/
Copy pathTaskfile.yml
File metadata and controls
178 lines (150 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
version: '3'
tasks:
default:
desc: Show available tasks
cmds:
- task --list
test:
desc: Run tests with race detector
cmds:
- go test -race -count=1 ./...
vet:
desc: Run go vet
cmds:
- go vet ./...
fmt:
desc: Check formatting
cmds:
- test -z "$(gofmt -l .)"
fmt:fix:
desc: Fix formatting
cmds:
- gofmt -w .
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
vulncheck:
desc: Run govulncheck
cmds:
- govulncheck ./...
check:
desc: Run all CI checks (test, vet, fmt, lint, vulncheck)
cmds:
- task: test
- task: vet
- task: fmt
- task: lint
- task: vulncheck
build:
desc: Build all binaries
cmds:
- GOWORK=off go build ./cmd/memstore-mcp
- GOWORK=off go build ./cmd/memstore
clean:
desc: Remove built binaries
cmds:
- rm -f memstore-mcp memstore
install:
desc: Install binaries to GOPATH/bin
cmds:
- GOWORK=off go install ./cmd/memstore-mcp
- GOWORK=off go install ./cmd/memstore
hooks:install:
desc: Install git hooks (pre-commit and pre-push)
cmds:
- cp githooks/pre-commit .git/hooks/pre-commit
- chmod +x .git/hooks/pre-commit
- cp githooks/pre-push .git/hooks/pre-push
- chmod +x .git/hooks/pre-push
status:
- test -f .git/hooks/pre-commit
- diff -q githooks/pre-commit .git/hooks/pre-commit
- test -f .git/hooks/pre-push
- diff -q githooks/pre-push .git/hooks/pre-push
# --- Harness integration ------------------------------------------------
# Each install:<harness> task wires memstore-mcp (and where supported,
# passive hooks) into one AI coding harness. They are idempotent and
# safe to re-run. Harnesses with shared config files (Zed, Codex) print
# the snippet for manual paste rather than mutating user config; the
# rest write config directly.
#
# MEMSTORE_MCP_BIN can be overridden in the environment to point at a
# non-PATH binary.
install:claude:
desc: Install memstore Claude Code hooks + MCP entry (via ./memstore setup)
deps: [install]
cmds:
- memstore setup
preconditions:
- sh: command -v claude
msg: "Claude Code CLI not found on PATH — install claude first"
install:cursor:
desc: Register memstore-mcp in ~/.cursor/mcp.json (idempotent jq merge)
vars:
MEMSTORE_MCP_BIN:
sh: echo "${MEMSTORE_MCP_BIN:-$(command -v memstore-mcp || echo $HOME/go/bin/memstore-mcp)}"
cmds:
- mkdir -p "$HOME/.cursor"
- test -s "$HOME/.cursor/mcp.json" || echo '{"mcpServers":{}}' > "$HOME/.cursor/mcp.json"
- |
jq --arg bin "{{.MEMSTORE_MCP_BIN}}" \
'.mcpServers.memstore = {"command":$bin,"args":[],"env":{}}' \
"$HOME/.cursor/mcp.json" > "$HOME/.cursor/mcp.json.tmp"
- mv "$HOME/.cursor/mcp.json.tmp" "$HOME/.cursor/mcp.json"
- 'echo "Registered memstore-mcp in ~/.cursor/mcp.json (bin: {{.MEMSTORE_MCP_BIN}})"'
preconditions:
- sh: command -v jq
msg: "jq is required for safe JSON merging — install jq"
- sh: test -x "$(echo ${MEMSTORE_MCP_BIN:-$HOME/go/bin/memstore-mcp})" || command -v memstore-mcp
msg: "memstore-mcp not found — run 'task install' first or set MEMSTORE_MCP_BIN"
install:zed:
desc: Print Zed context_servers snippet (settings.json is JSONC, no safe auto-merge)
vars:
MEMSTORE_MCP_BIN:
sh: echo "${MEMSTORE_MCP_BIN:-$(command -v memstore-mcp || echo $HOME/go/bin/memstore-mcp)}"
cmds:
- |
cat <<EOF
Zed's settings.json is JSONC with extensive user content; auto-merge
is unsafe. Paste this into the top-level object of
~/.config/zed/settings.json (merge with any existing context_servers
block):
"context_servers": {
"memstore": {
"command": "{{.MEMSTORE_MCP_BIN}}",
"args": [],
"env": {}
}
}
Then restart Zed (or save settings.json — Zed hot-reloads).
Zed has no per-prompt hook surface; this enables tools only.
EOF
install:codex:
desc: Install experimental Codex notify shim + print config.toml snippet
vars:
MEMSTORE_MCP_BIN:
sh: echo "${MEMSTORE_MCP_BIN:-$(command -v memstore-mcp || echo $HOME/go/bin/memstore-mcp)}"
SHIM_DEST: '{{.HOME}}/.codex/hooks/codex-notify-memstore.mjs'
cmds:
- install -Dm755 examples/codex/codex-notify-memstore.mjs "$HOME/.codex/hooks/codex-notify-memstore.mjs"
- |
cat <<EOF
Experimental notify shim installed to:
~/.codex/hooks/codex-notify-memstore.mjs
Add to ~/.codex/config.toml (creates if absent):
notify = ["node", "$HOME/.codex/hooks/codex-notify-memstore.mjs"]
[mcp_servers.memstore]
command = "{{.MEMSTORE_MCP_BIN}}"
args = []
env = {}
See examples/codex/README.md for caveats (per-turn re-upload,
silent nudges, recursion safety).
EOF
install:harnesses:
desc: Run all harness installers (Claude, Cursor, Zed, Codex)
cmds:
- task: install:claude
- task: install:cursor
- task: install:zed
- task: install:codex