Source profileQuality 92/100Review permissions

humansys/raise/packages/raise-cli/src/raise_cli/skills_base/rai-architecture-review/SKILL.md

rai-architecture-review

Evaluate design proportionality using Beck's four rules. Use after implementation.

Source repository stars
71
Declared platforms
0
Static risk flags
2
Last source update
2026-08-22
Source checked
2026-08-25

Decision brief

What it does: where it fits

Evaluate design proportionality using Beck's four rules. Use after implementation.

Best for

  • Evaluate whether code is necessary and proportional using Beck's four rules of simple design. Core question: "Could we achieve the same outcome with less?"

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/humansys/raise --skill "packages/raise-cli/src/raise_cli/skills_base/rai-architecture-review"
Safe inspection promptEditorial

Inspect the Agent Skill "rai-architecture-review" from https://github.com/humansys/raise/blob/88a77d6e4065e3c8bdbae9be4aff5b84e6a7a5eb/packages/raise-cli/src/raise_cli/skills_base/rai-architecture-review/SKILL.md at commit 88a77d6e4065e3c8bdbae9be4aff5b84e6a7a5eb. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Step 1: Load Design Context & Patterns

    Before reviewing code, load what the design intended and what the codebase has learned:

    Code orientation: Load SA-ranked code symbols for the current branch:Read the design doc (design.md or scope.md) — what was the intended approach?Query the knowledge graph for patterns in affected modules:
  2. 02

    Step 2: Identify Scope and Changed Files

    Detect the project language and filter by appropriate extensions:

    Check .raise/manifest.yaml for project.language or project.projecttypeFallback: Scan extensions of changed files and pick the dominant languageDetect the project language and filter by appropriate extensions:
  3. 03

    Step 3: Necessity Audit (YAGNI — Beck Rule 4)

    When a heuristic triggers, check: "Does the design doc justify this?" If yes, note as Observation.

    When a heuristic triggers, check: "Does the design doc justify this?" If yes, note as Observation.
  4. 04

    Step 4: Proportionality Audit (KISS — Beck Rules 2+4)

    Review the “Step 4: Proportionality Audit (KISS — Beck Rules 2+4)” section in the pinned source before continuing.

    Review and apply the “Step 4: Proportionality Audit (KISS — Beck Rules 2+4)” source section.
  5. 05

    Step 5: Duplication & Responsibility (Beck Rules 2-3)

    Review the “Step 5: Duplication & Responsibility (Beck Rules 2-3)” section in the pinned source before continuing.

    Review and apply the “Step 5: Duplication & Responsibility (Beck Rules 2-3)” source section.

Permission review

Static risk signals and limitations

Runs scripts

medium · line 64

The documentation asks the agent to run terminal commands or scripts.

git diff --name-only $(git merge-base HEAD <parent-branch>)..HEAD -- '<extensions>'

Runs scripts

medium · line 66

The documentation asks the agent to run terminal commands or scripts.

git diff --name-only $(git merge-base HEAD <dev-branch>)..HEAD -- '<extensions>'

Reads files

low · line 75

The documentation asks the agent to read local files, directories, or repositories.

Read every changed file and the design doc. You cannot judge proportionality without intent context.

Reads files

low · line 121

The documentation asks the agent to read local files, directories, or repositories.

" 2>/dev/null || echo '⚠ Could not read hotspots file'

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score92/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars71SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
humansys/raise
Skill path
packages/raise-cli/src/raise_cli/skills_base/rai-architecture-review/SKILL.md
Commit
88a77d6e4065e3c8bdbae9be4aff5b84e6a7a5eb
License
Apache-2.0
Collected
2026-08-25
Default branch
main
View the original SKILL.md

Architecture Review

Purpose

Evaluate whether code is necessary and proportional using Beck's four rules of simple design. Core question: "Could we achieve the same outcome with less?"

Mastery Levels (ShuHaRi)

  • Shu: Apply all heuristics systematically, explain each finding
  • Ha: Focus on highest-signal heuristics for the scope, skip low-risk areas
  • Ri: Pattern-match to known anti-patterns, minimal ceremony

Context

ConditionAction
After /rai-story-implementRun with story scope
After last story in epicRun with epic scope
After /rai-bugfix-planRun with bugfix scope — input is analysis.md + archivos en puntos de cambio (no git diff: no hay código escrito aún)
Accumulated complexity feels disproportionateRun on-demand

Inputs: Scope (story, epic, or bugfix), design doc, changed files from git diff (story/epic) or analysis.md + files at change points (bugfix).

Steps

Step 1: Load Design Context & Patterns

Before reviewing code, load what the design intended and what the codebase has learned:

  1. Code orientation: Load SA-ranked code symbols for the current branch:

    rai session context -s code_context -p .
    

    Returns ~20 symbols ranked by structural proximity to active work modules. Empty result is valid. Use these as starting points — not exhaustive scope.

  2. Read the design doc (design.md or scope.md) — what was the intended approach?

  3. Query the knowledge graph for patterns in affected modules:

    Use raise_graph_query MCP tool with cwd="{project_or_worktree_path}", query="patterns for {affected_modules}". If MCP tools are not available, fall back to: rai graph query "patterns for {affected_modules}" --types pattern

    Use raise_pattern_query MCP tool with keywords="{module_keywords}", cwd="{project_or_worktree_path}". If MCP tools are not available, fall back to: rai graph query "{module_keywords}" --types pattern

  4. Load established patterns (PAT-E-*) — these are proven solutions. Deviations need justification.

JIT: For deeper code exploration beyond the orientation map, query the graph directly:

rai graph query "symbol_name" --types symbol --limit 10
rai graph query "module_name" --module mod-raise-cli--session
rai graph query "callers of function_name" --types symbol

Use --file path/to/file.py to scope results to a specific file.

This context informs every subsequent step: you can't judge proportionality without knowing intent, and you can't catch regressions without knowing established patterns.

Step 2: Identify Scope and Changed Files

Detect the project language and filter by appropriate extensions:

  1. Check .raise/manifest.yaml for project.language or project.project_type
  2. Fallback: Scan extensions of changed files and pick the dominant language
# Story scope: files changed vs parent branch
git diff --name-only $(git merge-base HEAD <parent-branch>)..HEAD -- '<extensions>'
# Epic scope: all files changed vs development branch
git diff --name-only $(git merge-base HEAD <dev-branch>)..HEAD -- '<extensions>'
# Bugfix scope: no git diff — read analysis.md to identify the files at change points
# then read those files directly

Replace <extensions> with language-appropriate patterns (e.g., '*.py' '*.pyi' for Python, '*.ts' '*.tsx' for TypeScript, '*.cs' for C#).

Bugfix scope: No code has been written yet. Load work/bugs/{issue_key}/analysis.md, extract the files identified as change points, and read them. The question is: "Is the proposed fix approach proportional to the problem?"

Read every changed file and the design doc. You cannot judge proportionality without intent context.

Step 3: Necessity Audit (YAGNI — Beck Rule 4)

#HeuristicRed Flag
H1Single ImplementationProtocol/ABC with exactly one concrete implementation, no documented consumer
H2Wrapper Without LogicClass delegates all work without adding behavior
H3Unused ParametersParameters accepted but never used in function body
H4Test-Only ConsumersPublic function/class used exclusively by test code
H5Dead ExportsPublic API includes names no consumer imports (e.g., __all__ in Python, export in TS, public in C#)

When a heuristic triggers, check: "Does the design doc justify this?" If yes, note as Observation.

Step 4: Proportionality Audit (KISS — Beck Rules 2+4)

#HeuristicRed Flag
H6Indirection Depth>2 layers of delegation for a simple operation
H7Abstraction-to-LOC RatioMore scaffolding than logic
H8Configuration Over ConventionConfigurable with only one valid value in practice

Step 5: Duplication & Responsibility (Beck Rules 2-3)

#HeuristicRed Flag
H9Semantic DuplicationSame concept expressed differently in multiple places
H10Pattern DuplicationSame structural problem solved differently across modules
H11Change Reason CountModule changes for >1 unrelated reason
H12Import Fan-InFile imports from 5+ distinct packages for one function

Step 6: Agent-Authored Drift Audit

# Re-read manifest vars (PAT-129)
_CFG=$(rai manifest env)
DRIFT_CATALOG=$(echo "$_CFG" | python3 -c "import json,sys; print(json.load(sys.stdin).get('governance',{}).get('drift_catalog',''))")
DRIFT_HOTSPOTS=$(echo "$_CFG" | python3 -c "import json,sys; print(json.load(sys.stdin).get('governance',{}).get('drift_hotspots',''))")

# tier-3: print top-10 hotspot module ranks for cross-reference with changed modules (skipped if key absent)
if [ -n "$DRIFT_HOTSPOTS" ]; then
  python3 -c "
import json
hs = json.load(open('$DRIFT_HOTSPOTS'))
for e in hs.get('ranked_modules', [])[:10]:
    print(f\"  rank={e['rank']} id={e['id']} signals={e.get('signal_count','?')}\")
" 2>/dev/null || echo '⚠ Could not read hotspots file'
fi

Check for agent-specific drift patterns at both story and epic scope. If $DRIFT_CATALOG is declared in manifest, reference it §1 for full definitions — do not copy inline. If absent, use the inline AG1–AG6 table below as the sole reference (tier-3: silent skip). If $DRIFT_HOTSPOTS output was printed above, note which changed modules (if any) match top-ranked entries.

#HeuristicSignal
AG1Authorization fan-outAuth-related changes touching ≥3 downstream modules without a consolidating aggregator
AG2Clone amplificationDuplicate logic blocks in ≥2 new locations relative to surrounding modules
AG3Hallucinated-API residueSymbol references that don't resolve; persistent across ≥2 commits
AG4Context-window planningFan-out of modified set has orphan edges — modules touched but not reconciled
AG5Vulnerability densityCWE-class patterns in agent-authored hunks (auth, injection, secrets)
AG6Over-specificationConditionals keyed on literal constants from prompt examples; re-implementation of existing capability

"No agent-authored drift detected" is always valid — do not invent findings.

Migration integrity check — runs once for every Alembic configuration whose configured script_location/versions/ contains a changed migration. Preserve the changed-path → configuration association: hybrid repositories may require more than one check.

BASE=$(git merge-base HEAD <parent-branch>)
mapfile -d '' CHANGED_FILES < <(git diff --name-only -z "$BASE"..HEAD)
declare -A VERIFIED_ROOTS=()

while IFS= read -r -d '' CONFIG; do
  CONFIG=${CONFIG#./}
  SCRIPT_ROOT=$(
    python3 - "$CONFIG" "$PWD" <<'PY'
from configparser import ConfigParser
from pathlib import Path
import sys

config = Path(sys.argv[1]).resolve()
repo = Path(sys.argv[2]).resolve()
parser = ConfigParser(defaults={"here": str(config.parent)})
parser.read(config, encoding="utf-8")
location = parser.get("alembic", "script_location", fallback="").strip()
if location and ":" not in location:
    root = Path(location)
    root = root if root.is_absolute() else config.parent / root
    try:
        print(root.resolve().relative_to(repo))
    except ValueError:
        pass
PY
  )
  [ -n "$SCRIPT_ROOT" ] || continue

  for CHANGED in "${CHANGED_FILES[@]}"; do
    case "$CHANGED" in
      "$SCRIPT_ROOT"/versions/*.py)
        CONFIG_DIR=$(dirname "$CONFIG")
        CONFIG_NAME=$(basename "$CONFIG")
        (cd "$CONFIG_DIR" && alembic -c "$CONFIG_NAME" heads)
        VERIFIED_ROOTS["$SCRIPT_ROOT"]=1
        break
        ;;
    esac
  done
done < <(find . -type f -name alembic.ini \
  -not -path './.git/*' -not -path './.venv/*' -print0)

# Any changed versions file not associated with a discovered configuration is
# an explicit unverified outcome, never a silent success.
for CHANGED in "${CHANGED_FILES[@]}"; do
  case "$CHANGED" in
    versions/*.py|*/versions/*.py)
      VERIFIED=0
      for SCRIPT_ROOT in "${!VERIFIED_ROOTS[@]}"; do
        case "$CHANGED" in
          "$SCRIPT_ROOT"/versions/*.py) VERIFIED=1; break ;;
        esac
      done
      if [ "$VERIFIED" -eq 0 ]; then
        echo "⚠ Migration '$CHANGED' changed but no applicable Alembic configuration was found; migration integrity cannot be verified."
      fi
      ;;
  esac
done
ResultAction
0 migration files changedSkip silently
1 head✓ Continue
>1 headsBLOCK — create merge migration before proceeding
Changed migration has no applicable configRecord the warning in the review output; do not claim migration integrity was verified

Step 7: Portfolio Impact Check

Using the modules already identified in Step 6 drift analysis, cross-reference against the portfolio cartridge to detect concurrent initiatives that may conflict.

For each touched module, run:

rai graph context mod-{module} --format json 2>/dev/null || true

Extract the portfolio_impact field from the JSON output. Handle each case:

ResultAction
change_mode: breaking initiative in same moduleAdd ## Portfolio Impact section to AR report with severity HIGH; list initiative key, module, and nature of conflict
change_mode: evolutionary initiative in same moduleMention as informative context in the AR report; do NOT block
Command fails or returns no portfolio nodesPrint advisory: portfolio cartridge no disponible — run \rai portfolio cartridge generate``; continue (fail-open, do NOT block the AR)
No concurrent initiativesNote: "No concurrent portfolio initiatives detected"

Fail-open rule: A missing or unavailable portfolio cartridge must never block the AR. This check is informative, not a gate.

Step 8: Systemic Audit (Epic Scope Only)

Skip for story scope. Cross-module heuristics:

#HeuristicRed Flag
H13Orphaned AbstractionsProtocol from early story still has ≤1 implementor at epic end
H14Coupling DirectionStable core imports from volatile/new module
H15Cyclic DependenciesCircular import paths between modules
H16Shotgun SurgeryOne logical change touches 5+ files across 3+ directories

Step 9: Lean Compliance Audit

Verify the implementation follows the lean principles established in design:

#CheckRed Flag
L1MVP deliveredImplementation exceeds what design specified — gold-plating
L2Design followedImplementation diverges from design without documented ADR
L3Pattern complianceKnown patterns (PAT-E-*) exist for this problem but weren't used
L4No speculative codeFeatures built for hypothetical future requirements (YAGNI)
L5Simplest approachA simpler implementation would achieve the same outcome (KISS)

For each L-finding: cite the pattern or design decision that was violated.

Step 10: Present Findings

## Architecture Review: {id} (scope: {story|epic})

### Critical (fix before merge)
### Recommended (simplify before next cycle)
### Questions (require human judgment)
### Observations (patterns noted)
### Verdict
- [ ] PASS / PASS WITH QUESTIONS / SIMPLIFY

Every finding: specific file:line, heuristic ID, proportionality concern, concrete simplification.

Step 11: Write Review Artifact

The bugfix and story pipelines validate this exact file before the phase can advance — writing it is not optional in those scopes (RAISE-16030).

ScopeOutput path
bugfixwork/bugs/{issue_key}/ar.md
storywork/epics/e{N}-{name}/stories/s{N}.{M}-ar.md
epicOn-demand — no pipeline-enforced artifact; save only if requested

Use raise_docs_write MCP tool with doc_type="architecture-review", title="{id}: architecture review", content="[Step 10 findings, verbatim]", output_path="{path from table above}", cwd="{project_or_worktree_path}". If MCP tools are not available, fall back to:

rai docs write architecture-review \
  --title "{id}: architecture review" \
  --stdin \
  --output-path {path from table above} << 'EOF'
[Step 10 findings, verbatim]
EOF
git add {path from table above}

Output

ItemDestination
Review findingswork/bugs/{issue_key}/ar.md (bugfix) or work/epics/e{N}-{name}/stories/s{N}.{M}-ar.md (story); presented inline, saved if requested (epic)
VerdictPASS, PASS WITH QUESTIONS, or SIMPLIFY
Next/rai-story-review (story) or /rai-epic-close (epic)

Quality Checklist

  • Design doc and graph patterns loaded before reviewing (Step 1)
  • Project language detected before filtering files
  • All changed files for detected language read before reviewing
  • Every finding cites specific file:line and heuristic ID (AG1-AG6, H1-H16, L1-L5)
  • Portfolio Impact Check run; breaking conflicts flagged HIGH or cartridge advisory emitted (Step 7)
  • Lean compliance verified: MVP, pattern adherence, no gold-plating
  • Known patterns (PAT-E-*) checked against implementation
  • Questions ratio >30% of findings (humility signal)
  • "No issues found" is a valid outcome — do not invent findings

References

  • Evidence: work/research/architecture-review/
  • Complements: /rai-quality-review (correctness), /rai-story-review (retrospective)
  • Framework: Beck's Simple Design Rules, Fowler's Code Smells, Silva et al. (ESEM 2024)

Frequently asked questions

What to verify before installation and use

What does the rai-architecture-review source document cover?

Evaluate design proportionality using Beck's four rules. Use after implementation.

How do I install rai-architecture-review?

The source record exposes this install command: npx skills add https://github.com/humansys/raise --skill "packages/raise-cli/src/raise_cli/skills_base/rai-architecture-review". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged exec-script, read-files in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 10045,511

coreyhaines31/marketingskills

ab-testing

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program

Computed 10045,511

coreyhaines31/marketingskills

churn-prevention

When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' 'involuntary churn,' 'people keep canceling,' 'churn rate is too high,' 'how do I keep users,' or 'customers are leaving.' Use this whenever someone is losing subscribers o

Computed 10014,671

prowler-cloud/prowler

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing index usage statistics, reindexing, dropping indexes, or working with partitioned table indexes. Also trigger when discussing index strategies, partial indexes, or index maintenance

Computed 1008

narrative-io/narrative-skills-marketplace

design-analysis

Translate a fuzzy analytical question into a rigorous investigation plan. Interrogates the ask, grounds the plan in the available data dictionary, applies analytical best practices, and produces a structured brief of query specifications for a downstream query-writing skill. Plans, does not write SQL. Use when: "why did X drop", "is there a relationship between A and B", "who are our highest-value customers", "what's driving the change in Y", "investigate this trend", "design an analysis for", "