Skip to content

Commit 1e0bcfa

Browse files
Prepare to implement MVP by doing some planning
0 parents  commit 1e0bcfa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+6291
-0
lines changed

.claude/commands/memento.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
allowed-tools: Bash(npx memento-protocol ticket list), Bash(ls:.memento/modes/), Bash(ls:.memento/workflows/), Bash(head:CLAUDE.md)
3+
description: Show current Memento Protocol project status
4+
---
5+
# Memento Protocol Status
6+
7+
## Active Tickets
8+
!`npx memento-protocol ticket list 2>/dev/null || echo "No tickets found"`
9+
10+
## Available Modes
11+
!`ls -1 .memento/modes/ 2>/dev/null | head -10 || echo "No modes installed"`
12+
13+
## Available Workflows
14+
!`ls -1 .memento/workflows/ 2>/dev/null | head -10 || echo "No workflows installed"`
15+
16+
## Current Configuration
17+
!`head -20 CLAUDE.md 2>/dev/null || echo "CLAUDE.md not found"`

.claude/commands/mode.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
allowed-tools: Bash(sh:.memento/scripts/mode-switch.sh)
3+
argument-hint: [mode-name]
4+
description: List available modes or switch to a specific mode
5+
---
6+
# Mode Management
7+
8+
!`sh .memento/scripts/mode-switch.sh $ARGUMENTS`
9+
10+
11+
12+
I'll now operate according to the mode guidelines shown above.

.claude/commands/ticket.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
allowed-tools: Bash(sh:.memento/scripts/ticket-context.sh)
3+
argument-hint: [ticket-name]
4+
description: List tickets or load specific ticket context
5+
---
6+
# Ticket Management
7+
8+
!`sh .memento/scripts/ticket-context.sh $ARGUMENTS`
9+
10+
11+
12+
I now have the current ticket status and context loaded.

.claude/settings.local.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(../dist/cli.js)",
5+
"Bash(../src/cli.ts)",
6+
"Bash(cat:*)",
7+
"Bash(chmod:*)",
8+
"Bash(find:*)",
9+
"Bash(git add:*)",
10+
"Bash(git commit:*)",
11+
"Bash(git describe:*)",
12+
"Bash(git push:*)",
13+
"Bash(git tag:*)",
14+
"Bash(gtimeout 15 npm run dev init -- --force --quick)",
15+
"Bash(ls:*)",
16+
"Bash(mkdir:*)",
17+
"Bash(mv:*)",
18+
"Bash(node:*)",
19+
"Bash(npm init:*)",
20+
"Bash(npm publish:*)",
21+
"Bash(npm run build:*)",
22+
"Bash(npm run dev init:*)",
23+
"Bash(npm run dev:*)",
24+
"Bash(npm run:*)",
25+
"Bash(npm test:*)",
26+
"Bash(npx memento-protocol ticket:*)",
27+
"Bash(npx tsx:*)",
28+
"Bash(rm:*)",
29+
"Bash(scripts/npm/commit-tag-and-publish.sh:*)",
30+
"Bash(timeout 15 npm run dev init -- --force --quick)",
31+
"WebFetch(domain:docs.anthropic.com)"
32+
],
33+
"deny": []
34+
},
35+
"hooks": {
36+
"UserPromptSubmit": [
37+
{
38+
"matcher": "*",
39+
"hooks": [
40+
{
41+
"type": "command",
42+
"command": "./.memento/hooks/scripts/acronym-expander.sh",
43+
"timeout": 30
44+
}
45+
]
46+
},
47+
{
48+
"matcher": "*",
49+
"hooks": [
50+
{
51+
"type": "command",
52+
"command": "./.memento/hooks/scripts/git-context-loader.sh",
53+
"timeout": 30
54+
}
55+
]
56+
},
57+
{
58+
"matcher": "*",
59+
"hooks": [
60+
{
61+
"type": "command",
62+
"command": "./.memento/hooks/scripts/memento-routing.sh",
63+
"timeout": 30
64+
}
65+
]
66+
}
67+
],
68+
"SessionStart": [
69+
{
70+
"matcher": "*",
71+
"hooks": [
72+
{
73+
"type": "command",
74+
"command": "./.memento/hooks/scripts/project-overview.sh",
75+
"timeout": 30
76+
}
77+
]
78+
}
79+
]
80+
}
81+
}

.memento/config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "1.0.0",
3+
"defaultMode": "autonomous-project-manager",
4+
"components": {
5+
"modes": [
6+
"ai-debt-maintainer",
7+
"architect",
8+
"autonomous-project-manager",
9+
"engineer",
10+
"reviewer"
11+
],
12+
"workflows": [
13+
"openmemory-setup",
14+
"review",
15+
"summarize"
16+
]
17+
}
18+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"version": "1.0.0",
3+
"hooks": [
4+
{
5+
"id": "acronym-expander",
6+
"name": "Acronym Expander",
7+
"description": "Automatically expands configured acronyms in prompts",
8+
"event": "UserPromptSubmit",
9+
"enabled": true,
10+
"command": "/Users/dazheng/workspace/dtrinity/hypernative/hypernative-apply/.memento/hooks/scripts/acronym-expander.sh",
11+
"priority": 150,
12+
"requirements": {
13+
"commands": [
14+
"cat",
15+
"jq",
16+
"echo",
17+
"grep",
18+
"tr",
19+
"pwd"
20+
],
21+
"env": [],
22+
"files": []
23+
}
24+
}
25+
]
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "1.0.0",
3+
"hooks": [
4+
{
5+
"id": "git-context-loader",
6+
"name": "Git Context Loader",
7+
"description": "Loads current git status on each user prompt",
8+
"event": "UserPromptSubmit",
9+
"enabled": true,
10+
"command": "/Users/dazheng/workspace/dtrinity/hypernative/hypernative-apply/.memento/hooks/scripts/git-context-loader.sh",
11+
"continueOnError": true,
12+
"priority": 95,
13+
"requirements": {
14+
"commands": [
15+
"echo",
16+
"git",
17+
"head"
18+
],
19+
"env": [],
20+
"files": []
21+
}
22+
}
23+
]
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "1.0.0",
3+
"hooks": [
4+
{
5+
"id": "memento-routing",
6+
"name": "Memento Routing Hook",
7+
"description": "Routes modes, workflows, and tickets based on user prompts",
8+
"event": "UserPromptSubmit",
9+
"enabled": true,
10+
"command": "/Users/dazheng/workspace/dtrinity/hypernative/hypernative-apply/.memento/hooks/scripts/memento-routing.sh",
11+
"priority": 100,
12+
"requirements": {
13+
"commands": [
14+
"jq",
15+
"grep",
16+
"sed",
17+
"cat",
18+
"echo",
19+
"ls",
20+
"basename"
21+
]
22+
}
23+
}
24+
]
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"version": "1.0.0",
3+
"hooks": [
4+
{
5+
"id": "project-overview",
6+
"name": "Project Overview",
7+
"description": "Loads project overview including tickets status at session start",
8+
"event": "SessionStart",
9+
"enabled": true,
10+
"command": "/Users/dazheng/workspace/dtrinity/hypernative/hypernative-apply/.memento/hooks/scripts/project-overview.sh",
11+
"continueOnError": true,
12+
"priority": 85,
13+
"requirements": {
14+
"commands": [
15+
"echo",
16+
"find",
17+
"wc",
18+
"tr",
19+
"basename"
20+
],
21+
"env": [],
22+
"files": []
23+
}
24+
}
25+
]
26+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
3+
# Read JSON input from stdin
4+
json_input=$(cat)
5+
6+
# Extract the prompt field from JSON
7+
prompt=$(echo "$json_input" | jq -r '.prompt // empty')
8+
9+
# If no prompt field, exit without output
10+
if [ -z "$prompt" ]; then
11+
exit 0
12+
fi
13+
14+
# Get the project root (current working directory)
15+
PROJECT_ROOT="$(pwd)"
16+
17+
# Get the acronyms config path
18+
acronyms_file="${PROJECT_ROOT}/.memento/acronyms.json"
19+
20+
# Check if acronyms config exists
21+
if [ ! -f "$acronyms_file" ]; then
22+
# No acronyms file - don't output anything
23+
exit 0
24+
fi
25+
26+
# Read acronyms config
27+
acronyms_json=$(cat "$acronyms_file" 2>/dev/null || echo '{}')
28+
29+
# Extract settings
30+
case_sensitive=$(echo "$acronyms_json" | jq -r '.settings.caseSensitive // false')
31+
whole_word=$(echo "$acronyms_json" | jq -r '.settings.wholeWordOnly // true')
32+
33+
# Get all acronyms
34+
acronyms=$(echo "$acronyms_json" | jq -r '.acronyms // {} | to_entries | .[] | "\(.key)|\(.value)"')
35+
36+
# Track detected acronyms
37+
detected_acronyms=""
38+
39+
# Check each acronym
40+
while IFS='|' read -r acronym expansion; do
41+
if [ -z "$acronym" ]; then
42+
continue
43+
fi
44+
45+
# Build the search pattern
46+
if [ "$whole_word" = "true" ]; then
47+
pattern="\\b${acronym}\\b"
48+
else
49+
pattern="$acronym"
50+
fi
51+
52+
# Check if acronym exists in prompt
53+
if [ "$case_sensitive" = "true" ]; then
54+
if echo "$prompt" | grep -q "$pattern"; then
55+
detected_acronyms="${detected_acronyms}- **${acronym}**: ${expansion}\n"
56+
fi
57+
else
58+
if echo "$prompt" | grep -qi "$pattern"; then
59+
# For case-insensitive, show the uppercase version
60+
display_acronym=$(echo "$acronym" | tr '[:lower:]' '[:upper:]')
61+
detected_acronyms="${detected_acronyms}- **${display_acronym}**: ${expansion}\n"
62+
fi
63+
fi
64+
done <<< "$acronyms"
65+
66+
# If any acronyms were detected, output ONLY the glossary
67+
# Claude Code will append the original prompt
68+
if [ -n "$detected_acronyms" ]; then
69+
echo -e "## Acronym Glossary\n${detected_acronyms}\n---\n"
70+
fi

0 commit comments

Comments
 (0)