seedproject-web/README.md

106 lines
4.5 KiB
Markdown
Raw Normal View History

# SeedProject base
A cloneable foundation for building websites — a static [Astro](https://astro.build)
frontend with a PHP backend, an AI authoring console, and an autonomous content
pipeline. Clone it, set one config file, and build out a new site (a lawyer's
office, a roofing company, a niche publication) the way you'd spin up a new
WordPress install — but faster to host and safer to run.
## What's inside
| Path | Role | "WordPress equivalent" |
|------|------|------------------------|
| `app/` | Astro theme — layouts, components, content collections, sample post | theme + posts |
| `api/` | [SeedProject](api/.memory/documentation.md) PHP framework — the dynamic backend (DB, forms, metrics, agents) | PHP core |
feat: content-pipeline/ → agents/ — formalize the agent system in the seed Adopt the agents/ architecture proven on medellin.co (reference impl): - Move the content engine to a top-level agents/ dir: orchestrators, prompts, config, run.sh, admin console, shared libs. All content-pipeline literals repointed (config paths, scripts, admin, LLM-facing prompts/image.md string, configure.mjs, new-site.sh, astroagent tokenFile, .gitignore runtime block). - Every script carries a parseable @agent-manifest header: name, title, class (content|operational|runtime|plumbing), trigger, model, prompts, skills (MCP), tools, reads/writes tables. 5 content agents + 3 plumbing scripts. - New agents/catalog.mjs generates the catalog from the headers: agents/AGENTS.md (human, grouped by class) + agents/agents.json (machine manifest — a clone diffs it against a source to find missing tools/tables/MCP before running). configure.mjs regenerates the catalog on every identity stamp. No DB table, no watcher. - config.json gains paths.stateDir/newsDir; publish-tick, write-daily, and news-radar read them instead of hardcoding. - Full cut: content-pipeline/ deleted (the seed has no live crons, so no hybrid period needed). Docs updated (AGENTS.md structure + pipeline section, README paths). Clones migrating from content-pipeline/: see medellin.co's .memory/handoffs/agents-directory-migration.md for the cutover playbook (one cron set active at a time; migrate drafts/state after repointing cron). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMQeUnUrAeexcZ7P2Hxa6G
2026-07-11 20:33:48 +00:00
| `agents/` | Autonomous content engine — research, write, review, publish | (no equivalent) |
| `astroagent.config.json` + `app/.astroagent/` | AI authoring console — change the site in plain English | wp-admin |
| `site.config.json` | **Single source of site identity** — the one file you edit per site | wp-config + Site Settings |
## Quick start — spin up a new site
```bash
git clone https://repo.carlosarias.com/carlos/seedproject-web.git my-site
cd my-site
./scripts/new-site.sh # prompts for name/URL/author → writes site.config.json,
# stamps every engine, (optionally) resets git + installs deps
cd app && npm run build # builds the static site into ./public
```
Then point a web server's document root at `./public` and alias `/api` to `./api`
(see [Backend](#backend-api)).
## The one file you edit: `site.config.json`
All site identity lives here:
```json
{
"name": "Acme Roofing",
"url": "https://acmeroofing.com",
"description": "Denver's trusted roofing contractor since 1998.",
"tagline": "Roofs done right",
"language": "en",
"timezone": "America/Denver",
"topic": "residential and commercial roofing",
"audience": "Denver-area homeowners and property managers",
"author": { "slug": "acme", "name": "Acme Roofing", "jobTitle": "...", "avatar": "/avatar-placeholder.png", "bio": "...", "longBio": "...", "knowsAbout": [], "sameAs": [] },
"social": { "twitter": "" }
}
```
After editing it, run:
```bash
node scripts/configure.mjs
```
This stamps the values into the Astro theme (`app/src/config/site.json`),
feat: content-pipeline/ → agents/ — formalize the agent system in the seed Adopt the agents/ architecture proven on medellin.co (reference impl): - Move the content engine to a top-level agents/ dir: orchestrators, prompts, config, run.sh, admin console, shared libs. All content-pipeline literals repointed (config paths, scripts, admin, LLM-facing prompts/image.md string, configure.mjs, new-site.sh, astroagent tokenFile, .gitignore runtime block). - Every script carries a parseable @agent-manifest header: name, title, class (content|operational|runtime|plumbing), trigger, model, prompts, skills (MCP), tools, reads/writes tables. 5 content agents + 3 plumbing scripts. - New agents/catalog.mjs generates the catalog from the headers: agents/AGENTS.md (human, grouped by class) + agents/agents.json (machine manifest — a clone diffs it against a source to find missing tools/tables/MCP before running). configure.mjs regenerates the catalog on every identity stamp. No DB table, no watcher. - config.json gains paths.stateDir/newsDir; publish-tick, write-daily, and news-radar read them instead of hardcoding. - Full cut: content-pipeline/ deleted (the seed has no live crons, so no hybrid period needed). Docs updated (AGENTS.md structure + pipeline section, README paths). Clones migrating from content-pipeline/: see medellin.co's .memory/handoffs/agents-directory-migration.md for the cutover playbook (one cron set active at a time; migrate drafts/state after repointing cron). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMQeUnUrAeexcZ7P2Hxa6G
2026-07-11 20:33:48 +00:00
`agents/config.json`, and `astroagent.config.json` so all three engines
share one identity. `new-site.sh` runs it for you.
## Backend (`api/`)
The `api/` directory is the SeedProject PHP framework, meant to be served at
`/api` on the same domain (the static frontend calls it same-origin). It needs:
- **Composer deps:** `cd api && composer install`
- **Config:** `api/config.php` with your database credentials (git-ignored). Until
the CLI installer ships (see below), create it by hand or use the framework's
web installer under `api/install/`.
- **A PHP-FPM handler** in your web server for `/api`, with a front-controller
rewrite to `api/index.php`. Example Apache/nginx snippets are in
[`api/.memory/foundation.md`](api/.memory/foundation.md).
> **Planned — the Foundation:** a `php console app:install` (DB + config + schema)
> and `php console db:migrate`, plus a two-tier auth layer and a `/api/health`
> round-trip. Design + implementation plan: [`api/.memory/foundation.md`](api/.memory/foundation.md)
> and [`api/.memory/foundation-plan.md`](api/.memory/foundation-plan.md).
## Content pipeline & authoring
feat: content-pipeline/ → agents/ — formalize the agent system in the seed Adopt the agents/ architecture proven on medellin.co (reference impl): - Move the content engine to a top-level agents/ dir: orchestrators, prompts, config, run.sh, admin console, shared libs. All content-pipeline literals repointed (config paths, scripts, admin, LLM-facing prompts/image.md string, configure.mjs, new-site.sh, astroagent tokenFile, .gitignore runtime block). - Every script carries a parseable @agent-manifest header: name, title, class (content|operational|runtime|plumbing), trigger, model, prompts, skills (MCP), tools, reads/writes tables. 5 content agents + 3 plumbing scripts. - New agents/catalog.mjs generates the catalog from the headers: agents/AGENTS.md (human, grouped by class) + agents/agents.json (machine manifest — a clone diffs it against a source to find missing tools/tables/MCP before running). configure.mjs regenerates the catalog on every identity stamp. No DB table, no watcher. - config.json gains paths.stateDir/newsDir; publish-tick, write-daily, and news-radar read them instead of hardcoding. - Full cut: content-pipeline/ deleted (the seed has no live crons, so no hybrid period needed). Docs updated (AGENTS.md structure + pipeline section, README paths). Clones migrating from content-pipeline/: see medellin.co's .memory/handoffs/agents-directory-migration.md for the cutover playbook (one cron set active at a time; migrate drafts/state after repointing cron). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMQeUnUrAeexcZ7P2Hxa6G
2026-07-11 20:33:48 +00:00
- **`agents/`** — autonomous research/write/review/publish scripts driven
by `agents/config.json` (populated from `site.config.json`). Runtime
state (`drafts/`, `state/`, `logs/`, queues) is git-ignored and regenerates per site.
- **astroagent** — the in-site console for making changes in plain English; its
identity comes from `astroagent.config.json`.
## Directory layout
```
my-site/
├── site.config.json ← edit this
├── scripts/
│ ├── new-site.sh ← one-time setup for a fresh clone
│ └── configure.mjs ← stamp site.config.json into every engine
├── app/ ← Astro frontend (build → ../public)
├── api/ ← SeedProject PHP backend (served at /api)
feat: content-pipeline/ → agents/ — formalize the agent system in the seed Adopt the agents/ architecture proven on medellin.co (reference impl): - Move the content engine to a top-level agents/ dir: orchestrators, prompts, config, run.sh, admin console, shared libs. All content-pipeline literals repointed (config paths, scripts, admin, LLM-facing prompts/image.md string, configure.mjs, new-site.sh, astroagent tokenFile, .gitignore runtime block). - Every script carries a parseable @agent-manifest header: name, title, class (content|operational|runtime|plumbing), trigger, model, prompts, skills (MCP), tools, reads/writes tables. 5 content agents + 3 plumbing scripts. - New agents/catalog.mjs generates the catalog from the headers: agents/AGENTS.md (human, grouped by class) + agents/agents.json (machine manifest — a clone diffs it against a source to find missing tools/tables/MCP before running). configure.mjs regenerates the catalog on every identity stamp. No DB table, no watcher. - config.json gains paths.stateDir/newsDir; publish-tick, write-daily, and news-radar read them instead of hardcoding. - Full cut: content-pipeline/ deleted (the seed has no live crons, so no hybrid period needed). Docs updated (AGENTS.md structure + pipeline section, README paths). Clones migrating from content-pipeline/: see medellin.co's .memory/handoffs/agents-directory-migration.md for the cutover playbook (one cron set active at a time; migrate drafts/state after repointing cron). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMQeUnUrAeexcZ7P2Hxa6G
2026-07-11 20:33:48 +00:00
├── agents/ ← autonomous content engine
└── public/ ← build output (git-ignored)
```
## What's git-ignored
Secrets (`**/.env`, `api/config.php`), dependencies (`node_modules/`, `api/vendor/`),
build output (`public/`, `app/dist/`), and per-site runtime state. A fresh clone
installs deps and generates the rest.