|
| 1 | +# Copilot Instructions |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +Personal portfolio/site built with Astro + TypeScript, bundled with Bun, linted with Biome. |
| 5 | + |
| 6 | +## Tech Stack |
| 7 | +- Framework: Astro 6 (SSG, file-based routing) |
| 8 | +- UI layer: `.astro` components + SolidJS for interactive islands (`src/components/solid/`) |
| 9 | +- UI primitives: `src/components/ui/` — reuse before creating new |
| 10 | +- Language: TypeScript (strict, version 6) |
| 11 | +- Package Manager: Bun — always `bun add`, `bun run`, `Bun.*` APIs |
| 12 | +- Styling: Tailwind CSS v4 (via `@tailwindcss/vite`) + `@tailwindcss/typography` |
| 13 | +- Spellcheck: cspell — new domain words go in `project-words.txt` |
| 14 | +- Schema validation: Zod (via `astro/zod`) — already imported in content collections |
| 15 | +- Astro integrations already registered in `astro.config.ts`: SolidJS, MDX, Sitemap, PWA, Partytown, RSS, rehype-d2. Do NOT add duplicates. |
| 16 | + |
| 17 | +## Project Structure |
| 18 | +- `src/components/` — Astro page-level components |
| 19 | +- `src/components/solid/` — SolidJS interactive island components |
| 20 | +- `src/components/ui/` — UI primitives: FeatureCard, FormField (check here first) |
| 21 | +- `src/layouts/` — Page layout wrappers |
| 22 | +- `src/pages/` — File-based routing |
| 23 | +- `src/content/` — Content collection data (JSON + md/mdx) |
| 24 | +- `src/data/` — Static non-collection data |
| 25 | +- `src/styles/` — Global CSS (excluded from Biome) |
| 26 | +- `src/lib/` — Shared utilities |
| 27 | +- `src/scripts/` — Client-side scripts |
| 28 | +- `src/types/` — Shared TypeScript types |
| 29 | + |
| 30 | +## Placement Rules |
| 31 | +- New shared types → `src/types/` |
| 32 | +- SolidJS component-local types → `src/components/solid/types.ts` |
| 33 | +- New utilities → `src/lib/` |
| 34 | +- New interactive components → `src/components/solid/` (SolidJS `.tsx`) |
| 35 | +- New static components → `src/components/` or `src/components/ui/` if reusable |
| 36 | +- New pages → `src/pages/` (Astro file-based routing) |
| 37 | + |
| 38 | +## Code Style |
| 39 | +- Formatter: Biome 2 (NOT Prettier, NOT ESLint) |
| 40 | +- Indent: 2 spaces, double quotes for TS/JS strings |
| 41 | +- No unused imports or variables (Biome enforced) — EXCEPT `.astro` files (rules are OFF there) |
| 42 | +- CSS files excluded from Biome — style freely |
| 43 | +- Auto-fix: `bun run lint:fix` |
| 44 | + |
| 45 | +## SolidJS Islands |
| 46 | +- Mount with `client:load` or `client:visible` in `.astro` files: `<Navbar client:load />` |
| 47 | +- Use `createSignal`, `createEffect`, `createMemo` — NOT React hooks |
| 48 | +- Component prop types go in `src/components/solid/types.ts` |
| 49 | + |
| 50 | +## Content Collections (`src/content.config.ts`) |
| 51 | + |
| 52 | +### `site` — JSON in `src/content/site/` |
| 53 | +brandTitle, metaDescription, kicker, heroLead, githubUrl, responseTime, |
| 54 | +timezone, location, availability, contactEmail, bookingUrl |
| 55 | + |
| 56 | +### `services` — JSON in `src/content/services/` |
| 57 | +slug, title, metaTitle, metaDescription, heroTitle, heroSubtitle, introduction, |
| 58 | +benefits[]{title,description}, services[]{name,description,icon}, technologies[], |
| 59 | +cta{title,description,buttonText,buttonLink}, |
| 60 | +faqs?[]{question,answer}, parentService?, relatedServices?[], relatedBlogPosts?[] |
| 61 | + |
| 62 | +### `portfolio` — JSON in `src/content/portfolio/` |
| 63 | +order(int), title, category, summary, description, challenge, solution, |
| 64 | +impact, timeframe, stack[], proofUrl, proofLabel |
| 65 | + |
| 66 | +### `blog` — .md/.mdx in `src/content/blog/` |
| 67 | +title, description, publishDate, updatedDate?, author(default:"Avaab Razzaq"), |
| 68 | +image?{src,alt}, tags[], category(enum: AI|Marketing|Development|Growth|Analytics|Tutorial), |
| 69 | +draft(bool), featured(bool), readingTime?, relatedService?, |
| 70 | +howTo?{totalTime?,estimatedCost?,steps[]{name,text}} |
| 71 | + |
| 72 | +## Commands |
| 73 | +- Dev: `bun run dev` |
| 74 | +- Build: `bun run build` (runs `astro check` + `astro build`) |
| 75 | +- Check: `bun run check` |
| 76 | +- Lint: `bun run lint:fix` |
| 77 | +- Format: `bun run format:fix` |
| 78 | +- Spell: `bun cspell "**"` |
| 79 | + |
| 80 | +## Commit Conventions |
| 81 | +Conventional commits scoped to area: `feat(blog): add reading time display` |
| 82 | +Prefixes: `feat:` `fix:` `chore:` `docs:` `refactor:` |
| 83 | + |
| 84 | +## Available MCP Tools |
| 85 | +Use these proactively during implementation — don't wait to be asked. |
| 86 | + |
| 87 | +### `astro-docs` |
| 88 | +Query official Astro documentation. Use FIRST whenever working with content collections, |
| 89 | +routing, layouts, integrations, or any Astro API. Never guess Astro APIs — look them up here. |
| 90 | + |
| 91 | +### `context7` |
| 92 | +Fetch up-to-date library docs for any package in `package.json`. |
| 93 | +Use for SolidJS signals, Zod schemas, Biome config, Tailwind v4, or Bun APIs. |
| 94 | +Prefer this over training-data knowledge for library-specific syntax. |
| 95 | + |
| 96 | +### `typescript-lsp` |
| 97 | +TypeScript Language Server. Use to check types before finalizing a component's props |
| 98 | +interface, validate imports, or find type errors without a full build. |
| 99 | + |
| 100 | +### `filesystem` |
| 101 | +Read/write files in `/workspaces`. Always read existing components before writing new |
| 102 | +ones — check patterns first. Verify a file exists before importing it. |
| 103 | + |
| 104 | +### `bun-runtime` |
| 105 | +Execute Bun scripts. Use to run `bun run lint:fix` after generating code and |
| 106 | +`bun run build` to verify no build errors before finishing a task. |
| 107 | + |
| 108 | +### `tailwindcss` |
| 109 | +Tailwind utility lookup. Use when adding or auditing CSS classes to ensure they are |
| 110 | +valid for Tailwind v4. |
| 111 | + |
| 112 | +### `sequential-thinking` |
| 113 | +Use for any task involving 3+ interdependent steps — e.g., adding a new content |
| 114 | +collection (schema → content file → component → page). Forces step-by-step reasoning. |
| 115 | + |
| 116 | +### `memory` |
| 117 | +Persist architectural decisions across sessions. When a pattern or decision is made, |
| 118 | +write it to memory so future sessions stay consistent. |
| 119 | + |
| 120 | +### `github` |
| 121 | +Read issues, PRs, and repo state. Use when implementing a feature tied to an open issue |
| 122 | +or checking if work is already in progress on a PR. |
| 123 | + |
| 124 | +### `playwright` |
| 125 | +Browser automation. Use after building a new page or component to screenshot and verify |
| 126 | +it renders correctly before marking a task done. |
| 127 | + |
| 128 | +### `fetch` |
| 129 | +Fetch external URLs. Use to retrieve third-party API specs or check live URLs referenced |
| 130 | +in content collections. |
| 131 | + |
| 132 | +### `time` |
| 133 | +Get current date/time. Use when generating blog post `publishDate` fields or any content |
| 134 | +requiring a timestamp. |
| 135 | + |
| 136 | +## Do NOT |
| 137 | +- Use npm or yarn — Bun only |
| 138 | +- Use React or Vue — SolidJS for islands, Astro for everything else |
| 139 | +- Use ESLint or Prettier — Biome only |
| 140 | +- Use `any` TypeScript type without an explanatory comment |
| 141 | +- Add `console.log` without `// TODO: remove` |
| 142 | +- Modify `bun.lock` manually |
| 143 | +- Create Zod schemas for content outside `src/content.config.ts` |
| 144 | +- Inline styles — use Tailwind classes or Astro scoped `<style>` blocks |
| 145 | +- Add integrations to `astro.config.ts` without checking if they are already registered |
0 commit comments