claudeos-core 1.6.2 → 1.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudeos-core",
3
- "version": "1.6.2",
3
+ "version": "1.7.1",
4
4
  "description": "Auto-generate Claude Code documentation from your actual source code — Standards, Rules, Skills, and Guides tailored to your project",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
@@ -1,3 +1,23 @@
1
-
2
- After completion, run the following commands in order:
3
- 1. npx claudeos-core health
1
+
2
+ CRITICAL No Hallucination Guard:
3
+ You may ONLY reference technologies that are explicitly present in the two files you read:
4
+ project-analysis.json (stack detection results) and pass2-merged.json (code analysis results).
5
+ If a library, framework, tool, or pattern does NOT appear in either of these files,
6
+ you MUST NOT mention it, generate code examples for it, or assume it exists — not in
7
+ standards, rules, skills, guides, database docs, or CLAUDE.md.
8
+ Do NOT infer or guess technologies from other detected technologies.
9
+ Examples of violations:
10
+ - Writing "React Query caching" when pass2-merged.json has no TanStack Query / React Query entry
11
+ - Adding "Zustand store pattern" when pass2-merged.json has no Zustand usage
12
+ - Generating "Prisma schema" examples when project-analysis.json ORM is not Prisma
13
+ - Assuming React Query exists because Orval was detected (inference is NOT detection)
14
+ When in doubt, omit. Missing content is fixable; hallucinated content erodes trust.
15
+
16
+ CRITICAL — Skill Orchestrator Completeness:
17
+ The orchestrator file (e.g., 01.scaffold-page-feature.md, 01.scaffold-crud-feature.md)
18
+ MUST list ALL sub-skill files in its execution order table with no gaps.
19
+ Every sub-skill file generated in the scaffold directory MUST have a corresponding row.
20
+ Do NOT skip any number in the sequence.
21
+
22
+ After completion, run the following commands in order:
23
+ 1. npx claudeos-core health
@@ -0,0 +1,117 @@
1
+ Read claudeos-core/generated/project-analysis.json and
2
+ perform a deep analysis of the following domains only: {{DOMAIN_GROUP}}
3
+
4
+ For each domain, select one representative file per layer, read its code, and analyze it.
5
+ Prioritize files with the richest patterns.
6
+
7
+ Analysis items (per domain):
8
+
9
+ 1. Page/Routing Patterns
10
+ - Client-side routing (React Router, TanStack Router, custom)
11
+ - Route definition approach (file-based, config-based, lazy loading)
12
+ - Layout structure (nested layouts, outlet, wrapper components)
13
+ - Dynamic routes and route parameters
14
+ - Route guards and authentication redirects
15
+ - Error/404 handling
16
+
17
+ 2. Component Patterns
18
+ - Component structure (functional, forwardRef, memo)
19
+ - Props type definition (interface vs type, Generic usage)
20
+ - State management (useState, useReducer, external libraries)
21
+ - Styling approach and exact import paths (e.g., `import styles from './index.module.scss'`, `import { cn } from '@/lib/utils'`)
22
+ - Styling utility functions: record the EXACT import path used in source code
23
+ - UI library and exact package names (e.g., `@mui/material`, `antd`, `@shadcn/ui`)
24
+ - Component classification (UI, Feature, Layout, Page)
25
+ - Component entry file pattern: is the main file `index.tsx` or `ComponentName.tsx`? Record exactly.
26
+ - Directory structure pattern: record exact convention
27
+ - export pattern: default export vs named export in component files
28
+ - Reuse patterns (composition, compound components, render props)
29
+ - Accessibility (ARIA, semantic HTML, keyboard navigation)
30
+
31
+ 3. Data Fetching Patterns
32
+ - Client-side data fetching (TanStack Query, SWR, useEffect, axios)
33
+ - API client configuration (base URL, interceptors, error handling)
34
+ - Request/response typing
35
+ - Caching strategy (query keys, stale time, refetch)
36
+ - Error/loading state handling
37
+ - Optimistic updates
38
+ - Pagination/infinite scroll patterns
39
+
40
+ 4. State Management Patterns
41
+ - Global state (Zustand, Redux Toolkit, Jotai, Recoil, Context)
42
+ - Server state (TanStack Query, SWR)
43
+ - URL state (searchParams, useNavigate)
44
+ - Form state (React Hook Form, Formik)
45
+ - Local component state patterns
46
+
47
+ 5. Configuration/Environment Patterns
48
+ - Environment variable management (VITE_ prefix convention, .env separation)
49
+ - vite.config settings (proxy, aliases, plugins)
50
+ - Build optimization (chunk splitting, dynamic imports)
51
+ - Path aliases (@/, src/)
52
+
53
+ 6. Logging/Monitoring Patterns
54
+ - Client error tracking (Sentry, DataDog RUM)
55
+ - Performance monitoring
56
+ - Analytics tools (Google Analytics, PostHog, Mixpanel)
57
+
58
+ 7. Testing Patterns
59
+ - Test framework (Vitest, Jest, Playwright, Cypress)
60
+ - Component testing (React Testing Library, Storybook)
61
+ - E2E testing strategy
62
+ - Mocking strategy (MSW, vi.mock)
63
+ - Test naming conventions
64
+
65
+ 8. Domain-Specific Patterns
66
+ - Authentication/authorization (session, token, OAuth)
67
+ - Internationalization (i18next, react-intl)
68
+ - File upload patterns
69
+ - Real-time features (WebSocket, SSE)
70
+ - API versioning strategy
71
+
72
+ 9. Anti-patterns / Inconsistencies
73
+ - Patterns inconsistent with other domains
74
+ - Performance issues (unnecessary re-renders, bundle size)
75
+ - Type safety issues
76
+ - Accessibility issues
77
+ - Security issues (XSS, CSRF)
78
+
79
+ Do not create or modify source files. Analysis only.
80
+ Save results to claudeos-core/generated/pass1-{{PASS_NUM}}.json in the following format:
81
+
82
+ {
83
+ "analyzedAt": "ISO timestamp",
84
+ "passNum": {{PASS_NUM}},
85
+ "domains": ["auth", "dashboard", "settings", "shared"],
86
+ "analysisPerDomain": {
87
+ "dashboard": {
88
+ "representativeFiles": {
89
+ "page": "src/pages/dashboard/index.tsx",
90
+ "component": "src/components/dashboard/StatsCard.tsx",
91
+ "hook": "src/hooks/useDashboardData.ts",
92
+ "api": "src/api/dashboard.ts"
93
+ },
94
+ "patterns": {
95
+ "page": { ... },
96
+ "component": {
97
+ "entryFilePattern": "index.tsx or ComponentName.tsx",
98
+ "exportPattern": "default export or named export",
99
+ "stylingImport": "exact import statement used for styling utility",
100
+ "uiLibraryImport": "exact import statement for UI components",
101
+ ...
102
+ },
103
+ "dataFetching": { ... },
104
+ "stateManagement": { ... },
105
+ "config": { ... },
106
+ "logging": { ... },
107
+ "testing": { ... }
108
+ },
109
+ "specialPatterns": [],
110
+ "antiPatterns": []
111
+ }
112
+ },
113
+ "crossDomainCommon": {
114
+ "description": "Patterns commonly used across domains in this group",
115
+ "patterns": []
116
+ }
117
+ }
@@ -0,0 +1,78 @@
1
+ Read all pass1-*.json files from the claudeos-core/generated/ directory and
2
+ merge all domain analysis results into a single unified report.
3
+
4
+ Merge items:
5
+
6
+ 1. Universal Patterns (shared by 100% of all domains)
7
+ - Page/routing structure (React Router / TanStack Router / custom)
8
+ - Component writing conventions (functional, Props types, styling)
9
+ - Data fetching strategy (TanStack Query, SWR, axios patterns)
10
+ - State management approach
11
+ - Error/loading handling patterns
12
+ - Route guard/protection patterns
13
+
14
+ 2. Majority Patterns (shared by 50%+ of domains)
15
+ - Specify which domains share them
16
+
17
+ 3. Domain-Specific Patterns (unique to a single domain)
18
+ - Auth: which domain
19
+ - Real-time features: which domain
20
+ - File upload: which domain
21
+ - i18n: which domain
22
+
23
+ 4. Anti-pattern Summary
24
+ - Consolidate all inconsistencies found across domains
25
+ - Classify by severity (CRITICAL / HIGH / MEDIUM / LOW)
26
+
27
+ 5. Naming Conventions Summary
28
+ - File/directory naming (kebab-case, PascalCase)
29
+ - Component entry file pattern (index.tsx vs ComponentName.tsx — pick ONE that the project actually uses)
30
+ - Component export pattern (default export vs named export)
31
+ - Hook naming (use* prefix)
32
+ - API function patterns
33
+
34
+ 6. Shared Types/Components List
35
+ - Common UI components with EXACT import paths
36
+ - Shared hooks with exact import paths
37
+ - Utility functions with EXACT import paths
38
+ - Path aliases used in the project (e.g., `@/` -> `src/`)
39
+ - Environment variable types
40
+ - Constants/Enum management
41
+
42
+ 7. Security/Authentication Patterns
43
+ - Authentication approach (JWT, session, OAuth)
44
+ - Route protection strategy
45
+ - CSRF/XSS prevention
46
+ - Environment variable management (VITE_ convention)
47
+
48
+ 8. Database Patterns
49
+ - API endpoint conventions
50
+ - Request/response format
51
+ - Error response handling
52
+
53
+ 9. Testing Strategy Summary
54
+ - Test coverage level
55
+ - Test classification system (unit/component/E2E)
56
+ - Mocking strategy (MSW, vi.mock)
57
+ - Storybook usage
58
+ - Test naming conventions
59
+
60
+ 10. Logging/Monitoring Strategy
61
+ - Error tracking approach (Sentry, DataDog)
62
+ - Analytics tools
63
+ - Performance monitoring
64
+
65
+ 11. Performance Patterns
66
+ - Code splitting strategy (lazy, Suspense)
67
+ - Bundle optimization (chunk splitting, tree shaking)
68
+ - Image optimization
69
+ - Caching strategy
70
+
71
+ 12. Code Quality Tools
72
+ - Lint/Format tools (ESLint, Prettier, Biome)
73
+ - Pre-commit hooks (husky, lint-staged)
74
+ - TypeScript strict mode
75
+ - CI integration status
76
+
77
+ Do not generate code. Merge only.
78
+ Save results to claudeos-core/generated/pass2-merged.json.
@@ -0,0 +1,103 @@
1
+ Read claudeos-core/generated/project-analysis.json and
2
+ claudeos-core/generated/pass2-merged.json, then
3
+ generate all ClaudeOS-Core files based on the analysis results.
4
+
5
+ Do not read the original source code again. Reference only the analysis results.
6
+
7
+ CRITICAL — Package Manager Consistency:
8
+ Check `stack.packageManager` in project-analysis.json (e.g., "pnpm", "yarn", "npm").
9
+ ALL generated files MUST use ONLY that detected package manager's commands.
10
+ NEVER mix npm/yarn/pnpm commands. Also check `scripts` field in the project's package.json
11
+ for actual script names.
12
+
13
+ CRITICAL — Cross-file Consistency:
14
+ Rules (.claude/rules/) and Standards (claudeos-core/standard/) MUST NOT contradict each other.
15
+
16
+ CRITICAL — Code Example Accuracy:
17
+ ALL code examples in rules and standards MUST use EXACT method names, class names,
18
+ and signatures from pass2-merged.json analysis data.
19
+ Do NOT paraphrase, rename, or infer API names.
20
+
21
+ CRITICAL — CLAUDE.md Reference Table Completeness:
22
+ The reference table in CLAUDE.md MUST list ALL generated standard files.
23
+
24
+ Generation targets:
25
+
26
+ 1. CLAUDE.md (project root)
27
+ - Role definition (based on detected stack — Vite + React SPA)
28
+ - Build & Run Commands (use ONLY the detected packageManager)
29
+ - Core architecture diagram (client-side SPA, routing, state management)
30
+ - Directory structure description
31
+ - Standard/Skills/Guide reference table
32
+
33
+ 2. claudeos-core/standard/ (active domains only)
34
+ - 00.core/01.project-overview.md — Stack, routing approach, deployment environment
35
+ - 00.core/02.architecture.md — SPA structure, component hierarchy, data flow
36
+ - 00.core/03.naming-conventions.md — File/component/hook/type naming conventions
37
+ - 20.frontend-ui/01.component-patterns.md — Component writing rules, Props patterns, reuse
38
+ - 20.frontend-ui/02.page-routing-patterns.md — Client-side routing, layouts, route guards, lazy loading
39
+ - 20.frontend-ui/03.data-fetching.md — API client, TanStack Query/SWR, caching, error handling
40
+ - 20.frontend-ui/04.state-management.md — Global/server/URL/form state management
41
+ - 20.frontend-ui/05.styling-patterns.md — Styling rules, theming, responsive, accessibility
42
+ - 30.security-db/01.security-auth.md — Auth patterns, token management, route protection, environment variables
43
+ - 40.infra/01.environment-config.md — Environment variables (VITE_ prefix), vite.config, build optimization
44
+ - 40.infra/02.logging-monitoring.md — Error tracking, analytics tools, performance monitoring
45
+ - 40.infra/03.cicd-deployment.md — CI/CD, static hosting deployment (Nginx, S3, Vercel, Netlify)
46
+ - 50.verification/01.development-verification.md — Build, startup, dev server
47
+ - 50.verification/02.testing-strategy.md — Testing strategy (Vitest, RTL, E2E, Storybook)
48
+
49
+ Each file MUST include:
50
+ - Correct examples (code blocks)
51
+ - Incorrect examples (code blocks)
52
+ - Key rules summary table
53
+
54
+ 3. .claude/rules/ (active domains only)
55
+ - Write the full rule content directly in each file (self-contained, no external references)
56
+ - Include 5-15 lines of key rules with concrete examples
57
+ - Do NOT use @import — it is not a Claude Code feature and does not work
58
+ - Each rule file MUST end with a `## Reference` section linking to the corresponding standard file(s):
59
+ ```
60
+ ## Reference
61
+ > For detailed patterns and examples, Read: claudeos-core/standard/20.frontend-ui/01.component-patterns.md
62
+ ```
63
+ - `paths:` frontmatter per rule category:
64
+ - `00.core/*` rules: `paths: ["**/*"]`
65
+ - `20.frontend/*` rules: `paths: ["**/*"]`
66
+ - `30.security-db/*` rules: `paths: ["**/*"]`
67
+ - `40.infra/*` rules: `paths: ["**/*.json", "**/*.env*", "**/vite.config.*", "**/Dockerfile*", "**/*.yml", "**/*.yaml"]`
68
+ - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]`
69
+ - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files.
70
+
71
+ 4. .claude/rules/50.sync/ (3 sync rules)
72
+ - 01.standard-sync.md — Remind AI to update plan/10 when standard is modified
73
+ - 02.rules-sync.md — Remind AI to update plan/20 when rules is modified
74
+ - 03.skills-sync.md — Remind AI to update plan/30 when skills is modified
75
+
76
+ 5. claudeos-core/skills/ (active domains only)
77
+ - 20.frontend-page/01.scaffold-page-feature.md (orchestrator)
78
+ - 20.frontend-page/scaffold-page-feature/01~08 (sub-skills: page, layout, component, hook, api-client, test, style, index)
79
+ - 00.shared/MANIFEST.md (skill registry)
80
+
81
+ 6. claudeos-core/guide/ (all)
82
+ - 01.onboarding/01.overview.md
83
+ - 01.onboarding/02.quickstart.md
84
+ - 01.onboarding/03.glossary.md
85
+ - 02.usage/01.faq.md
86
+ - 02.usage/02.real-world-examples.md
87
+ - 02.usage/03.do-and-dont.md
88
+ - 03.troubleshooting/01.troubleshooting.md
89
+ - 04.architecture/01.file-map.md
90
+ - 04.architecture/02.pros-and-cons.md
91
+
92
+ 7. claudeos-core/plan/ (Master Plan)
93
+ - 10.standard-master.md — CLAUDE.md + all standard/ files as <file> blocks
94
+ - 20.rules-master.md — All rules/ (except sync) as <file> blocks
95
+ - 21.sync-rules-master.md — All sync rules (code block format)
96
+ - 30.frontend-skills-master.md — All frontend skills as <file> blocks
97
+ - 40.guides-master.md — All guide/ files as <file> blocks
98
+
99
+ 8. claudeos-core/database/
100
+ - 01.schema-overview.md — API endpoint catalog, request/response schemas (if applicable)
101
+
102
+ 9. claudeos-core/mcp-guide/
103
+ - 01.mcp-overview.md — List of MCP servers in use, integration methods
@@ -0,0 +1,119 @@
1
+ Read claudeos-core/generated/project-analysis.json and
2
+ perform a deep analysis of the following domains only: {{DOMAIN_GROUP}}
3
+
4
+ For each domain, select one representative file per layer, read its code, and analyze it.
5
+ Prioritize files with the richest patterns.
6
+
7
+ Analysis items (per domain):
8
+
9
+ 1. Route/Blueprint Patterns
10
+ - Blueprint structure (Blueprint registration, url_prefix, naming)
11
+ - Route decorators (@app.route, @bp.route with methods)
12
+ - URL patterns and naming conventions
13
+ - View function structure (function-based vs class-based MethodView)
14
+ - Request handling (request.args, request.form, request.json, request.files)
15
+ - Response patterns (jsonify, make_response, Response, redirect, abort)
16
+ - If a custom response wrapper exists, record its EXACT function/class name, EXACT import path
17
+ - **Response wrapping layer (CRITICAL)**: Which layer formats the response?
18
+ Does the route handler call it directly, or does a service layer return formatted data?
19
+ - Error handling (errorhandler, abort, custom exception classes)
20
+ - Authentication (flask-login, flask-jwt-extended, custom decorators)
21
+ - API documentation (flask-restx, flask-smorest, flasgger)
22
+ - Pagination patterns
23
+
24
+ 2. Data Model Patterns
25
+ - ORM (SQLAlchemy, Flask-SQLAlchemy, Peewee)
26
+ - Model structure (db.Model, relationships, mixins)
27
+ - Serialization (marshmallow, flask-marshmallow, manual to_dict)
28
+ - Form validation (WTForms, Flask-WTF, manual)
29
+ - Request/Response schema separation
30
+ - Enum/constant management
31
+
32
+ 3. Data Access Patterns
33
+ - Session management (db.session, scoped_session)
34
+ - Repository/DAO pattern vs direct model queries
35
+ - Migration (Flask-Migrate / Alembic)
36
+ - Query optimization (eager loading, lazy loading)
37
+ - Connection management (pool, teardown_appcontext)
38
+ - Transaction management
39
+
40
+ 4. Application Structure Patterns
41
+ - Application factory (create_app)
42
+ - Configuration (app.config, from_object, from_envvar)
43
+ - Extension initialization (db.init_app, login_manager.init_app)
44
+ - Context (application context, request context, g, current_app)
45
+ - Before/after request hooks (before_request, after_request, teardown_request)
46
+ - Import paths: record EXACT import conventions
47
+ - Utility function locations: record EXACT module paths
48
+
49
+ 5. Configuration/Environment Patterns
50
+ - Environment variable management (python-dotenv, os.environ)
51
+ - Config classes (DevelopmentConfig, ProductionConfig)
52
+ - Per-environment branching
53
+ - Secret management (SECRET_KEY, database URL)
54
+
55
+ 6. Logging Patterns
56
+ - Logger usage (app.logger, structlog, loguru, logging)
57
+ - Log level policy
58
+ - Request/response logging
59
+ - Error logging
60
+
61
+ 7. Testing Patterns
62
+ - Test framework (pytest, unittest)
63
+ - Test client (app.test_client, pytest fixtures)
64
+ - Application factory testing (create_app with test config)
65
+ - Fixture management (conftest, client fixture)
66
+ - DB test strategy (test DB, SQLite in-memory, transaction rollback)
67
+ - Mocking (unittest.mock, pytest-mock, responses)
68
+
69
+ 8. Domain-Specific Patterns
70
+ - Template rendering (Jinja2, render_template) vs JSON API
71
+ - File upload (request.files, werkzeug FileStorage)
72
+ - Background tasks (Celery, RQ, APScheduler)
73
+ - WebSocket (Flask-SocketIO)
74
+ - External API integration (requests, httpx)
75
+ - Caching (Flask-Caching, Redis)
76
+ - Session management (server-side, Flask-Session)
77
+ - CSRF protection (Flask-WTF CSRFProtect)
78
+
79
+ 9. Anti-patterns / Inconsistencies
80
+ - Circular imports
81
+ - Missing application factory
82
+ - Global state misuse
83
+ - Missing error handlers
84
+ - Security issues (injection, missing CSRF, debug mode in production)
85
+ - Performance issues (blocking I/O, N+1 queries)
86
+
87
+ Do not create or modify source files. Analysis only.
88
+ Save results to claudeos-core/generated/pass1-{{PASS_NUM}}.json in the following format:
89
+
90
+ {
91
+ "analyzedAt": "ISO timestamp",
92
+ "passNum": {{PASS_NUM}},
93
+ "domains": ["auth", "users", "orders", "products"],
94
+ "analysisPerDomain": {
95
+ "users": {
96
+ "representativeFiles": {
97
+ "routes": "app/users/routes.py",
98
+ "models": "app/users/models.py",
99
+ "forms": "app/users/forms.py",
100
+ "services": "app/users/services.py"
101
+ },
102
+ "patterns": {
103
+ "routes": { ... },
104
+ "models": { ... },
105
+ "dataAccess": { ... },
106
+ "appStructure": { ... },
107
+ "config": { ... },
108
+ "logging": { ... },
109
+ "testing": { ... }
110
+ },
111
+ "specialPatterns": [],
112
+ "antiPatterns": []
113
+ }
114
+ },
115
+ "crossDomainCommon": {
116
+ "description": "Patterns commonly used across domains in this group",
117
+ "patterns": []
118
+ }
119
+ }
@@ -0,0 +1,85 @@
1
+ Read all pass1-*.json files from the claudeos-core/generated/ directory and
2
+ merge all domain analysis results into a single unified report.
3
+
4
+ Merge items:
5
+
6
+ 1. Universal Patterns (shared by 100% of all domains)
7
+ - Route/Blueprint style (decorators, response format, status codes)
8
+ - **Response flow**: Which layer wraps the response? (route handler vs service layer)
9
+ Record the definitive answer. If an orchestration layer exists, describe it.
10
+ - Model/serialization conventions (SQLAlchemy, marshmallow)
11
+ - Data access patterns (session management, queries)
12
+ - Application factory structure (create_app, extensions)
13
+ - Error handling patterns
14
+ - Before/after request hooks
15
+
16
+ 2. Majority Patterns (shared by 50%+ of domains)
17
+ - Specify which domains share them
18
+
19
+ 3. Domain-Specific Patterns (unique to a single domain)
20
+ - File upload: which domain
21
+ - WebSocket: which domain
22
+ - Background tasks: which domain
23
+ - External API: which domain
24
+ - Caching: which domain
25
+ - Template rendering: which domain
26
+
27
+ 4. Anti-pattern Summary
28
+ - Consolidate all inconsistencies found across domains
29
+ - Classify by severity (CRITICAL / HIGH / MEDIUM / LOW)
30
+
31
+ 5. Naming Conventions Summary
32
+ - Module/package naming (snake_case)
33
+ - Blueprint naming conventions
34
+ - Model/schema naming conventions
35
+ - Route URL patterns
36
+ - File structure conventions
37
+
38
+ 6. Common Models/Utilities List
39
+ - Base model mixins with EXACT import paths
40
+ - Shared utility functions with EXACT module paths
41
+ - Constants/Enum management with EXACT locations
42
+ - Extension instances (db, login_manager, etc.)
43
+
44
+ 7. Security/Authentication Patterns
45
+ - Authentication method (flask-login, flask-jwt-extended, custom)
46
+ - Authorization decorators (login_required, custom)
47
+ - CSRF protection
48
+ - CORS configuration
49
+ - Environment variable management
50
+
51
+ 8. Database Patterns
52
+ - Table naming (__tablename__)
53
+ - Migration strategy (Flask-Migrate)
54
+ - Seed data management
55
+ - Audit fields (created_at, updated_at)
56
+ - Relationship patterns
57
+ - Index/constraints
58
+
59
+ 9. Testing Strategy Summary
60
+ - Test coverage level
61
+ - Test classification system (unit/integration/E2E)
62
+ - Test client setup (app.test_client)
63
+ - Fixture/Factory strategy
64
+ - Mocking strategy
65
+ - DB test strategy
66
+
67
+ 10. Logging/Monitoring Strategy
68
+ - Logger standard (app.logger vs custom)
69
+ - Log level policy
70
+ - Request/response logging
71
+
72
+ 11. Performance Patterns
73
+ - Caching strategy (Flask-Caching)
74
+ - Connection pool configuration
75
+ - Query optimization
76
+ - Static file serving
77
+
78
+ 12. Code Quality Tools
79
+ - Lint/Format tools (ruff, black, isort, mypy, flake8)
80
+ - Pre-commit hooks
81
+ - Type Checking (mypy, pyright)
82
+ - CI integration status
83
+
84
+ Do not generate code. Merge only.
85
+ Save results to claudeos-core/generated/pass2-merged.json.
@@ -0,0 +1,103 @@
1
+ Read claudeos-core/generated/project-analysis.json and
2
+ claudeos-core/generated/pass2-merged.json, then
3
+ generate all ClaudeOS-Core files based on the analysis results.
4
+
5
+ Do not read the original source code again. Reference only the analysis results.
6
+
7
+ CRITICAL — Package Manager Consistency:
8
+ Check `stack.packageManager` in project-analysis.json (e.g., "poetry", "pipenv", "pip").
9
+ ALL generated files MUST use ONLY that detected package manager's commands.
10
+ NEVER mix pip/poetry/pipenv commands. Also check actual script names in pyproject.toml or Makefile.
11
+
12
+ CRITICAL — Cross-file Consistency:
13
+ Rules (.claude/rules/) and Standards (claudeos-core/standard/) MUST NOT contradict each other.
14
+
15
+ CRITICAL — Code Example Accuracy:
16
+ ALL code examples in rules and standards MUST use EXACT method names, class names,
17
+ and signatures from pass2-merged.json analysis data.
18
+ Do NOT paraphrase, rename, or infer API names.
19
+
20
+ CRITICAL — Response Flow Consistency:
21
+ Determine from pass2-merged.json which layer (route handler vs service layer) formats
22
+ the response. This MUST be identical across architecture.md, route-patterns.md,
23
+ and all rules files.
24
+
25
+ CRITICAL — CLAUDE.md Reference Table Completeness:
26
+ The reference table in CLAUDE.md MUST list ALL generated standard files.
27
+
28
+ Generation targets:
29
+
30
+ 1. CLAUDE.md (project root)
31
+ - Role definition (based on detected stack — Flask)
32
+ - Build & Run Commands (pip/poetry, flask run, gunicorn, docker)
33
+ - Core architecture diagram (application factory, Blueprint structure)
34
+ - Module structure
35
+ - Standard/Skills/Guide reference table
36
+
37
+ 2. claudeos-core/standard/ (active domains only)
38
+ - 00.core/01.project-overview.md — Stack, modules, server info
39
+ - 00.core/02.architecture.md — Application factory, Blueprint hierarchy, request flow
40
+ - 00.core/03.naming-conventions.md — Module/model/blueprint/route naming conventions
41
+ - 10.backend-api/01.route-blueprint-patterns.md — Blueprint structure, route decorators, request/response handling
42
+ - 10.backend-api/02.model-schema-patterns.md — SQLAlchemy models, marshmallow/WTForms serialization
43
+ - 10.backend-api/03.service-patterns.md — Service layer, business logic separation
44
+ - 10.backend-api/04.response-error-patterns.md — Response formatting, error handlers, custom exceptions
45
+ - 30.security-db/01.security-auth.md — Authentication, CSRF, session management, environment variables
46
+ - 30.security-db/02.database-patterns.md — SQLAlchemy patterns, migrations, relationships
47
+ - 40.infra/01.environment-config.md — Config classes, environment variables, extension initialization
48
+ - 40.infra/02.logging-monitoring.md — app.logger, request logging, error tracking
49
+ - 40.infra/03.cicd-deployment.md — CI/CD, gunicorn, Docker deployment
50
+ - 50.verification/01.development-verification.md — Build, startup, flask run
51
+ - 50.verification/02.testing-strategy.md — pytest, test_client, fixtures, DB testing
52
+
53
+ Each file MUST include:
54
+ - Correct examples (code blocks)
55
+ - Incorrect examples (code blocks)
56
+ - Key rules summary table
57
+
58
+ 3. .claude/rules/ (active domains only)
59
+ - Write the full rule content directly in each file (self-contained)
60
+ - Include 5-15 lines of key rules with concrete examples
61
+ - Do NOT use @import
62
+ - Each rule file MUST end with a `## Reference` section linking to the corresponding standard
63
+ - `paths:` frontmatter per rule category:
64
+ - `00.core/*` rules: `paths: ["**/*"]`
65
+ - `10.backend/*` rules: `paths: ["**/*"]`
66
+ - `30.security-db/*` rules: `paths: ["**/*"]`
67
+ - `40.infra/*` rules: `paths: ["**/*.json", "**/*.env*", "**/*.cfg", "**/Dockerfile*", "**/*.yml", "**/*.yaml"]`
68
+ - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]`
69
+ - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files
70
+
71
+ 4. .claude/rules/50.sync/ (3 sync rules)
72
+ - 01.standard-sync.md
73
+ - 02.rules-sync.md
74
+ - 03.skills-sync.md
75
+
76
+ 5. claudeos-core/skills/ (active domains only)
77
+ - 10.backend-crud/01.scaffold-crud-feature.md (orchestrator)
78
+ - 10.backend-crud/scaffold-crud-feature/01~08 (sub-skills: blueprint, routes, model, schema, service, migration, test, index)
79
+ - 00.shared/MANIFEST.md (skill registry)
80
+
81
+ 6. claudeos-core/guide/ (all)
82
+ - 01.onboarding/01.overview.md
83
+ - 01.onboarding/02.quickstart.md
84
+ - 01.onboarding/03.glossary.md
85
+ - 02.usage/01.faq.md
86
+ - 02.usage/02.real-world-examples.md
87
+ - 02.usage/03.do-and-dont.md
88
+ - 03.troubleshooting/01.troubleshooting.md
89
+ - 04.architecture/01.file-map.md
90
+ - 04.architecture/02.pros-and-cons.md
91
+
92
+ 7. claudeos-core/plan/ (Master Plan)
93
+ - 10.standard-master.md — CLAUDE.md + all standard/ files as <file> blocks
94
+ - 20.rules-master.md — All rules/ (except sync) as <file> blocks
95
+ - 21.sync-rules-master.md — All sync rules (code block format)
96
+ - 30.backend-skills-master.md — All backend skills as <file> blocks
97
+ - 40.guides-master.md — All guide/ files as <file> blocks
98
+
99
+ 8. claudeos-core/database/
100
+ - 01.schema-overview.md — DB schema, model relationships, migration guide
101
+
102
+ 9. claudeos-core/mcp-guide/
103
+ - 01.mcp-overview.md — MCP server integration