refactor: update setup-projects-meta for simplified wiki pathing
- Changed from ~/projects/projects-wiki/.wiki to ~/projects/.wiki/ - Removed legacy migration logic (no longer needed) - Updated all script references and documentation - Simplified Phase 4 detection (single canon path) This aligns with projects-wiki repo changes where nested .wiki/ was removed and content now lives in root.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
One-time skill that brings up the local `projects-meta-mcp` stdio server on a
|
||||
new (or freshly broken) machine. Clones the server repo, builds it, writes
|
||||
`~/.config/projects-mcp/auth.toml` with the user's Gitea token, clones the
|
||||
shared wiki to `~/projects/projects-wiki/.wiki`, and registers `mcpServers.projects-meta`
|
||||
shared wiki to `~/projects/.wiki`, and registers `mcpServers.projects-meta`
|
||||
in `~/.claude.json`.
|
||||
|
||||
The runtime policy for *using* the resulting tools lives in
|
||||
@@ -31,8 +31,7 @@ only place that touches user-level config or installs the server.
|
||||
| `~/.local/projects-meta-mcp/dist/server.js` | built stdio entry point |
|
||||
| `~/.config/projects-mcp/auth.toml` | Gitea credentials (token-bearing) |
|
||||
| `~/.cache/projects-mcp/tasks.json` | aggregated tasks cache |
|
||||
| `~/projects/projects-wiki/` | shared wiki clone root (Gitea repo `projects-wiki`) |
|
||||
| `~/projects/projects-wiki/.wiki/` | wiki content root (read by MCP server) |
|
||||
| `~/projects/.wiki/` | shared wiki clone (Gitea repo `projects-wiki`, content in root) |
|
||||
| `~/.claude.json` (`mcpServers.projects-meta`) | MCP registration |
|
||||
|
||||
## Hard rules
|
||||
@@ -42,13 +41,9 @@ only place that touches user-level config or installs the server.
|
||||
not to clone or write secrets.
|
||||
- **Never echo the Gitea token in chat.** Edit / Write tool calls inevitably
|
||||
contain it (that's how it lands in `auth.toml`); chat output must not.
|
||||
- **Never clone over an unrelated `~/projects/projects-wiki/` (or legacy `~/projects/.wiki`).**
|
||||
If either path exists with a non-matching `origin`, stop and ask — the user
|
||||
- **Never clone over an unrelated `~/projects/.wiki/`.**
|
||||
If it exists with a non-matching `origin`, stop and ask — the user
|
||||
may have an unrelated wiki there.
|
||||
- **Don't use the legacy `~/projects/.wiki` path.** It's deprecated — the MCP
|
||||
server's `loadWiki` reads from `~/projects/projects-wiki/.wiki/<type>/...`,
|
||||
while writes to `~/projects/.wiki/.wiki/...` would be invisible. Phase 4
|
||||
detects a legacy clone and migrates to the canon path.
|
||||
- **Always `chmod 600` `auth.toml` on Linux / macOS.** Token leak otherwise.
|
||||
|
||||
## Procedure (high-level)
|
||||
@@ -73,7 +68,7 @@ Full procedure with shell snippets and templates lives in [`SKILL.md`](SKILL.md)
|
||||
1. Stop. Don't fix forward.
|
||||
2. `cp <file>.bak-<ts> <file>` for `~/.claude.json` and `~/.config/projects-mcp/auth.toml`.
|
||||
3. Optional: `rm -rf ~/.local/projects-meta-mcp` and `rm -rf ~/.cache/projects-mcp`.
|
||||
Keep `~/projects/projects-wiki/` — it's a useful clone regardless of MCP state.
|
||||
Keep `~/projects/.wiki/` — it's a useful clone regardless of MCP state.
|
||||
4. Restart Claude Code.
|
||||
5. Confirm `mcp__projects-meta__*` tools are gone (or back to the prior version).
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: setup-projects-meta
|
||||
version: 1.0.0
|
||||
description: Installs and configures the local `projects-meta-mcp` stdio server — clones the repo to `~/.local/projects-meta-mcp`, builds it, writes `~/.config/projects-mcp/auth.toml` with the user's Gitea token, clones the shared wiki to `~/projects/projects-wiki/` (content lives at `~/projects/projects-wiki/.wiki/`), and registers `mcpServers.projects-meta` in `~/.claude.json`. Use this skill when the user says "install projects-meta", "set up projects-meta", "configure projects-meta", "настрой projects-meta", "установи projects-meta", "projects-meta не работает", "projects-meta isn't working", or whenever the `mcp__projects-meta__*` tools are missing in a session that needs cross-project task aggregation or the shared Gitea wiki. Cross-platform — Windows / Linux / macOS. Mutates user-level config and writes secrets; pauses for confirmation before every write. Includes a migration step for machines with an old `~/projects/.wiki` clone (deprecated path that caused the wiki-path-mismatch bug).
|
||||
description: Installs and configures the local `projects-meta-mcp` stdio server — clones the repo to `~/.local/projects-meta-mcp`, builds it, writes `~/.config/projects-mcp/auth.toml` with the user's Gitea token, clones the shared wiki to `~/projects/.wiki/` (content lives in root), and registers `mcpServers.projects-meta` in `~/.claude.json`. Use this skill when the user says "install projects-meta", "set up projects-meta", "configure projects-meta", "настрой projects-meta", "установи projects-meta", "projects-meta не работает", "projects-meta isn't working", or whenever the `mcp__projects-meta__*` tools are missing in a session that needs cross-project task aggregation or the shared Gitea wiki. Cross-platform — Windows / Linux / macOS. Mutates user-level config and writes secrets; pauses for confirmation before every write.
|
||||
---
|
||||
|
||||
# setup-projects-meta
|
||||
@@ -35,9 +35,7 @@ The procedure clones a repo, writes `~/.config/projects-mcp/auth.toml` (carries
|
||||
- Confirm Claude Code is the current harness (need `mcpServers` registration in `~/.claude.json`).
|
||||
- Confirm `git`, `node`, `npm` are on `PATH`. Node ≥ 18 (the server uses ES modules).
|
||||
- Confirm network reachability to `https://git.kzntsv.site` (the Gitea host). On HTTP 401/403 later, the token is dead — stop and ask for a new one.
|
||||
- Pick paths: `~/.local/projects-meta-mcp`, `~/.config/projects-mcp/`, `~/.cache/projects-mcp/`, `~/projects/projects-wiki/` (clone root; content at `~/projects/projects-wiki/.wiki/`). POSIX-style `~/...` resolves correctly under git-bash on Windows.
|
||||
|
||||
**Path note (canon vs legacy).** The shared wiki clone target is `~/projects/projects-wiki/` (content under `.wiki/`). Earlier README versions said `git clone … ~/projects/.wiki` — that path is **deprecated** because it caused a write/read mismatch (writer wrote to `<clone>/.wiki/<type>/<slug>.md`, reader walked `<clone>/<type>/...`). Phase 1 detects the legacy path and Phase 4 migrates.
|
||||
- Pick paths: `~/.local/projects-meta-mcp`, `~/.config/projects-mcp/`, `~/.cache/projects-mcp/`, `~/projects/.wiki/` (shared wiki clone). POSIX-style `~/...` resolves correctly under git-bash on Windows.
|
||||
|
||||
### Phase 1 — Discovery (read-only)
|
||||
|
||||
@@ -55,13 +53,7 @@ The first hit wins. Capture internally for Phase 5; **never echo it in chat**.
|
||||
|
||||
**Build artifact.** Check `~/.local/projects-meta-mcp/dist/server.js`. If absent, Phase 4 will run `npm install && npm run build`.
|
||||
|
||||
**Shared wiki clone.** Three states to detect:
|
||||
|
||||
1. **Canon clone present** — `~/projects/projects-wiki/.git` exists, `git -C ~/projects/projects-wiki remote get-url origin` matches `https://git.kzntsv.site/OpeItcLoc03/projects-wiki(.git)?`. Phase 4 just `git pull`s.
|
||||
2. **Legacy clone present** — `~/projects/.wiki/.git` exists with the right `origin`. The path is deprecated (caused the wiki-path-mismatch bug). Phase 4 will migrate: re-clone to `~/projects/projects-wiki/`, then offer to `rm -rf ~/projects/.wiki` once the user confirms there are no local commits or scratch files in there.
|
||||
3. **Either path exists with a non-matching `origin`** — stop and ask. The user may have an unrelated wiki there.
|
||||
|
||||
If neither path exists — Phase 4 clones fresh into `~/projects/projects-wiki/`.
|
||||
**Shared wiki clone.** Check if `~/projects/.wiki/.git` exists and `origin` matches `https://git.kzntsv.site/OpeItcLoc03/projects-wiki(.git)?`. If non-matching `origin`, stop and ask — the user may have an unrelated wiki there.
|
||||
|
||||
**MCP registration.** Read `~/.claude.json` and check `mcpServers.projects-meta`. Note the command + args. If args point at a stale path, Phase 6 will fix it.
|
||||
|
||||
@@ -75,7 +67,7 @@ Present a single-block plan to the user:
|
||||
Token: <found at <path> | NOT FOUND — will ask>
|
||||
Repo: <installed at ~/.local/projects-meta-mcp@<sha> | will clone>
|
||||
Build artifact: <present | will run npm install && npm run build>
|
||||
Wiki clone: <canon at ~/projects/projects-wiki | LEGACY at ~/projects/.wiki — will migrate | will clone | wrong remote — STOP>
|
||||
Wiki clone: <present at ~/projects/.wiki | will clone | wrong remote — STOP>
|
||||
MCP entry: <present in ~/.claude.json | will add | will fix path>
|
||||
Backups: ~/.claude.json.bak-<ts>, ~/.config/projects-mcp/auth.toml.bak-<ts> (if exists)
|
||||
```
|
||||
@@ -109,16 +101,12 @@ cd ~/.local/projects-meta-mcp
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
# Shared wiki — canon path is ~/projects/projects-wiki/ (content under .wiki/)
|
||||
# Shared wiki
|
||||
mkdir -p ~/projects
|
||||
if [ -d ~/projects/projects-wiki/.git ]; then
|
||||
git -C ~/projects/projects-wiki pull --ff-only
|
||||
elif [ -d ~/projects/.wiki/.git ]; then
|
||||
# Legacy path — re-clone to canon and let the user decide what to do with the old dir.
|
||||
git clone https://git.kzntsv.site/OpeItcLoc03/projects-wiki ~/projects/projects-wiki
|
||||
echo "Legacy clone at ~/projects/.wiki kept in place. Inspect for local changes; if clean, rm -rf it."
|
||||
if [ -d ~/projects/.wiki/.git ]; then
|
||||
git -C ~/projects/.wiki pull --ff-only
|
||||
else
|
||||
git clone https://git.kzntsv.site/OpeItcLoc03/projects-wiki ~/projects/projects-wiki
|
||||
git clone https://git.kzntsv.site/OpeItcLoc03/projects-wiki ~/projects/.wiki
|
||||
fi
|
||||
```
|
||||
|
||||
@@ -204,7 +192,7 @@ Tell the user:
|
||||
After restart:
|
||||
• mcp__projects-meta__* tools serve from ~/.local/projects-meta-mcp/dist/server.js
|
||||
• Cache lives at ~/.cache/projects-mcp/tasks.json (refresh: node dist/sync.js)
|
||||
• Shared wiki clone at ~/projects/projects-wiki/ (content at .wiki/) — `git -C ~/projects/projects-wiki pull --ff-only` for fresh anchors
|
||||
• Shared wiki clone at ~/projects/.wiki/ — `git -C ~/projects/.wiki pull --ff-only` for fresh anchors
|
||||
• Backups saved at ~/.claude.json.bak-<ts> (and auth.toml.bak-<ts> if it existed before)
|
||||
|
||||
If something breaks after restart:
|
||||
@@ -218,7 +206,7 @@ If a problem surfaces (now or after restart):
|
||||
1. Stop. Don't try to fix forward.
|
||||
2. Find the most recent `.bak-YYYYMMDD-HHMMSS` next to `~/.claude.json` (and `~/.config/projects-mcp/auth.toml` if applicable).
|
||||
3. `cp <file>.bak-<ts> <file>` for each.
|
||||
4. Optional: `rm -rf ~/.local/projects-meta-mcp` and `rm -rf ~/.cache/projects-mcp`. Keep `~/projects/projects-wiki/` — it's a useful clone regardless of MCP state.
|
||||
4. Optional: `rm -rf ~/.local/projects-meta-mcp` and `rm -rf ~/.cache/projects-mcp`. Keep `~/projects/.wiki/` — it's a useful clone regardless of MCP state.
|
||||
5. Restart Claude Code.
|
||||
6. Confirm `mcp__projects-meta__*` is gone (or back to the pre-existing version).
|
||||
7. Report what went wrong so we can fix the procedure.
|
||||
@@ -239,8 +227,7 @@ Path forms (`~/.local/...`, `~/.config/...`, `~/projects/...`) are identical on
|
||||
|
||||
- **Skipping Phase 1.** "User just said 'install projects-meta' — let's go." No — find existing token / repo / wiki first; re-cloning over an existing install loses any local commits in the wiki.
|
||||
- **Echoing the token.** It's a secret. Edit / Write tool calls inevitably contain it (that's how it gets into `auth.toml`), but no chat output should.
|
||||
- **Cloning over an unrelated `~/projects/projects-wiki/` (or legacy `~/projects/.wiki`).** If either path exists with a different `origin`, stop. The user may have an unrelated wiki there.
|
||||
- **Cloning to the legacy path `~/projects/.wiki`.** Path is deprecated — write/read mismatch bug. Always clone to `~/projects/projects-wiki/`. Phase 4 enforces this.
|
||||
- **Cloning over an unrelated `~/projects/.wiki/`.** If it exists with a different `origin`, stop. The user may have an unrelated wiki there.
|
||||
- **Writing `auth.toml` with `0644` perms on Linux/macOS.** Token leak. Always `chmod 600` after write.
|
||||
- **Treating in-session `meta_status` as proof.** Same as the context7 caveat — the active MCP connection was bound at session start.
|
||||
- **Auto-running on every "use projects-meta".** This skill is intrusive. Trigger only on explicit "install/setup/configure projects-meta", or when MCP tools are missing and the user is blocked.
|
||||
|
||||
Reference in New Issue
Block a user