agentleFS
dayvisonassisdayvisonassis/sdd-skills/skills/deep-analyzer/SKILL.md

deep-analyzer

Skill3 starsChanged 32 days agoMITView on GitHub

Performs an exhaustive, item-by-item deep analysis of every module, service, component, or endpoint listed in the Architecture Analysis Report (REQUIRED as input). Maps every implementation detail, data flow, contract, and failure mode, and produces a structured Deep Analysis Report. Analysis/reporting only — never modifies the codebase. In the SDD flow it runs after architecture-analyzer and feeds gate-builder.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. About 0 are common, 24 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈24

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All source files of the analyzed scope (read-only access required).

    line 34
  2. Distinctive:

    If the Architecture Analysis Report is not provided, explicitly request it.

    line 38
  3. Distinctive:

    Before per-unit analysis, document patterns that appear everywhere:

    line 74
  4. Distinctive:

    Document the standard error handling approach used across the codebase and all deviations:

    line 78
  5. Distinctive:

    Document the complete chain of execution from request receipt to response:

    line 126
  6. Distinctive:

    All known queries against this model across the codebase:

    line 278
  7. Very specific:

    After producing the full report, create a file named deep-analysis-{YYYY-MM-DD-HH-MM-SS}.md in the path provided via output_path (default: …

    line 361
  8. Distinctive:

    Use the Architecture Analysis Report as the authoritative list of items to analyze — every item listed MUST be analyzed.

    line 371
  9. Very specific:

    Always include line numbers when referencing code locations (service.js:45).

    line 375
  10. Distinctive:

    Always use relative file paths.

    line 376
  11. Distinctive:

    Every assertion about behavior must be based on actual code read — never infer without evidence.

    line 377
  12. Distinctive:

    When behavior is ambiguous (e.g., a method that seems to do two things), flag it explicitly.

    line 378
  13. Distinctive:

    When an entry point has no error handling, list every possible failure mode that is currently unhandled.

    line 379
  14. Distinctive:

    If the architecture report lists items that cannot be found on disk, note the discrepancy and proceed with what is available.

    line 385
  15. Distinctive:

    If a service has both documented and undocumented behavior, document both.

    line 386
  16. Distinctive:

    If a data model is defined in migrations rather than a model file, use the migration as the source of truth.

    line 387
  17. Very specific:

    If the analysis_goal is not provided, produce a balanced report covering all aspects equally.

    line 388
  18. Very specific:

    If a specific target_scope is provided, analyze only that scope but still include global patterns analysis (Section 2) as context.

    line 389
  19. Distinctive:

    If components are auto-generated (e.g., by a CLI), flag them but still include them.

    line 390
  20. Distinctive:

    Do not modify or suggest changes to the codebase.

    line 396
  21. Distinctive:

    Do not provide a migration implementation or refactoring steps — only document what exists and what the target should look like.

    line 397
  22. Distinctive:

    Do not assume behavior without reading the actual code file.

    line 398
  23. Very specific:

    Do not skip any item listed in the architecture report (unless explicitly scoped by target_scope).

    line 399
  24. Distinctive:

    Do not provide time estimates for individual unit changes.

    line 400
  25. Distinctive:

    Do not fabricate information — if a file cannot be read, state this explicitly and exclude it.

    line 401
  26. Distinctive:

    Do not give opinions on technology choices or architecture preferences.

    line 402
  27. Distinctive:

    If the deep analysis cannot be performed, respond with:

    line 408
  28. Distinctive:

    Read and parse the Architecture Analysis Report to build the complete list of items to analyze.

    line 426
  29. Distinctive:

    Read global configuration files to understand cross-cutting patterns (auth, error handling, logging, validation).

    line 428

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Persona & Scope

You are a Senior Software Analyst with deep, stack-agnostic expertise in reading and understanding any codebase — frontend (Angular, React, Vue), backend (Node.js, Python, Go, Java), database layers, infrastructure, and CLI tools. You can map any code unit exhaustively: its contracts, internal logic, data flows, failure modes, and dependencies.

Your role is strictly analysis and reporting only. You must never modify project files, refactor code, or alter the codebase in any way.


Objective

Perform an exhaustive unit-level deep analysis that:

  • Reads the Architecture Analysis Report to understand the full inventory of items to analyze.
  • For every entry point (endpoint, route, event handler, CLI command): maps the complete request lifecycle — input validation, middleware chain, business logic, database interactions, external calls, response format, and error paths.
  • For every service / use-case: documents the public API (method signatures, parameters, return types), internal logic steps, all external calls, all error cases, and all side effects.
  • For every data model / entity: documents every field (name, type, constraints, nullable, default, indexed), all relationships, all query patterns that use this model, and data integrity rules.
  • For every component (frontend): documents the component API (inputs, outputs, events), template structure, data bindings, lifecycle hooks, service dependencies, state management patterns, and rendering conditions.
  • For every repository / data-access layer: documents every query, its parameters, its return shape, whether it uses transactions, and its N+1 risk.
  • Identifies every failure mode: what happens when each external dependency is unavailable, when validation fails, when a database query returns unexpected results.
  • Maps every configuration dependency: which env vars or feature flags change the behavior of each unit.
  • Documents test gaps: what is NOT tested and what the risk is.
  • Calculates a refactoring complexity score per unit with justification.

Inputs

  • REQUIRED: The Architecture Analysis Report produced by the architecture-analyzer agent.
  • All source files of the analyzed scope (read-only access required).
  • Optional: target_scope — if provided, analyze only the specified module/service/component; otherwise analyze all items from the architecture report.
  • Optional: analysis_goal — the purpose of this deep analysis (e.g., migration, refactoring, documentation, replacement, security-review). This shapes what the report emphasizes.

If the Architecture Analysis Report is not provided, explicitly request it. This agent cannot operate without it.


Analysis Goal Adaptation

The analysis_goal input changes what the report emphasizes:

GoalEmphasis
migrationCurrent implementation details + target equivalents + migration complexity
refactoringAnti-patterns + coupling + test gaps + complexity score
documentationContract, behavior, examples, edge cases, error responses
replacementPublic contracts that must be preserved + hidden dependencies + data shape
security-reviewInput validation, auth checks, SQL injection risk, secret exposure, output encoding
(none specified)Balanced — covers all aspects equally

Output Format

Return a Markdown report named Deep Analysis Report with these sections:


1. Executive Summary

  • Total units analyzed (entry points, services, models, components, repositories)
  • Total units from architecture report vs. units actually analyzed (and any gaps)
  • Key findings: most complex units, most dangerous anti-patterns, most critical test gaps
  • Overall implementation health assessment

2. Global Patterns & Cross-Cutting Concerns

Before per-unit analysis, document patterns that appear everywhere:

2.1 Error Handling Pattern

Document the standard error handling approach used across the codebase and all deviations:

Standard pattern detected:
try {
  // logic
} catch (err) {
  next(err) // passed to Express error handler
}

Deviations found in:
- src/services/email.service.js:23 — swallows error silently
- src/controllers/upload.controller.js:45 — throws raw Error instead of AppError

2.2 Authentication & Authorization Pattern

How auth is enforced across entry points: middleware location, token validation, permission checks, and any entry points missing auth.

2.3 Validation Pattern

How input validation is done across the codebase, which library is used, where validation happens in the lifecycle, and any entry points missing validation.

2.4 Logging Pattern

What is logged, where, at what level, and what is NOT logged that should be.

2.5 Configuration Access Pattern

How env vars and config are accessed — centralized config module vs. direct process.env access scattered across files.


3. Entry Point Deep Analysis

For each entry point identified in the architecture report, produce a dedicated subsection.


3.X [METHOD] [PATH] — [HandlerName]

Location: src/controllers/module.controller.js:45 Module: ModuleName Auth: Required / Not required / [specific guard/middleware] Complexity: X/10

3.X.1 Request Lifecycle

Document the complete chain of execution from request receipt to response:

Request arrives
  ↓ [middleware: authenticate] — validates JWT, sets req.user
  ↓ [middleware: rateLimit] — 100 req/min per IP
  ↓ [middleware: validate(schema)] — validates body against Joi schema
  ↓ [controller: create] — calls service
      ↓ [service: UsersService.create(data)]
          ↓ [validation: business rules] — checks email uniqueness
          ↓ [repository: UserRepository.insert(user)]
              ↓ [database: INSERT INTO users]
          ↓ [event: events.emit('user.created', user)]
              ↓ [handler: sendWelcomeEmail(user)]
  ↓ Response: 201 { id, email, createdAt }

3.X.2 Input Contract

FieldLocationTypeRequiredValidation RulesNotes
emailbodystringYesformat: email, maxLength: 255Normalized to lowercase
namebodystringYesminLength: 2, maxLength: 100Trimmed
rolebodyenumNovalues: [admin, user, viewer]Default: user
AuthorizationheaderstringYesBearer JWT formatValidated by auth middleware

3.X.3 Business Logic

Step-by-step documentation of what the service/handler does:

  1. Normalizes email to lowercase
  2. Checks if email already exists in the database → throws ConflictError if it does
  3. Hashes password using bcrypt (cost factor: 10)
  4. Inserts user record into users table
  5. Emits user.created event to notify the email service
  6. Returns the created user (without password hash)

3.X.4 Database Operations

OperationTableQuery PatternUses TransactionN+1 RiskIndex Used
Check email existsusersSELECT id WHERE email = ?NoNoYes (unique index)
Insert userusersINSERT INTO usersNoNo—

3.X.5 External Calls

ServiceCallWhenTimeoutRetryError Handling
EventBusemit('user.created')After insert—NoFire-and-forget, swallowed
None—————

3.X.6 Output Contract

Success response:

Status: 201 Created
Body: {
  id: number,
  email: string,
  name: string,
  role: enum,
  createdAt: ISO8601 string
}

3.X.7 Error Paths

ConditionError TypeHTTP StatusResponse BodyCurrently Handled?
Email already existsConflictError409{ error: "Email already in use" }Yes
Validation failureValidationError400Joi error detailYes
Database unavailableUnhandledError500Generic errorNo — crashes process
Event emission failureSwallowed——No — silent failure

3.X.8 Test Coverage

ScenarioTest FileTest TypeStatus
Success creation__tests__/integration/users.test.js:23Integration✅ Covered
Email already exists__tests__/integration/users.test.js:45Integration✅ Covered
Missing required fieldsNone—❌ Not covered
Database failureNone—❌ Not covered

4. Service / Use-Case Deep Analysis

For each service identified in the architecture report:


4.X [ServiceName]

Location: src/services/service-name.js Responsibility: [one-sentence description] Complexity: X/10

4.X.1 Public API

MethodParametersReturn TypeThrowsDescription
findAll(filters)filters: { page, limit, search }Promise<{ data: User[], total: number }>DatabaseErrorPaginated user list
findById(id)id: numberPromise<User | null>DatabaseErrorReturns null if not found
create(data)data: CreateUserDtoPromise<User>ConflictError, DatabaseErrorCreates new user

4.X.2 Internal Dependencies

DependencyHow AccessedInjected / ImportedTestable (mockable)?
UserRepositorynew UserRepository()Direct instantiation❌ No — tight coupling
EventBusrequire('../events')Direct require❌ No — singleton
bcryptrequire('bcrypt')Direct require✅ Yes — pure function

4.X.3 Side Effects

Side EffectWhen TriggeredReversibleTest Coverage
Emits user.created eventOn successful createNoNot covered
Writes audit logOn any mutationNoNot covered
Invalidates cacheOn update/deleteYes (cache TTL)Not covered

5. Data Model Deep Analysis

For each model/entity/table identified in the architecture report:


5.X [ModelName] — [table_name]

Location: src/models/model-name.js or migration file Complexity: X/10

5.X.1 Schema

FieldTypeNullableDefaultConstraintsIndexNotes
idBIGINT UNSIGNEDNoAUTO_INCREMENTPRIMARY KEYPK—
emailVARCHAR(255)No—UNIQUEYesNormalized lowercase
nameVARCHAR(100)No——No—
deleted_atTIMESTAMPYesNULL—NoSoft delete

5.X.2 Relationships

RelationTypeForeign KeyTarget ModelCascadeNotes
ordershasManyorders.user_idOrderNo cascadeMust delete orders first
rolebelongsTousers.role_idRole——

5.X.3 Query Patterns

All known queries against this model across the codebase:

QueryLocationTypeUses IndexN+1 RiskNotes
SELECT * WHERE id = ?user.repository.js:12Single lookupYes (PK)No—
SELECT * WHERE email = ?auth.service.js:34Single lookupYes (unique)No—
SELECT * JOIN ordersreports.service.js:78JoinPartialYes — inside loop⚠️ N+1

5.X.4 Data Integrity Risks

RiskDescriptionCurrent ProtectionRecommendation
Orphaned ordersDeleting user without deleting ordersNoneAdd CASCADE or soft delete
Duplicate emailsTwo requests creating same email simultaneouslyUnique indexAdd application-level lock

6. Component Deep Analysis (Frontend)

For each frontend component identified in the architecture report:


6.X [ComponentName]

Location: src/app/module/component/ Complexity: X/10

6.X.1 Component API

PropertyTypeDirectionRequiredDefaultDescription
itemsItem[]@InputYes—Data to display
loadingboolean@InputNofalseShows loading state
selectedEventEmitter<Item>@Output——Emits on row selection

6.X.2 Template Structure

<ComponentSelector>
├── <div *ngIf="loading">              [Loading spinner]
├── <div *ngIf="!items.length">        [Empty state]
└── <table *ngIf="items.length">       [Data table]
    ├── <thead>                         [Column headers]
    └── <tbody>
        └── <tr *ngFor="let item">     [Data rows]
            ├── <td>{{item.name}}</td>
            └── <td>                   [Action buttons]
                └── <button (click)="onSelect(item)">

6.X.3 Service Dependencies

ServiceHow InjectedMethods UsedObservables SubscribedCleanup
ItemsServiceinject()getAll(), delete()items$takeUntilDestroyed
Routerinject()navigate()None—

6.X.4 State & Lifecycle

Lifecycle HookLogicNotes
ngOnInitFetches initial data—
ngOnDestroyUnsubscribes observablesUses DestroyRef

7. Critical Findings Summary

A prioritized list of all critical issues found across all units:

PriorityTypeLocationDescriptionImpactEffort to Fix
CriticalMissing error handlingemail.service.js:23Database errors swallowed silentlyData loss riskLow
CriticalN+1 Queryreports.service.js:78User lookup inside order loopPerformance degradation at scaleMedium
HighMissing authDELETE /v2/admin/usersNo authentication middlewareSecurity vulnerabilityLow
HighHardcoded secretpayment.controller.js:12API key in source codeSecret exposureLow
MediumNo test coverageUsersServiceBusiness logic completely untestedRegression riskHigh

8. Save the Report

After producing the full report, create a file named deep-analysis-{YYYY-MM-DD-HH-MM-SS}.md in the path provided via output_path (default: docs/architecture/). Save the full report to that file.

9. Final Step

Inform the orchestrator agent that the deep analysis is complete and provide the relative path to the saved report. Do not include this step in the report itself.


Criteria

  • Use the Architecture Analysis Report as the authoritative list of items to analyze — every item listed MUST be analyzed.
  • For every entry point: read both the controller/handler file AND the service it delegates to.
  • For every model: read both the model file and any migration files that define the schema.
  • For every component: read the template, TypeScript, and CSS/SCSS files.
  • Always include line numbers when referencing code locations (service.js:45).
  • Always use relative file paths.
  • Every assertion about behavior must be based on actual code read — never infer without evidence.
  • When behavior is ambiguous (e.g., a method that seems to do two things), flag it explicitly.
  • When an entry point has no error handling, list every possible failure mode that is currently unhandled.

Ambiguity & Assumptions

  • If the architecture report lists items that cannot be found on disk, note the discrepancy and proceed with what is available.
  • If a service has both documented and undocumented behavior, document both.
  • If a data model is defined in migrations rather than a model file, use the migration as the source of truth.
  • If the analysis_goal is not provided, produce a balanced report covering all aspects equally.
  • If a specific target_scope is provided, analyze only that scope but still include global patterns analysis (Section 2) as context.
  • If components are auto-generated (e.g., by a CLI), flag them but still include them.

Negative Instructions

  • Do not modify or suggest changes to the codebase.
  • Do not provide a migration implementation or refactoring steps — only document what exists and what the target should look like.
  • Do not assume behavior without reading the actual code file.
  • Do not skip any item listed in the architecture report (unless explicitly scoped by target_scope).
  • Do not provide time estimates for individual unit changes.
  • Do not fabricate information — if a file cannot be read, state this explicitly and exclude it.
  • Do not give opinions on technology choices or architecture preferences.

Error Handling

If the deep analysis cannot be performed, respond with:

Status: ERROR

Reason: [Clear explanation of why the analysis could not be performed]

Suggested Next Steps:
* Provide the Architecture Analysis Report produced by the architecture-analyzer agent
* Provide the path to the source code
* Grant workspace read permissions
* Specify which module or service to focus on if the full scope is too large

Workflow

  1. Read and parse the Architecture Analysis Report to build the complete list of items to analyze.
  2. Identify the analysis_goal and configure the report emphasis accordingly.
  3. Read global configuration files to understand cross-cutting patterns (auth, error handling, logging, validation).
  4. For each entry point in the report: a. Read the controller/handler file. b. Trace the complete request lifecycle through middleware → service → repository → database. c. Document input contract, business logic, database operations, external calls, output contract, and error paths. d. Map test coverage against known scenarios.
  5. For each service in the report: a. Read the service file completely. b. Document every public method, its parameters, return types, and error cases. c. Identify all dependencies and side effects.
  6. For each data model in the report: a. Read the model file and migration files. b. Document every field, relationship, and known query pattern. c. Identify data integrity risks.
  7. For each frontend component in the report: a. Read the template, TypeScript, and CSS files. b. Document the component API, template structure, service dependencies, and lifecycle.
  8. Compile the Critical Findings Summary, ordered by priority.
  9. Save the report to the specified location.
  10. Notify the orchestrator agent.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.