MemStack Documentation

repository·master·Indexed 19 days ago

https://github.com/cwinvestments/memstack

A structured skill framework for Claude Code featuring 130 professional skills for deployment, security, and development. MemStack utilizes an MCP (Model Context Protocol) skill loader to activate specialized capabilities on demand, preventing context bloat. It includes a tiered system of 86 free skills and 44 Pro-exclusive skills, a local management dashboard, and advanced context features like TokenStack™ integration and session-start context injection.

Tokens
209.9K
Snippets
321
Records
670
Agent score
64%

What's inside MemStack

  1. Overview of the Email Sequence skill

    master

    The memstack-content-email-sequence skill is designed for writing automated email campaigns. It provides a structured protocol for planning, designing, and writing multi-email sequences to achieve specific marketing goals.

    At its base level (Lv.1), the skill covers:

    • Campaign Planning: Defining goals, cadence, and the narrative arc.
    • 5-Email Structure: A standard sequence consisting of Welcome, Story, Value, Soft Pitch, and Hard Pitch.
    • Copywriting Elements: Subject lines (optimized for ~50 chars), preview text, and P.S. lines.
    • Optimization: A/B test suggestions and platform setup notes.
    • Output: A complete, ready-to-use sequence.
  2. Capabilities of the Site Audit skill (Lv.1)

    master

    The Level 1 (Base) Site Audit skill provides the following SEO analysis capabilities:

    • Meta tag scanning: Verifies presence and correctness of meta tags.
    • Heading hierarchy: Analyzes the structure of H1-H6 tags.
    • Broken link detection: Identifies dead links.
    • Image optimization: Checks for optimized image assets.
    • Core Web Vitals code patterns: Scans for code patterns affecting performance metrics.
    • Robots.txt/Sitemap.xml: Validates SEO configuration files.
    • Page performance: Evaluates loading speeds and efficiency.
    • Structured data presence: Checks for Schema.org or other structured data.
    • Scored output: Provides a page-by-page score with a prioritized list of recommended fixes.
  3. Use the CSP Headers skill to audit and generate security headers

    master

    The memstack-security-csp-headers skill is used to audit existing HTTP security headers, identify overly permissive directives (like unsafe-inline or unsafe-eval), and generate a production-ready Content-Security-Policy (CSP) along with companion security headers.

    When to use this skill:

    • When you need to audit, generate, or fix HTTP security headers for a web application.
    • When you need to address unsafe-inline, unsafe-eval, or wildcard directives.
    • When you need to configure HSTS, X-Frame-Options, or Permissions-Policy.

    When NOT to use this skill:

    • Do not use this for API route audits (use api-audit).
    • Do not use this for dependency scanning.
    • Do not use this for full OWASP security audits (use owasp-top10).
    • Do not use this for scanning secrets in code (use secrets-scanner).
  4. Master the API Designer skill

    master

    The API Designer skill focuses on designing robust routes, validation logic, and handler patterns. It covers the full lifecycle of API development, from initial route structure to generating TypeScript interfaces.

    Key components include:

    • Route Structure: Designing logical endpoint hierarchies.
    • Auth Guard Pattern: Implementing security chains using getAuthContext and verifyOrgAccess.
    • Input Validation: Using Zod for schema-based validation.
    • Response Consistency: Ensuring a uniform response format and correct HTTP status codes.
    • Advanced Patterns: Implementing rate limiting, webhook signature verification, and webhook endpoint design.
    • Type Safety: Generating TypeScript interfaces from API definitions.
  5. Key MemStack Features

    master

    MemStack provides several automated features for context management and developer experience:

    • On-demand loading: Skills are loaded from the catalog only when matched, preventing context bloat.
    • TTS notifications: Voice alerts for task completion, required attention, or errors.
    • Pre-prompt alerts: Plays a notification (e.g., "Claude needs your attention") before approval prompts to alert you to return to the terminal.
    • Diary webhook: Automatically POSTs session logs to an n8n webhook for devlog automation.
    • PostToolUse observation capture: Automatically logs every file write and bash command to .claude/observations/ with timestamps and parsed summaries.
    • SessionStart context injection: Injects the last 3 diary and observation summaries into .claude/session-context.md at the start of a session for instant recall.
    • TokenStack™ integration: Uses a context compression proxy to optimize token savings.
  6. What is Git-Guard and when to use it

    master

    Git-Guard is an installer and verifier for machine-wide secret-blocking setups. It is NOT a secret scanner itself; it ensures that the necessary protection layers (git hooks, .gitignore, and gitleaks configuration) are present, correctly wired, and actually 'armed' to catch secrets during a commit.

    When to use Git-Guard:

    • When asking "is this repo protected?"
    • When running "set up / install git-guard"
    • When verifying gitleaks or git hooks
    • On a new repository before the first commit

    When NOT to use Git-Guard:

    • For deep secret or history audits (use secrets-scanner instead).
    • When mid-commit and simply trying to bypass a block (do not loosen protection to unblock).
  7. Manage Environment Variables and Security

    master

    Understand the difference between build-time and runtime environment variables to avoid leaking secrets.

    Build-time Variables (Client-exposed)

    These are baked into your JavaScript bundle during the build process and are visible to anyone via browser DevTools. Use specific prefixes required by your framework:

    • VITE_ (Vite)
    • NEXT_PUBLIC_ (Next.js)
    • REACT_APP_ (CRA)

    Runtime Variables (Server-side/Functions)

    Variables without these prefixes are only available during the build process or within Netlify Functions. These are not exposed to the client.

    Best Practices

    • Never use client-exposed prefixes (VITE_, etc.) for sensitive data like API keys with write access, database URLs, or auth secrets.
    • Set sensitive secrets in the Netlify UI (Site Settings → Environment Variables).
    • Set non-sensitive build config (like NODE_VERSION) in netlify.toml under [build.environment].
  8. Choose between Quick and Deep scan modes for OWASP audits

    master

    The OWASP Top 10 skill supports two distinct scan modes depending on the required scope and speed:

    Deep scan (Default)

    • Scope: All 10 OWASP categories.
    • Use Case: Pre-launch reviews, formal security audits, or compliance checks.

    Quick scan

    • Scope: Limited to A01 (Broken Access Control/Auth), A05 (Security Misconfiguration/Headers), and A06 (Vulnerable and Outdated Components).
    • Use Case: Fast pre-deploy checks, CI pipeline gates, or initial triage.
    • Trigger: Triggered by phrases like "quick OWASP", "quick security check", or "fast scan".
    • Behavior: The scorecard will display the 3 targeted categories and mark the remaining 7 as ⏭️ SKIPPED (quick mode).
  9. Avoid Keyword Research anti-patterns

    master

    To ensure effective SEO, avoid these common mistakes:

    • Targeting only high volume keywords: High volume often means high competition. Focus on long-tail keywords with lower volume but higher intent for faster ranking.
    • One keyword per page: Each page should have one primary keyword and 3-5 semantically related keywords to build topic clusters.
    • Treating research as a one-time task: Revisit keyword research at least quarterly to account for shifting trends and new competitors.
    • Focusing on brand terms: You will rank for your brand naturally. Focus research on non-brand terms to attract new visitors.
    • Relying solely on volume: A keyword with lower volume but high purchase intent is often more valuable than a high-volume informational keyword.
  10. Understand the MemStack delivery architecture

    master

    MemStack delivers functionality through three independent artifacts shipped via three different channels. Understanding this separation is critical because updating one does not automatically update the others.

    1. The Plugin (Free Skills & Hooks)

    • Contents: 86 free skills, hooks (e.g., SessionStart), and the plugin manifest.
    • Source: The memstack repository.
    • Delivery: Via the Marketplace.
    • Update Mechanism: Controlled by the version field in plugin.json.
    • Note: Updating the plugin via /plugin update makes changes available, but does not force an automatic fetch for existing customers.

    2. The Pro Bundle (Pro Skills)

    • Contents: 44 Pro-exclusive skills.
    • Source: adminstack/src/data/pro-skills/.
    • Delivery: Via a Pro bundle probe (authenticated endpoint).
    • Update Mechanism: Based on the sha256 hash of the Pro SKILL.md bytes.
    • Customer Impact: Reaches passive customers within 24 hours.

    3. The Loader (MCP Server)

    • Contents: The memstack-skill-loader package providing the memstack-skills MCP server.
    • Source: PyPI.
    • Delivery: Via pip.
    • Note: The loader and the plugin share no version coupling. The loader does not receive information about the plugin version installed in the Claude Code cache.
  11. Refactor Planner (Lv.1) capabilities

    master

    The Level 1 Refactor Planner provides a systematic framework for planning code improvements. It includes:

    • Code Smell Categories: 4 categories (bloaters, couplers, dispensables, change preventers) covering 16 specific smells.
    • Risk Assessment: A 5-factor risk matrix.
    • Refactoring Patterns: 12 patterns organized into 3 groups (extraction, simplification, structural).
    • Execution Framework: A phased execution plan template, a rollback strategy with defined abort criteria, and a system for tracking before/after metrics.
  12. Convert features to benefits using the conversion formula

    master

    To create persuasive copy, avoid listing technical specifications (features) in isolation. Instead, transform every feature into a customer benefit that triggers an emotional outcome.

    Conversion Formula: [Feature] → so you can → [Benefit] → which means → [Emotional outcome]

    Examples:

    Feature→ Benefit→ Emotional
    "Made from organic cotton""Gentle on sensitive skin""Safe for your baby"
    "5000mAh battery""Lasts 2 full days on one charge""Never stress about dying battery"
    "Adjustable height: 28-36 inches""Fits any desk setup, standing or sitting""Work comfortably, your way"