gitifact 0.7.0 → 0.8.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.
- package/README.md +72 -43
- package/dist/THIRD_PARTY_NOTICES.txt +213 -0
- package/dist/browser/assets/Grid-BrUBBmhu.js +1 -0
- package/dist/browser/assets/HgiRefresh-DVzwwzGM.js +1 -0
- package/dist/browser/assets/{Markdown-DKZFXPE0.js → Markdown-K4Mne1wf.js} +3 -3
- package/dist/browser/assets/MetadataListItem-C3SqHyk0.js +1 -0
- package/dist/browser/assets/PretendardVariable-CJuje-Rk.woff2 +0 -0
- package/dist/browser/assets/Selector-DuT8AsMB.js +2 -0
- package/dist/browser/assets/{Table-DykMjEgT.js → Table-8qCDrsKI.js} +2 -2
- package/dist/browser/assets/Token-Dmavo-NE.js +1 -0
- package/dist/browser/assets/about-B8tYN8_7.js +3 -0
- package/dist/browser/assets/activity-CiuGYDQ8.jpg +0 -0
- package/dist/browser/assets/activity-timeline-CiFzANgu.css +1 -0
- package/dist/browser/assets/activity-timeline-USDjdupU.js +2 -0
- package/dist/browser/assets/changelog-BwEMGKor.js +2 -0
- package/dist/browser/assets/commit-45NumYDT.css +1 -0
- package/dist/browser/assets/commit-C0G_pkoH.js +4 -0
- package/dist/browser/assets/contributors-CPdOQKMF.css +1 -0
- package/dist/browser/assets/contributors-FNt-eYzY.js +1 -0
- package/dist/browser/assets/contributors._email-CW4qlA9y.js +1 -0
- package/dist/browser/assets/contributors.index-BMT_fvWV.js +1 -0
- package/dist/browser/assets/dashboard-CMSj2wu3.css +1 -0
- package/dist/browser/assets/dashboard.index-IeAMhDp4.js +1 -0
- package/dist/browser/assets/document-BbpOg7j8.js +1 -0
- package/dist/browser/assets/document-D4osdtS6.js +19 -0
- package/dist/browser/assets/document-DpkFXhPm.css +1 -0
- package/dist/browser/assets/document-Drgtj94X.css +1 -0
- package/dist/browser/assets/feature-requirements-CA8f9Bcf.jpg +0 -0
- package/dist/browser/assets/features-D91CUmI3.css +1 -0
- package/dist/browser/assets/features-DUe_HTbz.js +4 -0
- package/dist/browser/assets/features._featureId-CPuJxCrI.js +1 -0
- package/dist/browser/assets/features.index-BqKMq6DZ.js +1 -0
- package/dist/browser/assets/getting-started-DG-Skl34.js +1 -0
- package/dist/browser/assets/getting-started-DQwukRnd.css +1 -0
- package/dist/browser/assets/git-B2XLYoEb.js +1 -0
- package/dist/browser/assets/git-D_wcK2vC.css +1 -0
- package/dist/browser/assets/{gitifact-logo-DPewkDQ4.svg → gitifact-logo-B5c-L14Z.svg} +5 -5
- package/dist/browser/assets/index-BER0M7UG.css +1 -0
- package/dist/browser/assets/index-BoqBsl1i.js +48 -0
- package/dist/browser/assets/instructions-CX6doP-p.css +1 -0
- package/dist/browser/assets/instructions-CmMSgO5v.js +1 -0
- package/dist/browser/assets/instructions._instructionId-Biq4h3Db.js +1 -0
- package/dist/browser/assets/instructions.agents-C1LXUm7K.js +1 -0
- package/dist/browser/assets/instructions.index-DCiLsKxg.js +1 -0
- package/dist/browser/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/browser/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/browser/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/browser/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/browser/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/browser/assets/lazyRouteComponent-Dbwmw-_u.js +1 -0
- package/dist/browser/assets/page-header-PYFVxi9j.js +1 -0
- package/dist/browser/assets/page-header-atX8Nsmd.css +1 -0
- package/dist/browser/assets/project-instructions-DsWrw-nY.jpg +0 -0
- package/dist/browser/assets/records-CiGcLzEi.css +1 -0
- package/dist/browser/assets/records-page-BSx-Bxmm.css +1 -0
- package/dist/browser/assets/records-page-D8qxMJNY.js +1 -0
- package/dist/browser/assets/records._recordId-B6sdT5ro.js +1 -0
- package/dist/browser/assets/records.commits._commit-goSqW9tl.js +1 -0
- package/dist/browser/assets/records.index-CxubA4G5.js +1 -0
- package/dist/browser/assets/related-list-CU-kUhYj.js +2 -0
- package/dist/browser/assets/related-list-Rp3yvN_G.css +1 -0
- package/dist/browser/assets/request-state-rD3dhp0I.js +1 -0
- package/dist/browser/assets/search-BCYi0CBz.js +1 -0
- package/dist/browser/assets/search-palette-C-XxJJ6I.js +561 -0
- package/dist/browser/assets/{page-header-ClRsIf4A.css → search-palette-DpmGOAIg.css} +1 -1
- package/dist/browser/assets/settings-BdZ_rM9V.js +1 -0
- package/dist/browser/assets/useCollapsible-D7UZAUy-.js +1 -0
- package/dist/browser/assets/useInfiniteQuery-Cs8d91AB.js +1 -0
- package/dist/browser/assets/useKeyboardHint-CuvkDYsZ.js +1 -0
- package/dist/browser/favicon.svg +5 -5
- package/dist/browser/gitifact-logo.svg +4 -4
- package/dist/browser/index.html +14 -14
- package/dist/browser/licenses/jetbrains-mono.txt +93 -0
- package/dist/browser/licenses/pretendard.txt +94 -0
- package/dist/i18n/en/block.md +20 -20
- package/dist/i18n/en/changelog.md +35 -0
- package/dist/i18n/en/docs/commit.md +23 -22
- package/dist/i18n/en/docs/design.md +45 -26
- package/dist/i18n/en/docs/instructions.md +81 -0
- package/dist/i18n/en/docs/migrate.md +139 -0
- package/dist/i18n/en/docs/records.md +82 -0
- package/dist/i18n/en/docs/spec.md +68 -31
- package/dist/i18n/en/docs/workflow.md +28 -16
- package/dist/i18n/en/docs/writing.md +46 -15
- package/dist/i18n/ko/block.md +20 -20
- package/dist/i18n/ko/changelog.md +200 -165
- package/dist/i18n/ko/docs/commit.md +21 -20
- package/dist/i18n/ko/docs/design.md +44 -25
- package/dist/i18n/ko/docs/instructions.md +81 -0
- package/dist/i18n/ko/docs/migrate.md +139 -0
- package/dist/i18n/ko/docs/records.md +82 -0
- package/dist/i18n/ko/docs/spec.md +66 -29
- package/dist/i18n/ko/docs/workflow.md +28 -16
- package/dist/i18n/ko/docs/writing.md +46 -15
- package/dist/main.js +4461 -3077
- package/package.json +1 -1
- package/dist/browser/assets/Grid-D1SNqxih.js +0 -1
- package/dist/browser/assets/MetadataListItem-BHqMTUIy.js +0 -1
- package/dist/browser/assets/about-CwpTU41C.js +0 -3
- package/dist/browser/assets/activity-DJ808sVo.js +0 -1
- package/dist/browser/assets/activity-DRgs2s8a.jpg +0 -0
- package/dist/browser/assets/changelog-DWK3Qw5N.js +0 -2
- package/dist/browser/assets/contributors._email-Bu46gkJ8.js +0 -1
- package/dist/browser/assets/contributors.index-DGAkSUmH.js +0 -1
- package/dist/browser/assets/document-CUHZSDYL.js +0 -11
- package/dist/browser/assets/document-ChObsStB.css +0 -1
- package/dist/browser/assets/feature-requirements-Ci6Hez1P.jpg +0 -0
- package/dist/browser/assets/features._featureId-CZ1QE69X.js +0 -1
- package/dist/browser/assets/features.index-C0Ecj5SM.js +0 -1
- package/dist/browser/assets/getting-started-7e77o6gE.css +0 -1
- package/dist/browser/assets/getting-started-Bo0MbK7i.js +0 -1
- package/dist/browser/assets/git-C77vcInF.js +0 -1
- package/dist/browser/assets/git-DF8OMSPX.css +0 -1
- package/dist/browser/assets/index-CgDfX0u7.js +0 -48
- package/dist/browser/assets/index-DJrBgKkG.css +0 -1
- package/dist/browser/assets/page-header-DcMV32eV.js +0 -505
- package/dist/browser/assets/product-BSEt07YP.css +0 -1
- package/dist/browser/assets/product-CN8SmBrX.js +0 -10
- package/dist/browser/assets/product.index-C_eXOx4v.js +0 -1
- package/dist/browser/assets/project-wiki-BBWDVTfk.jpg +0 -0
- package/dist/browser/assets/request-state-H0vXVi6T.js +0 -1
- package/dist/browser/assets/requirements-jd-dp9SQ.js +0 -1
- package/dist/browser/assets/settings-CCOYFeaM.js +0 -1
- package/dist/browser/assets/wiki-DZmdT1pI.js +0 -1
- package/dist/browser/assets/wiki._documentId-DJ7LAi8J.js +0 -1
- package/dist/browser/assets/wiki.index-DJ7LAi8J.js +0 -1
- package/dist/i18n/en/docs/wiki.default.md +0 -27
- package/dist/i18n/en/docs/wiki.md +0 -43
- package/dist/i18n/ko/docs/wiki.default.md +0 -27
- package/dist/i18n/ko/docs/wiki.md +0 -43
|
@@ -1,52 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Feature design format
|
|
3
|
+
description: Design axes and splitting files, frontmatter, diagrams, revisions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A feature's design is the set of files under its `design/` folder. It explains the structure and processing that implement the feature's requirements. Each file covers one view (axis) of the design.
|
|
7
|
+
|
|
8
|
+
## Axes and splitting files
|
|
9
|
+
|
|
10
|
+
| File | Covers |
|
|
11
|
+
| :--- | :--- |
|
|
12
|
+
| `overview.md` (required) | Scope and approach, components and boundaries, open questions |
|
|
13
|
+
| `data.md` | Storage format, data structures and relations, caches, state and lifetime |
|
|
14
|
+
| `interface.md` | Commands, APIs and contracts, inputs and outputs, boundaries with other modules |
|
|
15
|
+
| `ui.md` | Screen layout and routes, display flow, interaction |
|
|
16
|
+
| `errors.md` | Error handling, input validation, recovery, what is tested |
|
|
2
17
|
|
|
3
|
-
A feature
|
|
18
|
+
A feature with any design must have `overview.md`. The other axes are recommended; create only the ones you need. If the feature is small and each view fits in a paragraph or two, keep everything in `overview.md`. Move a view into its own axis file when it grows to several sections or changes independently of the others. Do not create empty axis files or files that only fill in a template. If a view outside the table is needed, add a file with a lowercase, digits and hyphens slug.
|
|
19
|
+
|
|
20
|
+
Do not write the same content in two files. `overview.md` does not repeat the details of other axes; it is enough that a reader can tell which axis files exist.
|
|
4
21
|
|
|
5
22
|
## File structure
|
|
6
23
|
|
|
7
|
-
|
|
24
|
+
Create a file with `gitifact specs new design <feature>/<axis> --title "<title>" --description "<one line>"`. The CLI issues a D- ID, sets `order` to the highest in the folder plus 10, and adds `draft: true`. After writing the body, delete the `draft: true` line and check with `gitifact check`. Do not make up IDs.
|
|
8
25
|
|
|
9
26
|
```markdown
|
|
10
27
|
---
|
|
11
|
-
id:
|
|
28
|
+
id: D-value-issued-by-the-CLI
|
|
29
|
+
title: Post storage
|
|
30
|
+
description: Storage format for posts and attachments and the cleanup order on delete
|
|
31
|
+
order: 20
|
|
32
|
+
requirements:
|
|
33
|
+
- R-actual-related-requirement
|
|
12
34
|
sources:
|
|
13
|
-
-
|
|
14
|
-
path: ../../wiki/architecture.md
|
|
35
|
+
- id: I-actual-instruction-followed
|
|
15
36
|
note: Layers and dependency direction
|
|
16
|
-
- title: Library
|
|
37
|
+
- title: Library docs
|
|
17
38
|
url: https://example.test/docs
|
|
18
39
|
---
|
|
19
40
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Overview
|
|
23
|
-
Scope and implementation approach.
|
|
24
|
-
|
|
25
|
-
## Processing flow
|
|
26
|
-
<!-- gitifact-ref: R-actual-related-requirement-ID -->
|
|
27
|
-
The main flow from input to result.
|
|
41
|
+
Posts are ...
|
|
28
42
|
```
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
The IDs and sentences above illustrate the structure. Fill in real values; do not save the example as is.
|
|
31
45
|
|
|
32
|
-
|
|
46
|
+
- **`title`, `description`:** Required, one line each. Do not repeat the title as a `#` heading in the body. Body sections start at `##` and contain no gitifact comments.
|
|
47
|
+
- **`order`:** Order the files so the feature is easy to follow. Overview comes first; the default after it is data → interface → ui → errors. Values must not repeat within the folder.
|
|
48
|
+
- **`requirements`:** Only the R- IDs this file actually explains. Several design files may point to the same requirement. Do not copy every requirement of the feature into every file.
|
|
49
|
+
- **`sources`:** Documents this file is based on. Documents in the repository are listed by ID as `{id, note?}`; external material as `{title, url, note?}`. The browser shows this list as source cards. It does not fetch titles or previews of external pages.
|
|
33
50
|
|
|
34
|
-
|
|
51
|
+
Relative links in the body (such as `../../../assets/flow.png`) are relative to this file, and the browser links them to their targets. Relations between documents are expressed in frontmatter, not links.
|
|
35
52
|
|
|
36
|
-
|
|
53
|
+
## Writing the body
|
|
37
54
|
|
|
38
|
-
|
|
55
|
+
Follow `gitifact guide show writing` for style. The body describes the current structure and behavior. Separate what is decided, what was observed in the implementation, and what is proposed.
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
A design keeps no decision table. A choice among options goes into a record with its context and the alternatives considered, and the body states only the result as a rule (`gitifact guide show records`). Before changing a design, read how its decisions went with `gitifact records list --doc <D-ID>` so an option already passed over is not proposed again. How it changed, when, and the old approach go into records too, not the body.
|
|
41
58
|
|
|
42
|
-
|
|
59
|
+
For diagrams, follow `gitifact guide show writing` for choosing the kind and drawing it, and place each in the file for the axis it explains. Each axis has kinds that suit it: `erDiagram` and a `flowchart` of cache or read flows for data, a `sequenceDiagram` of requests between components for interface, a `stateDiagram-v2` of screen states for ui, and failure and recovery flows for errors.
|
|
43
60
|
|
|
44
|
-
|
|
61
|
+
Before writing a design, read the instructions for the area of work from the AGENTS.md index and list the ones you followed in `sources`. Do not repeat what an instruction already says; a design holds only what is particular to this feature. Instructions do not point at designs, so the relation is written in this one direction only. If the design conflicts with an instruction, agree with the user on whether to change the instruction first.
|
|
45
62
|
|
|
46
|
-
|
|
63
|
+
## When to write one
|
|
47
64
|
|
|
48
|
-
|
|
65
|
+
When shaping a new feature, write requirements and design together by default. If the user asks only for requirements, do that, and do not bulk-create designs for existing features that have none. Do not enforce step-by-step approval; ask only about important unknowns.
|
|
49
66
|
|
|
50
67
|
## Revisions
|
|
51
68
|
|
|
52
|
-
|
|
69
|
+
Before revising, read the feature's design files and the related requirements, and change only the files affected. Rewrite the sentences that changed instead of appending “previously we …” sentences. How it changed goes into a record, and Git keeps the old text. When a decision changes, change the rule in the body and write a new record. When a requirement changes, review the designs that point to it ("Referenced by" in `gitifact specs show <R-ID>`); when only the design changes, do not force changes to requirements.
|
|
70
|
+
|
|
71
|
+
When splitting a large file into axes or merging files, only move sentences; do not edit content in the same commit. After moving, check that every sentence of the old file is present in the new files. Keep IDs when moving files, and make sure the `requirements` of a deleted file moved to the remaining files. A commit that only moves sentences needs no record.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Project instruction format
|
|
3
|
+
description: The format of per-task instruction folders, the AGENTS.md index, how instructions relate to specs, assets and commits
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Project instructions hold how work is done in this project: architecture rules, decisions that span features, writing style, verification steps. Requirements say what to build and a design says how one feature is built; instructions say how the project works regardless of feature. Keep feature behavior in specs and do not repeat it in instructions.
|
|
7
|
+
|
|
8
|
+
## Folders and files
|
|
9
|
+
|
|
10
|
+
An instruction is a folder, `.gitifact/instructions/<name>/`. Names use lowercase letters, digits and hyphens, up to 80 characters. The folder's `index.md` is the instruction document; split long content into files under `references/` in the same folder, and link to them from `index.md` with relative links.
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
.gitifact/instructions/
|
|
14
|
+
cli-architecture/
|
|
15
|
+
index.md instruction document (I-)
|
|
16
|
+
references/
|
|
17
|
+
checklist.md a long list
|
|
18
|
+
verification/
|
|
19
|
+
index.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Create new instructions with the CLI. It issues an `I-` ID, fills in the frontmatter and adds `draft: true`. Write the body, remove that line and check with `gitifact check`.
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
gitifact instructions new code-review --title "Code review" --description "What to check in a review and how to report it. Use when reviewing a change."
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
---
|
|
30
|
+
id: I-value-issued-by-the-cli
|
|
31
|
+
title: Code review
|
|
32
|
+
description: What to check in a review and how to report it. Use when reviewing a change.
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
Rules and reasons. Long lists go in [references/checklist.md](references/checklist.md).
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The ID and sentences above only show the structure. The frontmatter of `index.md` has only `id`, `title` and `description`, all required. The `description` says both what the instruction holds and for which work to read it. Do not repeat the title as a `#` heading in the body; start body sections at `##` and do not add gitifact comments. Reference files are not parsed as documents, so they have no frontmatter or ID and any format. Follow `gitifact guide show writing` for the prose.
|
|
39
|
+
|
|
40
|
+
Edit existing instructions directly. To rename one, move the folder and keep the ID; to delete one, delete the folder. If a design's `sources` still names a deleted instruction, fix that design too or `check` fails. An instruction folder without `index.md` is an `INSTRUCTION_INDEX_REQUIRED` problem.
|
|
41
|
+
|
|
42
|
+
## The AGENTS.md index
|
|
43
|
+
|
|
44
|
+
Agents read AGENTS.md in every session. Write, briefly and outside the GITIFACT block, which instruction to read for which work. The CLI rewrites the block, so do not put the index inside it.
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
## Instructions by task
|
|
48
|
+
|
|
49
|
+
- When changing CLI code: `.gitifact/instructions/cli-architecture/index.md`
|
|
50
|
+
- Before verifying or committing a change: `.gitifact/instructions/verification/index.md`
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
When you create, rename or delete an instruction, update the index too. Short facts every session needs belong in AGENTS.md; content needed only for certain work belongs in an instruction.
|
|
54
|
+
|
|
55
|
+
## Relation to specs
|
|
56
|
+
|
|
57
|
+
Instructions do not point at specs. An instruction is knowledge that spans features; tied to one feature's spec, it goes stale when that spec changes. The only direction is a design listing the instructions it followed in `sources` as `{id: I-…}`. Markdown in an instruction folder that links under `.gitifact/spec/` is an `INSTRUCTION_SPEC_LINK` problem. A path pattern describing the storage format inside a code block is not a link.
|
|
58
|
+
|
|
59
|
+
Write links between instructions and to assets relative to the file, for example `../verification/index.md` or `../../assets/diagrams/flow.png`. `check` and `changes list` report a link without a target as a `MISSING_LINK_TARGET` warning.
|
|
60
|
+
|
|
61
|
+
## Decisions
|
|
62
|
+
|
|
63
|
+
An instruction keeps no decision table or decision log file of its own. Structure and technology choices that span features are written in the instruction body as rules; their context and the alternatives considered go into records that name the instruction (`gitifact guide show records`). Before changing an instruction, read how its decisions went with `gitifact records list --doc <I-ID>`. When a decision changes, change the rule in the body and write a new record.
|
|
64
|
+
|
|
65
|
+
When an instruction is created or widened, find the same content in designs with `gitifact specs list --q` and remove it there. Add the instruction to those designs' `sources`, and record the move in one record (`docs` naming the instruction and the designs changed).
|
|
66
|
+
|
|
67
|
+
## Assets
|
|
68
|
+
|
|
69
|
+
Keep images, PDFs and other non-Markdown files inside the instruction folder or under `.gitifact/assets/`: files one instruction uses go in its folder, files several documents share go in assets. For assets, the recommended extensions are png, jpg, gif, webp, svg and pdf, and the recommended size is at most 1 MB per file and 50 MB in total. Larger files can still be committed; `check` and `changes list` report them with `ASSET_SIZE`, `ASSET_EXTENSION` and `ASSETS_TOTAL_SIZE` warnings. Assets files no document references are reported with `UNREFERENCED_ASSET`.
|
|
70
|
+
|
|
71
|
+
## Commits
|
|
72
|
+
|
|
73
|
+
A change to an instruction is a change to its `index.md`; a record names it by its I- ID in `docs`. Other files of the folder may be listed in `paths` and committed along with it; a change to them alone needs no record (`gitifact guide show commit`).
|
|
74
|
+
|
|
75
|
+
## Agents
|
|
76
|
+
|
|
77
|
+
- Before changing requirements, designs or code, find the instructions for the area of work in the AGENTS.md index, read them and follow them. If none fits, say so and proceed.
|
|
78
|
+
- `gitifact instructions list` shows whether AGENTS.md exists and how many files each instruction folder holds. Read an instruction's `index.md` with `instructions show <name>` and a file of its folder with `instructions show <name> --file references/<file>`.
|
|
79
|
+
- If a request conflicts with an instruction, say so before proceeding. Whether to change the instruction is the user's call.
|
|
80
|
+
- When a new rule or decision spans features, suggest recording it in an instruction. If the user agrees, edit an existing instruction or create one with `gitifact instructions new`, and update the AGENTS.md index.
|
|
81
|
+
- The 0.7 wiki (`.gitifact/wiki/`) became instructions in 0.8.0. `check` reports any page left there as `WIKI_REMOVED`. Follow `gitifact guide show migrate` to move them.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Migrating a 0.7 project
|
|
3
|
+
description: Steps, checks and the migration commit for moving a schemaVersion 2 project to the 0.8.0 document format
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
When the user asks to move a 0.7 project (`schemaVersion: 2` in `.gitifact/config.json`) to the 0.8.0 document format (schemaVersion 3), follow these steps. The CLI has no conversion command, so the agent reads the old files and writes the new structure itself. Finish with a report in the form of the "Report" section.
|
|
7
|
+
|
|
8
|
+
In this guide, `gitifact` means the way to run the CLI that printed it (0.8.0 or later). Do not use a 0.7.x CLI. The 0.8.0 CLI refuses to read a schemaVersion 2 project, so read the files directly until step 3 changes the configuration.
|
|
9
|
+
|
|
10
|
+
## 1. Before you start
|
|
11
|
+
|
|
12
|
+
- `git status` must be clean. If there are uncommitted changes or staged files, stop and tell the user.
|
|
13
|
+
- If an **open branch** changed `.gitifact/` in the old format, tell the user to merge it before the migration and ask whether to merge or continue. Merging an old-format branch after the migration mixes the two formats, and `gitifact check` fails.
|
|
14
|
+
- The migration ends in a single commit. Confirm that you may commit. When possible, work on a new branch and merge after verification.
|
|
15
|
+
- Section 3 of this guide describes the whole new format. If a detail is unclear, run `gitifact init` and `gitifact specs new feature|requirement|design|instruction …` in an empty Git repository outside the project to see the skeletons the CLI writes, and check them with `gitifact check`.
|
|
16
|
+
|
|
17
|
+
## 2. Reading the old format
|
|
18
|
+
|
|
19
|
+
| Old file | Format |
|
|
20
|
+
| :--- | :--- |
|
|
21
|
+
| `.gitifact/spec/<feature>/requirements.md` | Frontmatter `id: S-…`, first body line `# Feature title`. A paragraph between `# title` and the first `## ` is the feature's introduction. Each requirement is a `## Requirement title` followed by a `<!-- gitifact-req: R-… -->` line; everything below it up to the next `## ` (outside code blocks) is the requirement body |
|
|
22
|
+
| `.gitifact/spec/<feature>/design.md` (when present) | Frontmatter `id` (the feature's S-) and optional `sources` (`title`, `path` or `url`, `note`). First body line `# Design title`; sections carry `<!-- gitifact-ref: R-…[, R-…] -->` |
|
|
23
|
+
| `.gitifact/spec/<feature>/history.jsonl` | One line per reason: `{"id":"H-…","requirements":[R-…],"designs":[S-…]?,"documents":[W-…]?,"reason":"…"}` |
|
|
24
|
+
| `.gitifact/wiki/**/*.md` | Frontmatter `id: W-…`, first body line `# Page title` |
|
|
25
|
+
| `.gitifact/wiki/history.jsonl` | The same reason lines, usually with `documents` |
|
|
26
|
+
|
|
27
|
+
Count before you start: features (`requirements.md` files), requirements (`gitifact-req` comments), designs (`design.md` files) and wiki pages. Section 4 compares against these counts.
|
|
28
|
+
|
|
29
|
+
## 3. Moving to the new structure
|
|
30
|
+
|
|
31
|
+
Every structural fact lives in frontmatter only. Bodies carry no `#` title and no `<!-- gitifact-` comments (code blocks excepted). `title` (200 characters) and `description` (300 characters) are single lines and both are required.
|
|
32
|
+
|
|
33
|
+
1. **Configuration:** set `schemaVersion` in `.gitifact/config.json` to 3. Leave `baseline` as it is.
|
|
34
|
+
2. **Features:** create `.gitifact/spec/<feature>/index.md`.
|
|
35
|
+
```markdown
|
|
36
|
+
---
|
|
37
|
+
id: S-… # the old requirements.md id, unchanged
|
|
38
|
+
title: Feature title # the old # title, unchanged
|
|
39
|
+
description: One line saying what this feature is
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
(The old introduction paragraph if there is one; otherwise one or two sentences on the feature's scope and purpose. A body is required.)
|
|
43
|
+
```
|
|
44
|
+
3. **Requirements:** create `.gitifact/spec/<feature>/requirements/<slug>.md` for each requirement. The slug names the title in lowercase English letters, digits and hyphens (80 characters at most). `order` follows the old file: 10, 20, 30… Move the old requirement body **without changing a character** (keep the `###` subheadings); only trim blank lines at its start and end.
|
|
45
|
+
```markdown
|
|
46
|
+
---
|
|
47
|
+
id: R-…
|
|
48
|
+
title: Requirement title
|
|
49
|
+
description: One line saying what it requires
|
|
50
|
+
order: 10
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
(the old body, unchanged)
|
|
54
|
+
```
|
|
55
|
+
4. **Designs:** for each feature with an old design.md, run `gitifact specs new design <feature>/overview --title "<old design title>" --description "<one line>"` to get a D- ID. Replace the body of the `design/overview.md` it created with the old design body (without its first line `# Design title`) and remove the `draft: true` line. Then:
|
|
56
|
+
- Remove the old `<!-- gitifact-ref: … -->` lines and list every R- ID they named, without duplicates, in the frontmatter `requirements`.
|
|
57
|
+
- Move old `sources`: a `path` becomes `- id: W-…` for the wiki page it points to (with its `note`, if any); a `url` becomes `- title: …` / `url: …`. The W- becomes the I- of the instruction that page moves to in step 5.
|
|
58
|
+
- Leave the rest of the body unchanged. Keep the `order: 10` that `specs new` wrote. Do not split a design into files per concern (data, interface, ui, errors, …) in the migration commit. Move it as one overview so the moved body can be compared, and split it afterwards in a separate commit following `gitifact guide show design`.
|
|
59
|
+
- The frontmatter ends up like this. Sources in the new format have no `title`, so the old title of a wiki source is dropped.
|
|
60
|
+
```markdown
|
|
61
|
+
---
|
|
62
|
+
id: D-…
|
|
63
|
+
title: Old design title
|
|
64
|
+
description: One line
|
|
65
|
+
order: 10
|
|
66
|
+
requirements:
|
|
67
|
+
- R-…
|
|
68
|
+
- R-…
|
|
69
|
+
sources:
|
|
70
|
+
- id: I-…
|
|
71
|
+
note: the old note (if any)
|
|
72
|
+
- title: Outside document title
|
|
73
|
+
url: https://…
|
|
74
|
+
---
|
|
75
|
+
```
|
|
76
|
+
5. **Wiki → instructions:** in 0.8.0 the wiki became project instructions (`gitifact guide show instructions`). `check` refuses pages left in `.gitifact/wiki/` with `WIKI_REMOVED`, so move every page into an instruction folder. Before moving, show the user a table of which page becomes which file of which instruction and get their confirmation. If the user changes the grouping, follow it.
|
|
77
|
+
|
|
78
|
+
| Old location | New location |
|
|
79
|
+
| :--- | :--- |
|
|
80
|
+
| `wiki/README.md` (policy and entry page) | If it is still the default policy `init` wrote (decision records collected under `adr/`), delete it without moving. If the project rewrote it, move it like a root page to the `index.md` of instruction `overview`. Whether its wiki rules move to AGENTS.md is decided in section 6 |
|
|
81
|
+
| Root page `wiki/<name>.md` | `index.md` of instruction `<name>`. Upper-case names become lower case (`ARCHITECTURE.md` → `architecture`) |
|
|
82
|
+
| Top-level folder `wiki/<folder>/` | Instruction `<folder>`. The folder's `README.md`, if any, becomes `index.md`; the other pages become `references/<path inside the folder>` |
|
|
83
|
+
| Folder with the same name as a root page | One instruction; the root page is `index.md` |
|
|
84
|
+
|
|
85
|
+
- For each instruction, run `gitifact instructions new <name> --title "<title>" --description "<one line>"` to get an I- ID. The title is the old title of the page that becomes `index.md`. For a folder without such a page, name the topic the folder holds (for example `handbook` → Team handbook). The description says what the instruction holds and for which work to read it.
|
|
86
|
+
- For the page that becomes `index.md`, drop the first body line `# Title` and move the rest unchanged: replace the body `specs new` wrote with it and remove the `draft: true` line. If a folder has no page to become `index.md`, write one line per reference file in the body, with its old title and a link.
|
|
87
|
+
- Pages moved to references keep the old file as it is (including the `# Title` line); remove only the frontmatter and the blank line after it, so the file starts with `# Title`. Reference files are not parsed as documents and have no ID.
|
|
88
|
+
- Move images and other non-Markdown files from the wiki folder into the instruction folder that uses them.
|
|
89
|
+
- Instructions cannot point at specs (`INSTRUCTION_SPEC_LINK`). In the moved files, reduce links under `.gitifact/spec/` from `[text](path)` to their text. Other relative links are fixed for the new location in step 6.
|
|
90
|
+
- Design `sources` that named a wiki page W- in step 4 now name the I- of the instruction that page moved to. If a design ends up naming the same instruction twice, merge the two and join the notes with `; `.
|
|
91
|
+
- The old W- IDs disappear from documents and stay only in the reasons of 0.7 commits.
|
|
92
|
+
- Do not turn the wiki's decision record (ADR) pages into record files or regroup instructions in the migration commit. Move bodies unchanged so they can be compared, and polish them in a separate commit after the migration.
|
|
93
|
+
6. **Relative links:** requirements and designs moved, so fix relative links in document bodies that point to the old `requirements.md` or `design.md`, or that break because a file moved (requirement and design bodies are now one folder deeper). Point links to wiki pages at the instruction files the pages moved to, and fix links inside moved instruction files for their new location. Do not edit bodies beyond fixing links.
|
|
94
|
+
7. **Reasons:** do not move the reasons in the old history.jsonl files. They stay in the 0.7 commits and remain visible in the history (`records list --doc`, the browser) after the migration. Reasons for changes from 0.8.0 on are kept in records (`gitifact guide show records`). The migration commit gets no records; it is hidden from the history.
|
|
95
|
+
8. **Delete the old files:** remove every `.gitifact/spec/<feature>/requirements.md`, `design.md`, `history.jsonl` and the whole `.gitifact/wiki/` folder (including `wiki/history.jsonl`), once step 5 has moved every page, with a plain file deletion. Do not use `git rm`: it stages the deletion and the commit in section 5 refuses existing staging. If something is staged, unstage it with `git restore --staged <path>`.
|
|
96
|
+
|
|
97
|
+
The mechanical parts (splitting files, moving wiki pages) may be done with a one-off script. Keep the script outside the project and never commit it. Write slugs, descriptions and feature bodies yourself after reading the content. Every feature, requirement and instruction needs a description, which makes this the largest part of the migration (68 for a project with 18 features, 45 requirements and 5 instructions). A description should let a reader recognize in one line of a list what the document requires or covers; do not repeat the title, condense the user story or the first paragraph instead.
|
|
98
|
+
|
|
99
|
+
**Allowed exceptions:** normally only the CLI issues IDs and committed reasons are never edited. For this migration only, existing S- and R- IDs are copied over. Never invent IDs (designs get their D- and instructions their I- from `specs new`).
|
|
100
|
+
|
|
101
|
+
## 4. Checks
|
|
102
|
+
|
|
103
|
+
1. `gitifact check` must report no problems. Fix anything it reports.
|
|
104
|
+
2. Compare with the counts from section 2: features = number of `index.md`, requirements, designs (`design/overview.md` per feature), wiki pages (the `index.md` and reference files in the step 5 table together). Count documents with `gitifact specs list --format json` and `gitifact instructions list --format json`.
|
|
105
|
+
3. Check that every old ID is present. Collect old IDs from `git grep -ohE '(S|R)-[a-z2-7]{10}' HEAD -- .gitifact` at their definitions (frontmatter `id`, `gitifact-req` comments) and new IDs from `documents[].id` of `gitifact specs list --format json`. No `.gitifact/wiki/` or `history.jsonl` file may remain and no design `sources` may name a W-.
|
|
106
|
+
4. The last lines of `gitifact changes list` must include `Document check: no problems`. Its other output is expected at this point: the old format does not parse as documents, so every document shows as `created`. New documents need no record. None of this blocks the commit.
|
|
107
|
+
|
|
108
|
+
## 5. Commit
|
|
109
|
+
|
|
110
|
+
Write JSON to the input path that `gitifact changes list` reports and run `gitifact changes commit --file <that path>`, first with `--dry-run`. `paths` is every path in `git status --porcelain --untracked-files=all` (`.gitifact/cache/` excludes itself and does not appear). Quote the user's request for the migration and the commit in `evidence`.
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"paths": ["<every changed, new or deleted path: .gitifact/config.json, the new documents, the deleted old files>"],
|
|
115
|
+
"message": "chore(gitifact): migrate to the 0.8.0 document format",
|
|
116
|
+
"authorization": { "basis": "user-request", "evidence": "<the user's words asking for the migration and commit>" },
|
|
117
|
+
"migration": true
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- `migration: true` adds the `Gitifact-Migration: 0.8.0` trailer. That commit becomes the history boundary: activity before it stays visible in the viewer, and the commit itself does not appear as activity.
|
|
122
|
+
- Add no records; the 0.7 reasons are read from the 0.7 commits.
|
|
123
|
+
- The deleted old files must be in `paths`; without them the CLI refuses the commit.
|
|
124
|
+
|
|
125
|
+
## 6. After the migration
|
|
126
|
+
|
|
127
|
+
- Refresh the GITIFACT block in the agent instruction files with `gitifact update`. If project instructions outside the block (AGENTS.md, CLAUDE.md, …) mention old commands such as `spec working`, `spec save`, `spec commit` or `docs <topic>`, ask the user whether to replace them with the new ones (`list`, `show` and `new` of `specs`, `instructions` and `records`, `check`, `changes list`·`commit`, `guide show`) in a separate commit.
|
|
128
|
+
- If the old index of the 0.7.x browser exists at `<git common dir>/gitifact/` (usually `.git/gitifact/`), tell the user it can be deleted. 0.8.0 does not use it; leave the deletion to the user.
|
|
129
|
+
- The 0.8.0 cache lives in `.gitifact/cache/` and keeps itself out of Git. The first query reads the history from the start and may take a few seconds.
|
|
130
|
+
- If the wiki README moved to instruction `overview` holds rules for running the wiki (what goes where), agree with the user whether to move them to AGENTS.md or another instruction. Then write the instruction index outside the GITIFACT block of AGENTS.md: one line per instruction saying for which work to read it ("The AGENTS.md index" in `gitifact guide show instructions`). Ask the user whether to record this in a commit separate from the migration.
|
|
131
|
+
- Turning the ADRs moved to references into records (`gitifact guide show records`) while leaving only the rules to keep in the instruction body, and regrouping instructions, are agreed with the user and done in a separate commit. The migration commit is hidden, so records written in that later commit are the ones the history shows.
|
|
132
|
+
- The migration commit leaves bodies as they were, so instructions or specification bodies may still describe the old format (`requirements.md`, `spec save`, …) or refer to the wiki. Report where, and agree with the user on fixing them in a separate commit.
|
|
133
|
+
|
|
134
|
+
## 7. Report
|
|
135
|
+
|
|
136
|
+
- Moved counts: features, requirements, designs, wiki pages (with the old counts), and the table of instructions the wiki pages moved to
|
|
137
|
+
- The `check` result and the comparison result
|
|
138
|
+
- Relative links fixed, anything not moved or that needed a judgment call
|
|
139
|
+
- The commit hash (if committed) and what remains (old commands in instructions, the old index)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Record format
|
|
3
|
+
description: When to write a record, the file and its sections, from draft to commit, and how to read records
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A record keeps why a document looks the way it does. A document body holds only what is valid now, so the context and the options chosen that the body cannot explain go into records. A committed record is never edited. When a decision changes, write a new record; reading one document's records in order shows how its decisions went.
|
|
7
|
+
|
|
8
|
+
## When to write one
|
|
9
|
+
|
|
10
|
+
| Case | Record |
|
|
11
|
+
| :--- | :--- |
|
|
12
|
+
| Changing or removing what an existing requirement, design or instruction says | Write one. The old text is gone, so a record is the only place for the context |
|
|
13
|
+
| Choosing one of several options while creating or changing something | Write one. Alternatives considered do not go into the document body |
|
|
14
|
+
| Simply adding a new requirement | None. The user story is the reason |
|
|
15
|
+
| A document changed as a consequence of another decision | None of its own. Add the document to that decision's `docs` |
|
|
16
|
+
| A typo or wording fix | None |
|
|
17
|
+
|
|
18
|
+
Record a decision when it is made. Written at commit time from memory, context such as the alternatives considered gets lost. One task with several decisions has several records.
|
|
19
|
+
|
|
20
|
+
## The file
|
|
21
|
+
|
|
22
|
+
A record is one file, `.gitifact/records/<yyyymmdd>/<DR-ID>.md`. Create it with the CLI, which issues the ID and writes it in the folder of today's date (created on the first record of the day) with the required sections and `draft: true`.
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
gitifact records new --title "30-day retention of deleted posts" --docs R-…,D-…
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
---
|
|
30
|
+
id: DR-value-issued-by-the-cli
|
|
31
|
+
title: 30-day retention of deleted posts
|
|
32
|
+
docs:
|
|
33
|
+
- R-actual-changed-requirement
|
|
34
|
+
- D-actual-changed-design
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Context
|
|
38
|
+
|
|
39
|
+
About 20 requests a month ask to restore a post deleted by mistake.
|
|
40
|
+
|
|
41
|
+
## Decision
|
|
42
|
+
|
|
43
|
+
A deleted post stays in the trash for 30 days; a cleanup job then removes it for good.
|
|
44
|
+
|
|
45
|
+
## Alternatives considered
|
|
46
|
+
|
|
47
|
+
- Remove at once (restore requests cannot be met)
|
|
48
|
+
- Keep forever (storage keeps growing)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The ID and sentences above only show the structure. Fill in the sections, then remove the `draft: true` line; a record that still has it cannot be committed.
|
|
52
|
+
|
|
53
|
+
- **`title`:** one line of at most 80 characters. It names the record on the browser's decision records page and in `records list --doc`. Write a short noun phrase naming what was decided (for example `500-character section limit`, `Removal of decision tables from documents`, `One decision per commit recommended`), not a sentence, not only the topic (`500-character section limit`, not `Section length`); the reason goes in a section.
|
|
54
|
+
- **`docs`:** IDs of the documents the record explains, including ones it deletes. Documents changed as a consequence go here too.
|
|
55
|
+
- **Author and time:** not in the file. They are read from the commit that added the record.
|
|
56
|
+
|
|
57
|
+
| Section | Required | Content |
|
|
58
|
+
| :--- | :--- | :--- |
|
|
59
|
+
| Context | Yes | What called for the decision: the problem, request or constraint |
|
|
60
|
+
| Decision | Yes | What was decided |
|
|
61
|
+
| Alternatives considered | No | Options actually weighed and not chosen, with why |
|
|
62
|
+
|
|
63
|
+
The body holds only these `##` sections. Headings may be in English (`## Context`) or Korean (`## 맥락`). A section not in the list, or one that appears twice, is a `check` problem. Write alternatives only when options were actually weighed; do not make them up. When there were none, as in most requirement changes, leave the section out.
|
|
64
|
+
|
|
65
|
+
## Length
|
|
66
|
+
|
|
67
|
+
Write two to five sentences each for the context and the decision. The context says what the problem was (what was seen and any numbers measured), who asked for what, and the constraints to keep. The decision says what was decided, how far it applies and its exceptions. Do not pad a section with what nothing supports. A section over 500 characters is a `check` problem (`RECORD_SECTION_TOO_LONG`). List alternatives one per line with why they were not chosen in brackets. Leave out the history, the measuring and the old ways. API fields, implementation steps and test notes stay in the design or the commit, not the record. If a longer explanation is needed, put it in the design or instruction body and keep only the gist in the record. Follow `gitifact guide show writing` for the prose.
|
|
68
|
+
|
|
69
|
+
## Committing
|
|
70
|
+
|
|
71
|
+
Commit a record with the documents it explains by listing its file in the commit input's `paths` (`gitifact guide show commit`). One decision per commit is the default, together with its documents, code and tests. When a file spans two decisions, commit both records together. `changes list` shows which documents each record explains and which documents two records explain.
|
|
72
|
+
|
|
73
|
+
A committed record is not edited or deleted. If it is, `check` reports `RECORD_ALTERED` and the commit is refused; restore it from HEAD and write the changed decision as a new record.
|
|
74
|
+
|
|
75
|
+
## Reading
|
|
76
|
+
|
|
77
|
+
| Command | When |
|
|
78
|
+
| :--- | :--- |
|
|
79
|
+
| `gitifact records list --doc <ID>` | Before changing a document, read how its decisions went: each record's title and sections with its commit |
|
|
80
|
+
| `gitifact records show <DR-ID>` | One record as written and the commit that added it |
|
|
81
|
+
|
|
82
|
+
Do not read or grep every file under `.gitifact/records/`. Records are placed only by day and ID, so gathering them by document means reading them all; `records list --doc` finds them through the cache's index.
|
|
@@ -1,62 +1,99 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Requirement format
|
|
3
|
+
description: Feature and requirement files, frontmatter, user stories and acceptance criteria, creating, editing and moving
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A feature is one folder, `.gitifact/spec/<feature>/`. The feature introduction is `index.md`, each requirement is its own `requirements/<slug>.md`, and the design is the files under `design/` (`gitifact guide show design`). Why a document changed is kept in records (`.gitifact/records/`, `gitifact guide show records`).
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
.gitifact/spec/posts/
|
|
10
|
+
index.md feature introduction (S-)
|
|
11
|
+
requirements/
|
|
12
|
+
create.md one requirement (R-)
|
|
13
|
+
delete.md
|
|
14
|
+
design/
|
|
15
|
+
overview.md design (D-)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Creating
|
|
2
19
|
|
|
3
|
-
|
|
20
|
+
Create files through the CLI. It issues the ID, fills in the frontmatter and writes a body skeleton.
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
gitifact specs new feature posts --title "Posts" --description "Writing, editing and deleting posts"
|
|
24
|
+
gitifact specs new requirement posts/create --title "Create a post" --description "An author saves a post with a title and body"
|
|
25
|
+
```
|
|
4
26
|
|
|
5
|
-
|
|
27
|
+
A new file carries `draft: true`. Fill in the body, remove that line and run `gitifact check`. While the line remains, `check` and `changes commit` fail. Do not invent IDs or copy another document's ID.
|
|
6
28
|
|
|
7
|
-
|
|
29
|
+
## File structure
|
|
8
30
|
|
|
9
31
|
```markdown
|
|
10
32
|
---
|
|
11
|
-
id:
|
|
33
|
+
id: R-issued-by-the-CLI
|
|
34
|
+
title: Create a post
|
|
35
|
+
description: An author saves a post with a title and body
|
|
36
|
+
order: 10
|
|
12
37
|
---
|
|
13
38
|
|
|
14
|
-
# Posts
|
|
15
|
-
|
|
16
|
-
## Create a post
|
|
17
|
-
<!-- gitifact-req: R-issued-by-the-CLI -->
|
|
18
|
-
|
|
19
39
|
As a post author, I want to save a title and body so that I can return to my writing later.
|
|
20
40
|
|
|
21
41
|
### Acceptance criteria
|
|
22
42
|
|
|
23
43
|
1. Condition: The user requests a save with an empty title.
|
|
24
|
-
Expected
|
|
44
|
+
Expected: The system asks for a title and does not save the post.
|
|
25
45
|
```
|
|
26
46
|
|
|
27
|
-
These IDs illustrate the structure and are not valid input.
|
|
47
|
+
These IDs and sentences illustrate the structure and are not valid input.
|
|
28
48
|
|
|
29
|
-
|
|
49
|
+
- **`id`:** issued by the CLI. Features use `S-`, requirements `R-`, followed by ten lowercase base32 characters. It stays the same when the file moves or its title changes.
|
|
50
|
+
- **`title` and `description`:** required, one line each. Do not repeat the title as a `#` heading in the body. Write the description so that the list (`specs list`) tells what the document is without opening it.
|
|
51
|
+
- **`order`:** requirements only. Number them in the order of the feature's use; two in one feature may not share a number. `specs new` uses the folder's highest value plus 10, leaving room to insert between.
|
|
52
|
+
- **Body:** required. Do not use a `#` heading or gitifact comments (`<!-- gitifact-… -->`). The body of a feature's `index.md` states in a paragraph or two what the feature is and where it ends.
|
|
30
53
|
|
|
31
|
-
|
|
54
|
+
Put no other keys in the frontmatter. Relations between documents are expressed by a design's `requirements` and `sources`; the folder decides which feature a requirement belongs to.
|
|
32
55
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"operations": [
|
|
37
|
-
{ "type": "create", "feature": "posts", "title": "Posts" },
|
|
38
|
-
{ "type": "add", "feature": "posts", "title": "Create a post", "body": "As a post author, I want to save a title and body so that I can return to my writing later.\n\n### Acceptance criteria\n\n1. Condition: The user requests a save with an empty title.\n Expected behavior: The system asks for a title and does not save the post." },
|
|
39
|
-
{ "type": "set-design", "feature": "posts", "title": "Posts design", "body": "## Overview\n\nAgreed approach and scope.\n\n## Structure and data\n\nComponents and storage needed for implementation." }
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
```
|
|
56
|
+
Links to other documents are relative to this file (from a requirement to an asset: `../../../assets/flow.png`). The browser opens their destinations. `check` and `changes list` report a missing target as a `MISSING_LINK_TARGET` warning. Warnings do not block a commit.
|
|
57
|
+
|
|
58
|
+
## Reading
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
| Command | When |
|
|
61
|
+
| :--- | :--- |
|
|
62
|
+
| `gitifact specs list [--feature <feature>]` | IDs, titles and descriptions of features, requirements and designs, without bodies |
|
|
63
|
+
| `gitifact specs list --uncovered` | Requirements no design covers. `--without-design` finds features without a design, `--draft` documents still marked draft |
|
|
64
|
+
| `gitifact specs list --changed-since <date\|commit>` | Documents changed since then. Combine with `--author` and `--sort updated` |
|
|
65
|
+
| `gitifact specs list --q <query>` | Finding text in bodies that titles and descriptions do not mention |
|
|
66
|
+
| `gitifact specs show <ID…>` | The source of the chosen documents and the designs that point to them. `--ref <commit>` shows them as of that commit |
|
|
67
|
+
| `gitifact records list --doc <ID>` | Why a document changed over time, with its records and commits |
|
|
45
68
|
|
|
46
|
-
|
|
69
|
+
Choose with the list's conditions, then `show` only the documents you need. A list also gives only the columns you ask for (`--fields id,title`) or JSON (`--format json`). This reads far less than grepping or opening every file.
|
|
47
70
|
|
|
48
|
-
|
|
71
|
+
## Editing, moving and deleting
|
|
72
|
+
|
|
73
|
+
Edit the files directly; there is no save command. Afterwards run `gitifact check` to verify format and references.
|
|
74
|
+
|
|
75
|
+
| Task | How |
|
|
76
|
+
| :--- | :--- |
|
|
77
|
+
| Change content | Edit `title`, `description` and the body. Keep the ID |
|
|
78
|
+
| Move to another feature | Move the file into that feature's `requirements/`, keep the ID, and adjust `order` to its place there |
|
|
79
|
+
| Rename the slug | Rename the file only. ID and content stay |
|
|
80
|
+
| Delete | Delete the file. Remove its ID from the `requirements` of any design that pointed to it, or `check` fails |
|
|
81
|
+
| Rename a feature (folder) | Move the folder. The S- ID in `index.md` stays |
|
|
82
|
+
|
|
83
|
+
Do not duplicate a document under a new ID when moving or renaming it, and do not reuse a deleted ID. When a requirement changes, review the designs that point to it (“Referenced by” in `specs show <R-ID>`).
|
|
49
84
|
|
|
50
85
|
## Grouping features
|
|
51
86
|
|
|
52
|
-
Group requirements into cohesive features that mean something to users. Do not reproduce code modules or DDD layers.
|
|
87
|
+
Group requirements into cohesive features that mean something to users. Do not reproduce code modules or DDD layers. Before creating a feature, check whether an existing one is a suitable home. Use the feature name as its title without a suffix such as “requirements.” Slugs and folder names use lowercase letters, digits and hyphens.
|
|
53
88
|
|
|
54
89
|
## User stories and acceptance criteria
|
|
55
90
|
|
|
56
91
|
Start each requirement with a user story: one or two sentences explaining who wants what and why. The default pattern is “As a [role], I want [goal] so that [reason],” expressed naturally in the project's language. Use an actual user or operator of the product. Do not copy the post author in this example, or a Gitifact user, into an unrelated product.
|
|
57
92
|
|
|
58
|
-
Follow the story with an acceptance-criteria heading and numbered condition/expected
|
|
93
|
+
Follow the story with an acceptance-criteria heading (`###`) and numbered condition/expected pairs, in the project's language. Do not substitute paths, IDs or storage conventions for user goals. Put additional agreed constraints in a scope-and-constraints section and implementation details in the design. Base roles, goals and reasons on the conversation and verified context. Do not invent motives to fill the template; ask only for information needed to settle the meaning.
|
|
94
|
+
|
|
95
|
+
Apply this to new requirements and those being revised for the current request. Preserve existing IDs, agreed constraints and the meaning of acceptance criteria. Do not rewrite unrelated requirements in bulk. When done, check that the story states a role, goal and reason, and that its criteria determine success or failure. The CLI does not enforce particular sentences or validate user intent.
|
|
59
96
|
|
|
60
|
-
|
|
97
|
+
Follow `gitifact guide show writing` for prose. Its style rules do not replace the user-story pattern and the condition/expected format above. Write project content in the project's language; the language of these instructions does not change it.
|
|
61
98
|
|
|
62
|
-
Refine
|
|
99
|
+
Refine the files during the conversation. When an existing requirement changes or one of several options is chosen, write a draft record then (`gitifact guide show records`). Simply adding a requirement needs no record. While changing code and tests, bring requirements into line with the final agreement.
|