agentleFS
yeaight7yeaight7/agent-powerups/skills/managed-codebase-context/SKILL.md

managed-codebase-context

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Use when connecting to a managed codebase-context MCP/session service, checking stale maps, or safely using MCP-provided repository context.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when a persistent codebase-context MCP server is available and the task requires broad architectural context, symbol inventory, or …

    line 9
  2. Distinctive:

    Check MCP transport type: stdio (local, one-off) vs HTTP (requires a running server).

    line 12
  3. Very specific:

    Do not run npx -y or start server processes without user approval.

    line 13
  4. Very specific:

    Verify server cwd, env variables, timeout, and workspace path scope.

    line 14
  5. Distinctive:

    HTTP: use only when a local server is already confirmed to be running.

    line 21
  6. Distinctive:

    Only interact with paths scoped to the current workspace.

    line 47
  7. Distinctive:

    Do not overwrite existing architectural documents without user confirmation.

    line 48
  8. Distinctive:

    Do not import user-level or global MCP configs implicitly.

    line 49
  9. Distinctive:

    Do not leave background server processes running after a failed connection.

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Managed Codebase Context

When to use

Use when a persistent codebase-context MCP server is available and the task requires broad architectural context, symbol inventory, or cross-file navigation that would be expensive to reconstruct from scratch on each turn.

Requirements / Checks

  • Check MCP transport type: stdio (local, one-off) vs HTTP (requires a running server).
  • Do not run npx -y or start server processes without user approval.
  • Verify server cwd, env variables, timeout, and workspace path scope.
  • Confirm cleanup behavior for spawned stdio processes before starting long-running tasks.

Workflow

  1. Select transport:
    • stdio: suitable for local, ephemeral sessions started per task.
    • HTTP: use only when a local server is already confirmed to be running.
  2. Connect with timeout — set a connection timeout; do not let the agent hang indefinitely if the server never initializes.
  3. Retrieve context — fetch the current codebase map, symbol index, or architectural summary as available.
  4. Validate freshness — a map is stale if any of the following are true:
    • Map timestamp predates the last git commit that touched relevant files.
    • Map references files that no longer exist.
    • Map is missing files present in the current workspace.
    • The user reports recent significant refactoring.
  5. Refresh when stale — trigger a context refresh only when the map is demonstrably stale. Do not refresh on every request — refreshes are expensive.
  6. Use context, then close — read what you need, then close the session. Ensure the client and transport close cleanly. If the server was spawned as a stdio process, kill the process tree if it does not exit within a few seconds.

Staleness Signals

SignalCheck
Map timestampCompare to git log --format="%ci" -1 for recently changed files
Missing filesCross-reference map file list with git ls-files
Stale symbolsCheck if key function/class names in the map exist in current source
User-reportedAccept the user's word; trigger refresh without verification

Safety Constraints

  • Only interact with paths scoped to the current workspace.
  • Do not overwrite existing architectural documents without user confirmation.
  • Do not import user-level or global MCP configs implicitly.
  • Do not leave background server processes running after a failed connection.

Validation / Done Criteria

  • Context retrieved is confirmed to be within the current workspace scope.
  • Freshness was validated or a refresh was triggered with reason.
  • Any spawned MCP process is closed or explicitly left running by user choice.

References

  • references/managed-session-checklist.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.