@archangel70/cosmo 1.7.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +792 -0
  3. package/SECURITY.md +15 -0
  4. package/docs/AGENT-HANDOFF.md +44 -0
  5. package/docs/ARCHITECTURE-INTELLIGENCE.md +64 -0
  6. package/docs/ARCHITECTURE.md +97 -0
  7. package/docs/BRAND-DISCOVERY.md +12 -0
  8. package/docs/BROWSER-QA.md +40 -0
  9. package/docs/CLAUDE-LAUNCHER.md +72 -0
  10. package/docs/CONTENT-QA.md +62 -0
  11. package/docs/DELIVERY.md +40 -0
  12. package/docs/DEPLOYMENT.md +119 -0
  13. package/docs/FIRST-PARTY-CAPABILITIES.md +54 -0
  14. package/docs/GENERATION.md +81 -0
  15. package/docs/INTEGRITY.md +75 -0
  16. package/docs/INTELLIGENCE-PACKS.md +122 -0
  17. package/docs/OPERATIONS.md +7 -0
  18. package/docs/PAGE-PRODUCTION.md +81 -0
  19. package/docs/ROADMAP.md +184 -0
  20. package/docs/WORKFLOWS.md +71 -0
  21. package/package.json +97 -0
  22. package/packages/cli/bin/cosmo.mjs +901 -0
  23. package/packages/cli/lib/adoption.mjs +72 -0
  24. package/packages/cli/lib/audit.mjs +145 -0
  25. package/packages/cli/lib/brand.mjs +60 -0
  26. package/packages/cli/lib/browser-audit.mjs +177 -0
  27. package/packages/cli/lib/claude-plugin.mjs +64 -0
  28. package/packages/cli/lib/content-audit.mjs +184 -0
  29. package/packages/cli/lib/delivery.mjs +140 -0
  30. package/packages/cli/lib/deployment.mjs +211 -0
  31. package/packages/cli/lib/doctor.mjs +42 -0
  32. package/packages/cli/lib/file-transfer.mjs +143 -0
  33. package/packages/cli/lib/generation.mjs +319 -0
  34. package/packages/cli/lib/handoff.mjs +109 -0
  35. package/packages/cli/lib/integrity.mjs +315 -0
  36. package/packages/cli/lib/intelligence-audit.mjs +445 -0
  37. package/packages/cli/lib/intelligence.mjs +331 -0
  38. package/packages/cli/lib/page-work.mjs +154 -0
  39. package/packages/cli/lib/plan.mjs +229 -0
  40. package/packages/cli/lib/process.mjs +45 -0
  41. package/packages/cli/lib/project.mjs +113 -0
  42. package/packages/cli/lib/research.mjs +85 -0
  43. package/packages/cli/lib/status.mjs +46 -0
  44. package/packages/cli/lib/workflow.mjs +294 -0
  45. package/plugins/claude-code/cosmo/.claude-plugin/plugin.json +10 -0
  46. package/plugins/claude-code/cosmo/README.md +25 -0
  47. package/plugins/claude-code/cosmo/bin/cosmo +11 -0
  48. package/plugins/claude-code/cosmo/skills/cosmo/SKILL.md +122 -0
  49. package/plugins/claude-code/cosmo/skills/cosmo-help/SKILL.md +16 -0
  50. package/scripts/postinstall.mjs +14 -0
  51. package/templates/astro-site/.cosmo/brand/discovery.json +19 -0
  52. package/templates/astro-site/.cosmo/brand/entity-canon.json +20 -0
  53. package/templates/astro-site/.cosmo/brand/voice-profile.json +16 -0
  54. package/templates/astro-site/.cosmo/build-plan.json +75 -0
  55. package/templates/astro-site/.cosmo/capabilities/registry.json +21 -0
  56. package/templates/astro-site/.cosmo/evidence.json +11 -0
  57. package/templates/astro-site/.cosmo/intelligence/selection.json +5 -0
  58. package/templates/astro-site/.cosmo/policies/content-integrity.json +22 -0
  59. package/templates/astro-site/.cosmo/project.json +10 -0
  60. package/templates/astro-site/.cosmo/work/pages/about/brief.json +49 -0
  61. package/templates/astro-site/.cosmo/work/pages/home/brief.json +51 -0
  62. package/templates/astro-site/.cosmo/workflows/default.json +146 -0
  63. package/templates/astro-site/.env.example +7 -0
  64. package/templates/astro-site/AGENTS.md +26 -0
  65. package/templates/astro-site/CLAUDE.md +28 -0
  66. package/templates/astro-site/DESIGN-DIRECTION.md +9 -0
  67. package/templates/astro-site/README.md +17 -0
  68. package/templates/astro-site/astro.config.mjs +16 -0
  69. package/templates/astro-site/cosmo.config.mjs +12 -0
  70. package/templates/astro-site/gitignore.template +9 -0
  71. package/templates/astro-site/package.json +23 -0
  72. package/templates/astro-site/public/favicon.svg +5 -0
  73. package/templates/astro-site/src/components/PageView.astro +20 -0
  74. package/templates/astro-site/src/components/sections/Action.astro +24 -0
  75. package/templates/astro-site/src/components/sections/Evidence.astro +19 -0
  76. package/templates/astro-site/src/components/sections/Hero.astro +41 -0
  77. package/templates/astro-site/src/components/sections/Problem.astro +19 -0
  78. package/templates/astro-site/src/components/sections/Proof.astro +15 -0
  79. package/templates/astro-site/src/components/sections/SectionRenderer.astro +22 -0
  80. package/templates/astro-site/src/components/sections/Solution.astro +19 -0
  81. package/templates/astro-site/src/components/seo/SeoHead.astro +41 -0
  82. package/templates/astro-site/src/content/pages/about.md +52 -0
  83. package/templates/astro-site/src/content/pages/home.md +48 -0
  84. package/templates/astro-site/src/content.config.ts +133 -0
  85. package/templates/astro-site/src/env.d.ts +1 -0
  86. package/templates/astro-site/src/layouts/BaseLayout.astro +57 -0
  87. package/templates/astro-site/src/pages/[...slug].astro +22 -0
  88. package/templates/astro-site/src/pages/index.astro +9 -0
  89. package/templates/astro-site/src/pages/robots.txt.ts +6 -0
  90. package/templates/astro-site/src/styles/global.css +540 -0
  91. package/templates/astro-site/src/styles/tokens.css +27 -0
  92. package/templates/astro-site/tsconfig.json +9 -0
package/SECURITY.md ADDED
@@ -0,0 +1,15 @@
1
+ # Security
2
+
3
+ Cosmo is currently shared privately with trusted collaborators and does not operate a hosted service.
4
+
5
+ Report a suspected vulnerability privately to the repository owner. Do not include credentials, private keys, customer data, unpublished research, or live deployment details in a public issue.
6
+
7
+ ## Credential boundaries
8
+
9
+ - Keep deployment credentials in provider authentication, process environment variables, or a gitignored runtime env file.
10
+ - Never commit `.env.deploy` or another populated env file.
11
+ - Verify SFTP host fingerprints before deployment.
12
+ - Prefer SFTP or FTPS; plain FTP is insecure and requires explicit acknowledgement.
13
+ - Review imported declarative intelligence packages before enabling them.
14
+
15
+ Cosmo does not intentionally persist credential values in project configuration, QA reports, deployment history, manifests, or agent handoffs.
@@ -0,0 +1,44 @@
1
+ # Claude and Codex Handoff
2
+
3
+ Cosmo supports a Claude-first build and later Codex maintenance without requiring either agent to have the earlier conversation. The repository carries approved intent, current progress, and verification evidence.
4
+
5
+ ## During the Claude build
6
+
7
+ Claude reads `CLAUDE.md`, the active intelligence selection and pack manifests, and the current Cosmo workflow. Claude Design can explore outside the starter's aesthetic; when its pack is selected, the approved exploration also becomes `.cosmo/design/claude-design-handoff.json` before content generation scales. The implemented direction remains local Astro components, CSS tokens, and `DESIGN-DIRECTION.md`.
8
+
9
+ Before leaving the project, Claude should complete the applicable checks and create a handoff:
10
+
11
+ ```bash
12
+ cosmo check .
13
+ cosmo browser check .
14
+ cosmo handoff create . --from claude --to codex --note "What changed, what was approved, and any unresolved judgment calls"
15
+ ```
16
+
17
+ ## During later Codex work
18
+
19
+ Codex reads `AGENTS.md` and `HANDOFF.md`, then verifies the summary against the repository artifacts. The handoff records:
20
+
21
+ - Project identity and current stage.
22
+ - Active or completed workflow state.
23
+ - Active intelligence profile and selected packs.
24
+ - Generation totals, failures, and stop reason.
25
+ - Approved plan page and graph counts.
26
+ - Latest static and browser QA status.
27
+ - Latest delivery readiness and release ID when evaluated.
28
+ - Latest deployment attempt, environment, release ID, status, and URL when available.
29
+ - A concise next action and operator note.
30
+
31
+ The receiving agent must still read the brand brief, intelligence selection, selected pack manifests and artifacts, design direction, build plan, progress ledger, relevant page brief, source manifest, outline, editorial report, and content files. A handoff communicates state; it does not manufacture approval.
32
+
33
+ ## Files
34
+
35
+ - `HANDOFF.md` is optimized for immediate human and agent reading.
36
+ - `.cosmo/handoff.json` is the structured equivalent for tooling.
37
+ - `.cosmo/activity.jsonl` records `handoff.created` with sender and recipient.
38
+ - `.cosmo/deploy/history.jsonl` remains the authoritative append-only deployment record.
39
+
40
+ Creating a later handoff safely replaces the current summary while the activity log preserves the event history.
41
+
42
+ ## Acceptance pilot
43
+
44
+ The v0.5 acceptance run initialized a project into an empty temporary directory and confirmed that no reports, progress, activity, design capture, or other starter runtime state crossed the boundary. It then completed intake, brand, design capture, homepage approval, template approval, plan approval, all five generation checkpoints, static QA, rendered QA, final approval, and a Claude-to-Codex handoff from the installed generated project.
@@ -0,0 +1,64 @@
1
+ # Cosmo Architecture Intelligence
2
+
3
+ Build Plan v3 makes site architecture executable. It extends the integrity foundation with page archetypes, intent states, indexability, collision boundaries, and governed internal-link roles.
4
+
5
+ ## Page architecture
6
+
7
+ Every page declares:
8
+
9
+ - `archetype`: `hub`, `service`, `location`, `guide`, `answer`, `comparison`, `trust`, or `utility`.
10
+ - `indexability`: `index` or `noindex`.
11
+ - `intent.primary`: the singular job the visitor is trying to complete.
12
+ - `intent.funnel`: `awareness`, `consideration`, `decision`, or `retention`.
13
+ - `intent.awareness`: `unaware`, `problem-aware`, `solution-aware`, `product-aware`, or `most-aware`.
14
+ - `intent.queryPatterns`: one or more distinct patterns the page answers.
15
+ - `intent.demandConfidence`: `observed`, `inferred`, or `unknown`.
16
+ - `intentBoundaries`: explicit distinctions from pages with legitimately adjacent topics.
17
+
18
+ `demandConfidence` records the quality of the planning input; it is not a search-volume prediction. `observed` should be used only when the project has real research or performance data.
19
+
20
+ ## Collision governance
21
+
22
+ Cosmo rejects exact duplicate normalized topics and query patterns. It also detects strongly overlapping primary topics. A near-overlap must be resolved by merging the pages or recording a concrete `intentBoundary` explaining why both should exist.
23
+
24
+ The heuristic is a planning alarm, not a ranking score. It never claims to predict search-engine performance.
25
+
26
+ ## Governed internal links
27
+
28
+ Build Plan v3 replaces untyped `parent` and `related` arrays with link records:
29
+
30
+ ```json
31
+ {
32
+ "target": "site-strategy",
33
+ "role": "conversion",
34
+ "reason": "Moves visitors from the overview to the primary planning offer.",
35
+ "anchorIntent": "Explore the site-strategy method"
36
+ }
37
+ ```
38
+
39
+ Roles are:
40
+
41
+ - `parent`: the single structural parent required by every non-home page.
42
+ - `sibling`: an adjacent page at the same architectural level.
43
+ - `supporting`: a page that supplies explanation, evidence, or context.
44
+ - `conversion`: an internal destination representing the intended next decision.
45
+
46
+ Every page named by the four-question `strengthensPages` contract must also be present as a governed link. Duplicate targets, unknown pages, self-links, and parent cycles are rejected.
47
+
48
+ ## Content and build behavior
49
+
50
+ Page briefs inherit the entire architecture and governed links. Generation completion checks that content frontmatter retains the approved archetype, indexability, intent, awareness, confidence, query patterns, and required links.
51
+
52
+ An `indexability: noindex` decision emits `noindex,follow`, excludes the route from the generated sitemap, and is verified by static QA. QA blocks both indexable routes missing from the sitemap and noindex routes included in it.
53
+
54
+ ## Review loop
55
+
56
+ After editing the plan:
57
+
58
+ ```bash
59
+ cosmo plan check .
60
+ cosmo brief create --all . --replace
61
+ cosmo integrity check .
62
+ ```
63
+
64
+ Review every `unknown` demand-confidence label and every explicit intent boundary before approving the plan stage.
@@ -0,0 +1,97 @@
1
+ # Cosmo Architecture
2
+
3
+ ## Product boundary
4
+
5
+ Cosmo is a local orchestrator and validator. A generated Astro repository remains independently buildable with standard npm and Astro commands; the site must not require a Cosmo account or runtime service.
6
+
7
+ ## Repository packages
8
+
9
+ - `packages/cli` contains deterministic project operations and build-output QA.
10
+ - `templates/astro-site` is the neutral, independently buildable project seed copied by `cosmo init`.
11
+ - `fixtures/reference-site` is the completed five-page reference implementation used to exercise claims, location-page gating, generation, and semantic QA. It is never copied into a new project.
12
+ - `.cosmo` inside a generated project contains local pipeline state and reports.
13
+
14
+ ## Authority boundaries
15
+
16
+ | Concern | Authority |
17
+ |---|---|
18
+ | Brand strategy and content judgment | Claude, Codex, or a human operator |
19
+ | Art direction and visual exploration | Claude Design, another design tool, or Cosmo fallback |
20
+ | Final visual source of truth | Local Astro components, CSS tokens, and `DESIGN-DIRECTION.md` |
21
+ | Page completeness and data shape | `src/content.config.ts` |
22
+ | Routes and rendering | Astro |
23
+ | Build validity and output QA | Astro checks plus `cosmo check` |
24
+ | Pipeline state | Local `.cosmo/*.json` artifacts |
25
+ | Entity identity and voice | `.cosmo/brand/entity-canon.json` and `.cosmo/brand/voice-profile.json` |
26
+ | Claims, proof, and provenance | `.cosmo/evidence.json` |
27
+ | Page purpose and site graph | Plan v3 architecture contract and its derived page brief |
28
+ | Optional domain and creative intelligence | `.cosmo/intelligence/selection.json`, selected pack manifests, and completed pack artifacts |
29
+ | Release deployment | Optional provider config plus the exact READY release ID; provider credentials remain external |
30
+
31
+ ## Generation rule
32
+
33
+ Bulk generation should create validated content entries and references. It should not create a bespoke Astro component for every page. New components are reserved for genuinely new visual or behavioral patterns and become part of the shared system before more pages use them.
34
+
35
+ The approved `.cosmo/build-plan.json` is the executable inventory. Version 3 declares each page's route, page type, archetype, intent and awareness state, indexability, demand confidence, governed graph relationships, audience need, entity, claim ids, and proof ids. `cosmo plan check` validates either a draft or approved plan and reports that state; generation refuses to start until approval is explicit. Validation rejects duplicate ids, routes, topics, and query patterns; unresolved near-topic collisions; unknown graph references; unsafe content paths; incomplete page-purpose contracts; builder-only pages; invalid link roles; and parent cycles.
36
+
37
+ `.cosmo/progress.json` is a resumable checkpoint ledger, not generated content. Generation progress v2 records `planned → briefed → sourced → outlined → drafted → edited → verified → done`; every transition validates the corresponding page-work artifact. A page can be completed only when its workspace and Markdown agree with Plan v3 and every carried proof is verified with the ledger's source and provenance. The queue stops after three consecutive failures, honors an optional page cap, limits automated repair to two cycles, and refuses to continue when the approved plan changes underneath a run. `.cosmo/generation.jsonl` records append-only transitions and repair escalation.
38
+
39
+ ## Optional intelligence
40
+
41
+ Capability Registry v2 separates the lean core from selected intelligence packs. Profiles are named pack compositions, not alternate build engines. Each selected pack is copied into the repository with its discovery questions, Claude and Codex guidance, active capability, required artifact, and workflow stage. Stage submission and direct generation both enforce those artifacts. Intelligence QA then evaluates whether the finished plan, evidence, content, imagery, research, and design implementation actually honor the selected contracts. See `docs/INTELLIGENCE-PACKS.md` for the seven packs and their specialized checks.
42
+
43
+ ## Claude Design handoff
44
+
45
+ 1. `cosmo design brief` creates a design-tool-neutral creative brief.
46
+ 2. Claude Design explores multiple directions without treating starter styles as requirements.
47
+ 3. Claude Code implements the selected direction in Astro.
48
+ 4. The approved implementation updates `DESIGN-DIRECTION.md`, `src/styles/tokens.css`, and shared components.
49
+ 5. `cosmo design capture` inventories the repository-owned design system and advances local project state.
50
+ 6. Later Claude or Codex sessions continue from those local artifacts.
51
+
52
+ ## Agent continuity
53
+
54
+ Generated repositories include tool-specific guidance without making either tool a runtime dependency. `CLAUDE.md` protects creative independence and evidence discipline during the primary build. `AGENTS.md` tells later Codex sessions how to recover approved intent and verify edits.
55
+
56
+ `cosmo handoff create` snapshots local project, workflow, generation, plan, and QA status into `.cosmo/handoff.json` and renders `HANDOFF.md` for the receiving agent. It records a handoff event but never treats the summary as a substitute for the underlying approved artifacts.
57
+
58
+ The seed carries a neutral home/about graph, keeps every route `noindex`, and marks its plan unapproved. It deliberately contains no assumed service, location, credentials, or publishable positioning. Starter runtime files are not portable inputs: `cosmo init` copies the project seed, draft plan, briefs, and workflow definitions while excluding build output, Astro caches, prior reports, design captures, progress, activity, and handoff state.
59
+
60
+ ## QA contracts
61
+
62
+ `cosmo content check` validates project-wide semantic contracts: canonical entity id, Plan v3 intent fidelity, governed links, voice boundaries, proof verification and provenance, generic and manipulative language policy, duplicated passages, and qualitative substance tiers. Its rules live in `.cosmo/policies/content-integrity.json`; the output is `.cosmo/reports/content-check.json`.
63
+
64
+ `cosmo check` builds the site and inspects generated HTML for:
65
+
66
+ - Missing or duplicate titles, descriptions, and H1s.
67
+ - Incorrect H1 counts.
68
+ - Missing canonical URLs or document language.
69
+ - Missing image alt attributes.
70
+ - Missing JSON-LD warnings.
71
+ - Broken root-relative internal links.
72
+ - Invalid JSON-LD structures and missing core properties.
73
+ - Sitemap coverage and the robots-to-sitemap declaration.
74
+
75
+ `cosmo browser check` serves the static build from a short-lived local server and renders every route at 320px, 768px, and 1440px. It blocks on navigation failures, horizontal overflow, browser errors, WCAG A/AA violations, and missing or invisible first-tab focus. It stores normal-state full-page captures and records homepage Lighthouse scores for performance, accessibility, best practices, and SEO.
76
+
77
+ `cosmo release check` sits above the individual validators. It requires completed workflow and generation state, an approved and indexable plan, production identity, an approved design direction, passing and fresh QA reports, and an intelligence report matching the active selection. The resulting release ID hashes durable source inputs; `.cosmo/reports/delivery-check.json` and `DELIVERY.md` record the decision.
78
+
79
+ ## Deployment boundary
80
+
81
+ Deployment remains optional and downstream of the release engine. `.cosmo/deploy/config.json` is portable, credential-free provider configuration. `.cosmo/deploy/history.jsonl` is an append-only local record of attempts and their release IDs. Preview deployments may represent blocked releases for review; production preflight recomputes delivery state and requires it to match the recorded READY manifest before invoking a provider.
82
+
83
+ The Cloudflare adapter maps this contract to Pages Direct Upload through Wrangler. File-transfer adapters map it to SFTP, FTPS, or acknowledged plain FTP, loading credentials only for the active command. Their SHA256 manifests enable changed-file-only uploads and intentionally never authorize remote deletion. The Astro project has no deployment-provider runtime dependency.
84
+
85
+ The deterministic report is `.cosmo/reports/site-check.json`; rendered results are `.cosmo/reports/browser-check.json`; captures live below `.cosmo/reports/screenshots/`. The QA workflow stage requires both reports to pass.
86
+
87
+ ## Workflow state machine
88
+
89
+ The default contract contains eight locked core stages: intake, brand, design, homepage, template, plan, generate, and QA. A custom workflow may insert additional stages, but validation rejects any file that removes, duplicates, or reorders the core sequence.
90
+
91
+ Each stage moves through:
92
+
93
+ ```text
94
+ pending → in_progress → awaiting_approval → completed
95
+ ```
96
+
97
+ Stages without approval skip `awaiting_approval`. Submission verifies every declared artifact within the project boundary. State and project metadata are written atomically, while `.cosmo/activity.jsonl` retains an append-only transition history.
@@ -0,0 +1,12 @@
1
+ # Guided Brand Discovery
2
+
3
+ Cosmo v1.4 turns brand discovery into a project-owned input instead of leaving positioning inside an AI conversation.
4
+
5
+ ```bash
6
+ cosmo brand discover .
7
+ cosmo brand check .
8
+ ```
9
+
10
+ The first command creates `.cosmo/brand/discovery.json` without replacing existing work. Eleven prompts cover the customer, buying moment, category distrust, alternatives, defensible difference, contrary belief, references, personality, anti-positioning, operating values, and desired first-five-seconds feeling.
11
+
12
+ Claude can conduct the interview and draft answers. A human must review the synthesis and set `approved` to `true`. `cosmo brand check` requires every answer and synthesis field; the default workflow will not submit the brand stage until that check passes. The approved discovery informs `BRAND-BRIEF.md`, the Entity Canon, voice profile, and later Claude Design exploration, but does not prescribe a Cosmo house style.
@@ -0,0 +1,40 @@
1
+ # Cosmo Browser QA
2
+
3
+ `cosmo browser check` verifies the production build in an installed Chrome or Chromium browser. It uses a short-lived static server owned by the command, so it does not depend on or leave behind an Astro preview process.
4
+
5
+ ## Checks
6
+
7
+ Every generated HTML route is rendered at:
8
+
9
+ - 320 × 900 for narrow mobile behavior.
10
+ - 768 × 1024 for tablet behavior.
11
+ - 1440 × 1000 for desktop behavior.
12
+
13
+ Each render checks successful navigation, horizontal overflow, console and page errors, WCAG 2 A/AA violations, and whether the first keyboard tab reaches an element with a visible focus treatment. Reduced-motion preference is enabled during the run.
14
+
15
+ Normal-state full-page screenshots are written before the keyboard interaction. This keeps the reference captures useful for visual review while still testing the focus path independently.
16
+
17
+ ## Lighthouse
18
+
19
+ The homepage is sampled for performance, accessibility, best practices, and SEO. Scores below 75 for performance or 90 for the other categories become report warnings. Rendered WCAG failures remain critical regardless of the Lighthouse score.
20
+
21
+ Use `--no-lighthouse` for a faster iteration pass:
22
+
23
+ ```bash
24
+ cosmo browser check . --no-lighthouse
25
+ ```
26
+
27
+ ## Output
28
+
29
+ - `.cosmo/reports/browser-check.json` contains the summary, findings, Lighthouse scores, and per-render evidence.
30
+ - `.cosmo/reports/screenshots/` contains route-and-width PNG captures.
31
+
32
+ Screenshots are ignored by git by default. Teams that want image-based regression history can deliberately track an approved reference directory in a project-specific workflow later.
33
+
34
+ ## Browser discovery
35
+
36
+ Cosmo checks `COSMO_CHROME_PATH` first, then common Chrome and Chromium installation paths. Set the variable to an executable when automatic discovery fails:
37
+
38
+ ```bash
39
+ COSMO_CHROME_PATH=/path/to/chrome cosmo browser check .
40
+ ```
@@ -0,0 +1,72 @@
1
+ # Claude Code conversational launcher
2
+
3
+ Cosmo can be started in Claude Code with the same short interaction used for Sonic: open the intended project folder and type `cosmo`.
4
+
5
+ ## Install
6
+
7
+ The public npm package installs the Claude launcher automatically:
8
+
9
+ ```bash
10
+ npm install --global @archangel70/cosmo
11
+ ```
12
+
13
+ The npm installer copies the first-party plugin to `~/.claude/skills/cosmo` and replaces its development shim with an absolute path to the installed Cosmo CLI. Restart Claude Code after installation.
14
+
15
+ If npm scripts were disabled or automatic setup could not write to the Claude directory, repair the integration with:
16
+
17
+ ```bash
18
+ cosmo setup
19
+ ```
20
+
21
+ `cosmo setup` also asks Claude Code to validate the installed plugin strictly when Claude is available.
22
+
23
+ Check installation at any time:
24
+
25
+ ```bash
26
+ cosmo claude status
27
+ ```
28
+
29
+ To update Cosmo and its Claude launcher:
30
+
31
+ ```bash
32
+ npm install --global @archangel70/cosmo@latest
33
+ ```
34
+
35
+ Remove the Claude integration without removing the CLI:
36
+
37
+ ```bash
38
+ cosmo claude uninstall
39
+ ```
40
+
41
+ ## Start
42
+
43
+ Open Claude Code in the folder you want to work on and enter:
44
+
45
+ ```text
46
+ cosmo
47
+ ```
48
+
49
+ Claude should invoke the launcher naturally. `/cosmo:cosmo` is the deterministic fallback, and `/cosmo:cosmo-help` shows its scope.
50
+
51
+ The launcher classifies the current directory before making changes:
52
+
53
+ | Directory state | Behavior |
54
+ | --- | --- |
55
+ | `.cosmo/project.json` exists | Diagnose and resume from repository-owned workflow state. |
56
+ | Astro exists but Cosmo does not | Inventory first, then offer non-destructive adoption. |
57
+ | Empty except for `.git` | Collect the minimum project decisions and initialize a new site after confirmation. |
58
+ | Non-empty and unrelated | Ask for a child directory; never initialize over existing work. |
59
+
60
+ ## Existing Astro sites
61
+
62
+ After the user confirms adoption, the launcher uses:
63
+
64
+ ```bash
65
+ cosmo adopt . --brand "Brand" --site "https://example.com" --profile growth-site
66
+ ```
67
+
68
+ Adoption adds `.cosmo` governance and an agent guide. It does not replace `src`, `public`, Astro configuration, `package.json`, or dependencies. Existing `CLAUDE.md` and `AGENTS.md` files are preserved; Cosmo's corresponding guide is placed inside `.cosmo` when a filename is already occupied. The initial page plan and evidence ledger are deliberately empty so Claude must inventory the real site instead of importing starter assumptions.
69
+
70
+ ## Boundaries
71
+
72
+ The plugin does not require a license key, Cosmo account, hosted service, Sonic, or Lyra. It does not approve work, invent evidence, or bypass stage gates. Claude handles conversation and creative judgment while Cosmo's local files and deterministic checks remain the source of truth. Claude Design can still own independent visual exploration when the chosen profile and design mode call for it.
@@ -0,0 +1,62 @@
1
+ # Cosmo Content QA
2
+
3
+ Cosmo content QA is a transparent rule engine. It reports named findings and fixes; it does not manufacture a universal content score or claim to predict rankings.
4
+
5
+ Run it with:
6
+
7
+ ```bash
8
+ cosmo content check .
9
+ ```
10
+
11
+ The report is written to `.cosmo/reports/content-check.json`.
12
+
13
+ ## Blocking rules
14
+
15
+ Content QA blocks delivery for:
16
+
17
+ - Entity Canon, topic, archetype, indexability, intent, or query-pattern drift.
18
+ - Missing governed parent, related, or conversion links.
19
+ - Missing or unverified proof on an indexable page.
20
+ - Source or provenance drift from the evidence ledger.
21
+ - Project-owned banned vocabulary when configured as blocking.
22
+ - Manipulative CTA or persuasion phrases defined by project policy.
23
+ - Long duplicated passages across pages with distinct intents.
24
+ - Indexable commodity pages without verified proof.
25
+
26
+ ## Warnings
27
+
28
+ Warnings keep uncertain work visible without pretending it is publishable proof:
29
+
30
+ - Configured generic or interchangeable language.
31
+ - Pending proof on a `noindex` draft.
32
+ - A `noindex` commodity page awaiting differentiated substance.
33
+
34
+ ## Substance tiers
35
+
36
+ The report uses qualitative tiers:
37
+
38
+ - `commodity`: no verified carried proof.
39
+ - `premium`: verified proof exists, but it is documented or attributed rather than first-party differentiated substance.
40
+ - `noncommodity`: verified proof is tied to at least one explicit ownership mode: `measured`, `lived`, `originated`, `accessed`, `staked`, `first`, or `corrected`.
41
+
42
+ These tiers describe evidence ownership. They are not scores and do not predict traffic, conversion, or AI visibility.
43
+
44
+ ## Project policy
45
+
46
+ `.cosmo/policies/content-integrity.json` declares:
47
+
48
+ - Generic phrases that should trigger review.
49
+ - Manipulative phrases that block delivery.
50
+ - Whether voice-profile banned vocabulary blocks or warns.
51
+ - Whether indexable pages require verified proof.
52
+ - Whether duplicated long passages block delivery.
53
+
54
+ The policy is local, versioned, reviewable, and copied into new projects. Agents must not silently relax it to make a report pass.
55
+
56
+ ## Entity and voice safety
57
+
58
+ Every content entry carries the Entity Canon id, preventing text from another client or project from silently entering the build. Voice checks use the project-owned voice profile; Cosmo does not include public-person imitation modes or silently activate a tone.
59
+
60
+ ## Relationship to editorial review
61
+
62
+ The production pipeline's editorial report captures judgment about a specific draft. Content QA independently checks deterministic cross-page and project-wide contracts. Both must pass: one cannot substitute for the other.
@@ -0,0 +1,40 @@
1
+ # Delivery Readiness
2
+
3
+ Cosmo separates individual QA checks from the final decision to ship. `cosmo release check` evaluates the complete local project and writes:
4
+
5
+ - `.cosmo/reports/delivery-check.json` for tooling.
6
+ - `DELIVERY.md` for operators and receiving agents.
7
+
8
+ ## Required release state
9
+
10
+ A project is ready only when all of the following are true:
11
+
12
+ - The canonical production site URL and project identity no longer use starter placeholders.
13
+ - `DESIGN-DIRECTION.md` records an approved project-owned direction.
14
+ - The Build Plan is approved and at least one route is explicitly indexable.
15
+ - The workflow is complete, including every approval.
16
+ - Generation is complete for the approved inventory.
17
+ - Integrity, content, intelligence, static, and browser reports all pass.
18
+ - Every report is newer than the source and portable Cosmo inputs it validates.
19
+ - The intelligence report was produced for the currently selected packs.
20
+
21
+ The release ID is a portable hash of the project source and durable Cosmo inputs. Editing those inputs changes the release ID and makes older QA reports stale.
22
+
23
+ ## Release sequence
24
+
25
+ ```bash
26
+ npm run build
27
+ cosmo integrity check .
28
+ cosmo check . --no-build
29
+ cosmo content check .
30
+ cosmo intelligence check .
31
+ cosmo browser check . --no-build
32
+ cosmo release check .
33
+ cosmo release show .
34
+ ```
35
+
36
+ A blocked release still writes the manifest. Each finding includes a concrete repair, so the manifest doubles as the final punch list. Rerun the affected checks after any source change, then run the release check again.
37
+
38
+ ## Handoff
39
+
40
+ Run `cosmo handoff create` after release evaluation. The handoff records the current release ID and ready/blocked state and includes the delivery report in its QA inventory. A handoff does not override a blocked release.
@@ -0,0 +1,119 @@
1
+ # Preview and Deployment
2
+
3
+ Cosmo keeps deployment optional and provider-neutral at the project boundary. An Astro repository remains independently buildable, and credentials never belong in Cosmo configuration or history. Supported remote providers are Cloudflare Pages, SFTP, FTPS, and explicitly acknowledged plain FTP.
4
+
5
+ ## Local preview
6
+
7
+ ```bash
8
+ cosmo deploy local .
9
+ ```
10
+
11
+ This builds the project and starts Astro's production preview server on `127.0.0.1`. Pass `--no-build` only when `dist` is already current.
12
+
13
+ ## Cloudflare Pages
14
+
15
+ The first remote adapter uses Cloudflare Pages Direct Upload. Static Astro projects require no Cloudflare Astro adapter: Cosmo builds `dist` and invokes Wrangler's `pages deploy` command.
16
+
17
+ Configure the portable provider settings once:
18
+
19
+ ```bash
20
+ cosmo deploy configure cloudflare-pages . \
21
+ --project my-cloudflare-project \
22
+ --production-branch main
23
+ ```
24
+
25
+ The resulting `.cosmo/deploy/config.json` contains only provider, project, branch, and output settings. Authenticate separately with Wrangler or the `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` environment variables. Cosmo rejects credential-like fields in the config.
26
+
27
+ Deploy a review URL from any build state:
28
+
29
+ ```bash
30
+ cosmo deploy preview .
31
+ ```
32
+
33
+ Preview branches include the source-derived Cosmo release ID. A blocked release may be previewed so unfinished work can be reviewed; the deployment record retains `releaseReady: false`.
34
+
35
+ Deploy production only after the complete release sequence:
36
+
37
+ ```bash
38
+ cosmo release check .
39
+ cosmo deploy production .
40
+ ```
41
+
42
+ Production preflight requires the recorded delivery manifest and the current repository to both be READY with the exact same release ID. Source drift, stale QA, a missing manifest, or a blocked release stops the command before Wrangler is invoked.
43
+
44
+ ## SFTP, FTPS, and FTP hosts
45
+
46
+ SFTP is the preferred file-transfer provider. Configure the host and remote paths in portable project state while referring to credentials only by environment-variable name:
47
+
48
+ ```bash
49
+ cosmo deploy configure sftp . \
50
+ --host files.example.com \
51
+ --remote-dir /public_html \
52
+ --preview-remote-dir /preview
53
+ ```
54
+
55
+ The defaults are `COSMO_DEPLOY_USER`, `COSMO_DEPLOY_PASSWORD`, and `COSMO_DEPLOY_HOST_FINGERPRINT`. SFTP host-key verification is mandatory; use the server's OpenSSH `SHA256:...` fingerprint or SHA256 hex digest. Key authentication is also supported:
56
+
57
+ ```bash
58
+ cosmo deploy configure sftp . \
59
+ --host files.example.com \
60
+ --remote-dir /public_html \
61
+ --no-password \
62
+ --private-key-env COSMO_DEPLOY_PRIVATE_KEY \
63
+ --passphrase-env COSMO_DEPLOY_KEY_PASSPHRASE
64
+ ```
65
+
66
+ For FTPS, explicit TLS on port 21 is the default. Add `--implicit` for implicit TLS on port 990:
67
+
68
+ ```bash
69
+ cosmo deploy configure ftps . --host files.example.com --remote-dir /public_html
70
+ ```
71
+
72
+ Plain FTP sends credentials and content without transport encryption. Cosmo refuses to configure it unless the operator explicitly acknowledges that risk:
73
+
74
+ ```bash
75
+ cosmo deploy configure ftp . \
76
+ --host legacy.example.com \
77
+ --remote-dir /public_html \
78
+ --allow-insecure
79
+ ```
80
+
81
+ Copy `.env.example` to the already-gitignored `.env.deploy`, populate it locally, and supply it only when deploying:
82
+
83
+ ```bash
84
+ cosmo deploy preview . --env-file .env.deploy
85
+ cosmo deploy production . --env-file .env.deploy
86
+ ```
87
+
88
+ On macOS or Linux, restrict the credential file with `chmod 600 .env.deploy`.
89
+
90
+ Existing process environment variables override values from the env file. Cosmo parses credentials in memory and never writes their values to config, manifests, history, handoffs, or sanitized failure records.
91
+
92
+ File-transfer previews require a separate `--preview-remote-dir`; Cosmo will not treat the production directory as a preview target. Each successful attempt writes a SHA256 file manifest and subsequent attempts upload only new or changed output files. Remote deletion is never performed, so stale remote files must be removed deliberately outside the file-transfer adapter.
93
+
94
+ ## Durable records
95
+
96
+ ```bash
97
+ cosmo deploy status .
98
+ cosmo deploy history .
99
+ ```
100
+
101
+ `.cosmo/deploy/history.jsonl` records environment, target, release ID, readiness, status, timestamps, transfer counts, and the provider deployment ID or URL when available. File hashes live in `.cosmo/deploy/manifests/`. Provider failures are recorded with a generic safe error; raw terminal output is not persisted.
102
+
103
+ Successful production records are marked rollback-eligible. Cloudflare only permits rollback to a successful production deployment, not a preview. Cosmo preserves the release and provider identifiers needed to choose a target, while the rollback itself remains an explicit Cloudflare dashboard or API action in v1.3.
104
+
105
+ ## Provider boundary
106
+
107
+ Deployment execution is isolated behind configuration, preflight, execution, and history records. Cloudflare, SFTP, and FTP-family adapters all use the same release preflight. Cloudflare recommends Workers for many new projects; the Pages adapter intentionally serves Cosmo's static Direct Upload workflow. A Workers adapter can be added without making Cloudflare a runtime dependency.
108
+
109
+ Cloudflare Direct Upload projects cannot later be converted to Git integration. Choose Git integration directly in Cloudflare if that is the intended long-term deployment model.
110
+
111
+ Official references:
112
+
113
+ - [Cloudflare Pages Direct Upload](https://developers.cloudflare.com/pages/get-started/direct-upload/)
114
+ - [Wrangler Pages commands](https://developers.cloudflare.com/workers/wrangler/commands/pages/)
115
+ - [Astro deployment to Cloudflare](https://docs.astro.build/en/guides/deploy/cloudflare/)
116
+ - [Cloudflare Pages rollbacks](https://developers.cloudflare.com/pages/configuration/rollbacks/)
117
+ - [ssh2-sftp-client documentation](https://www.npmjs.com/package/ssh2-sftp-client)
118
+ - [basic-ftp documentation and FTP security advisory](https://www.npmjs.com/package/basic-ftp)
119
+ - [Node.js environment-file format](https://nodejs.org/api/environment_variables.html)
@@ -0,0 +1,54 @@
1
+ # First-Party Capability Library
2
+
3
+ Cosmo v1.5 includes generally useful website intelligence as maintained first-party functionality. Users do not need Lyra, Sonic, their source files, an account, or a separate import.
4
+
5
+ ## Built-in capability packs
6
+
7
+ | Pack | Artifact | Enforced behavior |
8
+ |---|---|---|
9
+ | `audience-intelligence` | `.cosmo/intelligence/artifacts/audience-intelligence.json` | Separates supplied, observed, inferred, and unknown audience knowledge; requires sources for factual states and a decision impact for persona detail. |
10
+ | `differentiation` | `.cosmo/intelligence/artifacts/differentiation.json` | Classifies commodity versus non-commodity claims, connects ownership verbs to verified proof, and records the evidence ceiling. |
11
+ | `search-intelligence` | `.cosmo/intelligence/artifacts/search-intelligence.json` | Preserves dated source attribution, treats fetched material as untrusted evidence, validates finding links, and keeps niche research ahead of localization. |
12
+ | `conversion` | `.cosmo/intelligence/artifacts/conversion-system.json` | Governs actions, trust proof, page mappings, forms, personal-data consent, mobile behavior, and analytics event ids without imposing a page layout. |
13
+ | `editorial-naturalness` | `.cosmo/intelligence/artifacts/editorial-naturalness.json` | Uses owned voice samples, explicit allowances, and contextual pattern clusters; reports for review and requires factual preservation. |
14
+ | `branded-language` | `.cosmo/intelligence/artifacts/branded-language.json` | Governs canonical terms, definitions, origins, approval state, and evidence for claims of original intellectual contribution. |
15
+
16
+ These complement the existing authority, local, editorial, regulated, research, image-direction, and Claude Design packs.
17
+
18
+ ## Profiles
19
+
20
+ - `growth-site`: audience, differentiation, conversion, editorial naturalness, and branded language.
21
+ - `search-authority`: audience, authority, differentiation, research, search/community intelligence, and editorial naturalness.
22
+ - `brand-led`: audience, differentiation, branded language, image direction, and Claude Design.
23
+ - `full-authority`: every built-in pack.
24
+
25
+ ```bash
26
+ cosmo init ./site --profile growth-site
27
+ cosmo intelligence scaffold ./site
28
+ cosmo intelligence guide brand ./site
29
+ cosmo intelligence guide plan ./site
30
+ cosmo intelligence check ./site
31
+ ```
32
+
33
+ `cosmo intelligence guide` exposes the selected first-party questions and Claude/Codex instructions at the current stage. Completed artifacts remain repository-owned and portable across agents.
34
+
35
+ ## Research workbench
36
+
37
+ The search-intelligence pack has a provider-neutral workbench with SERP, competitor, and community recipes. Claude, Codex, a browser, or another approved research provider can produce a source snapshot; Cosmo owns attribution, storage, hashing, and downstream validation.
38
+
39
+ ```bash
40
+ cosmo research init .
41
+ cosmo research capture community-august ./raw/community.txt . \
42
+ --kind community \
43
+ --location https://example.com/attributed-source \
44
+ --captured-at 2026-08-20
45
+ cosmo research check .
46
+ ```
47
+
48
+ Snapshots are copied to `.cosmo/research/snapshots/`, SHA256-bound to their source records, and cannot be replaced without `--replace`. Research text remains untrusted evidence and is never treated as agent instructions. The workbench requires niche-level synthesis before geographic localization.
49
+
50
+ ## First-party versus imported
51
+
52
+ Built-in packs are the supported delivery mechanism for generally useful Cosmo methodology. Importable packages remain available for private company methods, project-specific contracts, and third-party experiments. They are not required for standard Cosmo capabilities and cannot replace built-in pack ids.
53
+
54
+ Cosmo implements the portable principles natively. It does not copy or distribute private source libraries, named personality imitations, credentials, hosted-service dependencies, or unrelated marketing modules.