@sddio/cli 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +142 -2
- package/dist/agents.js +33 -0
- package/dist/cli.js +140 -0
- package/dist/init.js +117 -0
- package/dist/paths.js +31 -0
- package/dist/prompt.js +61 -0
- package/dist/skill.js +18 -0
- package/dist/workspace.js +30 -0
- package/package.json +54 -4
- package/templates/.sddio/context/README.md +82 -0
- package/templates/.sddio/context/config.json +5 -0
- package/templates/.sddio/context/instructions/.schema/adr.md +28 -0
- package/templates/.sddio/context/instructions/.schema/discussion.md +16 -0
- package/templates/.sddio/context/instructions/.schema/spec.md +15 -0
- package/templates/.sddio/context/instructions/adr.md +36 -0
- package/templates/.sddio/context/instructions/bootstrap.md +42 -0
- package/templates/.sddio/context/instructions/discussion.md +31 -0
- package/templates/.sddio/context/instructions/entries.md +51 -0
- package/templates/.sddio/context/instructions/flow.md +45 -0
- package/templates/.sddio/context/instructions/reconciliation.md +92 -0
- package/templates/.sddio/context/instructions/spec.md +35 -0
- package/templates/.sddio/context/instructions.md +149 -0
- package/templates/.sddio/context/preferences.md +16 -0
- package/templates/.sddio/context/principles.md +46 -0
- package/templates/.sddio/context/roadmap.md +28 -0
- package/templates/.sddio/context/routes/routes.md +25 -0
- package/templates/.sddio/skill/SKILL.md +33 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# sddio
|
|
2
|
+
|
|
3
|
+
sddio is a lightweight project context system for AI-assisted software development.
|
|
4
|
+
|
|
5
|
+
It keeps the project's **requirements, decisions, discussions, and development direction** in a small set of structured, human-readable Markdown files.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
AI can write code quickly, but often lacks reliable project context.
|
|
10
|
+
|
|
11
|
+
Important context is usually scattered across:
|
|
12
|
+
|
|
13
|
+
- conversations
|
|
14
|
+
- code
|
|
15
|
+
- tickets
|
|
16
|
+
- documents
|
|
17
|
+
- decisions
|
|
18
|
+
- developer preferences
|
|
19
|
+
|
|
20
|
+
sddio provides a small, persistent layer of project context that AI can read and maintain.
|
|
21
|
+
|
|
22
|
+
## How it works
|
|
23
|
+
|
|
24
|
+
sddio separates project context into a few focused artifacts:
|
|
25
|
+
|
|
26
|
+
- **SPEC** — what the system should do
|
|
27
|
+
- **ADR** — why important technical decisions were made
|
|
28
|
+
- **DISCUSSION** — unresolved questions, concerns, suggestions, and ideas
|
|
29
|
+
- **FLOW** — what is currently being worked on
|
|
30
|
+
- **ROADMAP** — future direction
|
|
31
|
+
- **PREFERENCES** — stable project or user context
|
|
32
|
+
|
|
33
|
+
AI uses these artifacts to:
|
|
34
|
+
|
|
35
|
+
1. understand the project
|
|
36
|
+
2. identify the user's intent
|
|
37
|
+
3. load only relevant context
|
|
38
|
+
4. create or update the appropriate artifact
|
|
39
|
+
5. keep project knowledge consistent over time
|
|
40
|
+
|
|
41
|
+
The goal is not to document everything.
|
|
42
|
+
|
|
43
|
+
The goal is to preserve the **smallest amount of context that meaningfully improves AI work**.
|
|
44
|
+
|
|
45
|
+
## Design Principles
|
|
46
|
+
|
|
47
|
+
sddio follows a few simple rules:
|
|
48
|
+
|
|
49
|
+
- Keep artifacts minimal.
|
|
50
|
+
- Prefer structure over prose.
|
|
51
|
+
- Make information easy for both humans and AI to parse.
|
|
52
|
+
- Keep each artifact focused on one purpose.
|
|
53
|
+
- Avoid unnecessary metadata, nesting, duplication, and abstraction.
|
|
54
|
+
- Load context only when it is relevant.
|
|
55
|
+
- Let AI maintain the context whenever possible.
|
|
56
|
+
- Prefer the smallest structure that works well for both humans and AI.
|
|
57
|
+
|
|
58
|
+
> **Do the least necessary.**
|
|
59
|
+
|
|
60
|
+
## What sddio Is Not
|
|
61
|
+
|
|
62
|
+
sddio is not:
|
|
63
|
+
|
|
64
|
+
- a replacement for Git
|
|
65
|
+
- a project management system
|
|
66
|
+
- a documentation platform
|
|
67
|
+
- a database of every AI conversation
|
|
68
|
+
- a requirement to document every change
|
|
69
|
+
|
|
70
|
+
It is a **context layer between the project and AI**.
|
|
71
|
+
|
|
72
|
+
## The Desired Experience
|
|
73
|
+
|
|
74
|
+
After sddio is installed, the developer should not need to manage the system manually.
|
|
75
|
+
|
|
76
|
+
AI should be able to discover the project context, maintain the relevant artifacts, and keep them useful as the project evolves.
|
|
77
|
+
|
|
78
|
+
The developer should primarily focus on the project itself.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
sddio provides **just enough structure for AI to understand, remember, and evolve a project without creating another system to manage.**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- schema version: 1.0.0 -->
|
|
2
|
+
|
|
3
|
+
<!-- Multiple entries allowed. Frontmatter belongs to the following entry. -->
|
|
4
|
+
|
|
5
|
+
<!-- entry -->
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
id: [ADR-ID]
|
|
10
|
+
|
|
11
|
+
status: <accepted|rejected|superseded>
|
|
12
|
+
|
|
13
|
+
refs: [SPEC-ID|DISC-ID]
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## [Title]
|
|
18
|
+
|
|
19
|
+
- [Decision]
|
|
20
|
+
- [Key constraint or detail]
|
|
21
|
+
|
|
22
|
+
### Alternatives
|
|
23
|
+
|
|
24
|
+
- [Rejected option] — [reason]
|
|
25
|
+
|
|
26
|
+
### Consequences
|
|
27
|
+
|
|
28
|
+
- [Cost or gain]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- schema version: 1.0.0 -->
|
|
2
|
+
<!-- Multiple entries allowed. Frontmatter belongs to the following entry. -->
|
|
3
|
+
|
|
4
|
+
<!-- entry -->
|
|
5
|
+
---
|
|
6
|
+
id: [DISC-ID]
|
|
7
|
+
type: <concern|question|suggestion|idea>
|
|
8
|
+
status: <open|resolved>
|
|
9
|
+
refs: [SPEC-ID|DISC-ID]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## [Title]
|
|
13
|
+
|
|
14
|
+
- [Point]
|
|
15
|
+
- [Option or recommendation]
|
|
16
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- schema version: 1.0.0 -->
|
|
2
|
+
<!-- Multiple entries allowed. Frontmatter belongs to the following entry. -->
|
|
3
|
+
|
|
4
|
+
<!-- entry -->
|
|
5
|
+
---
|
|
6
|
+
id: [SPEC-ID]
|
|
7
|
+
type: <requirement|constraint>
|
|
8
|
+
status: <active|deprecated>
|
|
9
|
+
refs: [SPEC-ID, DISC-ID, ADR-ID]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## [Title]
|
|
13
|
+
|
|
14
|
+
- [Requirement statement]
|
|
15
|
+
- [Requirement statement]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ADR
|
|
2
|
+
|
|
3
|
+
`ADR` records important technical decisions with lasting consequences.
|
|
4
|
+
|
|
5
|
+
## Create
|
|
6
|
+
|
|
7
|
+
Create an `ADR` when a decision materially affects:
|
|
8
|
+
|
|
9
|
+
- architecture
|
|
10
|
+
- system boundaries
|
|
11
|
+
- major technology choices
|
|
12
|
+
- important constraints
|
|
13
|
+
- significant trade-offs
|
|
14
|
+
|
|
15
|
+
## Do Not Create
|
|
16
|
+
|
|
17
|
+
Do not create an `ADR` for:
|
|
18
|
+
|
|
19
|
+
- routine implementation choices
|
|
20
|
+
- temporary decisions
|
|
21
|
+
- obvious local changes
|
|
22
|
+
- decisions already captured by an existing ADR
|
|
23
|
+
|
|
24
|
+
## Shape
|
|
25
|
+
|
|
26
|
+
- Body: the decision as short bullets.
|
|
27
|
+
- `### Alternatives`: one rejected option per bullet, reason inline.
|
|
28
|
+
- `### Consequences`: costs and gains as short bullets.
|
|
29
|
+
- Omit any section that has nothing to say.
|
|
30
|
+
- Follow Entry Style in `instructions.md`.
|
|
31
|
+
|
|
32
|
+
## Rule
|
|
33
|
+
|
|
34
|
+
Record the decision and why it matters.
|
|
35
|
+
|
|
36
|
+
Do not use `ADR` to describe system requirements or implementation work.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Bootstrap
|
|
2
|
+
|
|
3
|
+
Bootstrap automatically establishes the minimum `SPEC` for an existing project.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Inspect the minimum repository context needed to understand the system.
|
|
8
|
+
2. Extract only requirements supported by code, configuration, tests, or documentation.
|
|
9
|
+
3. Record only high-value, durable requirements.
|
|
10
|
+
4. Leave unsupported requirements undocumented.
|
|
11
|
+
5. Do not ask the user for information already derivable from the repository.
|
|
12
|
+
6. Do not infer requirements from assumptions, conventions, TODOs, comments, or future plans.
|
|
13
|
+
7. Use the generated `SPEC` for future requirement-related work.
|
|
14
|
+
8. Record at least one `DISCUSSION` for what the repository cannot settle.
|
|
15
|
+
9. Write the route table described below.
|
|
16
|
+
|
|
17
|
+
## Route Table
|
|
18
|
+
|
|
19
|
+
Bootstrap writes `sddio_workspace/README.md`, the index that makes its own output findable.
|
|
20
|
+
|
|
21
|
+
- One row per area that has entries — not one row per entry.
|
|
22
|
+
- A row names the area, the `SPEC` range it holds, the `ADR` that governs it, and one sentence of scope.
|
|
23
|
+
- Rows only for entries that exist; a placeholder row teaches nothing.
|
|
24
|
+
- Regenerate the table when an entry is added or an area appears.
|
|
25
|
+
|
|
26
|
+
## Honest First Screen
|
|
27
|
+
|
|
28
|
+
Bootstrap writes a `SPEC` of claims, so it also writes the doubt that qualifies them.
|
|
29
|
+
|
|
30
|
+
- Always record at least one `DISCUSSION` entry; a bootstrapped workspace with none reads as complete.
|
|
31
|
+
- Record the single most material gap — the one whose answer would change future work.
|
|
32
|
+
- Prefer: intent behind the code, unverified external dependencies, competing interpretations of the same module.
|
|
33
|
+
- Add a second entry only when it changes a different decision; this is a floor, not a quota.
|
|
34
|
+
- The entry satisfies `instructions/discussion.md`; code records structure, not intent, so a real gap always exists.
|
|
35
|
+
- Never record a decorative question to satisfy this rule.
|
|
36
|
+
|
|
37
|
+
## Limits
|
|
38
|
+
|
|
39
|
+
- Do not comprehensively document the repository.
|
|
40
|
+
- Do not record implementation details without lasting value.
|
|
41
|
+
- Do not repeatedly scan information already captured in `SPEC`.
|
|
42
|
+
- Bootstrap requires no user action.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# DISCUSSION
|
|
2
|
+
|
|
3
|
+
`DISCUSSION` represents unresolved project knowledge.
|
|
4
|
+
|
|
5
|
+
## Create
|
|
6
|
+
|
|
7
|
+
Create a discussion when:
|
|
8
|
+
|
|
9
|
+
* required information is missing
|
|
10
|
+
* multiple valid interpretations exist
|
|
11
|
+
* user clarification is required
|
|
12
|
+
* an unresolved decision affects implementation
|
|
13
|
+
* a potential requirement needs confirmation
|
|
14
|
+
|
|
15
|
+
## Rule
|
|
16
|
+
|
|
17
|
+
Do not create a discussion for uncertainty that is:
|
|
18
|
+
|
|
19
|
+
* non-critical
|
|
20
|
+
* safely reversible
|
|
21
|
+
* irrelevant to future work
|
|
22
|
+
|
|
23
|
+
## Resolve Discussions
|
|
24
|
+
|
|
25
|
+
When resolve discussions:
|
|
26
|
+
|
|
27
|
+
- Record the durable outcome briefly in `SPEC` or `ADR` when appropriate, and avoid duplicating the same information.
|
|
28
|
+
- Delete the original discussion entry only after the ADR/SPEC is successfully created.
|
|
29
|
+
- Deleting a resolved entry is the one sanctioned removal; it is not a rewrite of history.
|
|
30
|
+
- The ID is not reused, including the ID just deleted.
|
|
31
|
+
- Leave unanswered discussions unchanged.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Entries
|
|
2
|
+
|
|
3
|
+
## Schema
|
|
4
|
+
|
|
5
|
+
Before creating or modifying an `ADR`, `DISCUSSION`, or `SPEC` entry:
|
|
6
|
+
|
|
7
|
+
1. Read the corresponding schema in `.schema/`.
|
|
8
|
+
2. Follow its fields and structure.
|
|
9
|
+
3. Preserve its schema version.
|
|
10
|
+
|
|
11
|
+
Schema mapping:
|
|
12
|
+
|
|
13
|
+
- `ADR` → `.schema/adr.md`
|
|
14
|
+
- `DISCUSSION` → `.schema/discussion.md`
|
|
15
|
+
- `SPEC` → `.schema/spec.md`
|
|
16
|
+
|
|
17
|
+
Do not duplicate schema definitions in instruction files.
|
|
18
|
+
|
|
19
|
+
If the expected schema is missing:
|
|
20
|
+
|
|
21
|
+
1. Search `.schema/` for the closest matching schema.
|
|
22
|
+
2. Inspect existing entries for compatibility.
|
|
23
|
+
3. Do not invent a new schema unless required.
|
|
24
|
+
|
|
25
|
+
## Content
|
|
26
|
+
|
|
27
|
+
- Body content follows Entry Style in `instructions.md`.
|
|
28
|
+
- Frontmatter carries fields only, never prose.
|
|
29
|
+
|
|
30
|
+
## Entry Files
|
|
31
|
+
|
|
32
|
+
Entry collections use numbered Markdown files with a maximum of 100 entries.
|
|
33
|
+
|
|
34
|
+
Examples:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
adr_100.md → ADR 001–100
|
|
38
|
+
adr_200.md → ADR 101–200
|
|
39
|
+
|
|
40
|
+
discussions_100.md → DISC 001–100
|
|
41
|
+
discussions_200.md → DISC 101–200
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Rules:
|
|
45
|
+
|
|
46
|
+
1. Never exceed 100 entries.
|
|
47
|
+
2. Add to the current file while capacity remains.
|
|
48
|
+
3. When full, create the next numbered file before adding the next entry.
|
|
49
|
+
4. Preserve existing IDs and ordering.
|
|
50
|
+
5. New files use the same schema and structure.
|
|
51
|
+
6. Never move or split existing entries unless required by capacity.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# FLOW
|
|
2
|
+
|
|
3
|
+
`FLOW` represents implementation work.
|
|
4
|
+
|
|
5
|
+
## Create
|
|
6
|
+
|
|
7
|
+
Create or update a flow when implementation work needs persistent progress tracking.
|
|
8
|
+
|
|
9
|
+
## Rule
|
|
10
|
+
|
|
11
|
+
Keep `FLOW` focused on:
|
|
12
|
+
|
|
13
|
+
- current work
|
|
14
|
+
- relevant steps
|
|
15
|
+
- implementation state
|
|
16
|
+
- completion state
|
|
17
|
+
|
|
18
|
+
Do not use `FLOW` as permanent project documentation.
|
|
19
|
+
|
|
20
|
+
## Facts a FLOW carries
|
|
21
|
+
|
|
22
|
+
- Front matter carries `phases`, each with `code` and `verified` as separate markers.
|
|
23
|
+
- `code` means written; `verified` means a command ran and returned the expected value.
|
|
24
|
+
- Record the number before and the number after, each with the command that produced it.
|
|
25
|
+
- Write status once, in the front matter, and nowhere else.
|
|
26
|
+
- Name the residual at close: what was not done, and who owes it.
|
|
27
|
+
|
|
28
|
+
| Marker | Means |
|
|
29
|
+
| ------ | ---------------------------------------- |
|
|
30
|
+
| `[ ]` | Not started |
|
|
31
|
+
| `[~]` | Started, not finished |
|
|
32
|
+
| `[v]` | Written, not proven — no command has run |
|
|
33
|
+
| `[x]` | Proven — the command ran as expected |
|
|
34
|
+
| `[!]` | Failed or blocked outside this work |
|
|
35
|
+
| `[-]` | Dropped, with the reason on the line |
|
|
36
|
+
|
|
37
|
+
These are facts a plan records, not fields a tool validates — `ADR-004` keeps `FLOW` schema-free.
|
|
38
|
+
|
|
39
|
+
## Completion
|
|
40
|
+
|
|
41
|
+
When work is complete:
|
|
42
|
+
|
|
43
|
+
1. Validate the implementation.
|
|
44
|
+
2. Move the flow to `flow/completed`.
|
|
45
|
+
3. Run Reconciliation.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Reconciliation
|
|
2
|
+
|
|
3
|
+
Reconciliation keeps durable project knowledge consistent with implementation.
|
|
4
|
+
|
|
5
|
+
## Trigger
|
|
6
|
+
|
|
7
|
+
- **Startup** — the commit check runs on every session, before any work.
|
|
8
|
+
- **After work** — after meaningful implementation changes.
|
|
9
|
+
- **Conflict** — when implementation and artifacts disagree.
|
|
10
|
+
|
|
11
|
+
## Commit Check
|
|
12
|
+
|
|
13
|
+
Read `.sddio/context/config.json`, then resolve the cursor with git.
|
|
14
|
+
|
|
15
|
+
- `HEAD` — `git rev-parse HEAD`
|
|
16
|
+
- Exists — `git cat-file -e <sha>^{commit}`
|
|
17
|
+
- Ancestor — `git merge-base --is-ancestor <sha> HEAD`
|
|
18
|
+
|
|
19
|
+
Evaluate in order; stop at the first match.
|
|
20
|
+
|
|
21
|
+
| State | Condition | Range |
|
|
22
|
+
| --------- | ---------------------------------------- | ---------------- |
|
|
23
|
+
| current | `lastProcessedCommit` equals `HEAD` | none |
|
|
24
|
+
| ahead | it is an ancestor of `HEAD` | `last..HEAD` |
|
|
25
|
+
| rewritten | it exists, is not an ancestor | `last...HEAD` |
|
|
26
|
+
| lost | it is gone, `previousCommit` is ancestor | `previous..HEAD` |
|
|
27
|
+
| unknown | `null`, absent, or unresolvable | current state |
|
|
28
|
+
|
|
29
|
+
- `current` — no reconciliation; continue with the request.
|
|
30
|
+
- `ahead` — reconcile only the new commits.
|
|
31
|
+
- `rewritten` — amended, rebased, or reset history; reconcile both sides.
|
|
32
|
+
- `lost` — the anchor survives but the tip does not; reconcile from the anchor.
|
|
33
|
+
- `unknown` — verify artifacts against the current implementation, not the whole repository.
|
|
34
|
+
- A shallow clone with a missing cursor commit is `unknown`, never `rewritten`.
|
|
35
|
+
- No git repository, or no git binary — skip the check, leave the cursor untouched.
|
|
36
|
+
- Report the state and the reconciled range; do not reconcile silently.
|
|
37
|
+
|
|
38
|
+
## Cursor Update
|
|
39
|
+
|
|
40
|
+
After reconciliation completes:
|
|
41
|
+
|
|
42
|
+
1. `previousCommit` ← `HEAD^`; `null` at a root commit.
|
|
43
|
+
2. `lastProcessedCommit` ← `HEAD`.
|
|
44
|
+
3. Preserve `schemaVersion`.
|
|
45
|
+
4. Write nothing when the state was `current`.
|
|
46
|
+
|
|
47
|
+
- Write only after the artifacts are updated.
|
|
48
|
+
- Do not advance the cursor when reconciliation is skipped, partial, or abandoned.
|
|
49
|
+
- The cursor holds commits only; uncommitted work is re-examined on the next run.
|
|
50
|
+
|
|
51
|
+
## Process
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
Observe
|
|
55
|
+
→ Compare
|
|
56
|
+
→ Identify affected artifacts
|
|
57
|
+
→ Reconcile
|
|
58
|
+
→ Advance cursor
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Check only affected:
|
|
62
|
+
|
|
63
|
+
- `SPEC`
|
|
64
|
+
- `ADR`
|
|
65
|
+
- `DISCUSSION`
|
|
66
|
+
- `FLOW`
|
|
67
|
+
|
|
68
|
+
Both sides of the range, by name:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git diff --name-only <range>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A changed file matters only if it is named by an entry body in `SPEC`, `ADR`, or `DISCUSSION`. A file no
|
|
75
|
+
entry names is not this layer's problem.
|
|
76
|
+
|
|
77
|
+
## Rules
|
|
78
|
+
|
|
79
|
+
- Do not rescan unrelated project areas.
|
|
80
|
+
- Do not rewrite accurate artifacts.
|
|
81
|
+
- Do not create artifacts merely because implementation changed.
|
|
82
|
+
- Update the smallest affected artifact.
|
|
83
|
+
- Remove or resolve stale information when appropriate.
|
|
84
|
+
|
|
85
|
+
## Conflict
|
|
86
|
+
|
|
87
|
+
When implementation and project artifacts disagree:
|
|
88
|
+
|
|
89
|
+
1. Determine whether the implementation or artifact is stale.
|
|
90
|
+
2. Preserve the confirmed requirement.
|
|
91
|
+
3. Update the stale representation.
|
|
92
|
+
4. If intent cannot be determined, create `DISCUSSION`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# SPEC
|
|
2
|
+
|
|
3
|
+
`SPEC` contains confirmed, durable system requirements.
|
|
4
|
+
|
|
5
|
+
## Create
|
|
6
|
+
|
|
7
|
+
Create or update `SPEC` when:
|
|
8
|
+
|
|
9
|
+
- a new requirement is confirmed
|
|
10
|
+
- an existing requirement changes
|
|
11
|
+
- implementation reveals a durable requirement
|
|
12
|
+
|
|
13
|
+
## Shape
|
|
14
|
+
|
|
15
|
+
- One requirement per bullet.
|
|
16
|
+
- Short statements, not paragraphs.
|
|
17
|
+
- The title names the requirement; the body does not repeat it.
|
|
18
|
+
- Follow Entry Style in `instructions.md`.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
- Record what the system must do, not how it is implemented.
|
|
23
|
+
- A requirement that can be checked names the command that checks it, and the value it must return.
|
|
24
|
+
- A requirement that cannot be checked says it is judgement, instead of inventing a check.
|
|
25
|
+
- Prefer existing entries over duplicates.
|
|
26
|
+
- Keep requirements independently understandable.
|
|
27
|
+
- Do not record assumptions or temporary behavior.
|
|
28
|
+
|
|
29
|
+
## Source of Truth
|
|
30
|
+
|
|
31
|
+
`SPEC` describes confirmed requirements.
|
|
32
|
+
|
|
33
|
+
The repository describes actual implementation behavior.
|
|
34
|
+
|
|
35
|
+
If they conflict, use Reconciliation to determine which is stale.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Instructions
|
|
2
|
+
|
|
3
|
+
## Startup
|
|
4
|
+
|
|
5
|
+
1. Read `principles.md`
|
|
6
|
+
2. Read `preferences.md`
|
|
7
|
+
3. Read `roadmap.md`
|
|
8
|
+
4. Read `routes/routes.md`
|
|
9
|
+
5. Run the commit check
|
|
10
|
+
6. Identify the current intent
|
|
11
|
+
7. Load only the minimum context required
|
|
12
|
+
8. Load detailed instructions only when required
|
|
13
|
+
|
|
14
|
+
If no usable `SPEC` exists, load `instructions/bootstrap.md`.
|
|
15
|
+
|
|
16
|
+
## Commit Tracking
|
|
17
|
+
|
|
18
|
+
`config.json` is the reconciliation cursor. Check it on every run.
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"schemaVersion": 2,
|
|
23
|
+
"lastProcessedCommit": "<sha>",
|
|
24
|
+
"previousCommit": "<sha>"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- `lastProcessedCommit` — `HEAD` when reconciliation last completed.
|
|
29
|
+
- `previousCommit` — parent of `lastProcessedCommit`.
|
|
30
|
+
- Two commits are recorded so a rewritten or vanished tip still has an anchor.
|
|
31
|
+
- `null` means no baseline yet; the first run establishes one.
|
|
32
|
+
|
|
33
|
+
| State | Cursor condition | Reconcile |
|
|
34
|
+
| --------- | ------------------------------------- | ---------------- |
|
|
35
|
+
| current | equals `HEAD` | nothing |
|
|
36
|
+
| ahead | ancestor of `HEAD` | `cursor..HEAD` |
|
|
37
|
+
| rewritten | present, not an ancestor | `cursor...HEAD` |
|
|
38
|
+
| lost | gone, `previousCommit` is an ancestor | `previous..HEAD` |
|
|
39
|
+
| unknown | `null`, missing, or unresolvable | current state |
|
|
40
|
+
|
|
41
|
+
- Rows are ordered; the first match wins.
|
|
42
|
+
- Advance the cursor only after reconciliation completes.
|
|
43
|
+
- The cursor records commits, not uncommitted work.
|
|
44
|
+
- The cursor decides where to look; `sddio_workspace/` stays the source of truth.
|
|
45
|
+
- Procedure and edge cases: `instructions/reconciliation.md`.
|
|
46
|
+
|
|
47
|
+
## Core Loop
|
|
48
|
+
|
|
49
|
+
All work follows:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Observe → Classify → Act → Reconcile
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Observe
|
|
56
|
+
|
|
57
|
+
Gather only the information required for the current task.
|
|
58
|
+
|
|
59
|
+
Prefer existing project artifacts before inspecting implementation.
|
|
60
|
+
|
|
61
|
+
### Classify
|
|
62
|
+
|
|
63
|
+
Classify durable information as:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Requirement → SPEC
|
|
67
|
+
Decision → ADR
|
|
68
|
+
Uncertainty → DISCUSSION
|
|
69
|
+
Work → FLOW
|
|
70
|
+
Transient → nothing
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If multiple classifications apply, create only the artifacts that are necessary.
|
|
74
|
+
|
|
75
|
+
### Act
|
|
76
|
+
|
|
77
|
+
Load the relevant detailed instruction before creating or modifying an artifact.
|
|
78
|
+
|
|
79
|
+
Prefer updating existing artifacts over creating duplicates.
|
|
80
|
+
|
|
81
|
+
### Reconcile
|
|
82
|
+
|
|
83
|
+
After meaningful changes, verify that affected project knowledge remains accurate.
|
|
84
|
+
|
|
85
|
+
Update only stale or affected artifacts.
|
|
86
|
+
|
|
87
|
+
A resolved `DISCUSSION` is promoted into `SPEC` or `ADR`, then deleted — see `instructions/discussion.md`.
|
|
88
|
+
|
|
89
|
+
## Knowledge Rule
|
|
90
|
+
|
|
91
|
+
Record information only when it is likely to affect future work.
|
|
92
|
+
|
|
93
|
+
Do not record information merely because it was observed.
|
|
94
|
+
|
|
95
|
+
Prefer the smallest artifact that preserves future usefulness.
|
|
96
|
+
|
|
97
|
+
## Artifact Roles
|
|
98
|
+
|
|
99
|
+
- `SPEC` — confirmed system requirements
|
|
100
|
+
- `ADR` — important technical decisions
|
|
101
|
+
- `DISCUSSION` — unresolved knowledge
|
|
102
|
+
- `FLOW` — implementation work
|
|
103
|
+
|
|
104
|
+
Keep these roles distinct.
|
|
105
|
+
|
|
106
|
+
## Entry Style
|
|
107
|
+
|
|
108
|
+
Entry bodies are scannable lists, not prose.
|
|
109
|
+
|
|
110
|
+
1. One idea per line.
|
|
111
|
+
2. Bullets over paragraphs.
|
|
112
|
+
3. Keep lines under ~100 characters.
|
|
113
|
+
4. Facts only — no background, motivation, or history.
|
|
114
|
+
5. No filler: "clearly", "simply", "note that", "it is important".
|
|
115
|
+
6. Do not restate the title in the first bullet.
|
|
116
|
+
7. Reference other artifacts by ID; never repeat their content.
|
|
117
|
+
8. One level of nesting at most.
|
|
118
|
+
9. Omit a section that has nothing to say.
|
|
119
|
+
10. If a bullet needs two sentences, it is two bullets.
|
|
120
|
+
|
|
121
|
+
Shape test: every line is readable and actionable on its own.
|
|
122
|
+
|
|
123
|
+
## Detailed Instructions
|
|
124
|
+
|
|
125
|
+
Load only when needed:
|
|
126
|
+
|
|
127
|
+
| Need | Instruction |
|
|
128
|
+
| ---------------- | -------------------------------- |
|
|
129
|
+
| Bootstrap | `instructions/bootstrap.md` |
|
|
130
|
+
| SPEC | `instructions/spec.md` |
|
|
131
|
+
| ADR | `instructions/adr.md` |
|
|
132
|
+
| DISCUSSION | `instructions/discussion.md` |
|
|
133
|
+
| FLOW | `instructions/flow.md` |
|
|
134
|
+
| Reconciliation | `instructions/reconciliation.md` |
|
|
135
|
+
| Schema / entries | `instructions/entries.md` |
|
|
136
|
+
|
|
137
|
+
## General Rules
|
|
138
|
+
|
|
139
|
+
- Do not invent requirements.
|
|
140
|
+
- Do not create artifacts for completeness.
|
|
141
|
+
- Do not duplicate existing knowledge.
|
|
142
|
+
- Do not load unrelated context.
|
|
143
|
+
- Do not rewrite accurate artifacts.
|
|
144
|
+
- Do not record transient implementation details.
|
|
145
|
+
- Write every entry body in Entry Style.
|
|
146
|
+
- A rule that can be checked names the command that checks it; a rule that cannot says it is judgement.
|
|
147
|
+
- Write a fact where it is read, and nowhere else.
|
|
148
|
+
- Prefer automatic, minimal, reversible actions.
|
|
149
|
+
- When intent cannot be determined safely, use `DISCUSSION`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Preferences
|
|
2
|
+
|
|
3
|
+
## Preferences
|
|
4
|
+
|
|
5
|
+
- Documentation: concise
|
|
6
|
+
- Code style: minimal
|
|
7
|
+
- Dependencies: avoid unnecessary dependencies
|
|
8
|
+
- Communication: direct
|
|
9
|
+
- Planning: incremental
|
|
10
|
+
- Context: prefer targeted retrieval
|
|
11
|
+
|
|
12
|
+
## Project
|
|
13
|
+
|
|
14
|
+
- Package manager: pnpm (not now, preferred later)
|
|
15
|
+
- Architecture: monorepo (not now, preferred later)
|
|
16
|
+
- Source of truth: repository artifacts
|