opencastle 0.32.12 → 0.33.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/LICENSE +21 -93
- package/README.md +5 -3
- package/package.json +2 -2
- package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
- package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
- package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +12 -12
- package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
- package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
- package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
- package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
- package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
- package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +12 -12
- package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
- package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
- package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
- package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
- package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
- package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
- package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
- package/src/orchestrator/plugins/astro/SKILL.md +22 -29
- package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
- package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
- package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
- package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/convex/SKILL.md +13 -1
- package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
- package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
- package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
- package/src/orchestrator/plugins/figma/SKILL.md +41 -66
- package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/jira/SKILL.md +26 -114
- package/src/orchestrator/plugins/linear/SKILL.md +42 -109
- package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
- package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
- package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
- package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
- package/src/orchestrator/plugins/notion/SKILL.md +26 -168
- package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
- package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
- package/src/orchestrator/plugins/nx/SKILL.md +12 -12
- package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
- package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
- package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
- package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
- package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
- package/src/orchestrator/plugins/resend/SKILL.md +23 -137
- package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
- package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
- package/src/orchestrator/plugins/slack/SKILL.md +36 -111
- package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
- package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
- package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
- package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
- package/src/orchestrator/plugins/teams/SKILL.md +35 -85
- package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/trello/SKILL.md +25 -97
- package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
- package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
- package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
- package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
- package/src/orchestrator/prompts/generate-convoy.prompt.md +6 -0
- package/src/orchestrator/prompts/generate-prd.prompt.md +4 -0
- package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
- package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
- package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
- package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
- package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
- package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +16 -0
- package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +99 -0
- package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
- package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
- package/src/orchestrator/skills/context-map/SKILL.md +28 -55
- package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
- package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
- package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
- package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
- package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
- package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
- package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
- package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
- package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
- package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
- package/src/orchestrator/skills/git-workflow/SKILL.md +13 -2
- package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
- package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
- package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
- package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
- package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
- package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
- package/src/orchestrator/skills/react-development/SKILL.md +50 -42
- package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
- package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
- package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
- package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
- package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
- package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: linear-task-management
|
|
3
|
-
description: "
|
|
3
|
+
description: "Creates and names Linear issues, assigns labels and priorities, manages status transitions, and links issues to PRs. Use when decomposing features into tasks or resuming interrupted sessions. Trigger terms: tickets, backlog, task breakdown, project board, sprint planning"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
7
|
|
|
8
8
|
# Task Management with Linear
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For project-specific team ID, workflow state UUIDs, and label UUIDs, see [tracker-config.md](../../.opencastle/project/tracker-config.md).
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## MCP Tool Examples
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
```json
|
|
15
|
+
// Create issue
|
|
16
|
+
{ "teamId": "TEAM_UUID", "title": "[UI] Build PriceRangeFilter", "description": "Objective: ...\nFiles: ...\nAC: ...", "labelIds": ["LABEL_UUID"], "priority": 2 }
|
|
17
|
+
// → { "id": "TAS-42", "url": "https://linear.app/team/TAS-42" }
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
// Update issue status
|
|
20
|
+
{ "issueId": "TAS-42", "stateId": "IN_PROGRESS_UUID" }
|
|
21
|
+
|
|
22
|
+
// Search issues
|
|
23
|
+
{ "query": "is:open assignee:me", "teamId": "TEAM_UUID" }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Discovered Issues
|
|
27
|
+
|
|
28
|
+
- Search Linear for existing tickets; if found, link and add evidence.
|
|
29
|
+
- If not found, create: Title `[Bug] <symptom>`, Labels `bug` + domain, Priority P1–P4 with rationale, Acceptance steps.
|
|
26
30
|
|
|
27
31
|
## Issue Naming
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
Name issues using a verb-first, actionable format that maps to operator intent:
|
|
30
34
|
|
|
31
35
|
```
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
[Page] Integrate price filter into /places
|
|
37
|
-
[Test] E2E test price range filtering
|
|
38
|
-
[Docs] Update data model documentation
|
|
36
|
+
Add priceRange field to place type -> Action: `Add schema: priceRange to place`
|
|
37
|
+
Run DB migration to add price_range column -> Action: `Migrate DB: add price_range`
|
|
38
|
+
Update GROQ query to include priceRange filter -> Action: `Update query: include priceRange`
|
|
39
|
+
Build PriceRangeFilter component -> Action: `Implement UI: PriceRangeFilter`
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
**Area prefixes:** `[Schema]`, `[DB]`, `[Query]`, `[UI]`, `[Page]`, `[API]`, `[Auth]`, `[Test]`, `[Docs]`, `[Deploy]`, `[Data]`, `[Perf]`, `[Security]`
|
|
42
|
-
|
|
43
42
|
## Priority
|
|
44
43
|
|
|
45
|
-
| Level |
|
|
46
|
-
|
|
47
|
-
| P1 (Urgent) |
|
|
48
|
-
| P2 (High) |
|
|
49
|
-
| P3 (Medium) |
|
|
50
|
-
| P4 (Low) |
|
|
44
|
+
| Level | When to use |
|
|
45
|
+
|-------|-------------|
|
|
46
|
+
| P1 (Urgent) | Blocks other tasks, critical path |
|
|
47
|
+
| P2 (High) | Core feature work, on critical path |
|
|
48
|
+
| P3 (Medium) | Supporting tasks, can be parallelized |
|
|
49
|
+
| P4 (Low) | Docs, cleanup, polish |
|
|
51
50
|
|
|
52
51
|
## Status Workflow
|
|
53
52
|
|
|
@@ -55,91 +54,25 @@ Use `[Area] Short description` format:
|
|
|
55
54
|
Backlog -> Todo -> In Progress -> In Review -> Done -> Cancelled
|
|
56
55
|
```
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
- **Todo** — Planned for current feature, ready to start
|
|
60
|
-
- **In Progress** — Actively being worked on by an agent
|
|
61
|
-
- **In Review** — PR opened, awaiting review/merge
|
|
62
|
-
- **Done** — Completed and verified
|
|
63
|
-
- **Cancelled** — Dropped or no longer relevant
|
|
64
|
-
|
|
65
|
-
### Status Drivers
|
|
66
|
-
|
|
67
|
-
Issue status is driven by **two sources** — the Team Lead agent (via MCP) and the GitHub integration (automatically). Both can move issues through the workflow.
|
|
68
|
-
|
|
69
|
-
**Agent-driven transitions (via MCP):**
|
|
70
|
-
- **Todo -> In Progress** — when the agent starts working on a task
|
|
71
|
-
- **In Progress -> Done** — when non-PR tasks are verified (e.g., docs, config changes)
|
|
72
|
-
- **Any -> Cancelled** — when a task is dropped
|
|
73
|
-
|
|
74
|
-
**GitHub-driven transitions (automatic):**
|
|
75
|
-
|
|
76
|
-
The Linear-GitHub integration auto-updates issue status based on PR lifecycle events. This is configured in Linear under *Settings -> Team -> Issue statuses & automations -> Pull request and commit automation*.
|
|
77
|
-
|
|
78
|
-
| PR Event | Linear Status Change |
|
|
79
|
-
|----------|---------------------|
|
|
80
|
-
| Branch pushed / PR drafted | -> **In Progress** |
|
|
81
|
-
| PR opened | -> **In Progress** |
|
|
82
|
-
| Review requested | -> **In Review** |
|
|
83
|
-
| PR ready for merge (all checks pass) | -> **In Review** |
|
|
84
|
-
| PR merged to `main` | -> **Done** |
|
|
85
|
-
|
|
86
|
-
**Linking issues to PRs:** Include the Linear issue ID (e.g., `TAS-123`) in the branch name or PR title. Linear auto-detects the link and begins status automation. Use the branch name format from Linear: copy with `Cmd+Shift+.` on any issue.
|
|
87
|
-
|
|
88
|
-
**Multiple PRs per issue:** When multiple PRs are linked to one issue, the status only advances to Done when the *last* linked PR is merged.
|
|
57
|
+
### Transition Rules
|
|
89
58
|
|
|
90
|
-
|
|
59
|
+
- Agent (via MCP): `Todo → In Progress` on start; `In Progress → Done` on verified completion; `Any → Cancelled` to drop.
|
|
60
|
+
- GitHub integration: auto-updates status on PR events (push → In Progress, review → In Review, merge → Done). Configure in Linear *Settings → Team → Pull request automation*.
|
|
61
|
+
- Link via issue ID in branch/PR title (e.g., `TAS-123`).
|
|
91
62
|
|
|
92
63
|
## Issue Descriptions
|
|
93
64
|
|
|
94
|
-
Every issue must include:
|
|
65
|
+
Every issue must include: **Objective** (one sentence), **Files (partition)** (paths this agent may modify), **Acceptance Criteria** (verifiable checklist), **Dependencies** (`#TAS-XX`).
|
|
95
66
|
|
|
96
|
-
|
|
97
|
-
**Objective:** One sentence describing the deliverable
|
|
98
|
-
|
|
99
|
-
**Files (partition):**
|
|
100
|
-
- `path/to/relevant/file.ts`
|
|
101
|
-
- `path/to/another/file.ts`
|
|
102
|
-
|
|
103
|
-
**Acceptance Criteria:**
|
|
104
|
-
- [ ] Specific, verifiable outcome 1
|
|
105
|
-
- [ ] Specific, verifiable outcome 2
|
|
106
|
-
|
|
107
|
-
**Dependencies:** #TAS-XX (if any)
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
The **Files (partition)** section defines which files this agent is allowed to modify. This prevents merge conflicts when multiple agents work in parallel — no two issues in the same phase should list overlapping files.
|
|
111
|
-
|
|
112
|
-
## Feature Grouping
|
|
113
|
-
|
|
114
|
-
- Use a **Linear project** for each major feature
|
|
115
|
-
- Create projects via the Linear UI — no create_project API is available via MCP
|
|
116
|
-
- All related issues belong to that project
|
|
117
|
-
- Issues track individual subtasks within the feature
|
|
67
|
+
Group related issues under a Linear project; issues track individual subtasks.
|
|
118
68
|
|
|
119
69
|
## Session Workflow
|
|
120
70
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
5. Begin delegation
|
|
128
|
-
|
|
129
|
-
### During execution
|
|
130
|
-
|
|
131
|
-
- Move issue to **In Progress** before delegating to an agent
|
|
132
|
-
- Move issue to **Done** immediately after the agent completes and output is verified
|
|
133
|
-
- If a task is blocked, update the issue description explaining the blocker (Linear MCP has no comment API)
|
|
134
|
-
|
|
135
|
-
### Resuming an interrupted session
|
|
136
|
-
|
|
137
|
-
1. List issues filtered by **In Progress** and **Todo** status
|
|
138
|
-
2. Read issue descriptions to restore context
|
|
139
|
-
3. Pick up where work left off — no need to re-analyze from scratch
|
|
140
|
-
|
|
141
|
-
### Completing a feature
|
|
71
|
+
1. Check board for existing in-progress work.
|
|
72
|
+
2. Decompose feature into issues; create all on Linear — verify each returns a valid issue ID.
|
|
73
|
+
3. Delegate: move to **In Progress** before starting; **Done** after verified.
|
|
74
|
+
4. If blocked, update the issue description (Linear MCP has no comment API).
|
|
75
|
+
5. On resume: filter by In Progress/Todo, read descriptions, continue.
|
|
76
|
+
6. On completion: verify all issues Done/Cancelled, run build/lint/test.
|
|
142
77
|
|
|
143
|
-
|
|
144
|
-
2. Run final build/lint/test checks
|
|
145
|
-
3. Mark all project issues as Done or Cancelled (closing the project requires the Linear UI)
|
|
78
|
+
If creation fails: check team ID and state UUIDs in [tracker-config.md](../../.opencastle/project/tracker-config.md); retry once. If board state is inconsistent on resume: re-read all issue statuses before proceeding.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
Netlify REFERENCE: extended CI build examples, function/edge function snippets, and verification scripts.
|
|
4
|
+
|
|
5
|
+
Put long-form troubleshooting steps and environment-specific snippets here; `SKILL.md` contains the concise checklist.
|
|
6
|
+
Last Updated: 2026-03-31
|
|
7
|
+
|
|
8
|
+
Reference: Netlify verification & scripts
|
|
9
|
+
|
|
10
|
+
- Post-deploy verification scripts (curl checks, env validation) and Lighthouse commands
|
|
11
|
+
- Netlify CLI examples for local `netlify build` and `netlify env:set`
|
|
12
|
+
- Common deploy log patterns and error snippets with remediation steps
|
|
13
|
+
|
|
14
|
+
## Environment Variable Scoping
|
|
15
|
+
|
|
16
|
+
| Scope | When Applied | Use For |
|
|
17
|
+
|-------|-------------|----------|
|
|
18
|
+
| **Production** | `main` deploys | Live secrets, production API keys |
|
|
19
|
+
| **Deploy previews** | All PR/branch builds | Staging/test API keys |
|
|
20
|
+
| **Branch deploy** | Specific branch deploys | Branch-specific overrides |
|
|
21
|
+
| **Local** | `netlify dev` | Local development |
|
|
22
|
+
|
|
23
|
+
## Security Headers (netlify.toml)
|
|
24
|
+
|
|
25
|
+
```toml
|
|
26
|
+
[[headers]]
|
|
27
|
+
for = "/*"
|
|
28
|
+
[headers.values]
|
|
29
|
+
X-Frame-Options = "DENY"
|
|
30
|
+
X-Content-Type-Options = "nosniff"
|
|
31
|
+
Referrer-Policy = "strict-origin-when-cross-origin"
|
|
32
|
+
```
|
|
33
|
+
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: netlify-deployment
|
|
3
|
-
description: "
|
|
3
|
+
description: "Deploy sites, configure serverless and edge functions, and verify builds on Netlify. Use when the user mentions: 'deploy preview', 'configure netlify.toml', or 'debug a failed deploy'. Trigger terms: build error, Netlify Functions, deploy logs, deploy preview"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
-
|
|
8
6
|
# Netlify Deployment
|
|
9
7
|
|
|
10
8
|
Netlify-specific deployment patterns and conventions. For project-specific deployment architecture, environment variables, and key files, see [deployment-config.md](../../.opencastle/stack/deployment-config.md).
|
|
11
9
|
|
|
12
10
|
## Deployment Model
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
| Branch | Environment |
|
|
13
|
+
|--------|-------------|
|
|
14
|
+
| `main` | Production (auto) |
|
|
15
|
+
| `feature/*`, `fix/*` | Deploy preview (auto, unique URL) |
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
main branch → Production deployment (auto)
|
|
18
|
-
feature/* → Deploy preview (auto, unique URL)
|
|
19
|
-
fix/* → Deploy preview (auto, unique URL)
|
|
20
|
-
```
|
|
17
|
+
## Deployment Workflow
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
1. Configure `netlify.toml` (build command, publish dir, env vars).
|
|
20
|
+
2. Build locally: `netlify build --debug` — fix any errors before pushing.
|
|
21
|
+
3. Push branch — Netlify auto-deploys a preview.
|
|
22
|
+
4. Verify preview: `curl -fsS -o /dev/null -w '%{http_code}' https://<DEPLOY_URL>/` — expect 200.
|
|
23
|
+
5. Merge to `main` — production auto-deploys.
|
|
26
24
|
|
|
27
25
|
## Build Configuration (netlify.toml)
|
|
28
26
|
|
|
@@ -39,39 +37,17 @@ fix/* → Deploy preview (auto, unique URL)
|
|
|
39
37
|
to = "/index.html"
|
|
40
38
|
status = 200
|
|
41
39
|
conditions = {Role = ["admin"]}
|
|
42
|
-
|
|
43
|
-
[[headers]]
|
|
44
|
-
for = "/*"
|
|
45
|
-
[headers.values]
|
|
46
|
-
X-Frame-Options = "DENY"
|
|
47
|
-
X-Content-Type-Options = "nosniff"
|
|
48
|
-
Referrer-Policy = "strict-origin-when-cross-origin"
|
|
49
40
|
```
|
|
50
41
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Place functions in `netlify/functions/`:
|
|
42
|
+
For security headers config, see [REFERENCE.md](REFERENCE.md).
|
|
54
43
|
|
|
55
|
-
|
|
56
|
-
// netlify/functions/hello.ts
|
|
57
|
-
import type { Context, Config } from "@netlify/functions";
|
|
58
|
-
|
|
59
|
-
export default async (req: Request, context: Context) => {
|
|
60
|
-
return new Response(JSON.stringify({ message: "Hello from Netlify Functions" }), {
|
|
61
|
-
headers: { "Content-Type": "application/json" },
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const config: Config = {
|
|
66
|
-
path: "/hello",
|
|
67
|
-
};
|
|
68
|
-
```
|
|
44
|
+
## Serverless Functions
|
|
69
45
|
|
|
70
|
-
|
|
46
|
+
Place functions in `netlify/functions/`. For full examples and CI-ready function patterns see [REFERENCE.md](REFERENCE.md).
|
|
71
47
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
- Use background functions for long-running tasks (up to 15 min)
|
|
48
|
+
- Functions use web standard Request/Response. The `Config` export defines routing (path) instead of the default `/.netlify/functions/<name>` path.
|
|
49
|
+
- Supports TypeScript out of the box; default timeout: 10s (extendable to 26s on Pro).
|
|
50
|
+
- Use background functions for long-running tasks (up to 15 min).
|
|
75
51
|
|
|
76
52
|
## Edge Functions
|
|
77
53
|
|
|
@@ -89,26 +65,12 @@ export default async (request: Request, context: Context) => {
|
|
|
89
65
|
export const config = { path: '/geo' };
|
|
90
66
|
```
|
|
91
67
|
|
|
92
|
-
- Run at the CDN edge, sub-millisecond cold starts
|
|
93
68
|
- Use for personalization, A/B testing, geo-routing
|
|
94
69
|
- Deno runtime (not Node.js)
|
|
95
70
|
|
|
96
71
|
## Environment Variables
|
|
97
72
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
| Scope | When Applied | Use For |
|
|
101
|
-
|-------|-------------|---------|
|
|
102
|
-
| **Production** | `main` deploys | Live secrets, production API keys |
|
|
103
|
-
| **Deploy previews** | All PR/branch builds | Staging/test API keys |
|
|
104
|
-
| **Branch deploy** | Specific branch deploys | Branch-specific overrides |
|
|
105
|
-
| **Local** | `netlify dev` | Local development |
|
|
106
|
-
|
|
107
|
-
### Best Practices
|
|
108
|
-
|
|
109
|
-
- Set secrets via Netlify UI or CLI (`netlify env:set`) — never commit them
|
|
110
|
-
- Use `netlify dev` to run locally with injected env vars
|
|
111
|
-
- Validate required vars at build time in `netlify.toml`
|
|
73
|
+
See [REFERENCE.md](REFERENCE.md) for environment variable scoping and security header examples.
|
|
112
74
|
|
|
113
75
|
## Scheduled Functions (Cron)
|
|
114
76
|
|
|
@@ -128,11 +90,19 @@ export const config: Config = {
|
|
|
128
90
|
|
|
129
91
|
## Build Troubleshooting
|
|
130
92
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
93
|
+
```bash
|
|
94
|
+
netlify build --debug # reproduce locally with verbose output
|
|
95
|
+
netlify env:list # verify env vars are set
|
|
96
|
+
netlify status # check linked site and deploy state
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Common fixes: set `NODE_VERSION` in `netlify.toml`, sync lockfile, verify `publish` directory matches build output.
|
|
100
|
+
|
|
101
|
+
## Post-Deploy Verification
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
curl -fsS -o /dev/null -w '%{http_code}' https://<DEPLOY_URL>/ # expect 200
|
|
105
|
+
curl -fsS -o /dev/null -w '%{http_code}' https://<DEPLOY_URL>/api/health # expect 200
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If any route fails: inspect deploy logs in Netlify UI, fix, and re-deploy. See [REFERENCE.md](REFERENCE.md) for extended verification scripts.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
Next.js REFERENCE: deep-dive topics for revalidation, middleware, and advanced caching.
|
|
4
|
+
|
|
5
|
+
Place detailed config snippets and long tables here; the `SKILL.md` keeps only the quick workflow and validation commands.
|
|
6
|
+
Last Updated: 2026-03-31
|
|
7
|
+
|
|
8
|
+
Reference: deeper Next.js topics
|
|
9
|
+
|
|
10
|
+
- Routing edge cases: middleware vs route-level server checks
|
|
11
|
+
- Revalidation patterns: `revalidatePath`, `tags`, on-demand revalidation examples
|
|
12
|
+
- App Router auth patterns and middleware examples
|
|
13
|
+
- Performance tuning: RSC payload sizing and bundle splitting
|
|
14
|
+
|
|
15
|
+
See `next.config.ts`, `app/` examples in the repo for applied patterns.
|
|
16
|
+
|
|
17
|
+
## Caching Details
|
|
18
|
+
|
|
19
|
+
| Mechanism | Scope | How to Use |
|
|
20
|
+
|-----------|-------|------------|
|
|
21
|
+
| **Request Memoization** | Per-request | Automatic deduplication of identical `fetch` calls |
|
|
22
|
+
| **Data Cache** | Cross-request | Cached by default; opt out with `cache: 'no-store'` |
|
|
23
|
+
| **Full Route Cache** | Build time | Static routes cached as HTML + RSC payload |
|
|
24
|
+
| **Router Cache** | Client-side | Prefetched and visited routes cached in browser |
|
|
25
|
+
|
|
26
|
+
On-demand revalidation: `revalidatePath('/blog')` or `revalidateTag('posts')`. Tag a fetch: `fetch(url, { next: { tags: ['posts'] } })`.
|
|
27
|
+
|
|
28
|
+
## Routing — File Conventions & Dynamic Routes
|
|
29
|
+
|
|
30
|
+
| File | Purpose |
|
|
31
|
+
|------|---------|
|
|
32
|
+
| `page.tsx` | Route UI |
|
|
33
|
+
| `layout.tsx` | Shared layout (persists across navigation) |
|
|
34
|
+
| `template.tsx` | Like layout but re-mounts on navigation |
|
|
35
|
+
| `loading.tsx` | Loading UI (automatic Suspense boundary) |
|
|
36
|
+
| `error.tsx` | Error UI (Client Component) |
|
|
37
|
+
| `not-found.tsx` | 404 UI |
|
|
38
|
+
| `route.ts` | API endpoint |
|
|
39
|
+
| `default.tsx` | Fallback for parallel routes |
|
|
40
|
+
|
|
41
|
+
Dynamic route patterns:
|
|
42
|
+
- `app/blog/[slug]/page.tsx` → `/blog/:slug`
|
|
43
|
+
- `app/shop/[...slug]/page.tsx` → `/shop/:slug+` (catch-all)
|
|
44
|
+
- `app/shop/[[...slug]]/page.tsx` → `/shop` or `/shop/:slug+` (optional)
|
|
45
|
+
|
|
46
|
+
### Middleware examples
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { NextResponse, type NextRequest } from 'next/server';
|
|
50
|
+
export function middleware(req: NextRequest) {
|
|
51
|
+
if (!req.cookies.get('session') && req.nextUrl.pathname.startsWith('/dashboard'))
|
|
52
|
+
return NextResponse.redirect(new URL('/login', req.url));
|
|
53
|
+
return NextResponse.next();
|
|
54
|
+
}
|
|
55
|
+
export const config = { matcher: ['/dashboard/:path*'] };
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Anti-Patterns
|
|
59
|
+
|
|
60
|
+
| Anti-Pattern | Why It's Wrong | Do This Instead |
|
|
61
|
+
|-------------|---------------|-----------------|
|
|
62
|
+
| `'use client'` on every component | Bloats JS bundle, defeats RSC benefits | Default to Server Components |
|
|
63
|
+
| Sequential `await` for independent data | Waterfall, slows page load | Use `Promise.all()` |
|
|
64
|
+
| `next/dynamic` with `ssr: false` in Server Components | Build/runtime crash | Extract to Client Component |
|
|
65
|
+
| Fetching in `useEffect` when server fetch works | Extra roundtrip, loading flash | Fetch in Server Component or Server Actions |
|
|
66
|
+
| Giant `layout.tsx` with all providers | Hard to test, couples concerns | Split into a `Providers` Client Component |
|
|
67
|
+
| No `error.tsx` per segment | Unhandled errors crash the page | Add `error.tsx` per route segment |
|
|
68
|
+
| Hardcoding secrets in source | Security risk, version control leak | Use `.env.local` and `process.env` |
|
|
69
|
+
| Skipping `loading.tsx` / `<Suspense>` | Blank screen while data loads | Add `loading.tsx` or wrap in `<Suspense>` |
|
|
70
|
+
| `getServerSideProps` / `getStaticProps` | Legacy Pages Router | Use App Router with async Server Components |
|
|
71
|
+
| Missing `metadata` exports | Poor SEO, no social previews | Export `metadata` or `generateMetadata` per page |
|
|
72
|
+
|
|
73
|
+
Last Updated: 2026-03-31
|