@yashasvi9199/vibefix 0.0.0-stage → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yash Haldiya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,237 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="./assets/banner.png" alt="VibeFix Banner" width="100%" />
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">VibeFix</h1>
6
+
7
+ <p align="center">
8
+ <strong>Stealth architecture rules, zero-trust security standards, and agent workflows for Antigravity IDE.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/yashasvi9199/vibefix/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT License" /></a>
13
+ <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.0+-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" /></a>
14
+ <a href="https://pnpm.io/"><img src="https://img.shields.io/badge/pnpm-ready-F69220?style=flat-square&logo=pnpm&logoColor=white" alt="pnpm" /></a>
15
+ <a href="https://github.com/yashasvi9199/vibefix/stargazers"><img src="https://img.shields.io/github/stars/yashasvi9199/vibefix?style=flat-square" alt="GitHub Stars" /></a>
16
+ <a href="https://github.com/yashasvi9199/vibefix/issues"><img src="https://img.shields.io/github/issues/yashasvi9199/vibefix?style=flat-square" alt="Open Issues" /></a>
17
+ </p>
18
+
19
+ ---
20
+
21
+ ## ⚡ Overview
22
+
23
+ **VibeFix** automates the injection of battle-tested software engineering standards, security guardrails, and AI agent slash commands into any codebase. Designed natively for **Google Antigravity IDE**, it bridges the gap between autonomous AI coding agents and hardened, production-grade architecture.
24
+
25
+ With a single command, VibeFix scaffolds modular system prompts, DPDP compliance standards, zero-trust validation rules, and executable `.agent/workflows/` that turn your IDE assistant into an elite senior staff engineer.
26
+
27
+ ---
28
+
29
+ ## 🚀 Quick Start (Zero Install)
30
+
31
+ Run VibeFix directly in your project root using your package manager of choice:
32
+
33
+ ### **pnpm** (Recommended)
34
+ ```bash
35
+ # Run directly via GitHub repository
36
+ pnpm dlx github:yashasvi9199/vibefix init
37
+
38
+ # Or via npm package registry
39
+ pnpm dlx vibefix init
40
+ ```
41
+
42
+ ### **npm / npx**
43
+ ```bash
44
+ # Run directly via GitHub repository
45
+ npx github:yashasvi9199/vibefix init
46
+
47
+ # Or via npm package registry
48
+ npx vibefix init
49
+ ```
50
+
51
+ ### **bun**
52
+ ```bash
53
+ # Run directly via GitHub repository
54
+ bunx --bun github:yashasvi9199/vibefix init
55
+
56
+ # Or via npm package registry
57
+ bunx vibefix init
58
+ ```
59
+
60
+ ### **yarn**
61
+ ```bash
62
+ # Run directly via GitHub repository
63
+ yarn dlx github:yashasvi9199/vibefix init
64
+
65
+ # Or via npm package registry
66
+ yarn dlx vibefix init
67
+ ```
68
+
69
+ ---
70
+
71
+ ## 📦 Global Installation
72
+
73
+ Install VibeFix globally to use the `vibefix` command anywhere across your system:
74
+
75
+ | Package Manager | Global Install Command | Project Init Command |
76
+ |---|---|---|
77
+ | **pnpm** | `pnpm add -g github:yashasvi9199/vibefix` | `vibefix init` |
78
+ | **npm** | `npm install -g github:yashasvi9199/vibefix` | `vibefix init` |
79
+ | **bun** | `bun add -g github:yashasvi9199/vibefix` | `vibefix init` |
80
+ | **yarn** | `yarn global add github:yashasvi9199/vibefix` | `vibefix init` |
81
+
82
+ > [!TIP]
83
+ > Once installed globally, navigate to any workspace and run `vibefix init`.
84
+
85
+ ---
86
+
87
+ ## 🛠️ Project Dev Dependency Installation
88
+
89
+ If you prefer pinning VibeFix inside your repository's `package.json`:
90
+
91
+ ### 1. Install as dev dependency
92
+ ```bash
93
+ # pnpm
94
+ pnpm add -D github:yashasvi9199/vibefix
95
+
96
+ # npm
97
+ npm install -D github:yashasvi9199/vibefix
98
+
99
+ # bun
100
+ bun add -d github:yashasvi9199/vibefix
101
+
102
+ # yarn
103
+ yarn add -D github:yashasvi9199/vibefix
104
+ ```
105
+
106
+ ### 2. Run initialization
107
+ ```bash
108
+ pnpm vibefix init
109
+ # or: npx vibefix init / bunx vibefix init / yarn vibefix init
110
+ ```
111
+
112
+ ---
113
+
114
+ ## 💻 CLI Usage & Flags
115
+
116
+ ```
117
+ Usage: vibefix [options] [command]
118
+
119
+ Scaffold rules, GEMINI.md, and Antigravity slash commands
120
+
121
+ Options:
122
+ -V, --version output the version number
123
+ -h, --help display help for command
124
+
125
+ Commands:
126
+ init [options] Scaffold rules/, .agent/workflows/, and GEMINI.md into project
127
+ help [command] display help for command
128
+ ```
129
+
130
+ ### Command Options: `vibefix init`
131
+
132
+ | Option | Shorthand | Description | Default |
133
+ |---|---|---|---|
134
+ | `--force` | `-f` | Overwrite existing files if they already exist in destination | `false` |
135
+ | `--help` | `-h` | Display help for the `init` command | - |
136
+
137
+ ```bash
138
+ # Force overwrite existing configs
139
+ vibefix init --force
140
+ ```
141
+
142
+ ---
143
+
144
+ ## 🏗️ What VibeFix Scaffolds
145
+
146
+ Running `vibefix init` provisions three mission-critical subsystems in your repository:
147
+
148
+ ```
149
+ your-project/
150
+ ├── GEMINI.md # Agent routing prompt & behavioral enforcement
151
+ ├── rules/ # Modular architectural directives
152
+ │ ├── CORE.md # Strict TypeScript, zero 'any', pnpm standards
153
+ │ ├── API.md # REST, gRPC, SSE, Webhooks, idempotency & rate limits
154
+ │ ├── SECURITY.md # Zero-trust validation, Zod schemas, UUIDs, ReDoS/SSTI defense
155
+ │ ├── FRONTEND.md # SSR, Tailwind, Zustand, TanStack Query, Offline-first PWA
156
+ │ ├── SEO.md # Canonical meta titles, dynamic Open Graph, sitemaps
157
+ │ ├── COMPLIANCE.md # India DPDP Act 2023, consent checkboxes & privacy policies
158
+ │ ├── DOCS.md # Ephemeral staging docs, CHANGELOG, and DATABASE.sql ledgers
159
+ │ └── CHECKLIST.md # Pre-commit & pre-deployment verification matrix
160
+ └── .agent/
161
+ └── workflows/ # Interactive slash commands for Antigravity IDE
162
+ ├── /audit-security # Full zero-trust vulnerability & data exposure scan
163
+ ├── /audit-seo # Meta tags, crawler indexability & Open Graph audit
164
+ ├── /dpdp-audit # Verify statutory compliance with DPDP Act 2023
165
+ ├── /dpdp-cookies # Scaffold GDPR/DPDP compliant consent banners
166
+ ├── /dpdp-scaffold # Generate compliant Privacy Policy and Terms & Conditions
167
+ ├── /gen-conversion # Scaffold high-conversion 'Thank You' post-purchase flows
168
+ ├── /gen-errors # Generate standardized custom 404, 500 & maintenance views
169
+ ├── /gen-sitemap # Auto-generate dynamic sitemap.xml and robots.txt
170
+ ├── /harden-headers # Inject CSP, HSTS, X-Frame-Options, and CORS controls
171
+ ├── /open-graph # Scaffold dynamic edge-rendered social preview cards
172
+ ├── /setup-pwa # Generate offline-first service worker & web manifest
173
+ ├── /setup-telemetry # Setup privacy-respecting client analytics
174
+ └── /task-sync # Sync task completion to RELEASE.md & CHANGELOG.md
175
+ ```
176
+
177
+ ---
178
+
179
+ ## 🎯 Architectural Philosophy
180
+
181
+ VibeFix enforces strict, production-first development rules:
182
+
183
+ - **Strict Typing**: Ban on `any`, isolated `.types.ts` per feature domain, and strict compiler boundaries.
184
+ - **Deterministic Tooling**: Standardized on `pnpm` exclusively; eliminates phantom dependencies and lockfile drift.
185
+ - **Zero-Trust Input Validation**: Mandates Zod schemas, parameterized ORMs (Drizzle / Prisma), and UUID primary keys.
186
+ - **Modern Edge & Frontend**: SSR architectures, TanStack Query / Zustand separation, and mobile breakpoint parity.
187
+ - **Regulatory Compliance**: Built-in compliance mechanisms for modern data protection acts (DPDP 2023, GDPR).
188
+
189
+ ---
190
+
191
+ ## 🤖 Using with Antigravity IDE
192
+
193
+ 1. Run `vibefix init` in your project root.
194
+ 2. Open the project in **Google Antigravity IDE**.
195
+ 3. Open the chat panel and type `/` to see all injected agent workflows:
196
+
197
+ ```
198
+ /audit-security - Run security audit
199
+ /setup-pwa - Scaffold offline-first PWA
200
+ /harden-headers - Configure security headers
201
+ /task-sync - Update staging docs & changelog
202
+ ```
203
+
204
+ Your AI assistant will immediately adhere to all guidelines defined in `GEMINI.md` and `rules/`.
205
+
206
+ ---
207
+
208
+ ## 🛠️ Local Development & Contribution
209
+
210
+ Want to contribute new rules or workflows to VibeFix?
211
+
212
+ ```bash
213
+ # 1. Clone the repository
214
+ git clone https://github.com/yashasvi9199/vibefix.git
215
+ cd vibefix
216
+
217
+ # 2. Install dependencies
218
+ pnpm install
219
+
220
+ # 3. Build TypeScript source
221
+ pnpm run build
222
+
223
+ # 4. Test CLI locally
224
+ pnpm run dev init
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 📄 License
230
+
231
+ Distributed under the **MIT License**. See [LICENSE](file:///home/drone/Programming/vibefix/LICENSE) for more information.
232
+
233
+ ---
234
+
235
+ <p align="center">
236
+ Crafted by <a href="https://github.com/yashasvi9199"><strong>Yash Haldiya</strong></a>
237
+ </p>
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import chalk from "chalk";
4
+ import { initProject } from "../src/commands/init.js";
5
+ const program = new Command();
6
+ program
7
+ .name("vibefix")
8
+ .description("Scaffold rules, GEMINI.md, and Antigravity slash commands")
9
+ .version("1.0.0");
10
+ program
11
+ .command("init")
12
+ .description("Scaffold rules/, .agent/workflows/, and GEMINI.md into project")
13
+ .option("-f, --force", "Overwrite existing files if present")
14
+ .action(async (options) => {
15
+ console.log(chalk.cyan("🚀 Initializing VibeFix architecture..."));
16
+ await initProject(options);
17
+ });
18
+ program.parse(process.argv);
@@ -0,0 +1,67 @@
1
+ import fs from "fs/promises";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import chalk from "chalk";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+ // Resolves to package root whether running locally or inside node_modules
8
+ const PACKAGE_ROOT = path.resolve(__dirname, "../../");
9
+ const TEMPLATES_DIR = path.join(PACKAGE_ROOT, "templates");
10
+ async function copyFolder(src, dest, force) {
11
+ await fs.mkdir(dest, { recursive: true });
12
+ const entries = await fs.readdir(src, { withFileTypes: true });
13
+ for (const entry of entries) {
14
+ const srcPath = path.join(src, entry.name);
15
+ const destPath = path.join(dest, entry.name);
16
+ if (entry.isDirectory()) {
17
+ await copyFolder(srcPath, destPath, force);
18
+ }
19
+ else {
20
+ if (!force) {
21
+ try {
22
+ await fs.access(destPath);
23
+ console.log(chalk.gray(` - Skipping existing: ${entry.name}`));
24
+ continue;
25
+ }
26
+ catch { }
27
+ }
28
+ await fs.copyFile(srcPath, destPath);
29
+ console.log(chalk.green(` ✔ Injected: ${entry.name}`));
30
+ }
31
+ }
32
+ }
33
+ export async function initProject(options) {
34
+ const targetDir = process.cwd();
35
+ const force = !!options.force;
36
+ try {
37
+ // 1. Copy rules/
38
+ console.log(chalk.bold("\n📁 Deploying rules/ directory..."));
39
+ await copyFolder(path.join(TEMPLATES_DIR, "rules"), path.join(targetDir, "rules"), force);
40
+ // 2. Copy .agent/workflows/
41
+ console.log(chalk.bold("\n⚡ Deploying .agent/workflows/ slash commands..."));
42
+ await copyFolder(path.join(TEMPLATES_DIR, "workflows"), path.join(targetDir, ".agent", "workflows"), force);
43
+ // 3. Copy GEMINI.md to project root
44
+ console.log(chalk.bold("\n📄 Deploying GEMINI.md routing prompt..."));
45
+ const geminiSrc = path.join(TEMPLATES_DIR, "GEMINI.md");
46
+ const geminiDest = path.join(targetDir, "GEMINI.md");
47
+ let writeGemini = true;
48
+ if (!force) {
49
+ try {
50
+ await fs.access(geminiDest);
51
+ console.log(chalk.gray(" - GEMINI.md already exists, skipping"));
52
+ writeGemini = false;
53
+ }
54
+ catch { }
55
+ }
56
+ if (writeGemini) {
57
+ await fs.copyFile(geminiSrc, geminiDest);
58
+ console.log(chalk.green(" ✔ Injected: GEMINI.md"));
59
+ }
60
+ console.log(chalk.cyan.bold("\n✨ VibeFix initialized successfully!"));
61
+ console.log(chalk.yellow("Open Antigravity IDE and type '/' in chat to view your slash commands.\n"));
62
+ }
63
+ catch (err) {
64
+ console.error(chalk.red("Initialization failed:"), err);
65
+ process.exit(1);
66
+ }
67
+ }
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@yashasvi9199/vibefix",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.1",
4
+ "description": "Stealth architecture rules and agent workflows for Antigravity IDE",
5
+ "license": "MIT",
6
+ "author": "yashasvi9199",
7
+ "type": "module",
8
+ "bin": {
9
+ "vibefix": "./dist/bin/cli.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "templates"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc"
17
+ },
18
+ "dependencies": {
19
+ "chalk": "^5.3.0",
20
+ "commander": "^12.0.0"
21
+ },
22
+ "devDependencies": {
23
+ "@types/node": "^20.0.0",
24
+ "typescript": "^5.0.0"
25
+ }
6
26
  }
@@ -0,0 +1,29 @@
1
+ <antigravity_agent_context>
2
+ Operate as an elite senior developer in an Arch Linux environment. Output production-grade, zero-fluff code. Ban AI boilerplate, conversational preamble, and hand-holding inline comments. Apply surgical line-by-line diffs—never re-dump or replace entire files.
3
+ </antigravity_agent_context>
4
+
5
+ <core_standards>
6
+ * Enforce strict TypeScript types; absolute ban on the `any` datatype.
7
+ * Co-locate isolated `.types.ts` and `.styles.css` per feature module; ban central `global.d.ts` and global monolithic stylesheets.
8
+ * Standardize on `pnpm` exclusively across all workspaces and setup tasks; `npm` is strictly prohibited.
9
+ * Wrap all asynchronous operations in defensive `try/catch` blocks.
10
+ * Use 'Better Comments' formatting (`!`, `?`, `TODO`, `*`) for complex logic and edge cases; do not comment self-explanatory syntax.
11
+ * Execute immediate micro-commits for minor changes authored under: `yashasvi9199` / `yashasvi9199@gmail.com`.
12
+ * Enforce semantic commit prefixes strictly: `<prefix>(<scope>): <message>` (e.g., `feat:`, `fix:`, `chore:`, `refactor:`).
13
+ </core_standards>
14
+
15
+ <documentation_invariants>
16
+ * Update documentation only upon explicit instruction or when `docs/CHANGELOG.md` increments version (`X.Y.Z`).
17
+ * Maintain `docs/GUIDE.md` for onboarding steps, environment setup, and API keys.
18
+ * Maintain an append-only, immutable `docs/DATABASE.sql` ledger logging every schema migration with timestamp and rationale.
19
+ </documentation_invariants>
20
+
21
+ <modular_rule_routing>
22
+ Reference and load domain-specific rules on demand:
23
+ * When building or modifying REST endpoints: Adhere to `@rules/API.md`
24
+ * When handling authentication, inputs, uploads, or DB queries: Adhere to `@rules/SECURITY.md` (Trigger `/audit-security` or `/harden-headers` for audit and security scaffolding)
25
+ * When styling, handling viewports, animations, or state: Adhere to `@rules/FRONTEND.md`
26
+ * When configuring metadata, structured data, or crawl files: Adhere to `@rules/SEO.md`
27
+ * When implementing legal routes, cookie banners, or intake forms: Adhere to `@rules/COMPLIANCE.md`
28
+ * When tracking or completing feature debt: Synchronize via `@rules/CHECKLIST.md`
29
+ </modular_rule_routing>
@@ -0,0 +1,9 @@
1
+ # API & NETWORKING STANDARDS
2
+
3
+ 1. **REST Resource Semantics:** Use plural nouns for resources (e.g., `/users/42`). Nest paths to a maximum of 2 levels; pass deeper relationships via query parameters (e.g., `/tasks/4?project_id=3`).
4
+ 2. **Kebab-Case & Verb-Free Routing:** Keep all URLs lowercase and hyphenated. Strip action verbs from paths and let HTTP verbs dictate intent (`GET` reads, `POST` creates, `DELETE` removes).
5
+ 3. **Actionable Error Payloads:** Return human-readable, actionable error bodies indicating what the client must correct (e.g., `{"error": "email is required"}`). Never leak database errors or internal stack traces to the client.
6
+ 4. **Payload Size Boundaries:** Enforce strict body-size limits on all incoming request streams (rejecting payloads exceeding limits with `413 Payload Too Large`) to prevent memory exhaustion DoS.
7
+ 5. **Tiered Backend Rate Limiting:** Implement rate limiting strictly on the backend:
8
+ - **General endpoints:** Token bucket (30 req / 60s).
9
+ - **Strict/Auth endpoints (login, signup, reset):** Fixed window (1 req / 120s) with tight threshold tiers.
@@ -0,0 +1,17 @@
1
+ # PENDING TASKS & LEDGER INVARIANTS
2
+
3
+ 1. **Single Source of Truth:**
4
+ - All pending implementations, rule debts, and architectural gaps must be tracked in `.pending-tasks/checklist.md`.
5
+ - The `.pending-tasks/` directory must be committed to git to persist state across sessions.
6
+
7
+ 2. **Status Notation:**
8
+ - `[ ]` Pending Task: Unstarted item with domain scope and rule reference.
9
+ - `[-]` In Progress: Task actively being executed.
10
+ - `[x]` Completed: Verified via build/typecheck (`tsc --noEmit`).
11
+ - `[!]` Blocked: Awaiting external credentials, packages, or user input.
12
+
13
+ 3. **Task Entry Format:**
14
+ `- [ ] [<CATEGORY>] <Task Description> (@rules/<RULE_FILE>.md#<RuleNumber>) [Priority: High|Med|Low]`
15
+
16
+ 4. **Verification Gate:**
17
+ - Tasks must never be marked `[x]` without verifying that code compiles without type errors (`pnpm tsc --noEmit`).
@@ -0,0 +1,16 @@
1
+ # DPDP & REGULATORY COMPLIANCE INVARIANTS
2
+
3
+ 1. **Explicit Affirmative Consent Gate:**
4
+ - Every user registration, signup, contact, and data-intake form must include an explicit consent checkbox for the DPDP Act.
5
+ - Checkboxes must remain unticked by default. Form submission must be blocked until checked.
6
+ - The checkbox label must explicitly link to `/privacy` and `/terms`.
7
+
8
+ 2. **Statutory Grievance Redressal:**
9
+ - The application must maintain an accessible `/grievance` route detailing the Grievance Officer's contact details and a direct inquiry form.
10
+ - The form must provide explicit action categories: "Erase/Delete My Data", "Correct Personal Data", and "General Privacy Concern".
11
+
12
+ 3. **Consent-Gated Cookie Telemetry:**
13
+ - Non-essential cookies, localStorage analytics markers, and telemetry SDKs must remain completely dormant until explicit consent is given via the cookie banner.
14
+
15
+ 4. **Public Entity & Address Verification:**
16
+ - The primary footer and legal pages must display a verified physical or registered business address to satisfy regulatory transparency requirements.
@@ -0,0 +1,19 @@
1
+ # CORE STANDARDS
2
+
3
+ 1. **Elite Stealth Persona & Zero Fluff:** Act as an elite senior engineer in an Arch Linux environment producing production-grade code. Never output chain-of-thought rambling, conversational preamble, or process explanations. Apply surgical diffs and modify only the necessary lines—strictly avoid replacing or re-dumping entire files.
4
+
5
+ 2. **Absolute Ban on `any` Datatype:** Enforce strict, uncompromising TypeScript types across all application logic. The `any` escape hatch is strictly banned in favor of explicit interfaces, generics, or `unknown` with runtime type narrowing.
6
+
7
+ 3. **Isolated Feature Types (`.types.ts`):** Co-locate all type declarations inside dedicated `.types.ts` files within their respective feature modules. Never create or rely on monolithic, centralized `global.d.ts` or root type buckets.
8
+
9
+ 4. **Exclusive `pnpm` Package Management:** Standardize on `pnpm` exclusively across all workspaces, monorepos, and setup commands. Standard `npm` is strictly prohibited to guarantee deterministic builds and eliminate disk bloat.
10
+
11
+ 5. **Native 'Better Comments' Formatting:** Use standard visual prefix tokens (`!`, `?`, `TODO`, `*`) for inline annotations. Add pragmatic, human-like comments before complex business logic, edge-case conditions, custom hooks, or non-obvious algorithms. Do not comment on self-explanatory syntax or basic primitives.
12
+
13
+ 6. **Defensive Async Operations:** Wrap all asynchronous operations, network requests, and Promise chains in strict `try/catch` blocks to ensure errors are captured and handled predictably without crashing the runtime.
14
+
15
+ 7. **Immediate Micro-Commits with Personal Credentials:** Execute an immediate Git commit following even minor file changes. All commits must strictly be authored under:
16
+ - `user.name`: `yashasvi9199`
17
+ - `user.email`: `yashasvi9199@gmail.com`
18
+
19
+ 8. **Semantic Conventional Commits:** Enforce conventional commit prefixes strictly. Commits must follow the format `<prefix>(<scope>): <message>` (or `<prefix>[<scope>]: <message>`), where prefix is one of: `feat`, `fix`, `build`, `chore`, `ci`, `docs`, `style`, `refactor`, `perf`, `test`, `nit`, `minor`, `bin`, or `dist`.
@@ -0,0 +1,24 @@
1
+ # DOCUMENTATION & LEDGER INVARIANTS
2
+
3
+ 1. **Explicit Trigger & SemVer Sync:**
4
+ - Update documentation files only when explicitly requested, or immediately following any Semantic Version increment in `docs/CHANGELOG.md`.
5
+ - Never generate unsolicited documentation files during standard feature edits.
6
+
7
+ 2. **Semantic Versioning Ledger (`docs/CHANGELOG.md`):**
8
+ - Strictly follow Semantic Versioning (`X.Y.Z`):
9
+ - `X` (Major): Breaking API/architectural changes or foundational feature overhauls.
10
+ - `Y` (Minor): Backward-compatible new features, new endpoints, or UI additions.
11
+ - `Z` (Patch): Backward-compatible bug fixes, UI styling tweaks, or minor refactors.
12
+ - Categorize entries under clear SemVer subheadings: `### Added`, `### Changed`, `### Fixed`, or `### Removed`.
13
+
14
+ 3. **Developer Onboarding Manual (`docs/GUIDE.md`):**
15
+ - Maintain a practical, reproducible guide for onboarding new developers.
16
+ - Detail project setup commands (`pnpm install`, `pnpm dev`), system prerequisites, all required environment variable keys (with explanations for how to obtain them), and local build scripts.
17
+
18
+ 4. **Immutable Database Ledger (`docs/DATABASE.sql`):**
19
+ - Maintain an append-only transaction ledger of all database schema changes.
20
+ - Every entry must append to the bottom of the file with:
21
+ - ISO Timestamp and Date.
22
+ - Target table/entity and operational objective (Rationale).
23
+ - The exact executable SQL mutation query (`CREATE TABLE`, `ALTER TABLE`, `CREATE INDEX`).
24
+ - Entries written to this file are strictly immutable: past queries must never be edited, refactored, or deleted.
@@ -0,0 +1,33 @@
1
+ # FRONTEND UI/UX, MOTION & MOBILE STANDARDS
2
+
3
+ 1. **Architecture & State Partitioning:**
4
+ - Standardize on Vite + React SPA/PWA architecture.
5
+ - Use Zustand strictly for global client UI state (modals, drawers, navigation, local user flags).
6
+ - Use TanStack Query / SWR for all server state, mutations, and caching. Never duplicate server cache into Zustand.
7
+
8
+ 2. **Responsive Styling & Feature Scope:**
9
+ - Standardize on Tailwind CSS for layouts and primitives. Ban arbitrary inline style overrides and dark/light mode toggle complexity.
10
+ - Prohibit monolithic global stylesheets. Each feature module must maintain a dedicated `.styles.css` file for scoped animations or complex pseudo-selectors.
11
+
12
+ 3. **Desktop vs. Mobile View Separation:**
13
+ - **Static / Standard UI:** Implement responsive Tailwind breakpoint classes within a single component.
14
+ - **Motion / 3D / Complex Scroll Pages:** Maintain dedicated UI views (`View.desktop.tsx` vs `View.mobile.tsx`). Isolate mouse/wheel-based GSAP ScrollTriggers to Desktop, and touch-optimized pointer gestures to Mobile.
15
+ - Explicitly configure CSS `touch-action: pan-y` and gesture recognizers on touch views to prevent inverted or fighting scroll axis states.
16
+
17
+ 4. **Conversion & Visual Hierarchy:**
18
+ - Place the primary Call to Action (CTA) above the fold on all initial viewports.
19
+ - Implement an explicit sticky mobile CTA bar for viewports under `768px`.
20
+
21
+ 5. **Interface State Feedback:**
22
+ - Every interactive form, async mutation, and data fetch must include explicit loading states (skeletons or disabled spinner states) and localized inline form validation error states.
23
+
24
+ 6. **Browser Storage Strategy:**
25
+ - **Cookies (`httpOnly`, `Secure`, `SameSite`):** Strictly reserved for authentication tokens and session identifiers. Never store auth tokens in LocalStorage.
26
+ - **LocalStorage:** Reserved exclusively for non-sensitive, persistent preferences (e.g., drawer collapsed, language).
27
+ - **SessionStorage:** Reserved for transient, tab-specific multi-step form data.
28
+ - **IndexedDB:** Reserved for heavy structured payloads, offline caching, and PWA synchronization.
29
+
30
+ 7. **Capacitor Android Integration:**
31
+ - Store auth tokens in Native Secure Storage on Capacitor builds.
32
+ - Explicitly handle Android hardware back-button listeners (`App.addListener('backButton')`), app pause/resume state listeners, and graceful native permissions.
33
+ - Deploy dynamic runtime URL resolution using ternary fallback: Deployment Platform Variable -> `.env`/`dev.vars` -> `localhost`.
@@ -0,0 +1,24 @@
1
+ # SECURITY & DATA VALIDATION INVARIANTS
2
+
3
+ 1. **Zero-Trust Schema Validation:** Every incoming API payload, query param, and path variable must be validated against a strict schema (e.g., Zod, Valibot) checking type, length, and format. Reject non-matching data immediately; do not rely on loose sanitization.
4
+ 2. **Sequential ID Masking:** Never expose raw, auto-incrementing database integers to clients or public routes. Use cryptographically secure UUIDs, ULIDs, or NanoIDs to prevent resource enumeration.
5
+ 3. **Universal Injection Defense:**
6
+ - **SQL:** Strictly enforce parameterized queries via type-safe ORMs/query builders (e.g., Drizzle, Prisma, Kysely). Manual string concatenation and raw template interpolation are strictly banned.
7
+ - **NoSQL / Document:** Strictly map and type-cast incoming properties field-by-field. Never pass raw request objects into query filters to prevent operator injection.
8
+ 4. **Mass-Assignment Defense:** Never spread raw request bodies directly into database inserts or updates (`...req.body`). Explicitly pick whitelisted attributes matching the table schema.
9
+ 5. **Anti-DoS Input Capping:**
10
+ - Enforce hard character limits (e.g., 64–72 characters) on password fields before hashing to neutralize CPU-exhaustion attacks against bcrypt/argon2.
11
+ - Enforce execution timeouts or use pre-vetted standard patterns for regular expressions to prevent catastrophic backtracking (ReDoS).
12
+ 6. **SSTI & Template Isolation:** Never concatenate user-supplied input into template strings, server renderers, or dynamic evaluators. Pass dynamic values strictly as data parameters.
13
+ 7. **Storage & Binary File Isolation:**
14
+ - Discard client-provided filenames; rename uploaded assets with server-generated UUIDs.
15
+ - Offload binary transfers using short-lived pre-signed/signed upload URLs rather than streaming large files through application memory.
16
+ - Validate true MIME types via binary magic numbers (file headers), not file extensions. Store uploads outside executable paths.
17
+ 8. **Dynamic CORS & Transport:**
18
+ - Never use wildcard (`*`) origins on endpoints that exchange credentials, cookies, or auth headers.
19
+ - Resolve allowed origins dynamically from runtime environment variables.
20
+ 9. **Cryptographic Entropy:** Prohibit `Math.random()` for any security context. Always utilize the Web Crypto API (`crypto.getRandomValues`, `crypto.randomUUID`) or platform-native cryptographic libraries.
21
+
22
+ ## Actionable Security Workflows
23
+ - **Dependency & Secret Leak Auditing:** Trigger `/audit-security` to run `pnpm audit` and verify `.env` secrecy.
24
+ - **HTTP Header Hardening:** Trigger `/harden-headers` to configure CSP, HSTS, frame options, and dynamic CORS middleware.
@@ -0,0 +1,15 @@
1
+ # SEO, CORE WEB VITALS & TELEMETRY STANDARDS
2
+
3
+ 1. **Page Metadata & Structured Data:**
4
+ - Every routable view must expose a unique `<title>` and `<meta name="description">`.
5
+ - Indexable views must include a `<link rel="canonical">` tag pointing to the production domain, stripping marketing/tracking query parameters to prevent duplicate content indexing.
6
+ - Every key indexable page must inject validated JSON-LD schema (`<script type="application/ld+json">`) defining standard entities (`WebSite`, `SoftwareApplication`, `Organization`).
7
+
8
+ 2. **Core Web Vitals & Cumulative Layout Shift (CLS):**
9
+ - All `<img>`, `<video>`, `<iframe>`, and canvas containers must specify explicit `width`/`height` or CSS `aspect-ratio` properties.
10
+ - Dynamic UI elements rendered above the fold must reserve layout height using skeletons or fixed min-height containers to keep Cumulative Layout Shift below 0.1.
11
+
12
+ 3. **Telemetry Privacy & Event Contracts:**
13
+ - Telemetry and analytics pings must remain strictly disabled until explicit user consent is confirmed.
14
+ - All analytics events must adhere to a strict, centralized TypeScript dictionary (`event_name`, `timestamp`, `session_id`, typed properties). Caching or transmitting personally identifiable information (PII), plain passwords, or form inputs is banned.
15
+ - In SPA routing (React/Vite), attach a router-level observer to dispatch a virtual `page_view` telemetry event on every route transition.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Run dependency audit and scan project for secret leaks or gitignore flaws
3
+ ---
4
+
5
+ # Security Audit Task
6
+ 1. Execute `pnpm audit` in the terminal and report vulnerabilities by severity.
7
+ 2. Inspect `.gitignore` to ensure `.env`, `.env.local`, and custom secret files are excluded.
8
+ 3. Search the workspace tree for hardcoded API keys, JWT secrets, or unparameterized queries.
9
+ 4. Confirm `.env.example` contains variable placeholders with dummy data only.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Audit metadata, JSON-LD, canonical tags, heading hierarchy, and image alt attributes
3
+ ---
4
+
5
+ # SEO Compliance Audit Task
6
+
7
+ 1. Scan all page routes to ensure unique `<title>`, `<meta name="description">`, and `<link rel="canonical">` tags exist.
8
+ 2. Verify that indexable landing views render valid JSON-LD structured data.
9
+ 3. Check headings for strict unbroken hierarchy (single H1 per page, sequential H2/H3).
10
+ 4. Inspect all `<img>` tags for descriptive, non-empty `alt` text and explicit width/height dimensions.
11
+ 5. Print a structured pass/fail compliance checklist with file links.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Audit forms for mandatory unticked DPDP checkboxes, policy links, and public footer address
3
+ ---
4
+
5
+ # DPDP Act Compliance Audit Task
6
+
7
+ 1. **Form Consent Scan:**
8
+ - Search the workspace for all form components (`<form>`, `handleSubmit`, auth views).
9
+ - Verify every user-facing intake form includes an unticked `DPDPCheckbox`.
10
+ - Flag any form where the consent checkbox defaults to pre-checked (`checked={true}`).
11
+
12
+ 2. **Routing & Legal Page Verification:**
13
+ - Verify `/privacy`, `/terms`, and `/grievance` routes exist and render complete content.
14
+ - Confirm the grievance form includes data erasure/removal options.
15
+
16
+ 3. **Footer & Entity Identity Verification:**
17
+ - Inspect public footer templates to ensure a registered contact address and legal links are rendered.
18
+
19
+ 4. **Output Structured Report:**
20
+ - Print a pass/fail table of all scanned forms and views with exact file paths.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Scaffold interactive cookie consent banner and wire it to localStorage and telemetry gating
3
+ ---
4
+
5
+ # DPDP / GDPR Cookie Consent Banner Task
6
+
7
+ 1. **Scaffold Banner Component (`src/components/common/CookieBanner.tsx`):**
8
+ - Design a fixed bottom modal or drawer responsive across desktop and mobile viewports.
9
+ - Include clear explanatory text regarding essential vs. non-essential analytics cookies.
10
+ - Provide explicit "Accept All", "Reject Non-Essential", and "Customize" action buttons.
11
+
12
+ 2. **State & Storage Binding:**
13
+ - Store user preference in `localStorage` under `dpdp_cookie_consent` (`"granted"` | `"denied"`).
14
+ - Ensure banner does not re-render if a valid preference is already stored.
15
+
16
+ 3. **Link to Telemetry Engine:**
17
+ - Connect the consent status to the telemetry gate (`src/lib/telemetry.ts`):
18
+ - If `"granted"`, initialize analytics and trigger pending page views.
19
+ - If `"denied"` or unselected, prevent any outbound tracking pings.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Scaffold complete DPDP compliance pages (Privacy Policy, Terms, Grievance route) and Consent Checkbox component
3
+ ---
4
+
5
+ # DPDP Legal Route & Component Scaffolding Task
6
+
7
+ 1. **Scaffold Shared Legal Views:**
8
+ - Inspect existing routing setup (`react-router-dom`, TanStack Router, etc.).
9
+ - Create or update the following views:
10
+ - `src/pages/legal/PrivacyPolicyView.tsx`: Comprehensive policy covering collection purposes, third-party services, retention windows, and user rights.
11
+ - `src/pages/legal/TermsView.tsx`: Standard platform terms, acceptable use, liability limits, and dispute jurisdiction.
12
+ - `src/pages/legal/GrievanceView.tsx`: Displays statutory Grievance Officer email/address with an interactive form containing action reasons:
13
+ - "Delete / Erase My Personal Data"
14
+ - "Rectify / Update Outdated Information"
15
+ - "Revoke Consent"
16
+ - "General Inquiry"
17
+
18
+ 2. **Scaffold Consent Checkbox Component:**
19
+ - Create `src/components/common/DPDPCheckbox.tsx`:
20
+ - Native `<input type="checkbox">` defaulted strictly to `checked={false}`.
21
+ - Descriptive label with clickable routing links to `/privacy` and `/terms`.
22
+ - Required validation hook integration (e.g., React Hook Form / Zod).
23
+
24
+ 3. **Verify Routing & Footer Links:**
25
+ - Register the three views in the main application router.
26
+ - Inject footer anchor links pointing to `/privacy`, `/terms`, and `/grievance`.
27
+
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Scaffold a dedicated Post-Conversion Thank You and confirmation view with analytics triggers
3
+ ---
4
+
5
+ # Post-Conversion UI Scaffolding Task
6
+
7
+ 1. **Locate Target Feature Module:**
8
+ - Identify which feature or route requires the conversion transition (e.g., `features/checkout`, `features/auth`, or `features/lead-gen`).
9
+
10
+ 2. **Scaffold the Confirmation View (`ThankYouView.tsx`):**
11
+ - Place primary confirmation elements above the fold:
12
+ - Success confirmation banner/check animation.
13
+ - Dynamic transaction ID or account reference identifier.
14
+ - Clear summary of the user's action and explicit next steps.
15
+ - Primary and secondary navigation buttons (e.g., "Go to Dashboard", "Download Receipt").
16
+ - Ensure the layout is responsive and contains a sticky CTA bar on mobile screens.
17
+
18
+ 3. **Attach Analytics & State Handlers:**
19
+ - Inject an event dispatch hook for analytics tracking (reading track IDs conditionally from environment variables).
20
+ - Ensure back-button navigation is handled cleanly so users cannot accidentally re-submit the previous conversion form.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Scaffold production-ready responsive UI routes for 404, 500, downtime, and redirect fallbacks
3
+ ---
4
+
5
+ # Edge-Case UI Scaffolding Task
6
+
7
+ 1. **Verify Project Structure:**
8
+ - Inspect the current routing setup (`react-router-dom`, TanStack Router, etc.) to determine the routing convention.
9
+ - Identify the primary UI library/Tailwind tokens already configured in the workspace.
10
+
11
+ 2. **Generate Standardized View Templates:**
12
+ - Create or update the following dedicated route components inside the project's view/page directory:
13
+ - `NotFoundView.tsx` (Custom 404): Include a clear error statement, primary home button, search/navigation fallback, and an above-the-fold CTA.
14
+ - `ErrorBoundaryView.tsx` (Generic 500): Implement a React Error Boundary fallback view that captures crash metrics, presents a user-friendly error payload without leaking internal stack traces, and provides an immediate refresh/retry CTA.
15
+ - `MaintenanceView.tsx` (Downtime): Create a clean, static, standalone downtime splash view detailing service status and estimated recovery.
16
+ - `RedirectView.tsx`: Build an animated redirection interstitial component featuring a fallback link in case automatic redirection is delayed.
17
+
18
+ 3. **Enforce Responsive Layouts:**
19
+ - Ensure all scaffolded templates are fully responsive with sticky action buttons on mobile screens.
20
+ - Verify that all visual assets referenced have descriptive `alt` tags and contain no missing dependencies.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Scan router tree and regenerate public/sitemap.xml and public/robots.txt
3
+ ---
4
+
5
+ # Sitemap & Robots Generation Task
6
+
7
+ 1. Inspect router configuration to extract all public, indexable route paths.
8
+ 2. Exclude private routes, authenticated dashboards, API paths, and error fallback pages.
9
+ 3. Generate `public/sitemap.xml` conforming to standard Sitemaps XML protocol with current ISO timestamps.
10
+ 4. Generate `public/robots.txt` referencing the sitemap URL and blocking restricted directories.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: Scaffold and verify strict HTTP browser security headers
3
+ ---
4
+
5
+ # Security Header Hardening Task
6
+ 1. Inspect the server or middleware layer (Node, Express, Hono, Edge functions).
7
+ 2. Configure standard defensive headers:
8
+ - `Content-Security-Policy` (CSP)
9
+ - `X-Frame-Options: DENY`
10
+ - `X-Content-Type-Options: nosniff`
11
+ - `Referrer-Policy: strict-origin-when-cross-origin`
12
+ 3. Ensure CORS policies resolve whitelisted origins dynamically from environment variables.
13
+ - `Strict-Transport-Security` (HSTS for HTTPS)
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Generate optimized Open Graph preview assets (1200x630), favicons, and social cards
3
+ ---
4
+
5
+ # Open Graph & Asset Generation Task
6
+
7
+ 1. **Context Ingestion:**
8
+ - Inspect user arguments passed to the command (e.g., `/open-graph generate images based on README and UI`).
9
+ - If no arguments are provided, read `README.md`, `package.json`, and the main landing page UI to determine app theme, brand name, primary colors, and tagline.
10
+
11
+ 2. **Asset Generation:**
12
+ - **Open Graph Social Card (1200x630):** Generate an SVG template incorporating brand title, category tag, product illustration/mockup layout, and tagline. Export or convert to high-contrast social image specifications.
13
+ - **Favicon Suite:** Generate `public/icon.svg` (scalable vector), `public/favicon.ico`, and `public/apple-touch-icon.png` (180x180) following the primary visual mark.
14
+
15
+ 3. **HTML Metadata Integration:**
16
+ - Ensure `index.html` (or the root `<head>` component) includes matching Open Graph tags:
17
+ - `og:image` pointing to the generated preview card.
18
+ - `og:image:width` (1200) and `og:image:height` (630).
19
+ - Standard favicon `<link rel="icon">` references.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Configure an offline-first Progressive Web App (PWA) with Service Worker, Web App Manifest, and Cache Storage
3
+ ---
4
+
5
+ # Offline-First PWA Setup Task
6
+
7
+ 1. **Generate Web App Manifest:**
8
+ - Create `public/manifest.json` (or `manifest.webmanifest`) declaring:
9
+ - `name`, `short_name`, `theme_color`, and `background_color`.
10
+ - `display: "standalone"`, `start_url: "/"`, and `orientation: "portrait"`.
11
+ - Standard icon mappings for `192x192` and `512x512` resolutions.
12
+ - Link the manifest inside `index.html`.
13
+
14
+ 2. **Implement Service Worker & Offline Cache:**
15
+ - Create the Service Worker file (e.g., `public/sw.js` or via a Vite PWA plugin like `vite-plugin-pwa`).
16
+ - Configure cache versioning and implement Cache-First / Stale-While-Revalidate strategies for:
17
+ - Static assets (HTML, compiled CSS, JS chunks, and favicons).
18
+ - Standard offline application shell fallback.
19
+
20
+ 3. **Register Service Worker:**
21
+ - Create a registration utility (e.g., `src/utils/registerSW.ts`) that executes on window load.
22
+ - Add an update-detection event listener to notify the client when a new version of the app shell is waiting to activate.
23
+
24
+ 4. **Verify Offline Data Storage:**
25
+ - Ensure utilities are available to persist API data into `IndexedDB` when network calls fail, enabling offline-first browsing.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Scaffold type-safe analytics taxonomy, consent gate, and SPA route change listeners
3
+ ---
4
+
5
+ # Telemetry Setup Task
6
+
7
+ 1. Create `src/types/telemetry.types.ts` defining strict event unions without PII.
8
+ 2. Scaffold `src/lib/telemetry.ts` with runtime environment checks (suppressing pings on localhost).
9
+ 3. Bind consent-checking middleware so events drop silently until consent is granted.
10
+ 4. Inject an SPA route observer into the top-level router to trigger virtual page views on route changes.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Scan codebase against rules/ and specs, initialize .pending-tasks/, and synchronize checklist.md
3
+ ---
4
+
5
+ # Task Synchronization & Audit Task
6
+
7
+ 1. **Initialize Task Storage:**
8
+ - Verify if `.pending-tasks/` directory exists. If not, create it.
9
+ - Verify if `.pending-tasks/checklist.md` exists. If not, initialize with standard category headers:
10
+ - `## Core & Types`
11
+ - `## API & Backend`
12
+ - `## Security & Validation`
13
+ - `## Frontend & UI States`
14
+ - `## SEO & Analytics`
15
+ - `## Compliance & Legal`
16
+
17
+ 2. **Audit Workspace Compliance:**
18
+ - Inspect recent changes against active rule files in `rules/`.
19
+ - Scan for:
20
+ - Missing error boundaries or fallback views (`404`, `500`)
21
+ - Missing `alt` attributes or uncompressed assets
22
+ - Routes missing meta titles, descriptions, or canonical tags
23
+ - Unused or loose `any` types in `.types.ts`
24
+ - Pending OpenSpec changes (`openspec/changes/`)
25
+ - Pending security checks: unhardened headers (run `/harden-headers`) or unverified dependencies (run `/audit-security`)
26
+
27
+ 3. **Update `.pending-tasks/checklist.md`:**
28
+ - Append newly identified gaps under appropriate category headers.
29
+ - Retain existing tasks; do not overwrite in-progress items.
30
+ - Display a concise markdown summary in chat: total pending items, high-priority count, and next suggested action.