Skip to main content
ClaudeWave
Skill66 repo starsupdated 29d ago

context-engineering

Strictly enforce context engineering principles to avoid context stuffing, optimize memory architecture, and manage the Research-Plan-Reset-Implement cycle.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/tranhieutt/software_development_department /tmp/context-engineering && cp -r /tmp/context-engineering/.claude/skills/context-engineering ~/.claude/skills/context-engineering
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# 1. Overview
Context engineering bridges the gap between static training data and dynamic reality. **Context Stuffing** (jamming volume without intent) degrades reasoning, increases noise, and leads to hallucinations. **Context Engineering** treats AI attention as a scarce resource and allocates it deliberately through structure, bounded contexts, and intelligent memory retrieval (RAG / MCP Supermemory). Without this skill, the AI suffers from "Context Hoarding Disorder," leading to goal drift, high latency, and poor execution quality.

# 2. When to Use
Activate this skill immediately upon detecting the following signs:
- **Sign 1:** User pastes a massive block of uncurated documents entirely into the context window (e.g., full PRDs, full codebases, thousands of lines of logs).
- **Sign 2:** The AI's outputs start to become vague, hedged, or inconsistent despite having "all the context", or when the context window is clearly overflowing.
- **Sign 3:** The user wants to start a multi-step complex workflow spanning many files and iterations.
- **Implicit Command:** User types `/context` or `/memory`.

# 3. Strict Process
*ULTIMATUM*: You are an Agent. You DO NOT have the right to ignore, truncate, or alter the order of these steps, even if you think "the model has a 1 million token context limit anyway."

1. **[Step 1 - Intent & Boundary Falsification]**: Identify exactly what decision the provided context supports. Apply the falsification test: "If I exclude [context element X], what specific failure will occur in [decision Y]?" If there is no concrete failure, the context must be rejected or removed from the active window.
2. **[Step 2 - Persist vs. Retrieve Classification]**: Separate the information. Core constraints and glossary definitions remain in active context. Episodic, project-specific, or historical data must be offloaded and retrieved only when queried. Use `mcp_supermemory_recall` for historical lookups instead of keeping them in the prompt.
3. **[Step 3 - The R-P-R-I Cycle Execution]**: 
   - **R**esearch: Gather necessary information.
   - **P**lan: Synthesize findings into a high-density `PLAN.md` or `SPEC.md`. 
   - **R**eset: Save crucial lessons to memory using `mcp_supermemory_memory` and explicitly ask the user to **clear the context window** (start a new chat) or summarize everything to drop the past context rot.
   - **I**mplement: Execute purely based on the dense plan.
4. **[Step 4 - Storage & Consolidation]**: Upon finishing a milestone, write the generalized knowledge or operational principles into `mcp_supermemory_memory`.

# 4. Anti-Rationalizations
These are lazy thoughts that Agents (like you) commonly fall prey to. If an idea in your head matches the Left Column, you MUST immediately obey the Right Column:

| Agent's Lazy Rationalization | Refutation & Mandatory Action |
| :--- | :--- |
| "I have a massive context window; I can just read all 50 files the user provided without complaining." | Volume != Quality. Context is an attention economy. You MUST explicitly tell the user that "Context Stuffing" dilutes attention. Limit the working context to only the files strictly needed for the immediate decision. |
| "I'll just try again and rewrite the code if it hallucinates." | Retries mask bad information architecture. Do not normalize retries. Stop and fix the context structure, break down the problem, or refine the retrieved memory BEFORE writing another line of code. |
| "I'll keep all the research logs and failed attempts in the chat history so I remember what I tried." | "Context Rot" kills reasoning. Once a plan is synthesized, the previous dead ends become pure noise. You MUST instruct the user to flush the context or start fresh with a clean `SPEC.md`. |

# 5. Verification Gates
You are NOT allowed to end your turn and respond "Context established" or proceed to implementation until the following checks pass:
- [ ] You have successfully filtered out unnecessary broad context and kept only the decision-critical context.
- [ ] You have explicitly called `mcp_supermemory_memory` to commit important established facts, or `mcp_supermemory_recall` to fetch past facts instead of asking the user to paste them.
- [ ] You have synthesized the current sprawling context into a dense artifact (e.g. `PLAN.md` or `SPEC.md`) and proposed a Context Reset.

# 6. Red Flags
Immediately STOP and request User intervention if:
- The user demands that you process more than 35k tokens of unstructured, mixed-domain text in a single prompt without allowing you to summarize and discard the noise.
- You detect that the current context window is bloated with >3 failed attempts of the same task. You must halt and enforce a **Reset**.
- Memory retrieval tools (like `mcp_supermemory`) fail repeatedly, meaning you are operating blind on historical context.
accessibility-specialistSubagent

The Accessibility Specialist ensures the software is accessible to the widest possible audience. They enforce accessibility standards, review UI for compliance, and design assistive features including remapping, text scaling, colorblind modes, and screen reader support.

ai-programmerSubagent

The AI Programmer implements intelligent system features: recommendation engines, classification pipelines, LLM integrations, decision logic, and autonomous agent behavior. Use this agent for AI/ML feature implementation, model integration, intelligent automation, or AI system debugging.

analytics-engineerSubagent

The Analytics Engineer designs telemetry systems, user behavior tracking, A/B test frameworks, and data analysis pipelines. Use this agent for event tracking design, dashboard specification, A/B test design, or user behavior analysis methodology.

backend-developerSubagent

The Backend Developer builds and maintains server-side logic, APIs, databases, authentication, and integrations. Use this agent for REST/GraphQL API implementation, database operations, authentication systems, background jobs, microservices, server performance, and backend testing. Works from API design contracts and PRDs.

community-managerSubagent

The Community Manager handles user-facing communications, feedback synthesis, support escalation, and community engagement. Use this agent for drafting release announcements, synthesizing user feedback into actionable insights, writing support documentation, or coordinating community-facing communication around releases and incidents.

ctoSubagent

The CTO (Chief Technical Officer) owns the high-level technical vision, architecture decisions, technology choices, and technical strategy. Use this agent for architecture-level decisions, technology evaluations, cross-system conflicts, and when a technical choice will constrain or enable product possibilities. This is the highest technical authority in the department.

data-engineerSubagent

The Data Engineer designs database schemas, builds data pipelines, manages migrations, and owns the data infrastructure. Use this agent for schema design, complex migrations, data modeling, ETL/ELT pipelines, database performance optimization, analytics infrastructure, and data integrity strategies.

devops-engineerSubagent

The DevOps Engineer maintains build pipelines, CI/CD configuration, version control workflow, and deployment infrastructure. Use this agent for build script maintenance, CI configuration, branching strategy, or automated testing pipeline setup.