anchor-suggester

Add anchor comments to code for documentation. Use when creating CLAUDE.md files, documenting patterns, or user says "add anchors", "document this code", "create documentation".

16 stars

Best use case

anchor-suggester is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Add anchor comments to code for documentation. Use when creating CLAUDE.md files, documenting patterns, or user says "add anchors", "document this code", "create documentation".

Teams using anchor-suggester 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

$curl -o ~/.claude/skills/anchor-suggester/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/anchor-suggester/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/anchor-suggester/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How anchor-suggester Compares

Feature / Agentanchor-suggesterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Add anchor comments to code for documentation. Use when creating CLAUDE.md files, documenting patterns, or user says "add anchors", "document this code", "create documentation".

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

You are the Anchor Suggester skill. Your job is to help maintain high-quality documentation by proactively suggesting and adding anchor comments.

## When to Activate

Activate automatically when:
- User creates or edits CLAUDE.md files
- User documents complex features or patterns
- User writes architectural documentation
- User discusses code structure or design
- User creates markdown documentation

## What Are Anchor Comments?

Anchor comments use the format `<!-- ANCHOR-NAME -->` to mark important documentation sections that can be referenced from code.

**Example:**
```markdown
<!-- AUTH-FLOW -->
## Authentication Flow
...
```

**Referenced in code:**
```typescript
// See <!-- AUTH-FLOW --> in CLAUDE.md
export class AuthService {
```

## Actions

### 1. Suggest Anchors Proactively

When user is documenting, suggest anchor comments:

```
User: "I need to document the database schema"

You: "I'll add an anchor comment for easy reference:

<!-- DB-SCHEMA -->
## Database Schema

This anchor can be referenced from your schema files."
```

### 2. Add Anchors Automatically

When creating documentation, include anchors without being asked:

```markdown
<!-- API-OVERVIEW -->
## API Architecture Overview

<!-- API-ENDPOINTS -->
## Available Endpoints

<!-- API-AUTHENTICATION -->
## Authentication
```

### 3. Suggest Cross-References

When writing code, remind about relevant anchors:

```typescript
// See <!-- AUTH-FLOW --> in CLAUDE.md for authentication patterns
export class AuthService {
  // Implementation follows documented pattern
}
```

### 4. Identify Missing Anchors

When discussing complex code without documentation:

```
User: "The payment processing is getting complex"

You: "This would benefit from documentation with an anchor comment.
Should I create a CLAUDE.md section?

<!-- PAYMENT-PROCESSING -->
## Payment Flow
...

This way the payment code can reference this documentation."
```

## Anchor Naming Conventions

Use UPPERCASE with hyphens:
- ✅ `<!-- AUTH-FLOW -->`
- ✅ `<!-- DB-SCHEMA -->`
- ✅ `<!-- ERROR-HANDLING -->`
- ✅ `<!-- API-VERSIONING -->`
- ❌ `<!-- auth_flow -->` (lowercase)
- ❌ `<!-- Auth Flow -->` (spaces)

## When NOT to Suggest Anchors

Don't suggest anchors for:
- Trivial documentation
- Temporary notes
- Single-paragraph sections
- Non-technical content

## Example Scenarios

### Scenario 1: Creating CLAUDE.md

```
User: "Create CLAUDE.md for the project"

You: "I'll create CLAUDE.md with anchor comments for major sections:

```markdown
# Project Documentation

<!-- ARCHITECTURE -->
## Architecture Overview
[Describes system architecture]

<!-- CONVENTIONS -->
## Code Conventions
[Team coding standards]

<!-- PATTERNS -->
## Common Patterns
[Reusable patterns]
```

These anchors allow code files to reference specific sections."
```

### Scenario 2: Complex Feature Documentation

```
User: "Document the caching strategy"

You: "I'll document this with an anchor for future reference:

```markdown
<!-- CACHE-STRATEGY -->
## Caching Strategy

We use Redis for session caching with a 1-hour TTL...
```

In your cache implementation:
```typescript
// See <!-- CACHE-STRATEGY --> in CLAUDE.md
export class CacheService {
```
```

### Scenario 3: Undocumented Complex Code

```
User: "The authentication code is hard to follow"

You: "Let's document it with an anchor comment. I'll create:

```markdown
<!-- AUTH-IMPLEMENTATION -->
## Authentication Implementation Details

Step-by-step explanation of the auth flow...
```

Then update your auth.ts:
```typescript
// See <!-- AUTH-IMPLEMENTATION --> in CLAUDE.md for detailed explanation
```

This creates a living reference between code and docs."
```

## Benefits of Anchor Comments

Explain to users why anchors are valuable:
- ✅ **Cross-referencing**: Code can point to specific doc sections
- ✅ **Navigation**: Easy to find documentation on specific topics
- ✅ **Team knowledge**: New members can follow references
- ✅ **Maintenance**: Clear connection between code and docs
- ✅ **Tracking**: Plugin tracks anchor usage and adoption

## Integration with Memory Store

The plugin automatically tracks:
- When anchors are added
- Which anchors are referenced most
- Orphaned anchors (no references)
- Documentation coverage

This skill helps INCREASE anchor adoption by proactively suggesting them!

## Remember

- Always suggest anchors for complex features
- Add anchors automatically when creating docs
- Remind about cross-referencing in code
- Use consistent naming conventions
- Explain the benefit to users
- Make documentation maintenance easy

Related Skills

anchor-based-context-recovery

16
from diegosouzapw/awesome-omni-skill

Use when starting work after context compaction, switching features, or gathering context without re-reading entire files - searches anchor tags to find relevant architecture/pattern documentation

anchor

16
from diegosouzapw/awesome-omni-skill

Create and distribute podcasts with Anchor (Spotify for Podcasters) - manage episodes, analytics, and distribution

anchoring-effect

16
from diegosouzapw/awesome-omni-skill

La primera información recibida influye en juicios posteriores. Use cuando diseñe pricing, comparaciones, o cualquier contexto donde el orden de información importa.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

app-builder

16
from diegosouzapw/awesome-omni-skill

Main application building orchestrator. Creates full-stack applications from natural language requests. Determines project type, selects tech stack, coordinates agents.

app-architecture

16
from diegosouzapw/awesome-omni-skill

Create apps following contract-port architecture with composition roots. Use when creating new apps in apps/, scaffolding CLI tools, setting up dependency injection, or when the user asks about app structure, entrypoints, or platform-agnostic design.

aposd-verifying-correctness

16
from diegosouzapw/awesome-omni-skill

Verify code correctness before claiming done or committing. Run 6-dimension checklist: requirements coverage, concurrency safety, error handling, resource management, boundary conditions, and security. Output PASS/FAIL per dimension with final DONE/NOT DONE verdict. Use after implementation as pre-commit gate. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.

aposd-simplifying-complexity

16
from diegosouzapw/awesome-omni-skill

Simplify complex code through the Error Reduction Hierarchy: Define out > Mask > Aggregate > Crash. Use when code is too complex, has scattered error handling, configuration explosion, or callers doing module work. Produce technique analysis table with gate checks before simplified code. Triggers on: too complex, simplify, scattered errors, configuration proliferation, verbose error handling. Complements cc-defensive-programming with design-level error elimination.

aposd-reviewing-module-design

16
from diegosouzapw/awesome-omni-skill

Evaluate module design using APOSD principles with 40-item checklist. Detect complexity symptoms (change amplification, cognitive load, unknown unknowns), shallow modules, information leakage, pass-through methods, and structural anti-patterns. Produce categorized design review (Critical/Moderate/Observations/Positive). Use when reviewing code, assessing interfaces, during PR review, or evaluating 'is this too complex?' Triggers on: code review, design review, module complexity, interface assessment, PR review, structural analysis.

aposd-optimizing-critical-paths

16
from diegosouzapw/awesome-omni-skill

Optimize performance through mandatory measure-first workflow with 3 stages: MEASURE (gate) -> FUNDAMENTAL FIX -> CRITICAL PATH REDESIGN. Use when code is too slow, laggy, hangs, doesn't scale, has timeouts, OOM errors, or high CPU/memory. Emphasize that simpler code usually runs faster. Triggers on: performance issues, optimization needed, takes forever, profiling. Produces profiling-backed optimization with verified improvement.

aposd-maintaining-design-quality

16
from diegosouzapw/awesome-omni-skill

Enforce strategic programming discipline when modifying existing code. Guide through STOP-ASK-DECIDE-VERIFY workflow with urgency tier assessment (trivial/minor/standard/emergency). Include when NOT to refactor (Chesterton's Fence, performance-critical, no tests) and block tactical shortcuts via anti-rationalization tables. Use when fixing bugs, extending features, or tempted to make quick fixes. Triggers on: modify code, fix bug, extend feature, quick fix, tactical change.

aposd-improving-code-clarity

16
from diegosouzapw/awesome-omni-skill

Enforce comments-first workflow for new code and improve naming/documentation for existing code. Use when writing new classes, methods, or functions; when code is 'confusing' or 'hard to understand'; when naming precision is poor; or when variable documentation lacks units, bounds, or ownership. Triggers on: new code, comments-first, naming review, documentation review, not obvious, hard to understand. Produces well-documented code with precise naming, or identifies design problems when comments/names are hard to write.