# Repository planning conventions

Use these conventions when creating, updating or auditing project plans. They
do not require a numbered project for every small code change. Preserve the
user's requested scope and the repository's other instructions.

## Layout

`planning/` at the repository root is the Obsidian vault itself.

```text
planning/
  Boards/
    NN. Project Name.md
    NN. Project Name notes.md
  projects/
    NN. Project Name/
      Research.md
      Planning.md
      decisions.md
      NN.0 Project Name — Foundation.md
      NN.1 Project Name — Phase Title.md
  requirements/
    topic.md
  requirements.md
  Manual verification.md
```

One project has one board. `Boards/` is flat and contains boards and their
notes; research, decisions and phase cards belong in the numbered project
folder. A board's note, `NN. Project Name notes.md` beside it, holds the prose a
Kanban board cannot: text outside a lane is discarded by the plugin and text
inside one becomes a card, so a client that shows a list's description reads it
from this file. Project
folders stay in `projects/` when their status changes, including completion.
Do not rename completed phase files or add completion markers to filenames.

Project numbers form one sequence, starting at 1. Inspect existing project
folders and boards before choosing the next unused number. Preserve existing
numbers. Number phases from 0; phase 0 establishes the prerequisites needed by
the later work. Use an em dash with spaces in phase filenames: ` — `.

Wikilinks use paths relative to the vault root, without `.md`:

```text
[[Boards/NN. Project Name]]
[[projects/NN. Project Name/Planning|Planning]]
[[projects/NN. Project Name/NN.0 Project Name — Foundation|NN.0 Foundation]]
```

Existing documents outside the vault stay where they are. Research links to
them using relative Markdown links rather than copying their contents.

## Documents

Every project has these three files:

- **Research.md** has `project: "NN. Project Name"` and
  `status: research complete` in frontmatter once the research is complete.
  Describe the problem, current implementation, constraints, limitations and
  open questions. Anchor findings to real code paths; distinguish findings from
  assumptions.
- **Planning.md** has `project: "NN. Project Name"` and the project's `status:`.
  Include a goal, a `## Phases` list linking every phase with a one-line
  description, design principles and non-goals. Put implementation steps in the
  phase cards, not here.
- **decisions.md** has `project: "NN. Project Name"`. Append an entry whenever
  direction changes: `## YYYY-MM-DD — Decision title`, followed by Decision,
  Reason, Alternatives and Impact. Keep old entries; record corrections and
  superseding decisions as new entries.

A phase card begins with:

```yaml
---
phase: "NN.0"
project: "NN. Project Name"
status: pending
---
```

The body contains its full title, Kanban and Planning back-links, then
`## Goal`, `## Context`, `## Files`, `## Tasks` and `## Done Criteria`. Context
names dependencies. Files names concrete paths. Tasks is a numbered list of
implementation steps. Done Criteria gives observable exit conditions and
appropriate validation. Record performed checks and their results in
`## Evidence`; do not invent results or describe an unrun check as passing.

Phase statuses are `pending`, `in progress`, `done` and `deferred`. Deferred
phases include the condition for resuming them. A document without actionable
work uses `status: documentation`, has no `phase:` property, and gets no card.

## Human verification

When acceptance requires a person to operate the software or judge its result,
add this to the phase's frontmatter:

```yaml
verification: manual
verification_kind:
  - app
```

Kinds are `app` (manual interaction), `install` (packaged build or upgrade),
`platform` (a specific device or environment), `visual` (judging rendering),
`live-data` (real integrations or accounts) and `users` (acceptance with people).
Choose all that apply. The marker describes required acceptance, not whether
the implementation was written by hand.

Add `## Test Steps` with one independently confirmable outcome per case:

```markdown
- [ ] **[NN.0-TC01] Short title**

  - Prerequisites and test data: concrete setup and inputs.
  - Actions: repeatable steps for the person running the check.
  - Expected result: observable behavior and the pass condition.
  - Actual result:
  - Verified by and date:
```

Leave actual results and verifier blank until someone runs the case. Done
Criteria requires every case to pass, plus any automated checks that apply.
A manual gate cannot close on automated evidence alone. If implementation is
unfinished, say so in Tasks; do not describe the project as awaiting only
verification.

`Manual verification.md` is an index of unfinished manual phases, with links,
kinds and whether each is ready to run or still needs implementation. Test
instructions and results stay in the phase files.

## Boards and reconciliation

No special synchronization tool is included. Maintain board files from phase
files using these rules, whether editing directly or writing a small local
helper. Do not assume a command exists just because another repository uses it.

The board frontmatter contains:

```yaml
---
kanban-plugin: board
project: "NN. Project Name"
status: planned
phases: "0/2"
docs:
  - "[[projects/NN. Project Name/Research|Research]]"
  - "[[projects/NN. Project Name/Planning|Planning]]"
  - "[[projects/NN. Project Name/decisions|decisions]]"
notes: "[[Boards/NN. Project Name notes|notes]]"
---
```

`notes:` points at the board's note. Write the pointer rather than relying on
the file's name: a board renamed in Obsidian would otherwise leave its note
named after something that no longer exists. Keep the note's filename in step
with the board when either is renamed.

Each real phase has exactly one card:

```markdown
## phases

- [ ] [[projects/NN. Project Name/NN.0 Project Name — Foundation|NN.0 Foundation]]

## completed
```

Use `## phases` for pending and in-progress work, `## completed` for done work
with `[x]`, and `## deferred` for deferred phases with `[ ]`. Always keep phases
and completed. Use a `## testing` lane for remaining manual gates only when
the entire project has no implementation or automated validation left.

For each reconciliation:

1. Read phase files and existing board cards before writing anything. Report
   duplicate phase numbers, malformed frontmatter and missing link targets.
   Do not silently remove a missing-file card or count an unreadable phase as
   completed. Resolve the affected project's ambiguity before declaring it done.
2. Treat the phase's status and recorded evidence as authoritative. A board
   checkbox change requests reconciliation: inspect its intent and evidence,
   then update the phase if warranted. Do not infer manual sign-off from a board
   tick. Report any completion request that lacks the required proof.
3. Keep cards already in their correct lane in their existing relative order.
   Append moved cards to the destination lane in their previous board order.
   Append newly discovered cards after them in numeric phase order. Preserve
   card annotations, unrelated frontmatter and Kanban settings.
4. Count done phases over all non-deferred phases. Documentation is excluded
   from both numbers. Derive project status as follows: `done` when the total
   is greater than zero and all counted phases are done; `testing` when at least
   one phase is done and all remaining counted work is ready for human checks;
   `started` when work has begun; otherwise `planned`. A project consisting
   entirely of deferred phases is `deferred`, not complete. Preserve a
   deliberately parked `deferred` or superseded `archived` project until the
   user resumes or changes it.
5. Write the same project status to the board and Planning.md. Refresh the
   phase links and manual verification index. Review the diff and confirm that
   another reconciliation would make no further changes.

## Completion and requirements

Completed means implemented and validated against the phase's criteria. Inspect
real code and relevant checks; the presence of a function name is not proof of
its behavior. Review decisions and documentation for stale claims, and append
the coherence result to decisions.md when a project completes.

`requirements/<topic>.md` describes current, confirmable behavior in present
tense, with `status: current` and `topic:` frontmatter. Link each behavior to
the relevant project's decisions. Update an existing description rather than
duplicating it. `requirements.md` is a Kanban index with one card per topic
linking to its requirements document; it is not a project completion log.

Use the `obsidian-plan` skill for research and phase planning and
`obsidian-prune` for an audit. Those skill folders each contain `SKILL.md`.
Neither workflow implies a commit, push, deployment or change to an external
account; follow the user's requested workflow for those actions.
