@llblab/pi-kit 0.3.2 → 0.4.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/AGENTS.md +3 -3
- package/BACKLOG.md +1 -1
- package/CHANGELOG.md +6 -0
- package/README.md +19 -10
- package/node_modules/@llblab/pi-actors/AGENTS.md +1 -0
- package/node_modules/@llblab/pi-actors/CHANGELOG.md +6 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/SKILL.md +16 -6
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/SKILL.md +3 -3
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/genapps/music-player.mjs +6 -4
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/scripts/playback.mjs +85 -18
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/SKILL.md +2 -6
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/references/development-swarm.md +2 -31
- package/node_modules/@llblab/pi-actors/docs/recipe-library.md +1 -1
- package/node_modules/@llblab/pi-actors/package.json +1 -1
- package/node_modules/@llblab/pi-actors/skills/actors/SKILL.md +16 -6
- package/node_modules/@llblab/pi-actors/skills/music-player/SKILL.md +3 -3
- package/node_modules/@llblab/pi-actors/skills/music-player/genapps/music-player.mjs +6 -4
- package/node_modules/@llblab/pi-actors/skills/music-player/scripts/playback.mjs +85 -18
- package/node_modules/@llblab/pi-actors/skills/swarm/SKILL.md +2 -6
- package/node_modules/@llblab/pi-actors/skills/swarm/references/development-swarm.md +2 -31
- package/node_modules/@llblab/pi-clean-room/AGENTS.md +5 -0
- package/node_modules/@llblab/pi-clean-room/BACKLOG.md +3 -0
- package/node_modules/@llblab/pi-clean-room/CHANGELOG.md +15 -0
- package/node_modules/@llblab/pi-clean-room/README.md +61 -0
- package/node_modules/@llblab/pi-clean-room/banner.jpg +0 -0
- package/node_modules/@llblab/pi-clean-room/index.ts +178 -0
- package/node_modules/@llblab/pi-clean-room/package.json +53 -0
- package/node_modules/@llblab/pi-grow-loop/AGENTS.md +1 -1
- package/node_modules/@llblab/pi-grow-loop/CHANGELOG.md +4 -0
- package/node_modules/@llblab/pi-grow-loop/package.json +1 -1
- package/node_modules/@llblab/pi-grow-loop/skills/grow-loop/SKILL.md +3 -17
- package/node_modules/@llblab/pi-state-flow/AGENTS.md +28 -0
- package/node_modules/@llblab/pi-state-flow/BACKLOG.md +3 -0
- package/node_modules/@llblab/pi-state-flow/CHANGELOG.md +79 -0
- package/node_modules/@llblab/pi-state-flow/README.md +197 -0
- package/node_modules/@llblab/pi-state-flow/index.ts +4 -0
- package/node_modules/@llblab/pi-state-flow/lib/context.ts +88 -0
- package/node_modules/@llblab/pi-state-flow/lib/episode.ts +29 -0
- package/node_modules/@llblab/pi-state-flow/lib/extension.ts +238 -0
- package/node_modules/@llblab/pi-state-flow/lib/json.ts +78 -0
- package/node_modules/@llblab/pi-state-flow/lib/recovery.ts +38 -0
- package/node_modules/@llblab/pi-state-flow/lib/session.ts +49 -0
- package/node_modules/@llblab/pi-state-flow/lib/skills.ts +58 -0
- package/node_modules/@llblab/pi-state-flow/lib/snapshot.ts +103 -0
- package/node_modules/@llblab/pi-state-flow/lib/state.ts +20 -0
- package/node_modules/@llblab/pi-state-flow/lib/status.ts +16 -0
- package/node_modules/@llblab/pi-state-flow/lib/terminal.ts +148 -0
- package/node_modules/@llblab/pi-state-flow/lib/transition.ts +47 -0
- package/node_modules/@llblab/pi-state-flow/lib/validation.ts +27 -0
- package/node_modules/@llblab/pi-state-flow/package.json +55 -0
- package/node_modules/@llblab/pi-telegram/BACKLOG.md +2 -0
- package/node_modules/@llblab/pi-telegram/CHANGELOG.md +12 -0
- package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +17 -5
- package/node_modules/@llblab/pi-telegram/index.ts +9 -0
- package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +29 -18
- package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +15 -6
- package/node_modules/@llblab/pi-telegram/lib/bus.ts +11 -4
- package/node_modules/@llblab/pi-telegram/lib/routing.ts +89 -32
- package/node_modules/@llblab/pi-telegram/lib/sync.ts +74 -15
- package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +32 -1
- package/node_modules/@llblab/pi-telegram/lib/thread-reconciler.ts +17 -0
- package/node_modules/@llblab/pi-telegram/lib/threads.ts +123 -15
- package/node_modules/@llblab/pi-telegram/package.json +1 -1
- package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/references/diagnosis.md +4 -2
- package/node_modules/@llblab/skills/abcd-context/AGENTS.md +40 -0
- package/node_modules/@llblab/skills/abcd-context/BACKLOG.md +3 -0
- package/node_modules/@llblab/skills/abcd-context/CHANGELOG.md +19 -0
- package/node_modules/@llblab/skills/abcd-context/README.md +30 -0
- package/node_modules/@llblab/skills/abcd-context/SKILL.md +122 -0
- package/node_modules/@llblab/skills/abcd-context/docs/README.md +9 -0
- package/node_modules/@llblab/skills/abcd-context/docs/protocols.md +199 -0
- package/node_modules/@llblab/skills/abcd-context/docs/templates.md +194 -0
- package/node_modules/@llblab/skills/abcd-context/docs/validation-design.md +117 -0
- package/node_modules/@llblab/skills/abcd-context/fixtures/abcd-project/AGENTS.md +10 -0
- package/node_modules/@llblab/skills/abcd-context/fixtures/abcd-project/BACKLOG.md +5 -0
- package/node_modules/@llblab/skills/abcd-context/fixtures/abcd-project/CHANGELOG.md +5 -0
- package/node_modules/@llblab/skills/abcd-context/fixtures/abcd-project/README.md +10 -0
- package/node_modules/@llblab/skills/abcd-context/fixtures/abcd-project/docs/README.md +7 -0
- package/node_modules/@llblab/skills/abcd-context/fixtures/abcd-project/docs/overview.md +3 -0
- package/node_modules/@llblab/skills/abcd-context/recipes/validate-context.json +7 -0
- package/node_modules/@llblab/skills/abcd-context/scripts/_self-test.mjs +244 -0
- package/node_modules/@llblab/skills/abcd-context/scripts/validate-context.mjs +497 -0
- package/node_modules/@llblab/skills/brain-storm/AGENTS.md +5 -0
- package/node_modules/@llblab/skills/brain-storm/SKILL.md +321 -0
- package/node_modules/@llblab/skills/coding-contract/SKILL.md +228 -0
- package/node_modules/@llblab/skills/domain-dag/AGENTS.md +6 -0
- package/node_modules/@llblab/skills/domain-dag/SKILL.md +257 -0
- package/node_modules/@llblab/skills/domain-dag/domain-dag.json +9 -0
- package/node_modules/@llblab/skills/domain-dag/recipes/validate-domain-dag.json +7 -0
- package/node_modules/@llblab/skills/domain-dag/scripts/validate-domain-dag.mjs +771 -0
- package/node_modules/@llblab/skills/domain-dag/scripts/validate-domain-dag.sh +4 -0
- package/node_modules/@llblab/skills/edge-tts/AGENTS.md +19 -0
- package/node_modules/@llblab/skills/edge-tts/SKILL.md +56 -0
- package/node_modules/@llblab/skills/edge-tts/recipes/say-edge.json +9 -0
- package/node_modules/@llblab/skills/edge-tts/scripts/say.mjs +1548 -0
- package/node_modules/@llblab/skills/edge-tts/scripts/say.sh +4 -0
- package/node_modules/@llblab/skills/extra-self/SKILL.md +229 -0
- package/node_modules/@llblab/skills/frontend-design/SKILL.md +78 -0
- package/node_modules/@llblab/skills/groq-stt/AGENTS.md +15 -0
- package/node_modules/@llblab/skills/groq-stt/SKILL.md +35 -0
- package/node_modules/@llblab/skills/groq-stt/recipes/transcribe-groq.json +10 -0
- package/node_modules/@llblab/skills/groq-stt/scripts/transcribe.mjs +190 -0
- package/node_modules/@llblab/skills/groq-stt/scripts/transcribe.sh +4 -0
- package/node_modules/@llblab/skills/mistral-stt/AGENTS.md +15 -0
- package/node_modules/@llblab/skills/mistral-stt/SKILL.md +35 -0
- package/node_modules/@llblab/skills/mistral-stt/recipes/transcribe-mistral.json +10 -0
- package/node_modules/@llblab/skills/mistral-stt/scripts/transcribe.mjs +191 -0
- package/node_modules/@llblab/skills/mistral-stt/scripts/transcribe.sh +4 -0
- package/node_modules/@llblab/skills/package.json +46 -0
- package/node_modules/@llblab/skills/re-review/SKILL.md +318 -0
- package/node_modules/@llblab/skills/release-flow/SKILL.md +456 -0
- package/node_modules/@llblab/skills/show-me/SKILL.md +144 -0
- package/package.json +20 -8
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/scripts/playback-client.mjs +0 -143
- package/node_modules/@llblab/pi-actors/skills/music-player/scripts/playback-client.mjs +0 -143
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# ABCd Context Protocols
|
|
2
|
+
|
|
3
|
+
Deep reference for the operating kernel in [SKILL.md](../SKILL.md). This document owns file resolution, full reconciliation, state transitions, consolidation, and local-overlay coexistence.
|
|
4
|
+
|
|
5
|
+
## File Resolution
|
|
6
|
+
|
|
7
|
+
### Human Entrypoints
|
|
8
|
+
|
|
9
|
+
Root and subtree `README.md` files form the human navigation plane.
|
|
10
|
+
|
|
11
|
+
- Root `README.md` should link to the durable protocol, canonical open work, completed history when present, and primary docs index.
|
|
12
|
+
- A subtree `README.md` becomes managed when the subtree acts as a real human entrypoint.
|
|
13
|
+
- Update the nearest relevant README when setup, topology, ownership, usage semantics, or same-domain operator/developer knowledge changes.
|
|
14
|
+
- Keep subtree entrypoints reachable from a parent README, root README, or docs index.
|
|
15
|
+
|
|
16
|
+
### Durable Protocol
|
|
17
|
+
|
|
18
|
+
Preferred file: `AGENTS.md`.
|
|
19
|
+
|
|
20
|
+
Accepted inherited fallbacks, in resolution order: `CLAUDE.md`, `CODEX.md`, `GEMINI.md`, `CONTEXT.md`.
|
|
21
|
+
|
|
22
|
+
Create `AGENTS.md` only when project convention permits it. If an inherited durable file contains useful material but mixes abstraction levels or state types, restructure it toward the appropriate template instead of appending another flat section.
|
|
23
|
+
|
|
24
|
+
### Canonical Open Work
|
|
25
|
+
|
|
26
|
+
Preferred file: `BACKLOG.md`.
|
|
27
|
+
|
|
28
|
+
Accepted inherited fallbacks: `TODO.md`, `PLAN.md`, `ROADMAP.md`.
|
|
29
|
+
|
|
30
|
+
- If exactly one exists and project behavior confirms it, use it.
|
|
31
|
+
- If several exist, identify the actively maintained canonical source before editing.
|
|
32
|
+
- Prefer eventual convergence toward one source, but do not rename established project files casually.
|
|
33
|
+
- Never mirror the same open item across multiple plans.
|
|
34
|
+
|
|
35
|
+
### Completed Delivery
|
|
36
|
+
|
|
37
|
+
Preferred file: `CHANGELOG.md`.
|
|
38
|
+
|
|
39
|
+
If the project already keeps canonical shipped history elsewhere, preserve that convention rather than inventing a parallel changelog. Completed delivery never belongs as rolling history in `AGENTS.md`.
|
|
40
|
+
|
|
41
|
+
### Documentation Plane
|
|
42
|
+
|
|
43
|
+
- `docs/README.md` indexes project documentation.
|
|
44
|
+
- `docs/*` owns subsystem, architecture, operations, decision, and public-contract detail.
|
|
45
|
+
- Root protocol files should link to docs rather than duplicate them.
|
|
46
|
+
|
|
47
|
+
## Adaptation and Restructuring
|
|
48
|
+
|
|
49
|
+
When writing managed files:
|
|
50
|
+
|
|
51
|
+
1. Read the current structure, tone, and ownership.
|
|
52
|
+
2. Decide whether the structure still represents reality honestly.
|
|
53
|
+
3. Match established form when it remains clear.
|
|
54
|
+
4. Restructure when one file mixes durable protocol, open work, completed history, or unrelated documentation.
|
|
55
|
+
5. Route new information only after ownership becomes clear.
|
|
56
|
+
6. Consolidate existing duplication in the same pass when safe.
|
|
57
|
+
|
|
58
|
+
Use [templates.md](./templates.md) for new/empty files and as target shapes for inherited drift. Choose the lean `AGENTS.md` starter for low coordination load and the layered starter only when real subsystem or governance complexity justifies it.
|
|
59
|
+
|
|
60
|
+
Do not preserve accidental formatting merely because it exists. Do not impose a mature hierarchy on a tiny project.
|
|
61
|
+
|
|
62
|
+
## Proportional Reconciliation
|
|
63
|
+
|
|
64
|
+
### Light Pass
|
|
65
|
+
|
|
66
|
+
Use after a small meaningful slice:
|
|
67
|
+
|
|
68
|
+
1. Reconcile the affected backlog item.
|
|
69
|
+
2. Update the nearest README or contract doc only if user-facing or operator-facing truth changed.
|
|
70
|
+
3. Record a changelog outcome only when delivery is meaningful.
|
|
71
|
+
4. Promote a durable lesson only when it will change future behavior.
|
|
72
|
+
5. Validate changed context and stop.
|
|
73
|
+
|
|
74
|
+
### Full Pass
|
|
75
|
+
|
|
76
|
+
Use for architecture changes, broad documentation refactors, migration of context ownership, or explicit audits:
|
|
77
|
+
|
|
78
|
+
1. Map root files, README entrypoints, docs index, and local overlays.
|
|
79
|
+
2. Identify canonical owners for durable protocol, open work, shipped history, and subsystem contracts.
|
|
80
|
+
3. Compare claims with repository reality.
|
|
81
|
+
4. Repair backlog truth first.
|
|
82
|
+
5. Repair README entrypoints and navigation.
|
|
83
|
+
6. Reconcile subsystem docs and docs index coverage.
|
|
84
|
+
7. Record meaningful delivered outcomes.
|
|
85
|
+
8. Promote only reusable constraints into durable protocol.
|
|
86
|
+
9. Merge duplicates and remove stale context.
|
|
87
|
+
10. Run validation, inspect warnings, and repeat only for concrete remaining drift.
|
|
88
|
+
|
|
89
|
+
## Backlog State Transitions
|
|
90
|
+
|
|
91
|
+
Use one of these explicit transitions:
|
|
92
|
+
|
|
93
|
+
- `Close`: Exit criteria are satisfied in reality; remove the item from open work.
|
|
94
|
+
- `Narrow`: Part landed; rewrite the item to describe only what remains.
|
|
95
|
+
- `Split`: One vague item became multiple independently executable slices.
|
|
96
|
+
- `Retarget`: The original wording no longer matches the real desired outcome.
|
|
97
|
+
- `Defer`: The item remains valid but no longer ranks as the next useful slice.
|
|
98
|
+
- `Gate`: Progress requires an external condition or approval.
|
|
99
|
+
- `Block`: Progress requires another unresolved internal or external dependency.
|
|
100
|
+
|
|
101
|
+
Rules:
|
|
102
|
+
|
|
103
|
+
- Active epics should expose at least one concrete next slice.
|
|
104
|
+
- If implementation completed work absent from the plan, update the nearest existing item or record delivery without fabricating retrospective backlog ceremony.
|
|
105
|
+
- If docs or architecture change exit criteria, update the item rather than preserving stale wording.
|
|
106
|
+
- Evergreen maintenance disciplines belong in durable protocol, not perpetual checkboxes.
|
|
107
|
+
- Prefer refining existing items over creating near-duplicates.
|
|
108
|
+
|
|
109
|
+
## Completed Delivery Sync
|
|
110
|
+
|
|
111
|
+
Record meaningful outcomes from reality, not intention.
|
|
112
|
+
|
|
113
|
+
A good entry names:
|
|
114
|
+
|
|
115
|
+
- The affected area.
|
|
116
|
+
- What changed for users, operators, developers, or system behavior.
|
|
117
|
+
- Material compatibility, migration, or safety impact when relevant.
|
|
118
|
+
|
|
119
|
+
Avoid version-bump-only notes, test bookkeeping, and duplicates of `AGENTS.md` rules.
|
|
120
|
+
|
|
121
|
+
## Consolidation
|
|
122
|
+
|
|
123
|
+
### Triggers
|
|
124
|
+
|
|
125
|
+
Consolidate when:
|
|
126
|
+
|
|
127
|
+
- Three or more entries describe one pattern.
|
|
128
|
+
- Two sections substantially overlap.
|
|
129
|
+
- A section grows beyond easy scanning because abstraction levels became mixed.
|
|
130
|
+
- A mistake repeats despite an existing rule.
|
|
131
|
+
- Docs contradict implementation.
|
|
132
|
+
- Two docs own the same contract.
|
|
133
|
+
- A docs file lacks index coverage.
|
|
134
|
+
- A README entrypoint becomes unreachable or stale.
|
|
135
|
+
|
|
136
|
+
Heuristics suggest inspection; they do not replace judgment.
|
|
137
|
+
|
|
138
|
+
### Procedure
|
|
139
|
+
|
|
140
|
+
1. Identify the authoritative home.
|
|
141
|
+
2. Preserve unique and still-true information.
|
|
142
|
+
3. Resolve contradictions against implementation and current project convention.
|
|
143
|
+
4. Merge the useful content.
|
|
144
|
+
5. Remove or explicitly deprecate the weaker source.
|
|
145
|
+
6. Repair links and index coverage.
|
|
146
|
+
7. Validate the resulting graph.
|
|
147
|
+
|
|
148
|
+
### Escalation Ladder
|
|
149
|
+
|
|
150
|
+
When a mistake repeats:
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
Durable insight
|
|
154
|
+
→ Emphasized convention
|
|
155
|
+
→ Hard rule with validation
|
|
156
|
+
→ Structural tooling or automation
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Escalate only after evidence shows the previous level failed.
|
|
160
|
+
|
|
161
|
+
## Local Overlay Coexistence
|
|
162
|
+
|
|
163
|
+
ABCd owns portable context hygiene:
|
|
164
|
+
|
|
165
|
+
- Root state separation.
|
|
166
|
+
- README and docs-index connectivity.
|
|
167
|
+
- Link health and basic Markdown shape.
|
|
168
|
+
- Generic backlog/changelog drift detection.
|
|
169
|
+
- Context bloat and freshness signals.
|
|
170
|
+
|
|
171
|
+
Local overlays own project-specific behavior:
|
|
172
|
+
|
|
173
|
+
- Release and deployment gates.
|
|
174
|
+
- Architecture/domain ownership rules.
|
|
175
|
+
- Stack-specific tests and security checks.
|
|
176
|
+
- Organization-specific conventions.
|
|
177
|
+
|
|
178
|
+
Run ABCd to verify the context surface, then run the stricter local overlay. Do not copy local rules into ABCd unless they become portable across projects. Tune style warnings through documented options or environment variables rather than forking the validator for one repository.
|
|
179
|
+
|
|
180
|
+
## Full Audit Checklist
|
|
181
|
+
|
|
182
|
+
After automated validation, manually verify what scripts cannot prove:
|
|
183
|
+
|
|
184
|
+
- [ ] Repository claims match implementation and current operations.
|
|
185
|
+
- [ ] One authoritative home owns each material fact.
|
|
186
|
+
- [ ] Canonical open work reflects real remaining work.
|
|
187
|
+
- [ ] Completed work no longer appears open.
|
|
188
|
+
- [ ] Durable protocol contains reusable constraints rather than delivery history.
|
|
189
|
+
- [ ] Relevant README entrypoints describe current setup, topology, usage, and ownership.
|
|
190
|
+
- [ ] Subtree entrypoints remain reachable.
|
|
191
|
+
- [ ] Docs index covers current docs without phantom entries.
|
|
192
|
+
- [ ] Active epics expose an executable next slice.
|
|
193
|
+
- [ ] Local overlays remain authoritative for project-specific gates.
|
|
194
|
+
|
|
195
|
+
## Related
|
|
196
|
+
|
|
197
|
+
- [SKILL.md](../SKILL.md) — operating kernel
|
|
198
|
+
- [templates.md](./templates.md) — starter and restructuring shapes
|
|
199
|
+
- [validation-design.md](./validation-design.md) — validator behavior and parity contract
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# ABCd Context Templates
|
|
2
|
+
|
|
3
|
+
Starter and restructuring shapes for files managed by ABCd. Existing honest project conventions win. Use only the files and sections the project actually needs.
|
|
4
|
+
|
|
5
|
+
## Root README
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# [Project Name]
|
|
9
|
+
|
|
10
|
+
[One-sentence project purpose.]
|
|
11
|
+
|
|
12
|
+
## Start Here
|
|
13
|
+
|
|
14
|
+
- [Project Context](./AGENTS.md)
|
|
15
|
+
- [Open Backlog](./BACKLOG.md)
|
|
16
|
+
- [Changelog](./CHANGELOG.md)
|
|
17
|
+
- [Documentation](./docs/README.md)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Omit links to surfaces the project deliberately does not maintain. Do not create empty control-plane files merely to satisfy the template.
|
|
21
|
+
|
|
22
|
+
## AGENTS — Lean
|
|
23
|
+
|
|
24
|
+
Use for early projects with low coordination load and few durable constraints.
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
# Project Context
|
|
28
|
+
|
|
29
|
+
## Meta-Protocol Principles
|
|
30
|
+
|
|
31
|
+
- `Constraint-Driven Evolution`: Add structure when real constraints justify it.
|
|
32
|
+
- `Single Source of Truth`: Keep each fact in one authoritative layer.
|
|
33
|
+
- `Context Hygiene`: Consolidate and remove stale context before it becomes drag.
|
|
34
|
+
- `Boundary Clarity`: Separate durable protocol, open work, completed history, and docs.
|
|
35
|
+
|
|
36
|
+
## Concept
|
|
37
|
+
|
|
38
|
+
[One-sentence project purpose and boundary.]
|
|
39
|
+
|
|
40
|
+
## Topology
|
|
41
|
+
|
|
42
|
+
- `/[directory]/`: [Responsibility.]
|
|
43
|
+
|
|
44
|
+
## Durable Conventions
|
|
45
|
+
|
|
46
|
+
- `[Label]`: [Constraint or rule.]
|
|
47
|
+
- Trigger: [When it applies.]
|
|
48
|
+
- Action: [Required behavior.]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## AGENTS — Layered
|
|
52
|
+
|
|
53
|
+
Use only when multiple subsystems, stronger contracts, or autonomous coordination pressure justify a durable hierarchy. This also serves as a restructuring target for overgrown flat files.
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
# Project Context
|
|
57
|
+
|
|
58
|
+
## 0. Meta-Protocol Principles
|
|
59
|
+
|
|
60
|
+
- `Constraint-Driven Evolution`: Add complexity only when discovered constraints justify it.
|
|
61
|
+
- `Single Source of Truth`: Keep durable protocol, open work, completed history, and subsystem docs distinct.
|
|
62
|
+
- `Decreasing Abstraction`: Organize context from mental model to execution protocol.
|
|
63
|
+
- `Context Optimization`: Consolidate and remove stale structure before context becomes entropy.
|
|
64
|
+
- `Validation Infrastructure`: Pair structural rules with explicit checks.
|
|
65
|
+
- `Human + Agent Coherence`: Keep the same graph useful to future humans and agents.
|
|
66
|
+
|
|
67
|
+
## 1. Concept
|
|
68
|
+
|
|
69
|
+
[Project identity, problem, and product boundary.]
|
|
70
|
+
|
|
71
|
+
## 2. Identity and Naming
|
|
72
|
+
|
|
73
|
+
- [Canonical terms and naming boundaries.]
|
|
74
|
+
|
|
75
|
+
## 3. Topology
|
|
76
|
+
|
|
77
|
+
- `/[directory]/`: [Responsibility.]
|
|
78
|
+
|
|
79
|
+
## 4. Core Entities
|
|
80
|
+
|
|
81
|
+
- [Durable domain atoms.]
|
|
82
|
+
|
|
83
|
+
## 5. Architectural Decisions
|
|
84
|
+
|
|
85
|
+
- [Stable boundaries and design decisions.]
|
|
86
|
+
|
|
87
|
+
## 6. Engineering Conventions
|
|
88
|
+
|
|
89
|
+
- [Validation, implementation, and code standards.]
|
|
90
|
+
|
|
91
|
+
## 7. Operational Conventions
|
|
92
|
+
|
|
93
|
+
- [Documentation, tooling, coordination, and release rules.]
|
|
94
|
+
|
|
95
|
+
## 8. Integration Protocols
|
|
96
|
+
|
|
97
|
+
- [Runtime, upstream, network, and service seams.]
|
|
98
|
+
|
|
99
|
+
## 9. Pre-Task Protocol
|
|
100
|
+
|
|
101
|
+
- [Preparation required by this project.]
|
|
102
|
+
|
|
103
|
+
## 10. Completion Protocol
|
|
104
|
+
|
|
105
|
+
- [Validation, context sync, and delivery gates.]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## BACKLOG
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
# Project Backlog
|
|
112
|
+
|
|
113
|
+
## Open Backlog
|
|
114
|
+
|
|
115
|
+
- [ ] `[Slice]` [Concrete remaining work with truthful exit criteria.]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Keep only open, gated, or blocked work. Remove completed items after recording meaningful delivery in the canonical history surface.
|
|
119
|
+
|
|
120
|
+
## CHANGELOG
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
# Changelog
|
|
124
|
+
|
|
125
|
+
## [Version or Current]
|
|
126
|
+
|
|
127
|
+
- `[Area]` [Delivered outcome]. Impact: [Meaningful user/operator/developer effect.]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Durable Convention Entry
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
- `[Label]`: [Reusable constraint or insight.]
|
|
134
|
+
- Trigger: [Observed condition.]
|
|
135
|
+
- Action: [Future behavior.]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Subtree README
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
# [Area Name]
|
|
142
|
+
|
|
143
|
+
[One-sentence responsibility.]
|
|
144
|
+
|
|
145
|
+
## What This Area Owns
|
|
146
|
+
|
|
147
|
+
- [Responsibility.]
|
|
148
|
+
|
|
149
|
+
## Key Entry Points
|
|
150
|
+
|
|
151
|
+
- [Relevant file or directory](./path)
|
|
152
|
+
- [Parent or related documentation](../README.md)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Docs Index
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
# Documentation Index
|
|
159
|
+
|
|
160
|
+
Living index of project documentation.
|
|
161
|
+
|
|
162
|
+
## Documents
|
|
163
|
+
|
|
164
|
+
- [`filename.md`](./filename.md): [Purpose.]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Project Document
|
|
168
|
+
|
|
169
|
+
```markdown
|
|
170
|
+
# [Document Title]
|
|
171
|
+
|
|
172
|
+
## Overview
|
|
173
|
+
|
|
174
|
+
[What this document owns and why it exists.]
|
|
175
|
+
|
|
176
|
+
## [Main Section]
|
|
177
|
+
|
|
178
|
+
[Content organized from general contract to specific behavior.]
|
|
179
|
+
|
|
180
|
+
## Related
|
|
181
|
+
|
|
182
|
+
- [Related document](./related.md)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## README Status Update
|
|
186
|
+
|
|
187
|
+
Use when local entrypoint truth changed:
|
|
188
|
+
|
|
189
|
+
```markdown
|
|
190
|
+
## Current Status
|
|
191
|
+
|
|
192
|
+
- [What this area now owns or exposes.]
|
|
193
|
+
- [Changed entrypoint, workflow, compatibility, or boundary.]
|
|
194
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# `validate-context` Design
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`validate-context` supplies structural evidence for the ABCd graph. It checks ownership surfaces, navigation, links, drift signals, and Markdown shape. It cannot prove that documentation claims match implementation; the full audit keeps that manual responsibility explicit.
|
|
6
|
+
|
|
7
|
+
## Runtime
|
|
8
|
+
|
|
9
|
+
`scripts/validate-context.mjs` is the single supported implementation. It runs on the supported Node runtime and prints classic human-readable validation logs by default.
|
|
10
|
+
|
|
11
|
+
## Root Resolution
|
|
12
|
+
|
|
13
|
+
Resolution order:
|
|
14
|
+
|
|
15
|
+
1. Explicit `project-root` argument.
|
|
16
|
+
2. `VALIDATE_CONTEXT_ROOT`.
|
|
17
|
+
3. Current working directory.
|
|
18
|
+
|
|
19
|
+
A missing or non-directory root fails before validation.
|
|
20
|
+
|
|
21
|
+
## Checks
|
|
22
|
+
|
|
23
|
+
1. `Durable file detection — Error`: Finds `AGENTS.md`, `CLAUDE.md`, `CODEX.md`, `GEMINI.md`, or `CONTEXT.md`.
|
|
24
|
+
2. `Root README connectivity — Warning`: Checks references to the durable file, canonical open work, completed history, and docs index when present.
|
|
25
|
+
3. `Core durable structure — Warning`: Accepts numbered mature-project sections or compact skill-style meta/operating sections.
|
|
26
|
+
4. `Root state split — Warning`: Detects the canonical plan, completed-history surface, delivery history inside the durable file, and obvious backlog/changelog label drift.
|
|
27
|
+
5. `Relative links and anchors — Error`: Validates Markdown links outside fenced code blocks, including heading anchors and GitHub-style line-reference bounds.
|
|
28
|
+
6. `README reachability — Warning`: Finds subtree README files with no inbound Markdown link.
|
|
29
|
+
7. `Meta-protocol presence — Warning`: Checks the durable file for `Meta-Protocol Principles`.
|
|
30
|
+
8. `Bloat signals — Warning`: Reports low information density or sparse structure in the durable file.
|
|
31
|
+
9. `Markdown tables — Error/Warning`: Always fails non-compact delimiter rows and warns about table rows longer than 120 characters.
|
|
32
|
+
10. `Freshness — Warning`: Reports durable files older than 30 days.
|
|
33
|
+
11. `Docs directory — Warning`: Checks for `/docs`.
|
|
34
|
+
12. `Docs index coverage — Warning`: Detects docs missing from `docs/README.md` and indexed files that do not exist.
|
|
35
|
+
|
|
36
|
+
## Severity Contract
|
|
37
|
+
|
|
38
|
+
- `Pass`: The structural check found no issue.
|
|
39
|
+
- `Info`: Evidence or an intentionally skipped bounded check.
|
|
40
|
+
- `Warning`: Potential drift requiring judgment; warnings do not change exit status.
|
|
41
|
+
- `Error`: Broken structural invariant or invalid invocation; errors return exit `1`.
|
|
42
|
+
|
|
43
|
+
Exit `0` never means the context is factually correct. It means automated checks found no errors.
|
|
44
|
+
|
|
45
|
+
## Link Validation
|
|
46
|
+
|
|
47
|
+
The validator scans Markdown under the project root while excluding common generated, dependency, cache, and vendor directories. It ignores links and table syntax inside fenced code blocks, including backtick or tilde fences with CommonMark-compatible indentation and matching closing-fence length.
|
|
48
|
+
|
|
49
|
+
It handles anchor-only, relative-file, file-plus-anchor, and GitHub line-reference links. Heading anchors use GitHub-style normalization while preserving underscores. Line references must point to existing lines.
|
|
50
|
+
|
|
51
|
+
Files larger than `ABCD_MARKDOWN_LINK_SCAN_MAX_BYTES`, default `262144`, skip link scanning and emit an info item instead of spending unbounded time on generated or reference dumps.
|
|
52
|
+
|
|
53
|
+
## Root State Drift
|
|
54
|
+
|
|
55
|
+
The validator prefers `BACKLOG.md` but accepts `TODO.md`, `PLAN.md`, and `ROADMAP.md` with a warning.
|
|
56
|
+
|
|
57
|
+
It warns when:
|
|
58
|
+
|
|
59
|
+
- The durable file contains a `Change History` section while `CHANGELOG.md` exists.
|
|
60
|
+
- An unchecked backtick-labelled backlog slice also appears in `CHANGELOG.md`.
|
|
61
|
+
|
|
62
|
+
These checks identify suspicious duplication; they do not prove semantic completion.
|
|
63
|
+
|
|
64
|
+
## Bloat Signals
|
|
65
|
+
|
|
66
|
+
The validator avoids a hard file-length limit. It checks independent signals:
|
|
67
|
+
|
|
68
|
+
- `Low information density`: Structural elements make up less than 40% of nonblank lines.
|
|
69
|
+
- `Sparse structure`: The file averages more than 15 lines per heading.
|
|
70
|
+
|
|
71
|
+
Signals suggest consolidation; they do not replace judgment.
|
|
72
|
+
|
|
73
|
+
## Markdown Tables
|
|
74
|
+
|
|
75
|
+
Table checks always run and have no enabling option.
|
|
76
|
+
|
|
77
|
+
- Delimiter cells use exactly three hyphens, optional alignment colons, and one space inside each pipe: for example, `| --- | ---: | :--- |`.
|
|
78
|
+
- Delimiters without inner spaces or with padded hyphen runs fail validation.
|
|
79
|
+
- Table row length has no maximum; each contiguous table emits one warning when one or more rows exceed 120 characters.
|
|
80
|
+
|
|
81
|
+
LaTeX is allowed and is not validated.
|
|
82
|
+
|
|
83
|
+
## Human-Readable Output
|
|
84
|
+
|
|
85
|
+
Validation prints each check and a summary by default. `NO_COLOR=1` disables ANSI color for CI or captured logs. There is no JSON output mode.
|
|
86
|
+
|
|
87
|
+
## Regression Contract
|
|
88
|
+
|
|
89
|
+
`scripts/_self-test.mjs` verifies the Node validator against:
|
|
90
|
+
|
|
91
|
+
1. `fixtures/abcd-project`, through both environment and explicit-root resolution.
|
|
92
|
+
2. The `abcd-context` skill root.
|
|
93
|
+
3. A missing path, which must fail clearly.
|
|
94
|
+
4. The removed `--json` option, which must fail clearly.
|
|
95
|
+
5. A temporary fixture with an out-of-range line reference, which must fail clearly.
|
|
96
|
+
6. Temporary fixtures proving that LaTeX and compact table delimiters pass, non-compact delimiters fail, and rows over 120 characters warn.
|
|
97
|
+
|
|
98
|
+
The fixture remains linked from [its README](../fixtures/abcd-project/README.md).
|
|
99
|
+
|
|
100
|
+
## Usage
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Current project
|
|
104
|
+
node /path/to/skill/scripts/validate-context.mjs
|
|
105
|
+
|
|
106
|
+
# Explicit root
|
|
107
|
+
node /path/to/skill/scripts/validate-context.mjs /path/to/project
|
|
108
|
+
|
|
109
|
+
# Skill regression suite
|
|
110
|
+
node /path/to/skill/scripts/_self-test.mjs
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Related
|
|
114
|
+
|
|
115
|
+
- [SKILL.md](../SKILL.md) — operating kernel
|
|
116
|
+
- [protocols.md](./protocols.md) — reconciliation and consolidation rules
|
|
117
|
+
- [templates.md](./templates.md) — starter and restructuring shapes
|