code-anchored-context 0.2.0 → 0.2.1

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/context/README.md CHANGED
@@ -10,10 +10,6 @@ implementation plans, and release-documentation notes. Do not use
10
10
 
11
11
  ## Start Here
12
12
 
13
- - `code-anchored-context.html` is a human-friendly visual brief for this
14
- opinionated context practice.
15
- - `giving-ai-agents-context-around-code.md` is an article-form explanation of
16
- Code-Anchored Context for human-agent collaboration.
17
13
  - `terminology.md` defines the shared vocabulary.
18
14
  - `current.md` points to the active release context.
19
15
  - `programs/` contains durable multi-release working context.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "code-anchored-context",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Install repo-local agent context, release initiatives, and release-anchored docs scaffolding into an existing project.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
- "code-anchored-context": "./bin/code-anchored-context.js"
8
+ "code-anchored-context": "bin/code-anchored-context.js"
9
9
  },
10
10
  "files": [
11
11
  "AGENTS.md",
@@ -14,11 +14,7 @@
14
14
  "context/README.md",
15
15
  "context/_templates/",
16
16
  "context/backlog/",
17
- "context/code-anchored-context-structure.md",
18
- "context/code-anchored-context-why.md",
19
- "context/code-anchored-context.html",
20
17
  "context/current.md",
21
- "context/giving-ai-agents-context-around-code.md",
22
18
  "context/programs/",
23
19
  "context/releases/v0_1_0/README.md",
24
20
  "context/releases/v0_1_0/backlog.md",
@@ -1,133 +0,0 @@
1
- # Code-Anchored Context: The Structure
2
-
3
- This is the companion to the
4
- [reasoning article](code-anchored-context-why.md). It covers how working
5
- context is laid out so both humans and agents can navigate it.
6
-
7
- ## Denormalize Navigation, Not Knowledge
8
-
9
- Agents and IDEs do not always open from the repo root. They may start in
10
- product code, CI/CD config, infrastructure code, generated artifacts, or a
11
- nested app. If all guidance lives at the top, it gets missed. If each area
12
- keeps its own plans, cross-project work fragments.
13
-
14
- > Denormalize navigation, not knowledge.
15
-
16
- Local `AGENTS.md` files point agents toward the right place. But plans, specs,
17
- ADRs, release context, testing strategy, delivery notes, and infrastructure
18
- context live centrally under `context/`.
19
-
20
- ## The Core Model
21
-
22
- Vocabulary is captured in `context/terminology.md`. The main containers:
23
-
24
- ```text
25
- Program Long-lived multi-release effort.
26
- Planned initiative A scoped future slice inside a program.
27
- Release initiative Active or historical work for a specific release.
28
- Context backlog item Isolated work cut from scope but worth preserving.
29
- Program release slice What a release contributes to a program.
30
- ```
31
-
32
- Each kind of context gets a home:
33
-
34
- ```text
35
- context/
36
- terminology.md
37
- current.md
38
- programs/
39
- backlog/
40
- releases/
41
- _templates/
42
- ```
43
-
44
- Structure follows delivery concerns, not technologies. Name a file for the
45
- knowledge it preserves, not the tool that produced it.
46
-
47
- ## Release Initiatives
48
-
49
- The main unit of active delivery:
50
-
51
- ```text
52
- context/releases/<version>/initiatives/<initiative>/
53
- README.md plan.md spec.md interface.md architecture.md
54
- testing.md delivery.md infrastructure.md operations.md
55
- backlog.md decisions/ release-doc-notes.md
56
- ```
57
-
58
- The most important file is `plan.md` — the working alignment space. It can be
59
- messy with notes, options, and tradeoffs, with one rule:
60
-
61
- > `plan.md` may be messy, but it must not be the only place settled truth lives.
62
-
63
- Once something stabilizes, it moves to a durable file:
64
-
65
- ```text
66
- spec.md What the system should do.
67
- interface.md How clients, APIs, config, or tools interact with it.
68
- architecture.md Internal shape, boundaries, data flow, tradeoffs.
69
- testing.md Verification strategy, coverage, gates, known gaps.
70
- delivery.md CI/CD, build, deployment, promotion, release toggles.
71
- infrastructure.md Environments, IaC, networking, identity, storage, secrets.
72
- operations.md Runtime/support: observability, failure modes, rollback.
73
- backlog.md Trackable work items and progress.
74
- decisions/ Durable decisions and consequences (ADRs).
75
- release-doc-notes.md What should become product documentation later.
76
- ```
77
-
78
- Not every initiative needs every file. The point is to give stable knowledge a
79
- place to land — testing, delivery, and infrastructure are first-class context,
80
- not afterthoughts buried in pipeline files or PRs.
81
-
82
- ## Programs And Planned Initiatives
83
-
84
- Some work is bigger than one release. A program holds durable multi-release
85
- context:
86
-
87
- ```text
88
- context/programs/<program>/
89
- README.md context.md roadmap.md backlog.md
90
- decisions/ planned-initiatives/ releases/
91
- ```
92
-
93
- Future work that is clear enough to plan — but whose target release is not
94
- current yet — becomes a planned initiative:
95
-
96
- ```text
97
- context/programs/<program>/planned-initiatives/<initiative>/
98
- ```
99
-
100
- When the target release becomes current, it is promoted into
101
- `context/releases/<version>/initiatives/<initiative>/`. Promotion is
102
- explicit; the original planned initiative stays as historical context.
103
-
104
- ## Context Backlog
105
-
106
- Work cut from scope but worth preserving — when it doesn't justify a program or
107
- planned initiative — lives in:
108
-
109
- ```text
110
- context/backlog/items/<originating-initiative>--<item>.md
111
- ```
112
-
113
- Each item records where it came from, why it was deferred, future value, and
114
- re-entry criteria. If picked up later, it is marked promoted and linked — never
115
- silently rewritten.
116
-
117
- ## Release Transitions
118
-
119
- Changing the current release is more than editing a pointer. When
120
- `context/current.md` moves to a new release, agents should scan program
121
- planned initiatives, promote items targeting the new release into the release
122
- folder, update links both ways, and preserve the originals as history.
123
-
124
- ```mermaid
125
- flowchart TD
126
- Start["Set a new current release"]
127
- Scan["Scan program planned initiatives"]
128
- Promote["Promote into releases/<version>/initiatives/"]
129
- Link["Update links both ways"]
130
- Preserve["Preserve original as history"]
131
-
132
- Start --> Scan --> Promote --> Link --> Preserve
133
- ```
@@ -1,80 +0,0 @@
1
- # Code-Anchored Context: Giving AI Agents The Context Around The Code
2
-
3
- AI agents are good at reading repositories, editing files, and following
4
- instructions. But in large codebases, code is not the whole story.
5
-
6
- The hard part is not whether an agent can change a file. It is whether it
7
- understands the intent behind the change, the current release scope, the
8
- decisions already made, the work deliberately deferred, how the change should
9
- be verified, how it ships, and what infrastructure or operational risks
10
- surround it.
11
-
12
- That context usually exists — in chats, tickets, pull request comments,
13
- planning notes, and people's heads — but agents need it in a structured,
14
- discoverable form.
15
-
16
- ## Docs vs Working Context
17
-
18
- This is why I separate **released product documentation** from **working
19
- context**:
20
-
21
- ```text
22
- docs/ What shipped.
23
- context/ What we are planning, building, deciding, testing,
24
- shipping, hosting, deferring, and learning.
25
- ```
26
-
27
- Product documentation stays stable and release-accurate: it describes a known
28
- release, not an unfinished branch. Working context is allowed to evolve —
29
- it is where humans and agents work through ambiguity.
30
-
31
- ## The Principle
32
-
33
- I think of this as **Code-Anchored Context**. Not a methodology — a rule of
34
- thumb:
35
-
36
- > Keep truth as close to code as possible, and keep the surrounding context
37
- > structured enough that both humans and agents can find it.
38
-
39
- It is opinionated on purpose: prefer repository-local context, explicit
40
- lifetimes, and navigable structure over scattered notes that only make sense
41
- to the people who were in the room. Repository-local context scales beyond one
42
- person.
43
-
44
- ## Why It Travels
45
-
46
- When context is materialized in the repository, it stops being tied to one
47
- chat transcript, IDE, agent, or session. A team can switch tools without
48
- losing the trail of why the system is shaped the way it is. The next human or
49
- agent opens the repo and continues from the same accumulated understanding
50
- instead of reconstructing it from memory.
51
-
52
- ```mermaid
53
- flowchart LR
54
- Code["Codebase<br/>What exists"]
55
- Dev["context/<br/>What is being planned, built, decided, tested, shipped, deferred"]
56
- Docs["docs/<br/>What shipped in a known release"]
57
- Agents["Agents and humans"]
58
-
59
- Agents --> Code
60
- Agents --> Dev
61
- Dev -->|"release-doc-notes.md captures future docs impact"| Docs
62
- Docs -->|"stable release truth"| Agents
63
- ```
64
-
65
- ## Why It Matters
66
-
67
- Code-Anchored Context is context continuity. It helps agents and humans answer:
68
-
69
- - What is active now, and what belongs to a future phase?
70
- - What was cut from scope, and why was a decision made?
71
- - How should this be tested, and what gates must pass before release?
72
- - How will it ship, and what infrastructure does it depend on?
73
- - What should become product documentation later?
74
- - What reasoning needs to survive a change of IDE, agent, or session?
75
-
76
- Code tells an agent *what exists*. Working context tells it *why* it
77
- exists, where it is going, what has been decided, and what was left for later.
78
-
79
- For the concrete folder layout, see the companion article,
80
- [Code-Anchored Context: The Structure](code-anchored-context-structure.md).