Skip to content
cccskills
FreePublished on GitHub

ccg-annotate

Author, refine, and verify CCG annotations such as @intent, @domainRule, @sideEffect, @mutates, @index, and @see. Use when adding business meaning to code, improving annotation-aware code or documentation retrieval, fixing annotation lint findings, checking supported tag syntax, or documenting operational contracts. Do not use for generated Markdown editing or annotations that merely restate symbol names.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17 stars(GitHub 17 + cccskills 0)

Run score Not tested

See how to install

Files included (2)

  • SKILL.md7.3 KB
  • references/annotation-reference.md3.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

ccg-annotate — Annotation Workflow

Add structured business metadata to source comments so graph search and generated documentation can retrieve intent and operational contracts.

Retrieval-Aware Tag Selection

Annotations are retrieval features, but they must stay truthful. Use the specific tag that matches the code's role instead of stuffing keywords into @intent.

When you see thisAdd this
File/package/module should be found as one unit@index
Public function, handler, CLI command, service method, or UI workflow has a clear purpose@intent
Policy, constraint, operational rule, or false-positive/false-negative criterion matters@domainRule
DB/file/network/cache/log/process side effect exists@sideEffect
Receiver or argument object changes in memory@mutates
Caller-facing input/output contract matters@requires, @ensures
Related implementation must be followed, especially across namespaces@see

Good retrieval annotations include the words a developer or LLM would naturally use to ask for the code, while matching the implementation. For example, if a graph component focuses a resolved ccg:// node, say graph viewer, ccg ref, and node focus in the appropriate @index/@intent. Do not add unrelated terms just to raise score; broad terms make the wrong files rank higher.

Read references/annotation-reference.md before using less-common tags, aliases, multiline values, typed JSDoc/YARD forms, cross-namespace refs, or language-specific comment syntax.

Annotation Workflow

This is an agent skill workflow, not a ccg CLI subcommand. The agent reads and edits code directly.

Step 1: Pick targets

  • File path → that file only
  • Directory → all source files
  • Skip: vendor, dependencies, and generated code
  • Skip tests by default; include a test only when it is itself important domain-contract evidence

Step 2: Analyze each target

Read the code and determine:

  • What it does → first summary line
  • File/package discoverability → @index when the file itself is a useful search target
  • Why it exists → @intent for meaningful public/workflow entry points
  • Business or operational rules → @domainRule (must be specific)
  • Real side effects → @sideEffect
  • State changes → @mutates
  • Caller-facing contracts → @requires, @ensures when they matter

For cross-namespace behavior, explain the reason in the semantic tag and put the target in @see:

// @sideEffect records token validation audit in auth-svc.
// @see ccg://auth-svc/internal/audit/token_audit.go#RecordTokenAudit

Step 3: Write

  • Add comments directly above the declaration using the language's documentation-comment syntax
  • Preserve accurate human-authored context; update or remove stale, false, or duplicate tags when refinement is requested
  • Do not erase non-obvious rationale unless the code contradicts it; report such changes explicitly
  • Skip trivial functions (getters/setters, obvious one-line wrappers)
  • Do not add tags that do not match real behavior
  • Do not repeat the same keyword across tags unless each tag adds distinct evidence
  • Match the language of existing comments (Korean for Korean codebases, English for English)

Step 4: Report reindex requirement

Annotations enter the search index only at graph build time. An annotation written but not rebuilt is invisible to search — the most common way to conclude, wrongly, that "annotations don't work". Do not invoke ccg-build automatically. Report that reindexing is required and that the user must explicitly name ccg-build in a new request before graph refresh.

After an explicitly authorized refresh, representative changed symbols can be checked with get_annotation. Until then, report graph-backed verification as pending. The parser returns unknown-tag warnings to direct callers, but the current ingestion discards that warning list and ccg lint does not surface it. Treat the reference tag list as an allowlist; a green lint result alone does not prove an unknown tag was indexed.

Quality Example

❌ Bad annotation:

// @intent creates a user
func CreateUser(...) {}

WHAT only. Function name already tells you that.

✅ Good annotation:

// @intent register a normalized account for the onboarding flow
// @domainRule email must be unique across all tenants
// @sideEffect inserts the user and audit record, then sends a verification email
// @mutates input.NormalizedEmail
func CreateUser(input *SignupRequest) error { ... }

WHY + business rules + side effects. Code and documentation search become powerful.

Annotation Priority

Don't annotate everything. Prioritize:

  1. Tier 1: domain core (auth, payment, billing — business logic)
  2. Tier 2: frequently searched (entry points, public APIs)
  3. Tier 3: complex functions (high cognitive load)
  4. Skip: getters/setters, simple wrappers, generated code

Use ccg lint unannotated category and pick top-priority functions from there.

Retrieval Quality Checks

After adding annotations for a feature area, run a few natural-language retrieve/search probes that match how an LLM or engineer would ask:

ccg search "graph viewer ccg ref node focus"

For MCP/Web UI retrieval, use search + get_doc_content or Wiki search. If the expected file is missing, prefer improving the precise @index, @intent, @domainRule, or @see evidence on that file over changing global scoring.

Closing the Question Loop

When this skill was entered from the ccg skill's search failure path — a plain-language question that came back empty because no recorded reason answered it — the work is not done until that question succeeds:

  1. Annotate the area the question was about (Steps 1–3), writing the @intent/@domainRule in words that answer the question actually asked.
  2. Rebuild (Step 4). Without this the re-ask is guaranteed to fail again.
  3. Re-ask the original question, verbatim, through search, and confirm the answer now carries reason-matched hits (reason and matched_terms) pointing at the annotated area.

If the re-ask still comes back empty, the recorded reason and the question do not share vocabulary — revise the annotation's wording, not the search.

Completion

List annotated files and meaningful tags added or deliberately revised, report any existing rationale changed, confirm the rebuild ran, verify representative nodes with get_annotation, run retrieval probes for affected concepts, and report lint plus any unknown-tag risk or unrelated finding without claiming it was fixed. When the work started from a failed question, state the original question and what its re-ask returned.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

ccg

Free

Fast read-only code discovery with a bounded code-context-graph search and targeted source verification. Use when an ordinary positive lookup or explanation needs an entry point, recorded intent, known-path inventory, or direct relationship evidence. Do not use for absence, completeness, exhaustive inventory, deep flow or impact analysis, or graph writes; use ccg-search-verify for defensible negative claims, and require explicit invocation for ccg-analyze or ccg-build.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17Updated Aug 22, 2026

Explicit-only deep analysis of algorithms, feature pipelines, and code relationships with CCG impact radius, bounded flow tracing, callers/callees, git-diff risk, affected stored flows, and cross-namespace references. Use only when the user explicitly names the ccg-analyze skill in the current request. Do not invoke merely because a task asks about a flow, pipeline, impact, caller, or relationship.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17Updated Aug 22, 2026

code-context-graph — annotation system. AI-driven annotation workflow, tag reference, and annotation search.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17Updated Aug 22, 2026

Explicit-only graph ingestion for building, updating, migrating, and postprocessing code-context-graph graphs from source visible to the CCG runtime. Use only when the user explicitly names the ccg-build skill in the current request. Do not invoke merely because a graph is missing or stale, annotations need reindexing, or another workflow would benefit from a refresh.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17Updated Aug 22, 2026

code-context-graph — documentation generation, RAG indexing, and docs quality linting.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17Updated Aug 22, 2026

Generate, discover, read, and lint CCG documentation. Use when producing Markdown and Wiki snapshots, narrowing broad module questions with search, reading generated docs from configured content roots with get_doc_content, or diagnosing orphan, missing, stale, incomplete, contradiction, dead-ref, and drift findings. Do not use for direct source annotation authoring or exact call-graph analysis.

The English summary is being prepared. Showing the original description.

tae2089/code-context-graph17Updated Aug 22, 2026

See all skills by tae2089

Report a problem with this skill