context-engineering
/context-engineering
Use when starting a session, switching between planning/implementation/review phases, entering unfamiliar code, or when output drifts from project norms.
- Author
- moberghr ↗
- Repository
- mtk-agent-toolkit ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when starting a session, switching between planning/implementation/review phases, entering unfamiliar code, or when output drifts from project norms.
Original author description
Use when starting a session, switching between planning/implementation/review phases, entering unfamiliar code, or when output drifts from project norms.
How it works
- Active Stack
- Overview
- When To Use
- Workflow
- Verification
SKILL.md preview
---
name: context-engineering
description: Use when starting a session, switching between planning/implementation/review phases, entering unfamiliar code, or when output drifts from project norms.
type: skill
license: MIT
compatibility:
- claude-code
- cursor
- codex
user-invocable: false
---
# Context Engineering
## Active Stack
```!
echo "--- Tech Stack ---"
_rts="${CLAUDE_PLUGIN_ROOT}/scripts/resolve-tech-stack.sh"; [ -f "$_rts" ] || _rts="scripts/resolve-tech-stack.sh"
if [ -f "$_rts" ]; then bash "$_rts" --explain "$PWD" 2>&1; echo; else cat .claude/tech-stack 2>/dev/null || echo "(not set)"; fi
if [ -f .claude/tech-stack-pm ]; then echo "--- Package Manager ---"; cat .claude/tech-stack-pm; fi
```
## Overview
Load the minimum context the current phase needs, from the right stack, and refresh it when the
scope changes. The constitution (`AGENTS.md` / `CLAUDE.md`) is already loaded by the harness; do
not re-read it.
## When To Use
- Phase 0 of `fix`, `batch-fix`, and `implement`, and at every later phase boundary
- Entering an unfamiliar area, or when new files enter scope
## Workflow
1. **Resolve the stack for the files in scope.** `bash scripts/resolve-tech-stack.sh <path>` is
polyglot-aware (subproject `.claude/tech-stack` → root `.claude/tech-stack.map` glob → root
file). Pass a representative target path, not `$PWD`, when the change sits in a subtree; add
`--check <paths>` to warn when the resolved stack disagrees with the files. Then read
`.claude/skills/tech-stack-{stack}/SKILL.md` for build/test commands and reference paths.
If nothing resolves, infer with `bash scripts/setup-detect.sh --json` (read-only) and load the
matching stack skill; if that is empty too, say the stack is unconfigured (suggest
`/mtk-setup`) and continue in degraded mode.
2. **Load references for the current phase only.** Spec: `domain-finance.md` (finance and
security supplement, only when scope touches auth/financial/infra) and the stack's testing
supplement. Implementation: the stack's `## Reference Files` entries for the touched layers. Review:
`pre-commit-review-list.md` if present. Read by section where one section is enough.
3. **`applyTo` matching.** Reference entries in `.claude/manifest.json` may declare an `applyTo`
glob array. Test each file in scope (the spec's `change_manifest`, else
`git diff --name-only HEAD`) against the globs with `case`/`fnmatch` semantics; load the
references that match at least one file and skip the rest. References without `applyTo` load
on demand per phase. Re-run the match when new files enter scope.
4. **Native `paths:` rules.** `.claude/rules/*.md` carry `paths:` frontmatter and Claude Code loads
a rule only when a matching file is read or edited. Do not read every rule up front; when the
task needs a rule whose paths did not match (a security pass, a release), read that one file.
5. Read the file to be changed and 2-3 neighbours that set the local pattern.
6. Independent reads go out in one message, not sequentially.
Bound tool output before pruning instructions: instructions are prompt-cached, tool output is
re-billed every turn. Model tiers per phase live in `.claude/references/model-routing.md`.
## Verification
- [ ] Stack resolved for the files in scope (not just the repo root)
- [ ] References loaded for the current phase only; `applyTo` matched against real touched files
- [ ] Local pattern files read before editing or reviewing
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · moberghr/mtk-agent-toolkit | 100 | MIT |
| mvschwarz/openrig | 100 | Apache-2.0 |
| TerminalSkills/skills | 100 | Apache-2.0 |
| FrancoStino/opencode-skills-collection | 100 | MIT |
| drvoss/everything-copilot-cli | 100 | MIT |
| komluk/scaffolding | 100 | MIT |
| kdlbs/kandev | 100 | AGPL-3.0 |
| proxify-dev/agentic-kit | 100 | MIT |
| krzysztofsurdy/code-virtuoso | 100 | MIT |
Database snapshot: 13.11.2026 · package version b710592d675a (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100mukhon-context-engineering
Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project. - 1003a-review
Use when a developer is about to transition between project phases and needs a readiness check. Validates that prerequisites are met before moving from planning to implementation, implementation to deploy, or deploy to production. Triggers on: "am I ready to deploy", "review",… - 100session-handoff
Use when context approaches capacity, before /clear or /compact, when switching tasks, or when ending a coding session: produces a structured handoff artifact for the next session. - 100handoff
Capture session context for a fresh agent. Use for handoffs, context limits, switching focus, ending sessions, or splitting work across sessions. - 100onboard
Auto-generate project context for AI sessions. Use when starting on a new repo for the first time, or when CLAUDE.md / .rune/ context is missing or stale. Scans codebase and creates the setup so every future session starts with full context. - 100handoff
Create HANDOFF.md files for session continuity between conversations. Use when ending a session, switching context, or before /compact.