project-memory-cli 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.md +21 -0
- package/README.md +153 -0
- package/SPEC.md +445 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +163 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/new-task.d.ts +2 -0
- package/dist/commands/new-task.d.ts.map +1 -0
- package/dist/commands/new-task.js +54 -0
- package/dist/commands/new-task.js.map +1 -0
- package/dist/commands/new-workflow.d.ts +2 -0
- package/dist/commands/new-workflow.d.ts.map +1 -0
- package/dist/commands/new-workflow.js +29 -0
- package/dist/commands/new-workflow.js.map +1 -0
- package/dist/commands/tree.d.ts +2 -0
- package/dist/commands/tree.d.ts.map +1 -0
- package/dist/commands/tree.js +55 -0
- package/dist/commands/tree.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +36 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/detector.d.ts +12 -0
- package/dist/lib/detector.d.ts.map +1 -0
- package/dist/lib/detector.js +131 -0
- package/dist/lib/detector.js.map +1 -0
- package/dist/lib/fs.d.ts +7 -0
- package/dist/lib/fs.d.ts.map +1 -0
- package/dist/lib/fs.js +27 -0
- package/dist/lib/fs.js.map +1 -0
- package/dist/lib/ids.d.ts +8 -0
- package/dist/lib/ids.d.ts.map +1 -0
- package/dist/lib/ids.js +19 -0
- package/dist/lib/ids.js.map +1 -0
- package/dist/lib/planner.d.ts +23 -0
- package/dist/lib/planner.d.ts.map +1 -0
- package/dist/lib/planner.js +44 -0
- package/dist/lib/planner.js.map +1 -0
- package/dist/lib/rules.d.ts +18 -0
- package/dist/lib/rules.d.ts.map +1 -0
- package/dist/lib/rules.js +97 -0
- package/dist/lib/rules.js.map +1 -0
- package/dist/lib/templates.d.ts +24 -0
- package/dist/lib/templates.d.ts.map +1 -0
- package/dist/lib/templates.js +391 -0
- package/dist/lib/templates.js.map +1 -0
- package/dist/lib/validator.d.ts +8 -0
- package/dist/lib/validator.d.ts.map +1 -0
- package/dist/lib/validator.js +77 -0
- package/dist/lib/validator.js.map +1 -0
- package/package.json +57 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joel Hayward
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# project-memory
|
|
2
|
+
|
|
3
|
+
> The file system is the system. Structure defines execution. Agents are interchangeable executors.
|
|
4
|
+
|
|
5
|
+
**project-memory** is a file-tree standard and CLI that makes any AI coding tool more effective.
|
|
6
|
+
|
|
7
|
+
It is not an agent framework. It defines how a project's memory, work, and intent are stored so that Claude Code, Cursor, Codex, or any future tool can enter a project cold, read the structure, understand the state, and continue work — without hand-holding.
|
|
8
|
+
|
|
9
|
+
**Spec version:** v1.0.0 — see [SPEC.md](./SPEC.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g project-memory
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or use without installing:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx project-memory init
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
### `project-memory init [name]`
|
|
30
|
+
|
|
31
|
+
Initializes a project-memory structure in the current directory.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cd my-project
|
|
35
|
+
project-memory init
|
|
36
|
+
# or
|
|
37
|
+
project-memory init my-app
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Creates:
|
|
41
|
+
```
|
|
42
|
+
project/
|
|
43
|
+
overview.md
|
|
44
|
+
architecture.md
|
|
45
|
+
context/
|
|
46
|
+
decisions.md
|
|
47
|
+
tasks/
|
|
48
|
+
active.md
|
|
49
|
+
tools/
|
|
50
|
+
global-tools.md
|
|
51
|
+
data/
|
|
52
|
+
.gitkeep
|
|
53
|
+
workflows/
|
|
54
|
+
.gitkeep
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### `project-memory new task "title"`
|
|
60
|
+
|
|
61
|
+
Creates a new task with auto-incremented ID. Updates `tasks/active.md`.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
project-memory new task "Build login page"
|
|
65
|
+
project-memory new task "Add unit tests for auth module"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Creates:
|
|
69
|
+
```
|
|
70
|
+
tasks/TASK-001/
|
|
71
|
+
instructions.md ← define the work
|
|
72
|
+
context.md ← background and relevant files
|
|
73
|
+
output.md ← fill in when done
|
|
74
|
+
data/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### `project-memory new workflow "title"`
|
|
80
|
+
|
|
81
|
+
Creates a new workflow with auto-incremented ID.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
project-memory new workflow "User onboarding"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Creates:
|
|
88
|
+
```
|
|
89
|
+
workflows/WORKFLOW-001/
|
|
90
|
+
overview.md ← goal, task list, completion criteria
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### `project-memory validate`
|
|
96
|
+
|
|
97
|
+
Validates the project-memory structure against the spec.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
project-memory validate
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Checks for:
|
|
104
|
+
- Required folders and files
|
|
105
|
+
- Task folder integrity (`instructions.md`, `context.md`)
|
|
106
|
+
- Workflow folder integrity
|
|
107
|
+
- Non-standard naming
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## How to Use With AI Tools
|
|
112
|
+
|
|
113
|
+
### Claude Code / Claude Cowork
|
|
114
|
+
Point Claude at the project root. It will read `project/overview.md` for context, `tasks/active.md` for current state, and the relevant `TASK-NNN/` folder for the work at hand.
|
|
115
|
+
|
|
116
|
+
### Cursor
|
|
117
|
+
Open the project root. Add a note in your first message: *"Read project/overview.md and tasks/active.md before starting."*
|
|
118
|
+
|
|
119
|
+
### Any other tool
|
|
120
|
+
The same pattern works everywhere. The structure is the interface.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Philosophy
|
|
125
|
+
|
|
126
|
+
- **Visible everything** — No hidden folders. Plain files only.
|
|
127
|
+
- **Human-readable first** — Every file is editable without tooling.
|
|
128
|
+
- **Git-friendly** — All plaintext. Diffs cleanly.
|
|
129
|
+
- **Agent-agnostic** — No Claude-specific syntax. Works with any tool.
|
|
130
|
+
- **Zero-config** — The structure is the config.
|
|
131
|
+
- **Minimal by default** — Only create what's needed.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## What This Is Not
|
|
136
|
+
|
|
137
|
+
- Not an agent framework
|
|
138
|
+
- Not a runtime
|
|
139
|
+
- Not a plugin system
|
|
140
|
+
- Not a UI
|
|
141
|
+
- Not Claude-specific
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Contributing
|
|
146
|
+
|
|
147
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT — see [LICENSE](./LICENSE)
|
package/SPEC.md
ADDED
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
# project-memory — Spec v1.0.0
|
|
2
|
+
|
|
3
|
+
> The file system is the system. Structure defines execution. Agents are interchangeable executors.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Philosophy
|
|
8
|
+
|
|
9
|
+
project-memory is a file-tree standard, not an agent framework. It defines a structured information layer that lives inside a Git repo alongside the codebase. Any AI coding tool — Claude Code, Cursor, Codex, or tools that do not exist yet — can enter the project, read the structure, understand the current state, and continue work without hand-holding.
|
|
10
|
+
|
|
11
|
+
The intelligence lives in the structure, not the agent.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Core Principles
|
|
16
|
+
|
|
17
|
+
1. **Visible everything** — No hidden folders. No internal metadata layers. Plain files only.
|
|
18
|
+
2. **Human-readable first** — Every file is plaintext markdown, editable without tooling.
|
|
19
|
+
3. **Git-friendly** — All markdown. Diffs cleanly. No binary files in the framework layer.
|
|
20
|
+
4. **Agent-agnostic** — No Claude-specific syntax. Works with any tool, any model, any future tool.
|
|
21
|
+
5. **Zero-config** — The structure is the config. No runtime required.
|
|
22
|
+
6. **Minimal by default** — Only create what the rules say. Nothing more.
|
|
23
|
+
7. **Contained** — The entire information layer lives under `project-memory/`. One folder. Zero interference with the codebase.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Repo Integration Model
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
/my-app/ ← Git repo root
|
|
31
|
+
│
|
|
32
|
+
├── src/ ← CODE LAYER (untouched by project-memory)
|
|
33
|
+
├── tests/
|
|
34
|
+
├── package.json
|
|
35
|
+
├── README.md
|
|
36
|
+
│
|
|
37
|
+
├── AI.md ← optional root pointer (recommended)
|
|
38
|
+
│
|
|
39
|
+
└── project-memory/ ← INFORMATION LAYER (fully contained)
|
|
40
|
+
├── README.md
|
|
41
|
+
├── project/
|
|
42
|
+
├── context/
|
|
43
|
+
├── tasks/
|
|
44
|
+
├── workflows/
|
|
45
|
+
├── tools/
|
|
46
|
+
└── data/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The code layer is untouched. project-memory owns exactly one folder (`project-memory/`) and one optional root file (`AI.md`).
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Initialization Philosophy
|
|
54
|
+
|
|
55
|
+
**Deterministic initialization. Rules-driven dynamic structure.**
|
|
56
|
+
|
|
57
|
+
`project-memory init` scans the current directory using a fixed, documented set of signals. It applies a fixed set of rules. It produces a written scaffold plan. It waits for confirmation before writing anything.
|
|
58
|
+
|
|
59
|
+
Every file created traces back to a specific detected signal and a specific applied rule. No guessing. No AI reasoning. No silent assumptions. No hidden heuristics.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Detection Signals
|
|
64
|
+
|
|
65
|
+
### Pass 1 — Is this an existing project?
|
|
66
|
+
|
|
67
|
+
Any one of the following signals triggers the existing project flow:
|
|
68
|
+
|
|
69
|
+
| Signal | Type |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `.git/` | Version control |
|
|
72
|
+
| `package.json` | Node / JS project |
|
|
73
|
+
| `requirements.txt` / `pyproject.toml` | Python project |
|
|
74
|
+
| `Cargo.toml` | Rust project |
|
|
75
|
+
| `go.mod` | Go project |
|
|
76
|
+
| `Gemfile` | Ruby project |
|
|
77
|
+
| `composer.json` | PHP project |
|
|
78
|
+
| `pom.xml` | Java project |
|
|
79
|
+
| `src/` / `app/` / `components/` | Source structure present |
|
|
80
|
+
| `README.md` | Documented project |
|
|
81
|
+
| `Dockerfile` / `docker-compose.yml` | Containerized |
|
|
82
|
+
| `.github/` / `.gitlab-ci.yml` / `Jenkinsfile` | CI configured |
|
|
83
|
+
|
|
84
|
+
If none found → new project flow.
|
|
85
|
+
|
|
86
|
+
### Pass 2 — What type? (existing projects only)
|
|
87
|
+
|
|
88
|
+
| Signal(s) | Inferred Type |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `package.json` + `components/` or `pages/` | web-app |
|
|
91
|
+
| `package.json` alone | node |
|
|
92
|
+
| `requirements.txt` / `pyproject.toml` | python |
|
|
93
|
+
| `Cargo.toml` | rust |
|
|
94
|
+
| `go.mod` | go |
|
|
95
|
+
| `Gemfile` | ruby |
|
|
96
|
+
| `pom.xml` | java |
|
|
97
|
+
| `.git` only, nothing else | generic |
|
|
98
|
+
|
|
99
|
+
### Pass 3 — Maturity signals (existing projects only)
|
|
100
|
+
|
|
101
|
+
| Signal | Effect |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `tests/` or `__tests__/` exists | Flag in architecture template |
|
|
104
|
+
| `docker-compose.yml` exists | Adds `context/dependencies.md` |
|
|
105
|
+
| Multiple manifests detected | Adds `context/dependencies.md` |
|
|
106
|
+
| CI files present | Note in `global-tools.md` template |
|
|
107
|
+
| More than 10 files in `src/` | Adds `context/current-state.md` |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Base Layer
|
|
112
|
+
|
|
113
|
+
Always created. No rules can remove these.
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
project-memory/README.md
|
|
117
|
+
project-memory/project/overview.md
|
|
118
|
+
project-memory/project/architecture.md
|
|
119
|
+
project-memory/context/decisions.md
|
|
120
|
+
project-memory/tasks/active.md
|
|
121
|
+
project-memory/tools/global-tools.md
|
|
122
|
+
project-memory/data/.gitkeep
|
|
123
|
+
project-memory/workflows/.gitkeep
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`AI.md` at repo root is always created for new projects. For existing projects the user is prompted (default yes). It is never required by validation.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Dynamic Expansion Layer
|
|
131
|
+
|
|
132
|
+
Added only when the corresponding rule fires. Never added speculatively.
|
|
133
|
+
|
|
134
|
+
| File | Trigger |
|
|
135
|
+
|---|---|
|
|
136
|
+
| `project-memory/project/brief.md` | New project flow OR web-app type |
|
|
137
|
+
| `project-memory/project/plan.md` | New project flow only |
|
|
138
|
+
| `project-memory/context/current-state.md` | Existing project with maturity signals |
|
|
139
|
+
| `project-memory/context/constraints.md` | Existing project |
|
|
140
|
+
| `project-memory/context/dependencies.md` | `docker-compose.yml` found OR multiple manifests |
|
|
141
|
+
| `project-memory/tasks/completed.md` | Existing project |
|
|
142
|
+
| `project-memory/tasks/archive/.gitkeep` | Existing project with maturity signals |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## `AI.md` — Repo Root Pointer
|
|
147
|
+
|
|
148
|
+
A minimal pointer file at the repo root. Optional but recommended.
|
|
149
|
+
|
|
150
|
+
**Behavior:**
|
|
151
|
+
- New projects: always created without prompting
|
|
152
|
+
- Existing projects: user is asked — `Add AI.md to repo root? (recommended) [Y/n]` — default yes
|
|
153
|
+
- If `AI.md` already exists: always skipped, never overwritten
|
|
154
|
+
- Scaffold proceeds regardless of the AI.md answer
|
|
155
|
+
- Validation never fails or warns for missing AI.md — shows an informational note only
|
|
156
|
+
|
|
157
|
+
**Content (locked — no additions):**
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
# AI Project Entry
|
|
161
|
+
|
|
162
|
+
This project uses the project-memory framework.
|
|
163
|
+
|
|
164
|
+
Start here:
|
|
165
|
+
- project-memory/README.md
|
|
166
|
+
- project-memory/project/overview.md
|
|
167
|
+
- project-memory/tasks/active.md
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## `project-memory/README.md` — Framework Entrypoint
|
|
173
|
+
|
|
174
|
+
Critical infrastructure. The first file any agent reads after `AI.md`. Explains the structure, defines read order, and serves as the navigation guide for humans and agents.
|
|
175
|
+
|
|
176
|
+
Generated by `init`. Users may edit freely after initialization.
|
|
177
|
+
|
|
178
|
+
This file is distinct from the repo root `README.md`, which documents the CLI tool itself. `project-memory/README.md` is the entrypoint for the initialized framework inside a project.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Read Order
|
|
183
|
+
|
|
184
|
+
### Cold Start
|
|
185
|
+
*Agent enters project with no prior context.*
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
1. project-memory/project/overview.md
|
|
189
|
+
2. project-memory/context/current-state.md (if present)
|
|
190
|
+
3. project-memory/tasks/active.md
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Assigned Task
|
|
194
|
+
*Agent has been directed to a specific task.*
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
1. project-memory/tasks/TASK-XXX/instructions.md
|
|
198
|
+
2. project-memory/tasks/TASK-XXX/context.md
|
|
199
|
+
3. project-memory/tasks/TASK-XXX/tools.md (if present)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Full V1 File Tree
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
/my-app/
|
|
208
|
+
│
|
|
209
|
+
├── AI.md ← optional root pointer
|
|
210
|
+
│
|
|
211
|
+
└── project-memory/
|
|
212
|
+
│
|
|
213
|
+
├── README.md ← BASE: entrypoint + read order
|
|
214
|
+
│
|
|
215
|
+
├── project/
|
|
216
|
+
│ ├── overview.md ← BASE
|
|
217
|
+
│ ├── architecture.md ← BASE
|
|
218
|
+
│ ├── brief.md ← DYNAMIC: new project / web-app
|
|
219
|
+
│ └── plan.md ← DYNAMIC: new project only
|
|
220
|
+
│
|
|
221
|
+
├── context/
|
|
222
|
+
│ ├── decisions.md ← BASE
|
|
223
|
+
│ ├── current-state.md ← DYNAMIC: existing + maturity
|
|
224
|
+
│ ├── constraints.md ← DYNAMIC: existing project
|
|
225
|
+
│ └── dependencies.md ← DYNAMIC: docker / multi-manifest
|
|
226
|
+
│
|
|
227
|
+
├── tasks/
|
|
228
|
+
│ ├── active.md ← BASE
|
|
229
|
+
│ ├── completed.md ← DYNAMIC: existing project
|
|
230
|
+
│ ├── archive/ ← DYNAMIC: existing + maturity
|
|
231
|
+
│ │ └── .gitkeep
|
|
232
|
+
│ └── TASK-001/ ← ON DEMAND
|
|
233
|
+
│ ├── instructions.md ← required
|
|
234
|
+
│ ├── context.md ← required
|
|
235
|
+
│ ├── output.md ← required (empty until done)
|
|
236
|
+
│ └── data/
|
|
237
|
+
│ └── .gitkeep
|
|
238
|
+
│
|
|
239
|
+
├── workflows/ ← BASE (empty until first workflow)
|
|
240
|
+
│ ├── .gitkeep
|
|
241
|
+
│ └── WORKFLOW-001/ ← ON DEMAND
|
|
242
|
+
│ └── overview.md
|
|
243
|
+
│
|
|
244
|
+
├── tools/
|
|
245
|
+
│ └── global-tools.md ← BASE
|
|
246
|
+
│
|
|
247
|
+
└── data/
|
|
248
|
+
└── .gitkeep ← BASE (empty until needed)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Folder Definitions
|
|
254
|
+
|
|
255
|
+
### `project-memory/project/`
|
|
256
|
+
|
|
257
|
+
**Purpose:** Stable project definition. Written once, updated infrequently.
|
|
258
|
+
|
|
259
|
+
**Rule:** No operational state here. No task content. No running logs. If it changes week to week, it belongs in `context/`.
|
|
260
|
+
|
|
261
|
+
| File | Layer | Purpose |
|
|
262
|
+
|---|---|---|
|
|
263
|
+
| `overview.md` | Base | What the project is, current goal, tech stack summary |
|
|
264
|
+
| `architecture.md` | Base | System design, components, data flow, key patterns |
|
|
265
|
+
| `brief.md` | Dynamic | What and why. Written at project start. |
|
|
266
|
+
| `plan.md` | Dynamic | How and when. High-level roadmap. New projects only. |
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
### `project-memory/context/`
|
|
271
|
+
|
|
272
|
+
**Purpose:** Dynamic operational context. Everything that explains current state and shapes decisions.
|
|
273
|
+
|
|
274
|
+
**Rule:** `current-state.md` lives here, not in `project/`. It is operational state, not project definition.
|
|
275
|
+
|
|
276
|
+
| File | Layer | Purpose |
|
|
277
|
+
|---|---|---|
|
|
278
|
+
| `decisions.md` | Base | Running log of key decisions, rationale, alternatives rejected |
|
|
279
|
+
| `current-state.md` | Dynamic | Where things stand right now. Max 1 page. Updated regularly. |
|
|
280
|
+
| `constraints.md` | Dynamic | Technical and business constraints |
|
|
281
|
+
| `dependencies.md` | Dynamic | External services, integrations, third-party dependencies |
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
### `project-memory/tasks/`
|
|
286
|
+
|
|
287
|
+
**Purpose:** All work tracking. The execution layer of the framework.
|
|
288
|
+
|
|
289
|
+
| Item | Layer | Purpose |
|
|
290
|
+
|---|---|---|
|
|
291
|
+
| `active.md` | Base | Master task tracker. All current tasks with status. |
|
|
292
|
+
| `completed.md` | Dynamic | Done tasks. Same table format as active.md. |
|
|
293
|
+
| `archive/` | Dynamic | Deep archive for old task folders. |
|
|
294
|
+
| `TASK-NNN/` | On demand | Individual task folder. |
|
|
295
|
+
|
|
296
|
+
**`active.md` table format:**
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
| ID | Title | Status | Affected Files |
|
|
300
|
+
|----------|------------------|-------------|----------------|
|
|
301
|
+
| TASK-001 | Build login page | in-progress | src/auth/ |
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Status values:** `planned` | `in-progress` | `done` | `blocked`
|
|
305
|
+
|
|
306
|
+
**Task folder:**
|
|
307
|
+
|
|
308
|
+
| File | Required | Purpose |
|
|
309
|
+
|---|---|---|
|
|
310
|
+
| `instructions.md` | Yes | Objective, steps, acceptance criteria |
|
|
311
|
+
| `context.md` | Yes | Background, relevant files, dependencies, constraints |
|
|
312
|
+
| `output.md` | Yes (empty until done) | What was done, changes made, outcomes, follow-up |
|
|
313
|
+
| `data/` | No | Task-specific assets |
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
### `project-memory/workflows/`
|
|
318
|
+
|
|
319
|
+
**Purpose:** Named sequences of tasks with a shared goal.
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
workflows/WORKFLOW-001/
|
|
323
|
+
└── overview.md ← goal, ordered task list, completion criteria
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
### `project-memory/tools/`
|
|
329
|
+
|
|
330
|
+
**Purpose:** Project-wide tooling reference. Stable. Not task-specific.
|
|
331
|
+
|
|
332
|
+
Task-specific tooling goes in `tasks/TASK-NNN/tools.md` only.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### `project-memory/data/`
|
|
337
|
+
|
|
338
|
+
**Purpose:** Shared data assets used across multiple tasks. Empty until needed.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Naming Conventions
|
|
343
|
+
|
|
344
|
+
| Item | Convention | Example |
|
|
345
|
+
|---|---|---|
|
|
346
|
+
| Task folders | `TASK-NNN` (3-digit zero-padded) | `TASK-001` |
|
|
347
|
+
| Workflow folders | `WORKFLOW-NNN` (3-digit zero-padded) | `WORKFLOW-001` |
|
|
348
|
+
| All filenames | `kebab-case.md` | `global-tools.md` |
|
|
349
|
+
| Status values | lowercase with hyphens | `in-progress` |
|
|
350
|
+
| Framework root | `project-memory` | always this exact name |
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Validation Rules
|
|
355
|
+
|
|
356
|
+
Validation enforces the **base layer only**. Dynamic files are never required and never checked.
|
|
357
|
+
|
|
358
|
+
### Errors (must fix — validation fails)
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
project-memory/ folder must exist
|
|
362
|
+
project-memory/README.md
|
|
363
|
+
project-memory/project/overview.md
|
|
364
|
+
project-memory/project/architecture.md
|
|
365
|
+
project-memory/context/decisions.md
|
|
366
|
+
project-memory/tasks/active.md
|
|
367
|
+
project-memory/tools/global-tools.md
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Task folder errors (must fix)
|
|
371
|
+
|
|
372
|
+
```
|
|
373
|
+
Each TASK-NNN/ must contain instructions.md
|
|
374
|
+
Each TASK-NNN/ must contain context.md
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Warnings (shown but do not fail validation)
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
TASK-NNN/ missing output.md
|
|
381
|
+
Non-standard folder names inside tasks/
|
|
382
|
+
Non-standard folder names inside workflows/
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Informational notes (never errors, never warnings)
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
AI.md not found at repo root — optional but recommended
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Never checked by validate
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
context/current-state.md
|
|
395
|
+
context/constraints.md
|
|
396
|
+
context/dependencies.md
|
|
397
|
+
project/brief.md
|
|
398
|
+
project/plan.md
|
|
399
|
+
tasks/completed.md
|
|
400
|
+
tasks/archive/
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## `project-memory tree` Command
|
|
406
|
+
|
|
407
|
+
Prints a deterministic ASCII tree of the `project-memory/` directory.
|
|
408
|
+
|
|
409
|
+
**Output rules:**
|
|
410
|
+
- ASCII characters only: `├──`, `└──`, `│`, spaces
|
|
411
|
+
- No color
|
|
412
|
+
- No metadata (no sizes, dates, permissions)
|
|
413
|
+
- Folders listed before files at each level
|
|
414
|
+
- Alphabetical sort within each group independently
|
|
415
|
+
- `.gitkeep` files hidden
|
|
416
|
+
- Empty folders shown
|
|
417
|
+
- No depth limit in v1
|
|
418
|
+
- Pure Node.js `fs` — no external dependencies
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## CLI Commands (v1)
|
|
423
|
+
|
|
424
|
+
| Command | Purpose |
|
|
425
|
+
|---|---|
|
|
426
|
+
| `project-memory init` | Detect → plan → confirm → scaffold |
|
|
427
|
+
| `project-memory init --new` | Force new project flow |
|
|
428
|
+
| `project-memory init --existing` | Force existing project flow |
|
|
429
|
+
| `project-memory init --yes` | Skip confirmation (still prints plan) |
|
|
430
|
+
| `project-memory new task "title"` | Create task folder, update active.md |
|
|
431
|
+
| `project-memory new workflow "title"` | Create workflow folder |
|
|
432
|
+
| `project-memory validate` | Check structure against base layer spec |
|
|
433
|
+
| `project-memory tree` | Print ASCII tree of project-memory/ |
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## Explicitly Excluded from V1
|
|
438
|
+
|
|
439
|
+
Roles, skills, agent definitions, orchestration, runtime logic, plugins, UI, dashboards, AI API calls, multi-project management.
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Spec Version
|
|
444
|
+
|
|
445
|
+
**v1.0.0** — This document is the source of truth. All CLI behavior derives from it.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAYA,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+G1E"}
|