diff --git a/.claude/commands/memento.md b/.claude/commands/memento.md deleted file mode 100644 index c7ac9e3..0000000 --- a/.claude/commands/memento.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -allowed-tools: Bash(npx memento-protocol ticket list), Bash(ls:.memento/modes/), Bash(ls:.memento/workflows/), Bash(head:CLAUDE.md) -description: Show current Memento Protocol project status ---- -# Memento Protocol Status - -## Active Tickets -!`npx memento-protocol ticket list 2>/dev/null || echo "No tickets found"` - -## Available Modes -!`ls -1 .memento/modes/ 2>/dev/null | head -10 || echo "No modes installed"` - -## Available Workflows -!`ls -1 .memento/workflows/ 2>/dev/null | head -10 || echo "No workflows installed"` - -## Current Configuration -!`head -20 CLAUDE.md 2>/dev/null || echo "CLAUDE.md not found"` \ No newline at end of file diff --git a/.claude/commands/mode.md b/.claude/commands/mode.md deleted file mode 100644 index 606eca6..0000000 --- a/.claude/commands/mode.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -allowed-tools: Bash(sh:.memento/scripts/mode-switch.sh) -argument-hint: [mode-name] -description: List available modes or switch to a specific mode ---- -# Mode Management - -!`sh .memento/scripts/mode-switch.sh $ARGUMENTS` - - - -I'll now operate according to the mode guidelines shown above. \ No newline at end of file diff --git a/.claude/commands/ticket.md b/.claude/commands/ticket.md deleted file mode 100644 index 2c991a5..0000000 --- a/.claude/commands/ticket.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -allowed-tools: Bash(sh:.memento/scripts/ticket-context.sh) -argument-hint: [ticket-name] -description: List tickets or load specific ticket context ---- -# Ticket Management - -!`sh .memento/scripts/ticket-context.sh $ARGUMENTS` - - - -I now have the current ticket status and context loaded. \ No newline at end of file diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index eb301b0..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(../dist/cli.js)", - "Bash(../src/cli.ts)", - "Bash(cat:*)", - "Bash(chmod:*)", - "Bash(find:*)", - "Bash(git add:*)", - "Bash(git commit:*)", - "Bash(git describe:*)", - "Bash(git push:*)", - "Bash(git tag:*)", - "Bash(gtimeout 15 npm run dev init -- --force --quick)", - "Bash(ls:*)", - "Bash(mkdir:*)", - "Bash(mv:*)", - "Bash(node:*)", - "Bash(npm init:*)", - "Bash(npm publish:*)", - "Bash(npm run build:*)", - "Bash(npm run dev init:*)", - "Bash(npm run dev:*)", - "Bash(npm run:*)", - "Bash(npm test:*)", - "Bash(npx memento-protocol ticket:*)", - "Bash(npx tsx:*)", - "Bash(rm:*)", - "Bash(scripts/npm/commit-tag-and-publish.sh:*)", - "Bash(timeout 15 npm run dev init -- --force --quick)", - "WebFetch(domain:docs.anthropic.com)" - ], - "deny": [], - "additionalDirectories": [ - "/Users/dazheng/workspace/dtrinity" - ] - }, - "hooks": { - "UserPromptSubmit": [ - { - "matcher": "*", - "hooks": [ - { - "type": "command", - "command": "./.memento/hooks/scripts/acronym-expander.sh", - "timeout": 30 - } - ] - }, - { - "matcher": "*", - "hooks": [ - { - "type": "command", - "command": "./.memento/hooks/scripts/git-context-loader.sh", - "timeout": 30 - } - ] - }, - { - "matcher": "*", - "hooks": [ - { - "type": "command", - "command": "./.memento/hooks/scripts/memento-routing.sh", - "timeout": 30 - } - ] - } - ], - "SessionStart": [ - { - "matcher": "*", - "hooks": [ - { - "type": "command", - "command": "./.memento/hooks/scripts/project-overview.sh", - "timeout": 30 - } - ] - } - ] - } -} \ No newline at end of file diff --git a/.memento/config.json b/.memento/config.json deleted file mode 100644 index d12e6c8..0000000 --- a/.memento/config.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0", - "defaultMode": "autonomous-project-manager", - "components": { - "modes": [ - "ai-debt-maintainer", - "architect", - "autonomous-project-manager", - "engineer", - "reviewer" - ], - "workflows": [ - "openmemory-setup", - "review", - "summarize" - ] - } -} \ No newline at end of file diff --git a/.memento/hooks/definitions/acronym-expander.json b/.memento/hooks/definitions/acronym-expander.json deleted file mode 100644 index 8b33cb9..0000000 --- a/.memento/hooks/definitions/acronym-expander.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0", - "hooks": [ - { - "id": "acronym-expander", - "name": "Acronym Expander", - "description": "Automatically expands configured acronyms in prompts", - "event": "UserPromptSubmit", - "enabled": true, - "command": "/Users/dazheng/workspace/dtrinity/ronin-solidity-contracts/.memento/hooks/scripts/acronym-expander.sh", - "priority": 150, - "requirements": { - "commands": [ - "cat", - "jq", - "echo", - "grep", - "tr", - "pwd" - ], - "env": [], - "files": [] - } - } - ] -} \ No newline at end of file diff --git a/.memento/hooks/definitions/git-context-loader.json b/.memento/hooks/definitions/git-context-loader.json deleted file mode 100644 index 091ab29..0000000 --- a/.memento/hooks/definitions/git-context-loader.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "1.0.0", - "hooks": [ - { - "id": "git-context-loader", - "name": "Git Context Loader", - "description": "Loads current git status on each user prompt", - "event": "UserPromptSubmit", - "enabled": true, - "command": "/Users/dazheng/workspace/dtrinity/ronin-solidity-contracts/.memento/hooks/scripts/git-context-loader.sh", - "continueOnError": true, - "priority": 95, - "requirements": { - "commands": [ - "echo", - "git", - "head" - ], - "env": [], - "files": [] - } - } - ] -} \ No newline at end of file diff --git a/.memento/hooks/definitions/memento-routing.json b/.memento/hooks/definitions/memento-routing.json deleted file mode 100644 index 29f784f..0000000 --- a/.memento/hooks/definitions/memento-routing.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": "1.0.0", - "hooks": [ - { - "id": "memento-routing", - "name": "Memento Routing Hook", - "description": "Routes modes, workflows, and tickets based on user prompts", - "event": "UserPromptSubmit", - "enabled": true, - "command": "/Users/dazheng/workspace/dtrinity/ronin-solidity-contracts/.memento/hooks/scripts/memento-routing.sh", - "priority": 100, - "requirements": { - "commands": [ - "jq", - "grep", - "sed", - "cat", - "echo", - "ls", - "basename" - ] - } - } - ] -} \ No newline at end of file diff --git a/.memento/hooks/definitions/project-overview.json b/.memento/hooks/definitions/project-overview.json deleted file mode 100644 index 51d049c..0000000 --- a/.memento/hooks/definitions/project-overview.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0", - "hooks": [ - { - "id": "project-overview", - "name": "Project Overview", - "description": "Loads project overview including tickets status at session start", - "event": "SessionStart", - "enabled": true, - "command": "/Users/dazheng/workspace/dtrinity/ronin-solidity-contracts/.memento/hooks/scripts/project-overview.sh", - "continueOnError": true, - "priority": 85, - "requirements": { - "commands": [ - "echo", - "find", - "wc", - "tr", - "basename" - ], - "env": [], - "files": [] - } - } - ] -} \ No newline at end of file diff --git a/.memento/hooks/scripts/acronym-expander.sh b/.memento/hooks/scripts/acronym-expander.sh deleted file mode 100755 index 8f9fb0c..0000000 --- a/.memento/hooks/scripts/acronym-expander.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -# Read JSON input from stdin -json_input=$(cat) - -# Extract the prompt field from JSON -prompt=$(echo "$json_input" | jq -r '.prompt // empty') - -# If no prompt field, exit without output -if [ -z "$prompt" ]; then - exit 0 -fi - -# Get the project root (current working directory) -PROJECT_ROOT="$(pwd)" - -# Get the acronyms config path -acronyms_file="${PROJECT_ROOT}/.memento/acronyms.json" - -# Check if acronyms config exists -if [ ! -f "$acronyms_file" ]; then - # No acronyms file - don't output anything - exit 0 -fi - -# Read acronyms config -acronyms_json=$(cat "$acronyms_file" 2>/dev/null || echo '{}') - -# Extract settings -case_sensitive=$(echo "$acronyms_json" | jq -r '.settings.caseSensitive // false') -whole_word=$(echo "$acronyms_json" | jq -r '.settings.wholeWordOnly // true') - -# Get all acronyms -acronyms=$(echo "$acronyms_json" | jq -r '.acronyms // {} | to_entries | .[] | "\(.key)|\(.value)"') - -# Track detected acronyms -detected_acronyms="" - -# Check each acronym -while IFS='|' read -r acronym expansion; do - if [ -z "$acronym" ]; then - continue - fi - - # Build the search pattern - if [ "$whole_word" = "true" ]; then - pattern="\\b${acronym}\\b" - else - pattern="$acronym" - fi - - # Check if acronym exists in prompt - if [ "$case_sensitive" = "true" ]; then - if echo "$prompt" | grep -q "$pattern"; then - detected_acronyms="${detected_acronyms}- **${acronym}**: ${expansion}\n" - fi - else - if echo "$prompt" | grep -qi "$pattern"; then - # For case-insensitive, show the uppercase version - display_acronym=$(echo "$acronym" | tr '[:lower:]' '[:upper:]') - detected_acronyms="${detected_acronyms}- **${display_acronym}**: ${expansion}\n" - fi - fi -done <<< "$acronyms" - -# If any acronyms were detected, output ONLY the glossary -# Claude Code will append the original prompt -if [ -n "$detected_acronyms" ]; then - echo -e "## Acronym Glossary\n${detected_acronyms}\n---\n" -fi \ No newline at end of file diff --git a/.memento/hooks/scripts/git-context-loader.sh b/.memento/hooks/scripts/git-context-loader.sh deleted file mode 100755 index d649ff1..0000000 --- a/.memento/hooks/scripts/git-context-loader.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# Git context loader hook for Memento Protocol -# Provides succinct git status on each user prompt - -echo '## Git Status' -# Show only the first 10 changed files to keep output succinct -git status -s 2>/dev/null | head -10 || echo 'Not a git repository' - -# Exit successfully -exit 0 \ No newline at end of file diff --git a/.memento/hooks/scripts/memento-routing.sh b/.memento/hooks/scripts/memento-routing.sh deleted file mode 100755 index cb1ebac..0000000 --- a/.memento/hooks/scripts/memento-routing.sh +++ /dev/null @@ -1,322 +0,0 @@ -#!/bin/bash - -# Memento Protocol Routing Hook -# This hook processes user prompts to inject mode, workflow, and ticket context - -# Read JSON input from stdin -JSON_INPUT=$(cat) - -# Extract the prompt field from JSON -PROMPT=$(echo "$JSON_INPUT" | jq -r '.prompt // empty') - -# If no prompt field, exit without output -if [ -z "$PROMPT" ]; then - exit 0 -fi - -# Extract mode/workflow/ticket request -MODE_REQUEST=$(echo "$PROMPT" | grep -o '[Mm]ode:[[:space:]]*[A-Za-z0-9_-]*' | sed 's/[Mm]ode:[[:space:]]*//' || true) -WORKFLOW_REQUEST=$(echo "$PROMPT" | grep -o '[Ww]orkflow:[[:space:]]*[A-Za-z0-9_-]*' | sed 's/[Ww]orkflow:[[:space:]]*//' || true) -TICKET_REQUEST=$(echo "$PROMPT" | grep -o '[Tt]icket:[[:space:]]*[A-Za-z0-9_/-]*' | sed 's/[Tt]icket:[[:space:]]*//' || true) - -# Extract .memento paths from prompt -MEMENTO_MODE_PATH=$(echo "$PROMPT" | grep -o '\.memento/modes/[A-Za-z0-9_-]*\.md' | sed 's|\.memento/modes/||; s|\.md||' | head -1 || true) -MEMENTO_WORKFLOW_PATH=$(echo "$PROMPT" | grep -o '\.memento/workflows/[A-Za-z0-9_-]*\.md' | sed 's|\.memento/workflows/||; s|\.md||' | head -1 || true) -MEMENTO_TICKET_PATH=$(echo "$PROMPT" | grep -o '\.memento/tickets/[A-Za-z0-9_/-]*' | sed 's|\.memento/tickets/||' | head -1 || true) - -# Use path-based detection if no explicit request -if [ -z "$MODE_REQUEST" ] && [ -n "$MEMENTO_MODE_PATH" ]; then - MODE_REQUEST="$MEMENTO_MODE_PATH" -fi -if [ -z "$WORKFLOW_REQUEST" ] && [ -n "$MEMENTO_WORKFLOW_PATH" ]; then - WORKFLOW_REQUEST="$MEMENTO_WORKFLOW_PATH" -fi -if [ -z "$TICKET_REQUEST" ] && [ -n "$MEMENTO_TICKET_PATH" ]; then - TICKET_REQUEST="$MEMENTO_TICKET_PATH" -fi - -# Read default mode from config if no mode specified -DEFAULT_MODE="" -if [ -z "$MODE_REQUEST" ] && [ -f ".memento/config.json" ]; then - DEFAULT_MODE=$(grep '"defaultMode"' .memento/config.json | sed 's/.*"defaultMode"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/' || true) -fi - -# Function to find fuzzy matches -find_matches() { - local query="$1" - local type="$2" # "mode" or "workflow" - local matches=() - - # Get all available items - if [ "$type" = "mode" ]; then - if [ -d ".memento/modes" ]; then - items=($(ls .memento/modes/*.md 2>/dev/null | xargs -n1 basename | sed 's/.md//' || true)) - else - items=() - fi - else - if [ -d ".memento/workflows" ]; then - items=($(ls .memento/workflows/*.md 2>/dev/null | xargs -n1 basename | sed 's/.md//' || true)) - else - items=() - fi - fi - - # Return early if no items - if [ ${#items[@]} -eq 0 ]; then - echo "" - return - fi - - # Convert query to lowercase - query_lower=$(echo "$query" | tr '[:upper:]' '[:lower:]') - - # Stage 1: Exact match (case-insensitive) - for item in "${items[@]}"; do - item_lower=$(echo "$item" | tr '[:upper:]' '[:lower:]') - if [ "$item_lower" = "$query_lower" ]; then - matches+=("$item") - echo "${matches[@]}" - return - fi - done - - # Stage 2: Prefix match - for item in "${items[@]}"; do - item_lower=$(echo "$item" | tr '[:upper:]' '[:lower:]') - case "$item_lower" in - "$query_lower"*) - matches+=("$item") - ;; - esac - done - - # Stage 3: Substring match - if [ ${#matches[@]} -eq 0 ]; then - for item in "${items[@]}"; do - item_lower=$(echo "$item" | tr '[:upper:]' '[:lower:]') - case "$item_lower" in - *"$query_lower"*) - matches+=("$item") - ;; - esac - done - fi - - # Stage 4: Common abbreviations - if [ ${#matches[@]} -eq 0 ]; then - for item in "${items[@]}"; do - item_lower=$(echo "$item" | tr '[:upper:]' '[:lower:]') - - # Extract abbreviation from hyphenated names - if echo "$item_lower" | grep -q '-'; then - abbrev=$(echo "$item_lower" | sed 's/\([a-z]\)[a-z]*-*/\1/g') - if [ "$abbrev" = "$query_lower" ]; then - matches+=("$item") - fi - fi - - # First 3-4 letters abbreviation - if [ ${#query_lower} -ge 3 ] && [ ${#query_lower} -le 4 ]; then - if echo "$item_lower" | grep -q "^$query_lower"; then - matches+=("$item") - fi - fi - done - fi - - echo "${matches[@]}" -} - -# Process mode request or use default -if [ -n "$MODE_REQUEST" ]; then - # Explicit mode requested - MATCHES=($(find_matches "$MODE_REQUEST" "mode")) - - if [ ${#MATCHES[@]} -eq 0 ]; then - echo "## No Mode Match Found" - echo "Could not find a mode matching: $MODE_REQUEST" - echo "Available modes in .memento/modes/:" - if [ -d ".memento/modes" ]; then - ls .memento/modes/*.md 2>/dev/null | xargs -n1 basename | sed 's/.md//' | sed 's/^/ - /' || echo " (none)" - else - echo " (none - .memento/modes directory not found)" - fi - elif [ ${#MATCHES[@]} -eq 1 ]; then - echo "## Mode: ${MATCHES[0]}" - cat ".memento/modes/${MATCHES[0]}.md" - else - echo "## Multiple Mode Matches Found for: $MODE_REQUEST" - for match in "${MATCHES[@]}"; do - echo "" - echo "### Mode: $match" - cat ".memento/modes/$match.md" - echo "" - echo "---" - done - echo "" - echo "Claude will select the most appropriate mode based on context." - fi - echo "" -elif [ -n "$DEFAULT_MODE" ]; then - # No explicit mode requested, but default mode is configured - if [ -f ".memento/modes/$DEFAULT_MODE.md" ]; then - echo "## Mode: $DEFAULT_MODE (default)" - cat ".memento/modes/$DEFAULT_MODE.md" - echo "" - fi -fi - -# Process workflow request -if [ -n "$WORKFLOW_REQUEST" ]; then - MATCHES=($(find_matches "$WORKFLOW_REQUEST" "workflow")) - - if [ ${#MATCHES[@]} -eq 0 ]; then - echo "## No Workflow Match Found" - echo "Could not find a workflow matching: $WORKFLOW_REQUEST" - echo "Available workflows in .memento/workflows/:" - if [ -d ".memento/workflows" ]; then - ls .memento/workflows/*.md 2>/dev/null | xargs -n1 basename | sed 's/.md//' | sed 's/^/ - /' || echo " (none)" - else - echo " (none - .memento/workflows directory not found)" - fi - elif [ ${#MATCHES[@]} -eq 1 ]; then - echo "## Workflow: ${MATCHES[0]}" - cat ".memento/workflows/${MATCHES[0]}.md" - else - echo "## Multiple Workflow Matches Found for: $WORKFLOW_REQUEST" - for match in "${MATCHES[@]}"; do - echo "" - echo "### Workflow: $match" - cat ".memento/workflows/$match.md" - echo "" - echo "---" - done - echo "" - echo "Claude will select the most appropriate workflow based on context." - fi - echo "" -fi - -# Process ticket request -if [ -n "$TICKET_REQUEST" ]; then - # Function to find ticket in any status directory - find_ticket() { - local ticket="$1" - local statuses=("next" "in-progress" "done") - - for status in "${statuses[@]}"; do - # Check if ticket is already a path with status - if echo "$ticket" | grep -q "^$status/"; then - if [ -f ".memento/tickets/$ticket.md" ] || [ -f ".memento/tickets/$ticket" ]; then - echo "$ticket" - return - fi - else - # Search in each status directory - if [ -f ".memento/tickets/$status/$ticket.md" ]; then - echo "$status/$ticket" - return - elif [ -f ".memento/tickets/$status/$ticket" ]; then - echo "$status/$ticket" - return - fi - fi - done - - echo "" - } - - TICKET_PATH=$(find_ticket "$TICKET_REQUEST") - - if [ -z "$TICKET_PATH" ]; then - echo "## No Ticket Match Found" - echo "Could not find a ticket matching: $TICKET_REQUEST" - echo "Available tickets:" - for status in next in-progress done; do - if [ -d ".memento/tickets/$status" ]; then - echo " $status:" - ls ".memento/tickets/$status" 2>/dev/null | sed 's/^/ - /' || true - fi - done - else - echo "## Ticket: $TICKET_PATH" - echo "" - echo "### Ticket Commands" - printf '%s\n' '```bash' - echo "# Create a new ticket" - echo "npx memento-protocol ticket create \"ticket-name\"" - echo "" - echo "# Move ticket to different status" - echo "npx memento-protocol ticket move $TICKET_REQUEST --to in-progress # or: next, done" - echo "" - echo "# Delete a ticket" - echo "npx memento-protocol ticket delete $TICKET_REQUEST" - echo "" - echo "# List all tickets" - echo "npx memento-protocol ticket list" - printf '%s\n' '```' - echo "" - echo "### Working with Tickets" - echo "" - echo "- Tickets are simple markdown files that serve as persistent workspaces" - echo "- Use your file editing tools to update ticket content directly" - echo "- Tickets survive between sessions - use them to track progress and share context" - echo "- When working on large tasks, create multiple tickets and delegate to sub-agents" - echo "" - - # Output ticket content - if [ -f ".memento/tickets/$TICKET_PATH.md" ]; then - echo "### Ticket Content" - cat ".memento/tickets/$TICKET_PATH.md" - elif [ -f ".memento/tickets/$TICKET_PATH" ]; then - echo "### Ticket Content" - cat ".memento/tickets/$TICKET_PATH" - else - echo "### Error" - echo "Ticket file not found at expected location." - fi - fi - echo "" -fi - -# Ticket Detection Logic -# If no explicit ticket request, check for ticket-related keywords -if [ -z "$TICKET_REQUEST" ]; then - # High-confidence patterns (case-insensitive) - if echo "$PROMPT" | grep -qi '\(create.*ticket\|new.*ticket\|list.*tickets\|work.*with.*tickets\|move.*ticket\|use.*ticket.*create\|ticket.*command\)'; then - echo "## Ticket System - Quick Reference" - echo "" - echo "### Available Commands" - printf '%s\n' '```bash' - echo "# Create a new ticket" - echo "npx memento-protocol ticket create \"ticket-name\"" - echo "" - echo "# List all tickets" - echo "npx memento-protocol ticket list" - echo "" - echo "# Move ticket to different status" - echo "npx memento-protocol ticket move ticket-name --to in-progress # or: next, done" - echo "" - echo "# Delete a ticket" - echo "npx memento-protocol ticket delete ticket-name" - printf '%s\n' '```' - echo "" - echo "### Working with Tickets" - echo "" - echo "- Tickets are simple markdown files that serve as persistent workspaces" - echo "- Use your file editing tools to update ticket content directly" - echo "- Tickets survive between sessions - use them to track progress and share context" - echo "- When working on large tasks, create multiple tickets and delegate to sub-agents" - echo "" - # Low-confidence patterns (case-insensitive) - exclude explicit ticket: requests - elif echo "$PROMPT" | grep -qi 'ticket' && ! echo "$PROMPT" | grep -qi '^[[:space:]]*ticket[[:space:]]*:'; then - echo "## Ticket System Available" - echo "" - echo "Memento Protocol includes a ticket system for task management." - echo "Use \`npx memento-protocol ticket --help\` for more information." - echo "" - fi -fi - -# Don't output the prompt - Claude Code will append it automatically diff --git a/.memento/hooks/scripts/project-overview.sh b/.memento/hooks/scripts/project-overview.sh deleted file mode 100755 index 441cc6c..0000000 --- a/.memento/hooks/scripts/project-overview.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# Project overview hook for Memento Protocol -# Provides a summary of project tickets at session start - -echo '## Project Overview' -echo - -# Tickets Status -echo '### Tickets Status' -echo - -# In Progress Tickets -echo '#### In Progress' -if [ -d ".memento/tickets/in-progress" ]; then - tickets=$(find .memento/tickets/in-progress -name '*.md' 2>/dev/null) - if [ -n "$tickets" ]; then - echo "$tickets" | while read -r ticket; do - echo "- $(basename "$ticket" .md)" - done - else - echo "No tickets in progress" - fi -else - echo "No tickets in progress" -fi -echo - -# Next Tickets -echo '#### Next' -if [ -d ".memento/tickets/next" ]; then - count=$(find .memento/tickets/next -name '*.md' 2>/dev/null | wc -l | tr -d ' ') - echo "$count tickets" -else - echo "0 tickets" -fi -echo - -# Done Tickets -echo '#### Done' -if [ -d ".memento/tickets/done" ]; then - count=$(find .memento/tickets/done -name '*.md' 2>/dev/null | wc -l | tr -d ' ') - echo "$count tickets" -else - echo "0 tickets" -fi - -# Exit successfully -exit 0 \ No newline at end of file diff --git a/.memento/manifest.json b/.memento/manifest.json deleted file mode 100644 index c1c5500..0000000 --- a/.memento/manifest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0", - "created": "2025-08-02T17:50:08.779Z", - "components": { - "modes": [ - "ai-debt-maintainer", - "architect", - "autonomous-project-manager", - "engineer", - "reviewer" - ], - "workflows": [ - "openmemory-setup", - "review", - "summarize" - ], - "integrations": [], - "agents": [], - "updated": "2025-08-02T17:50:19.809Z" - } -} \ No newline at end of file diff --git a/.memento/modes/ai-debt-maintainer.md b/.memento/modes/ai-debt-maintainer.md deleted file mode 100644 index 3d6f12d..0000000 --- a/.memento/modes/ai-debt-maintainer.md +++ /dev/null @@ -1,29 +0,0 @@ -# AI Debt Maintainer - -This codebase has knowledge and tech debt left over from previous changes made by humans and AIs. Your job is to review the codebase for "code smells" and other heuristics and identify opportunities to clean up. - -## Behavioral Guidelines - -- Look for documentation that may be out of date, or excessive documentation that is not part of the code. Excessive documentation is often a sign of LLMs context dumping -- Do not assume that backwards compatability is necessary. Unless it's obvious that the codebase needs to maintain backwards compatability (like via versioned APIs), you should mark it for removal -- If you see the same logic repeated in multiple places, you should mark it for refactor -- If you see functions that can be refactored for readability or testability, you should mark it for refactor -- If you see obvious security holes or exploitable code, you should mark it for refactor -- If you see test cases that are not actually testing something meaningful (for example excessive mocking or always returning true), you should mark it for removal or refactor -- If you see code that is not actually doing anything (for example a function that is never called), you should mark it for removal -- This is not an exhaustive list, rather it's meant to evoke inspiration, be pragmatic and look for other code smells or bad practices as you go - -## Example Process - -This is an example process provided for best practice. Of course you should be flexible and practice good judgement and pragmatism based on the actual task at hand - -### Phase 1: Review -- Look at the codebase language(s) and framework(s) and think of other things to look out for during our thorough review -- Assess the current state of the codebase. Spawn a cheap sub-agent to lint, build, test, etc... to identify the current state of the codebase as a starting point. -- Write a ticket that outlines the current state of the codebase, what to look for, and make sure to include the broad behavioral guidelines as well. This ticket will be used by sub-agents in the next step -- Pause and ask the user to review. The user likely has tribal knowledge about the codebase so make sure to call out the decisions you are least sure about or that are the most impactful -- Update the ticket based on user feedback, repeat if necessary - -### Phase 2: Execute -- Spawn cheap sub-agents to do any deletions that were identified, make sure that the codebase still passes lint and testing (or whatever checks are available) -- Spawn engineer mode sub-agents to do any refactors that were identified, make sure that the codebase still passes lint and testing (or whatever checks are available) diff --git a/.memento/modes/architect.md b/.memento/modes/architect.md deleted file mode 100644 index 338fe4b..0000000 --- a/.memento/modes/architect.md +++ /dev/null @@ -1,30 +0,0 @@ -# Architect Mode - -You are now operating in Architect mode. Your focus is on system design and technical excellence. - -## Behavioral Guidelines - -- Consider the state of the codebase before you over-engineer. Is it a prototype? MVP? mature product? Only give stage-relevant suggestions -- Evaluate multiple architectural approaches, considering trade-offs between performance, scalability, simplicity, and long-term maintainability -- Define clear system boundaries, module interfaces, and API contracts for engineer agents to implement -- Design for testability, extensibility, security, and failure modes from the start - -## Example Process - -This is an example process provided for best practice. Of course you should be flexible and practice good judgement and pragmatism based on the actual task at hand - -### Phase 1: Research and Analysis -- Deconstruct the requirements into technical requirements -- Spawn cheap reviewer mode sub-agents to examine the current code base if it exists -- Spawn cheap sub-agents to research and compare technologies, patterns, and existing solutions -- Write down your findings in a ticket and ask the user for feedback on key design decisions, the user likely has tribal knowledge - -### Phase 2: Design -- Create a high-level system design document with the proposed architecture, noting tradeoffs -- Write or update clear API contracts, data models, or other key integration documents if relevant (adapt to the current use-case and codebase) - -### Phase 3: Review and iterate -- Note the current branch, git branch onto a new temporary branch, commit the design documents -- Surface any surprises during planning and ask the user to read the documents and provide feedback or directly edit the documents -- Git diff the design documents to see what the user has changed -- Iterate until user is satisfied, using the design documents as the source of truth diff --git a/.memento/modes/autonomous-project-manager.md b/.memento/modes/autonomous-project-manager.md deleted file mode 100644 index 2b300c9..0000000 --- a/.memento/modes/autonomous-project-manager.md +++ /dev/null @@ -1,27 +0,0 @@ -# Autonomous Project Manager Mode - -You are operating in Autonomous Project Manager mode. You are to be agentic and drive the task to completion without human intervention. - -## Behavioral Guidelines - -- Save your own context, delegate work to sub-agents whenever possible, use your best judgement about how powerful of a model the sub-agent needs, biasing towards cost savings -- As a professional project manager, you ensure that all sub-agents are acting in alignment, and when one delivers work that is not aligned, you give it feedback for it to iterate on -- As a pragmatic project manager, you know when it's necessary to simplify requirements while adhering to the original goal. Make sure to avoid over-engineering beyond the original scope, and keep sub-agents in line as they have a tendence to scope creep -- Keep the ticket(s) up to date, and ask your sub-agents to provide you with updates for you to write in the ticket. For large tasks, you can split up the work into multiple tickets and have sub-agents update their own tickets, with you aggregating into the epic-ticket - -## Example Process - -This is an example process provided for best practice. Of course you should be flexible and practice good judgement and pragmatism based on the actual task at hand - -### Phase 1: Planning -- Identify the core requirements and their spirit. Figure out what questions need to be answered -- Do requirements gathering in parallel - - Execute the review workflow as needed to summarize relevant parts of the codebase to gather context - - Spawn cheap agents to search online for relevant best practices, docs, or examples if needed -- Update the ticket with a comprehensive implementation plan. Split into multiple smaller tickets if needed - -### Phase 2: Implementation -- Spawn engineer mode sub-agents, optionally in parallel if it's a big task - -### Phase 3: Testing & Review -- Spawn reviewer mode sub-agents, optionally in parallel if there's many parts diff --git a/.memento/modes/engineer.md b/.memento/modes/engineer.md deleted file mode 100644 index 907e7a1..0000000 --- a/.memento/modes/engineer.md +++ /dev/null @@ -1,27 +0,0 @@ -# Engineer Mode - -You are now operating in Engineer mode. Your focus is on crafting high-quality code and solving technical challenges. - -## Behavioral Guidelines - -- Be pragmatic, focus on clear, easy to understand, difficult to mess up code over elegant and over-engineered code -- Examine and follow project conventions, style, and best practices -- Implement robust, LLM-debuggable error handling -- Write functions that are easily testable, apply functional programming principles where appropriate, but be pragmatic -- If the requirements are clear, take a TDD approach, if the requirements are not clear, write tests after implementation so you understand the requirements better -- Don't write brittle tests. Avoid asserting specific things that are likely to change, and favor unit over integration tests where useful - -## Example Process - -### Phase 1: Understand -- Review the requirements, architecture, and ticket details -- Examine the relevant pieces of code that need to be modified -- Look at related, similar, or dependent code to understand the context and style - -### Phase 2: Implement -- Either follow TDD or implement then test, depending on clarity of requirements -- Look for opportunities to improve the code, make it simpler, easier to test, easier to maintain. Do NOT over-generalize the code if not necessary - -### Phase 3: Verify -- Lint, build, or whatever static analysis is available -- Run all tests and ensure they pass diff --git a/.memento/modes/reviewer.md b/.memento/modes/reviewer.md deleted file mode 100644 index 149f6e2..0000000 --- a/.memento/modes/reviewer.md +++ /dev/null @@ -1,24 +0,0 @@ -# Reviewer Mode - -You are now operating in Reviewer mode. Your focus is on quality assurance and constructive feedback. - -## Behavioral Guidelines -- Prioritize critical issues (bugs, security vulnerabilities) over stylistic preferences -- Point out deviations between what the code looks like it should do vs what it actually does (or mis-aligned comments, docs) -- Ensure code follows established patterns, conventions, and has adequate test coverage -- Suggest remediations and explain rationale behind your suggestions -- Be pragmatic and codebase specific. For example don't suggest adding Kubernetes for a simple local prototype - -## Example Process - -### Phase 1: Context Gathering -- Understand the requirements of the ticket or feature being reviewed -- Check the associated design documents or code files - -### Phase 2: Review -- Perform multiple review passes: first for high-level structure and logic, then for details like variable names and comments -- Review the relevant tests for the code, see if the coverage looks adequant, and use it to help bolster your understanding of the code -- Spawn some cheap sub-agents to take on different perspectives, red-team the code, etc... - -### Phase 3: Feedback -- Consolidate feedback into a structured summary diff --git a/.memento/scripts/list-modes.sh b/.memento/scripts/list-modes.sh deleted file mode 100755 index 8329bdf..0000000 --- a/.memento/scripts/list-modes.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -for mode in .memento/modes/*.md; do - if [ -f "$mode" ]; then - echo "## $(basename "$mode" .md)" - head -3 "$mode" | tail -1 - echo - fi -done 2>/dev/null || echo "No modes installed." diff --git a/.memento/scripts/mode-switch.sh b/.memento/scripts/mode-switch.sh deleted file mode 100755 index da8d8d0..0000000 --- a/.memento/scripts/mode-switch.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -if [ -z "$1" ]; then - sh .memento/scripts/list-modes.sh -else - MODE_FILE=$(find .memento/modes -name "*$1*.md" | head -1) - if [ -n "$MODE_FILE" ]; then - echo "# Switching to Mode: $(basename "$MODE_FILE" .md)" - cat "$MODE_FILE" - else - echo "Mode '$1' not found. Available modes:" - sh .memento/scripts/list-modes.sh - fi -fi \ No newline at end of file diff --git a/.memento/scripts/ticket-context.sh b/.memento/scripts/ticket-context.sh deleted file mode 100755 index 4974874..0000000 --- a/.memento/scripts/ticket-context.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -if [ -z "$1" ]; then - npx memento-protocol ticket list 2>/dev/null || echo "No tickets found" -else - find .memento/tickets -name "*$1*" -type f | head -1 | xargs cat 2>/dev/null || { - echo "Ticket '$1' not found. Available tickets:" - npx memento-protocol ticket list 2>/dev/null - } -fi \ No newline at end of file diff --git a/.memento/tickets/done/replace-sonic-with-ronin.md b/.memento/tickets/done/replace-sonic-with-ronin.md deleted file mode 100644 index 7d0da9b..0000000 --- a/.memento/tickets/done/replace-sonic-with-ronin.md +++ /dev/null @@ -1,29 +0,0 @@ -# replace-sonic-with-ronin - -## Description -We forked this repo from Sonic. Now we must set it up for Ronin - -Ronin network info: -``` - ronin: { // Mainnet - chainId: 2020, - url: "https://api.roninchain.com/rpc", - }, - saigon: { // Testnet - chainId: 2021, - url: "https://saigon-testnet.roninchain.com/rpc", - }, -``` - -## Tasks -- [ ] Find all instances of Sonic, `sonic_testnet` and `sonic_mainnet` to replace with Ronin values -- [ ] `make lint` -- [ ] `make test` <- get all tests passing -- [ ] Do a final search for references to Sonic -- [ ] Open a PR - -## Notes - - ---- -Created: 2025-08-04T09:07:32.082Z diff --git a/.memento/tickets/in-progress/use-explicit-ronin-network-names.md b/.memento/tickets/in-progress/use-explicit-ronin-network-names.md deleted file mode 100644 index c6546c0..0000000 --- a/.memento/tickets/in-progress/use-explicit-ronin-network-names.md +++ /dev/null @@ -1,14 +0,0 @@ -# use-explicit-ronin-network-names - -## Description -[Add ticket description here] - -## Tasks -- [ ] Task 1 -- [ ] Task 2 - -## Notes -[Add any relevant notes here] - ---- -Created: 2025-08-04T09:26:46.619Z diff --git a/.memento/workflows/openmemory-setup.md b/.memento/workflows/openmemory-setup.md deleted file mode 100644 index dead2de..0000000 --- a/.memento/workflows/openmemory-setup.md +++ /dev/null @@ -1,40 +0,0 @@ -# OpenMemory MCP Setup Workflow - -This workflow guides an LLM agent in setting up OpenMemory MCP for the user's local environment to enable persistent memory across sessions. - -## 1. Prerequisites: Obtain OpenMemory API Key - -Before starting, ensure the user has an OpenMemory API key. You will need to ask the user for it. - -1. The user can get a key by signing up at app.openmemory.dev. -2. The key should be in the format `om-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. - -## 2. Configure OpenMemory (Global Setup) - -To add MCP servers to your Claude Code configuration: - -1. Create/edit the config file: ~/.claude/mcp.json - -``` -{ - "mcpServers": { - "openmemory": { - "command": "npx", - "args": ["-y", "openmemory"], - "env": { - "OPENMEMORY_API_KEY": "your-api-key", - "CLIENT_NAME": "claude" - } - } -} -} -``` - -## 2. Verify Global Configuration - -Run these commands to verify that the MCP server was added successfully at the user level. - -```bash -claude mcp list -claude mcp get openmemory -``` diff --git a/.memento/workflows/review.md b/.memento/workflows/review.md deleted file mode 100644 index 509de5e..0000000 --- a/.memento/workflows/review.md +++ /dev/null @@ -1,174 +0,0 @@ -# Review Workflow - -A structured approach to code review that ensures quality, security, and maintainability through systematic evaluation. - -## Prerequisites -- Access to code changes or pull request -- Understanding of project standards and conventions -- Reviewer mode installed (recommended) - -## Inputs -- **target**: What to review (PR URL, commit range, or file paths) -- **type**: Review type (general, security, performance, architecture) -- **depth**: Review thoroughness (quick, standard, deep) - -## Outputs -- Structured feedback document in `.memento/tickets/[current]/reviews/` -- Prioritized list of issues and suggestions -- Actionable improvement recommendations - -## Example Commands - -### Natural Language Invocations -- "execute review on the authentication module" -- "run a security-focused review of the API" -- "perform a deep code review on PR #456" -- "review the latest commit for performance issues" - -### Common Use Cases -- `execute review --target PR#123 --type general` → Standard PR review -- `execute review --target src/api --type security --depth deep` → Security audit -- `execute review --target HEAD~5..HEAD --type performance` → Performance review of recent commits -- `execute review --target src/components --depth quick` → Quick component review - -### Workflow Integration Examples -- "execute review then summarize the findings" → Review + Summary -- "review this code and create tickets for critical issues" → Review + Task creation -- "run the review workflow before deployment" → Pre-deployment check - -## Workflow Steps - -### 1. Preparation Phase - -1. **Context Gathering** - - Understand the purpose of changes - - Review related tickets/issues - - Check design documents - -2. **Scope Definition** - - Identify files to review - - Note areas of particular concern - - Set review priorities - -### 2. Multi-Pass Review - -#### Pass 1: Architecture & Design (10 minutes) -- Overall structure appropriate? -- Design patterns correctly applied? -- Proper separation of concerns? -- API contracts well-defined? - -#### Pass 2: Implementation Details (20 minutes) -- Logic correctness -- Error handling -- Edge case coverage -- Performance considerations - -#### Pass 3: Code Quality (15 minutes) -- Readability and clarity -- Naming conventions -- Documentation completeness -- Test coverage - -#### Pass 4: Security & Safety (10 minutes) -- Input validation -- Authentication/authorization -- Data sanitization -- Resource management - -### 3. Feedback Compilation - -Structure feedback by priority: - -#### Critical (Must Fix) -- Security vulnerabilities -- Data loss risks -- Logic errors -- Missing error handling - -#### Important (Should Fix) -- Performance issues -- Poor test coverage -- Unclear code -- Design problems - -#### Minor (Consider Fixing) -- Style inconsistencies -- Documentation gaps -- Refactoring opportunities -- Nice-to-have improvements - -### 4. Feedback Delivery - -Use this template: - -```markdown -## Code Review: [Component/PR Name] - -### Summary -[Overall assessment - 2-3 sentences] - -### Critical Issues -1. **[File:Line]**: [Issue description] - ``` - [Code snippet if helpful] - ``` - **Suggestion**: [Specific fix] - -### Important Issues -[Similar format] - -### Minor Suggestions -[Similar format] - -### Positive Observations -- [Good practice noted] -- [Well-implemented feature] - -### Overall Recommendations -[Next steps and priorities] -``` - -## Review Checklist - -### Always Check -- [ ] Functionality correct -- [ ] Tests adequate -- [ ] Error handling present -- [ ] Security considered -- [ ] Performance acceptable - -### Language-Specific Checks -- [ ] Memory management (C/C++/Rust) -- [ ] Null safety (Java/Kotlin/Swift) -- [ ] Type safety (TypeScript) -- [ ] Concurrency safety (Go/Rust) - -## Integration Points - -- Use with pull requests -- Part of deployment pipeline -- Regular codebase audits -- Pair programming sessions - -## Best Practices - -1. **Time-box Reviews**: Maximum 60 minutes per session -2. **Focus on Impact**: Prioritize high-risk areas -3. **Provide Examples**: Show, don't just tell -4. **Be Respectful**: Professional and constructive -5. **Follow Up**: Ensure feedback is addressed - -## Automation Support - -Consider automating checks for: -- Code formatting -- Basic linting -- Test coverage -- Security scanning - -Focus human review on: -- Business logic -- Design decisions -- Complex algorithms -- Integration points \ No newline at end of file diff --git a/.memento/workflows/summarize.md b/.memento/workflows/summarize.md deleted file mode 100644 index 1f6cb8d..0000000 --- a/.memento/workflows/summarize.md +++ /dev/null @@ -1,185 +0,0 @@ -# Summarize Workflow - -A systematic approach to compressing context and extracting essential information from codebases, directories, or complex topics. - -## Prerequisites -- Clear definition of what needs summarizing -- Access to relevant files/directories -- Understanding of the target audience for the summary - -## Inputs -- **scope**: What to summarize (path, topic, or file list) -- **depth**: Level of detail needed (high-level, detailed, exhaustive) -- **focus**: Specific aspects to emphasize (architecture, implementation, etc.) - -## Example Commands - -### Natural Language Invocations -- "execute summarize on the entire codebase" -- "summarize the authentication module for me" -- "create a high-level overview of our React components" -- "compress the context of this directory" - -### Common Use Cases -- `execute summarize --scope src/ --depth high-level` → Quick codebase overview -- `execute summarize --scope src/auth --depth detailed --focus security` → Detailed security summary -- `execute summarize --scope . --focus architecture` → Architecture documentation -- `execute summarize --scope src/components --depth exhaustive` → Complete component analysis - -### Workflow Integration Examples -- "summarize the codebase before the architecture review" → Pre-review documentation -- "execute summarize then act as architect" → Context compression before design -- "summarize recent changes from git history" → Change summary - -## Workflow Steps - -### 1. Scope Definition -Determine what needs to be summarized: -- Entire codebase -- Specific directory -- Set of related files -- Conceptual topic - -### 2. Analysis Phase - -#### For Code/Directory Summaries: -1. **Structure Analysis** - - Map directory structure - - Identify key modules/components - - Note dependencies between parts - -2. **Purpose Identification** - - What does each component do? - - How do components interact? - - What are the main entry points? - -3. **Pattern Recognition** - - Common design patterns used - - Coding conventions - - Architectural decisions - -#### For Conceptual Summaries: -1. **Core Concepts** - - Key ideas and principles - - Important terminology - - Relationships between concepts - -2. **Context Mapping** - - Prerequisites - - Related topics - - Practical applications - -### 3. Synthesis Phase - -Create a hierarchical summary: -1. **High-Level Overview** (1-2 paragraphs) - - Primary purpose - - Key components - - Main interactions - -2. **Component Breakdown** - - Brief description of each major part - - Key responsibilities - - Important details - -3. **Essential Details** - - Critical configuration - - Important constraints - - Notable decisions - -### 4. Output Format - -Structure the summary for maximum utility: - -```markdown -# Summary: [Topic/Directory Name] - -## Overview -[High-level description] - -## Key Components -- **Component A**: [Brief description] -- **Component B**: [Brief description] - -## Important Details -- [Critical detail 1] -- [Critical detail 2] - -## Next Steps / Entry Points -- [Where to start exploring] -- [Key files to examine] -``` - -## Output Format - -The workflow produces a structured summary saved to `.memento/tickets/[current]/summaries/[timestamp].md`: - -```markdown -# Summary: [Topic/Scope] -Generated: [timestamp] -Scope: [what was analyzed] -Depth: [level of detail] - -## Executive Summary -[1-2 paragraph overview for quick understanding] - -## Architecture Overview -[System structure and key design decisions] - -## Key Components -### Component Name -- Purpose: [what it does] -- Location: [where to find it] -- Dependencies: [what it needs] -- Interface: [how to use it] - -## Data Flow -[How information moves through the system] - -## Entry Points -[Where to start when working with this code] - -## Critical Paths -[Most important flows through the system] - -## Technical Debt / Notes -[Important limitations or future work] -``` - -## Language-Specific Patterns - -### TypeScript/JavaScript Projects -- Focus on module structure and exports -- Note TypeScript interfaces and types -- Highlight React component hierarchies -- Document state management patterns - -### Go Projects -- Emphasize package organization -- Note interface definitions -- Document goroutine usage -- Highlight error handling patterns - -## Best Practices - -1. **Be Ruthlessly Concise**: Aim for 10-20% of original context -2. **Preserve Critical Information**: Architecture > Implementation details -3. **Use Visual Aids**: Include simple ASCII diagrams where helpful -4. **Make it Scannable**: Use consistent formatting and headers -5. **Version Summaries**: Include timestamps and scope - -## Integration Points - -- Store in `.memento/tickets/[task]/summaries/` -- Link from main ticket documentation -- Reference when switching modes -- Use as input for reviews - -## When to Use - -- Before switching between modes -- When context window approaches limits -- For daily progress documentation -- When onboarding team members -- Before architectural discussions -