Review incan source quality

From dannys-code-corner/incan · View interactive version

Review incan source quality is an AI agent skill from the GitHub repository dannys-code-corner/incan. Review touched Incan source for Python-quality readability, idiomatic Incan structure, dogfooding integrity, public API polish, and source-level anti-patterns. Use for `.incn` stdlib, examples, language-surface implementations, or when the user asks whether Incan code reads like well-written Python

How to use this skill

Skill file

Review Incan Source Quality

Purpose

/review-incan-source-quality is a report-only reviewer for touched .incn source.

The standard is not merely "has comments" or "passes tests". The standard is:

Own:

Do not own:

Output artifacts

Write a slice report at:

Do not write to the canonical .agents/state/review-report.md.

When the source-quality report has findings, also copy the scope and findings into the shared lightweight central snapshot folder outside individual repo worktrees under FINDINGS_ROOT. Resolve it once per review and record the absolute path in the slice report:

COMMON_GIT_DIR="$(git rev-parse --path-format=absolute --git-common-dir)"
WORKSPACE_ROOT="$(dirname "$(dirname "$COMMON_GIT_DIR")")"
FINDINGS_ROOT="${INCAN_REVIEW_FINDINGS_ROOT:-$WORKSPACE_ROOT/.incan-review-findings}"
mkdir -p "$FINDINGS_ROOT"

git-common-dir keeps the default stable when the review runs in a linked worktree. Set INCAN_REVIEW_FINDINGS_ROOT to use a different shared corpus location.

Use a deterministic, descriptive filename when possible:

Do not create a snapshot for clean reviews. The snapshot is raw corpus for later analysis, not canonical guidance.

Treat FINDINGS_ROOT as an append-only central corpus for local review work: create new snapshot files, but do not delete, overwrite, prune, or "clean up" existing snapshots unless the user explicitly asks for that exact maintenance.

Snapshot content is evidence, not a fix log. Preserve the original finding blocks verbatim, including severity, category, file path, line reference, and explanatory text. If the finding is fixed before the snapshot is written, keep the original finding as observed and add a separate Resolution note after it; do not replace the evidence with a resolved checklist item or a summary of the fix.

Review standard

Treat touched Incan source as user-facing language showcase code, especially under loaves/stdlib/, examples, fixtures that teach behavior, and RFC-backed language features.

Good Incan source should have:

Capability baseline to verify

Reviewers must assume the branch can use the current v0.2+v0.3 language and stdlib surface unless it proves otherwise. Do not accept Rust-shaped or pre-current scaffolding without evidence.

Before judging .incn source quality, read the generated feature inventory, current release notes, and relevant reference pages. At minimum check workspaces/docs-site/docs/language/reference/feature_inventory.md, workspaces/docs-site/docs/release_notes/0_2.md, workspaces/docs-site/docs/release_notes/0_3.md, and the detailed inventories in those release-note files. If the touched code claims a limitation, verify it against source, examples, tests, or a probe.

Baseline v0.2 surfaces to remember:

Current v0.3 surfaces to remember:

Flag stale source that:

Flag Incan source that has:

Workflow

  1. Derive scope from touched .incn files in the current worktree plus any .incn files named by the user.
  2. Read the generated feature inventory and current release-note inventories before style judgment. Use v0.2 as the minimum modern baseline and v0.3 as the active capability baseline.
  3. For stdlib or RFC-backed work, compare source shape against nearby established modules such as std.fs, std.io, std.collections, or the relevant domain module.
  4. Check whether the implementation claims or implies a current Incan limitation. If so, verify that the branch records local precedent, tests, or probe evidence for that limitation.
  5. Inspect declarations first: module docstring, public and private types, functions, methods, properties, aliases, partials, argument order, return shape, and examples.
  6. Inspect file layout next: whether public/external implementations are easy to find, whether internal helpers are grouped near their use, and whether section ordering lets a Python-oriented reader build context naturally.
  7. Inspect implementation helpers next: helper names, docstrings, control-flow readability, branch shape, conversion noise, and whether helpers clarify or obscure.
  8. Inspect comments/docstrings last as part of source quality, not as a separate docs-only pass. Short or non-descriptive docstrings are findings even when every declaration technically has one.
  9. For each finding, explain what a Pythonic/Incan-native version would make clearer. Do not demand style churn when the existing shape is already direct and readable.
  10. Stay report-only unless the user explicitly asks for fixes.
  11. If the report contains findings, create FINDINGS_ROOT if needed and write a new snapshot containing only the review source metadata, Scope, and Findings sections. Copy the finding blocks verbatim from .agents/state/review-report.incan-source-quality.md; do not generalize them into policy or rewrite them as fix summaries. Preserve exact file:line evidence when the report has it; if a finding is only file-level, make that explicit in the finding text. Do not overwrite an existing snapshot path; add a suffix if needed.

Slice report shape

Keep findings first. Only list clean surfaces when the clean call is useful because the file is a visible Incan surface or had prior risk.

# Review Slice Report

- role: incan-source-quality
- worker: <agent-id or stable label>
- status: in_progress | clean | blocked

## Scope
- assigned files:
  - loaves/stdlib/data/src/uuid.incn

## Findings

- [ ] warning | source-quality | Rust-shaped sentinel read | loaves/stdlib/data/src/uuid.incn:117
  The function initializes a placeholder byte and overwrites it from a match arm. A direct helper returning `Result[u8, UuidError]` would read like authored Incan rather than generated Rust-shaped control flow.

## Reviewed Clean Surfaces
- loaves/stdlib/system/src/fs/path.incn — used as style baseline

Finding severities:

If there are no findings, say so explicitly.

Findings snapshot shape

Only write this file when findings are present.

# Incan Source Quality Findings Snapshot

- source: PR #<number> / <branch-or-context>
- date: YYYY-MM-DD
- reviewer: review-incan-source-quality

## Scope
- assigned files:
  - loaves/stdlib/data/src/uuid.incn

## Findings
- [ ] warning | source-quality | Rust-shaped sentinel read | loaves/stdlib/data/src/uuid.incn:117
  The function initializes a placeholder byte and overwrites it from a match arm. A direct helper returning `Result[u8, UuidError]` would read like authored Incan rather than generated Rust-shaped control flow.

## Resolution
- <optional, only if this snapshot is written after a fix loop>
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.