gap-analysis

A command that checks an existing codebase against the engineering rules relevant to that project. It writes a GAPANALYSIS.md report showing what is present, missing, or needs migration.

In plain words
What is it for?
Use it to assess a project before development, review its current engineering setup, and plan missing work or migrations.
Why use it?
It avoids reporting requirements that do not apply, such as database or payment systems the project never needs. This gives developers a focused list of standards-related gaps.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alphaaiservice/cortex/gap-analysis
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,372 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.04372
Opus 5 $0.00021 $0.02186
Sonnet 5 $0.00008 $0.00874
Haiku 4.5 $0.00004 $0.00437

Measured yesterday against content hash ce4323974311, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gap-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/gap-analysis.md · 420 lines

How it starts

The opening of the file, as written. The whole thing — 420 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gap Analysis — Alpha AI Standards Compliance (Context-Aware)

Analyze project at: $ARGUMENTS (default: current directory)

Compare the existing codebase against ONLY the standards relevant to this project — NOT every standard in the book.

KEY PRINCIPLE: A project that doesn't need MongoDB should NOT be flagged for missing MongoDB. A project without payments should NOT be flagged for missing Razorpay. Only check what the project ACTUALLY requires.


Step 0: Detect Project Requirements

Before checking any standards, first understand WHAT this project needs.

0.1: Read Project Context

Gather requirements from these sources (check in order):

1. Read PRD.md or PRD_*.md (if exists) — most authoritative source of requirements
2. Read SPRINT_PLAN.md (if exists) — tells what features are planned
3. Read PROJECT_ANALYSIS.md (if exists, from /analyze-project)
4. Read README.md (if exists) — project description
5. Read CLAUDE.md (if exists) — project-specific standards
6. Quick scan of codebase (package.json, requirements.txt, docker-compose.yml)

0.2: Build Project Requirements Profile

Based on the context gathered, build a requirements profile by answering YES/NO to each:

PROJECT REQUIREMENTS PROFILE
═══════════════════════════════

Project Name:       [detected name]
Project Type:       [API only | Web app | Mobile app | Full-stack | AI/ML | Library]
Description:        [1-line from PRD/README]

Core Requirements:
  Has backend API?                    → [YES/NO]
  Has user authentication?            → [YES/NO]
  Has SQL database (relational data)? → [YES/NO]
  Has document/NoSQL storage needs?   → [YES/NO] — only YES if project stores:
                                        - Unstructured documents, logs, audit trails
                                        - Highly nested/variable-schema data
                                        - Chat messages, activity feeds, analytics events
                                        - If NO clear need → NO (do NOT default to YES)
  Has caching/session needs?          → [YES/NO] — only YES if project has:
                                        - High-traffic endpoints needing caching
                                        - Real-time session management
                                        - Rate limiting, queues, pub/sub
                                        - If simple CRUD app → NO
  Has payment processing?             → [YES/NO]
  Has India market / INR billing?     → [YES/NO] — determines Razorpay vs Stripe

Frontend Requirements:
  Has web frontend?                   → [YES/NO]
  Has mobile app?                     → [YES/NO]
  Needs dark mode?                    → [YES/NO] — YES if user-facing app
  Needs i18n (multilingual)?          → [YES/NO] — only if PRD mentions multiple languages
  Needs animations/transitions?       → [YES/NO]

Feature Requirements:
  Has file uploads?                   → [YES/NO]
  Has full-text search?               → [YES/NO] — only if search is a core feature
  Has real-time features?             → [YES/NO] — chat, live updates, notifications
  Has push notifications?             → [YES/NO] — only if mobile or PWA with push
  Has email sending?                  → [YES/NO]
  Has social login (Google/Apple)?    → [YES/NO]
  Has role-based access (RBAC)?       → [YES/NO] — only if multiple user roles
  Has 2FA/MFA?                        → [YES/NO] — only if high-security app
  Has background jobs/queues?         → [YES/NO]

AI/GenAI Requirements:
  Has AI/LLM features?                → [YES/NO]
  Has RAG/document search?            → [YES/NO]
  Has AI agents/tools?                → [YES/NO]
  Has MCP/A2A integration?            → [YES/NO]

Infrastructure:
  Needs error tracking (production)?  → [YES/NO] — YES if deploying to production
  Needs analytics?                    → [YES/NO] — only if tracking user behavior
  Needs monitoring?                   → [YES/NO] — YES if production deployment

Read the full file on GitHub · 420 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 420 lines · 42 tokens per session scan A ce4323974311

Subscribe to this mod's changes

gap-analysis is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 25d ago), licensed MIT. It adds 42 tokens to every session and 4,372 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.