.cursor/skills/agents-md/SKILL.md
Deep codebase initialisation with hierarchical AGENTS.md documentation and updating of AGENTS.md documentation.
npx skillsauth add Samuel-Harris/Bytes-and-Nibbles-Website agents-mdInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Creates comprehensive, hierarchical AGENTS.md documentation across the entire codebase.
AGENTS.md files serve as AI-readable documentation that helps agents understand:
Every AGENTS.md (except root) includes a parent reference tag:
<!-- Parent: ../AGENTS.md -->
This creates a navigable hierarchy:
/AGENTS.md ← Root (no parent tag)
├── src/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
│ ├── src/components/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
│ └── src/utils/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
└── docs/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
<!-- Parent: {relative_path_to_parent}/AGENTS.md -->
<!-- Generated: {timestamp} | Updated: {timestamp} -->
# {Directory Name}
## Purpose
{One-paragraph description of what this directory contains and its role}
## Key Files
{List each significant file with a one-line description}
| File | Description |
| --------- | ---------------------------- |
| `file.ts` | Brief description of purpose |
## Subdirectories
{List each subdirectory with brief purpose}
| Directory | Purpose |
| --------- | ----------------------------------------- |
| `subdir/` | What it contains (see `subdir/AGENTS.md`) |
## For AI Agents
### Working In This Directory
{Special instructions for AI agents modifying files here}
### Testing Requirements
{How to test changes in this directory}
### Common Patterns
{Code patterns or conventions used here}
## Dependencies
### Internal
{References to other parts of the codebase this depends on}
### External
{Key external packages/libraries used}
<!-- MANUAL: Any manually added notes below this line are preserved on regeneration -->
CRITICAL: DO NOT generate documentation for any directory that is ignored by .gitignore or .cursorignore.
Task(description="List directories recursively",
subagent_type="explore",
prompt="List all directories recursively. STRICTLY EXCLUDE any directories that are ignored by .gitignore or .cursorignore. Also exclude common dependency, build, cache, and VCS directories (e.g. node_modules, .git, dist, build, __pycache__, .venv, coverage, .next, .nuxt) and any other project-specific directories that are clearly generated or tooling-only.")
Generate todo items for each directory, organized by depth level:
Level 0: / (root)
Level 1: /src, /docs, /tests
Level 2: /src/components, /src/utils, /docs/api
...
IMPORTANT: Generate parent levels before child levels to ensure parent references are valid.
For each directory:
When AGENTS.md already exists:
<!-- MANUAL --> preserved)After generation, run validation checks:
| Check | How to Verify | Corrective Action |
| ------------------------- | --------------------------------------------------------- | ------------------------- |
| Parent references resolve | Read each AGENTS.md, check <!-- Parent: --> path exists | Fix path or remove orphan |
| No orphaned AGENTS.md | Compare AGENTS.md locations to directory structure | Delete orphaned files |
| Completeness | List all directories, check for AGENTS.md | Generate missing files |
| Timestamps current | Check <!-- Generated: --> dates | Regenerate outdated files |
Validation script pattern:
# Find all AGENTS.md files
find . -name "AGENTS.md" -type f
# Check parent references
grep -r "<!-- Parent:" --include="AGENTS.md" .
| Task | Agent |
| ------------------ | ---------------- |
| Directory mapping | explore |
| File analysis | generalPurpose |
| Content generation | generalPurpose |
| AGENTS.md writes | generalPurpose |
When encountering empty or near-empty directories:
| Condition | Action | | ----------------------------------------- | ------------------------------------------------------- | | No files, no subdirectories | Skip - do not create AGENTS.md | | No files, has subdirectories | Create minimal AGENTS.md with subdirectory listing only | | Has only generated files (.min.js,.map) | Skip or minimal AGENTS.md | | Has only config files | Create AGENTS.md describing configuration purpose |
Example minimal AGENTS.md for directory-only containers:
<!-- Parent: ../AGENTS.md -->
# {Directory Name}
## Purpose
Container directory for organizing related modules.
## Subdirectories
| Directory | Purpose |
| --------- | ------------------------------------ |
| `subdir/` | Description (see `subdir/AGENTS.md`) |
<!-- Generated: 2024-01-15 | Updated: 2024-01-15 -->
# my-project
## Purpose
A web application for managing user tasks with real-time collaboration features.
## Key Files
| File | Description |
| --------------- | -------------------------------- |
| `package.json` | Project dependencies and scripts |
| `tsconfig.json` | TypeScript configuration |
| `.env.example` | Environment variable template |
## Subdirectories
| Directory | Purpose |
| --------- | --------------------------------------------- |
| `src/` | Application source code (see `src/AGENTS.md`) |
| `docs/` | Documentation (see `docs/AGENTS.md`) |
| `tests/` | Test suites (see `tests/AGENTS.md`) |
## For AI Agents
### Working In This Directory
- Always install dependencies after modifying the project manifest
- Use TypeScript strict mode
- Follow ESLint rules
### Testing Requirements
- Run tests before committing
- Ensure >80% coverage
### Common Patterns
- Use barrel exports (index.ts)
- Prefer functional components
## Dependencies
### External
- React 18.x - UI framework
- TypeScript 5.x - Type safety
- Vite - Build tool
<!-- MANUAL: Custom project notes can be added below -->
<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2024-01-15 | Updated: 2024-01-15 -->
# components
## Purpose
Reusable React components organized by feature and complexity.
## Key Files
| File | Description |
| ------------ | -------------------------------- |
| `index.ts` | Barrel export for all components |
| `Button.tsx` | Primary button component |
| `Modal.tsx` | Modal dialog component |
## Subdirectories
| Directory | Purpose |
| --------- | ----------------------------------------------- |
| `forms/` | Form-related components (see `forms/AGENTS.md`) |
| `layout/` | Layout components (see `layout/AGENTS.md`) |
## For AI Agents
### Working In This Directory
- Each component has its own file
- Use CSS modules for styling
- Export via index.ts
### Testing Requirements
- Unit tests in `__tests__/` subdirectory
- Use React Testing Library
### Common Patterns
- Props interfaces defined above component
- Use forwardRef for DOM-exposing components
## Dependencies
### Internal
- `src/hooks/` - Custom hooks used by components
- `src/utils/` - Utility functions
### External
- `clsx` - Conditional class names
- `lucide-react` - Icons
<!-- MANUAL: -->
When running on an existing codebase with AGENTS.md files:
development
# Code Review Instructions ## Introduction You are a senior software engineer. ## Exploring the changes Run `git --no-pager diff origin/main...HEAD` to identify the differences between this branch and the main branch. Perform any other necessary git diffs to explore the changes made in this branch. ## Rules: - You absolutely must not edit any of the code. - Investigate any potential issue you find, to validate whether it actually is an issue. ## Code Review Checklist (internal) Work thro
testing
Iterative planning consensus loop. Orchestrates Planner, Architect, and Critic agents in rounds until the plan is approved or max iterations reached. Use for complex tasks that need a validated plan before implementation.
development
Audit a repository's Cursor configuration or evaluate whether a specific artefact (rule, skill, command, subagent) is correctly placed. Use when optimising the repo for Cursor, improving indexing, adding or assessing rules/skills, or deciding where information should live.
development
Generate a holistic product vision from Linear tickets. Pulls backlog, to-do, and in-progress tickets and synthesises them into a status-agnostic overview. Use when starting a new feature to understand the bigger picture, onboarding to the project, or when AI needs context on long-term goals. Supports refreshing existing masterplans with latest data.