fastrmemory 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +14 -14
- package/.claude-plugin/plugin.json +18 -18
- package/.cursor/mcp.json +3 -1
- package/.cursor/skills/fastr-compress/SKILL.md +33 -33
- package/.cursor/skills/fastr-curate/SKILL.md +62 -62
- package/.cursor/skills/fastr-dag/SKILL.md +47 -47
- package/.cursor/skills/fastr-doctor/SKILL.md +39 -39
- package/.cursor/skills/fastr-memory/SKILL.md +51 -51
- package/.cursor/skills/fastr-plan-estimate/SKILL.md +45 -45
- package/.cursor/skills/fastr-session-commit/SKILL.md +49 -49
- package/.cursor/skills/fastr-setup/SKILL.md +45 -45
- package/.cursor/skills/fastr-trap-log/SKILL.md +39 -39
- package/.cursor/skills/fastr-vision/SKILL.md +35 -35
- package/.cursor/skills/skills.json +65 -65
- package/README.md +642 -729
- package/bin/fastr-guard.mjs +61 -0
- package/dist/bin/fastr.js +68 -10
- package/dist/bin/fastr.js.map +1 -1
- package/dist/src/bench/benchmark.js +13 -13
- package/dist/src/bench/harness.js +17 -17
- package/dist/src/bench/public-harness.js +5 -5
- package/dist/src/branch/manager.js +31 -31
- package/dist/src/ci/guardian.js +9 -9
- package/dist/src/db/doctor.js +25 -25
- package/dist/src/db/hygiene.js +23 -23
- package/dist/src/db/repository.js +283 -283
- package/dist/src/db/schema.js +268 -268
- package/dist/src/db/spool.js +4 -4
- package/dist/src/export/obsidian.js +15 -15
- package/dist/src/import/local.js +4 -4
- package/dist/src/installer/mcp-init.d.ts +65 -0
- package/dist/src/installer/mcp-init.d.ts.map +1 -0
- package/dist/src/installer/mcp-init.js +293 -0
- package/dist/src/installer/mcp-init.js.map +1 -0
- package/dist/src/installer/setup.d.ts +2 -0
- package/dist/src/installer/setup.d.ts.map +1 -1
- package/dist/src/installer/setup.js +24 -18
- package/dist/src/installer/setup.js.map +1 -1
- package/dist/src/mcp/server.js +25 -25
- package/dist/src/mirror/markdown-pages.js +22 -22
- package/dist/src/search/backfill.js +6 -6
- package/dist/src/search/hybrid-rrf.js +60 -60
- package/dist/src/ui/server.js +1259 -1259
- package/dist/src/vision/assets.js +6 -6
- package/dist-ui/assets/ActionsPage-B3quzFNF.js +11 -11
- package/dist-ui/assets/GraphPage-DetiATmC.js +1 -1
- package/dist-ui/assets/ObservatoryPage-QIGMwENf.js +16 -16
- package/dist-ui/assets/TreemapPage-C7uLZd37.js +2 -2
- package/dist-ui/assets/index-BJnPINTu.css +1 -1
- package/dist-ui/assets/index-DWAH--Fu.js +329 -329
- package/dist-ui/assets/maximize-2-BebkGbZA.js +6 -6
- package/dist-ui/build-manifest.json +95 -95
- package/dist-ui/index.html +26 -26
- package/llms-install.md +77 -69
- package/package.json +108 -107
- package/server.json +28 -28
- package/skills/fastr-compress/SKILL.md +33 -33
- package/skills/fastr-curate/SKILL.md +62 -62
- package/skills/fastr-dag/SKILL.md +47 -47
- package/skills/fastr-doctor/SKILL.md +39 -39
- package/skills/fastr-memory/SKILL.md +51 -51
- package/skills/fastr-plan-estimate/SKILL.md +45 -45
- package/skills/fastr-session-commit/SKILL.md +49 -49
- package/skills/fastr-setup/SKILL.md +45 -45
- package/skills/fastr-trap-log/SKILL.md +39 -39
- package/skills/fastr-vision/SKILL.md +35 -35
- package/skills/skills.json +65 -65
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastr-memory
|
|
3
|
-
description: Use at the start of any coding task and before reading-to-edit, creating, or modifying project files. Checks FastrMemory for [TRAP] warnings on the target files, then recalls relevant rules and decisions so you do not repeat known mistakes or contradict project conventions.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# FastrMemory: Recall Before You Code
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- A new task or sub-task begins (feature, bug fix, refactor, review).
|
|
10
|
-
- You are about to edit or create a file you have not checked this session.
|
|
11
|
-
- You hit unfamiliar architecture or a convention you are unsure about.
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
1. **Check traps on the files you will touch** (always, before the first edit):
|
|
16
|
-
```js
|
|
17
|
-
fastr_trap_recall({ files: ["src/auth/jwt.ts", "src/auth/guard.ts"] })
|
|
18
|
-
```
|
|
19
|
-
For each `[TRAP]` returned, state in your plan how the change avoids it.
|
|
20
|
-
|
|
21
|
-
2. **Recall rules and decisions for the task**:
|
|
22
|
-
```js
|
|
23
|
-
fastr_recall({
|
|
24
|
-
query: "JWT expiry handling in auth guard",
|
|
25
|
-
files: ["src/auth/jwt.ts"],
|
|
26
|
-
module: "auth",
|
|
27
|
-
budgetTokens: 1500
|
|
28
|
-
})
|
|
29
|
-
```
|
|
30
|
-
Set `includeHistory: true` only when you need superseded rules (for example, to learn why something changed).
|
|
31
|
-
|
|
32
|
-
Or get one token-budgeted context block (rules + traps + ready tasks + last handoff):
|
|
33
|
-
```js
|
|
34
|
-
fastr_assemble({
|
|
35
|
-
taskDescription: "Add refresh-token rotation to the auth guard",
|
|
36
|
-
targetFiles: ["src/auth/guard.ts"],
|
|
37
|
-
module: "auth",
|
|
38
|
-
budgetTokens: 2000
|
|
39
|
-
})
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
3. **Drill down only when needed**:
|
|
43
|
-
- Everything linked to one file: `fastr_file_history({ filePath: "src/auth/jwt.ts" })`
|
|
44
|
-
- Neighbouring files and memories: `fastr_graph_query({ filePath: "src/auth/jwt.ts", depth: 2 })`
|
|
45
|
-
- Verbatim stack trace or diff behind a memory: `fastr_drill({ memoryId: "mem_8f2a1c" })`
|
|
46
|
-
- Where the last session stopped: `fastr_handoff({ action: "latest" })`
|
|
47
|
-
|
|
48
|
-
## Ground rules
|
|
49
|
-
- If recall returns nothing, say so. Do not invent project conventions.
|
|
50
|
-
- Note the IDs of memories you relied on; rate them at the end with the `fastr-session-commit` skill.
|
|
51
|
-
- When a failure is diagnosed mid-task, switch to the `fastr-trap-log` skill immediately.
|
|
1
|
+
---
|
|
2
|
+
name: fastr-memory
|
|
3
|
+
description: Use at the start of any coding task and before reading-to-edit, creating, or modifying project files. Checks FastrMemory for [TRAP] warnings on the target files, then recalls relevant rules and decisions so you do not repeat known mistakes or contradict project conventions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FastrMemory: Recall Before You Code
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- A new task or sub-task begins (feature, bug fix, refactor, review).
|
|
10
|
+
- You are about to edit or create a file you have not checked this session.
|
|
11
|
+
- You hit unfamiliar architecture or a convention you are unsure about.
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. **Check traps on the files you will touch** (always, before the first edit):
|
|
16
|
+
```js
|
|
17
|
+
fastr_trap_recall({ files: ["src/auth/jwt.ts", "src/auth/guard.ts"] })
|
|
18
|
+
```
|
|
19
|
+
For each `[TRAP]` returned, state in your plan how the change avoids it.
|
|
20
|
+
|
|
21
|
+
2. **Recall rules and decisions for the task**:
|
|
22
|
+
```js
|
|
23
|
+
fastr_recall({
|
|
24
|
+
query: "JWT expiry handling in auth guard",
|
|
25
|
+
files: ["src/auth/jwt.ts"],
|
|
26
|
+
module: "auth",
|
|
27
|
+
budgetTokens: 1500
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
Set `includeHistory: true` only when you need superseded rules (for example, to learn why something changed).
|
|
31
|
+
|
|
32
|
+
Or get one token-budgeted context block (rules + traps + ready tasks + last handoff):
|
|
33
|
+
```js
|
|
34
|
+
fastr_assemble({
|
|
35
|
+
taskDescription: "Add refresh-token rotation to the auth guard",
|
|
36
|
+
targetFiles: ["src/auth/guard.ts"],
|
|
37
|
+
module: "auth",
|
|
38
|
+
budgetTokens: 2000
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
3. **Drill down only when needed**:
|
|
43
|
+
- Everything linked to one file: `fastr_file_history({ filePath: "src/auth/jwt.ts" })`
|
|
44
|
+
- Neighbouring files and memories: `fastr_graph_query({ filePath: "src/auth/jwt.ts", depth: 2 })`
|
|
45
|
+
- Verbatim stack trace or diff behind a memory: `fastr_drill({ memoryId: "mem_8f2a1c" })`
|
|
46
|
+
- Where the last session stopped: `fastr_handoff({ action: "latest" })`
|
|
47
|
+
|
|
48
|
+
## Ground rules
|
|
49
|
+
- If recall returns nothing, say so. Do not invent project conventions.
|
|
50
|
+
- Note the IDs of memories you relied on; rate them at the end with the `fastr-session-commit` skill.
|
|
51
|
+
- When a failure is diagnosed mid-task, switch to the `fastr-trap-log` skill immediately.
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastr-plan-estimate
|
|
3
|
-
description: Use when the user asks how long or how risky a change will be, before committing to an estimate or plan for a migration, refactor, or bug fix, and again when that work finishes so the estimate can be closed with the actual result. Calibrates estimates against the project's own track record.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# FastrMemory: Calibrated Estimates and Risk
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- You are asked for an effort or time estimate.
|
|
10
|
-
- You are planning edits to files with a history of breakage.
|
|
11
|
-
- A previously estimated task is complete (close the prediction).
|
|
12
|
-
|
|
13
|
-
## 1. Check the base rate for this kind of work
|
|
14
|
-
```js
|
|
15
|
-
fastr_predict_baserate({ classTag: "migration" })
|
|
16
|
-
```
|
|
17
|
-
If history exists, multiply your inside-view estimate by the reported median ratio. Pick a stable `classTag` (for example `migration`, `refactor`, `bugfix`, `feature`) and reuse it.
|
|
18
|
-
|
|
19
|
-
## 2. Check pre-edit risk for the target files
|
|
20
|
-
```js
|
|
21
|
-
fastr_risk_predict({ targetFiles: ["src/db/schema.ts", "src/db/repository.ts"], module: "db" })
|
|
22
|
-
```
|
|
23
|
-
High risk means: read the traps (`fastr-memory` skill), plan smaller steps, and add tests first.
|
|
24
|
-
|
|
25
|
-
## 3. Record the estimate
|
|
26
|
-
```js
|
|
27
|
-
fastr_predict({
|
|
28
|
-
action: "create",
|
|
29
|
-
classTag: "migration",
|
|
30
|
-
claimText: "Add bi-temporal columns to the actions table",
|
|
31
|
-
estimateValue: 3,
|
|
32
|
-
estimateUnit: "hours"
|
|
33
|
-
})
|
|
34
|
-
```
|
|
35
|
-
Note the returned prediction ID.
|
|
36
|
-
|
|
37
|
-
## 4. Close it when the work is done
|
|
38
|
-
```js
|
|
39
|
-
fastr_predict({ action: "close", predictionId: 12, actualValue: 5 })
|
|
40
|
-
```
|
|
41
|
-
List open predictions with `fastr_predict({ action: "list", classTag: "migration" })`.
|
|
42
|
-
|
|
43
|
-
## Rules
|
|
44
|
-
- Report the calibrated number, and say what the raw estimate was.
|
|
45
|
-
- Always close predictions; unclosed ones never improve future calibration.
|
|
1
|
+
---
|
|
2
|
+
name: fastr-plan-estimate
|
|
3
|
+
description: Use when the user asks how long or how risky a change will be, before committing to an estimate or plan for a migration, refactor, or bug fix, and again when that work finishes so the estimate can be closed with the actual result. Calibrates estimates against the project's own track record.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FastrMemory: Calibrated Estimates and Risk
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- You are asked for an effort or time estimate.
|
|
10
|
+
- You are planning edits to files with a history of breakage.
|
|
11
|
+
- A previously estimated task is complete (close the prediction).
|
|
12
|
+
|
|
13
|
+
## 1. Check the base rate for this kind of work
|
|
14
|
+
```js
|
|
15
|
+
fastr_predict_baserate({ classTag: "migration" })
|
|
16
|
+
```
|
|
17
|
+
If history exists, multiply your inside-view estimate by the reported median ratio. Pick a stable `classTag` (for example `migration`, `refactor`, `bugfix`, `feature`) and reuse it.
|
|
18
|
+
|
|
19
|
+
## 2. Check pre-edit risk for the target files
|
|
20
|
+
```js
|
|
21
|
+
fastr_risk_predict({ targetFiles: ["src/db/schema.ts", "src/db/repository.ts"], module: "db" })
|
|
22
|
+
```
|
|
23
|
+
High risk means: read the traps (`fastr-memory` skill), plan smaller steps, and add tests first.
|
|
24
|
+
|
|
25
|
+
## 3. Record the estimate
|
|
26
|
+
```js
|
|
27
|
+
fastr_predict({
|
|
28
|
+
action: "create",
|
|
29
|
+
classTag: "migration",
|
|
30
|
+
claimText: "Add bi-temporal columns to the actions table",
|
|
31
|
+
estimateValue: 3,
|
|
32
|
+
estimateUnit: "hours"
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
Note the returned prediction ID.
|
|
36
|
+
|
|
37
|
+
## 4. Close it when the work is done
|
|
38
|
+
```js
|
|
39
|
+
fastr_predict({ action: "close", predictionId: 12, actualValue: 5 })
|
|
40
|
+
```
|
|
41
|
+
List open predictions with `fastr_predict({ action: "list", classTag: "migration" })`.
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
- Report the calibrated number, and say what the raw estimate was.
|
|
45
|
+
- Always close predictions; unclosed ones never improve future calibration.
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastr-session-commit
|
|
3
|
-
description: Use when a task or milestone is finished and tests pass, before handing control back to the user, or when you are about to run out of context. Rates the memories you used, supersedes rules your work invalidated, and saves a handoff that promotes this session's staging memories to verified.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# FastrMemory: Commit the Session
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- The task is done and the test suite passes.
|
|
10
|
-
- You are yielding to the user or another agent, or context is about to be compacted.
|
|
11
|
-
- You are resuming work and need to know where the last session stopped.
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
1. **Supersede rules your change made obsolete** (keeps history, redirects future recall):
|
|
16
|
-
```js
|
|
17
|
-
fastr_supersede({
|
|
18
|
-
oldMemoryId: "mem_8f2a1c",
|
|
19
|
-
newTitle: "Use Vitest for all unit tests",
|
|
20
|
-
newContent: "The project migrated from Jest to Vitest for native ESM. Do not add Jest config.",
|
|
21
|
-
reason: "Test runner migration",
|
|
22
|
-
files: ["vitest.config.ts"]
|
|
23
|
-
})
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
2. **Rate each memory you actually relied on** (per ID, never the whole batch):
|
|
27
|
-
```js
|
|
28
|
-
fastr_feedback({ memoryId: "mem_3c9d0e", outcome: "good" })
|
|
29
|
-
fastr_feedback({ memoryId: "mem_77ab12", outcome: "bad", note: "Described the old config loader" })
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
3. **Save the handoff and verify staging**:
|
|
33
|
-
```js
|
|
34
|
-
fastr_handoff({
|
|
35
|
-
action: "save",
|
|
36
|
-
taskTitle: "Refresh-token rotation in auth guard",
|
|
37
|
-
summary: "Added rotation and revocation list; all auth tests pass.",
|
|
38
|
-
nextStep: "Wire revocation list cleanup into the nightly job.",
|
|
39
|
-
activeFiles: ["src/auth/guard.ts", "src/auth/jwt.ts"],
|
|
40
|
-
verifyStaging: true
|
|
41
|
-
})
|
|
42
|
-
```
|
|
43
|
-
Only pass `verifyStaging: true` when tests pass; it promotes every staging memory from this project to verified.
|
|
44
|
-
|
|
45
|
-
## Resuming a session
|
|
46
|
-
```js
|
|
47
|
-
fastr_handoff({ action: "latest" })
|
|
48
|
-
```
|
|
49
|
-
Read the summary and next step before planning, then follow the `fastr-memory` skill.
|
|
1
|
+
---
|
|
2
|
+
name: fastr-session-commit
|
|
3
|
+
description: Use when a task or milestone is finished and tests pass, before handing control back to the user, or when you are about to run out of context. Rates the memories you used, supersedes rules your work invalidated, and saves a handoff that promotes this session's staging memories to verified.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FastrMemory: Commit the Session
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- The task is done and the test suite passes.
|
|
10
|
+
- You are yielding to the user or another agent, or context is about to be compacted.
|
|
11
|
+
- You are resuming work and need to know where the last session stopped.
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. **Supersede rules your change made obsolete** (keeps history, redirects future recall):
|
|
16
|
+
```js
|
|
17
|
+
fastr_supersede({
|
|
18
|
+
oldMemoryId: "mem_8f2a1c",
|
|
19
|
+
newTitle: "Use Vitest for all unit tests",
|
|
20
|
+
newContent: "The project migrated from Jest to Vitest for native ESM. Do not add Jest config.",
|
|
21
|
+
reason: "Test runner migration",
|
|
22
|
+
files: ["vitest.config.ts"]
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. **Rate each memory you actually relied on** (per ID, never the whole batch):
|
|
27
|
+
```js
|
|
28
|
+
fastr_feedback({ memoryId: "mem_3c9d0e", outcome: "good" })
|
|
29
|
+
fastr_feedback({ memoryId: "mem_77ab12", outcome: "bad", note: "Described the old config loader" })
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. **Save the handoff and verify staging**:
|
|
33
|
+
```js
|
|
34
|
+
fastr_handoff({
|
|
35
|
+
action: "save",
|
|
36
|
+
taskTitle: "Refresh-token rotation in auth guard",
|
|
37
|
+
summary: "Added rotation and revocation list; all auth tests pass.",
|
|
38
|
+
nextStep: "Wire revocation list cleanup into the nightly job.",
|
|
39
|
+
activeFiles: ["src/auth/guard.ts", "src/auth/jwt.ts"],
|
|
40
|
+
verifyStaging: true
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
Only pass `verifyStaging: true` when tests pass; it promotes every staging memory from this project to verified.
|
|
44
|
+
|
|
45
|
+
## Resuming a session
|
|
46
|
+
```js
|
|
47
|
+
fastr_handoff({ action: "latest" })
|
|
48
|
+
```
|
|
49
|
+
Read the summary and next step before planning, then follow the `fastr-memory` skill.
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastr-setup
|
|
3
|
-
description: Use when FastrMemory tools are missing or not responding in Claude Code, when the user asks to install or wire up FastrMemory in a project, or when hooks (session start, pre-edit trap warnings) are not firing. Covers project install, manual MCP registration, and verification.
|
|
4
|
-
allowed-tools: Bash(fastr *), Bash(fastrmemory *), Bash(npx -y fastrmemory*)
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# FastrMemory: Wire Up Claude Code
|
|
8
|
-
|
|
9
|
-
## When to use
|
|
10
|
-
- `fastr_*` tools are not available in the session.
|
|
11
|
-
- The user asks to set up FastrMemory for this repository.
|
|
12
|
-
- Pre-edit trap warnings or session-start context stopped appearing.
|
|
13
|
-
|
|
14
|
-
## 1. Project install (recommended)
|
|
15
|
-
Run from the project root:
|
|
16
|
-
```bash
|
|
17
|
-
npx -y fastrmemory@0.3.
|
|
18
|
-
```
|
|
19
|
-
This is idempotent and backs up files it changes. It writes:
|
|
20
|
-
- `.mcp.json`: a project-scoped `fastrmemory` MCP server.
|
|
21
|
-
- `.claude/settings.json`: hooks for `SessionStart`, `PreToolUse` (matcher `Edit|Write|MultiEdit|NotebookEdit`), `PreCompact`, and `SessionEnd`, each running the FastrMemory CLI as `... hook run <event>`.
|
|
22
|
-
- `.cursor/mcp.json` and an `AGENTS.md` discipline block for other agents.
|
|
23
|
-
|
|
24
|
-
Commit `.mcp.json` and `.claude/settings.json` so the team shares the setup. Restart Claude Code and approve the project MCP server when prompted.
|
|
25
|
-
|
|
26
|
-
## 2. Manual MCP registration (alternative)
|
|
27
|
-
```bash
|
|
28
|
-
claude mcp add fastrmemory -- npx -y fastrmemory@0.3.
|
|
29
|
-
```
|
|
30
|
-
On native Windows use `-- cmd /c npx -y fastrmemory@0.3.
|
|
31
|
-
|
|
32
|
-
## 3. Verify
|
|
33
|
-
```bash
|
|
34
|
-
npx -y fastrmemory@0.3.
|
|
35
|
-
claude mcp list
|
|
36
|
-
```
|
|
37
|
-
`status` prints the project ID, memory counts, and database path (`.fastr/` under the project). Inside a session, call:
|
|
38
|
-
```js
|
|
39
|
-
fastr_status({})
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Troubleshooting
|
|
43
|
-
- Tools missing after install: run `/mcp` in Claude Code and check the server started; requires Node >= 22.16.
|
|
44
|
-
- Searches miss new memories or the DB looks inconsistent: follow the `fastr-doctor` skill.
|
|
45
|
-
- Do not edit `~/.claude` files by hand; prefer the commands above.
|
|
1
|
+
---
|
|
2
|
+
name: fastr-setup
|
|
3
|
+
description: Use when FastrMemory tools are missing or not responding in Claude Code, when the user asks to install or wire up FastrMemory in a project, or when hooks (session start, pre-edit trap warnings) are not firing. Covers project install, manual MCP registration, and verification.
|
|
4
|
+
allowed-tools: Bash(fastr *), Bash(fastrmemory *), Bash(npx -y fastrmemory*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# FastrMemory: Wire Up Claude Code
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
- `fastr_*` tools are not available in the session.
|
|
11
|
+
- The user asks to set up FastrMemory for this repository.
|
|
12
|
+
- Pre-edit trap warnings or session-start context stopped appearing.
|
|
13
|
+
|
|
14
|
+
## 1. Project install (recommended)
|
|
15
|
+
Run from the project root:
|
|
16
|
+
```bash
|
|
17
|
+
npx -y fastrmemory@0.3.1 hook install
|
|
18
|
+
```
|
|
19
|
+
This is idempotent and backs up files it changes. It writes:
|
|
20
|
+
- `.mcp.json`: a project-scoped `fastrmemory` MCP server.
|
|
21
|
+
- `.claude/settings.json`: hooks for `SessionStart`, `PreToolUse` (matcher `Edit|Write|MultiEdit|NotebookEdit`), `PreCompact`, and `SessionEnd`, each running the FastrMemory CLI as `... hook run <event>`.
|
|
22
|
+
- `.cursor/mcp.json` and an `AGENTS.md` discipline block for other agents.
|
|
23
|
+
|
|
24
|
+
Commit `.mcp.json` and `.claude/settings.json` so the team shares the setup. Restart Claude Code and approve the project MCP server when prompted.
|
|
25
|
+
|
|
26
|
+
## 2. Manual MCP registration (alternative)
|
|
27
|
+
```bash
|
|
28
|
+
claude mcp add fastrmemory -- npx -y fastrmemory@0.3.1 mcp
|
|
29
|
+
```
|
|
30
|
+
On native Windows use `-- cmd /c npx -y fastrmemory@0.3.1 mcp`. Pass `--scope project` (before the name) to write `.mcp.json`. For a user-scoped registration (the default when `--scope project` is omitted), append `--project <absolute-project-path>` so the server does not use the client's launch directory; `fastr setup` writes that path automatically. This adds tools only, not hooks.
|
|
31
|
+
|
|
32
|
+
## 3. Verify
|
|
33
|
+
```bash
|
|
34
|
+
npx -y fastrmemory@0.3.1 status
|
|
35
|
+
claude mcp list
|
|
36
|
+
```
|
|
37
|
+
`status` prints the project ID, memory counts, and database path (`.fastr/` under the project). Inside a session, call:
|
|
38
|
+
```js
|
|
39
|
+
fastr_status({})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Troubleshooting
|
|
43
|
+
- Tools missing after install: run `/mcp` in Claude Code and check the server started; requires Node >= 22.16.
|
|
44
|
+
- Searches miss new memories or the DB looks inconsistent: follow the `fastr-doctor` skill.
|
|
45
|
+
- Do not edit `~/.claude` files by hand; prefer the commands above.
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastr-trap-log
|
|
3
|
-
description: Use the moment you diagnose the root cause of a build error, failing test, runtime exception, or platform/library gotcha. Records it as an error trap so future agents are warned before editing the same files. Do not wait until the end of the session.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# FastrMemory: Log Error Traps Immediately
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- A test, type check, or build failed and you now know why.
|
|
10
|
-
- A runtime crash or wrong behaviour was traced to a specific cause.
|
|
11
|
-
- You hit a subtle environment trap (Windows paths, SQLite locking, ESM/CJS interop, timezone, rounding).
|
|
12
|
-
|
|
13
|
-
Skip it for typos or one-off mistakes that teach nothing reusable.
|
|
14
|
-
|
|
15
|
-
## Steps
|
|
16
|
-
|
|
17
|
-
1. **Check it is not already recorded**:
|
|
18
|
-
```js
|
|
19
|
-
fastr_trap_recall({ files: ["src/db/schema.ts"] })
|
|
20
|
-
```
|
|
21
|
-
If the same trap exists, do not duplicate it; rate it instead with
|
|
22
|
-
`fastr_feedback({ memoryId: "mem_xxxx", outcome: "good", note: "Trap matched this failure" })`.
|
|
23
|
-
|
|
24
|
-
2. **Log the trap** (stored as a verified `error_trap` with a 2.0x recall boost):
|
|
25
|
-
```js
|
|
26
|
-
fastr_trap_log({
|
|
27
|
-
title: "Never open two write connections to the SQLite DB",
|
|
28
|
-
content: "Symptom: SQLITE_BUSY in tests. Cause: a second DatabaseSync writer outside the shared repo. Fix: reuse the server context's db handle.",
|
|
29
|
-
files: ["src/db/schema.ts", "src/mcp/server.ts"],
|
|
30
|
-
module: "db"
|
|
31
|
-
})
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Writing a good trap
|
|
35
|
-
- `title`: imperative rule, not a description of the bug ("Always X" / "Never Y").
|
|
36
|
-
- `content`: symptom, root cause, and the concrete fix or workaround, in a few sentences.
|
|
37
|
-
- `files`: every file where the trap applies; this is what pre-edit checks match on.
|
|
38
|
-
- Never paste secrets, tokens, or private URLs. Content is scrubbed, but do not rely on it.
|
|
39
|
-
- If the fix changes an existing rule, also follow the `fastr-curate` skill to supersede it.
|
|
1
|
+
---
|
|
2
|
+
name: fastr-trap-log
|
|
3
|
+
description: Use the moment you diagnose the root cause of a build error, failing test, runtime exception, or platform/library gotcha. Records it as an error trap so future agents are warned before editing the same files. Do not wait until the end of the session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FastrMemory: Log Error Traps Immediately
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- A test, type check, or build failed and you now know why.
|
|
10
|
+
- A runtime crash or wrong behaviour was traced to a specific cause.
|
|
11
|
+
- You hit a subtle environment trap (Windows paths, SQLite locking, ESM/CJS interop, timezone, rounding).
|
|
12
|
+
|
|
13
|
+
Skip it for typos or one-off mistakes that teach nothing reusable.
|
|
14
|
+
|
|
15
|
+
## Steps
|
|
16
|
+
|
|
17
|
+
1. **Check it is not already recorded**:
|
|
18
|
+
```js
|
|
19
|
+
fastr_trap_recall({ files: ["src/db/schema.ts"] })
|
|
20
|
+
```
|
|
21
|
+
If the same trap exists, do not duplicate it; rate it instead with
|
|
22
|
+
`fastr_feedback({ memoryId: "mem_xxxx", outcome: "good", note: "Trap matched this failure" })`.
|
|
23
|
+
|
|
24
|
+
2. **Log the trap** (stored as a verified `error_trap` with a 2.0x recall boost):
|
|
25
|
+
```js
|
|
26
|
+
fastr_trap_log({
|
|
27
|
+
title: "Never open two write connections to the SQLite DB",
|
|
28
|
+
content: "Symptom: SQLITE_BUSY in tests. Cause: a second DatabaseSync writer outside the shared repo. Fix: reuse the server context's db handle.",
|
|
29
|
+
files: ["src/db/schema.ts", "src/mcp/server.ts"],
|
|
30
|
+
module: "db"
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Writing a good trap
|
|
35
|
+
- `title`: imperative rule, not a description of the bug ("Always X" / "Never Y").
|
|
36
|
+
- `content`: symptom, root cause, and the concrete fix or workaround, in a few sentences.
|
|
37
|
+
- `files`: every file where the trap applies; this is what pre-edit checks match on.
|
|
38
|
+
- Never paste secrets, tokens, or private URLs. Content is scrubbed, but do not rely on it.
|
|
39
|
+
- If the fix changes an existing rule, also follow the `fastr-curate` skill to supersede it.
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fastr-vision
|
|
3
|
-
description: Use when a screenshot, UI mockup, architecture diagram, or error screen should be remembered for later, or before fixing a visual bug or redesigning UI to find related images stored earlier. Tags images with descriptions and OCR text and searches them.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# FastrMemory: Visual Memory
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- The user shares a screenshot or diagram that explains a bug, design, or architecture.
|
|
10
|
-
- A test or tool produced an image worth keeping (visual regression, error dialog).
|
|
11
|
-
- You are about to change UI and want earlier screenshots or design references.
|
|
12
|
-
|
|
13
|
-
## 1. Tag an image
|
|
14
|
-
```js
|
|
15
|
-
fastr_vision_tag({
|
|
16
|
-
filePath: "screenshots/checkout-401.png",
|
|
17
|
-
description: "Checkout modal showing a red HTTP 401 banner above the pay button",
|
|
18
|
-
ocrText: "HTTP 401 Unauthorized. Access token expired.",
|
|
19
|
-
memoryId: "mem_009e4a7d",
|
|
20
|
-
taskId: "act_checkout_fix"
|
|
21
|
-
})
|
|
22
|
-
```
|
|
23
|
-
- `description`: components, layout, colours, and what is wrong or notable.
|
|
24
|
-
- `ocrText`: exact visible text (error messages, codes, labels) to make keyword search work.
|
|
25
|
-
- `memoryId` / `taskId` (optional): link the governing trap or rule, and the related action.
|
|
26
|
-
|
|
27
|
-
## 2. Search images
|
|
28
|
-
```js
|
|
29
|
-
fastr_vision_search({ query: "checkout modal 401 error", limit: 5 })
|
|
30
|
-
```
|
|
31
|
-
Filter to images linked to one memory with `memoryId: "mem_009e4a7d"`.
|
|
32
|
-
|
|
33
|
-
## Rules
|
|
34
|
-
- Describe what is in the image; do not guess at content you cannot see.
|
|
35
|
-
- Do not tag images containing secrets or personal data.
|
|
1
|
+
---
|
|
2
|
+
name: fastr-vision
|
|
3
|
+
description: Use when a screenshot, UI mockup, architecture diagram, or error screen should be remembered for later, or before fixing a visual bug or redesigning UI to find related images stored earlier. Tags images with descriptions and OCR text and searches them.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FastrMemory: Visual Memory
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- The user shares a screenshot or diagram that explains a bug, design, or architecture.
|
|
10
|
+
- A test or tool produced an image worth keeping (visual regression, error dialog).
|
|
11
|
+
- You are about to change UI and want earlier screenshots or design references.
|
|
12
|
+
|
|
13
|
+
## 1. Tag an image
|
|
14
|
+
```js
|
|
15
|
+
fastr_vision_tag({
|
|
16
|
+
filePath: "screenshots/checkout-401.png",
|
|
17
|
+
description: "Checkout modal showing a red HTTP 401 banner above the pay button",
|
|
18
|
+
ocrText: "HTTP 401 Unauthorized. Access token expired.",
|
|
19
|
+
memoryId: "mem_009e4a7d",
|
|
20
|
+
taskId: "act_checkout_fix"
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
- `description`: components, layout, colours, and what is wrong or notable.
|
|
24
|
+
- `ocrText`: exact visible text (error messages, codes, labels) to make keyword search work.
|
|
25
|
+
- `memoryId` / `taskId` (optional): link the governing trap or rule, and the related action.
|
|
26
|
+
|
|
27
|
+
## 2. Search images
|
|
28
|
+
```js
|
|
29
|
+
fastr_vision_search({ query: "checkout modal 401 error", limit: 5 })
|
|
30
|
+
```
|
|
31
|
+
Filter to images linked to one memory with `memoryId: "mem_009e4a7d"`.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
- Describe what is in the image; do not guess at content you cannot see.
|
|
35
|
+
- Do not tag images containing secrets or personal data.
|