# Write Repository-Grounded Agent Instructions

Stale agent instructions cause incorrect commands and repeated repository mistakes. This guide helps agents review repository facts and draft concise instructions without claiming unavailable automation.

## Install

```bash
npx skillstore add nexaiguy/md-context-writer
```

## Metadata

- Status: approved
- Slug: nexaiguy-md-context-writer
- Version: 1.1
- Author version: 1.1
- Skillstore revision: r1
- Version status: invalid
- Tree hash: e47cb68cb51a828fc178265619edcca6b5db607f862d3b593d9d28b99d4ecc2b
- Author: nexaiguy
- GitHub username: nexaiguy
- License: MIT
- Repository: https://github.com/nexaiguy/nex-ai-skills/tree/463aaff26593654193deb52f24d18e80ec21e323/skills/md-context-writer
- Ref: 3ddfdca559084abffbfdd188f2ba14b597dcfd9c
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, env\_access
- Quality score: 77
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/nexaiguy-md-context-writer
- Manifest: https://skillstore.pages.dev/api/skills/nexaiguy-md-context-writer/manifest

## Capabilities

- Provides a workflow for grounding instruction files in repository manifests, paths, and CI configuration.
- Guides drafting and reviewing CLAUDE.md and AGENTS.md with a suggested limit of 200 lines.
- Recommends moving area-specific guidance into path-scoped .claude/rules files.
- Provides an audit example covering stale commands, removed paths, conflicting rules, and credential exposure.
- Directs agents to show a diff and explain removed sections instead of silently dropping content.

## Use Cases

- Create Instructions for a New Repository: Draft concise agent guidance from manifests and CI configuration, marking anything that still requires maintainer confirmation.
- Review Stale Onboarding Guidance: Compare an existing instruction file with current commands and paths, then review proposed corrections before accepting a diff.
- Organize Monorepo Rules: Separate shared instructions from area-specific rules and identify where automated drift checks would require additional tooling.

## Prompt Templates

### Draft a Basic Instruction File

```
Draft CLAUDE.md from this repository's manifests and CI files. Keep it under 200 lines. Mark unverified commands and do not run missing helpers.
```

### Review Existing Instructions

```
Review AGENTS.md against current repository files. Identify stale commands, missing paths, and conflicting rules. Show a proposed diff with reasons before applying changes.
```

### Separate Scoped Rules

```
Propose splitting this CLAUDE.md into shared instructions and path-scoped .claude/rules files. Verify directory paths and preserve existing intent. Show the complete proposed diff.
```

### Plan Evidence-Based Drift Checks

```
Audit instructions across this monorepo using workspace manifests and CI configuration. Record evidence, flag unverifiable claims, and propose drift checks without assuming missing scripts exist.
```

## Limitations

- Only SKILL.md is included; referenced scripts, templates, extension source, and automated tests are absent.
- Automatic fact collection, linting, and CI enforcement require separately obtained tools whose behavior was not verified here.
- The described linter supports selected command runners and checks paths written in backticks, not every possible command or path.
- The guide cannot establish whether a repository rule is appropriate; maintainers must review recommendations and tool-specific loading behavior.

## Best Practices

- Ground each command and path in current repository files, and distinguish configured commands from commands actually executed.
- Keep shared instructions concise and scope specialized rules to verified paths.
- Review the proposed diff and redact secret values; rotate exposed credentials rather than only deleting them from documentation.

## Anti Patterns

- Assuming the referenced scripts, templates, or claimed tests are included in this package.
- Copying example commands or paths without checking the target repository.
- Embedding credential values or silently deleting maintainer instructions during a rewrite.

## Security Audit

- Audited at: 2026-11-02T12:21:57.219\+00:00
- Summary: All 20 static findings are false positives involving Markdown formatting, attribution links, and an example advising credential removal and rotation. No evidence found of malicious command execution, credential access, exfiltration, reconnaissance, or prompt injection in the supplied guide. Referenced scripts and templates are absent, so their behavior and claimed test coverage cannot be verified.

## Stats

- Views: 0
- Downloads: 0
- Favorites: 0
- Popularity score: 0
