tajul-avengers 1.0.0 → 1.0.2

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 CHANGED
@@ -4,31 +4,32 @@ Zero-dependency CLI tool to inject the **Avengers Protocol Multi-Agent Orchestra
4
4
 
5
5
  ---
6
6
 
7
- ## ⚡ Quick Start with NPX (No installation needed)
7
+ ## ⚡ Quick Start with NPX (No installation required)
8
8
 
9
- ### 1. Existing Project-এ ব্যবহার করার জন্য:
10
- আপনার চলমান যেকোনো প্রোজেক্টের ফোল্ডারে টার্মিনাল খুলে এই এক লাইনের কমান্ডটি দিন:
9
+ ### 1. Integrate into an Existing Project:
10
+ Open your terminal inside any existing project folder and run:
11
11
 
12
12
  ```bash
13
13
  npx tajul-avengers init
14
14
  ```
15
- > এটি আপনার কোনো পুরনো কোড না ছুঁয়ে শুধু অর্কেস্ট্রেশন লেয়ার (`AGENTS.md`, `project.config.md`, `planning/`, `docs/`, `.agents/`, `scripts/`) বসিয়ে দেবে এবং পরবর্তী প্রম্পটগুলো টার্মিনালে দেখিয়ে দেবে।
15
+ > **What it does:** Injects only the orchestration layer (`AGENTS.md`, `project.config.md`, `planning/`, `docs/`, `.agents/`, `scripts/`) without modifying or moving any of your existing source code. It then displays the exact AI prompts to get started.
16
16
 
17
17
  ---
18
18
 
19
- ### 2. একদম নতুন ফুল-স্ট্যাক প্রজেক্ট তৈরি করার জন্য:
20
- যেকোনো ফোল্ডারে টার্মিনাল খুলে কমান্ড দিন:
19
+ ### 2. Scaffold a Brand-New Full-Stack Project:
20
+ Open your terminal in any directory and run:
21
21
 
22
22
  ```bash
23
23
  npx tajul-avengers create my-new-project
24
- # অথবা সরাসরি
24
+ # or simply:
25
25
  npx tajul-avengers my-new-project
26
26
  ```
27
+ > **What it does:** Generates a complete full-stack boilerplate including frontend, backend, docker configurations, test setups, and multi-agent roles.
27
28
 
28
29
  ---
29
30
 
30
31
  ### 3. Interactive Mode:
31
- কোনো আর্গুমেন্ট ছাড়া সরাসরি রান করলে একটি ইন্টারঅ্যাক্টিভ মেনু দেখতে পাবেন:
32
+ Run without arguments to access an interactive setup menu:
32
33
 
33
34
  ```bash
34
35
  npx tajul-avengers
@@ -36,30 +37,53 @@ npx tajul-avengers
36
37
 
37
38
  ---
38
39
 
39
- ## 📦 npmjs-এ কীভাবে পাবলিশ করবেন (How to Publish):
40
+ ## 🚀 Two-Command AI Workflow for Existing Projects
40
41
 
41
- 1. আপনার টার্মিনালে `cli` ফোল্ডারে যান:
42
+ Once `init` is complete, open your AI coding assistant (Cursor, Claude Code, Antigravity, etc.) and run:
43
+
44
+ ### Command 1: Auto-Discovery & Baseline Audit
45
+ ```text
46
+ Iron Man, adapt our Avengers Protocol to this existing codebase:
47
+ 1. Scan the full codebase to detect the frontend, backend, database ORM, package manager, and folder paths, then automatically update project.config.md.
48
+ 2. Thoroughly analyze what features, database schemas, and APIs currently exist, and document them in docs/EXISTING_PROJECT_SUMMARY.md.
49
+ 3. Establish accurate system baselines in docs/07-database-design.md, docs/08-api-contract.md, and docs/context-map.md.
50
+ 4. Do not modify or refactor any existing source code. Only generate the documentation baselines and configurations.
51
+ ```
52
+
53
+ ### Command 2: Gap Analysis & Feature Execution
54
+ After writing your feature requirements in `planning/new-plan.md`, run:
55
+ ```text
56
+ Iron Man, deeply analyze docs/EXISTING_PROJECT_SUMMARY.md (existing baseline) and planning/new-plan.md (new feature):
57
+ 1. Perform a Gap Analysis (what already exists vs. what needs to be created). Avoid duplicate models or endpoints.
58
+ 2. Deconstruct the feature into isolated sub-tasks with Task IDs ([TASK-001], [TASK-002]) in planning/task.md assigned to specialist agents (Edith, Friday, Thanos).
59
+ 3. Update planning/updateplanning.md.
60
+ 4. Begin task-by-task execution under the Avengers Protocol and context policy.
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 📦 How to Publish to npm (For Maintainers)
66
+
67
+ 1. Navigate to the `cli` directory:
42
68
  ```bash
43
69
  cd cli
44
70
  ```
45
- 2. npm-এ লগইন করুন (যদি আগে না করা থাকে):
71
+ 2. Log in to npm (if not already authenticated):
46
72
  ```bash
47
73
  npm login
48
74
  ```
49
- 3. প্যাকেজ পাবলিশ করে দিন:
75
+ 3. Publish publicly:
50
76
  ```bash
51
77
  npm publish --access public
52
78
  ```
53
-
54
- পাবলিশ হওয়ার সাথে সাথেই পৃথিবীর যেকোনো ডেভেলপার `npx tajul-avengers` রান করতে পারবে!
79
+ *(If prompted for 2FA, pass your OTP: `npm publish --access public --otp=123456`)*
55
80
 
56
81
  ---
57
82
 
58
- ## 🔄 টেমপ্লেট সিঙ্ক করার নিয়ম (Sync Templates):
59
- ভবিষ্যতে আপনি যদি মেইন `avengers_end_code` প্রোজেক্টে নতুন কোনো ডকুমেন্ট বা রুলস আপডেট করেন, তবে CLI-এর টেমপ্লেটগুলো আপডেট করতে শুধু চালান:
83
+ ## 🔄 Syncing Templates:
84
+ Whenever you update root documents or protocol rules in `avengers_end_code`, sync the CLI bundle by running:
60
85
 
61
86
  ```bash
62
87
  cd cli
63
88
  node scripts/sync.js
64
89
  ```
65
-
package/bin/index.js CHANGED
@@ -37,7 +37,7 @@ function printHelp() {
37
37
  printBanner();
38
38
  console.log(`
39
39
  ${c.bold}Usage:${c.reset}
40
- ${c.green}npx tajul-avengers init${c.reset} Inject protocol into current existing project
40
+ ${c.green}npx tajul-avengers init${c.reset} Inject protocol & all guide READMEs into current project
41
41
  ${c.green}npx tajul-avengers create <name>${c.reset} Create a new full-stack Avengers project
42
42
  ${c.green}npx tajul-avengers${c.reset} Interactive mode
43
43
 
@@ -69,7 +69,15 @@ function copyRecursive(src, dest, force = false) {
69
69
  fs.mkdirSync(dest, { recursive: true });
70
70
  const entries = fs.readdirSync(src);
71
71
  for (const entry of entries) {
72
- copyRecursive(path.join(src, entry), path.join(dest, entry), force);
72
+ const srcChild = path.join(src, entry);
73
+ let destChild = path.join(dest, entry);
74
+
75
+ // Protect existing project README.md if present, saving as AVENGERS_README.md
76
+ if (entry === 'README.md' && fs.existsSync(destChild) && !force) {
77
+ destChild = path.join(dest, 'AVENGERS_README.md');
78
+ }
79
+
80
+ copyRecursive(srcChild, destChild, force);
73
81
  }
74
82
  } else {
75
83
  if (fs.existsSync(dest) && !force) {
@@ -91,12 +99,12 @@ async function handleInit(force = false) {
91
99
  }
92
100
 
93
101
  console.log(`${c.blue}ℹ${c.reset} Target directory: ${c.bold}${targetDir}${c.reset}`);
94
- console.log(`${c.yellow}⏳ Injecting Avengers Protocol Orchestration Layer...${c.reset}`);
102
+ console.log(`${c.yellow}⏳ Injecting Avengers Protocol Orchestration & Documentation...${c.reset}`);
95
103
 
96
104
  try {
97
105
  copyRecursive(templateDir, targetDir, force);
98
106
 
99
- console.log(`\n${c.green}${c.bold}✔ Avengers Protocol successfully injected!${c.reset}`);
107
+ console.log(`\n${c.green}${c.bold}✔ Avengers Protocol & Documentation successfully injected!${c.reset}`);
100
108
  console.log(`
101
109
  ${c.bold}📂 Files & Folders Added:${c.reset}
102
110
  ${c.cyan}├── AGENTS.md${c.reset} (Global Multi-Agent Rules)
@@ -104,7 +112,10 @@ ${c.bold}📂 Files & Folders Added:${c.reset}
104
112
  ${c.cyan}├── planning/${c.reset} (task.md, updateplanning.md, new-plan.md)
105
113
  ${c.cyan}├── docs/${c.reset} (ai-context-policy.md, context-map.md, etc.)
106
114
  ${c.cyan}├── .agents/${c.reset} (Specialist Skills)
107
- ${c.cyan}└── scripts/${c.reset} (Validation & token-clean runners)
115
+ ${c.cyan}├── scripts/${c.reset} (Validation & token-clean runners)
116
+ ${c.cyan}├── HOW_TO_USE_BN.md & EN.md${c.reset} (Comprehensive Usage Guides)
117
+ ${c.cyan}├── HOW_TO_USE_IN_EXISTING_PROJECT...${c.reset} (Existing Project Guides - BN & EN)
118
+ ${c.cyan}└── PROJECT_STRUCTURE.md & README${c.reset} (A-Z Structure & Client Brief)
108
119
 
109
120
  ${c.magenta}${c.bold}🚀 NEXT STEPS (পরবর্তী করণীয়):${c.reset}
110
121
 
@@ -219,7 +230,7 @@ async function main() {
219
230
  // Interactive menu if no arguments passed
220
231
  printBanner();
221
232
  console.log(`${c.bold}What would you like to do?${c.reset}`);
222
- console.log(` ${c.cyan}[1]${c.reset} Inject Avengers Protocol into ${c.bold}this existing project${c.reset} (init)`);
233
+ console.log(` ${c.cyan}[1]${c.reset} Inject Avengers Protocol & Docs into ${c.bold}this existing project${c.reset} (init)`);
223
234
  console.log(` ${c.cyan}[2]${c.reset} Create a ${c.bold}new full-stack project${c.reset} from scratch (create)`);
224
235
  console.log(` ${c.cyan}[3]${c.reset} Exit\n`);
225
236
 
@@ -243,4 +254,3 @@ main().catch((err) => {
243
254
  console.error(`${c.red}Fatal error:${c.reset}`, err);
244
255
  process.exit(1);
245
256
  });
246
-
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "tajul-avengers",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Zero-dependency CLI tool to inject Avengers Protocol multi-agent orchestration into existing projects or scaffold new ones.",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
7
7
  "tajul-avengers": "bin/index.js",
8
8
  "tajul": "bin/index.js"
9
9
  },
10
+ "files": [
11
+ "bin",
12
+ "templates",
13
+ "scripts",
14
+ "README.md"
15
+ ],
10
16
  "keywords": [
11
17
  "avengers",
12
18
  "ai-agents",
package/scripts/sync.js CHANGED
@@ -9,14 +9,20 @@ const fullDir = path.join(cliDir, 'templates/full');
9
9
 
10
10
  console.log('🔄 Syncing Avengers templates to CLI...');
11
11
 
12
- // Orchestration files & folders
12
+ // Orchestration files & folders (including all documentation & guides)
13
13
  const orchItems = [
14
14
  'AGENTS.md',
15
15
  'project.config.md',
16
16
  'planning',
17
17
  'docs',
18
18
  '.agents',
19
- 'scripts'
19
+ 'scripts',
20
+ 'HOW_TO_USE_BN.md',
21
+ 'HOW_TO_USE_EN.md',
22
+ 'HOW_TO_USE_IN_EXISTING_PROJECT_BN.md',
23
+ 'HOW_TO_USE_IN_EXISTING_PROJECT_EN.md',
24
+ 'PROJECT_STRUCTURE.md',
25
+ 'README.md'
20
26
  ];
21
27
 
22
28
  // Full project items
@@ -28,12 +34,7 @@ const fullItems = [
28
34
  'input',
29
35
  '.codex',
30
36
  '.editorconfig',
31
- '.env.example',
32
- 'HOW_TO_USE_BN.md',
33
- 'HOW_TO_USE_EN.md',
34
- 'HOW_TO_USE_IN_EXISTING_PROJECT_BN.md',
35
- 'PROJECT_STRUCTURE.md',
36
- 'README.md'
37
+ '.env.example'
37
38
  ];
38
39
 
39
40
  fs.mkdirSync(orchDir, { recursive: true });
@@ -56,4 +57,3 @@ for (const item of fullItems) {
56
57
  }
57
58
 
58
59
  console.log('✅ Templates successfully synced!');
59
-
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: api-contract-validation
3
+ description: Workflow for validating API request and response contracts between Edith (backend) and Friday/Thor (frontend/mobile).
4
+ ---
5
+
6
+ # API Contract Validation Workflow
7
+
8
+ ## Purpose
9
+ Ensure that frontend client calls and backend endpoint definitions remain strictly synchronized through `docs/08-api-contract.md`, avoiding integration defects and silent assumptions.
10
+
11
+ ## Contract Structure Standard
12
+ For every endpoint documented in `docs/08-api-contract.md`:
13
+ 1. **Method & Path**: `POST /api/v1/auth/login`
14
+ 2. **Auth & Permissions**: `Public` or `Bearer JWT` (Role: `Admin`, `Member`)
15
+ 3. **Request Headers & Query Params**: `page=1&limit=20&sort=desc`
16
+ 4. **Request Body Schema**: Strict JSON/TypeScript representation
17
+ 5. **Success Response (2xx)**: HTTP code and JSON payload shape
18
+ 6. **Error Responses (4xx, 5xx)**: Standard error format:
19
+ ```json
20
+ {
21
+ "statusCode": 400,
22
+ "message": "Validation failed",
23
+ "errors": ["email must be an email"]
24
+ }
25
+ ```
26
+
27
+ ## Contract Change Procedure
28
+ 1. **Change Initiation**: Identify the need for a modified or new endpoint.
29
+ 2. **Contract Update**: Edith updates `docs/08-api-contract.md`.
30
+ 3. **Notification**: Edith notes the update in `planning/updateplanning.md`.
31
+ 4. **Implementation**:
32
+ - Backend: Edith implements NestJS controller and DTO.
33
+ - Frontend/Mobile: Friday or Thor implements TanStack Query / Dio client call matching the contract.
34
+ 5. **Validation**: Run script `./scripts/validate-contracts.sh` or integration tests.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: backend-development
3
+ description: Workflow for implementing NestJS modular architecture, Prisma ORM schemas, PostgreSQL migrations, Redis caching, and REST APIs with Edith.
4
+ ---
5
+
6
+ # Backend Development Workflow (Edith)
7
+
8
+ ## Purpose
9
+ Guide the Backend Specialist (`edith`) to implement scalable, secure, and type-safe server logic in `development/backend/`.
10
+
11
+ ## Architecture Principles
12
+ - **Transport Separation**: Controllers only handle HTTP concerns (request parsing, status codes, calling services).
13
+ - **Domain Services**: Business logic, calculations, and invariants live in domain services.
14
+ - **Data Access**: Prisma Client operations, query optimization, indexing, and transactional boundaries.
15
+
16
+ ## Step-by-Step Procedure
17
+
18
+ ### 1. Database Schema & Migration
19
+ - Open `docs/07-database-design.md` and check the entity relationship.
20
+ - Update `prisma/schema.prisma` with explicit relations, indexes, and constraints.
21
+ - Generate migration:
22
+ ```bash
23
+ pnpm --filter backend prisma migrate dev --name <migration_name>
24
+ ```
25
+ - *Human Approval Gate*: If migration drops columns or tables, stop and ask the user for approval.
26
+
27
+ ### 2. DTO & Validation
28
+ - Define request and response DTOs using `class-validator` and `class-transformer`.
29
+ - Sanitize inputs to prevent SQL injection and parameter tampering.
30
+
31
+ ### 3. Business Logic & Transactions
32
+ - Implement domain logic inside dedicated services.
33
+ - Use `prisma.$transaction` for multi-step mutations where consistency is required.
34
+
35
+ ### 4. Auth & Guards
36
+ - Apply JWT guards or role-based permission guards on protected endpoints.
37
+ - Extract user context securely via custom `@CurrentUser()` decorators.
38
+
39
+ ### 5. Contract Synchronization
40
+ - Document the newly built endpoint in `docs/08-api-contract.md` so Friday and Thor can integrate seamlessly.
41
+ - Run unit/integration tests:
42
+ ```bash
43
+ pnpm --filter backend test
44
+ ```
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: deployment-security
3
+ description: Workflow for containerization with Docker, Nginx reverse proxy configuration, CI/CD pipeline setup, and cyber security auditing with Ultron.
4
+ ---
5
+
6
+ # Deployment and Security Workflow (Ultron)
7
+
8
+ ## Purpose
9
+ Guide the DevOps and Security Specialist (`ultron`) to containerize the application, configure reverse proxies, set up automated CI/CD pipelines, and harden system security.
10
+
11
+ ## Key Focus Areas
12
+ - **Containerization**: Multi-stage Docker builds for minimal production image sizes.
13
+ - **Nginx**: Reverse proxy, SSL/TLS termination, rate limiting, gzip/brotli compression.
14
+ - **Cyber Security**: Security headers, CORS, CSRF, cookie security, secret hygiene.
15
+ - **CI/CD**: GitHub Actions workflows for automated linting, testing, and security scanning.
16
+
17
+ ## Step-by-Step Procedure
18
+
19
+ ### 1. Docker Build & Multi-Stage Architecture
20
+ - Frontend Dockerfile: Build Next.js standalone output for ultra-lightweight containers.
21
+ - Backend Dockerfile: Transpile NestJS to JavaScript and prune development dependencies.
22
+ - Docker Compose: Configure app services, PostgreSQL, Redis, and health checks with resource limits.
23
+
24
+ ### 2. Nginx & Reverse Proxy Configuration
25
+ - Set up reverse proxy routing:
26
+ - `/` -> Frontend Next.js container (port 3000)
27
+ - `/api/` -> Backend NestJS container (port 4000)
28
+ - Enforce strict security headers:
29
+ ```nginx
30
+ add_header X-Frame-Options "DENY" always;
31
+ add_header X-Content-Type-Options "nosniff" always;
32
+ add_header Referrer-Policy "strict-origin-when-cross-origin" always;
33
+ add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; object-src 'none';" always;
34
+ ```
35
+
36
+ ### 3. Cyber Security Audit
37
+ - Run dependency vulnerability scan:
38
+ ```bash
39
+ pnpm audit
40
+ ```
41
+ - Verify that `.env` files and API secrets are never tracked in Git (check `.gitignore`).
42
+ - Verify rate limiting is active on `/api/v1/auth/*` routes.
43
+
44
+ ### 4. Human Approval Gate
45
+ - Production deployment or changing production environment variables **ALWAYS** requires explicit human confirmation.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: design-system
3
+ description: Workflow for establishing design tokens, typography scale, color palettes, dark mode, and UI component primitives with Jarvis.
4
+ ---
5
+
6
+ # Design System Workflow (Jarvis)
7
+
8
+ ## Purpose
9
+ Guide the Design Specialist (`jarvis`) to construct a coherent, accessible, and premium design system before mass frontend component implementation begins.
10
+
11
+ ## Key Deliverables
12
+ 1. **Design Tokens (`globals.css` / Tailwind Config)**:
13
+ - Surface colors: `--bg-primary`, `--bg-secondary`, `--bg-card`, `--border-subtle`.
14
+ - Typography colors: `--text-primary`, `--text-secondary`, `--text-muted`.
15
+ - Brand colors: `--primary`, `--primary-hover`, `--primary-foreground`.
16
+ - Feedback colors: `--success`, `--warning`, `--danger`, `--info`.
17
+ - Elevation shadows: soft, modern 1px delicate borders and layered shadows.
18
+ 2. **Typography Scale**:
19
+ - Central font: Google Fonts (Inter / Plus Jakarta Sans).
20
+ - Strict hierarchical sizing (H1 to H6, body-sm, body-md, caption).
21
+ 3. **Core UI Primitives**:
22
+ - `Button`: Primary, Secondary, Outline, Ghost, Danger with loading/disabled states.
23
+ - `Input` & `Textarea`: Clear borders, focus-visible rings, inline error state.
24
+ - `Card`: Surface elevation, padding rules, header/content/footer slots.
25
+ - `Skeleton`: Pulsing skeleton shapes for text, avatars, cards, and tables.
26
+ - `EmptyState`: Centered graphic/icon, title, message, and call-to-action button.
27
+ - `Badge` / `Tag`: Semantic status indicators.
28
+
29
+ ## Step-by-Step Procedure
30
+ 1. Inspect `README.md` for client brand guidelines or Figma URLs.
31
+ 2. Update `docs/04-design-system.md` with semantic token values.
32
+ 3. Apply variables in `development/frontend/src/styles/globals.css`.
33
+ 4. Build reusable primitives in `development/frontend/src/components/ui/`.
34
+ 5. Verify contrast ratios against WCAG 2.2 AA (minimum 4.5:1 for normal text).
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: frontend-development
3
+ description: Workflow for building Next.js App Router components, screens, client state, forms, and API integrations with Friday.
4
+ ---
5
+
6
+ # Frontend Development Workflow (Friday)
7
+
8
+ ## Purpose
9
+ Guide the Frontend Specialist (`friday`) to implement performant, accessible, and resilient web interfaces in `development/frontend/`.
10
+
11
+ ## Stack Standards
12
+ - Next.js (App Router), TypeScript (strict mode), Tailwind CSS.
13
+ - Client state: Zustand.
14
+ - Server state: TanStack Query (React Query).
15
+ - Forms: React Hook Form + Zod.
16
+
17
+ ## Step-by-Step Procedure
18
+
19
+ ### 1. Contract Verification
20
+ - Open `docs/08-api-contract.md` to review the exact API endpoint, request body, query params, response shape, and error codes.
21
+ - Do not guess or hallucinate backend routes.
22
+
23
+ ### 2. Mandatory 6 UI States Implementation
24
+ Every page, table, and data-bound form must implement:
25
+ 1. **Default / Success State**: Clean, crisp UI with active data rendering.
26
+ 2. **Loading Skeleton State**: Tailored skeleton loader matching the exact shape of cards/rows.
27
+ 3. **Empty State**: Icon, headline, friendly description, and action button.
28
+ 4. **Validation & Error State**: Inline red helper text for input fields; toast notifications for API failure.
29
+ 5. **Responsive State**: Mobile-first design, fluid grid, collapsible sidebar, table horizontal scroll.
30
+ 6. **Interactive & Accessibility State**: Visible focus ring (`focus-visible:ring-2`), hover animations (`transition-all duration-200`), accessible ARIA labels.
31
+
32
+ ### 3. API Integration
33
+ - Use a centralized API client with automatic token attachment and error interceptors.
34
+ - Handle network errors, 401 unauthorized redirects, and 422 validation errors gracefully.
35
+
36
+ ### 4. Verification
37
+ - Run:
38
+ ```bash
39
+ pnpm --filter frontend type-check # or npm run type-check
40
+ pnpm --filter frontend test # or npm run test
41
+ ```
42
+ - Inspect responsive behavior and keyboard accessibility.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: project-planning
3
+ description: Workflow for analyzing client requirements in README.md, preparing technical documentation in docs/, and initializing tasks in planning/task.md under the Avengers Protocol.
4
+ ---
5
+
6
+ # Project Planning Workflow (Iron Man)
7
+
8
+ ## Purpose
9
+ Guide the Chief Orchestrator (`iron_man`) to translate client requirements into structured technical blueprints and prioritized task boards without inventing details or burning excessive tokens.
10
+
11
+ ## Prerequisites
12
+ - Read root `README.md` (single source of truth for requirements).
13
+ - Read `project.config.md` (stack settings).
14
+ - Read `AGENTS.md` (global rules).
15
+
16
+ ## Execution Steps
17
+
18
+ ### 1. Requirements Discovery
19
+ - Extract functional requirements (`REQ-F-001`, `REQ-F-002`, ...), non-functional requirements, constraints, and external integrations from `README.md`.
20
+ - Identify ambiguities or missing specifications.
21
+ - **Rule**: If a requirement is missing or unclear, record it in `planning/open-questions.md`. Never guess client intent.
22
+
23
+ ### 2. Technical Blueprint Generation (`docs/`)
24
+ Create or incrementally update the core technical specifications:
25
+ - `docs/01-requirements-analysis.md`: Detailed functional/non-functional breakdown.
26
+ - `docs/02-system-architecture.md`: High-level component and data flow.
27
+ - `docs/07-database-design.md`: Tables, models, relations, and indexes.
28
+ - `docs/08-api-contract.md`: Endpoints, request/response DTOs, and error codes.
29
+ - `docs/10-security-plan.md`: Authentication, authorization, and rate limiting.
30
+ - `docs/13-acceptance-criteria.md`: Verifiable completion criteria for each feature.
31
+
32
+ *Token Optimization Tip: Use compact markdown tables and concise TypeScript/DTO interfaces instead of long conversational text.*
33
+
34
+ ### 3. Task Board Initialization & Granular Decomposition (`planning/tasks/`)
35
+ Decompose the work into sequential and parallel tasks:
36
+ - **Master Board (`planning/task.md`)**: Maintain the high-level Kanban overview linking each task ID to its file in `tasks/TASK-XXX.md`.
37
+ - **Dynamic Granular Task Creation (`planning/tasks/TASK-XXX.md`)**: Generate or update an individual specification markdown file for each task (e.g. `planning/tasks/TASK-001.md`, `TASK-002.md`). Each file must include:
38
+ 1. Status, Assignee, Priority, Dependencies, and Master Board Link.
39
+ 2. Objective and User Story.
40
+ 3. Direct inputs and contract references (`docs/08-api-contract.md`, `DESIGN_GUIDELINES.md`).
41
+ 4. Granular step-by-step execution plan.
42
+ 5. Acceptance criteria checklist.
43
+ 6. Verification evidence block for Thanos.
44
+ 7. Fresh session handoff command.
45
+ - Assign each task to the appropriate hero agent:
46
+ - `[jarvis]`: Design tokens, UI states, component primitives.
47
+ - `[edith]`: DB schema, migrations, backend services, REST APIs.
48
+ - `[friday]`: Next.js web components, forms, client integration.
49
+ - `[thor]`: Flutter mobile views (if mobile enabled).
50
+ - `[thanos]`: Verification, tests, acceptance validation.
51
+ - `[ultron]`: Docker, Nginx, CI/CD, cyber security.
52
+
53
+ *Token Optimization Tip: Granular task files isolate context so specialist agents only load their active task (~60 lines) instead of reading a massive monolithic document, cutting token consumption by 85–90%.*
54
+
55
+ ### 4. Human Approval Gate
56
+ Present the planning summary to the human developer. Do not start coding until the plan is approved.
57
+
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: task-execution
3
+ description: Standard workflow for executing a single assigned task under the Avengers Protocol, including context isolation, focused editing, and progress tracking.
4
+ ---
5
+
6
+ # Task Execution Workflow
7
+
8
+ ## Purpose
9
+ Standard operating procedure for any agent (Jarvis, Friday, Edith, Thor, Thanos, Ultron) when implementing an assigned task from `planning/task.md`.
10
+
11
+ ## Execution Steps
12
+
13
+ ### 1. Task Intake & Ownership
14
+ - Identify the requested `TASK-ID` in `planning/task.md` and load its dedicated file: `planning/tasks/${TASK-ID}.md`.
15
+ - Verify you are the assigned agent (`Assignee`).
16
+ - Check that all prerequisite `Dependencies` are marked `DONE`.
17
+ - Confirm that the task status is `READY`. Change status to `IN_PROGRESS` in both `planning/task.md` and `planning/tasks/${TASK-ID}.md`.
18
+
19
+ ### 2. Context Loading (Isolated & Focused — 90% Token Reduction)
20
+ - Load **only** the direct files required for this task:
21
+ - The granular task file: `planning/tasks/${TASK-ID}.md`.
22
+ - The relevant technical contract referenced in the task file (e.g., `docs/08-api-contract.md` or `development/frontend/DESIGN_GUIDELINES.md`).
23
+ - The specific source code files to modify or test.
24
+ - **Rule**: Do not read unrelated directories or full repository listings.
25
+
26
+ ### 3. Implementation
27
+ - Make focused, surgical changes.
28
+ - Reuse existing components, hooks, domain services, and utilities.
29
+ - Never rewrite entire files when replacing a targeted function or block.
30
+ - Follow the domain rules:
31
+ - Frontend: 6 UI States, accessible markup, WCAG 2.2 AA.
32
+ - Backend: DTO validation, service business logic, transaction safety.
33
+
34
+ ### 4. Verification Check
35
+ - Run focused checks (type-check, linter, unit test for modified file).
36
+ - If checks fail, fix the issue immediately before reporting completion.
37
+
38
+ ### 5. Checkpoint & Reporting
39
+ - Update `planning/tasks/${TASK-ID}.md` with actual test verification logs and mark status (`IN_REVIEW` or `DONE`).
40
+ - Synchronize status in the master board: `planning/task.md`.
41
+ - Update `planning/updateplanning.md` with:
42
+ - Task ID and Assignee.
43
+ - Files modified.
44
+ - Verification commands run and results.
45
+ - Next ready task.
46
+ - **Fresh Session Handoff Command**: Always output the exact command (`planning/updateplanning.md পড়ে [NEXT-TASK-ID] শুরু করো`) and advise the developer to open a new chat window to eliminate token compounding and maintain 95% token efficiency.
47
+
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: testing
3
+ description: Workflow for verification, unit testing, integration testing, end-to-end testing, and acceptance verification with Thanos.
4
+ ---
5
+
6
+ # Testing and Verification Workflow (Thanos)
7
+
8
+ ## Purpose
9
+ Guide the QA and Verification Specialist (`thanos`) to enforce strict quality control, verify acceptance criteria, and snap bugs out of existence.
10
+
11
+ ## Testing Hierarchy
12
+ 1. **Focused Unit Tests**: Verify individual functions, utility methods, React components, and NestJS services. Run immediately after code modification.
13
+ 2. **Integration Tests**: Verify interactions between controllers, services, database models, and external APIs.
14
+ 3. **End-to-End (E2E) Tests**: Verify complete user flows across frontend and backend boundaries (e.g., registration -> email verification -> login -> dashboard).
15
+ 4. **Contract Tests**: Verify that HTTP endpoints return exact JSON shapes as documented in `docs/08-api-contract.md`.
16
+ 5. **Acceptance Criteria Verification**: Cross-reference the implementation against `docs/13-acceptance-criteria.md`.
17
+
18
+ ## Step-by-Step Procedure
19
+
20
+ ### 1. Identify Changed Files & Tasks
21
+ - Review Git status or the changed file list reported in `planning/task.md`.
22
+
23
+ ### 2. Execute Focused Verification
24
+ - Run the most focused test first:
25
+ ```bash
26
+ # Frontend focused test
27
+ pnpm --filter frontend test -- path/to/component.test.tsx
28
+
29
+ # Backend focused test
30
+ pnpm --filter backend test -- path/to/service.spec.ts
31
+ ```
32
+
33
+ ### 3. Diagnose Failures
34
+ When a failure occurs, categorize it:
35
+ - **Code Bug**: Implementation defect -> report exact stack trace and delegate fix to domain agent (Friday/Edith/Thor).
36
+ - **Test Defect**: Flaky test or incorrect assertion -> update test spec.
37
+ - **Environment**: Missing database or `.env` variable -> notify Ultron/developer.
38
+
39
+ ### 4. Acceptance Certification
40
+ A task is certified `DONE` only when:
41
+ - All required acceptance criteria have passed.
42
+ - Actual test execution logs confirm 0 failures.
43
+ - No untested edge cases or console errors are present.