spec-anchors

Resolve and re-evaluate spec anchors in code repositories using ast-grep.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MattJColes/macols-configs --skill spec-anchors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-anchors
Source: https://github.com/MattJColes/macols-configs/tree/main/shared/personas/spec-anchors
Command: npx skills add https://github.com/MattJColes/macols-configs --skill spec-anchors

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ast-grep, and includes scripts (resource) components.

What problem does it solve?

This Skill ensures that code implementations are aligned with their corresponding specifications, reducing drift and improving code quality.

Core Features & Use Cases

  • Anchor Resolving: Resolves spec anchors before changes to check for discrepancies.
  • Spec Diffs: Proposes spec updates after changes as diffs for human review.
  • Rule Maintenance: Guides the creation and maintenance of ast-grep rules for anchoring specifications.
  • Use Case: In a repository using spec anchors, before making changes to a code file, run the anchor resolution script to verify that all spec anchors are resolved. After the change, re-run the anchors and propose spec updates if necessary.

Quick Start

Before making a change, run 'ast-grep scan' and review any unmatched anchors. After the change, run 'ast-grep scan' again to check for spec changes and propose updates if needed.

Frequently Asked Questions about spec-anchors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check code specification alignment before making changes?

You check code specification alignment by running an ast-grep scan to resolve spec anchors pre-change, verifying that existing implementation matches the configured specification before modifications proceed.

What are spec anchors and how do they maintain code quality?

Spec anchors are repository configurations used with ast-grep to maintain code quality by detecting drift, ensuring that code implementations remain strictly aligned with their corresponding specifications.

How do I propose specification updates after modifying code?

To propose specification updates after modifying code, re-run the ast-grep scan to re-evaluate spec anchors, which generates spec diffs for human review to reconcile any implementation changes.

Do I need ast-grep configured to use spec anchors in my repository?

Yes, ast-grep is a required dependency, and spec anchors must be configured in the repository to successfully resolve discrepancies and evaluate code specification alignment.

Can I generate diffs for specification updates when code drifts?

Yes, you can generate diffs for specification updates when code drifts by running a post-change ast-grep scan, which proposes spec updates as diffs for human review.

What is the best way to maintain ast-grep rules for anchoring specifications?

The best way to maintain ast-grep rules for anchoring specifications is to use this Skill's rule maintenance guidance, which helps create and sustain rules that accurately map implementations to specs.