Contextacao

From gabrielmoreira/agent-skills-mirror · View interactive version

Contextacao is an AI agent skill from the GitHub repository gabrielmoreira/agent-skills-mirror. **WORKFLOW SKILL** — Structured context analysis before acting. USE FOR: questioning assumptions, mapping dependencies, identifying blind spots, validating scope of any task or subject. Use to contextualize, question, analyze before implementing, review premises, prevent hallucination, structured as

How to use this skill

Skill file

Contextação — Structured Context Analysis

Purpose

Before answering, implementing, or creating anything, this skill forces a critical and structured analysis of the context. The goal is to surface what truly matters before acting, avoiding shallow responses, incorrect assumptions, and blind spots.

When to Use

Procedure

Phase 0 — Complexity Triage

First, classify the task using the objective criteria below. A single criterion from a level is enough to classify at that level:

| Level | Objective criteria | Depth |

|-------|-------------------|-------|

| Simple | • 1 technology involved • 0 external dependencies • Reversible outcome • 1 stakeholder | Phase 1 summarized (1 question per axis) + Phase 3 (questions only) + Phase 4 |

| Medium | • 2-3 technologies • 1+ external dependency • Multiple possible interpretations • Hard-to-reverse outcome | Phases 1-4 complete |

| Complex | • 4+ technologies • Domain with frequent updates (APIs, specs, compliance) • Multiple stakeholders • Production or user data impact | Phases 1-4 complete + mandatory consultation of frameworks + good vs. bad analysis examples |

When in doubt, classify upward. Over-analyzing is better than under-analyzing.

Visual Triage Flow
START → How many technologies involved?
  │
  ├─ 1 tech, 0 deps, reversible, 1 stakeholder
  │   └─ ✅ SIMPLE → Phase 1 (1 question/axis) → Phase 3 → Phase 4
  │
  ├─ 2-3 techs, OR 1+ deps, OR ambiguous, OR hard to reverse
  │   └─ ⚠️ MEDIUM → Phases 1-4 complete
  │
  └─ 4+ techs, OR frequently-changing domain, OR multiple stakeholders, OR production data
      └─ 🔴 COMPLEX → Phases 1-4 + frameworks + examples consultation

Phase 1 — Subject Decomposition

Break the subject/task into the following axes. For each axis, ask at least 2 critical questions (1 if triage = Simple):

1.1 Assumptions — *"What am I treating as fact without evidence?"*
1.2 Scope — *"What is in, out, and undefined?"*
1.3 Dependencies — *"What needs to exist or work for the solution to work?"*
1.4 Sources of Truth — *"Where does the knowledge come from and is it reliable?"*
1.5 Failure Modes — *"How can this go wrong and what am I not seeing?"*
1.6 Stakeholders and Impact — *"Who is affected and who decides?"*

Boundaries between axes: Assumptions = what I assume. Sources of Truth = where my knowledge comes from. Failure Modes = consequences of errors. If a point fits multiple axes, place it in the axis where the corrective action is clearest.

Phase 2 — Confidence Classification

⚠️ Disclaimer: The classification below is a model estimate, not a fact. LLMs tend to be overconfident — i.e., classifying as 🟢 what should be 🟡. Whenever the analysis informs high-impact decisions, the classification should be validated by a human before proceeding.

For each axis, classify your confidence level:

| Level | Meaning | Action |

|-------|---------|--------|

| 🟢 High | I have reliable, up-to-date data | Proceed |

| 🟡 Medium | I have partial or possibly outdated knowledge | Research actively: use available tools (fetch docs, search repos, read specs) to upgrade to 🟢. If tools exhausted and still 🟡, flag for human validation. |

| 🔴 Low | I lack sufficient data or know it's outdated | Stop. Research actively using every available tool before proceeding. Fetch official docs. Search repos. Read specs. Query APIs. Only after exhausting available research paths: escalate to human. Declaring "unknown" without research effort is a failure mode, not an answer. |

Tool Evidence (anti-hallucination)

For every axis classified as 🟡 or 🔴, you MUST list in the Phase 2 table which tools you used to research before accepting that classification. The Tools used column accepts: tool_name("argument") format.

Accepted tools: read_file, grep_search, semantic_search, fetch_webpage, run_in_terminal, file_search, list_dir.

A Stop hook cross-checks the listed tools against the session transcript. Listing a tool you didn't actually call will trigger a block.

Phase 3 — Action Plan

Based on the analysis, generate:

  1. Questions for the user (MANDATORY) — list questions that need human answers before proceeding. Every analysis MUST generate at least 1 question. If there are no questions, the analysis was probably shallow.
  2. What can be answered now — with high confidence
  3. What needs consultation — specify where to look (docs, APIs, internal knowledge base). If the source is reachable with available tools, consult it NOW — don't list it as "needs consultation" when you can resolve it in this session.
  4. What needs human validation — decisions the model should not make alone
  5. What should NOT be done — actions that would be premature without more context

Use the output template to structure the delivery.

Phase 4 — Transparency

Always declare:

Phase 5 — Feedback Loop

After delivering the analysis and the user acts on it, record the learning:

  1. Evaluate the outcome: did the analysis get it right? Wrong? What was not anticipated?
  2. Record in staging: add an entry in retrospectives.md in the format:

```

### [DATE] — [SUBJECT]

What happened: [short description]

Learning: [concise rule]

Axis affected: [axis from SKILL.md]

```

  1. Check the cap: if staging reached 5 entries, start the distillation procedure
  2. Capture real examples: if the analysis was particularly good or bad, save in examples.md under "Real Cases"

Phase 5 is optional for Simple triage. Mandatory for Medium and Complex.

Rules

Quality Checklist (self-validation)

Before delivering the analysis, verify:

If any item fails, refine the analysis before delivering. Consult good vs. bad analysis examples to calibrate.

When the User Asks for Help

References

Companion Skills

When task-intent has already been applied, its Success Condition output (WHY/WHAT FOR/FOR WHOM) can be used directly — no need to re-derive it in Phase 1.6.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.