patch.md-intent 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 +95 -0
- package/SPEC.md +93 -0
- package/examples/customization.PATCH.md +27 -0
- package/examples/minimal.PATCH.md +16 -0
- package/examples/retired-fix.PATCH.md +25 -0
- package/package.json +26 -0
- package/template/PATCH.md +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Elliot Drel
|
|
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,95 @@
|
|
|
1
|
+
# PatchMD
|
|
2
|
+
|
|
3
|
+
PatchMD is a proposed convention for keeping customized software updatable.
|
|
4
|
+
|
|
5
|
+
A root `PATCH.md` records the **intent** behind deliberate changes made to a
|
|
6
|
+
fork. The code and Git commits remain the implementation. The document gives a
|
|
7
|
+
future developer or AI agent enough context to preserve, adapt, or retire those
|
|
8
|
+
changes when upstream moves on.
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
customize -> record intent -> update upstream -> repair if needed -> review
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
PatchMD is a draft proposal, not an established standard or finished product.
|
|
15
|
+
It is inspired by [Theo's "A letter to tech CEOs" talk](https://www.youtube.com/watch?v=G1xqTjoihfo),
|
|
16
|
+
the predictable-file approach of [AGENTS.md](https://agents.md/), and a working
|
|
17
|
+
fork-maintenance workflow first developed in
|
|
18
|
+
[gbrain](https://github.com/ElliotDrel/gbrain/commit/2e3053fa000c6e01fc8dc28f0eb4acaa11381c37). An early project-specific
|
|
19
|
+
experiment also exists in [T3 Code PR #3146](https://github.com/pingdotgg/t3code/pull/3146).
|
|
20
|
+
|
|
21
|
+
## The idea
|
|
22
|
+
|
|
23
|
+
When you customize a fork:
|
|
24
|
+
|
|
25
|
+
1. Change the application normally and commit the work normally.
|
|
26
|
+
2. Add or update a `PATCH.md` entry describing the outcome you intended.
|
|
27
|
+
3. Later, update from upstream using normal Git mechanics first.
|
|
28
|
+
4. If a patch conflicts or has become obsolete, use its recorded intent to
|
|
29
|
+
repair or retire it.
|
|
30
|
+
5. Verify and review the result before pushing or deploying it.
|
|
31
|
+
|
|
32
|
+
`PATCH.md` is not a diff, lockfile, or substitute for version control. It
|
|
33
|
+
explains *why the fork differs* so the implementation can change safely.
|
|
34
|
+
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
From the root of your fork, give your agent either of these prompts.
|
|
38
|
+
|
|
39
|
+
### Run the installer directly
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Read and follow this skill in the current repository:
|
|
43
|
+
https://raw.githubusercontent.com/ElliotDrel/PATCH-md/main/skills/install-patch-md/SKILL.md
|
|
44
|
+
|
|
45
|
+
Use it to install PatchMD in this fork.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Install it as a skill
|
|
49
|
+
|
|
50
|
+
Install the
|
|
51
|
+
[install-patch-md skill](skills/install-patch-md/)
|
|
52
|
+
in your agent's skills directory, then run:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
Use the install-patch-md skill to add PatchMD to this fork.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The installer creates `PATCH.md`, inventories existing customizations, and
|
|
59
|
+
adapts the other two repository skills to the fork's upstream and verification
|
|
60
|
+
commands:
|
|
61
|
+
|
|
62
|
+
- `install-patch-md` sets up an existing or new fork.
|
|
63
|
+
- `modify-with-patch-md` records intent while making custom changes.
|
|
64
|
+
- `update-with-patch-md` safely rebases, repairs, verifies, and reports.
|
|
65
|
+
|
|
66
|
+
## What belongs in PATCH.md
|
|
67
|
+
|
|
68
|
+
Record intentional changes to upstream-owned behavior that the fork needs to
|
|
69
|
+
keep. Do not record formatting-only edits, generated files, lockfile churn,
|
|
70
|
+
environment files, ordinary dependency updates, or unrelated local additions.
|
|
71
|
+
|
|
72
|
+
Keep entries about outcomes, not old code. One entry may cover several files or
|
|
73
|
+
commits when they implement one customization.
|
|
74
|
+
|
|
75
|
+
## Specification
|
|
76
|
+
|
|
77
|
+
[SPEC.md](SPEC.md) defines Draft 0.1. The format is intentionally small:
|
|
78
|
+
|
|
79
|
+
- one root `PATCH.md`;
|
|
80
|
+
- one stable ID per customization;
|
|
81
|
+
- plain-English intent, rationale, behavior, scope, and reconstruction guidance;
|
|
82
|
+
- `active` and `retired` lifecycle states;
|
|
83
|
+
- normal Git commits as the implementation record.
|
|
84
|
+
|
|
85
|
+
See [examples/](examples/) for complete files.
|
|
86
|
+
|
|
87
|
+
## Status
|
|
88
|
+
|
|
89
|
+
Draft 0.1 is open for practical feedback from maintainers of private and
|
|
90
|
+
downstream forks. Keep proposals simple and grounded in a real maintenance
|
|
91
|
+
problem.
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT
|
package/SPEC.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# PatchMD Draft 0.1
|
|
2
|
+
|
|
3
|
+
PatchMD is an AI-readable record of the intent behind deliberate customizations
|
|
4
|
+
to a downstream software fork.
|
|
5
|
+
|
|
6
|
+
The key words **MUST**, **MUST NOT**, **SHOULD**, and **MAY** describe this draft's
|
|
7
|
+
requirements.
|
|
8
|
+
|
|
9
|
+
## File
|
|
10
|
+
|
|
11
|
+
- The file MUST be named `PATCH.md` and live at the repository root.
|
|
12
|
+
- The file MUST be readable as ordinary Markdown without special tooling.
|
|
13
|
+
- A repository MUST have at most one authoritative `PATCH.md`.
|
|
14
|
+
- The file SHOULD identify the upstream repository and branch.
|
|
15
|
+
|
|
16
|
+
## Scope
|
|
17
|
+
|
|
18
|
+
An entry belongs in `PATCH.md` when it describes an intentional change to
|
|
19
|
+
upstream-owned behavior that the downstream fork expects to preserve.
|
|
20
|
+
|
|
21
|
+
The file SHOULD NOT track:
|
|
22
|
+
|
|
23
|
+
- formatting-only or incidental refactors;
|
|
24
|
+
- generated files or dependency lockfiles;
|
|
25
|
+
- local environment configuration or secrets;
|
|
26
|
+
- ordinary dependency updates;
|
|
27
|
+
- additions that upstream cannot overwrite and that need no upgrade handling.
|
|
28
|
+
|
|
29
|
+
## Entries
|
|
30
|
+
|
|
31
|
+
Each customization MUST have a stable, human-readable ID. A kebab-case ID such
|
|
32
|
+
as `compact-navigation` is recommended. IDs MUST NOT depend on commit hashes or
|
|
33
|
+
list positions.
|
|
34
|
+
|
|
35
|
+
Each entry MUST contain:
|
|
36
|
+
|
|
37
|
+
- **Status:** `active` or `retired`.
|
|
38
|
+
- **Intent:** the user or product outcome being preserved.
|
|
39
|
+
- **Why:** why the downstream fork needs the change.
|
|
40
|
+
- **Behavior:** observable requirements that should remain true.
|
|
41
|
+
- **Scope:** affected files, packages, or subsystems.
|
|
42
|
+
- **Reconstruction:** guidance and constraints for implementing the intent on
|
|
43
|
+
newer upstream code.
|
|
44
|
+
|
|
45
|
+
An entry MAY include implementation notes and links to commits, issues, or
|
|
46
|
+
upstream pull requests. It SHOULD NOT contain a full source patch. One entry MAY
|
|
47
|
+
cover multiple files or commits when they serve one intent.
|
|
48
|
+
|
|
49
|
+
## Lifecycle
|
|
50
|
+
|
|
51
|
+
### Record
|
|
52
|
+
|
|
53
|
+
Downstream code MUST remain in ordinary Git commits. The matching `PATCH.md`
|
|
54
|
+
entry SHOULD be added or refreshed in the same logical change.
|
|
55
|
+
|
|
56
|
+
### Update
|
|
57
|
+
|
|
58
|
+
An update process MUST:
|
|
59
|
+
|
|
60
|
+
1. refuse to discard uncommitted work;
|
|
61
|
+
2. create a recoverable reference before rewriting history;
|
|
62
|
+
3. try normal Git integration before reconstructing code;
|
|
63
|
+
4. preserve displaced downstream content before resolving a conflict;
|
|
64
|
+
5. prefer the new upstream version when a conflict cannot be resolved safely;
|
|
65
|
+
6. verify the resulting repository with its own checks;
|
|
66
|
+
7. make no push or deployment without user approval.
|
|
67
|
+
|
|
68
|
+
### Resolve
|
|
69
|
+
|
|
70
|
+
When mechanical integration is insufficient, a developer or agent SHOULD
|
|
71
|
+
compare the new upstream implementation, the previous downstream
|
|
72
|
+
implementation, and the matching `PATCH.md` intent.
|
|
73
|
+
|
|
74
|
+
It MUST reconstruct intent rather than blindly restore old text. Ambiguous work
|
|
75
|
+
MUST be shown to the user instead of guessed.
|
|
76
|
+
|
|
77
|
+
### Retire
|
|
78
|
+
|
|
79
|
+
When upstream satisfies an intent or the customization is abandoned, its entry
|
|
80
|
+
MUST be marked `retired` rather than deleted. The reason and relevant upstream
|
|
81
|
+
reference SHOULD be recorded.
|
|
82
|
+
|
|
83
|
+
## Review
|
|
84
|
+
|
|
85
|
+
The user MUST be told which customizations were preserved, changed, retired, or
|
|
86
|
+
left unresolved. The result MUST be reviewed before it is pushed, deployed, or
|
|
87
|
+
otherwise adopted.
|
|
88
|
+
|
|
89
|
+
## Compatibility
|
|
90
|
+
|
|
91
|
+
PatchMD does not require a specific agent, package manager, programming
|
|
92
|
+
language, or upgrade program. Tools MAY automate this lifecycle if they preserve
|
|
93
|
+
the guarantees above.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# PATCH.md
|
|
2
|
+
|
|
3
|
+
This file records the intent behind deliberate customizations to this fork.
|
|
4
|
+
|
|
5
|
+
## Upstream
|
|
6
|
+
|
|
7
|
+
- Repository: `https://github.com/example/notes-app`
|
|
8
|
+
- Branch: `main`
|
|
9
|
+
|
|
10
|
+
## Active customizations
|
|
11
|
+
|
|
12
|
+
### compact-navigation
|
|
13
|
+
|
|
14
|
+
- **Status:** active
|
|
15
|
+
- **Intent:** Let keyboard-heavy users switch sections without opening the
|
|
16
|
+
navigation drawer.
|
|
17
|
+
- **Why:** Upstream requires pointer interaction for every section change.
|
|
18
|
+
- **Behavior:** `Ctrl+1` through `Ctrl+4` switch the four primary sections;
|
|
19
|
+
shortcuts do nothing while a text field is active.
|
|
20
|
+
- **Scope:** Desktop keyboard handling and primary navigation state.
|
|
21
|
+
- **Reconstruction:** Use upstream's current command and navigation APIs. Keep
|
|
22
|
+
the text-input guard and avoid a second navigation state store.
|
|
23
|
+
- **References:** Downstream issue `#12`.
|
|
24
|
+
|
|
25
|
+
## Retired customizations
|
|
26
|
+
|
|
27
|
+
No retired customizations.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# PATCH.md
|
|
2
|
+
|
|
3
|
+
This file records the intent behind deliberate customizations to this fork.
|
|
4
|
+
|
|
5
|
+
## Upstream
|
|
6
|
+
|
|
7
|
+
- Repository: `https://github.com/example/notes-app`
|
|
8
|
+
- Branch: `main`
|
|
9
|
+
|
|
10
|
+
## Active customizations
|
|
11
|
+
|
|
12
|
+
No active customizations.
|
|
13
|
+
|
|
14
|
+
## Retired customizations
|
|
15
|
+
|
|
16
|
+
No retired customizations.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# PATCH.md
|
|
2
|
+
|
|
3
|
+
This file records the intent behind deliberate customizations to this fork.
|
|
4
|
+
|
|
5
|
+
## Upstream
|
|
6
|
+
|
|
7
|
+
- Repository: `https://github.com/example/notes-app`
|
|
8
|
+
- Branch: `main`
|
|
9
|
+
|
|
10
|
+
## Active customizations
|
|
11
|
+
|
|
12
|
+
No active customizations.
|
|
13
|
+
|
|
14
|
+
## Retired customizations
|
|
15
|
+
|
|
16
|
+
### preserve-drafts-on-refresh
|
|
17
|
+
|
|
18
|
+
- **Status:** retired
|
|
19
|
+
- **Intent:** Prevent unsaved drafts from disappearing after a browser refresh.
|
|
20
|
+
- **Why:** Older upstream releases stored drafts only in component memory.
|
|
21
|
+
- **Behavior:** A refresh restores the latest unsaved draft for the open note.
|
|
22
|
+
- **Scope:** Draft persistence and note editor initialization.
|
|
23
|
+
- **Reconstruction:** No longer required. Upstream now persists draft state and
|
|
24
|
+
restores it before rendering the editor.
|
|
25
|
+
- **References:** Retired after upstream PR `#456`.
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "patch.md-intent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A convention for keeping customized software forks updatable. Add a PATCH.md to record the intent behind your fork's deliberate changes.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"patch",
|
|
7
|
+
"fork",
|
|
8
|
+
"upstream",
|
|
9
|
+
"convention",
|
|
10
|
+
"ai",
|
|
11
|
+
"agent"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/ElliotDrel/PATCH-md",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/ElliotDrel/PATCH-md.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Elliot Drel",
|
|
20
|
+
"files": [
|
|
21
|
+
"README.md",
|
|
22
|
+
"SPEC.md",
|
|
23
|
+
"template/",
|
|
24
|
+
"examples/"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# PATCH.md
|
|
2
|
+
|
|
3
|
+
This file records the intent behind deliberate customizations to this fork.
|
|
4
|
+
Code and Git commits are the implementation; this file explains what must
|
|
5
|
+
survive an upstream update.
|
|
6
|
+
|
|
7
|
+
## Upstream
|
|
8
|
+
|
|
9
|
+
- Repository: `https://github.com/OWNER/REPOSITORY`
|
|
10
|
+
- Branch: `main`
|
|
11
|
+
|
|
12
|
+
## Active customizations
|
|
13
|
+
|
|
14
|
+
<!-- Copy this section for each customization. Use a stable kebab-case ID. -->
|
|
15
|
+
|
|
16
|
+
### customization-id
|
|
17
|
+
|
|
18
|
+
- **Status:** active
|
|
19
|
+
- **Intent:** What outcome should this customization provide?
|
|
20
|
+
- **Why:** Why does this fork need behavior that upstream does not provide?
|
|
21
|
+
- **Behavior:** What observable requirements must remain true?
|
|
22
|
+
- **Scope:** Which files, packages, or subsystems are involved?
|
|
23
|
+
- **Reconstruction:** How should a future developer or agent rebuild the intent
|
|
24
|
+
on newer upstream code? Include constraints, not a full code patch.
|
|
25
|
+
- **References:** Optional commits, issues, or upstream pull requests.
|
|
26
|
+
|
|
27
|
+
## Retired customizations
|
|
28
|
+
|
|
29
|
+
Move or copy retired entries here, set `Status` to `retired`, and explain why
|
|
30
|
+
the customization is no longer needed. Do not delete its history.
|