pdd-skills 3.0.0
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 +1478 -0
- package/bin/pdd.js +354 -0
- package/config/bpmn-rules.yaml +166 -0
- package/config/checkstyle.xml +105 -0
- package/config/eslint.config.js +48 -0
- package/config/pmd.xml +91 -0
- package/config/prd-rules.yaml +113 -0
- package/config/ruff.toml +45 -0
- package/config/sqlfluff.cfg +82 -0
- package/hooks/hook-executor.js +332 -0
- package/index.js +43 -0
- package/lib/api-routes.js +750 -0
- package/lib/api-server.js +408 -0
- package/lib/cache/cache-config.js +209 -0
- package/lib/cache/system-cache.js +852 -0
- package/lib/config-manager.js +373 -0
- package/lib/generate.js +528 -0
- package/lib/grpc/grpc-routes.js +1134 -0
- package/lib/grpc/grpc-server.js +912 -0
- package/lib/grpc/proto-definitions.js +1033 -0
- package/lib/init.js +172 -0
- package/lib/iteration/auto-fixer.js +1025 -0
- package/lib/iteration/auto-reviewer.js +923 -0
- package/lib/iteration/controller.js +577 -0
- package/lib/list.js +130 -0
- package/lib/mcp-server.js +548 -0
- package/lib/openclaw/api-integration.js +535 -0
- package/lib/openclaw/cli-integration.js +567 -0
- package/lib/openclaw/data-sync.js +845 -0
- package/lib/openclaw/openclaw-adapter.js +783 -0
- package/lib/plugin/example-plugins/code-stats/index.js +332 -0
- package/lib/plugin/example-plugins/code-stats/plugin.json +1 -0
- package/lib/plugin/example-plugins/custom-linter/index.js +472 -0
- package/lib/plugin/example-plugins/custom-linter/plugin.json +1 -0
- package/lib/plugin/example-plugins/hello-world/index.js +86 -0
- package/lib/plugin/example-plugins/hello-world/plugin.json +1 -0
- package/lib/plugin/plugin-manager.js +655 -0
- package/lib/plugin/plugin-sdk.js +565 -0
- package/lib/plugin/sandbox.js +627 -0
- package/lib/quality/rules/maintainability.js +418 -0
- package/lib/quality/rules/performance.js +498 -0
- package/lib/quality/rules/readability.js +441 -0
- package/lib/quality/rules/robustness.js +504 -0
- package/lib/quality/rules/security.js +444 -0
- package/lib/quality/scorer.js +576 -0
- package/lib/report.js +669 -0
- package/lib/sdk-base.js +301 -0
- package/lib/sdk-js.js +446 -0
- package/lib/sdk-python/README.md +546 -0
- package/lib/sdk-python/examples/basic_usage.py +450 -0
- package/lib/sdk-python/pdd_sdk/__init__.py +180 -0
- package/lib/sdk-python/pdd_sdk/client.py +1170 -0
- package/lib/sdk-python/pdd_sdk/events.py +423 -0
- package/lib/sdk-python/pdd_sdk/exceptions.py +158 -0
- package/lib/sdk-python/pdd_sdk/models.py +518 -0
- package/lib/sdk-python/pdd_sdk/utils.py +759 -0
- package/lib/token/budget-alert.js +367 -0
- package/lib/token/budget-manager.js +485 -0
- package/lib/update.js +54 -0
- package/lib/utils/logger.js +88 -0
- package/lib/verify.js +741 -0
- package/lib/version.js +52 -0
- package/lib/vm/README.md +102 -0
- package/lib/vm/dashboard/api-routes.js +669 -0
- package/lib/vm/dashboard/server.js +391 -0
- package/lib/vm/dashboard/sse.js +358 -0
- package/lib/vm/dashboard/static/css/dashboard.css +1378 -0
- package/lib/vm/dashboard/static/index.html +118 -0
- package/lib/vm/dashboard/static/js/app.js +949 -0
- package/lib/vm/dashboard/static/js/charts.js +913 -0
- package/lib/vm/dashboard/static/js/kanban-view.js +1053 -0
- package/lib/vm/dashboard/static/js/pipeline-view.js +463 -0
- package/lib/vm/dashboard/static/js/quality-view.js +598 -0
- package/lib/vm/dashboard/static/js/system-view.js +1021 -0
- package/lib/vm/data-provider.js +1191 -0
- package/lib/vm/event-bus.js +402 -0
- package/lib/vm/hooks/extract-hook.js +307 -0
- package/lib/vm/hooks/generate-hook.js +374 -0
- package/lib/vm/hooks/hook-interface.js +458 -0
- package/lib/vm/hooks/report-hook.js +331 -0
- package/lib/vm/hooks/verify-hook.js +454 -0
- package/lib/vm/models.js +1003 -0
- package/lib/vm/reconciler.js +855 -0
- package/lib/vm/scanner.js +988 -0
- package/lib/vm/state-schema.js +955 -0
- package/lib/vm/state-store.js +733 -0
- package/lib/vm/tui/components/card.js +339 -0
- package/lib/vm/tui/components/progress-bar.js +368 -0
- package/lib/vm/tui/components/sparkline.js +327 -0
- package/lib/vm/tui/components/status-light.js +294 -0
- package/lib/vm/tui/components/table.js +370 -0
- package/lib/vm/tui/input.js +335 -0
- package/lib/vm/tui/renderer.js +548 -0
- package/lib/vm/tui/screens/kanban-screen.js +397 -0
- package/lib/vm/tui/screens/overview-screen.js +357 -0
- package/lib/vm/tui/screens/quality-screen.js +336 -0
- package/lib/vm/tui/screens/system-screen.js +379 -0
- package/lib/vm/tui/tui.js +805 -0
- package/package.json +1 -0
- package/scripts/cso-analyzer.js +198 -0
- package/scripts/eval-runner.js +359 -0
- package/scripts/i18n-checker.js +109 -0
- package/scripts/linter/activiti-linter.js +272 -0
- package/scripts/linter/prd-linter.js +162 -0
- package/scripts/linter/report-generator.js +207 -0
- package/scripts/linter/run-linters.js +285 -0
- package/scripts/linter/sql-linter.js +166 -0
- package/scripts/token-analyzer.js +162 -0
- package/scripts/vm-test.js +180 -0
- package/skills/core/official-doc-writer/LICENSE +21 -0
- package/skills/core/official-doc-writer/README.md +232 -0
- package/skills/core/official-doc-writer/SKILL.md +475 -0
- package/skills/core/official-doc-writer/_meta.json +1 -0
- package/skills/core/official-doc-writer/document_generator.py +580 -0
- package/skills/core/official-doc-writer/evals/default-evals.json +1 -0
- package/skills/core/official-doc-writer/examples.md +150 -0
- package/skills/core/official-doc-writer/fonts/FONTS_LIST.md +45 -0
- package/skills/core/official-doc-writer/fonts/README.md +141 -0
- package/skills/core/official-doc-writer/fonts/SIMFANG.TTF +0 -0
- package/skills/core/official-doc-writer/fonts/SIMHEI.TTF +0 -0
- package/skills/core/official-doc-writer/fonts/SIMKAI.TTF +0 -0
- package/skills/core/official-doc-writer/fonts/SIMSUN.TTC +0 -0
- package/skills/core/official-doc-writer/fonts//346/226/271/346/255/243/345/260/217/346/240/207/345/256/213GBK.TTF +0 -0
- package/skills/core/official-doc-writer/references/GBT_9704-2012_/345/205/232/346/224/277/346/234/272/345/205/263/345/205/254/346/226/207/346/240/274/345/274/217.md +422 -0
- package/skills/core/official-doc-writer/scripts/__pycache__/generate_official_doc.cpython-313.pyc +0 -0
- package/skills/core/official-doc-writer/scripts/dialog_manager.py +564 -0
- package/skills/core/official-doc-writer/scripts/generate_official_doc.py +252 -0
- package/skills/core/official-doc-writer/scripts/install_fonts.py +390 -0
- package/skills/core/official-doc-writer/scripts/smart_prompts.py +363 -0
- package/skills/core/pdd-ba/SKILL.md +305 -0
- package/skills/core/pdd-ba/_meta.json +1 -0
- package/skills/core/pdd-ba/evals/default-evals.json +1 -0
- package/skills/core/pdd-code-reviewer/SKILL.md +378 -0
- package/skills/core/pdd-code-reviewer/_meta.json +1 -0
- package/skills/core/pdd-code-reviewer/evals/default-evals.json +1 -0
- package/skills/core/pdd-doc-change/SKILL.md +350 -0
- package/skills/core/pdd-doc-change/_meta.json +1 -0
- package/skills/core/pdd-doc-change/evals/default-evals.json +1 -0
- package/skills/core/pdd-doc-gardener/SKILL.md +248 -0
- package/skills/core/pdd-doc-gardener/_meta.json +1 -0
- package/skills/core/pdd-doc-gardener/evals/default-evals.json +1 -0
- package/skills/core/pdd-entropy-reduction/SKILL.md +360 -0
- package/skills/core/pdd-entropy-reduction/_meta.json +1 -0
- package/skills/core/pdd-entropy-reduction/evals/default-evals.json +1 -0
- package/skills/core/pdd-entropy-reduction/references/entropy-report-template.md +287 -0
- package/skills/core/pdd-entropy-reduction/references/golden-principles.md +573 -0
- package/skills/core/pdd-entropy-reduction/scripts/entropy_scan.py +712 -0
- package/skills/core/pdd-extract-features/SKILL.md +320 -0
- package/skills/core/pdd-extract-features/_meta.json +1 -0
- package/skills/core/pdd-extract-features/evals/default-evals.json +1 -0
- package/skills/core/pdd-generate-spec/SKILL.md +418 -0
- package/skills/core/pdd-generate-spec/_meta.json +1 -0
- package/skills/core/pdd-generate-spec/evals/default-evals.json +1 -0
- package/skills/core/pdd-implement-feature/SKILL.md +332 -0
- package/skills/core/pdd-implement-feature/_meta.json +1 -0
- package/skills/core/pdd-implement-feature/evals/default-evals.json +1 -0
- package/skills/core/pdd-main/SKILL.md +540 -0
- package/skills/core/pdd-main/_meta.json +1 -0
- package/skills/core/pdd-main/evals/default-evals.json +1 -0
- package/skills/core/pdd-main/evals/evals.json +215 -0
- package/skills/core/pdd-verify-feature/SKILL.md +474 -0
- package/skills/core/pdd-verify-feature/_meta.json +1 -0
- package/skills/core/pdd-verify-feature/evals/default-evals.json +1 -0
- package/skills/core/pdd-vm/evals/default-evals.json +1 -0
- package/skills/core/traffic-accident-assessor/LICENSE +29 -0
- package/skills/core/traffic-accident-assessor/SKILL.md +439 -0
- package/skills/core/traffic-accident-assessor/evals/evals.json +1 -0
- package/skills/core/traffic-accident-assessor/references/accident-types.md +369 -0
- package/skills/core/traffic-accident-assessor/references/liability-rules.md +287 -0
- package/skills/core/traffic-accident-assessor/references/traffic-laws.md +226 -0
- package/skills/core/traffic-accident-assessor/references//351/253/230/345/260/224/345/244/253/350/257/264/346/230/216/344/271/246.pdf +32576 -106
- package/skills/core/traffic-accident-assessor/scripts/generate_official_statement.py +588 -0
- package/skills/core/traffic-accident-assessor/scripts/generate_report.py +495 -0
- package/skills/core/traffic-accident-assessor/scripts/generate_statement.py +528 -0
- package/skills/core/traffic-accident-assessor.zip +0 -0
- package/skills/entropy/expert-arch-enforcer/SKILL.md +292 -0
- package/skills/entropy/expert-arch-enforcer/_meta.json +1 -0
- package/skills/entropy/expert-arch-enforcer/evals/default-evals.json +1 -0
- package/skills/entropy/expert-auto-refactor/SKILL.md +327 -0
- package/skills/entropy/expert-auto-refactor/_meta.json +1 -0
- package/skills/entropy/expert-auto-refactor/evals/default-evals.json +1 -0
- package/skills/entropy/expert-code-quality/SKILL.md +468 -0
- package/skills/entropy/expert-code-quality/_meta.json +1 -0
- package/skills/entropy/expert-code-quality/evals/default-evals.json +1 -0
- package/skills/entropy/expert-code-quality/evals/evals.json +109 -0
- package/skills/entropy/expert-code-quality/references/code-smells.md +605 -0
- package/skills/entropy/expert-code-quality/references/design-patterns.md +1111 -0
- package/skills/entropy/expert-code-quality/references/refactoring-catalog.md +1281 -0
- package/skills/entropy/expert-code-quality/references/solid-principles.md +524 -0
- package/skills/entropy/expert-entropy-auditor/SKILL.md +276 -0
- package/skills/entropy/expert-entropy-auditor/_meta.json +1 -0
- package/skills/entropy/expert-entropy-auditor/evals/default-evals.json +1 -0
- package/skills/expert/expert-activiti/SKILL.md +497 -0
- package/skills/expert/expert-activiti/_meta.json +1 -0
- package/skills/expert/expert-mysql/SKILL.md +832 -0
- package/skills/expert/expert-mysql/_meta.json +1 -0
- package/skills/expert/expert-performance/SKILL.md +379 -0
- package/skills/expert/expert-performance/_meta.json +1 -0
- package/skills/expert/expert-performance/evals/default-evals.json +1 -0
- package/skills/expert/expert-ruoyi/SKILL.md +472 -0
- package/skills/expert/expert-ruoyi/_meta.json +1 -0
- package/skills/expert/expert-security/SKILL.md +1341 -0
- package/skills/expert/expert-security/_meta.json +1 -0
- package/skills/expert/expert-security/evals/default-evals.json +1 -0
- package/skills/expert/software-architect/SKILL.md +350 -0
- package/skills/expert/software-architect/_meta.json +1 -0
- package/skills/expert/software-engineer/SKILL.md +437 -0
- package/skills/expert/software-engineer/_meta.json +1 -0
- package/skills/expert/software-engineer/architecture.md +130 -0
- package/skills/expert/software-engineer/patterns.md +151 -0
- package/skills/expert/software-engineer/testing.md +135 -0
- package/skills/expert/system-architect/SKILL.md +628 -0
- package/skills/expert/system-architect/_meta.json +1 -0
- package/skills/expert/system-architect/assets/templates/ARCHITECTURE.md +25 -0
- package/skills/expert/system-architect/assets/templates/README.md +44 -0
- package/skills/expert/system-architect/references/js-ts-standards.md +18 -0
- package/skills/expert/system-architect/references/python-standards.md +19 -0
- package/skills/expert/system-architect/references/scaffolding.md +61 -0
- package/skills/expert/system-architect/references/security-checklist.md +21 -0
- package/skills/openspec/openspec-apply-change/SKILL.md +156 -0
- package/skills/openspec/openspec-apply-change/_meta.json +1 -0
- package/skills/openspec/openspec-archive-change/SKILL.md +114 -0
- package/skills/openspec/openspec-archive-change/_meta.json +1 -0
- package/skills/openspec/openspec-bulk-archive-change/SKILL.md +246 -0
- package/skills/openspec/openspec-bulk-archive-change/_meta.json +1 -0
- package/skills/openspec/openspec-continue-change/SKILL.md +118 -0
- package/skills/openspec/openspec-continue-change/_meta.json +1 -0
- package/skills/openspec/openspec-explore/SKILL.md +288 -0
- package/skills/openspec/openspec-explore/_meta.json +1 -0
- package/skills/openspec/openspec-ff-change/SKILL.md +101 -0
- package/skills/openspec/openspec-ff-change/_meta.json +1 -0
- package/skills/openspec/openspec-new-change/SKILL.md +74 -0
- package/skills/openspec/openspec-new-change/_meta.json +1 -0
- package/skills/openspec/openspec-onboard/SKILL.md +554 -0
- package/skills/openspec/openspec-onboard/_meta.json +1 -0
- package/skills/openspec/openspec-sync-specs/SKILL.md +138 -0
- package/skills/openspec/openspec-sync-specs/_meta.json +1 -0
- package/skills/openspec/openspec-verify-change/SKILL.md +168 -0
- package/skills/openspec/openspec-verify-change/_meta.json +1 -0
- package/skills/pr/pdd-multi-review/SKILL.md +534 -0
- package/skills/pr/pdd-multi-review/_meta.json +1 -0
- package/skills/pr/pdd-pr-batch/SKILL.md +303 -0
- package/skills/pr/pdd-pr-batch/_meta.json +1 -0
- package/skills/pr/pdd-pr-create/SKILL.md +344 -0
- package/skills/pr/pdd-pr-create/_meta.json +1 -0
- package/skills/pr/pdd-pr-merge/SKILL.md +286 -0
- package/skills/pr/pdd-pr-merge/_meta.json +1 -0
- package/skills/pr/pdd-pr-review/SKILL.md +217 -0
- package/skills/pr/pdd-pr-review/_meta.json +1 -0
- package/skills/pr/pdd-task-manager/SKILL.md +636 -0
- package/skills/pr/pdd-task-manager/_meta.json +1 -0
- package/skills/pr/pdd-template-engine/SKILL.md +306 -0
- package/skills/pr/pdd-template-engine/_meta.json +1 -0
- package/templates/behavior-shaping/iron-law-template.md +87 -0
- package/templates/behavior-shaping/rationalization-template.md +62 -0
- package/templates/behavior-shaping/red-flags-template.md +70 -0
- package/templates/bilingual-template.md +139 -0
- package/templates/config/default.yaml +47 -0
- package/templates/project/default/README.md +31 -0
- package/templates/project/frontend/README.md +46 -0
- package/templates/project/java/README.md +48 -0
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-architect
|
|
3
|
+
description: "Senior System Architect designing robust, scalable architectures with security best practices. Invoke when starting new projects or discussing system design."
|
|
4
|
+
license: "MIT"
|
|
5
|
+
author: "neuqik@hotmail.com"
|
|
6
|
+
version: "2.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# System Architect
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
This skill serves as a **Technical Lead** role, responsible for:
|
|
14
|
+
- Project scaffolding and structure setup
|
|
15
|
+
- Technology stack decision-making
|
|
16
|
+
- Code standards enforcement
|
|
17
|
+
- Documentation template creation
|
|
18
|
+
|
|
19
|
+
**Note**: This is a high-level system architecture skill focused on project initialization and technology stack selection. For detailed architecture design, please use **software-architect**.
|
|
20
|
+
|
|
21
|
+
## Directory Structure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
system-architect/
|
|
25
|
+
├── SKILL.md # Skill definition file
|
|
26
|
+
├── LICENSE # MIT License
|
|
27
|
+
└── assets/
|
|
28
|
+
└── templates/ # Configuration templates
|
|
29
|
+
├── README.md
|
|
30
|
+
├── ARCHITECTURE.md
|
|
31
|
+
└── .editorconfig
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Trigger Conditions
|
|
35
|
+
|
|
36
|
+
**Auto-trigger:**
|
|
37
|
+
- Starting a new project or application
|
|
38
|
+
- Selecting technology stack (language, framework, database)
|
|
39
|
+
- Setting up project structure and scaffolding
|
|
40
|
+
- Defining code standards and linting rules
|
|
41
|
+
- Creating project documentation (README, ARCHITECTURE)
|
|
42
|
+
- Refactoring project structure
|
|
43
|
+
|
|
44
|
+
**Manual trigger:**
|
|
45
|
+
- User inputs commands like `/system-architect`, `/new-project`, `/setup`, etc.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Core Capabilities
|
|
50
|
+
|
|
51
|
+
### 1. Technology Stack Selection Guide
|
|
52
|
+
|
|
53
|
+
#### 1.1 Backend Technologies
|
|
54
|
+
|
|
55
|
+
| Technology | Use Cases | Pros | Cons |
|
|
56
|
+
|------|---------|------|------|
|
|
57
|
+
| **Python (FastAPI)** | API, microservices, ML/AI | Rapid development, async support, type hints | GIL limits CPU-intensive tasks |
|
|
58
|
+
| **Python (Django)** | Full-featured web applications | Batteries included, Admin panel, ORM | Monolithic, slower for APIs |
|
|
59
|
+
| **Java (Spring Boot)** | Enterprise applications | Mature ecosystem, strong typing | Verbose, heavyweight |
|
|
60
|
+
| **Node.js (Express)** | Real-time applications, APIs | JavaScript full-stack, fast I/O | Callback hell (use async/await) |
|
|
61
|
+
| **Go** | High-performance services | Fast, simple, excellent concurrency | Smaller ecosystem |
|
|
62
|
+
| **Rust** | Systems programming, performance | Memory safe, zero-cost abstractions | Steep learning curve |
|
|
63
|
+
|
|
64
|
+
#### 1.2 Frontend Technologies
|
|
65
|
+
|
|
66
|
+
| Technology | Use Cases | Pros | Cons |
|
|
67
|
+
|------|---------|------|------|
|
|
68
|
+
| **React** | SPA, complex UI | Large ecosystem, flexible | Need to choose libraries |
|
|
69
|
+
| **Vue.js** | SPA, progressive enhancement | Easy to learn, complete framework | Smaller ecosystem than React |
|
|
70
|
+
| **Angular** | Enterprise applications | Complete framework, TypeScript | Steep learning curve, verbose |
|
|
71
|
+
| **Svelte** | Performance-critical applications | No virtual DOM, small bundle | Smaller ecosystem |
|
|
72
|
+
|
|
73
|
+
#### 1.3 Databases
|
|
74
|
+
|
|
75
|
+
| Database | Use Cases | Pros | Cons |
|
|
76
|
+
|--------|---------|------|------|
|
|
77
|
+
| **PostgreSQL** | Relational data, ACID required | ACID, advanced features, JSONB | Vertical scaling limits |
|
|
78
|
+
| **MySQL** | Simple web applications | Widely adopted, easy setup | Fewer advanced features |
|
|
79
|
+
| **MongoDB** | Document storage, flexible schema | Flexible schema, horizontal scaling | No ACID transactions before 4.0 |
|
|
80
|
+
| **Redis** | Caching, sessions, queues | Extremely fast, versatile | Memory limitations |
|
|
81
|
+
| **Elasticsearch** | Search, log analysis | Full-text search, analytics | Resource intensive |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### 2. Project Structure Templates
|
|
86
|
+
|
|
87
|
+
#### 2.1 Python Project Structure
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
project-name/
|
|
91
|
+
├── src/
|
|
92
|
+
│ ├── __init__.py
|
|
93
|
+
│ ├── main.py # Application entry point
|
|
94
|
+
│ ├── config/ # Configuration management
|
|
95
|
+
│ │ ├── __init__.py
|
|
96
|
+
│ │ ├── settings.py
|
|
97
|
+
│ │ └── logging.py
|
|
98
|
+
│ ├── api/ # API endpoints
|
|
99
|
+
│ │ ├── __init__.py
|
|
100
|
+
│ │ ├── routes/
|
|
101
|
+
│ │ └── dependencies.py
|
|
102
|
+
│ ├── services/ # Business logic
|
|
103
|
+
│ │ ├── __init__.py
|
|
104
|
+
│ │ └── user_service.py
|
|
105
|
+
│ ├── models/ # Data models
|
|
106
|
+
│ │ ├── __init__.py
|
|
107
|
+
│ │ ├── domain/ # Domain models
|
|
108
|
+
│ │ └── db/ # Database models
|
|
109
|
+
│ ├── repositories/ # Data access
|
|
110
|
+
│ │ ├── __init__.py
|
|
111
|
+
│ │ └── user_repository.py
|
|
112
|
+
│ └── utils/ # Utility functions
|
|
113
|
+
│ ├── __init__.py
|
|
114
|
+
│ └── helpers.py
|
|
115
|
+
├── tests/
|
|
116
|
+
│ ├── __init__.py
|
|
117
|
+
│ ├── unit/
|
|
118
|
+
│ ├── integration/
|
|
119
|
+
│ └── conftest.py
|
|
120
|
+
├── docs/
|
|
121
|
+
│ ├── README.md
|
|
122
|
+
│ └── ARCHITECTURE.md
|
|
123
|
+
├── scripts/
|
|
124
|
+
│ └── setup.sh
|
|
125
|
+
├── .env.example
|
|
126
|
+
├── .gitignore
|
|
127
|
+
├── requirements.txt
|
|
128
|
+
├── requirements-dev.txt
|
|
129
|
+
├── pyproject.toml
|
|
130
|
+
├── Dockerfile
|
|
131
|
+
├── docker-compose.yml
|
|
132
|
+
└── README.md
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### 2.2 Node.js/TypeScript Project Structure
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
project-name/
|
|
139
|
+
├── src/
|
|
140
|
+
│ ├── index.ts # Application entry point
|
|
141
|
+
│ ├── config/ # Configuration
|
|
142
|
+
│ │ ├── index.ts
|
|
143
|
+
│ │ └── database.ts
|
|
144
|
+
│ ├── routes/ # API routes
|
|
145
|
+
│ │ ├── index.ts
|
|
146
|
+
│ │ └── userRoutes.ts
|
|
147
|
+
│ ├── controllers/ # Request handlers
|
|
148
|
+
│ │ └── userController.ts
|
|
149
|
+
│ ├── services/ # Business logic
|
|
150
|
+
│ │ └── userService.ts
|
|
151
|
+
│ ├── models/ # Data models
|
|
152
|
+
│ │ └── User.ts
|
|
153
|
+
│ ├── repositories/ # Data access
|
|
154
|
+
│ │ └── userRepository.ts
|
|
155
|
+
│ ├── middleware/ # Express middleware
|
|
156
|
+
│ │ ├── auth.ts
|
|
157
|
+
│ │ └── errorHandler.ts
|
|
158
|
+
│ ├── types/ # TypeScript types
|
|
159
|
+
│ │ └── index.ts
|
|
160
|
+
│ └── utils/ # Utility functions
|
|
161
|
+
│ └── helpers.ts
|
|
162
|
+
├── tests/
|
|
163
|
+
│ ├── unit/
|
|
164
|
+
│ ├── integration/
|
|
165
|
+
│ └── setup.ts
|
|
166
|
+
├── docs/
|
|
167
|
+
│ ├── README.md
|
|
168
|
+
│ └── ARCHITECTURE.md
|
|
169
|
+
├── scripts/
|
|
170
|
+
│ └── setup.sh
|
|
171
|
+
├── .env.example
|
|
172
|
+
├── .gitignore
|
|
173
|
+
├── package.json
|
|
174
|
+
├── tsconfig.json
|
|
175
|
+
├── eslint.config.js
|
|
176
|
+
├── Dockerfile
|
|
177
|
+
├── docker-compose.yml
|
|
178
|
+
└── README.md
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### 3. Configuration Templates
|
|
184
|
+
|
|
185
|
+
#### 3.1 .editorconfig
|
|
186
|
+
|
|
187
|
+
```ini
|
|
188
|
+
# EditorConfig - https://editorconfig.org
|
|
189
|
+
|
|
190
|
+
root = true
|
|
191
|
+
|
|
192
|
+
[*]
|
|
193
|
+
charset = utf-8
|
|
194
|
+
end_of_line = lf
|
|
195
|
+
insert_final_newline = true
|
|
196
|
+
trim_trailing_whitespace = true
|
|
197
|
+
|
|
198
|
+
[*.{py,js,ts,json,yml,yaml}]
|
|
199
|
+
indent_style = space
|
|
200
|
+
indent_size = 2
|
|
201
|
+
|
|
202
|
+
[*.md]
|
|
203
|
+
trim_trailing_whitespace = false
|
|
204
|
+
|
|
205
|
+
[Makefile]
|
|
206
|
+
indent_style = tab
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### 3.2 Python pyproject.toml
|
|
210
|
+
|
|
211
|
+
```toml
|
|
212
|
+
[tool.poetry]
|
|
213
|
+
name = "project-name"
|
|
214
|
+
version = "0.1.0"
|
|
215
|
+
description = "Project description"
|
|
216
|
+
authors = ["Your Name <your.email@example.com>"]
|
|
217
|
+
|
|
218
|
+
[tool.poetry.dependencies]
|
|
219
|
+
python = "^3.10"
|
|
220
|
+
fastapi = "^0.104.0"
|
|
221
|
+
uvicorn = "^0.24.0"
|
|
222
|
+
sqlalchemy = "^2.0.0"
|
|
223
|
+
pydantic = "^2.0.0"
|
|
224
|
+
python-dotenv = "^1.0.0"
|
|
225
|
+
|
|
226
|
+
[tool.poetry.dev-dependencies]
|
|
227
|
+
pytest = "^7.4.0"
|
|
228
|
+
pytest-cov = "^4.1.0"
|
|
229
|
+
black = "^23.10.0"
|
|
230
|
+
flake8 = "^6.1.0"
|
|
231
|
+
mypy = "^1.6.0"
|
|
232
|
+
|
|
233
|
+
[tool.black]
|
|
234
|
+
line-length = 100
|
|
235
|
+
target-version = ['py310']
|
|
236
|
+
|
|
237
|
+
[tool.mypy]
|
|
238
|
+
python_version = "3.10"
|
|
239
|
+
warn_return_any = true
|
|
240
|
+
warn_unused_configs = true
|
|
241
|
+
disallow_untyped_defs = true
|
|
242
|
+
|
|
243
|
+
[build-system]
|
|
244
|
+
requires = ["poetry-core"]
|
|
245
|
+
build-backend = "poetry.core.masonry.api"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
#### 3.3 TypeScript tsconfig.json
|
|
249
|
+
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"compilerOptions": {
|
|
253
|
+
"target": "ES2022",
|
|
254
|
+
"module": "NodeNext",
|
|
255
|
+
"moduleResolution": "NodeNext",
|
|
256
|
+
"lib": ["ES2022"],
|
|
257
|
+
"outDir": "./dist",
|
|
258
|
+
"rootDir": "./src",
|
|
259
|
+
"strict": true,
|
|
260
|
+
"esModuleInterop": true,
|
|
261
|
+
"skipLibCheck": true,
|
|
262
|
+
"forceConsistentCasingInFileNames": true,
|
|
263
|
+
"resolveJsonModule": true,
|
|
264
|
+
"declaration": true,
|
|
265
|
+
"declarationMap": true,
|
|
266
|
+
"sourceMap": true,
|
|
267
|
+
"noImplicitAny": true,
|
|
268
|
+
"strictNullChecks": true,
|
|
269
|
+
"strictFunctionTypes": true,
|
|
270
|
+
"noUnusedLocals": true,
|
|
271
|
+
"noUnusedParameters": true,
|
|
272
|
+
"noImplicitReturns": true,
|
|
273
|
+
"noFallthroughCasesInSwitch": true
|
|
274
|
+
},
|
|
275
|
+
"include": ["src/**/*"],
|
|
276
|
+
"exclude": ["node_modules", "dist", "tests"]
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### 3.4 ESLint Configuration
|
|
281
|
+
|
|
282
|
+
```javascript
|
|
283
|
+
import js from '@eslint/js';
|
|
284
|
+
import ts from 'typescript-eslint';
|
|
285
|
+
import prettier from 'eslint-config-prettier';
|
|
286
|
+
|
|
287
|
+
export default [
|
|
288
|
+
js.configs.recommended,
|
|
289
|
+
...ts.configs.recommended,
|
|
290
|
+
prettier,
|
|
291
|
+
{
|
|
292
|
+
rules: {
|
|
293
|
+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
294
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
295
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
296
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
];
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### 4. Documentation Templates
|
|
305
|
+
|
|
306
|
+
#### 4.1 README Template
|
|
307
|
+
|
|
308
|
+
```markdown
|
|
309
|
+
# Project Name
|
|
310
|
+
|
|
311
|
+
Brief description of what this project does.
|
|
312
|
+
|
|
313
|
+
## Features
|
|
314
|
+
|
|
315
|
+
- Feature 1
|
|
316
|
+
- Feature 2
|
|
317
|
+
- Feature 3
|
|
318
|
+
|
|
319
|
+
## Quick Start
|
|
320
|
+
|
|
321
|
+
### Prerequisites
|
|
322
|
+
|
|
323
|
+
- Python 3.10+ / Node.js 18+
|
|
324
|
+
- Docker and Docker Compose
|
|
325
|
+
- PostgreSQL 14+ (if not using Docker)
|
|
326
|
+
|
|
327
|
+
### Installation
|
|
328
|
+
|
|
329
|
+
\`\`\`bash
|
|
330
|
+
# Clone the repository
|
|
331
|
+
git clone https://github.com/your-org/project-name.git
|
|
332
|
+
cd project-name
|
|
333
|
+
|
|
334
|
+
# Install dependencies
|
|
335
|
+
pip install -r requirements.txt # Python
|
|
336
|
+
# or
|
|
337
|
+
npm install # Node.js
|
|
338
|
+
|
|
339
|
+
# Set up environment variables
|
|
340
|
+
cp .env.example .env
|
|
341
|
+
# Edit .env with your configuration
|
|
342
|
+
|
|
343
|
+
# Run the application
|
|
344
|
+
python src/main.py # Python
|
|
345
|
+
# or
|
|
346
|
+
npm run dev # Node.js
|
|
347
|
+
\`\`\`
|
|
348
|
+
|
|
349
|
+
### Docker Setup
|
|
350
|
+
|
|
351
|
+
\`\`\`bash
|
|
352
|
+
# Build and run with Docker Compose
|
|
353
|
+
docker-compose up -d
|
|
354
|
+
|
|
355
|
+
# View logs
|
|
356
|
+
docker-compose logs -f
|
|
357
|
+
|
|
358
|
+
# Stop services
|
|
359
|
+
docker-compose down
|
|
360
|
+
\`\`\`
|
|
361
|
+
|
|
362
|
+
## Project Structure
|
|
363
|
+
|
|
364
|
+
\`\`\`
|
|
365
|
+
project-name/
|
|
366
|
+
├── src/ # Source code
|
|
367
|
+
│ ├── api/ # API endpoints
|
|
368
|
+
│ ├── services/ # Business logic
|
|
369
|
+
│ ├── models/ # Data models
|
|
370
|
+
│ └── repositories/ # Data access
|
|
371
|
+
├── tests/ # Test files
|
|
372
|
+
├── docs/ # Documentation
|
|
373
|
+
└── scripts/ # Utility scripts
|
|
374
|
+
\`\`\`
|
|
375
|
+
|
|
376
|
+
## API Documentation
|
|
377
|
+
|
|
378
|
+
API documentation is available at `/docs` when running the application.
|
|
379
|
+
|
|
380
|
+
## Testing
|
|
381
|
+
|
|
382
|
+
\`\`\`bash
|
|
383
|
+
# Run all tests
|
|
384
|
+
pytest # Python
|
|
385
|
+
# or
|
|
386
|
+
npm test # Node.js
|
|
387
|
+
|
|
388
|
+
# Run with coverage
|
|
389
|
+
pytest --cov=src # Python
|
|
390
|
+
# or
|
|
391
|
+
npm run test:coverage # Node.js
|
|
392
|
+
\`\`\`
|
|
393
|
+
|
|
394
|
+
## Contributing
|
|
395
|
+
|
|
396
|
+
1. Fork the repository
|
|
397
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
398
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
399
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
400
|
+
5. Open a Pull Request
|
|
401
|
+
|
|
402
|
+
## License
|
|
403
|
+
|
|
404
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
#### 4.2 ARCHITECTURE Template
|
|
408
|
+
|
|
409
|
+
```markdown
|
|
410
|
+
# Architecture Overview
|
|
411
|
+
|
|
412
|
+
## System Components
|
|
413
|
+
|
|
414
|
+
### Component Diagram
|
|
415
|
+
|
|
416
|
+
\`\`\`mermaid
|
|
417
|
+
graph TB
|
|
418
|
+
Client[Client Application]
|
|
419
|
+
API[API Layer]
|
|
420
|
+
Service[Service Layer]
|
|
421
|
+
Repository[Repository Layer]
|
|
422
|
+
DB[(Database)]
|
|
423
|
+
Cache[(Redis Cache)]
|
|
424
|
+
|
|
425
|
+
Client --> API
|
|
426
|
+
API --> Service
|
|
427
|
+
Service --> Repository
|
|
428
|
+
Repository --> DB
|
|
429
|
+
Service --> Cache
|
|
430
|
+
\`\`\`
|
|
431
|
+
|
|
432
|
+
## Data Flow
|
|
433
|
+
|
|
434
|
+
1. **Request Flow**: Client → API → Service → Repository → Database
|
|
435
|
+
2. **Response Flow**: Database → Repository → Service → API → Client
|
|
436
|
+
3. **Caching**: Service checks Cache before Repository
|
|
437
|
+
|
|
438
|
+
## Technology Stack
|
|
439
|
+
|
|
440
|
+
| Component | Technology | Justification |
|
|
441
|
+
|-----------|------------|---------------|
|
|
442
|
+
| Backend | FastAPI/Express | Fast, async, type-safe |
|
|
443
|
+
| Database | PostgreSQL | ACID compliance, JSONB support |
|
|
444
|
+
| Cache | Redis | Fast in-memory caching |
|
|
445
|
+
| Container | Docker | Consistent deployment |
|
|
446
|
+
|
|
447
|
+
## Key Decisions
|
|
448
|
+
|
|
449
|
+
### Decision 1: Use PostgreSQL for Primary Database
|
|
450
|
+
|
|
451
|
+
**Context**: Need reliable data storage for financial transactions.
|
|
452
|
+
|
|
453
|
+
**Decision**: PostgreSQL with SQLAlchemy ORM.
|
|
454
|
+
|
|
455
|
+
**Consequences**:
|
|
456
|
+
- ✅ ACID compliance
|
|
457
|
+
- ✅ Strong ecosystem
|
|
458
|
+
- ❌ Vertical scaling limits
|
|
459
|
+
|
|
460
|
+
**Alternatives Considered**: MySQL (fewer features), MongoDB (no ACID)
|
|
461
|
+
|
|
462
|
+
### Decision 2: Layered Architecture
|
|
463
|
+
|
|
464
|
+
**Context**: Need maintainable codebase with clear separation of concerns.
|
|
465
|
+
|
|
466
|
+
**Decision**: Three-layer architecture (API → Service → Repository).
|
|
467
|
+
|
|
468
|
+
**Consequences**:
|
|
469
|
+
- ✅ Clear separation of concerns
|
|
470
|
+
- ✅ Easy to test
|
|
471
|
+
- ❌ More files to maintain
|
|
472
|
+
|
|
473
|
+
## Security
|
|
474
|
+
|
|
475
|
+
- **Authentication**: JWT tokens with refresh mechanism
|
|
476
|
+
- **Authorization**: Role-based access control (RBAC)
|
|
477
|
+
- **Data Protection**: Encryption at rest and in transit
|
|
478
|
+
- **Input Validation**: Pydantic/Joi validation on all inputs
|
|
479
|
+
|
|
480
|
+
## Scalability
|
|
481
|
+
|
|
482
|
+
- **Horizontal Scaling**: Stateless services behind load balancer
|
|
483
|
+
- **Database Scaling**: Read replicas for read-heavy workloads
|
|
484
|
+
- **Caching**: Redis for frequently accessed data
|
|
485
|
+
- **Async Processing**: Background jobs for long-running tasks
|
|
486
|
+
|
|
487
|
+
## Deployment
|
|
488
|
+
|
|
489
|
+
- **Containerization**: Docker for consistent environments
|
|
490
|
+
- **Orchestration**: Kubernetes for production (optional)
|
|
491
|
+
- **CI/CD**: GitHub Actions for automated deployment
|
|
492
|
+
- **Monitoring**: Prometheus + Grafana for metrics
|
|
493
|
+
|
|
494
|
+
## Development Workflow
|
|
495
|
+
|
|
496
|
+
1. **Local Development**: Docker Compose for all dependencies
|
|
497
|
+
2. **Testing**: Unit tests + integration tests + E2E tests
|
|
498
|
+
3. **Code Review**: Required for all changes
|
|
499
|
+
4. **Deployment**: Automated via CI/CD pipeline
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
### 5. Decision Framework
|
|
505
|
+
|
|
506
|
+
When selecting technologies or making architectural decisions, follow this process:
|
|
507
|
+
|
|
508
|
+
1. **Understand Requirements**
|
|
509
|
+
- Functional requirements
|
|
510
|
+
- Non-functional requirements (performance, scalability, security)
|
|
511
|
+
- Constraints (budget, team skills, timeline)
|
|
512
|
+
|
|
513
|
+
2. **Generate Options**
|
|
514
|
+
- List at least 3 alternatives
|
|
515
|
+
- Consider build vs buy vs open source
|
|
516
|
+
|
|
517
|
+
3. **Evaluate Trade-offs**
|
|
518
|
+
- Performance vs maintainability
|
|
519
|
+
- Cost vs features
|
|
520
|
+
- Learning curve vs productivity
|
|
521
|
+
|
|
522
|
+
4. **Make Decision**
|
|
523
|
+
- Document the decision
|
|
524
|
+
- Document the rationale
|
|
525
|
+
- Document alternatives considered
|
|
526
|
+
|
|
527
|
+
5. **Validate**
|
|
528
|
+
- Prototype if necessary
|
|
529
|
+
- Get team buy-in
|
|
530
|
+
- Plan migration if needed
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
### 6. Collaboration Table
|
|
535
|
+
|
|
536
|
+
#### 6.1 Collaboration with Other Skills
|
|
537
|
+
|
|
538
|
+
| Collaborating Skill | Collaboration Mode | Description |
|
|
539
|
+
|---------|---------|------|
|
|
540
|
+
| **software-architect** | Delegate | After project initialization, delegate detailed architecture design |
|
|
541
|
+
| **software-engineer** | Delegate | Delegate specific feature implementation |
|
|
542
|
+
| **expert-code-quality** | Consult | Consult before establishing code standards |
|
|
543
|
+
| **pdd-main** | Sequential | Use PDD framework process for new projects |
|
|
544
|
+
| **expert-mysql** | Consult | Consult before database selection |
|
|
545
|
+
| **expert-ruoyi** | Consult | Consult when using RuoYi framework for Java projects |
|
|
546
|
+
|
|
547
|
+
#### 6.2 Collaboration Workflow
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
New Project Startup
|
|
551
|
+
↓
|
|
552
|
+
Invoke system-architect
|
|
553
|
+
↓
|
|
554
|
+
Project scaffolding + Technology stack selection
|
|
555
|
+
↓
|
|
556
|
+
(If detailed architecture design needed) → Invoke software-architect
|
|
557
|
+
↓
|
|
558
|
+
(If code implementation needed) → Invoke software-engineer
|
|
559
|
+
↓
|
|
560
|
+
(If code quality check needed) → Invoke expert-code-quality
|
|
561
|
+
↓
|
|
562
|
+
Project initialization complete
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
### 7. Rules
|
|
568
|
+
|
|
569
|
+
1. **Security First**: All decisions prioritize security
|
|
570
|
+
2. **Scalability**: Design for growth from the start
|
|
571
|
+
3. **Minimization**: Follow YAGNI (You Aren't Gonna Need It) principle
|
|
572
|
+
4. **Containerization**: Use Docker by default for deployment
|
|
573
|
+
5. **Linting**: Enforce strict code quality standards
|
|
574
|
+
|
|
575
|
+
---
|
|
576
|
+
|
|
577
|
+
### 8. Quick Diagnosis Mode
|
|
578
|
+
|
|
579
|
+
#### 8.1 Technology Stack Quick Diagnosis
|
|
580
|
+
|
|
581
|
+
| Problem Symptoms | Suggested Technology |
|
|
582
|
+
|---------|---------|
|
|
583
|
+
| Rapid API development | FastAPI (Python) / Express (Node.js) |
|
|
584
|
+
| Enterprise applications | Spring Boot (Java) / Django (Python) |
|
|
585
|
+
| High concurrency services | Go / Java |
|
|
586
|
+
| Real-time applications | Node.js / Socket.io |
|
|
587
|
+
| Microservices architecture | Go / Java / Node.js |
|
|
588
|
+
| Data analysis | Python (pandas, numpy) |
|
|
589
|
+
| AI/ML integration | Python (TensorFlow, PyTorch) |
|
|
590
|
+
|
|
591
|
+
#### 8.2 Project Structure Quick Diagnosis
|
|
592
|
+
|
|
593
|
+
| Scenario | Suggested Structure |
|
|
594
|
+
|------|---------|
|
|
595
|
+
| Monolithic application | Layered structure (api/service/repo) |
|
|
596
|
+
| Microservices | Independent service directories + shared libraries |
|
|
597
|
+
| Event-driven | Directories organized by domain/event type |
|
|
598
|
+
| Hexagonal architecture | core/ports/adapters |
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
### 9. Guardrails
|
|
603
|
+
|
|
604
|
+
- Technology stack selection must consider existing team skills
|
|
605
|
+
- Project structure must follow industry standards and best practices
|
|
606
|
+
- Security must be a default consideration
|
|
607
|
+
- Must provide clear documentation and configuration templates
|
|
608
|
+
- Decisions must include trade-off analysis and alternatives
|
|
609
|
+
|
|
610
|
+
---
|
|
611
|
+
|
|
612
|
+
## Version History
|
|
613
|
+
|
|
614
|
+
### v2.0 (2026-03-21)
|
|
615
|
+
- Unified to English descriptions
|
|
616
|
+
- Added collaboration table to clarify relationships with other skills
|
|
617
|
+
- Enhanced quick diagnosis mode
|
|
618
|
+
- Added decision framework
|
|
619
|
+
- Standardized output format
|
|
620
|
+
|
|
621
|
+
### v1.0 (Initial version)
|
|
622
|
+
- Basic project scaffolding templates
|
|
623
|
+
- Technology stack selection guide
|
|
624
|
+
- Configuration templates
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
> **Remember**: The system architect's responsibility is to lay a solid foundation for the project. Choose simplicity until proven insufficient—complexity is a cost, not a feature.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name": "system-architect", "version": "1.0.0", "category": "expert", "description": "Senior System Architect designing robust, scalable, and maintainable software architectures. Enforces industry standards (PEP 8 for Python, ESLint for JS/TS), modular design, and security best practices. Invoke when starting new projects, refactoring existing ones, or discussing high-level system design decisions. 支持中文触发:系统架构、架构设计、技术选型、项目初始化、系统设计、架构评审。", "triggers": ["系统架构", "架构设计", "技术选型", "项目初始化", "架构评审"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Architecture: {{project_name}}
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
High-level description of the system: purpose, main users, and key constraints.
|
|
5
|
+
|
|
6
|
+
## Components
|
|
7
|
+
|
|
8
|
+
| Component | Responsibility | Tech |
|
|
9
|
+
|-----------|----------------|------|
|
|
10
|
+
| [Frontend/API/Worker] | [Brief responsibility] | [Stack] |
|
|
11
|
+
|
|
12
|
+
## Data Flow
|
|
13
|
+
- Describe request/response paths.
|
|
14
|
+
- Note async flows (queues, events) if any.
|
|
15
|
+
|
|
16
|
+
## Deployment
|
|
17
|
+
- **Runtime**: [Docker / K8s / Serverless]
|
|
18
|
+
- **Environments**: dev, staging, prod
|
|
19
|
+
- **Secrets**: env vars / vault; never in repo.
|
|
20
|
+
|
|
21
|
+
## Decisions
|
|
22
|
+
- **ADR-001**: [Title] – [One-line summary and link or short rationale.]
|
|
23
|
+
|
|
24
|
+
## Diagrams
|
|
25
|
+
Use Mermaid in this doc or link to `docs/diagrams/`. Keep node IDs safe (no spaces, quoted labels).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Project:
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Brief description of the project.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### Node / TypeScript
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
git clone ...
|
|
13
|
+
npm install
|
|
14
|
+
npm run dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Python
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
git clone ...
|
|
21
|
+
python3 -m venv .venv
|
|
22
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
23
|
+
pip install -e .
|
|
24
|
+
pytest
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Architecture
|
|
28
|
+
|
|
29
|
+
- **Frontend**: [React/Vue/Next.js]
|
|
30
|
+
- **Backend**: [Node/Python/Go]
|
|
31
|
+
- **Database**: [Postgres/MySQL/SQLite]
|
|
32
|
+
- **Cache**: [Redis/Memcached]
|
|
33
|
+
|
|
34
|
+
See [ARCHITECTURE.md](ARCHITECTURE.md) for components, data flow, and decisions.
|
|
35
|
+
|
|
36
|
+
## Development Standards
|
|
37
|
+
|
|
38
|
+
- Use pre-commit hooks (e.g. `husky` for Node, `pre-commit` for Python).
|
|
39
|
+
- Lint and format before pushing.
|
|
40
|
+
- Unit tests required for new features.
|
|
41
|
+
|
|
42
|
+
## Contributors
|
|
43
|
+
|
|
44
|
+
- [Your Name]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# JavaScript/TypeScript Development Standards
|
|
2
|
+
|
|
3
|
+
## Code Style
|
|
4
|
+
- Use **camelCase** for variables, functions, and methods.
|
|
5
|
+
- Use **PascalCase** for classes, components, and interfaces.
|
|
6
|
+
- Use **UPPER_CASE** for constants.
|
|
7
|
+
- Indent using **2 spaces**.
|
|
8
|
+
- Always use **Semicolons**.
|
|
9
|
+
|
|
10
|
+
## TypeScript Rules
|
|
11
|
+
- Avoid `any` - use explicit types or `unknown`.
|
|
12
|
+
- Use `interface` over `type` for object shapes.
|
|
13
|
+
- Enable `strict: true` in `tsconfig.json`.
|
|
14
|
+
|
|
15
|
+
## Tools
|
|
16
|
+
- **Formatter**: `prettier`.
|
|
17
|
+
- **Linter**: `eslint` (with TypeScript plugin).
|
|
18
|
+
- **Package Manager**: `npm` (preferred) or `pnpm`.
|