context-engineer
Context Engineer v3.0
Determine what context an agent needs and package it within token budget.
Actions
/context-engineer analyze <task>
Identify what context sources are relevant:
- Parse task description for domain keywords
- Check for DESIGN.md (frontend tasks)
- Check for .spec.md files (spec-driven tasks)
- Check memory sources (vault, handoffs, ledgers)
- Check codebase files (Glob/Grep for related code)
- Output: ranked list of context sources with estimated tokens
/context-engineer load <task>
Assemble context from identified sources:
- Run
analyzeif not already done - Read each source, extract relevant sections
- Prioritize by relevance score
- Output: assembled context block
/context-engineer prune <budget>
Trim assembled context to fit token budget:
- Default budget: 8000 tokens
- Remove low-relevance sections first
- Summarize long sections instead of including full text
- Preserve: interfaces, invariants, design tokens (high signal)
- Output: pruned context within budget
/context-engineer inject
Write packaged context to .claude/context-payload.md:
- Write pruned context to file
- The
ralph-subagent-start.shhook reads this file and injects into teammate prompt - File is gitignored (per Item 0a)
Context Sources (Priority Order)
| Source | When Relevant | Token Cost |
|---|---|---|
| .spec.md | Task has a spec | ~500-2000 |
| DESIGN.md | Frontend task | ~1000-3000 |
| Related code files | Always | ~500-5000 |
| Memory (vault) | Prior work exists | ~200-500 |
| Handoffs | Cross-session | ~300-800 |
| Vault (future) | Curated knowledge | ~200-1000 |
Integration
- Orchestrator Step 5 (DELEGATE): invoke before spawning teammate
- ralph-subagent-start.sh: reads
.claude/context-payload.mdif exists - Token budget: default 8000, adjustable per task complexity
Anti-Rationalization
| Excuse | Rebuttal |
|---|---|
| "The agent has enough context from the prompt" | Agents lose 40% accuracy without structured context. Package it. |
| "Context engineering is overhead" | 5 seconds of packaging saves 5 minutes of wrong output. |
| "I'll just include everything" | Token flooding degrades quality. Prune to signal. |
More from alfredolopez80/multi-agent-ralph-loop
stop-slop
A skill for removing AI-generated writing patterns ('slop') from prose. Eliminates telltale signs of AI writing like filler phrases, excessive hedging, overly formal language, and mechanical sentence structures. Use when: writing content that should sound human and natural, editing AI-generated drafts, cleaning up prose for publication, or any content that needs to sound authentic rather than AI-generated. Triggers: 'stop-slop', 'remove AI tells', 'clean up prose', 'make it sound human', 'edit AI writing'.
10iterate
Ralph Loop pattern with swarm mode: iterative execution until VERIFIED_DONE with multi-agent coordination. Use when: (1) iterative refinement needed, (2) quality gates must pass, (3) automated validation required. Triggers: /iterate, 'iterate until done', 'keep trying', 'fix until passing', 'loop until done'.
2gemini-cli
|
2minimax
Custom skill for minimax
1clarify
Intensive requirement clarification using structured AskUserQuestion workflow. Gathers MUST_HAVE (blocking) and NICE_TO_HAVE (optional) information before implementation. Use when: (1) starting new feature implementation, (2) requirements are ambiguous, (3) multiple approaches possible, (4) before writing any code. Triggers: /clarify, 'clarify requirements', 'ask questions', 'gather requirements'.
1security
Security audit with Codex + MiniMax second opinion. Integrates ralph-security agent (6 quality pillars, OWASP A01-A10). Uses LSP for code navigation during analysis. Use when: (1) /security is invoked, (2) task relates to security functionality.
1