ai-ops-cli 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -1
- package/data/presets.yaml +56 -0
- package/data/rules/ai-llm-python.yaml +35 -0
- package/data/rules/code-philosophy.yaml +30 -0
- package/data/rules/communication.yaml +11 -0
- package/data/rules/data-pipeline-python.yaml +34 -0
- package/data/rules/engineering-standards.yaml +39 -0
- package/data/rules/fastapi.yaml +34 -0
- package/data/rules/flutter.yaml +40 -0
- package/data/rules/graphql.yaml +34 -0
- package/data/rules/libs-backend-python.yaml +35 -0
- package/data/rules/libs-backend-ts.yaml +38 -0
- package/data/rules/libs-frontend-app.yaml +39 -0
- package/data/rules/libs-frontend-web.yaml +44 -0
- package/data/rules/naming-convention.yaml +10 -0
- package/data/rules/nestjs-graphql.yaml +31 -0
- package/data/rules/nestjs.yaml +26 -0
- package/data/rules/nextjs.yaml +34 -0
- package/data/rules/plan-mode.yaml +30 -0
- package/data/rules/prisma-postgresql.yaml +30 -0
- package/data/rules/python.yaml +31 -0
- package/data/rules/react-typescript.yaml +11 -0
- package/data/rules/role-persona.yaml +14 -0
- package/data/rules/shadcn-ui.yaml +36 -0
- package/data/rules/sqlalchemy.yaml +32 -0
- package/data/rules/typescript.yaml +22 -0
- package/dist/bin/index.js +499 -119
- package/dist/bin/index.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
id: nextjs
|
|
2
|
+
category: framework
|
|
3
|
+
tags:
|
|
4
|
+
- typescript
|
|
5
|
+
- react
|
|
6
|
+
- nextjs
|
|
7
|
+
- app-router
|
|
8
|
+
priority: 50
|
|
9
|
+
content:
|
|
10
|
+
constraints:
|
|
11
|
+
- "DO NOT import server-only code into Client Components. Enforce with 'server-only'."
|
|
12
|
+
- 'DO NOT store secrets in NEXT_PUBLIC_ variables. Only NEXT_PUBLIC_ vars are exposed to the browser bundle.'
|
|
13
|
+
- 'DO NOT use next/router in App Router projects. Use next/navigation APIs.'
|
|
14
|
+
guidelines:
|
|
15
|
+
- 'Follow App Router file conventions (page.tsx, layout.tsx, loading.tsx, error.tsx, not-found.tsx).'
|
|
16
|
+
- "Keep Server Actions in dedicated files (e.g., actions.ts) with 'use server'."
|
|
17
|
+
- 'Use next/image with explicit dimensions or fill + sizes.'
|
|
18
|
+
- 'Use next/font in root layout and apply through CSS variables.'
|
|
19
|
+
- 'Use middleware.ts only for cross-cutting concerns (auth redirect, locale, header policy).'
|
|
20
|
+
- 'Export metadata (or generateMetadata) for public pages with title/description/OpenGraph.'
|
|
21
|
+
- 'Add JSON-LD structured data for public pages when SEO/GEO matters.'
|
|
22
|
+
decision_table:
|
|
23
|
+
- when: 'A component needs browser APIs, state hooks, or event handlers'
|
|
24
|
+
then: "Add 'use client' at the smallest leaf component"
|
|
25
|
+
avoid: "Marking high-level parent trees as 'use client'"
|
|
26
|
+
- when: 'Page data is needed for initial render'
|
|
27
|
+
then: 'Fetch in Server Components with async/await'
|
|
28
|
+
avoid: 'Client-side useEffect fetch for primary page data'
|
|
29
|
+
- when: 'Internal form mutation is needed'
|
|
30
|
+
then: 'Use Server Actions'
|
|
31
|
+
avoid: 'route.ts endpoints for simple internal form writes'
|
|
32
|
+
- when: 'External API/webhook endpoint is needed'
|
|
33
|
+
then: 'Use route.ts with explicit HTTP method exports'
|
|
34
|
+
avoid: 'Server Actions for public API integration points'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
id: plan-mode
|
|
2
|
+
category: standard
|
|
3
|
+
tags:
|
|
4
|
+
- general
|
|
5
|
+
- planning
|
|
6
|
+
- mermaid
|
|
7
|
+
priority: 71
|
|
8
|
+
content:
|
|
9
|
+
constraints:
|
|
10
|
+
- 'DO NOT mix Mermaid diagram types arbitrarily. Pick the type that matches the information structure.'
|
|
11
|
+
guidelines:
|
|
12
|
+
- 'Prefer Mermaid diagrams over long bullet lists when explaining flow, sequence, state, or structure.'
|
|
13
|
+
- 'Use flowchart for UX/control flows and decision trees.'
|
|
14
|
+
- 'Use sequenceDiagram for request/response and service interaction flows.'
|
|
15
|
+
- 'Use erDiagram for entities and schema relationships.'
|
|
16
|
+
- 'Use stateDiagram-v2 for lifecycle/state transitions.'
|
|
17
|
+
- 'Wrap diagrams in fenced ```mermaid code blocks.'
|
|
18
|
+
decision_table:
|
|
19
|
+
- when: 'Describing user journey or UI navigation'
|
|
20
|
+
then: 'Use flowchart (LR or TD)'
|
|
21
|
+
avoid: 'Text-only step lists'
|
|
22
|
+
- when: 'Describing API or service interactions'
|
|
23
|
+
then: 'Use sequenceDiagram'
|
|
24
|
+
avoid: 'Plain text arrows only'
|
|
25
|
+
- when: 'Describing schema relationships'
|
|
26
|
+
then: 'Use erDiagram'
|
|
27
|
+
avoid: 'Unstructured table bullet lists'
|
|
28
|
+
- when: 'Describing state transitions'
|
|
29
|
+
then: 'Use stateDiagram-v2'
|
|
30
|
+
avoid: 'Flat textual state lists'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
id: prisma-postgresql
|
|
2
|
+
category: database
|
|
3
|
+
tags:
|
|
4
|
+
- typescript
|
|
5
|
+
- prisma
|
|
6
|
+
- postgresql
|
|
7
|
+
priority: 40
|
|
8
|
+
content:
|
|
9
|
+
constraints:
|
|
10
|
+
- 'DO NOT interpolate strings in $queryRawUnsafe. Use $queryRaw tagged templates or parameterized placeholders.'
|
|
11
|
+
- 'DO NOT return Prisma models directly from APIs. Use select or DTO mapping to avoid leaking sensitive fields.'
|
|
12
|
+
- 'DO NOT define mutable models without updatedAt DateTime @updatedAt.'
|
|
13
|
+
- 'DO NOT use $use() middleware. Use Client Extensions ($extends) in Prisma v7+.'
|
|
14
|
+
- 'DO NOT use prisma db push in production. Use prisma migrate deploy with versioned migrations.'
|
|
15
|
+
guidelines:
|
|
16
|
+
- 'Use generator client { provider = "prisma-client"; output = "./generated/prisma/client" }.'
|
|
17
|
+
- 'Use @prisma/adapter-pg and set explicit pool/timeout values for your environment.'
|
|
18
|
+
- 'Add indexes for frequent where/orderBy/join patterns, including composite indexes where needed.'
|
|
19
|
+
- 'Set explicit timeout and maxWait for interactive transactions.'
|
|
20
|
+
- 'Centralize datasource and migration settings in prisma.config.ts.'
|
|
21
|
+
- 'Implement soft delete with a Client Extension query hook that injects deletedAt: null filtering.'
|
|
22
|
+
- 'Prefer cursor pagination over deep skip/take for large tables.'
|
|
23
|
+
- 'Use an external pooler (e.g., PgBouncer) or explicit adapter connection limits in serverless/container workloads.'
|
|
24
|
+
decision_table:
|
|
25
|
+
- when: 'A query needs PostgreSQL features Prisma API cannot express well'
|
|
26
|
+
then: 'Use $queryRaw with tagged templates and typed result mapping'
|
|
27
|
+
avoid: 'Unsafe string-built SQL'
|
|
28
|
+
- when: 'A transaction has dependent steps'
|
|
29
|
+
then: 'Use interactive $transaction(async (tx) => ...) with explicit timeout/maxWait'
|
|
30
|
+
avoid: 'Batch $transaction([...]) for interdependent operations'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
id: python
|
|
2
|
+
category: language
|
|
3
|
+
tags:
|
|
4
|
+
- python
|
|
5
|
+
priority: 55
|
|
6
|
+
content:
|
|
7
|
+
constraints:
|
|
8
|
+
- 'DO NOT use Any in type hints. Use object or concrete generics instead.'
|
|
9
|
+
- 'DO NOT use mutable default arguments. Use None + factory inside the function.'
|
|
10
|
+
- 'DO NOT use bare except or broad except Exception. Catch specific exception types.'
|
|
11
|
+
- 'DO NOT use wildcard imports.'
|
|
12
|
+
- 'DO NOT use type(x) == T checks. Prefer isinstance() or protocol-based checks.'
|
|
13
|
+
- 'DO NOT use # type: ignore without an explicit error code.'
|
|
14
|
+
guidelines:
|
|
15
|
+
- 'Annotate all function parameters and return types, including -> None.'
|
|
16
|
+
- 'Use Pydantic v2 BaseModel for DTO/config schemas; use field_validator/model_validator APIs.'
|
|
17
|
+
- 'Use TypeAlias, TypeVar, ParamSpec, TypedDict, and Literal to model intent clearly.'
|
|
18
|
+
- 'Keep business logic in pure *_logic.py modules; keep routers/services thin.'
|
|
19
|
+
- 'Use @dataclass(frozen=True) for immutable value objects that do not need runtime validation.'
|
|
20
|
+
- 'Use pathlib.Path for filesystem paths.'
|
|
21
|
+
- 'Use f-strings for string formatting.'
|
|
22
|
+
decision_table:
|
|
23
|
+
- when: 'Structured input/output needs validation or serialization'
|
|
24
|
+
then: 'Use Pydantic v2 models'
|
|
25
|
+
avoid: 'Unvalidated dict payloads'
|
|
26
|
+
- when: 'Immutable value object without runtime validation is enough'
|
|
27
|
+
then: 'Use @dataclass(frozen=True)'
|
|
28
|
+
avoid: 'Using Pydantic where validation is unnecessary'
|
|
29
|
+
- when: 'Runtime type narrowing is needed'
|
|
30
|
+
then: 'Use isinstance() or model_validate()'
|
|
31
|
+
avoid: 'Fragile type()/hasattr() checks'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
id: role-persona
|
|
2
|
+
category: persona
|
|
3
|
+
tags:
|
|
4
|
+
- general
|
|
5
|
+
- persona
|
|
6
|
+
priority: 90
|
|
7
|
+
content:
|
|
8
|
+
constraints:
|
|
9
|
+
- "DO NOT write patronizing tutorials (e.g., 'First, let me explain what React is...')."
|
|
10
|
+
guidelines:
|
|
11
|
+
- 'You are an expert Senior Full-Stack Developer.'
|
|
12
|
+
- 'Assume the user is a senior developer, but may be unfamiliar with specific domains or patterns.'
|
|
13
|
+
- 'When choosing a pattern, library, or architectural approach, briefly explain WHY it was chosen over alternatives.'
|
|
14
|
+
- 'Focus on high-level architecture, edge cases, performance optimization, and maintainability.'
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
id: shadcn-ui
|
|
2
|
+
category: ui
|
|
3
|
+
tags:
|
|
4
|
+
- typescript
|
|
5
|
+
- react
|
|
6
|
+
- shadcn-ui
|
|
7
|
+
- tailwind
|
|
8
|
+
priority: 35
|
|
9
|
+
content:
|
|
10
|
+
constraints:
|
|
11
|
+
- 'DO NOT reimplement components already available in shadcn/ui. Add and compose existing primitives first.'
|
|
12
|
+
- 'DO NOT edit generated shadcn source files directly (components/ui/*). Extend via wrappers or className overrides.'
|
|
13
|
+
- 'DO NOT overuse arbitrary Tailwind values for stable design tokens.'
|
|
14
|
+
- 'DO NOT use inline style props for static values. Use Tailwind classes.'
|
|
15
|
+
guidelines:
|
|
16
|
+
- 'Check shadcn component catalog before building custom UI primitives.'
|
|
17
|
+
- 'Use cn() for conditional class composition and tailwind-merge conflict resolution.'
|
|
18
|
+
- 'Use shadcn composition patterns (Trigger/Content/Header/etc.) for complex components.'
|
|
19
|
+
- 'Use cva for variant-heavy components.'
|
|
20
|
+
- 'Keep theme tokens CSS-variable based and map them in Tailwind config.'
|
|
21
|
+
- 'Use mobile-first responsive classes (sm/md/lg progression).'
|
|
22
|
+
- 'Preserve accessibility (aria-label or sr-only text for icon-only controls).'
|
|
23
|
+
- 'Use named lucide-react icon imports only.'
|
|
24
|
+
decision_table:
|
|
25
|
+
- when: 'A needed UI element exists in shadcn or can be composed from Radix primitives'
|
|
26
|
+
then: 'Use shadcn composition'
|
|
27
|
+
avoid: 'Custom rebuild from scratch'
|
|
28
|
+
- when: 'No suitable primitive exists and interaction is domain-specific'
|
|
29
|
+
then: 'Build a custom component'
|
|
30
|
+
avoid: 'Forcing unrelated shadcn primitives'
|
|
31
|
+
- when: 'A component has variants'
|
|
32
|
+
then: 'Model variants with cva'
|
|
33
|
+
avoid: 'Large conditional className branches in JSX'
|
|
34
|
+
- when: 'Styling approach is needed'
|
|
35
|
+
then: 'Use Tailwind utilities by default'
|
|
36
|
+
avoid: 'Switching to CSS Modules for normal component styling'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
id: sqlalchemy
|
|
2
|
+
category: database
|
|
3
|
+
tags:
|
|
4
|
+
- python
|
|
5
|
+
- sqlalchemy
|
|
6
|
+
- postgresql
|
|
7
|
+
priority: 38
|
|
8
|
+
content:
|
|
9
|
+
constraints:
|
|
10
|
+
- 'DO NOT use legacy session.query() patterns. Use SQLAlchemy 2.x select()/insert()/update().'
|
|
11
|
+
- 'DO NOT execute raw SQL strings directly outside migrations. Use ORM or text() with bound params.'
|
|
12
|
+
- 'DO NOT call session.commit() from scattered layers. Commit once at service/unit-of-work boundary.'
|
|
13
|
+
- 'DO NOT omit created_at/updated_at on mutable models.'
|
|
14
|
+
- 'DO NOT change schema without Alembic migrations.'
|
|
15
|
+
guidelines:
|
|
16
|
+
- 'Use Mapped[T] + mapped_column() declarative mappings.'
|
|
17
|
+
- 'Define relationships explicitly with back_populates.'
|
|
18
|
+
- 'Use AsyncSession + async_sessionmaker for async FastAPI stacks.'
|
|
19
|
+
- 'Implement soft delete with deleted_at and default filtered queries.'
|
|
20
|
+
- 'Use StrEnum-backed string enums for migration-safe enum storage.'
|
|
21
|
+
- 'Declare indexes/unique constraints explicitly in __table_args__. '
|
|
22
|
+
- 'Prevent N+1: use selectinload() for 1:N (separate IN query) and joinedload() for N:1/1:1 (JOIN). Never rely on lazy loading by default.'
|
|
23
|
+
decision_table:
|
|
24
|
+
- when: 'Routine CRUD is needed'
|
|
25
|
+
then: 'Use ORM expressions (select/insert/update)'
|
|
26
|
+
avoid: 'Hand-written raw SQL by default'
|
|
27
|
+
- when: 'Complex analytical SQL is needed'
|
|
28
|
+
then: 'Use text() with bound params or a fit-for-purpose analytical engine'
|
|
29
|
+
avoid: 'Unreadable ORM expression chains'
|
|
30
|
+
- when: 'Schema changes are required'
|
|
31
|
+
then: 'Generate Alembic migration and review before apply'
|
|
32
|
+
avoid: 'Manual untracked DDL changes'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: typescript
|
|
2
|
+
category: language
|
|
3
|
+
tags:
|
|
4
|
+
- typescript
|
|
5
|
+
priority: 65
|
|
6
|
+
content:
|
|
7
|
+
constraints:
|
|
8
|
+
- 'DO NOT use interface. Use type aliases consistently.'
|
|
9
|
+
- 'DO NOT use enum. Use const objects with inferred literal unions.'
|
|
10
|
+
- 'DO NOT use any. Use unknown and narrow with runtime/type guards.'
|
|
11
|
+
- 'DO NOT use non-null assertion (!). Handle null/undefined explicitly with ?. and ??.'
|
|
12
|
+
- 'DO NOT use .then() chains for normal async flows. Use async/await.'
|
|
13
|
+
- 'DO NOT throw raw strings. Throw Error objects and narrow caught errors from unknown.'
|
|
14
|
+
guidelines:
|
|
15
|
+
- 'Use arrow functions only. Annotate return types for exported functions.'
|
|
16
|
+
- 'Use import type for type-only imports. Use absolute paths (@/...) only.'
|
|
17
|
+
- 'Use as const for static config objects.'
|
|
18
|
+
- 'Keep business logic in *.logic.ts and stateless helpers in *.util.ts.'
|
|
19
|
+
decision_table:
|
|
20
|
+
- when: 'You feel forced to use an as assertion'
|
|
21
|
+
then: 'Prefer schema parse (e.g., Zod) or explicit type guards first'
|
|
22
|
+
avoid: 'Bypassing the type system with unchecked assertions'
|