plugins/development-harness/skills/context-integration/SKILL.md
Use when the PLAN artifact from SAM Stage 2 needs contextualization against actual codebase state — grounds the design plan in reality by performing scope analysis (NEW/MODIFY/COMPLETE classification), conflict detection between plan assumptions and codebase patterns, and resource mapping to concrete file paths and integration points. Produces an updated ARTIFACT:PLAN registered via MCP with a Contextualization section appended.
npx skillsauth add jamie-bitflight/claude_skills context-integrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the context integration agent for the SAM pipeline. You take an abstract design plan and ground it in the concrete reality of the codebase. Every design element maps to real files, patterns, and integration points.
flowchart TD
Start([ARTIFACT:PLAN + codebase access]) --> S1[1. Scope Analysis]
S1 --> S2[2. Conflict Detection]
S2 --> Q{Conflicts found?}
Q -->|Yes| Resolve[Resolve or document conflicts]
Resolve --> S3
Q -->|No| S3[3. Resource Mapping]
S3 --> S4[4. Plan Update]
S4 --> Done([Contextualized ARTIFACT:PLAN])
For each component in the plan, classify the implementation scope:
Document the evidence for each classification (file paths, function names, line ranges).
Search the codebase for contradictions between the plan and existing patterns:
For each conflict, document:
Identify existing codebase assets the plan can use:
Map each plan component to the concrete resources it will use.
Re-register the updated plan via MCP:
artifact_register(
issue_number={issue},
artifact_type="architect",
path="plan/architect-{slug}.md",
agent="context-integration",
content="{full_updated_plan_markdown}"
)
This overwrites the previous "architect" artifact with the contextualized version.
Add the Contextualization section and mark the status checkbox as complete.
ARTIFACT:PLAN via artifact_read(issue_number={issue}, artifact_type="architect")Updated ARTIFACT:PLAN re-registered via artifact_register(issue_number={issue}, artifact_type="architect", path="plan/architect-{slug}.md", agent="context-integration", content="{full_updated_plan_markdown}") with the following section appended:
## Contextualization
### Scope Analysis
| Component | Scope | Evidence |
|-----------|-------|----------|
| <component from plan> | NEW / MODIFY / COMPLETE | <file paths, line ranges> |
### Conflict Report
| Conflict | Plan Assumes | Codebase Reality | Resolution |
|----------|-------------|------------------|------------|
| <conflict name> | <what plan says> | <what exists> | <adapt plan / refactor> |
### Resource Map
| Resource | Type | Location | Used By |
|----------|------|----------|---------|
| <existing asset> | utility / pattern / config / test | <file path> | <plan component> |
### Integration Points
1. **<integration point>** — <where new code connects to existing code; file and function>
2. <...>
### File Impact Summary
- Files to create — <list>
- Files to modify — <list>
- Files unchanged — <list>
Also update the Contextualization Status at the bottom of PLAN.md:
## Contextualization Status
- [x] Grounded in codebase (completed by Stage 3)
This stage requires a codebase analyzer capable of reading files, searching patterns, and understanding project structure. Use the project's language manifest to find the appropriate codebase-analysis role for the tech stack.
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.