memflow-command-system
BrunoLagoa/memflow-command-system
Open-source SDLC command system with AI: predictable workflows, strict quality gates, and persistent decision memory.
Instalação
npx convez-ai BrunoLagoa/memflow-command-system1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
README
A tradução para o português deste README ainda está na fila.
English | Português (Brasil)
In one sentence
Memflow turns the "open a chat and hope for the best" habit into an engineering flow that decides with criteria, executes with discipline, validates with rigor, and remembers decisions across sessions.
Why Memflow?
Most AI workflows look like this: open chat, paste context, ask for code, hope for the best, repeat. Every session restarts from zero. Decisions evaporate. The same mistakes get re-litigated next week.
Memflow swaps improvisation for an auditable, repeatable process:
| Without Memflow | With Memflow |
|---|---|
| Every session restarts from zero | Memory reused across sessions |
| Decisions get lost in chat history | Decisions become structured memory with category, impact, and score |
| Always the most expensive (or cheapest) model | The right model for the task — cheap by default, escalate when needed |
| "Looks approved" by feeling | Explicit final gate: OK or BLOCKED |
| AI decides and executes in one shot | Each step waits for explicit confirmation before moving on |
Under the hood, Memflow works like an engineering team in stages:
- Workflow — classifies the task, routes exploration when needed (
/brainstorm), and picks the right strategy and model. - Execution — implements with controlled fallbacks and explicit checkpoints.
- Validation — strict final gate (
OKorBLOCKED), no approval by feeling. - Memory — captures relevant decisions with category, impact, and a
0–100score, and reuses them across sessions.
The result is something you can audit, repeat, and trust.
Quick start
One interactive command. It detects your environment, asks 3 questions, and installs.
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/BrunoLagoa/memflow-command-system/main/scripts/install.sh | bash -s -- install
Windows (PowerShell)
powershell -ExecutionPolicy Bypass -Command "iwr https://raw.githubusercontent.com/BrunoLagoa/memflow-command-system/main/scripts/install.ps1 -OutFile $env:TEMP\install.ps1; & $env:TEMP\install.ps1 install"
The wizard guides you through 3 choices:
- Operating system
- Platform —
OpenCode,VSCode,Cursor, orClaude Code - Scope —
globalorlocal(when applicable)
Then jump straight to your first commands:
/context
/workflow
New to Memflow? Read the first 10 minutes guide for a step-by-step walkthrough with real examples.
Need scripted installs, update, check or uninstall? See the advanced installation guide.
How it works — the flow
┌──────────┐ ┌──────────────┐ ┌────────────────┐ ┌──────────┐
│ /context │──▶│ /workflow │──▶│ /execute │──▶│ /review │
│ load │ │ decide │ │ (or /plan) │ │ validate │
│ memory │ │ model │ │ implement │ │ │
└──────────┘ └──────┬───────┘ └────────────────┘ └────┬─────┘
│ │
┌──────▼───────┐ ┌─────────▼──────┐
│ /brainstorm │ │ /memory-save │
│ (optional) │ │ (optional) │
└──────────────┘ └────────────────┘
/context→/workflow→/execute→/reviewis the main path.- When
/workflowdetects insufficient clarity or unresolved trade-offs, it routes to/brainstormfirst. Handoff after approval goes to/prd,/spec, or/plan. - For high-risk work, finish with
/review-code(deep technical review) and/review-enforce-rules(strict final gate).
What's included
Orchestration commands
The control layer that decides, executes, and validates — the main path.
| Command | What it does |
|---|---|
/context | Load project context, memory, operating mode, and available skills |
/workflow | Classify the task; decide exploration (/brainstorm), execution strategy, level, primary model, and fallbacks |
/execute | Apply the decision with controlled fallback |
/review | Validate technical and architectural adherence |
/review-code | Deep technical validation before production readiness |
/review-enforce-rules | Strict final gate with binary output: OK or BLOCKED |
Capability commands
Specialized resolution for everyday tasks, called by the workflow as needed.
| Category | Commands |
|---|---|
| Discovery & definition | /brainstorm, /prd, /spec, /plan |
| Implementation & quality | /debug, /refactor, /test-plan |
| Memory | /memory-init, /memory-save |
Key differentiators
- Structured exploration —
/brainstormcompares 2–5 approaches in a phased dialogue, with HARD-GATE, self-review, optional artifact save, and handoff to/prd,/spec, or/plan. - Decision reuse by score — high-scoring decisions are auto-reused across sessions.
- Cost/quality model policy — primary model + same-level fallbacks; escalate only when justified.
- Functional degraded mode — keeps working even when
.agentsis missing. - Smart memory persistence — decision versioning with
(update)semantics. - Anti-compaction invariants — pt-BR + Memflow identity re-hydrated via
/contextand/workflow. - MCP integration — code, contextual memory, and external docs.
- Live plans — when
/planis saved, tasks are sized by complexity with status markers ([ ],[-],[x],[!]) and execution modes ([P]parallel,[S]sequential).
Quick glossary
Terms that show up across the project, one line each:
| Term | What it means |
|---|---|
.agents | Project context folder that /context loads (memory, modes, skills). |
Score 0–100 | Relevance rating of a decision; the higher it is, the more it gets reused across sessions. |
| Fallback | Same-level backup model, used when the primary fails — without escalating cost unnecessarily. |
| HARD-GATE | Mandatory stop point that requires explicit confirmation before moving on. |
| Degraded mode | Reduced but functional operation when .agents or context is missing. |
| Anti-compaction re-hydration | Restoration of invariants (pt-BR language and Memflow identity) when history gets compacted. |
| MCP | Model Context Protocol — integration with code, contextual memory, and external docs. |
| Live plans | /plan plans whose tasks are marked by status and execution mode, updated as work progresses. |
A real example
Implementing a medium-complexity feature with active memory:
1. /context → Loads .agents and existing memory
2. /workflow → Detects previous decision, reuses if score is high
3. /plan → Required due to complexity/risk
4. /execute → Implements with validations and tests; scores session relevance
5. /memory-save → Records the decision with category, impact, and score
6. /review → Checks quality, security, and architecture
7. /review-code → Deep technical validation
8. /review-enforce-rules → Strict final gate (OK or BLOCKED) — optional, recommended
When scope or approach is unclear, insert /brainstorm after /workflow (step 3 becomes exploration and approval, then /prd, /spec, or /plan).
Supported tools
| Tool | Status | Notes |
|---|---|---|
| OpenCode | ✅ | Main platform. Full slash command and SDLC support. |
| VSCode | ✅ | Installed via --target vscode as prompt files in .github/prompts. |
| Cursor | ✅ | Installed via --target cursor as commands in .cursor/commands/memflow. |
| Claude Code | ✅ | Installed via --target claude as commands in .claude/commands/memflow. |
| Antigravity | ⏳ | Pending validation. |
Philosophy
Workflow decides. Model executes. Rules protect.
Operating principles:
- Start cheap, escalate when needed. Don't burn the strongest model on a one-line fix.
- No execution without a decision. Context and workflow come first, always.
- No silent progress. Each step waits for explicit user confirmation.
- Don't lose learning. Important decisions become structured memory.
- No "approval by feeling". Validation is explicit and traceable.
Documentation
| Doc | What's inside |
|---|---|
| First 10 minutes | Step-by-step walkthrough with real examples |
| Advanced installation | Non-interactive install, update, check, uninstall, scope details, bootstrap pinning |
| SDLC guide (English) | Conceptual guide to the Memflow SDLC |
| SDLC guide (Português) | pt-BR version |
| End-to-end examples | Real usage scenarios with full command flows |
| Changelog | Version history |
| Model policy | Model selection and escalation strategy |
| Command specs | /context · /workflow · /brainstorm · /execute · /review-code · /review-enforce-rules |
Who is this for?
- Teams standardizing AI-assisted SDLC with governance
- Projects suffering from inconsistent decisions across sessions
- Environments balancing model cost and technical quality
- Flows with high architectural and security compliance requirements
- Engineering orgs adopting AI without sacrificing predictability
Roadmap
- Provide stack-based templates for faster onboarding
- Add effectiveness metrics (lead time, rework, cost per task)
- Expand command specs with adaptive memory hints
Contributing
This project follows Conventional Commits 1.0.0. Commit messages are validated in CI for pull requests and pushes to main.
Allowed types: feat, fix, docs, style, refactor, perf, test, chore, build, ci.
Source and distribution
If you're going to touch the command code, mind how the project is organized (this reduces token cost in production prompts while keeping authoring in pt-BR):
developer/is the authoring source in Portuguese (pt-BR).src/is the distribution payload in English used by installers.- Installer targets (
opencode,cursor,vscode,claude) continue to consumesrc/.
When command behavior changes, keep both trees synchronized and preserve the same file structure between developer/ and src/.
People
This project evolves with contributions from people who believe in disciplined, practical, and auditable AI software engineering.
Want to show up here too? Open an issue, suggest improvements, or send a PR.
Support
Open a GitHub issue. Bug reports, feature requests, and usage questions are welcome.
License
MIT. See LICENSE for full terms.