Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flat-ghost-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@anarchitecture/ghost": major
---

Flatten Ghost packages so manifest, facets, and checks live directly in the package directory, remove config.yml behavior, and use GHOST_PACKAGE_DIR for host-wrapper package discovery.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 10 additions & 16 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,22 @@ structural diffs, drift checks, comparison math, and handoff packets.
The canonical root `.ghost/` package follows:

```text
config.yml
fingerprint/
manifest.yml
intent.yml
inventory.yml
composition.yml
validate.yml
manifest.yml
intent.yml
inventory.yml
composition.yml
validate.yml
```

The three root facet files under `fingerprint/` are the core model:
The three root facet files are the core model:

- `intent.yml` for surface intent.
- `inventory.yml` for curated material, exemplars, and source links.
- `composition.yml` for experience patterns.

`validate.yml` validates output through deterministic checks; it is not
generation input.
`.ghost/config.yml` remains local adapter/routing config outside portable
context. Ordinary Git review is the approval boundary for fingerprint edits.
Ordinary Git review is the approval boundary for fingerprint edits.

Legacy `resources.yml`, `map.md`, `survey.json`, and `patterns.yml` may still
appear in older repos or as migration source material. They are not canonical
Expand All @@ -74,7 +71,7 @@ fingerprint input for new Ghost work.

| Command | Description |
| --- | --- |
| `ghost init` | Create `.ghost/fingerprint/` with manifest, facets, and deterministic checks. |
| `ghost init` | Create `.ghost/` with manifest, facets, and deterministic checks. |
| `ghost scan` | Report fingerprint contribution facets and BYOA next-step guidance. |
| `ghost signals` | Emit raw repo signals as JSON for fingerprint authoring. |
| `ghost lint` | Validate a fingerprint package or single artifact. |
Expand Down Expand Up @@ -129,16 +126,13 @@ One sentence, user-facing, present tense.
```

Use `patch` for fixes and docs, `minor` for new commands/flags/exports, and
`major` for removed or renamed public behavior. For this PR 81 package-shape
change, the source version stays `0.0.0` and the changeset is `minor` so the
first publish becomes `0.1.0`.
`major` for removed or renamed public behavior.

## Conventions

- Keep publishable runtime code self-contained in `packages/ghost`; no
`workspace:*` runtime dependencies in the packed public artifact.
- The canonical on-disk form is `.ghost/fingerprint/` plus optional
`.ghost/config.yml`.
- The canonical on-disk form is a flat `.ghost/` package.
- Direct `fingerprint.md` remains only for legacy/direct compare workflows.
- Skill recipes live in `packages/ghost/src/skill-bundle/references/`; install
them with `ghost skill install`.
Expand Down
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@ they generate UI and validate after they change it. The public package is
Agents can assemble components. What they need help preserving is the product
surface behind those components: hierarchy, density, restraint, behavior, copy,
accessibility, trust, and flow. Ghost keeps that surface composition in a
portable `.ghost/fingerprint/` package that ordinary Git review can approve.
portable `.ghost/` package that ordinary Git review can approve.

## The Shape

The canonical package is intentionally small:

```text
.ghost/
config.yml # optional local routing, not portable context
fingerprint/
manifest.yml # ghost.fingerprint-package/v1 anchor
intent.yml # surface intent
inventory.yml # curated material and exemplars
composition.yml # patterns, flows, states, and arrangements
validate.yml # optional deterministic gates
manifest.yml # ghost.fingerprint-package/v1 anchor
intent.yml # surface intent
inventory.yml # curated material and exemplars
composition.yml # patterns, flows, states, and arrangements
validate.yml # optional deterministic gates
```

A package can be sparse: it contributes whichever facets are locally true. Generation usually uses intent + inventory + composition:
Expand All @@ -41,13 +39,13 @@ what the surface is trying to preserve.

Older `resources.yml`, `map.md`, `survey.json`, `patterns.yml`, and direct
`fingerprint.yml` artifacts can still inform migration workflows, but new Ghost
work should target `.ghost/fingerprint/`.
work should target `.ghost/`.

## Project Status: Beta

> [!WARNING]
> Ghost is pre-1.0 and under active development. The CLI, fingerprint schema,
> on-disk `.ghost/fingerprint/` package shape, and public JavaScript exports may
> on-disk `.ghost/` package shape, and public JavaScript exports may
> change in breaking ways before a stable 1.0 release.
>
> Breaking changes may ship in minor versions while Ghost is pre-1.0. Patch
Expand Down Expand Up @@ -92,25 +90,26 @@ edits, and asks you to curate the claims.

```bash
ghost init
ghost init --package product-surface
ghost scan --format json
ghost signals .
ghost lint .ghost
ghost lint product-surface
ghost verify .ghost --root .
```

Use `--with-config`, `--reference`, or `--scope` only when the repo needs local
routing, reference libraries, or nested product areas.
Use `--reference` when a reference library should seed inventory, `--scope`
for nested product areas, or `--package <dir>` when initializing an exact
package directory such as `product-surface/`.
For monorepos, `ghost init --monorepo` creates or preserves the root package,
detects workspace child roots, and prints proposed `ghost init --scope ...`
commands by default. Run `ghost init --monorepo --apply` to create the detected
child packages. Host wrappers that need Ghost files somewhere other than
`.ghost` may set `GHOST_MEMORY_DIR=<relative-dir>` on the child `ghost` process,
or pass `--memory-dir <relative-dir>` explicitly. Explicit `init [dir]` and
`--memory-dir <relative-dir>` values win over the environment default.
`.ghost` may set `GHOST_PACKAGE_DIR=<relative-dir>` on the child `ghost`
process. Exact `--package <dir>` values win over the environment default.

Drafted fingerprint edits are just ordinary file changes until Git review
accepts them. Checked-in `fingerprint/` facet files are the Ghost source of
truth.
accepts them. Checked-in Ghost facet files are the Ghost source of truth.

## Generate From Ghost

Expand Down Expand Up @@ -159,7 +158,7 @@ context. It does not call an LLM.

| Command | Description |
| --- | --- |
| `ghost init` | Create `.ghost/fingerprint/` package facet files. |
| `ghost init` | Create `.ghost/` package facet files. |
| `ghost scan` | Report sparse fingerprint contribution facets. |
| `ghost lint` | Validate a fingerprint package or individual artifact. |
| `ghost verify` | Validate evidence paths, exemplar paths, and typed check refs. |
Expand Down Expand Up @@ -206,7 +205,7 @@ optional and only used by semantic embedding helpers when a host opts in.

| Resource | Description |
| --- | --- |
| [docs/fingerprint-format.md](./docs/fingerprint-format.md) | Portable `.ghost/fingerprint/` package format. |
| [docs/fingerprint-format.md](./docs/fingerprint-format.md) | Portable `.ghost/` package format. |
| [docs/generation-loop.md](./docs/generation-loop.md) | Brief, generate, check, review, and remediate loop. |
| [docs/language-fingerprints.md](./docs/language-fingerprints.md) | Voice and language capture through existing fingerprint facets. |
| [docs/host-adapters.md](./docs/host-adapters.md) | Adapter-neutral JSON, severity mapping, and custom fingerprint directories. |
Expand Down
3 changes: 1 addition & 2 deletions apps/docs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ export default function Home() {
<p className="thesis-item">Ghost keeps that model compact:</p>
<ul className="thesis-item list-disc space-y-2 pl-6">
<li>
<code>.ghost/fingerprint/</code> is the portable fingerprint
package
<code>.ghost/</code> is the default portable fingerprint package
</li>
<li>
<code>intent.yml</code>, <code>inventory.yml</code>, and{" "}
Expand Down
46 changes: 26 additions & 20 deletions apps/docs/src/content/docs/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Canonical Ghost fingerprints start here, with optional child packages for scoped
product areas:

```text
.ghost/fingerprint/manifest.yml
.ghost/fingerprint/intent.yml
.ghost/fingerprint/inventory.yml
.ghost/fingerprint/composition.yml
.ghost/fingerprint/validate.yml
apps/checkout/.ghost/fingerprint/manifest.yml
.ghost/manifest.yml
.ghost/intent.yml
.ghost/inventory.yml
.ghost/composition.yml
.ghost/validate.yml
apps/checkout/.ghost/manifest.yml
```

The command tables below are generated from the CLI source. Run
Expand All @@ -39,15 +39,14 @@ The command tables below are generated from the CLI source. Run

### Initialize - `init`

Create a `.ghost/fingerprint/` package with a manifest, raw facet files,
Create a `.ghost/` package with a manifest, raw facet files,
and deterministic checks. Use `--scope <path>` for nested package roots. Use
`--monorepo` to create or preserve the root package, detect workspace child
roots, and print scoped init commands; add `--apply` to create the detected
child packages. Use
`GHOST_MEMORY_DIR=<relative-dir>` only when a host wrapper stores Ghost package
`GHOST_PACKAGE_DIR=<relative-dir>` only when a host wrapper stores Ghost package
roots under a different safe relative directory; raw `ghost` defaults to
`.ghost`. Explicit `init [dir]` and `--memory-dir <relative-dir>` values win
over the environment default.
`.ghost`. Exact `--package <dir>` values win over the environment default.

<CliHelp tool="ghost" command="init" hideDescription />

Expand All @@ -56,13 +55,15 @@ ghost init
ghost init --monorepo
ghost init --monorepo --apply
ghost init --scope apps/checkout
GHOST_MEMORY_DIR=.agents/ghost ghost init
ghost init --scope apps/checkout --memory-dir .design/memory
ghost init --package product-surface
ghost init --package .design/custom-ghost
GHOST_PACKAGE_DIR=.agents/ghost ghost init
GHOST_PACKAGE_DIR=.design/memory ghost init --scope apps/checkout
```

### Contribution facets - `scan`

Report whether `fingerprint/manifest.yml` is present and which sparse facets
Report whether `manifest.yml` is present and which sparse facets
this package contributes: `intent`, `inventory`, `composition`, and `validate`.
Raw repo signals do not count toward inventory contribution.

Expand All @@ -71,8 +72,8 @@ Raw repo signals do not count toward inventory contribution.
```bash
ghost scan
ghost scan --format json
GHOST_MEMORY_DIR=.agents/ghost ghost scan --format json
ghost scan --include-nested --memory-dir .design/memory --format json
GHOST_PACKAGE_DIR=.agents/ghost ghost scan --format json
GHOST_PACKAGE_DIR=.design/memory ghost scan --include-nested --format json
```

### Stack inspection - `stack`
Expand Down Expand Up @@ -109,21 +110,21 @@ Validate a root `.ghost` fingerprint package or an individual split artifact.

```bash
ghost lint
ghost lint .ghost/fingerprint/intent.yml
ghost lint .ghost/fingerprint/validate.yml --format json
ghost lint .ghost/intent.yml
ghost lint .ghost/validate.yml --format json
ghost lint --all
```

### Package fidelity - `verify`

Validate fingerprint evidence and exemplar paths, typed check refs, optional
rationale files, and config references.
Validate fingerprint evidence and exemplar paths, typed check refs, and
optional rationale files.

<CliHelp tool="ghost" command="verify" hideDescription />

```bash
ghost verify .ghost --root .
ghost verify --all --memory-dir .design/memory
GHOST_PACKAGE_DIR=.design/memory ghost verify --all
```

### Reusable Review Command - `emit`
Expand All @@ -142,6 +143,11 @@ and gaps.

<CliHelp tool="ghost" command="relay" hideDescription />

```bash
ghost relay gather apps/checkout/review/page.tsx
ghost relay gather apps/checkout/review/page.tsx --package product-surface --format json
```

### Inspection - `describe`

Print a markdown section map.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/fingerprint-authoring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ ghost verify --all
<DocSection title="Ratification">

Uncommitted or unmerged fingerprint edits are drafts. Checked-in
`fingerprint/` core files are canonical.
Ghost package facet files are canonical.

Add deterministic checks sparingly, and only when a rule can be enforced
deterministically.
Expand Down
20 changes: 8 additions & 12 deletions apps/docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,18 @@ The canonical portable fingerprint is a folder:

```text
.ghost/
config.yml
fingerprint/
manifest.yml
intent.yml
inventory.yml
composition.yml
validate.yml
manifest.yml
intent.yml
inventory.yml
composition.yml
validate.yml
```

Generation starts from `intent.yml`, `inventory.yml`, and `composition.yml`.
`validate.yml` checks validate the result afterward; they are not generation input.
`.ghost/config.yml` stays outside the portable package because it is local
routing config.

Nested product areas can add child package roots such as
`apps/checkout/.ghost/fingerprint/`. Ghost resolves fingerprint stacks
`apps/checkout/.ghost/`. Ghost resolves fingerprint stacks
root-to-leaf for the file or diff being reviewed.

</DocSection>
Expand All @@ -42,7 +38,7 @@ root-to-leaf for the file or diff being reviewed.
<Callout variant="warning" title="Beta / pre-1.0">

Ghost is pre-1.0 and under active development. The CLI, fingerprint schema,
on-disk `.ghost/fingerprint/` package shape, and public JavaScript exports may
on-disk `.ghost/` package shape, and public JavaScript exports may
change in breaking ways before a stable 1.0 release.

Breaking changes may ship in minor versions while Ghost is pre-1.0. Patch
Expand Down Expand Up @@ -153,7 +149,7 @@ ghost track new-tracked.fingerprint.md
ghost diverge typography --reason "Editorial product uses a different type scale"
```

Package comparison uses canonical `.ghost/fingerprint/` packages. `ack`,
Package comparison uses canonical `.ghost/` packages. `ack`,
`track`, and `diverge` record stance for compatibility drift workflows that
track direct fingerprint markdown references.

Expand Down
Loading
Loading