Skip to content

Commit 081712e

Browse files
committed
chore: remove deprecated files and update Copilot instructions for clarity
1 parent bb0f4ca commit 081712e

7 files changed

Lines changed: 44 additions & 256 deletions

File tree

.claude/settings.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

.claude/skills/debug-issue.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

.claude/skills/explore-codebase.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

.claude/skills/refactor-safely.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

.claude/skills/review-changes.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 14 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,22 @@
11
---
2-
applyTo: **
3-
description: Copilot instructions for Local-Stack repository
2+
applyTo: "**"
3+
description: Minimal Copilot shim for Local-Stack; AGENTS.md is canonical.
44
---
55

6-
## Copilot instructions for Local-Stack repository
6+
## Local-Stack Copilot Shim
77

8-
Goal: help an automated coding agent become productive quickly by describing the architecture, common developer workflows, repository conventions, and where to make safe, minimal changes.
8+
Primary instructions live in [AGENTS.md](../../AGENTS.md). Use that file as the canonical agent guide.
99

10-
1) Big-picture architecture
11-
- Historically, this repo used multiple Docker Compose files per service. We are migrating to modular Docker Swarm stacks to deploy the environment declaratively across local and remote hosts.
12-
- Service folders remain the source of truth for per-service configs: `traefik/`, `apisix/`, `observability/`, `postgres/`, `mongo/`, `redis/`, `growthbook/`, `portainer/`, `anitrend/`, and `on-the-edge/`.
13-
- Traefik is the edge router/TLS terminator; routing and middleware live in `traefik/config` and service-level labels.
14-
- Observability lives under `observability/` (`grafana/`, `prometheus/`, `loki/`, `tempo/`, `otel/`).
15-
- Target stack split (Swarm):
16-
- Infrastructure: Traefik, Portainer, APISIX (gateway + etcd + dashboard), Postgres, Mongo, Redis.
17-
- Observability: Prometheus, Grafana, Loki, Tempo, OTel Collector.
18-
- Platform: GrowthBook (dashboard + proxy), AniTrend apps/services, and other application-facing components.
10+
## Critical Guardrails
1911

20-
2) Key files and conventions (referenced in tasks)
21-
- Compose files: search for `**/docker-compose*.yml` or `**/docker-compose*.yaml`. Each service folder usually contains a compose file and an accompanying `.env.example`.
22-
- Environment files: the repo expects service-specific `.env` files created from `.env.example` (e.g., `traefik/.env.example`). CI jobs often copy `.env.example` -> `.env` for validation.
23-
- Traefik config: `traefik/config/traefik.yml` and `traefik/config/dynamic.yml` are authoritative for routing. When changing hostnames or ports update these files.
24-
- Observability provisioning: `observability/grafana/config/provisioning/` contains dashboards and datasources that should be updated together with any metric source changes.
25-
- Swarm stacks: new modular Swarm stack files will live under a `stacks/` directory (planned names: `infrastructure.yml`, `observability.yml`, `platform.yml`). The legacy root-level `swarm.*.yml` files are deprecated—do not edit or use them.
12+
- Do not edit generated rendered stack outputs.
13+
- Do not use or modify deprecated root-level `swarm.*.yml` files.
14+
- Prefer service-local source changes (`docker-compose*.yml`, `swarm.fragment.yml`, `.env.example`) and then regenerate/sync stacks.
15+
- Keep exposed services on `traefik-public` with correct Traefik labels.
16+
- Keep secrets out of source; use environment variables and follow [docs/Managing Secrets.md](../../docs/Managing%20Secrets.md).
2617

27-
3) Developer workflows and commands (explicit)
28-
- Preferred (Swarm, modular):
29-
- Initialize Swarm (once per host): `docker swarm init`.
30-
- Create shared overlay network (once): `docker network create --driver=overlay --attachable traefik-public`.
31-
- Deploy stacks:
32-
- `docker stack deploy -c stacks/infrastructure.yml infrastructure`
33-
- `docker stack deploy -c stacks/observability.yml observability`
34-
- `docker stack deploy -c stacks/platform.yml platform`
35-
- Verify: `docker stack services <stack>` and Portainer UI. Tear down with `docker stack rm <stack>`.
36-
- Legacy local-only (Compose): still available per service for iterative work until migration completes.
37-
- Example: `cd traefik && cp .env.example .env && docker compose up -d`
38-
- Observability (legacy): `cd observability && for d in grafana prometheus loki tempo otel; do cp $d/.env.example $d/.env; done && docker compose up -d`
39-
- Validation (CI/dev):
40-
- Compose syntax: `docker compose -f <path> config`.
41-
- YAML linting: `yamllint <file>`.
42-
- YAML parsing validation: `yq e '.' <file> >/dev/null` (prefer this in scripts/workflows for fast syntax checks).
43-
- Dockerfile linting: `hadolint` via container.
18+
## Canonical References
4419

45-
4) What to change and where (safe-scoped edits)
46-
- Service-scoped config: edit the service folder (`docker-compose.yml`, `.env.example`, and config files) as before. These feed into both Compose and Swarm stacks.
47-
- Swarm stacks (preferred for deployment): add/update files under `stacks/` to include or configure services. Keep stacks modular by function: infrastructure, observability, platform.
48-
- Cross-cutting routing or hostnames: update `traefik/config/dynamic.yml` and service labels (`traefik.http.routers.*`).
49-
- Do NOT edit or use root-level `swarm.*.yml`—they are deprecated remnants of an initial attempt.
50-
51-
5) Integration points and external dependencies
52-
- Networks: Under Swarm, all exposed services attach to a shared external overlay network named `traefik-public` (create once). Compose continues to create local bridge networks for ad-hoc local runs.
53-
- Routing: Traefik discovers services via Docker metadata and labels on the shared network.
54-
- External dependencies: none hard-coded; some components expect valid certificates in `traefik/certs` and secrets via `.env`.
55-
56-
6) Common pitfalls and agent guidance
57-
- Ensure the external overlay network `traefik-public` exists before deploying stacks.
58-
- Avoid Compose-only keys in Swarm stacks: no `container_name`, no `restart` (use `deploy.restart_policy`), and no `build` (images must be pre-built/pulled).
59-
- Prefer `deploy` settings in Swarm: `mode` (global/replicated), `placement.constraints` (e.g., `node.role == manager`), resource limits, and optional `restart_policy`.
60-
- Use `env_file` to load per-service `.env`; consider Docker secrets/config for sensitive values in future iterations.
61-
- `depends_on` in Swarm affects start order only; add healthchecks for critical readiness if needed.
62-
- Do not assume `.env` files exist; if adding new variables, update `.env.example` and docs.
63-
- When updating observability dashboards or Prometheus scrape configs, update provisioning under `observability/*/config` and Grafana datasources.
64-
65-
7) Code and content patterns to preserve
66-
- Service-level folder structure; keep related config colocated.
67-
- Volume mounts and named volumes for persistence.
68-
- Traefik labels on services for routing; keep consistent naming and middleware reuse.
69-
70-
8) Where to run tests/builds
71-
- There are no application unit tests in this repo; validation is through Compose validation and scanning workflows (`.github/workflows/docker-lint.yml` and `.github/workflows/docker-scan.yml`).
72-
- For Swarm changes, perform a dry deploy on a local single-node swarm and verify `docker stack services` shows healthy tasks; prefer incremental stack updates.
73-
74-
9) If you are unsure
75-
- Prefer small, reversible edits: add/update `stacks/<module>.yml` rather than touching many service configs at once. Keep Compose changes minimal and documented.
76-
- Open a PR with CI results and a brief manual verification plan (Swarm deploy steps and expected endpoints).
77-
78-
10) Acceptance criteria for the Swarm migration (initial phase)
79-
- Single-node Swarm deploys of `infrastructure`, `observability`, and `platform` stacks succeed.
80-
- All exposed services are reachable via Traefik on the shared `traefik-public` network.
81-
- No Swarm stack uses `container_name`, `restart`, or `build` keys.
82-
- Critical data volumes (e.g., Traefik certs, Portainer data, databases) are persisted via named volumes (external where reusing existing data).
83-
84-
Deprecated: root-level `swarm.*.yml` files. Do not use or update; they will be archived once new `stacks/*.yml` files are introduced.
85-
86-
If anything above is unclear or you want examples added (e.g., exact `docker compose config` output handling), tell me which area to expand and I'll iterate.
20+
- [AGENTS.md](../../AGENTS.md)
21+
- [README.md](../../README.md)
22+
- [stacks/README.md](../../stacks/README.md)

AGENTS.md

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
1-
<!-- code-review-graph MCP tools -->
2-
## MCP Tools: code-review-graph
3-
4-
**IMPORTANT: This project has a knowledge graph. ALWAYS use the
5-
code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore
6-
the codebase.** The graph is faster, cheaper (fewer tokens), and gives
7-
you structural context (callers, dependents, test coverage) that file
8-
scanning cannot.
9-
10-
### When to use graph tools FIRST
11-
12-
- **Exploring code**: `semantic_search_nodes` or `query_graph` instead of Grep
13-
- **Understanding impact**: `get_impact_radius` instead of manually tracing imports
14-
- **Code review**: `detect_changes` + `get_review_context` instead of reading entire files
15-
- **Finding relationships**: `query_graph` with callers_of/callees_of/imports_of/tests_for
16-
- **Architecture questions**: `get_architecture_overview` + `list_communities`
17-
18-
Fall back to Grep/Glob/Read **only** when the graph doesn't cover what you need.
19-
20-
### Key Tools
21-
22-
| Tool | Use when |
23-
|------|----------|
24-
| `detect_changes` | Reviewing code changes — gives risk-scored analysis |
25-
| `get_review_context` | Need source snippets for review — token-efficient |
26-
| `get_impact_radius` | Understanding blast radius of a change |
27-
| `get_affected_flows` | Finding which execution paths are impacted |
28-
| `query_graph` | Tracing callers, callees, imports, tests, dependencies |
29-
| `semantic_search_nodes` | Finding functions/classes by name or keyword |
30-
| `get_architecture_overview` | Understanding high-level codebase structure |
31-
| `refactor_tool` | Planning renames, finding dead code |
32-
33-
### Workflow
34-
35-
1. The graph auto-updates on file changes (via hooks).
36-
2. Use `detect_changes` for code review.
37-
3. Use `get_affected_flows` to understand impact.
38-
4. Use `query_graph` pattern="tests_for" to check coverage.
1+
# Local-Stack Agent Guide
2+
3+
Local-Stack is migrating from per-service Compose to modular Docker Swarm stacks. Keep agent guidance short, link to the canonical docs, and prefer editing the owning service or stack source instead of duplicating context here.
4+
5+
## Source Of Truth
6+
7+
- Service folders are the source of truth for config: `traefik/`, `apisix/`, `observability/`, `postgres/`, `mongo/`, `redis/`, `growthbook/`, `portainer/`, `anitrend/`, `on-the-edge/`, `edge-graphql/`, `website/`, and `beszel/`.
8+
- Generated Swarm stacks live in `stacks/`. Do not edit the rendered stack output directly; regenerate with `./stackctl.sh generate` or sync with `./stackctl.sh sync`. See [stacks/README.md](stacks/README.md).
9+
- Deprecated root-level `swarm.*.yml` files are not used for deployment.
10+
11+
## How To Work
12+
13+
- For full-environment deploys and validation, follow [stacks/README.md](stacks/README.md) and the `./stackctl.sh` workflow.
14+
- For service-local changes, update the service folder’s `docker-compose.yml`, `swarm.fragment.yml`, and `.env.example` together when needed.
15+
- Keep exposed services attached to the shared `traefik-public` network and route them with Traefik labels and [traefik/config/dynamic.yml](traefik/config/dynamic.yml).
16+
- Update Grafana provisioning under [observability/grafana/config/provisioning/](observability/grafana/config/provisioning/) when dashboards or datasources change.
17+
18+
## Change Rules
19+
20+
- Prefer pinned GHCR tags; avoid `latest`.
21+
- Do not assume `.env` files exist. If a new variable is needed, update the matching `.env.example`.
22+
- For edge-facing apps, include Traefik router/service labels and a healthcheck that matches the exposed endpoint.
23+
- Keep secrets out of source; prefer environment variables and the guidance in [docs/Managing Secrets.md](docs/Managing%20Secrets.md).
24+
25+
## Good Starting Docs
26+
27+
- [README.md](README.md)
28+
- [stacks/README.md](stacks/README.md)
29+
- [docs/Managing Secrets.md](docs/Managing%20Secrets.md)
30+
- [docs/Migrating Compose Files to a Modular Docker Swarm 2738a21416308060a700fda5cdcc3b2d.md](docs/Migrating%20Compose%20Files%20to%20a%20Modular%20Docker%20Swarm%20%202738a21416308060a700fda5cdcc3b2d.md)

0 commit comments

Comments
 (0)