@se-studio/skills 1.5.6 → 1.5.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @se-studio/skills
2
2
 
3
+ ## 1.5.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Add `site-workflows-stale-files-cleanup` skill and `references/stale-files-cleanup/` (checklist, false positives, monorepo/single-app layouts, Brightline case study) for repository hygiene audits on SE Studio marketing sites.
8
+
9
+ ## 1.5.7
10
+
11
+ ### Patch Changes
12
+
13
+ - c29c4c8: Add `site-workflows-agent-session` skill and agent-session reference files for cross-repo work sessions, placement checklist, and parallel feature isolation.
14
+
3
15
  ## 1.5.6
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/skills",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "SE Studio agent skills for marketing site development with Contentful CMS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,45 @@
1
+ ## Agent session workflow
2
+
3
+ **Load skill `site-workflows-agent-session` at the start of every coding session.**
4
+
5
+ Default mode for this repo: **site-first**.
6
+
7
+ ### Branch policy
8
+
9
+ - Agents may commit and push **`develop`** and **`feature/*`** only.
10
+ - **Never** push to `main`, `master`, or production — human-only.
11
+ - Prefer **draft PRs** to `develop` over direct pushes when `gh` is available.
12
+
13
+ ### Core vs customer placement
14
+
15
+ Before non-trivial code, run the placement checklist (in the skill). Summary:
16
+
17
+ | Belongs in… | Examples |
18
+ |-------------|----------|
19
+ | **This repo** (`src/project/*`, `cms-edit/**`) | Brand components, styling, site routing, editor-pack |
20
+ | **Customer shared package** (if monorepo) | Consent/analytics shared across sites in this customer |
21
+ | **`se-core-product`** (`@se-studio/*`) | Fixes/features needed by 2+ sites, CMS infrastructure |
22
+
23
+ If the checklist says **core**, stop and switch to core-first mode — do not patch `@se-studio` behaviour in this repo.
24
+
25
+ ### Core release order
26
+
27
+ When work depends on a new `@se-studio/*` npm release:
28
+
29
+ 1. Release from `se-core-product` (`dev` → CI publish)
30
+ 2. Confirm version on npm
31
+ 3. `pnpm update @se-studio/<package>@<version> -r` in this repo
32
+ 4. Then push `develop`
33
+
34
+ Never hand-edit `package.json` dependency versions.
35
+
36
+ ### Parallel features
37
+
38
+ - One feature = one `feature/<scope>/<slug>` branch
39
+ - Use a **git worktree** when multiple features touch this repo at once
40
+ - CMS edits: `--session <feature-slug>` (isolate cms-edit sessions)
41
+ - Track in-flight work: manifest at `~/source/se/se-core-product/work/active/<feature>.yaml` (or `work/active/` in this repo if core checkout unavailable)
42
+
43
+ ### Production handoff
44
+
45
+ When ready for production, agents **stop** and deliver a handoff note — they do not merge to `main`. See skill Step 8.
@@ -0,0 +1,32 @@
1
+ # Copy to work/active/<feature>.yaml — one file per in-flight feature.
2
+ # Canonical location: se-core-product/work/active/ (cross-repo visibility).
3
+
4
+ feature: my-feature-slug
5
+ mode: site-first # core-first | site-first
6
+ project_key: om1
7
+ primary_repo: ~/source/customers/om1/om1-website
8
+ branch: feature/om1/my-feature-slug
9
+ worktree: null # e.g. ~/source/worktrees/om1-my-feature-slug — required when parallel features share a repo
10
+ integration_branch: develop
11
+
12
+ related_repos:
13
+ - repo: se-core-product
14
+ path: ~/source/se/se-core-product
15
+ role: read-only # read-only | pending-extract | active
16
+
17
+ placement:
18
+ decision: customer # core | customer | customer-shared | defer-extract
19
+ rationale: One-site hero layout tied to OM1 Figma
20
+ extract_to_core: null # pending | null
21
+ extract_rationale: null
22
+
23
+ blocked_on: null # e.g. "@se-studio/core-ui@2.1.0"
24
+ cms_session: null # set to feature slug when doing parallel CMS edits
25
+
26
+ status: in_progress # in_progress | blocked | parked | ready_for_review
27
+ started_at: 2026-07-05
28
+ updated_at: 2026-07-05
29
+
30
+ validation: []
31
+
32
+ handoff: null
@@ -0,0 +1,86 @@
1
+ {
2
+ "manifestPath": "work/active/<feature>.yaml",
3
+ "integrationBranches": {
4
+ "core": "dev",
5
+ "customer": "develop"
6
+ },
7
+ "branchPattern": "feature/<scope>/<short-slug>",
8
+ "projects": [
9
+ {
10
+ "key": "se-core-product",
11
+ "displayName": "SE Core Product",
12
+ "path": "~/source/se/se-core-product",
13
+ "branch": "dev",
14
+ "type": "core",
15
+ "validate": "pnpm validate",
16
+ "exampleApps": [
17
+ "example-om1",
18
+ "example-se2026",
19
+ "example-brightline",
20
+ "example-brightlifekids",
21
+ "example-empty"
22
+ ]
23
+ },
24
+ {
25
+ "key": "se2026",
26
+ "displayName": "SE Studio Site",
27
+ "path": "~/source/se/se-website-2026",
28
+ "branch": "develop",
29
+ "type": "customer",
30
+ "contentfulSpaceId": "g0pw3n92bre6",
31
+ "hostedMcp": "cms-edit-se-website",
32
+ "validate": "pnpm check && pnpm type-check"
33
+ },
34
+ {
35
+ "key": "brightline",
36
+ "displayName": "Brightline Sites",
37
+ "path": "~/source/customers/brightline/brightline-sites",
38
+ "branch": "develop",
39
+ "type": "customer-monorepo",
40
+ "sharedPackage": "@brightline/shared",
41
+ "contentfulSpaceIds": ["96gdpqkm7elu", "c27ds9epot4n"],
42
+ "hostedMcp": "cms-edit-brightline",
43
+ "validate": "pnpm -r validate"
44
+ },
45
+ {
46
+ "key": "om1",
47
+ "displayName": "OM1 Website",
48
+ "path": "~/source/customers/om1/om1-website",
49
+ "branch": "develop",
50
+ "type": "customer",
51
+ "contentfulSpaceId": "ddhe5ahaolzf",
52
+ "hostedMcp": "cms-edit-om1",
53
+ "validate": "pnpm check && pnpm type-check && pnpm validate:routes"
54
+ },
55
+ {
56
+ "key": "pointme",
57
+ "displayName": "PointMe Marketing Site",
58
+ "path": "~/source/customers/pointme/develop-marketing-site",
59
+ "branch": "develop",
60
+ "type": "customer",
61
+ "contentfulSpaceId": "alwdzgjlz5qv",
62
+ "contentfulEnvironment": "marketing-master-2025-04-15",
63
+ "validate": "pnpm check && pnpm type-check"
64
+ },
65
+ {
66
+ "key": "pedestal",
67
+ "displayName": "Pedestal Sites",
68
+ "path": "~/source/customers/pedestal/pedestal-sites",
69
+ "branch": "develop",
70
+ "type": "customer-monorepo",
71
+ "sharedPackage": "@pedestal/site-common",
72
+ "contentfulSpaceIds": ["h4s3ip99qawo", "fea4lj2cdgl5"],
73
+ "hostedMcp": ["cms-edit-pedestal", "cms-edit-headwater"],
74
+ "validate": "pnpm -r validate"
75
+ },
76
+ {
77
+ "key": "hsd-extended-port",
78
+ "displayName": "HopSkipDrive Extended Port",
79
+ "path": "~/source/customers/hopskipdrive/hsd-extended-port",
80
+ "branch": "extended-port",
81
+ "type": "customer",
82
+ "wip": true,
83
+ "validate": "pnpm validate"
84
+ }
85
+ ]
86
+ }
@@ -66,6 +66,17 @@
66
66
  "validate": "pnpm -r validate",
67
67
  "workspace": true,
68
68
  "hasPinOverrides": false
69
+ },
70
+ {
71
+ "key": "hsd-extended-port",
72
+ "displayName": "HopSkipDrive Extended Port",
73
+ "path": "~/source/customers/hopskipdrive/hsd-extended-port",
74
+ "branch": "extended-port",
75
+ "wip": true,
76
+ "wipNote": "Parity port from legacy GraphQL/Netlify site onto @se-studio packages. Work on extended-port only — not develop/production. Defer routine deps bumps until parity snags are under control unless explicitly requested.",
77
+ "validate": "pnpm validate",
78
+ "workspace": false,
79
+ "hasPinOverrides": false
69
80
  }
70
81
  ]
71
82
  }
@@ -0,0 +1,90 @@
1
+ # Case study — Brightline Sites stale-files cleanup (Jul 2026)
2
+
3
+ Reference implementation for `site-workflows-stale-files-cleanup`. Repo: `brightline-sites` on `develop`.
4
+
5
+ ---
6
+
7
+ ## User choices
8
+
9
+ | Decision | Choice |
10
+ |----------|--------|
11
+ | Doc disposition | Hard delete (git history as backup) |
12
+ | BLK Contentful migration | Complete — migration scripts safe to remove |
13
+ | Dependabot | Investigate only; fix when asked separately |
14
+
15
+ ---
16
+
17
+ ## Commits
18
+
19
+ | SHA | Summary | Scale |
20
+ |-----|---------|-------|
21
+ | `783a329` | Remove stale scripts, docs, migration tooling | ~58 files, ~57k lines |
22
+ | `558fc56` | Fix A/B test, cms-guidelines paths, `.env.example` | 11 files |
23
+ | `e09da45` | Remove orphan `xlsx` devDependency | 2 files; cleared 4 Dependabot alerts |
24
+
25
+ ---
26
+
27
+ ## Removed categories (783a329)
28
+
29
+ **Broken npm scripts** (missing targets):
30
+
31
+ - `docs:screenshots`, `docs:pdf` (Brightline)
32
+ - `setup:footer-nav`, `audit:site` (BLK)
33
+
34
+ **Orphan scripts:**
35
+
36
+ - `update-leadership-linkedin.mjs`, Vercel env ops scripts, media workbook builder, pilot batch scripts, `run-cms-screenshots-all.mjs` (both apps), unreferenced schema patch scripts
37
+
38
+ **BLK migration (confirmed complete):**
39
+
40
+ - `migrate-blk.ts`, `blk-master-schema.json`, `enable-locales-migration.js`
41
+
42
+ **Stale docs:**
43
+
44
+ - `REPO_ORIENTATION.md`, app `AGENTS.md`, "Moved" stubs, Mar 2026 audit reports, migration runbooks, schema audit snapshots, dated xlsx/json deliverables
45
+
46
+ **Infra:**
47
+
48
+ - Per-app `.husky/` + `husky` devDependencies
49
+
50
+ ---
51
+
52
+ ## Follow-up fixes (558fc56)
53
+
54
+ - `ab-test-page.test.ts` — assert against active `home-parents` test in `abTests.ts`, not removed Long Island test
55
+ - cms-guidelines: `example-brightline` → `brightline` filter + `apps/brightline-website` paths
56
+ - `.env.example`: `CTM_ENABLED`, `STICKY_PHONE_ENABLED` (BL); `PREVIEW_SECRET` (BLK)
57
+
58
+ ---
59
+
60
+ ## Dependency hygiene (e09da45)
61
+
62
+ - `xlsx@0.18.5` root devDep — zero imports after workbook script removal
63
+ - `pnpm why xlsx` confirmed orphan; removed from `package.json` + lockfile
64
+
65
+ ---
66
+
67
+ ## Reference updates required
68
+
69
+ Deleting without grep caught stragglers in:
70
+
71
+ - `ACTION-PLAN.md`, `VERCEL-ENV-INVENTORY.md` (deleted script names)
72
+ - `docs/media/CUSTOMER-REVIEW-BRIEF.md`, `BLK-PILOT-REVIEW-PACKET.md`
73
+ - `MKTG-4804-fbp-explanation.md` (superseded Formstack audit link)
74
+ - `AGENTS.md` (non-existent `deploy-cms-edit-host.sh`)
75
+
76
+ ---
77
+
78
+ ## Kept intentionally
79
+
80
+ See [`FALSE_POSITIVES.md`](./FALSE_POSITIVES.md) — cms-editor, editor-pack, env-inventory, Formstack playbooks, wired schema scripts, screaming-frog configs.
81
+
82
+ ---
83
+
84
+ ## Lessons for future runs
85
+
86
+ 1. **Plan mode + AskQuestion** before bulk doc deletes
87
+ 2. **Grep after each phase** — playbook and action-plan refs linger
88
+ 3. **Revert validate side-effects** — `validate:routes` regenerated `abTests.ts`
89
+ 4. **Doc drift** can remain after file deletes (BLK README "standalone app" wording)
90
+ 5. **Dependabot investigate** separate from cleanup unless user conflates them
@@ -0,0 +1,145 @@
1
+ # Stale files cleanup — discovery checklist
2
+
3
+ Run these checks in parallel at the start of every hygiene audit. Adapt paths for monorepo vs single-app (see `MONOREPO.md` / `SINGLE_APP.md`).
4
+
5
+ ---
6
+
7
+ ## 1. Broken npm scripts
8
+
9
+ For each `package.json` with a `scripts` section (root + `apps/*/` in monorepos):
10
+
11
+ 1. Extract script commands that invoke local files (`tsx scripts/…`, `node scripts/…`, `bash scripts/…`).
12
+ 2. Verify each target file exists on disk.
13
+ 3. Flag scripts pointing at missing files — **High** risk.
14
+
15
+ ```bash
16
+ # Quick scan: list script files referenced from package.json
17
+ rg '"(tsx|node|bash) scripts/' package.json apps/*/package.json
18
+ ```
19
+
20
+ ---
21
+
22
+ ## 2. Orphan scripts
23
+
24
+ List runnable files under:
25
+
26
+ - `scripts/` (repo root)
27
+ - `apps/*/scripts/`
28
+ - `docs/*/scripts/`
29
+
30
+ For each file not referenced in any `package.json` script:
31
+
32
+ ```bash
33
+ rg -l '<basename>' --glob '!node_modules' --glob '!.next'
34
+ ```
35
+
36
+ Zero inbound refs → candidate for removal (**Low**), unless cited as an active re-run playbook in docs.
37
+
38
+ ---
39
+
40
+ ## 3. Stale documentation
41
+
42
+ Search for:
43
+
44
+ | Pattern | Typical meaning |
45
+ |---------|-----------------|
46
+ | `REPO_ORIENTATION`, `implementation-checklist-*` | Pre-monorepo or historical checklists |
47
+ | `# Moved`, `Moved to monorepo` | Stub redirects — safe to delete if canonical doc exists |
48
+ | `*-REPORT.md`, `*-audit.md` (dated) | Point-in-time reports |
49
+ | `example-brightline`, `apps/example-*` | Legacy template paths — update, not always delete |
50
+ | `deploy-cms-edit-host.sh` | Often referenced in AGENTS.md but file never existed |
51
+
52
+ ```bash
53
+ rg -l 'example-brightline|apps/example-|REPO_ORIENTATION|# Moved' docs apps
54
+ ```
55
+
56
+ ---
57
+
58
+ ## 4. Audit artifacts and deliverables
59
+
60
+ | Pattern | Notes |
61
+ |---------|-------|
62
+ | `docs/media-review-*.xlsx`, `media-review-*.json` | Regenerable via media-review playbooks |
63
+ | `docs/schema/audit/` | Point-in-time schema audit outputs |
64
+ | `docs/archive/` | Superseded snapshots — ask disposition |
65
+ | `*.xlsx` under `docs/` | Source spreadsheets when templates exist elsewhere |
66
+
67
+ Cross-check `.gitignore`: gitignored generated reports under `docs/seo/*-screaming-frog-*` are **local only** — do not treat as tracked stale files.
68
+
69
+ ```bash
70
+ git ls-files 'docs/**/*.xlsx' 'docs/**/*-audit*' 'docs/archive/'
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 5. Duplicate infrastructure (monorepo)
76
+
77
+ ```bash
78
+ ls -la .husky/pre-commit apps/*/.husky/pre-commit 2>/dev/null
79
+ rg '"husky"' package.json apps/*/package.json
80
+ ```
81
+
82
+ Flag when root hook runs typecheck but app hooks only run `lint-staged`.
83
+
84
+ ---
85
+
86
+ ## 6. Orphan npm dependencies
87
+
88
+ Root and app `devDependencies` with no imports:
89
+
90
+ ```bash
91
+ # For each suspicious package name from package.json:
92
+ pnpm why <package>
93
+ rg "from '<package>'|require\\('<package>'\\)|import.*'<package>'" . \
94
+ --glob '!node_modules' --glob '!pnpm-lock.yaml'
95
+ ```
96
+
97
+ Common orphans after script removal: `xlsx`, one-off CLI helpers.
98
+
99
+ ---
100
+
101
+ ## 7. Env template drift
102
+
103
+ Compare README tables and `docs/VERCEL-ENV-VARS.md` against `.env.example` (root or per-app):
104
+
105
+ ```bash
106
+ rg '^\| `[A-Z_]+`' apps/*/README.md docs/VERCEL-ENV-VARS.md
107
+ rg '^[A-Z_]+=' apps/*/.env.example .env.example 2>/dev/null
108
+ ```
109
+
110
+ Flag vars documented for humans but missing from `.env.example`.
111
+
112
+ ---
113
+
114
+ ## 8. Fragile tests tied to generated CMS state
115
+
116
+ After cleanup touching A/B tests or generated files:
117
+
118
+ - `src/generated/abTests.ts` — regenerated on `prebuild` / `generate:ab-tests`
119
+ - Tests importing `generatedTestsByPath` must assert against **current** CMS entries, not removed page tests
120
+
121
+ ```bash
122
+ pnpm --filter <app> test
123
+ ```
124
+
125
+ Revert unrelated codegen diffs before commit (`git diff src/generated/`).
126
+
127
+ ---
128
+
129
+ ## 9. Untracked files
130
+
131
+ ```bash
132
+ git status --short
133
+ ```
134
+
135
+ Orphan untracked audits (e.g. `docs/*-setup-audit.md`) — ask commit vs delete.
136
+
137
+ ---
138
+
139
+ ## Output format
140
+
141
+ Present findings as a table:
142
+
143
+ | Path | Why stale | Evidence | Risk | Proposed action |
144
+
145
+ Then proceed to user confirmation before any `git rm`.
@@ -0,0 +1,88 @@
1
+ # Stale files cleanup — false positives (do not delete)
2
+
3
+ Agents routinely mistake these for clutter. **Keep** unless the user explicitly requests removal.
4
+
5
+ ---
6
+
7
+ ## CMS editor and hosted MCP
8
+
9
+ | Path | Why keep |
10
+ |------|----------|
11
+ | `docs/cms-editor/**` | Source playbooks for `cms-edit editor-pack generate` |
12
+ | `cms-edit/<site>/editor-pack/**` | Committed MCP resources deployed via git push |
13
+ | `cms-edit/host/` staging (gitignored `.env.*`) | Local cms-edit host dev |
14
+
15
+ Overlap between `docs/cms-editor` and `editor-pack` is pipeline duplication, not accidental redundancy.
16
+
17
+ ---
18
+
19
+ ## Active operations documentation
20
+
21
+ | Path | Why keep |
22
+ |------|----------|
23
+ | `docs/STATUS.md`, `docs/ACTION-PLAN.md` | Live workload docs (customer monorepos) |
24
+ | `docs/env-inventory/`, `docs/VERCEL-ENV-*.md` | Env documentation pipeline |
25
+ | `docs/PAGE_VARIANTS_AND_TESTS.md` | A/B test runbooks |
26
+ | `docs/media/*.md` (briefs, not dated xlsx) | Active media-review workflow |
27
+
28
+ ---
29
+
30
+ ## Schema and SEO tooling (wired)
31
+
32
+ | Path | Why keep |
33
+ |------|----------|
34
+ | `docs/schema/templates/` | Mustache templates for schema.org |
35
+ | `docs/schema/page-inventory.json`, `PAGE-INVENTORY.md` | Referenced by schema recommendations |
36
+ | `docs/schema/scripts/validate-json-ld.mjs` | Wired in root `schema:validate` |
37
+ | `docs/schema/scripts/audit-localhost-schema.mjs` | Wired in `schema:audit:localhost*` |
38
+ | `apps/*/seo/screaming-frog.json` | Crawl manifest config (not generated crawl reports) |
39
+
40
+ ---
41
+
42
+ ## Re-run playbooks and audit baselines
43
+
44
+ | Path | Why keep |
45
+ |------|----------|
46
+ | `apps/*/scripts/formstack-spike.ts` (+ paired embed `.js`) | Cited by Formstack audit docs for re-runs |
47
+ | `packages/*/docs/*-audit.md` (current, not superseded) | Active audit baselines |
48
+ | `docs/alt-drafts/*.json` | Active pilot content batches |
49
+
50
+ ---
51
+
52
+ ## Agent skills and references
53
+
54
+ | Path | Why keep |
55
+ |------|----------|
56
+ | `.agents/skills/`, `.cursor/skills/` (symlinks) | Synced from `@se-studio/skills` / `skills-npm` |
57
+ | `.agents/references/` | Support docs for skills |
58
+ | Customer-specific skills (e.g. `brightline-status-refresh`) | Site-local workflows |
59
+
60
+ ---
61
+
62
+ ## CI and deployment config
63
+
64
+ | Path | Why keep |
65
+ |------|----------|
66
+ | `.github/workflows/*.yml` | Active CI (validate, deployment-smoke) |
67
+ | `apps/*/scripts/vercel-deployment-smoke-check.json` | Vercel Deployment Checks registration |
68
+ | Root `cms-edit:deploy:*` scripts | Emergency manual deploy (discouraged but intentional) |
69
+
70
+ ---
71
+
72
+ ## Generated outputs (regenerate, do not delete source)
73
+
74
+ | Path | Notes |
75
+ |------|-------|
76
+ | `src/generated/abTests.ts` | CMS-generated — update tests, do not hand-delete |
77
+ | `src/generated/cms-discovery/` | Regenerated by codegen scripts |
78
+ | `docs/cms-guidelines/COMPONENT_GUIDELINES_FOR_LLM.md` | Merged output — regenerate via merge script |
79
+
80
+ ---
81
+
82
+ ## Package names vs folder names
83
+
84
+ | Pattern | Notes |
85
+ |---------|-------|
86
+ | `example-brightlifekids` filter name | May differ from `apps/brightlife-kids-website/` — intentional for `pnpm --filter`; update **docs**, do not rename package without user request |
87
+
88
+ When in doubt, grep for inbound references before proposing deletion.
@@ -0,0 +1,85 @@
1
+ # Stale files cleanup — monorepo layout
2
+
3
+ For repos like `brightline-sites` with multiple apps under `apps/` and shared `packages/`.
4
+
5
+ ---
6
+
7
+ ## Detection
8
+
9
+ | Signal | Monorepo |
10
+ |--------|----------|
11
+ | Root `pnpm-workspace.yaml` | Yes |
12
+ | `apps/*/` with separate `package.json` | Yes |
13
+ | Root `AGENTS.md` + optional per-app docs | Common |
14
+
15
+ ---
16
+
17
+ ## package.json scripts
18
+
19
+ Audit **both**:
20
+
21
+ - Root `package.json` — monorepo-wide (`validate`, `cms-edit:*`, `schema:*`)
22
+ - Each `apps/<site>/package.json` — app dev/build/test scripts
23
+
24
+ Broken script entries in **either** file fail when invoked from that package context.
25
+
26
+ ---
27
+
28
+ ## Husky duplication
29
+
30
+ Canonical pattern (Brightline):
31
+
32
+ - **Root** `.husky/pre-commit` → `lint-staged` + `scripts/pre-commit-typecheck.sh`
33
+ - **App** `.husky/pre-commit` → only `lint-staged` (legacy)
34
+
35
+ Cleanup: remove `apps/*/.husky/` and `husky` from app `devDependencies` when root `prepare` owns hooks.
36
+
37
+ ---
38
+
39
+ ## AGENTS.md
40
+
41
+ | File | Role |
42
+ |------|------|
43
+ | Root `AGENTS.md` | Canonical agent rules |
44
+ | `apps/*/AGENTS.md` | Often generic template leftovers — candidate for deletion if root doc exists |
45
+
46
+ ---
47
+
48
+ ## Filter names vs directory names
49
+
50
+ | Folder | Package name (filter) |
51
+ |--------|----------------------|
52
+ | `apps/brightline-website` | `brightline` |
53
+ | `apps/brightlife-kids-website` | `example-brightlifekids` |
54
+
55
+ Docs may still say `example-brightline` or `apps/example-brightline` — update paths to real folder names and correct `pnpm --filter` names.
56
+
57
+ ---
58
+
59
+ ## Shared packages
60
+
61
+ `packages/<shared>/` — do not delete shared docs/scripts referenced by both apps. Audit imports from apps before removing shared tooling.
62
+
63
+ ---
64
+
65
+ ## cms-edit multi-site
66
+
67
+ | Path | Site |
68
+ |------|------|
69
+ | `cms-edit/brightline/project.json` | Brightline |
70
+ | `cms-edit/brightlifekids/project.json` | BrightLife Kids |
71
+ | `docs/cms-editor/<site>/` | Playbook source per site |
72
+
73
+ Never delete one site's editor-pack thinking the other is redundant.
74
+
75
+ ---
76
+
77
+ ## Validate command
78
+
79
+ Typically root:
80
+
81
+ ```bash
82
+ pnpm validate
83
+ ```
84
+
85
+ Runs `pnpm -r validate` across workspace packages. Pre-commit typecheck may only touch affected apps when paths are staged.
@@ -0,0 +1,66 @@
1
+ # Stale files cleanup — single-app layout
2
+
3
+ For standalone SE Studio customer sites (one Next.js app at repo root or under a single `apps/` entry).
4
+
5
+ ---
6
+
7
+ ## Detection
8
+
9
+ | Signal | Single-app |
10
+ |--------|------------|
11
+ | One primary `package.json` for the site | Yes |
12
+ | No `apps/` sibling sites | Typical |
13
+ | `cms-edit/project.json` at `cms-edit/` (not `cms-edit/<site>/`) | Common |
14
+
15
+ ---
16
+
17
+ ## Script locations
18
+
19
+ | Location | Scope |
20
+ |----------|-------|
21
+ | `scripts/` | App tooling |
22
+ | `docs/schema/scripts/` | Schema validation (if present) |
23
+
24
+ Same orphan/broken-script rules as monorepos — only one `package.json` to audit.
25
+
26
+ ---
27
+
28
+ ## Husky
29
+
30
+ Single `.husky/pre-commit` at repo root. No app-level duplicate to remove.
31
+
32
+ ---
33
+
34
+ ## Documentation paths
35
+
36
+ | Path | Notes |
37
+ |------|-------|
38
+ | `docs/cms-guidelines/` | Per-component guidelines |
39
+ | `docs/cms-editor/` | Editor playbooks (if hosted MCP enabled) |
40
+ | `REPO_ORIENTATION.md` | Sometimes accurate — verify against current layout before deleting |
41
+
42
+ Legacy `example-*` naming is less common in mature single-app repos but may persist in cms-guidelines from template copy.
43
+
44
+ ---
45
+
46
+ ## cms-edit
47
+
48
+ | Path | Role |
49
+ |------|------|
50
+ | `cms-edit/project.json` | Project config |
51
+ | `cms-edit/editor-pack/` | Generated MCP pack |
52
+ | `docs/cms-editor/` | Playbook source |
53
+
54
+ See [`FALSE_POSITIVES.md`](./FALSE_POSITIVES.md).
55
+
56
+ ---
57
+
58
+ ## Validate
59
+
60
+ Usually from repo root:
61
+
62
+ ```bash
63
+ pnpm validate
64
+ ```
65
+
66
+ Or `pnpm check && pnpm type-check` per project `package.json`.
@@ -7,7 +7,7 @@ description: "Set up or regenerate smoke.cases.json for local smoke tests from t
7
7
 
8
8
  Local smoke tests use curated HTTP cases in **`smoke.cases.json`**. Optionally enable **`cmsIntegrity`** for a local-only Contentful article-link check (no `cms-server` import in smoke scripts).
9
9
 
10
- Requires `@se-studio/site-check` **^2.6.1** when using `cmsIntegrity` or `pnpm smoke-test` with integrity enabled; **2.1.2+** for cache log audit; **2.0.0+** for HTTP-only static smoke.
10
+ Requires `@se-studio/site-check` **^2.9.0** when using `discovery` endpoint checks; **^2.6.1** when using `cmsIntegrity` or `pnpm smoke-test` with integrity enabled; **2.1.2+** for cache log audit; **2.0.0+** for HTTP-only static smoke.
11
11
 
12
12
  Preview / `DRAFT_ONLY` Contentful access in local dev is expected and not a smoke failure. **Deployment / live smoke stays HTTP-only** — do not enable `cmsIntegrity` on Vercel deployment checks.
13
13
 
@@ -204,6 +204,12 @@ curl -sI "http://localhost:<port>/some-path.md"
204
204
  {
205
205
  "siteName": "my-app",
206
206
  "port": 3012,
207
+ "discovery": {
208
+ "llmsTxt": true,
209
+ "markdownIndexTxt": true,
210
+ "cmsTxt": true,
211
+ "siteInfoMd": true
212
+ },
207
213
  "cases": [
208
214
  { "category": "home", "label": "Home", "path": "/", "expectMarkdown": true },
209
215
  { "category": "page", "label": "About", "path": "/about/", "expectMarkdown": true },
@@ -218,6 +224,19 @@ curl -sI "http://localhost:<port>/some-path.md"
218
224
  }
219
225
  ```
220
226
 
227
+ **Discovery endpoints** (`discovery` block) — requires `@se-studio/site-check@^2.9.0`:
228
+
229
+ | Path | Flag | Checks when `true` |
230
+ |------|------|-------------------|
231
+ | `/llms.txt` | `llmsTxt` | 200, `text/plain`, llmstxt.org structure, spot-check Key pages `.md` links |
232
+ | `/markdown-index.txt` | `markdownIndexTxt` | 200, same-origin `.md` URL list |
233
+ | `/cms.txt` | `cmsTxt` | 200, `text/markdown`, mentions llms + markdown-index |
234
+ | `/site-info.md` | `siteInfoMd` | 200, `text/markdown`, title + minimum body |
235
+
236
+ Omit a key or set `true` to require the endpoint. Set `false` to skip (not a failure). **PointMe:** set all four to `false` until CloudFront routes these paths to Vercel.
237
+
238
+ Add `/llms.txt`, `/markdown-index.txt`, and `/site-info.md` to `route-build-policy.json` → `mustBeSsgOrStatic` (commit beside `smoke.cases.json`).
239
+
221
240
  `expectHtmlStatus` requires `@se-studio/site-check@^2.7.2`. Omit for normal 2xx HTML checks.
222
241
 
223
242
  Optional `cmsIntegrity` (local only — see section below):
@@ -0,0 +1,279 @@
1
+ ---
2
+ name: site-workflows-agent-session
3
+ description: "Start and manage agent work sessions across se-core-product and customer sites. Declares work mode, feature branch, placement (core vs customer), parallel isolation, and production handoff. Load at the beginning of every coding session."
4
+ ---
5
+
6
+ # Agent session workflow
7
+
8
+ Orchestrates **where** to work, **where code belongs**, and **how to isolate parallel features**. Human merges to `main` / production — agents stop at handoff.
9
+
10
+ **Registry:** [`packages/skills/references/agent-session/projects.registry.json`](../../references/agent-session/projects.registry.json) — repo paths, integration branches, hosted MCP keys.
11
+
12
+ **Manifest template:** [`packages/skills/references/agent-session/manifest.template.yaml`](../../references/agent-session/manifest.template.yaml)
13
+
14
+ **Human guide:** `docs/WORKFLOW.md` in se-core-product.
15
+
16
+ ---
17
+
18
+ ## When to load this skill
19
+
20
+ Load **at the start of every coding session** — before reading code or making edits.
21
+
22
+ Triggers:
23
+
24
+ - User pastes a session opener (`Mode: site-first`, `Feature: …`)
25
+ - User asks to work on a customer site or core package
26
+ - User starts parallel work on another feature (new manifest, new branch)
27
+ - User asks "where should this live?" (run placement checklist)
28
+
29
+ ---
30
+
31
+ ## Step 1 — Resolve session context
32
+
33
+ Collect or infer:
34
+
35
+ | Field | Required | Notes |
36
+ |-------|----------|-------|
37
+ | `mode` | Yes | `core-first` or `site-first` |
38
+ | `feature` | Yes | Short slug, kebab-case (e.g. `om1-hero-redesign`) |
39
+ | `project_key` | Yes | From registry (`om1`, `se-core-product`, `pedestal`, …) |
40
+ | `primary_repo` | Yes | Absolute path from registry |
41
+ | `branch` | Yes | `feature/<scope>/<slug>` — see naming below |
42
+ | `worktree` | Optional | Separate checkout path when parallel features share a repo |
43
+
44
+ **Default mode if unclear:** ask once. Site-specific UI/content → `site-first`. Package/framework/multi-site → `core-first`.
45
+
46
+ **Branch naming:**
47
+
48
+ ```
49
+ feature/<scope>/<short-slug>
50
+ ```
51
+
52
+ | Scope | Example |
53
+ |-------|---------|
54
+ | Core work | `feature/core/search-webhook-fix` |
55
+ | Customer site | `feature/om1/hero-redesign` |
56
+ | Customer monorepo shared | `feature/brightline/consent-v2` |
57
+
58
+ Integration branches (agents push feature branches here via PR or merge — **never `main`**):
59
+
60
+ | Repo type | Integration branch |
61
+ |-----------|-------------------|
62
+ | `se-core-product` | `dev` |
63
+ | Customer sites | `develop` (or registry override, e.g. `extended-port`) |
64
+
65
+ ---
66
+
67
+ ## Step 2 — Write or update manifest
68
+
69
+ Path in **se-core-product** (canonical ledger for cross-repo visibility):
70
+
71
+ ```
72
+ work/active/<feature>.yaml
73
+ ```
74
+
75
+ Copy from `manifest.template.yaml`, fill all fields, set `status: in_progress`, `started_at` to today (ISO date).
76
+
77
+ If the user works only in a customer repo with no core checkout, still create/update the manifest in se-core-product when that repo is available; otherwise create `work/active/<feature>.yaml` in the customer repo and note `manifest_location: customer` in the file.
78
+
79
+ **One feature = one manifest.** Do not append unrelated work to an existing manifest.
80
+
81
+ ---
82
+
83
+ ## Step 3 — Placement checklist (before non-trivial code)
84
+
85
+ Run before implementing anything beyond a one-line fix. Record results in manifest `placement:`.
86
+
87
+ | Question | If yes → lean |
88
+ |----------|----------------|
89
+ | Will **2+ sites** need this within ~6 months? | **core** (`packages/*`) |
90
+ | Is it CMS infrastructure (converter, shared renderer, cms-edit, search webhook)? | **core** |
91
+ | Is it tied to **one brand** (Figma, copy, colours, one-off layout)? | **customer** (`src/project/*`) |
92
+ | Shared only within **one customer monorepo** (e.g. `@brightline/shared`)? | **customer-shared** |
93
+ | Bug in published `@se-studio/*` behaviour? | **core** — never fork in customer |
94
+
95
+ **Outcomes** — set `placement.decision`:
96
+
97
+ | Decision | Action |
98
+ |----------|--------|
99
+ | `core` | Edit `se-core-product` only; changeset before push to `dev`; customer waits for npm |
100
+ | `customer` | Edit customer repo only; do not touch core |
101
+ | `customer-shared` | Edit customer's shared package; not `@se-studio/*` |
102
+ | `defer-extract` | Implement in customer now; set `extract_to_core: pending` + `extract_rationale` |
103
+
104
+ **Site-first guard:** If checklist says `core` but mode is `site-first`, **stop** and ask whether to switch mode or record `defer-extract`.
105
+
106
+ **Core-first guard:** If checklist says `customer`, implement in customer repo (read-only probe in core example apps only if useful).
107
+
108
+ ---
109
+
110
+ ## Step 4 — Git isolation
111
+
112
+ ### Single feature in repo
113
+
114
+ ```bash
115
+ cd <primary_repo>
116
+ git fetch origin
117
+ git checkout -b <branch> origin/<integration-branch>
118
+ ```
119
+
120
+ ### Parallel features in same repo
121
+
122
+ Use a **git worktree** per feature:
123
+
124
+ ```bash
125
+ git worktree add <worktree-path> -b <branch> origin/<integration-branch>
126
+ ```
127
+
128
+ Record `worktree` in manifest. Do not commit unrelated features on the same branch.
129
+
130
+ ### CMS parallel sessions
131
+
132
+ When editing Contentful in parallel on the same space, use distinct cms-edit sessions:
133
+
134
+ ```bash
135
+ --session <feature-slug>
136
+ # or CONTENTFUL_CMS_SESSION=<feature-slug>
137
+ ```
138
+
139
+ Record `cms_session: <feature-slug>` in manifest when doing CMS work.
140
+
141
+ ---
142
+
143
+ ## Step 5 — Work execution rules
144
+
145
+ ### core-first
146
+
147
+ - Primary edits: `packages/*`, optionally `apps/example-*` to validate
148
+ - Compare customer implementations **read-only** unless user approves commits there
149
+ - Release train before customer push (see `AGENTS.md` **Client repos — wait for core**)
150
+
151
+ ### site-first
152
+
153
+ - Primary edits: customer `src/project/*`, `cms-edit/**`, site config
154
+ - **Do not** edit `se-core-product` unless placement is `core` and user approves mode switch
155
+ - Consume `@se-studio/*` from npm — not monorepo workspace links
156
+
157
+ ### Blocked work
158
+
159
+ If manifest has `blocked_on: "@se-studio/foo@1.2.3"`, do not push customer `develop` until npm publish is confirmed. Update manifest when unblocked.
160
+
161
+ ---
162
+
163
+ ## Step 6 — Validate before push
164
+
165
+ Minimum per repo type (see registry `validate` for full command):
166
+
167
+ | Repo | Typical |
168
+ |------|---------|
169
+ | se-core-product | `pnpm validate` or targeted `pnpm type-check` + tests |
170
+ | Customer | registry `validate` field |
171
+
172
+ Record commands run in manifest `validation:` before push.
173
+
174
+ ---
175
+
176
+ ## Step 7 — Push and PR policy
177
+
178
+ Agents may push to:
179
+
180
+ - `dev` / `develop` (via feature branch merge or direct if user prefers)
181
+ - `feature/*` branches
182
+
183
+ Agents must **never** push to `main`, `master`, or production branches.
184
+
185
+ **Preferred:** open a **draft PR** targeting the integration branch:
186
+
187
+ ```bash
188
+ gh pr create --base <integration-branch> --head <branch> --draft --title "<feature>: <summary>"
189
+ ```
190
+
191
+ If `gh` is unavailable or user prefers direct push, push `feature/*` and note in handoff.
192
+
193
+ ---
194
+
195
+ ## Step 8 — Handoff (production-ready)
196
+
197
+ When work is ready for human review / production promotion, **stop** — do not merge to `main`.
198
+
199
+ 1. Set manifest `status: ready_for_review`
200
+ 2. Deliver handoff using template below
201
+ 3. If core release was part of the work, list published package versions needed for customer bump
202
+
203
+ ### Handoff template
204
+
205
+ ```markdown
206
+ ## Handoff: <feature>
207
+
208
+ **Mode:** <core-first | site-first>
209
+ **Manifest:** work/active/<feature>.yaml
210
+
211
+ ### Repos and branches
212
+ - <repo>: `<branch>` → merge to `<integration-branch>`
213
+
214
+ ### Placement
215
+ - Decision: <core | customer | customer-shared | defer-extract>
216
+ - Core release required: <yes — packages + versions | no>
217
+
218
+ ### Changes
219
+ - <bullet summary>
220
+
221
+ ### Validation
222
+ - <commands run>
223
+
224
+ ### Merge order (if multi-repo)
225
+ 1. <core PR / npm publish>
226
+ 2. <customer pnpm update @se-studio/...>
227
+ 3. <customer PR>
228
+
229
+ ### Production
230
+ Ready for you to merge to `main` / promote Vercel. Agent will not push production.
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Step 9 — Complete or park
236
+
237
+ | Outcome | Manifest update |
238
+ |---------|-----------------|
239
+ | Merged / done | Move to `work/completed/<feature>.yaml` or delete from `work/active/` |
240
+ | Blocked | `status: blocked`, set `blocked_on` |
241
+ | Parked | `status: parked`, add `parked_reason` |
242
+
243
+ Remove worktree when done:
244
+
245
+ ```bash
246
+ git worktree remove <worktree-path>
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Session opener (user control surface)
252
+
253
+ User can paste:
254
+
255
+ ```
256
+ Load skill: site-workflows-agent-session
257
+ Mode: site-first
258
+ Project: om1
259
+ Feature: hero-redesign
260
+ Branch: feature/om1/hero-redesign
261
+ ```
262
+
263
+ Agent must load this skill, write manifest, run placement checklist, confirm branch/worktree, then proceed.
264
+
265
+ ---
266
+
267
+ ## Quick reference — project keys
268
+
269
+ | key | Integration branch | Type |
270
+ |-----|-------------------|------|
271
+ | `se-core-product` | `dev` | core monorepo |
272
+ | `se2026` | `develop` | customer |
273
+ | `brightline` | `develop` | customer monorepo |
274
+ | `om1` | `develop` | customer |
275
+ | `pointme` | `develop` | customer |
276
+ | `pedestal` | `develop` | customer monorepo |
277
+ | `hsd-extended-port` | `extended-port` | customer (WIP) |
278
+
279
+ Full paths and MCP keys: `projects.registry.json`.
@@ -11,7 +11,31 @@ Update npm dependencies to **latest** in se-core-product and consumer repos that
11
11
 
12
12
  **Default:** Process **one repo per invocation**. At the end, summarize changes and offer the next project.
13
13
 
14
- **Never:** push to `main`/`master`; bump Next to 16; bump Node to 25+; use `pnpm patch` / `patchedDependencies` / `patches/`; bypass or remove `minimumReleaseAge`.
14
+ **Never:** push to `main`/`master`; bump Next to 16; bump Node to 25+; use `pnpm patch` / `patchedDependencies` / `patches/`; bypass or remove `minimumReleaseAge`; **hand-edit `package.json` dependency versions** (use `pnpm update` instead).
15
+
16
+ ---
17
+
18
+ ## Bumping packages (all repos — agents must follow)
19
+
20
+ **Do not** edit `package.json` version strings by hand. Always run `pnpm update` from the repo root so `pnpm-lock.yaml` stays aligned.
21
+
22
+ ```bash
23
+ # One package after a core npm release
24
+ pnpm update @se-studio/contentful-rest-api@<version> -r
25
+
26
+ # Several @se-studio packages
27
+ pnpm update -r @se-studio/contentful-rest-api @se-studio/core-ui
28
+ ```
29
+
30
+ **`pnpm-workspace.yaml` overrides:** many customer repos pin packages under `overrides` (e.g. Point.me: `@se-studio/contentful-rest-api`, `mapbox-gl`). `pnpm update` does **not** update those lines. After updating a pinned package, set the matching override to the same range or `pnpm install --frozen-lockfile` fails.
31
+
32
+ **cms-edit host repos** (`cms-edit/host` in `pnpm-workspace.yaml`): Vercel install is:
33
+
34
+ ```bash
35
+ pnpm install --frozen-lockfile --config.node-linker=hoisted
36
+ ```
37
+
38
+ Run that locally **before push** whenever `package.json`, lockfile, or overrides change. A mismatch surfaces as `ERR_PNPM_OUTDATED_LOCKFILE` (manifest vs lockfile specifiers).
15
39
 
16
40
  ---
17
41
 
@@ -25,9 +49,12 @@ Update npm dependencies to **latest** in se-core-product and consumer repos that
25
49
  | `om1` | OM1 Website | `develop` |
26
50
  | `pointme` | PointMe Marketing Site | `develop` |
27
51
  | `pedestal` | Pedestal Sites | `develop` |
52
+ | `hsd-extended-port` | HopSkipDrive Extended Port **(WIP)** | `extended-port` |
28
53
 
29
54
  User may name a key (`update deps in om1`) or ask to run through all projects sequentially.
30
55
 
56
+ **WIP:** `hsd-extended-port` is an active parity port — branch `extended-port`, not `develop`. Prefer standards alignment and targeted `@se-studio/*` catch-up over full `pnpm update -r --latest` until the snag list is stable.
57
+
31
58
  ---
32
59
 
33
60
  ## Step 1 — Preflight
@@ -103,6 +130,8 @@ Align nested `packageManager` fields (e.g. `apps/*/package.json`) with the root
103
130
 
104
131
  ## Step 5 — Update dependencies
105
132
 
133
+ Use CLI updates only — do not StrReplace version strings in `package.json`.
134
+
106
135
  ```bash
107
136
  pnpm update -r --latest
108
137
  ```
@@ -147,6 +176,12 @@ rg '"node"' package.json apps/*/package.json packages/*/package.json 2>/dev/null
147
176
 
148
177
  ## Step 6 — Validate (unified for all repos)
149
178
 
179
+ If the registry project has `cms-edit/host` in `pnpm-workspace.yaml`, run the frozen hoisted install check first:
180
+
181
+ ```bash
182
+ pnpm install --frozen-lockfile --config.node-linker=hoisted
183
+ ```
184
+
150
185
  Always run the patches check **once**, then the project validate from the registry:
151
186
 
152
187
  ```bash
@@ -205,6 +240,7 @@ This is optional follow-up — the skill workflow always runs the check regardle
205
240
 
206
241
  | Issue | Action |
207
242
  |-------|--------|
243
+ | `ERR_PNPM_OUTDATED_LOCKFILE` on frozen/hoisted install | `package.json` and `pnpm-workspace.yaml` overrides out of sync with lockfile — re-run `pnpm update` for the package and align `overrides` |
208
244
  | `next` or `@types/node` still outdated to wrong major | Re-run overrides + safety re-pin; check `pnpm-workspace.yaml` overrides |
209
245
  | Non-`@se-studio` package still outdated after update | Likely within 24h of npm publish — wait and re-run; **do not** bypass `minimumReleaseAge` |
210
246
  | `corepack use` fails | Run `corepack enable` once, retry |
@@ -71,19 +71,53 @@ Write `CLAUDE.md` at the project root:
71
71
 
72
72
  ## Step 6 — Create `AGENTS.md`
73
73
 
74
- Write `AGENTS.md` at the project root. Fill in the user's email address (from memory if known, otherwise ask) and today's date:
74
+ Write `AGENTS.md` at the project root. Fill in the user's email address (from memory if known, otherwise ask) and today's date.
75
+
76
+ Include the **agent session workflow block** from [`packages/skills/references/agent-session/customer-agents-block.md`](../../references/agent-session/customer-agents-block.md) (branch policy, placement, parallel features, handoff).
75
77
 
76
78
  ```markdown
77
79
  # Next.js: ALWAYS read docs before coding
78
80
 
79
81
  Before any Next.js work, find and read the relevant doc in `node_modules/next/dist/docs/`. Your training data is outdated — the docs are the source of truth.
80
82
 
83
+ # @se-studio packages: ALWAYS read docs before coding
84
+
85
+ Before using any `@se-studio/*` package, read the relevant `node_modules/@se-studio/<package>/docs/llms.md`.
86
+
81
87
  # userEmail
82
88
  The user's email address is [USER_EMAIL].
83
89
 
84
90
  # currentDate
85
91
  Today's date is [CURRENT_DATE].
86
92
 
93
+ ## Agent session workflow
94
+
95
+ **Load skill `site-workflows-agent-session` at the start of every coding session.**
96
+
97
+ Default mode for this repo: **site-first**.
98
+
99
+ ### Branch policy
100
+
101
+ - Agents may commit and push **`develop`** and **`feature/*`** only.
102
+ - **Never** push to `main`, `master`, or production — human-only.
103
+ - Prefer **draft PRs** to `develop` over direct pushes when `gh` is available.
104
+
105
+ ### Core vs customer placement
106
+
107
+ Before non-trivial code, run the placement checklist (skill `site-workflows-agent-session`). If the checklist says **core**, stop — do not patch `@se-studio` behaviour in this repo.
108
+
109
+ ### Core release order
110
+
111
+ When work depends on a new `@se-studio/*` npm release: release from `se-core-product` first, confirm npm, then `pnpm update @se-studio/<package>@<version> -r` here, then push `develop`. Never hand-edit dependency versions.
112
+
113
+ ### Parallel features
114
+
115
+ One feature = one `feature/<scope>/<slug>` branch. Use git worktrees for parallel work on this repo. CMS: `--session <feature-slug>`. Manifest: `~/source/se/se-core-product/work/active/<feature>.yaml`.
116
+
117
+ ### Production handoff
118
+
119
+ Agents stop at handoff — they do not merge to `main`. See skill `site-workflows-agent-session` Step 8.
120
+
87
121
  ## CMS editing (cms-edit)
88
122
 
89
123
  Before any Contentful content edit:
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: site-workflows-stale-files-cleanup
3
+ description: "Audit and remove stale scripts, broken package.json entries, orphan docs, and duplicate tooling on SE Studio marketing sites. Supports single-app and monorepo layouts. Use for repo cleanup, stale files audit, hygiene audit, or pruning dead code. Always ask before deleting historical docs or deliverables."
4
+ ---
5
+
6
+ # Stale files cleanup (repository hygiene)
7
+
8
+ Remove **dead weight** from an SE Studio site repo without changing product behavior. This is **not** [`site-workflows-project-cleanup`](../site-workflows-project-cleanup/SKILL.md) (which strips a site to a bare template).
9
+
10
+ **References:**
11
+
12
+ | File | Purpose |
13
+ |------|---------|
14
+ | [`CHECKLIST.md`](../../references/stale-files-cleanup/CHECKLIST.md) | Discovery commands and grep patterns |
15
+ | [`FALSE_POSITIVES.md`](../../references/stale-files-cleanup/FALSE_POSITIVES.md) | Paths agents must not delete |
16
+ | [`MONOREPO.md`](../../references/stale-files-cleanup/MONOREPO.md) | Multi-app layout rules |
17
+ | [`SINGLE_APP.md`](../../references/stale-files-cleanup/SINGLE_APP.md) | Single-app layout rules |
18
+ | [`BRIGHTLINE_RUNBOOK.md`](../../references/stale-files-cleanup/BRIGHTLINE_RUNBOOK.md) | Case study (Jul 2026) |
19
+
20
+ **Default:** Plan mode first — present a classified audit table before deleting anything.
21
+
22
+ **Never:** push to `main`/`master`; delete `docs/cms-editor/` or committed `cms-edit/*/editor-pack/` without explicit user request; fix Dependabot alerts unless the user asks.
23
+
24
+ ---
25
+
26
+ ## When to use
27
+
28
+ | Situation | Action |
29
+ |-----------|--------|
30
+ | User asks for repo cleanup, stale files, orphan scripts, dead docs | Run full workflow |
31
+ | Broken `pnpm` scripts fail with missing file paths | Phase 1 only (broken tooling) |
32
+ | Post-migration or post-monorepo consolidation | Phases 2–4 with migration confirmation |
33
+ | Dependabot noise | Optional investigate phase only |
34
+
35
+ ## When not to use
36
+
37
+ - Stripping a customer site to a reusable template → **`site-workflows-project-cleanup`**
38
+ - CMS content edits → **`contentful-cms-*`** skills
39
+ - Dependency version bumps → **`site-workflows-deps-update`**
40
+
41
+ ---
42
+
43
+ ## Step 1 — Preflight
44
+
45
+ 1. Read repo `AGENTS.md`, root `README.md`, and `.gitignore`.
46
+ 2. Detect layout — see [`MONOREPO.md`](../../references/stale-files-cleanup/MONOREPO.md) vs [`SINGLE_APP.md`](../../references/stale-files-cleanup/SINGLE_APP.md).
47
+ 3. Confirm integration branch (`develop` for customer sites, `dev` for se-core-product). Working tree clean or user approves.
48
+ 4. Run parallel discovery per [`CHECKLIST.md`](../../references/stale-files-cleanup/CHECKLIST.md).
49
+
50
+ ---
51
+
52
+ ## Step 2 — Classify findings
53
+
54
+ Group every candidate into a table for the user:
55
+
56
+ | Risk | Examples | Default action |
57
+ |------|----------|----------------|
58
+ | **High** | `package.json` script → missing file; doc links to non-existent path | Fix script entry or restore file; fix doc |
59
+ | **Medium** | Completed migration scripts; dated audit deliverables; duplicate Husky | Delete after user confirms |
60
+ | **Low** | Orphan scripts with zero refs; stub "Moved" docs; legacy path names in docs | Delete or update refs |
61
+
62
+ Cross-check [`FALSE_POSITIVES.md`](../../references/stale-files-cleanup/FALSE_POSITIVES.md) before listing any path as deletable.
63
+
64
+ ---
65
+
66
+ ## Step 3 — Confirm with user
67
+
68
+ Use `AskQuestion` (or equivalent) before bulk deletes:
69
+
70
+ 1. **Historical docs and deliverables** — archive vs hard delete vs keep (default: **ask**; do not assume).
71
+ 2. **Migration / one-off ops scripts** — only remove when user confirms work is complete (e.g. Contentful locale migration, Vercel env rotation runbooks marked done).
72
+ 3. **Dependabot** — offer investigation summary; do not bump packages unless user explicitly asks.
73
+
74
+ ---
75
+
76
+ ## Step 4 — Execute (ordered phases)
77
+
78
+ ### Phase 1 — Broken tooling
79
+
80
+ - Remove or fix `package.json` script entries whose target files do not exist (root + `apps/*/package.json` in monorepos).
81
+ - Highest signal — these fail when invoked.
82
+
83
+ ### Phase 2 — Orphan scripts
84
+
85
+ - Delete scripts under `scripts/`, `apps/*/scripts/`, `docs/*/scripts/` with no `package.json` wiring and no inbound references.
86
+ - Keep scripts cited as re-run playbooks in active docs (e.g. Formstack audit spikes).
87
+
88
+ ### Phase 3 — Completed one-offs
89
+
90
+ - Migration tooling (`migrate-*.ts`, `enable-*-migration.js`, schema dumps) after user confirms migration done.
91
+ - Ops runbooks marked complete in `ACTION-PLAN.md` / env inventory docs.
92
+
93
+ ### Phase 4 — Stale docs and artifacts
94
+
95
+ - Pre-monorepo orientation docs, "Moved" stubs, one-off session reports, dated `.xlsx`/`.json` audit outputs.
96
+ - Untracked orphan audits at repo root — delete or commit per user choice.
97
+
98
+ ### Phase 5 — Duplicate infrastructure (monorepo)
99
+
100
+ - Per-app `.husky/` when root `.husky/pre-commit` runs `lint-staged` + typecheck.
101
+ - Remove `husky` from app `devDependencies` when root `prepare` owns hooks.
102
+
103
+ ### Phase 6 — Doc drift and env templates
104
+
105
+ - Legacy package/filter names (`example-brightline` → `apps/<app>/` paths and real filter name).
106
+ - Broken references in `AGENTS.md`, README, playbooks, `ACTION-PLAN.md`.
107
+ - Vars documented in README / `VERCEL-ENV-VARS.md` but missing from `.env.example`.
108
+
109
+ ### Phase 7 — Orphan npm dependencies (optional)
110
+
111
+ ```bash
112
+ pnpm why <package>
113
+ rg "from '<pkg>'|require\\('<pkg>'\\)" .
114
+ ```
115
+
116
+ Remove root or app devDependencies with zero imports (e.g. leftover `xlsx` after workbook script removal).
117
+
118
+ ---
119
+
120
+ ## Step 5 — Reference repair
121
+
122
+ After each deletion phase, grep for deleted basenames:
123
+
124
+ ```bash
125
+ rg '<basename-or-path>' --glob '!node_modules' --glob '!.next'
126
+ ```
127
+
128
+ Update inbound links in README, `AGENTS.md`, media briefs, editor playbooks, and superseded-doc cross-references.
129
+
130
+ ---
131
+
132
+ ## Step 6 — Optional Dependabot investigate
133
+
134
+ When the repo is on GitHub and `gh` is available:
135
+
136
+ ```bash
137
+ gh api repos/<org>/<repo>/dependabot/alerts --jq \
138
+ '.[] | select(.state=="open") | {number, package: .security_vulnerability.package.name, severity: .security_advisory.severity, manifest: .dependency.manifest_path, summary: .security_advisory.summary}'
139
+ ```
140
+
141
+ For each alert: `pnpm why <package>` — classify as direct vs transitive, runtime vs dev-only. Summarize fix paths; **do not** bump unless user asks.
142
+
143
+ ---
144
+
145
+ ## Step 7 — Validate and commit
146
+
147
+ ```bash
148
+ pnpm validate # or repo-specific validate from AGENTS.md
149
+ ```
150
+
151
+ - Revert unrelated diffs from validate side-effects (e.g. regenerated `abTests.ts`, biome trailing-newline fixes) before commit.
152
+ - Pre-existing test failures: call out explicitly; do not blame cleanup.
153
+
154
+ Commit on integration branch only. Suggested message: `chore: remove stale scripts, docs, and tooling`.
155
+
156
+ Hand off production promotion to the human — never push `main`.
157
+
158
+ ---
159
+
160
+ ## Success criteria
161
+
162
+ - Classified audit presented before deletes
163
+ - No false-positive paths from [`FALSE_POSITIVES.md`](../../references/stale-files-cleanup/FALSE_POSITIVES.md) removed
164
+ - `rg` pass clean for deleted paths (or intentional stubs updated)
165
+ - `pnpm validate` passes or pre-existing failures documented