enhance-cross-file
Use when checking cross-file consistency: tools vs frontmatter, agent references, duplicate rules, contradictions.
Best use case
enhance-cross-file is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when checking cross-file consistency: tools vs frontmatter, agent references, duplicate rules, contradictions.
Teams using enhance-cross-file should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/enhance-cross-file/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How enhance-cross-file Compares
| Feature / Agent | enhance-cross-file | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when checking cross-file consistency: tools vs frontmatter, agent references, duplicate rules, contradictions.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# enhance-cross-file
Analyze cross-file semantic consistency across agents, skills, and workflows.
## Parse Arguments
```javascript
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const targetPath = args.find(a => !a.startsWith('--')) || '.';
```
## Purpose
Detects issues that span multiple files - things single-file analysis misses:
- Tools used in prompt body but not declared in frontmatter
- Agent references that don't exist
- Duplicate instructions across files (maintenance burden)
- Contradictory rules (ALWAYS vs NEVER conflicts)
- Orphaned agents not referenced by any workflow
- Skill tool mismatches (allowed-tools vs actual usage)
## Workflow
1. **Run Analyzer** - Execute the JavaScript analyzer to get findings:
```bash
node -e "const a = require('./lib/enhance/cross-file-analyzer.js'); console.log(JSON.stringify(a.analyze('.'), null, 2));"
```
For a specific path: `a.analyze('./plugins/enhance')`
2. **Parse Results** - The analyzer returns JSON with `summary` and `findings`
3. **Report** - Return findings grouped by category
The JavaScript analyzer (`lib/enhance/cross-file-analyzer.js`) implements all cross-file detection. The patterns below are reference documentation.
## Detection Patterns
### 1. Tool Consistency (MEDIUM Certainty)
**tool_not_in_allowed_list**: Tool used in prompt body but not in frontmatter `tools:` list
```yaml
# Frontmatter declares:
tools: Read, Grep
# But body uses:
Use Write({ file_path: "/out" }) # <- Not declared!
```
**skill_tool_mismatch**: Skill's `allowed-tools` doesn't match actual tool usage in skill body
### 2. Workflow Consistency (MEDIUM Certainty)
**missing_workflow_agent**: `subagent_type: "plugin:agent-name"` references non-existent agent
**orphaned_prompt**: Agent file exists but no workflow references it (may be entry point - check manually)
**incomplete_phase_transition**: Workflow phase mentions "Phase N" but no corresponding section
### 3. Instruction Consistency (MEDIUM Certainty)
**duplicate_instructions**: Same MUST/NEVER instruction in 3+ files (extract to shared location)
**contradictory_rules**: One file says "ALWAYS X" while another says "NEVER X"
## Output Format
```markdown
## Cross-File Analysis
**Files Analyzed**: {agents} agents, {skills} skills, {commands} commands
### Tool Consistency ({n})
| Agent | Issue | Fix |
|-------|-------|-----|
| exploration-agent | Uses Write but not in tools list | Add Write to frontmatter |
### Workflow Issues ({n})
| Source | Issue | Fix |
|--------|-------|-----|
| workflow.md | References nonexistent agent | Check spelling or create agent |
### Instruction Consistency ({n})
| Instruction | Files | Fix |
|-------------|-------|-----|
| "NEVER push --force" | 4 files | Extract to CLAUDE.md |
```
## Constraints
- All patterns are MEDIUM certainty (require context)
- No auto-fix (cross-file changes need human review)
- Skip content inside `<bad-example>`, `<bad_example>`, `<badexample>` tags
- Skip content inside code blocks with "bad" in info string
- Entry point agents (orchestrator, validator, discoverer) are not orphaned
## Pattern Statistics
| Category | Patterns | Auto-Fixable |
|----------|----------|--------------|
| Tool Consistency | 2 | 0 |
| Workflow | 3 | 0 |
| Consistency | 3 | 0 |
| **Total** | **8** | **0** |Related Skills
file-path-traversal
This skill should be used when the user asks to "test for directory traversal", "exploit path traversal vulnerabilities", "read arbitrary files through web applications", "find LFI vu...
crossing-the-chasm
Navigate the technology adoption lifecycle from early adopters to mainstream market. Use when the user mentions "crossing the chasm", "beachhead segment", "whole product", "early adopters vs. mainstream", or "tech go-to-market". Covers D-Day analogy, bowling-pin strategy, and positioning against incumbents. For product positioning, see obviously-awesome. For new market creation, see blue-ocean-strategy.
cross-repo-plan
Creates and tracks implementation plans that span multiple repositories. Extends the single-repo plan model with a coordinator document that tracks per-repo progress, cross-repo dependencies, and execution order.
file-uploads
Expert at handling file uploads and cloud storage. Covers S3, Cloudflare R2, presigned URLs, multipart uploads, and image optimization. Knows how to handle large files without blocking. Use when: f...
multi-stage-dockerfile
Create optimized multi-stage Dockerfiles for any language or framework
git-pr-workflows-pr-enhance
You are a PR optimization expert specializing in creating high-quality pull requests that facilitate efficient code reviews. Generate comprehensive PR descriptions, automate review processes, and ensu
file-organizer
Intelligently organizes your files and folders across your computer by understanding context, finding duplicates, suggesting better structures, and automating cleanup tasks. Reduces cognitive load and keeps your digital workspace tidy without manual effort.
write-coding-standards-from-file
Write a coding standards document for a project using the coding styles from the file(s) and/or folder(s) passed as arguments in the prompt.
update-markdown-file-index
Update a markdown file section with an index/table of files from a specified folder.
image-enhancer
Improves the quality of images, especially screenshots, by enhancing resolution, sharpness, and clarity. Perfect for preparing images for presentations, documentation, or social media posts.
enhance-orchestrator
Use when coordinating multiple enhancers for /enhance command. Runs analyzers in parallel and produces unified report.
comprehensive-review-pr-enhance
You are a PR optimization expert specializing in creating high-quality pull requests that facilitate efficient code reviews. Generate comprehensive PR descriptions, automate review processes, and e...