Code annotate

From SteveGJones/ai-first-sdlc-practices · View interactive version

Code annotate is an AI agent skill from the GitHub repository SteveGJones/ai-first-sdlc-practices. Generate boilerplate `# implements:` annotation for a function based on the artefact ID, inserting it as the first line of the function body.

How to use this skill

Skill file

<!-- implements: DES-assured-skills-003 -->

Skill: code-annotate

Use this skill when adding implementation code that satisfies a REQ or DES. Generates the correct # implements: annotation, validates that the cited IDs exist in the registry, and inserts the annotation in a syntactically-correct place.

Inputs

Steps

  1. Verify the artefact exists. Read library/_ids.md; confirm <artefact-id> is declared.
  1. Detect the language. Python (#), JavaScript/TypeScript (//), Go (//), Rust (//). Default # if unknown.
  1. Determine the comment line. Choose the comment syntax matching the file extension.
  1. Insert the annotation. Place <comment-prefix> implements: <artefact-id> as the first line of the function body, immediately after the opening brace / : / func ... {.
  1. Confirm. Show the diff to the user.
  1. Run annotation_format_integrity on the file to verify the annotation parses correctly.

Annotation placement rules

<!-- implements: <DES-ID> --> and # implements: <DES-ID> annotations ALWAYS go on the implementing artefact:

NEVER place annotations:

The spec layer expresses obligation; the implementing artefact carries evidence. Crossing the layers blurs the audit trail.

Done criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.