Skip to content

Commit f1cab8d

Browse files
authored
Add repository-scoped Copilot/Codex guidance docs aligned with Gitfolio branch/data constraints (#42)
1 parent cb83189 commit f1cab8d

2 files changed

Lines changed: 79 additions & 0 deletions

File tree

‎.github/copilot-instructions.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# GitHub Copilot Instructions for Gitfolio
2+
3+
## Project context
4+
- This repo is both a Vite + React + TypeScript portfolio app and an npm CLI (`gitforge`).
5+
- Keep the app deterministic and static: do not add runtime GitHub API calls in browser code.
6+
- Use functional React components with TypeScript and Tailwind CSS.
7+
8+
## Branch and data rules
9+
- `main` is template code only: `data/*.json` must stay empty (`[]`).
10+
- `web` is deployment + personal data branch.
11+
- Never propose changes that put personal content into `main`.
12+
13+
## Generated files
14+
- Do not hand-edit generated files:
15+
- `src/generated/githubData.ts`
16+
- `src/siteContent.json`
17+
- If content generation is needed, use existing generator workflows/scripts.
18+
19+
## Config and secrets
20+
- Source-of-truth config is `gitforge.config.json` (git-ignored).
21+
- Only template config (`gitforge.config.example.json`) is tracked.
22+
- Never commit secrets (`.env`, tokens, client secrets, PATs).
23+
24+
## Editing guidance
25+
- Make minimal, surgical changes tied to the request.
26+
- Reuse existing patterns and libraries before introducing new ones.
27+
- Avoid unrelated refactors.
28+
- Keep routing/template patterns consistent across pages.
29+
30+
## Validation commands
31+
- Install: `pnpm install`
32+
- Lint: `pnpm lint`
33+
- Build: `pnpm build`
34+
35+
## Documentation consistency
36+
- Keep `CLAUDE.md`, `README.md`, and workflow behavior in sync when changing architecture expectations.

‎CODEX.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Codex Instructions for Gitfolio
2+
3+
## Goal
4+
Contribute safely to Gitfolio with small, correct changes that preserve branch/data architecture and static-site behavior.
5+
6+
## Understand first
7+
- Read `CLAUDE.md`, `README.md`, and relevant workflow files before structural changes.
8+
- Prefer minimal edits in existing patterns over broad rewrites.
9+
10+
## Critical repository constraints
11+
- Two-branch model:
12+
- `main`: template/dev branch, `data/*.json` must remain empty (`[]`).
13+
- `web`: deployment branch with real personal data.
14+
- `sync-to-web.yml` preserves `web` data and dispatches deploy.
15+
- `deploy.yml` deploys from `web`.
16+
17+
## Data and generation rules
18+
- Do not hand-edit generated outputs:
19+
- `src/generated/githubData.ts`
20+
- `src/siteContent.json`
21+
- Use existing generator script when needed: `scripts/generate-github-data.js`.
22+
23+
## Security rules
24+
- Never commit secrets or local credentials:
25+
- `.env`, PAT tokens, OAuth secrets, private keys
26+
- `gitforge.config.json` when it contains private token values
27+
- Follow `SECURITY.md` guidance for safe commits.
28+
29+
## Implementation style
30+
- React: functional components + TypeScript.
31+
- UI: Tailwind-first, clean and minimal style.
32+
- Keep browser behavior static/deterministic (no runtime GitHub API access in frontend).
33+
- Reuse existing utilities/components and avoid unnecessary dependencies.
34+
35+
## Validation
36+
- Install dependencies: `pnpm install`
37+
- Lint: `pnpm lint`
38+
- Build: `pnpm build`
39+
- Report pre-existing failures separately from new issues introduced by your changes.
40+
41+
## Scope discipline
42+
- Only change what the task requires.
43+
- If touching workflows or branching logic, ensure behavior still protects `web` data and `main` cleanliness.

0 commit comments

Comments
 (0)