Module context capture

From IntentArchitect/Intent.Modules.NET · View interactive version

Module context capture is an AI agent skill from the GitHub repository IntentArchitect/Intent.Modules.NET. Read and maintain a module's CONTEXT.md — the durable why behind its design decisions, invariants, and cross-module relationships, kept in the module's project folder. USE ONLY WHEN a design decision is made or a module change concludes (write it), or before modifying any module (read it first). DO

How to use this skill

Skill file

Skill: module-context-capture

CONTEXT.md is a module's durable knowledge layer — the why behind its design. The code

records what a module does; CONTEXT.md records the reasoning that would otherwise leave with the

session that decided it.

Where It Lives

Inside the module project folder — e.g. Modules/Intent.Modules.X/CONTEXT.md. One per module.

When A Module Has No CONTEXT.md

Create one, but not on arrival. A CONTEXT.md written before there is anything to record is a

template with headings and no content, and the next session learns to skip it.

Write the file at the moment the first durable decision actually lands — a design choice with a

rejected alternative, an invariant something else now depends on, a constraint discovered the hard

way. Start with the Purpose section and that one entry. Let it grow from there.

Read It Before You Modify

Before changing a module, read the CONTEXT.md of every module you are about to touch. It

tells you which constraints are deliberate, and which code is load-bearing for reasons the code

itself does not explain.

If your intended change conflicts with CONTEXT.md, stop and flag the conflict. Do not

silently "improve" a design that was chosen on purpose. Either the context is stale — in which case

update it deliberately, as part of this change — or the change is wrong. Both need a decision, not

an assumption.

What Goes In

| Capture | Example |

|---|---|

| Architectural decisions and their reasoning | Why a concern became a factory extension rather than a template |

| Invariants and constraints | This template must stay transport-agnostic; it may not reference X |

| Technology constraints | The library cannot do Y in environment Z, so the module generates W instead |

| Accepted patterns | How this module's templates resolve types across layers |

| Setting/condition-driven wiring | A setting or condition changes which concrete class or mechanism gets generated, not just a parameter on the same shape — e.g. enabling a transactional outbox switches the generated consumer to a base class sharing the persistence layer's own transaction, instead of the plain consumer used otherwise |

| Cross-module relationships | Which modules this one affects, what it broadcasts, what it expects others to handle |

| Dependency version contracts | Which version of a module this one depends on its code is written against, and how that module's interface changed between versions — e.g. a method taking one argument in 1.x takes two from 2.0, so the templates call the new form and the version floor is 2.0 |

| Decisions taken during implementation | Options considered and rejected, and why |

Dependency Versions Change The Contract

A module is written against a particular version of each module it depends on. When one of those

modules changes an interface, type, role or behaviour this module relies on between versions, the

code alone does not say which version it was written for or what the older form looked like.

Record it whenever you move a dependency to a new version, adapt to a changed interface, or raise a

version floor because of one: the version the module now targets, what changed and in which

version, how this module adapted, and why the floor sits where it does.

When you read CONTEXT.md before a change, compare each recorded version against the one the

module references now. A dependency that has since moved further may have changed again, so check

its interface before relying on what is recorded.

A change in an Intent Architect module or SDK interface between versions is a contract change like

any other, not a defect, so it belongs here.

What Stays Out

Intent Architect Problems Go To The User, Not Into CONTEXT.md

CONTEXT.md records decisions about this module. A problem with Intent Architect itself is not

one of them: the Software Factory, a designer, module installation or caching, the Intent MCP tools,

or any other part of the platform misbehaving, reporting something untrue, or needing a workaround.

Recorded in CONTEXT.md, such a problem becomes a permanent workaround that nobody reports, and the

next session reads a platform defect as a deliberate constraint of the module.

Instead, tell the user as soon as you find it, so they can bring it to the Intent Architect support

team's attention. Say what happened, how to reproduce it, and any workaround you used to keep going.

The one exception is a genuine limitation of the Intent Architect API or SDK — something it does

not offer by design, as opposed to something that malfunctions. For example: a registration base

class with no hook for what the module needs, or a module setting type that cannot express a

condition. Record it together with the module design decision it forced. If you cannot tell whether

something is a limitation or a defect, treat it as a defect and report it.

Write At Decision Time

Record the entry when the decision is made, not reconstructed at the end. A decision written up

late is written from memory, and by then the alternatives that were rejected — the most valuable

part — are usually gone.

The same applies to correction. When a decision is superseded, update or remove the entry then.

A confidently wrong CONTEXT.md is worse than none, because the next session trusts it.

Suggested Shape

# Context: [Module Name]

## Purpose
[What this module is responsible for, in two or three sentences.]

## Architectural Decisions
- **[Decision]** — [why; what was rejected and why]

## Invariants & Constraints
- [Rule that must hold, and what breaks if it does not]

## Module Interactions
- **[Other module]** — [how they relate; what is broadcast, consumed, or assumed]
  - Written against [version]. [Version] → [version]: [what changed, and how this module adapted]

## Superseded
- [Decision that no longer holds, and what replaced it]

Checklist

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.