Workflow · AI agents
Start AI agents with the project context they need.
Nift keeps its project model small and inspectable. nift init --handover makes that model explicit from the first command by placing the canonical HANDOVER.md in the project root for an agent — or a human — to read before changing the site.
nift init --handover.It creates the normal Nift project and writes HANDOVER.md at the project root, never in generated output. The handover is created as part of the scaffold before the initial build, so it is still present if that first build fails.
Try the agent-first workflow
You can test the whole idea without learning Nift's template language first:
Create the project with context
nift init --handoverOpen the project in your coding agent
Ask it to read HANDOVER.md before making changes. The file explains the Nift-specific part of the project and the workflow the agent should preserve.
Describe the site
You do not need elaborate prompt engineering. For example:
Build me a small personal website with a homepage, about page and projects page. Use Nift properly and follow HANDOVER.md. Build the project and fix any Nift errors before you finish.
This is deliberately an onboarding experiment, not a requirement to use AI with Nift. You can inspect what the agent produced, see the content/template relationship in a real project, and continue manually at any point.
Initialize a project for an AI agent
nift init --handover The flag composes with Nift's other named init options, and compatible named options are order-independent:
nift init --target=vercel --handover
nift init --handover --ext=.php Plain nift init remains the normal scaffold without a handover. Use --handover when you want the project to carry Nift-aware working context from the beginning.
For an existing project
You can fetch the same canonical file directly:
curl -fsSL https://nift.dev/HANDOVER.md -o HANDOVER.md nift init --handover and the download produce the same canonical HANDOVER.md, byte for byte. If the project already has a HANDOVER.md containing project-specific additions, download the canonical copy separately and merge or reapply those additions instead of blindly overwriting the existing file.
HANDOVER.md
Download the current canonical handover directly, or read the exact same file below.
What the handover gives an agent
A starting inspection path
Read .nift/config.json, .nift/tracked.json, the project structure and existing project documentation before making substantial changes.
The small Nift model
Understand @content, @input(...) and @path(...) first, then reach for advanced features only when the project actually needs them.
Boundaries
Keep ordinary HTML, CSS, JavaScript, frameworks and backend technologies doing their own jobs rather than inventing Nift-specific replacements.
A verification loop
Run nift build frequently and use nift status to inspect what Nift considers stale and why.
The handover does not make an agent infallible. It gives the agent explicit, checked and bounded project guidance, then points it back to the real build, tracked state and documentation for verification.
Use Nift's inspectable state instead of guessing
An agent can run nift status to see rebuild causes and use Nift's info* commands as JSON when output is piped. That lets an agent inspect the project through Nift itself without requiring a separate plugin, hosted API or agent-specific runtime.
read HANDOVER.md
↓
inspect config + tracked state
↓
make a bounded change
↓
nift build
↓
nift status + project tests
↓
review generated output / evidence Add project-specific context only when it helps
HANDOVER.md explains Nift. A small project-specific file such as ai-context.txt can optionally explain this project: its purpose, design direction and constraints that are not obvious from the repository itself. It should not re-teach Nift.
This site is for an independent architecture studio.
Visual direction:
- restrained editorial layout
- warm neutrals
- no gradients
- mobile-first
Project constraints:
- preserve the existing Go backend
- keep ordinary assets directly under public/assets/
- do not replace the vanilla JavaScript
- use @path for new internal links Then describe the result you actually want
Read HANDOVER.md and inspect this project before making changes.
Turn the existing Nift project into a polished website for an independent architecture
studio. Create the pages, shared templates/partials, CSS and JavaScript you think are
appropriate. Keep the site responsive and accessible, preserve the existing project
architecture, and verify the result with the project's real build and tests. The same workflow works for documentation, product sites, portfolios, application frontends and larger repositories where Nift is only one build-time layer among several tools.
Human-directed agentic engineering
For substantial work, treat the agent as an implementation and verification partner rather than the product authority. Humans define intent and boundaries; agents inspect, implement, build, test and return evidence; humans review the result and decide the next direction.
Nift suits that workflow because its project state is inspectable and its feedback loop is fast. Checked paths, dependencies, contracts and build failures can turn assumptions into evidence instead of leaving them as prompt instructions alone. Read how Nift itself is developed with this approach →
The canonical HANDOVER.md
The full file is available here for reference and is mechanically checked against the downloadable /HANDOVER.md; the two copies are required to remain byte-identical.
Read the full HANDOVER.md
The canonical HANDOVER.md
# HANDOVER.md
v0.0.8
This is a living handover for working effectively in a Nift project.
Canonical version:
https://nift.dev/HANDOVER.md
Check the version at the top of this file against the canonical copy when the
project is old, unfamiliar, or behaving differently from the current Nift
documentation.
To replace this file with the latest canonical version:
```sh
curl -fsSL https://nift.dev/HANDOVER.md -o HANDOVER.md
```
If this project has project-specific additions, preserve or reapply them when
updating the canonical handover.
This project uses Nift as part of its website build process.
Nift is the project's build-time templating and dependency layer. It does not determine what the website is about or what other technologies the project should use.
Keep the existing project architecture and use the project's normal HTML, CSS, JavaScript, frameworks, backend, and other tooling where appropriate.
Do not introduce Nift-specific machinery where ordinary web tooling is the clearer solution.
## Start here
Before making substantial changes:
1. Inspect `.nift/config.json` and `.nift/tracked.json`.
2. Inspect the existing `content/`, `templates/`, and output structure.
3. Read this project's `README.md` and other project-specific documentation.
4. Run:
```sh
nift status
```
During normal development, build frequently:
```sh
nift build
```
Use this throughout a task, not only at the end. Rebuild after meaningful
changes so Nift can surface template, path, dependency, configuration, and
tracking errors while the cause is still obvious.
In particular, run `nift build` immediately after editing
`.nift/config.json` or `.nift/tracked.json`.
Use:
```sh
nift status
```
when you want to inspect what Nift considers stale and why.
Successful `nift build` output may include indented `↳ ...` lines explaining
why a page was considered stale and rebuilt, such as a missing generated output
or a changed dependency. These are rebuild reasons, not errors. Actual build
failures are reported as errors and cause the build to fail.
Do not delete or recreate `.nift/`.
## Nift's core template model
Most Nift websites need very little Nift-specific syntax.
The three primitives you will use most often are:
```text
@content
@input(...)
@path(...)
```
`@content` inserts the tracked page's content into its template.
```html
<main>
@content
</main>
```
`@content` should execute exactly once across the rendered template/input graph
for a tracked page. It is normally placed in the page's template; the tracked
content file supplies the content inserted there.
Content files may still use other Nift syntax when needed. If page text needs
to display Nift syntax literally, prefix the active sigil with `\` rather than
leaving it as template syntax:
```html
<code>\@content</code>
<code>\@path('about')</code>
<code>\$[title]</code>
```
This applies whenever `@...`, `$[...]`, or other Nift syntax is intended as
literal output rather than something Nift should execute or resolve.
`@input(...)` inserts a reusable file and automatically makes it a dependency of the output using it.
```html
@input('templates/header.html')
<main>
@content
</main>
@input('templates/footer.html')
```
### Structured JSON and markup sources
Use name-first `@json` when a template needs immutable structured data:
```text
@json(name, path)
@json(name, schema-path, path)
@json(name, schema-name, path)
@json(name){...}
@json(name, schema-path){...}
@json(name, schema-name){...}
```
Inline bodies are evaluated as Nift templates before JSON parsing. A schema
name refers to an earlier JSON binding. Data and schema files are automatic
dependencies and paths must stay inside the project.
Use `@markup(format){...}` or `@markup(format, path)` for Markdown (`md`),
AsciiDoc (`adoc`) or reStructuredText (`rst`). Nift evaluates template syntax in
the source first, Markup++ converts it once, and the resulting HTML is appended
without being parsed as Nift syntax again. File sources and host-resolved
AsciiDoc/RST includes are automatic dependencies.
`@path(...)` creates project-aware links to tracked pages and local assets.
Nift has additional features including metadata, JSON data, loops, conditionals, pagination, contracts, and explicit dependencies. Use them when the project actually needs them; do not use advanced features merely because they exist.
When writing expressions inside constructs such as `@if(...)`, refer to values directly rather than wrapping them in `$[...]`. For example:
```html
@if(name == 'about'){...}
```
Use `$[...]` when resolving or rendering a value into output, for example `$[title]`. Consult the expressions and control-flow documentation when using more advanced expression syntax.
## Internal links: use `@path`
Use `@path(...)` for internal links.
This applies to:
- links between pages;
- stylesheets;
- JavaScript;
- images and other local assets where Nift should know the relationship.
For pages, link to the **tracked page name**, not its generated file.
```html
<nav>
<a href="@path('/')">Home</a>
<a href="@path('about')">About</a>
<a href="@path('docs')">Docs</a>
<a href="@path('contact')">Contact</a>
</nav>
```
Do this:
```html
<a href="@path('about')">About</a>
```
Do not do this:
```html
<a href="@path('about.html')">About</a>
```
and do not hard-code the generated output path:
```html
<a href="about.html">About</a>
```
The tracked page name is the stable project identity. Its output filename or location may change independently.
CSS and JavaScript includes should also use `@path(...)`:
```html
<link rel="stylesheet" href="@path('public/assets/style.css')">
<script src="@path('public/assets/app.js')"></script>
```
Do not calculate relative paths such as:
```html
<link rel="stylesheet" href="../../assets/style.css">
```
Using `@path` lets Nift resolve the correct output-relative path and check the project relationship during the build.
## Project configuration
`.nift/config.json` contains project-level Nift configuration.
`.nift/tracked.json` describes tracked pages and their metadata, including things such as their content, template, and output relationships.
By default, ordinary CSS, JavaScript, images, fonts and other static assets live
directly in the configured output tree (normally `public/`) and do not have
entries in `.nift/tracked.json`. Edit those files in place. This keeps Nift's
tracked graph focused on content that Nift actually renders and avoids duplicate
source/output copies for files that need no build-time transformation.
Track an asset only when Nift genuinely needs to generate it from content,
templates or build-time data. Template-less tracked entries remain available for
that advanced case; they are not the default asset workflow.
These files are part of the project and should evolve with its structure.
If you add, remove, or reorganise pages, templates, outputs, deployment settings, or other Nift-managed structure, inspect the relevant `.nift` configuration and update it where necessary.
Do not treat `.nift/` as disposable generated state.
Do not invent `.nift/tracked.json` fields or assume arbitrary fields become
`$[...]` metadata. When you need tracking behaviour or metadata that is not
already demonstrated by the project, consult the tracked-files and metadata
documentation rather than guessing.
## Output directory
Do not assume the generated website always lives in `public/`.
A normal Nift project may use `public/`, but deployment targets can use a different output structure appropriate to the platform.
Inspect `.nift/config.json` before making assumptions about output paths.
Edit Nift-managed page sources rather than their generated output. Edit untracked
static assets directly in the configured output tree, unless the project
documents another tool or source directory as their owner.
## Pagination
Pagination has several related pieces across `.nift/tracked.json`, page
content, pagination templates, and generated page links. Do not infer its full
behaviour from this handover.
If working with pagination, read the dedicated documentation first:
https://nift.dev/docs/pagination.html
Preserve the project's existing pagination structure unless the task actually
requires changing it, and run `nift build` frequently while doing so.
## Other stacks and tools
Nift does not need to own the whole application.
A project may use Nift alongside tools such as Vite, React, Vue, Svelte, TypeScript, Go, Node, Python, PHP, serverless functions, or other systems.
Keep responsibilities separated:
- use Nift for build-time composition, tracked relationships, and dependencies;
- use the neighbouring tool for the job it is designed to do.
Do not replace an existing stack with Nift-specific code simply to make more of the project use Nift.
## Before finishing
Run:
```sh
nift build
nift status
```
The build should succeed and `nift status` should report the project up to date.
Spot-check generated output when changes affect paths, templates, tracked
relationships, or deployment structure.
## Documentation
Nift documentation:
https://nift.dev/docs.html
When unfamiliar with the project, prioritise:
1. Getting started — https://nift.dev/docs/getting-started.html
2. the three-primitives/template-language material;
3. paths and tracked files, especially `@path`;
4. project structure;
5. `.nift/config.json` and `.nift/tracked.json`;
6. incremental builds and CLI commands.
Then read feature documentation only when the task requires it, for example:
- JSON and control flow;
- pagination;
- contracts;
- minification;
- deployment targets;
- integration with other application stacks.
Prefer documented Nift behaviour and the existing project structure over guessing based on another website generator or framework.
Nift does not need an MCP server or agent-specific project format to be useful with agents. The useful properties are the same ones humans benefit from: a small mental model, ordinary files, inspectable state, fast feedback and dependable checked relationships.