agentsclimarketplace

U reverse spec analysis

Skill zig999/siegard-code/dist/.claude/skills/u-reverse-spec-analysis

Most AI coding tools help you write code. Siegard Code manages the entire development lifecycle — it writes specifications, plans backlogs, implements features, runs QA, and delivers tested code. All autonomously, all traceable, all through Claude Code.

Install
npx -y skills add zig999/siegard-code --skill u-reverse-spec-analysis

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Source code analysis patterns by stack/framework for identifying entities, endpoints, business rules, events, and UI structure. Used by the Reverse Spec Analyzer Agent.

SKILL.md

16.1 KB, ~4.4k tokens by cl100k_base, as published. Nobody here has run it

SKILL: Source Code Analysis for Reverse Engineering

Purpose

Provide the Analyzer Agent with framework/stack-specific search patterns to extract structured information from existing source code.


Stack Detection

Step 1: Identify language and framework

Search for configuration files in the project root:

FileStack
package.jsonNode.js (analyze dependencies for framework)
tsconfig.jsonTypeScript
requirements.txt / pyproject.toml / PipfilePython
pom.xml / build.gradleJava/Kotlin
go.modGo
GemfileRuby
Cargo.tomlRust
composer.jsonPHP

Step 2: Identify specific framework

Node.js/TypeScript — via package.json dependencies:

DependencyFrameworkContext
@nestjs/coreNestJSBackend
expressExpressBackend
fastifyFastifyBackend
hapi, @hapi/hapiHapiBackend
koaKoaBackend
react, react-domReactFrontend
nextNext.jsFrontend (or fullstack)
vueVueFrontend
nuxtNuxtFrontend (or fullstack)
@angular/coreAngularFrontend
svelteSvelteFrontend

Python — via requirements.txt or pyproject.toml:

DependencyFrameworkContext
djangoDjangoBackend
fastapiFastAPIBackend
flaskFlaskBackend
starletteStarletteBackend

Java/Kotlin — via pom.xml or build.gradle:

DependencyFrameworkContext
spring-bootSpring BootBackend
quarkusQuarkusBackend

Step 3: Identify database

IndicatorDatabase
typeorm, @prisma/client, sequelize, knexCheck config for type (PostgreSQL, MySQL, SQLite)
mongoose, mongodbMongoDB
@supabase/supabase-jsSupabase (PostgreSQL)
pg, mysql2, better-sqlite3PostgreSQL / MySQL / SQLite
sqlalchemy, django.dbCheck config
redis, ioredisRedis (cache/session)

Step 4: Identify state management (frontend)

IndicatorSolution
zustandZustand
@reduxjs/toolkit, reduxRedux
jotaiJotai
recoilRecoil
piniaPinia (Vue)
vuexVuex (Vue)
@ngrx/storeNgRx (Angular)
React.createContext, useContextContext API

Step 5: Identify data fetching (frontend)

IndicatorSolution
@tanstack/react-query, react-queryReact Query
swrSWR
axiosAxios (manual)
fetch(Fetch API (manual)
@apollo/client, graphqlApollo/GraphQL
trpc, @trpc/clienttRPC

Search Patterns by Framework

NestJS (Backend)

What to search forSearch pattern (Grep)Spec artifact
Controllers@Controller(endpoints -> openapi.yaml
GET routes@Get(paths GET
POST routes@Post(paths POST
PUT routes@Put(paths PUT
PATCH routes@Patch(paths PATCH
DELETE routes@Delete(paths DELETE
Entities@Entity(data model -> .back.md
DTOsclass.*Dtoschemas -> openapi.yaml
Services@Injectable() + class.*Servicebusiness logic -> .spec.md
Guards@Injectable() + implements CanActivatebusiness rules -> .back.md
Interceptors@Injectable() + implements NestInterceptorcross-cutting behavior
Events@EventPattern( or EventEmitterevents -> .back.md
Pipes/Validators@UsePipes( or class-validator decoratorsvalidations -> .back.md
Modules@Module(domains (grouping)
Enumsenum.*Status or enum.*Statestate machine -> .back.md
Zod schemasz\.object\(schemas -> openapi.yaml
Zod type aliasz\.infer<DTO type name → schema
Joi schemasJoi\.object\(schemas -> openapi.yaml
Repositoriesclass.*Repository or @InjectRepository\(data access -> .back.md

Typical folder structure:

src/
  {module}/
    {module}.controller.ts  -> endpoints
    {module}.service.ts     -> business rules
    {module}.module.ts      -> domain
    dto/                    -> schemas
    entities/               -> data model
    guards/                 -> authorization
    events/                 -> events

Express (Backend)

What to search forSearch patternSpec artifact
Routesrouter\.(get|post|put|patch|delete)\(endpoints -> openapi.yaml
App routesapp\.(get|post|put|patch|delete)\(endpoints -> openapi.yaml
Middleware(req, res, next) or function.*middlewarecross-cutting
Models (Mongoose)mongoose\.Schema\( or new Schema\(data model -> .back.md
Models (Sequelize)sequelize\.define\( or Model\.init\(data model -> .back.md
ValidationJoi\. or yup\. or zod\.validations -> .back.md
Error handler(err, req, res, next)errors -> error-codes.md
Zod schemasz\.object\(schemas -> openapi.yaml
Repositoriesclass.*Repositorydata access -> .back.md

Typical folder structure (manual-factory pattern):

src/
  routes/        ← route/endpoint definitions ([resource].routes.ts)
  controllers/   ← HTTP handlers ([resource].controller.ts)
  services/      ← business rules ([resource].service.ts)
  repositories/  ← data access ([resource].repository.ts)
  models/        ← entity/DB schema definitions ([resource].model.ts)
  dto/           ← input/output schemas (Zod, Joi, or class-validator)
  middleware/    ← auth, logging, error handler
  factories/     ← DI wiring ([resource].factory.ts)
  config/        ← application configuration
  types/         ← global types and interfaces
  __tests__/     ← tests (mirrors src/)

Module-based alternative: src/modules/{domain}/ with controller/, service/, repository/, dto/, entity/, factory/.

FastAPI (Backend)

What to search forSearch patternSpec artifact
Routes@(app|router)\.(get|post|put|patch|delete)\(endpoints -> openapi.yaml
Modelsclass.*\(BaseModel\)schemas -> openapi.yaml
ORM Modelsclass.*\(Base\) or class.*\(SQLModel\)data model -> .back.md
DependenciesDepends\(middleware/guards
ExceptionsHTTPException\(errors -> error-codes.md
Events@app\.on_event\(events -> .back.md

Django (Backend)

What to search forSearch patternSpec artifact
Modelsclass.*\(models\.Model\)data model -> .back.md
Viewsclass.*\(APIView\) or def.*\(requestendpoints -> openapi.yaml
ViewSetsclass.*\(ModelViewSet\)CRUD endpoints -> openapi.yaml
Serializersclass.*\(serializers\.Serializer\)schemas -> openapi.yaml
URLspath\( or url\(routes -> openapi.yaml
Signals@receiver\(events -> .back.md
Validatorsdef validate_validations -> .back.md

Spring Boot (Backend)

What to search forSearch patternSpec artifact
Controllers@RestControllerendpoints -> openapi.yaml
Routes@(Get|Post|Put|Patch|Delete)Mappingpaths -> openapi.yaml
Entities@Entitydata model -> .back.md
Services@Servicebusiness logic -> .spec.md
Repositories@Repository or extends JpaRepositorypersistence -> .back.md
DTOsrecord.*Dto or class.*Dtoschemas -> openapi.yaml
Validators@Valid or @Validatedvalidations -> .back.md
EventsApplicationEvent or @EventListenerevents -> .back.md
Enumsenum.*Statusstate machine -> .back.md

React / Next.js (Frontend)

What to search forSearch patternSpec artifact
Pages (Next pages)Files in pages/ or app/features -> .feature.spec.md
Page componentsexport (function|const) [A-Z][a-zA-Z]*(Page|Screen|View)features -> .feature.spec.md
API callsfetch\( or axios\.(get|post) or useQuery\(consumed domains
Custom hooksfunction use[A-Z] or const use[A-Z]state logic
State storescreate\( (zustand) or createSlice\( (redux)state strategy -> feature.spec.md (§4 Requests, Order, and Cache)
Routes<Route or <Link or useRouter or useNavigateflows -> .flow.md
Forms<form or useForm\( or Formikvalidations -> .feature.spec.md (§5)
Error boundariescomponentDidCatch or ErrorBoundaryerror handling -> .feature.spec.md (§6)
Loading statesisLoading or isPending or <Skeleton or <SpinnerUI states -> .feature.spec.md (§2)

Vue / Nuxt (Frontend)

What to search forSearch patternSpec artifact
PagesFiles in pages/ (.vue)features -> .feature.spec.md
ComponentsdefineComponent\( or <script setup>screen components
API callsuseFetch\( or $fetch\( or axiosconsumed domains
StatedefineStore\( (Pinia) or new Vuex.Storestate strategy -> feature.spec.md (§4 Requests, Order, and Cache)
RoutercreateRouter\( or <RouterLinkflows -> .flow.md
GuardsbeforeEach\( or beforeEnternavigation rules -> .flow.md

Angular (Frontend)

What to search forSearch patternSpec artifact
Components@Component\(screens/components
Services@Injectable\( + HttpClientconsumed domains
RoutesRoutes or RouterModuleflows -> .flow.md
GuardscanActivate or CanActivateFnnavigation rules
FormsFormGroup or FormControlvalidations -> .feature.spec.md (§5)
State@ngrx/store or BehaviorSubjectstate strategy -> feature.spec.md (§4 Requests, Order, and Cache)

ORM-Specific Entity Patterns

When the project uses an ORM other than TypeORM, use these patterns instead of @Entity( for entity detection.

Prisma

Entities are defined in schema.prisma, not in TypeScript files. Use Glob("**/schema.prisma") to locate the file.

What to detectSearchNotes
Entity definition^model [A-Z] in *.prismaEach model block = one entity
Required fieldField line without ? inside model blocke.g., name String
Optional fieldField line with ?e.g., bio String?
Default value@default\(e.g., @default(now()), @default(uuid())
Unique constraint@unique or @@unique\(Single-field or composite
Relationship@relation\(Read both sides to determine cardinality
Enum^enum [A-Z] in *.prismaState machine candidates

Prisma type → OpenAPI type mapping: String→string, Int→integer, Float→number, Boolean→boolean, DateTime→string(format:date-time), Json→object.

Mongoose (Node.js)

What to detectSearch patternNotes
Schema definitionnew Schema\( or mongoose\.Schema\(
Model registrationmongoose\.model\(Entity name = first argument
Required fieldrequired: trueInside schema field definition
Unique constraintunique: trueInside schema field definition
Relationshipref:Cross-model reference (populate)

Sequelize (TypeScript class style)

What to detectSearch patternNotes
Model classclass.*extends ModelTypeScript Sequelize style
Column decorator@Column\(From sequelize-typescript
Primary key@PrimaryKey
Relationship@HasMany\( or @BelongsTo\( or @HasOne\( or @BelongsToMany\(Relationship decorators

Analysis Rules

Domain Identification

  1. Backend: each module/folder with controller + service + model = 1 domain
  2. Frontend: group by feature folder or by functional area (related pages)
  3. Domain names: use kebab-case, derive from the module/folder name
  4. If the project has no clear modular structure, group by primary entity

Entity Identification

  1. Class/interface with persisted fields = entity
  2. Fields with id, createdAt, updatedAt = root entity (aggregate root)
  3. Class embedded within another (nested) = value object
  4. Entity with a status or state field (enum or union type) = state machine candidate

Relationship Identification

Search for inter-entity relationships using ORM-specific patterns:

ORMPatternCardinality
TypeORM@OneToMany\(1:N
TypeORM@ManyToOne\(N:1
TypeORM@OneToOne\(1:1
TypeORM@ManyToMany\( + @JoinTable\(N:N
Prisma@relation\( in *.prismaRead both field sides
Mongooseref:Cross-model reference
Sequelize@HasMany\(, @BelongsTo\(, @HasOne\(, @BelongsToMany\(various

For each relationship found: identify source entity, target entity, cardinality, and whether bidirectional. Record in analysis-report.md Entities → Relationships table.

Field and Constraint Extraction

For each entity, extract fields and constraints using the active ORM/validation library:

TypeORM decorators

What to extractPattern
Column@Column\(
Primary key@PrimaryGeneratedColumn\( or @PrimaryColumn\(
Timestamps@CreateDateColumn\(, @UpdateDateColumn\(
Nullablenullable: true inside @Column
Uniqueunique: true inside @Column
Defaultdefault: inside @Column
Enum valuesenum: inside @Column

Zod schemas (default TS library)

What to extractPatternOpenAPI mapping
Required string.string() without .optional()type: string, required: true
Optional.optional() or .nullable()required: false
Min/max length.min\(N\), .max\(N\)minLength, maxLength
Email.email\(\)format: email
UUID.uuid\(\)format: uuid
Enumz\.enum\(\[enum: [...]
Default.default\(default:

class-validator (NestJS)

What to extractPatternOpenAPI mapping
Required@IsNotEmpty\(required: true
Optional@IsOptional\(required: false
Email@IsEmail\(format: email
UUID@IsUUID\(format: uuid
Length@MinLength\(, @MaxLength\(minLength, maxLength
Enum@IsEnum\(enum: [...]

Business Rule Identification

  1. Validations in services/use-cases = BR candidate
  2. Guards/middleware with authorization logic = BR candidate
  3. if/else conditions in domain logic (not UI) = BR candidate
  4. Each rule must be nameable and testable

Error Identification

  1. Search for throw new.*Error\( or throw new.*Exception\(
  2. Search for res\.status\(4 or res\.status\(5 or HttpException\(
  3. Search for error constants: ERROR_, ERR_, error.code
  4. For each error: extract HTTP code, message, and context

Screen Identification (Frontend)

  1. Each file in pages/ or app/ with default export = 1 screen
  2. Derive the route from the file/folder name (Next.js file-based routing)
  3. Identify components consumed by each page
  4. Identify API calls within each page/component

Flow Identification (Frontend)

  1. Navigation sequences (router.push, navigate, <Link>)
  2. Route guards (conditional redirects)
  3. Wizards/steps (components with sequential stages)
  4. Group connected screens by navigation = 1 flow

Expected Output

The Analyzer must produce {SPECS_DIR}/_temp/analysis-report.md following the structure defined in the u-reverse-spec-analyzer.md agent.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.