@event4u/agent-config 3.0.0 → 3.1.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/.agent-src/commands/install-via-agent.md +129 -0
- package/.agent-src/commands/video/from-script.md +1 -1
- package/.agent-src/commands/video.md +1 -1
- package/.agent-src/contexts/execution/cheap-question-mechanics.md +81 -0
- package/.agent-src/rules/caveman-speak.md +2 -2
- package/.agent-src/rules/context-hygiene.md +36 -0
- package/.agent-src/rules/engineering-safety-floor.md +102 -0
- package/.agent-src/rules/finance-safety-floor.md +114 -0
- package/.agent-src/rules/git-history-discipline.md +1 -1
- package/.agent-src/rules/no-cheap-questions.md +34 -32
- package/.agent-src/rules/provider-lifecycle-discipline.md +4 -4
- package/.agent-src/rules/strategy-safety-floor.md +114 -0
- package/.agent-src/skills/agents-md-thin-root/SKILL.md +15 -9
- package/.agent-src/skills/async-python-patterns/SKILL.md +1 -1
- package/.agent-src/skills/project-analysis-node-express/SKILL.md +1 -1
- package/.agent-src/skills/readme-reviewer/SKILL.md +52 -3
- package/.agent-src/skills/readme-writing/SKILL.md +52 -4
- package/.agent-src/skills/readme-writing-package/SKILL.md +48 -5
- package/.agent-src/skills/systematic-debugging/SKILL.md +41 -0
- package/.agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/.agent-src/templates/hooks/pre-commit-frontmatter +66 -0
- package/.agent-src/templates/hooks/pre-commit-roadmap-progress +78 -39
- package/.agent-src/templates/scripts/work_engine/_lib/agent_settings.py +4 -1
- package/.agent-src/templates/scripts/work_engine/orchestration.py +25 -11
- package/.claude-plugin/marketplace.json +2 -1
- package/AGENTS.md +10 -8
- package/CHANGELOG.md +233 -123
- package/README.md +165 -553
- package/config/agent-settings.template.yml +0 -7
- package/config/discovery/packs.yml +20 -0
- package/config/discovery/unassigned-artefacts.yml +2 -0
- package/config/gitignore-block.txt +19 -3
- package/dist/cli/commands/uiServe.js +13 -4
- package/dist/cli/commands/uiServe.js.map +1 -1
- package/dist/cli/registry.js +2 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/discovery/deprecation-report.md +7 -0
- package/dist/discovery/discovery-manifest.json +2107 -1409
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +9 -9
- package/dist/discovery/orphan-report.md +10 -0
- package/dist/discovery/packs.json +1002 -0
- package/dist/discovery/trust-report.md +26 -0
- package/dist/discovery/workspaces.json +705 -0
- package/dist/mcp/registry-manifest.json +4 -4
- package/dist/router.json +1623 -0
- package/dist/server/app.js +11 -3
- package/dist/server/app.js.map +1 -1
- package/dist/server/io/atomicMultiWrite.js +3 -1
- package/dist/server/io/atomicMultiWrite.js.map +1 -1
- package/dist/server/io/yamlIO.js +22 -0
- package/dist/server/io/yamlIO.js.map +1 -1
- package/dist/server/routes/ping.js +8 -0
- package/dist/server/routes/ping.js.map +1 -1
- package/dist/server/routes/schema.js +2 -2
- package/dist/server/routes/schema.js.map +1 -1
- package/dist/server/routes/settings.js +104 -23
- package/dist/server/routes/settings.js.map +1 -1
- package/dist/server/routes/userMd.js +37 -27
- package/dist/server/routes/userMd.js.map +1 -1
- package/dist/server/routes/wizard.js +256 -20
- package/dist/server/routes/wizard.js.map +1 -1
- package/dist/server/schemas/settings.js +0 -1
- package/dist/server/schemas/settings.js.map +1 -1
- package/dist/server/token.js +10 -3
- package/dist/server/token.js.map +1 -1
- package/dist/server/writeRoot.js +28 -11
- package/dist/server/writeRoot.js.map +1 -1
- package/dist/server/writeRoot.test.js +22 -4
- package/dist/server/writeRoot.test.js.map +1 -1
- package/dist/shared/userMd/formAdapter.js +29 -51
- package/dist/shared/userMd/formAdapter.js.map +1 -1
- package/dist/shared/userMd/schema.js +32 -104
- package/dist/shared/userMd/schema.js.map +1 -1
- package/dist/shared/userMd/utils.js +64 -50
- package/dist/shared/userMd/utils.js.map +1 -1
- package/dist/ui/assets/index-D-DY1ywI.js +35 -0
- package/dist/ui/assets/index-D-DY1ywI.js.map +1 -0
- package/dist/ui/index.html +1 -1
- package/docs/adrs/router/0001-three-tier-routing.md +5 -5
- package/docs/adrs/smoke/0001-per-tier-smoke-scripts.md +1 -1
- package/docs/architecture.md +3 -3
- package/docs/archive/CHANGELOG-pre-3.1.0.md +167 -0
- package/docs/catalog.md +30 -26
- package/docs/contracts/CHANGELOG-conventions.md +1 -1
- package/docs/contracts/agent-user-schema.md +6 -9
- package/docs/contracts/consumer-bridge.md +79 -0
- package/docs/contracts/discovery-manifest.md +209 -0
- package/docs/contracts/discovery-manifest.schema.json +77 -4
- package/docs/contracts/explain-trace.schema.json +1 -1
- package/docs/contracts/file-ownership-matrix.json +197 -13
- package/docs/contracts/frontmatter-contract.md +140 -0
- package/docs/contracts/gui-wizard.md +223 -0
- package/docs/contracts/installer-agent-mode.md +137 -0
- package/docs/contracts/kernel-membership.md +1 -1
- package/docs/contracts/mcp-tool-inventory.md +9 -9
- package/docs/contracts/namespace.md +6 -6
- package/docs/contracts/provider-lifecycle.md +5 -5
- package/docs/contracts/rule-router.md +4 -4
- package/docs/contracts/settings-api.md +53 -6
- package/docs/contracts/smoke-contracts.md +3 -3
- package/docs/contracts/trust-and-safety.md +144 -0
- package/docs/customization.md +2 -2
- package/docs/decisions/ADR-007-agent-discovery-scopes.md +12 -0
- package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +24 -0
- package/docs/decisions/ADR-015-discovery-manifest-contract.md +146 -0
- package/docs/decisions/ADR-016-installer-architecture.md +189 -0
- package/docs/decisions/ADR-017-monorepo-physical-layout.md +261 -0
- package/docs/decisions/ADR-018-trust-and-safety-layer.md +159 -0
- package/docs/decisions/ADR-019-router-json-dist-location.md +124 -0
- package/docs/decisions/ADR-020-global-only-consumer-scope.md +123 -0
- package/docs/decisions/ADR-021-deployment-shape.md +153 -0
- package/docs/decisions/INDEX.md +7 -0
- package/docs/deploy/connector-setup.md +129 -0
- package/docs/deploy/env-vars.md +70 -0
- package/docs/deploy/policy-cookbook.md +130 -0
- package/docs/deploy/quickstart.md +112 -0
- package/docs/distribution/public-install-smoke.md +68 -0
- package/docs/distribution/registries.md +55 -0
- package/docs/distribution/telemetry-privacy.md +128 -0
- package/docs/distribution/telemetry-schema.md +174 -0
- package/docs/featured-skills.md +95 -0
- package/docs/getting-started-by-role.md +19 -1
- package/docs/getting-started.md +2 -2
- package/docs/guidelines/agent-infra/installed-tools-manifest.md +11 -8
- package/docs/guidelines/docs/readme-size-and-splitting.md +53 -1
- package/docs/installation.md +27 -14
- package/docs/maintainers/dev-mode.md +105 -0
- package/docs/setup/per-ide/claude-desktop.md +3 -2
- package/docs/wizard.md +39 -4
- package/package.json +18 -1
- package/scripts/__pycache__/validate_frontmatter.cpython-312.pyc +0 -0
- package/scripts/_cli/cmd_doctor.py +150 -2
- package/scripts/_cli/cmd_explain.py +2 -1
- package/scripts/_cli/cmd_migrate_to_global.py +415 -0
- package/scripts/_cli/cmd_settings_migrate.py +146 -0
- package/scripts/_cli/explain_last/route.py +2 -1
- package/scripts/_dispatch.bash +36 -3
- package/scripts/_lib/__pycache__/__init__.cpython-312.pyc +0 -0
- package/scripts/_lib/__pycache__/agent_src.cpython-312.pyc +0 -0
- package/scripts/_lib/agent_settings.py +4 -1
- package/scripts/_lib/agent_src.py +157 -0
- package/scripts/agent-config +17 -6
- package/scripts/audit_skill_descriptions.py +18 -6
- package/scripts/build_discovery_manifest.py +373 -17
- package/scripts/check_artefact_checksums.py +104 -0
- package/scripts/check_cluster_patterns.py +20 -4
- package/scripts/check_command_count_messaging.py +33 -14
- package/scripts/check_council_references.py +43 -4
- package/scripts/check_overlay_cascade_subdirs.py +7 -3
- package/scripts/check_references.py +5 -2
- package/scripts/check_reply_consistency.py +32 -9
- package/scripts/check_template_pin_drift.py +24 -7
- package/scripts/check_token_optimizer_freshness.py +18 -3
- package/scripts/compile_router.py +34 -2
- package/scripts/compress.py +162 -44
- package/scripts/config/presets.py +19 -1
- package/scripts/config/profiles.py +16 -1
- package/scripts/discovery_stats.py +70 -0
- package/scripts/expected_perms.json +47 -0
- package/scripts/generate_index.py +78 -46
- package/scripts/generate_ownership_matrix.py +98 -43
- package/scripts/generate_pack_manifests.py +183 -0
- package/scripts/install +18 -1
- package/scripts/install.py +934 -59
- package/scripts/install.sh +27 -9
- package/scripts/lint_agents_layout.py +93 -13
- package/scripts/lint_agents_md.py +1 -1
- package/scripts/lint_archived_skills.py +32 -16
- package/scripts/lint_bench_corpus.py +14 -2
- package/scripts/lint_command_tiers.py +15 -2
- package/scripts/lint_featured_skills.py +139 -0
- package/scripts/lint_framework_leakage.py +33 -6
- package/scripts/lint_global_paths.py +147 -0
- package/scripts/lint_orchestration_dsl.py +6 -3
- package/scripts/lint_pack_boundaries.py +147 -0
- package/scripts/lint_pack_first_win.py +103 -0
- package/scripts/lint_readme_jargon.py +131 -0
- package/scripts/lint_readme_size.py +33 -0
- package/scripts/lint_rule_interactions.py +23 -5
- package/scripts/lint_rule_tiers.py +12 -3
- package/scripts/lint_trust_coherence.py +212 -0
- package/scripts/measure_rule_budget.py +22 -4
- package/scripts/move_artefact.py +143 -0
- package/scripts/new_skill.py +148 -0
- package/scripts/plan_physical_move.py +353 -0
- package/scripts/refine_ticket_detect.py +30 -7
- package/scripts/release.py +22 -2
- package/scripts/schemas/command.schema.json +4 -0
- package/scripts/skill_linter.py +248 -118
- package/scripts/skill_trigger_eval.py +28 -8
- package/scripts/smoke/kernel.sh +1 -1
- package/scripts/smoke/router.sh +24 -5
- package/scripts/smoke/skills.sh +15 -7
- package/scripts/smoke_quickstart.py +11 -2
- package/scripts/snapshot_agent_outputs.py +144 -0
- package/scripts/update_counts.py +45 -17
- package/scripts/validate_decision_engine.py +9 -1
- package/scripts/validate_discovery_manifest.py +94 -0
- package/scripts/validate_frontmatter.py +39 -20
- package/scripts/verify_physical_move.py +185 -0
- package/templates/agent-user.md +0 -1
- package/templates/agent-user.yml +21 -0
- package/templates/minimal/agents-overrides-readme.md +46 -0
- package/templates/minimal/overrides-gitkeep +2 -0
- package/dist/ui/assets/index-BTRcKDlB.js +0 -39
- package/dist/ui/assets/index-BTRcKDlB.js.map +0 -1
- package/templates/minimal/agents-gitkeep +0 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: "auto"
|
|
3
|
+
tier: "2a"
|
|
4
|
+
description: "Founder-strategy output (vision, positioning, competitive moats, market entry, OKR trees, build-vs-buy) — never issue final strategic call; surface trade-offs; human owns the decision"
|
|
5
|
+
source: package
|
|
6
|
+
triggers:
|
|
7
|
+
- keyword: "vision"
|
|
8
|
+
- keyword: "positioning"
|
|
9
|
+
- keyword: "moat"
|
|
10
|
+
- keyword: "competitive"
|
|
11
|
+
- keyword: "market entry"
|
|
12
|
+
- keyword: "OKR"
|
|
13
|
+
- keyword: "build vs buy"
|
|
14
|
+
- keyword: "buy vs partner"
|
|
15
|
+
- keyword: "beachhead"
|
|
16
|
+
- keyword: "GTM"
|
|
17
|
+
- keyword: "category"
|
|
18
|
+
- keyword: "where to play"
|
|
19
|
+
- keyword: "where not to play"
|
|
20
|
+
- phrase: "what's our strategy"
|
|
21
|
+
- phrase: "should we enter"
|
|
22
|
+
- phrase: "what's our moat"
|
|
23
|
+
- phrase: "where should we focus"
|
|
24
|
+
- phrase: "should we reorg"
|
|
25
|
+
routes_to:
|
|
26
|
+
- "skill:vision-articulation"
|
|
27
|
+
- "skill:positioning-strategy"
|
|
28
|
+
- "skill:competitive-moat-analysis"
|
|
29
|
+
- "skill:market-entry-analysis"
|
|
30
|
+
- "skill:build-buy-partner"
|
|
31
|
+
- "skill:okr-tree-modeling"
|
|
32
|
+
workspaces:
|
|
33
|
+
- founder
|
|
34
|
+
packs:
|
|
35
|
+
- founder-strategy
|
|
36
|
+
lifecycle: active
|
|
37
|
+
trust:
|
|
38
|
+
level: advisory
|
|
39
|
+
confidence: high
|
|
40
|
+
human_review_required: true
|
|
41
|
+
install:
|
|
42
|
+
default: true
|
|
43
|
+
removable: false
|
|
44
|
+
---
|
|
45
|
+
<!-- agent-config:human-review-banner -->
|
|
46
|
+
> HUMAN REVIEW REQUIRED · trust: advisory · owner: founder
|
|
47
|
+
|
|
48
|
+
# Strategy Safety Floor
|
|
49
|
+
|
|
50
|
+
Domain safety floor for founder-strategy artefacts (vision, positioning, competitive moats, market entry, OKR trees, build-vs-buy). Auto-activates when `pack-founder-strategy` is installed.
|
|
51
|
+
|
|
52
|
+
## Iron Law — strategy is a frame, not a verdict
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
THE AGENT NEVER ISSUES A FINAL "ENTER MARKET X" / "BUILD" / "BUY" / "REORG" CALL.
|
|
56
|
+
FRAME THE TRADE-OFF. SURFACE THE COST OF EACH PATH. THE FOUNDER DECIDES.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Strategy output is a structured argument — it sharpens the question, surfaces the trade-offs, names the bet being made. It does **not** make the bet. Holds for every founder-strategy skill (`vision-articulation`, `positioning-strategy`, `competitive-moat-analysis`, `market-entry-analysis`, `build-buy-partner`, `okr-tree-modeling`, `org-design`, `fundraising-narrative`).
|
|
60
|
+
|
|
61
|
+
## Mandatory disclosure footer
|
|
62
|
+
|
|
63
|
+
Every strategy deliverable (positioning brief, market-entry memo, build-vs-buy analysis, OKR tree, moat map) ends with:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
> **Not a strategic decision.** This is a framing of the trade-off, not the
|
|
67
|
+
> verdict. The named bet, residual risk, and counter-case are surfaced
|
|
68
|
+
> above. Founder review required before commitment to a path.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The footer is non-optional. Drop it → safety violation.
|
|
72
|
+
|
|
73
|
+
## Required structural elements
|
|
74
|
+
|
|
75
|
+
Each strategy deliverable surfaces, in this order:
|
|
76
|
+
|
|
77
|
+
1. **The bet** — one sentence naming what is being chosen and what is being given up.
|
|
78
|
+
2. **Why now / why us** — the timing and capability claim, with at least one piece of evidence per claim.
|
|
79
|
+
3. **Counter-case** — one paragraph on the strongest argument against this path (not a strawman).
|
|
80
|
+
4. **Residual risk** — what stays unresolved after this decision; what would invalidate it.
|
|
81
|
+
5. **Decision owner** — named human who owns the call (default: founder / CEO / leadership team).
|
|
82
|
+
|
|
83
|
+
## Human review escalation
|
|
84
|
+
|
|
85
|
+
| Trigger | Action |
|
|
86
|
+
|---|---|
|
|
87
|
+
| Board-bound positioning or strategy memo | Surface `HUMAN REVIEW REQUIRED` banner; do not commit without explicit user confirmation. |
|
|
88
|
+
| Reorg, layoff, or org-design recommendation | Refuse to finalize; output `DRAFT` watermark and route to the user for the people-impact review. |
|
|
89
|
+
| Market entry into a regulated domain (legal, medical, financial) | Refuse; route to `domain-safety-disclaimer` and defer to domain counsel. |
|
|
90
|
+
| Public-facing positioning (PR, fundraise narrative) | Mandatory counter-case + named decision owner. |
|
|
91
|
+
|
|
92
|
+
## Forbidden moves
|
|
93
|
+
|
|
94
|
+
- "You should enter market X" without surfacing the cost of not entering Y
|
|
95
|
+
- Positioning verdict without an opposable axis (per `positioning-strategy`)
|
|
96
|
+
- Build-vs-buy recommendation without integration-cost and optionality analysis
|
|
97
|
+
- OKR tree without measurability + laddering check
|
|
98
|
+
- Moat claim without a competitor delta (named, with evidence)
|
|
99
|
+
- Strategic call that fails the inversion test (per `competitive-moat-analysis`)
|
|
100
|
+
- Vision statement without a stated counter-case
|
|
101
|
+
|
|
102
|
+
## When this rule applies
|
|
103
|
+
|
|
104
|
+
Active whenever any of these are in the request, the open file, or the loaded skill set:
|
|
105
|
+
- A founder-strategy skill name (`vision-articulation`, `positioning-strategy`, `competitive-moat-analysis`, `market-entry-analysis`, `build-buy-partner`, `okr-tree-modeling`, `org-design`, `fundraising-narrative`)
|
|
106
|
+
- Keywords: vision, positioning, moat, competitive, market entry, OKR, build vs buy, beachhead, GTM, category, where to play
|
|
107
|
+
- Phrases: "what's our strategy", "should we enter", "what's our moat", "where should we focus", "should we reorg"
|
|
108
|
+
|
|
109
|
+
## See also
|
|
110
|
+
|
|
111
|
+
- `domain-safety-disclaimer` — generic advisory-content floor (core pack)
|
|
112
|
+
- `finance-safety-floor` — finance-pack floor, often paired with strategy work (pack-finance-basic)
|
|
113
|
+
- [`positioning-strategy`](../skills/positioning-strategy/SKILL.md) — opposable-axis discipline
|
|
114
|
+
- [`competitive-moat-analysis`](../skills/competitive-moat-analysis/SKILL.md) — inversion test
|
|
@@ -21,13 +21,15 @@ install:
|
|
|
21
21
|
removable: false
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
+
<!-- cloud_safe: noop -->
|
|
25
|
+
|
|
24
26
|
# agents-md-thin-root
|
|
25
27
|
|
|
26
28
|
## When to use
|
|
27
29
|
|
|
28
30
|
Use when:
|
|
29
31
|
- Editing `AGENTS.md` at the package root.
|
|
30
|
-
- Editing
|
|
32
|
+
- Editing `packages/core/.agent-src.uncompressed/templates/AGENTS.md` (consumer-shipped template).
|
|
31
33
|
- Reviewing a PR that changes either file.
|
|
32
34
|
- Running `/optimize/agents`.
|
|
33
35
|
- A budget meter (`scripts/measure_augment_budget.py`) flags the package-root AGENTS.md as the dominant cost.
|
|
@@ -35,7 +37,7 @@ Use when:
|
|
|
35
37
|
## Do NOT
|
|
36
38
|
|
|
37
39
|
- Edit `.github/copilot-instructions.md` with this skill (use `copilot-agents-optimization` instead).
|
|
38
|
-
- Edit other `.md` files under `.augment/`,
|
|
40
|
+
- Edit other `.md` files under `.augment/`, `packages/*/.agent-src.uncompressed/`, or `agents/` with this skill.
|
|
39
41
|
- Add a section to AGENTS.md without first checking whether an outboard target already exists in `agents/settings/contexts/` or `docs/contracts/`.
|
|
40
42
|
- Replace prose with a bare link `[label](path)` — every pointer needs a *why*-clause ≥ 60 chars or it does not count toward the 40 % ratio.
|
|
41
43
|
- Reuse the package-root anatomy in the consumer template — caps and target paths differ.
|
|
@@ -53,7 +55,7 @@ Every entry describes **what** the project does or **where** to learn more — n
|
|
|
53
55
|
| File | FAIL above | WARN above | Target |
|
|
54
56
|
|---|---|---|---|
|
|
55
57
|
| `AGENTS.md` (package root) | 3,000 chars | 2,800 chars | ≤ 2,800 |
|
|
56
|
-
|
|
|
58
|
+
| `packages/core/.agent-src.uncompressed/templates/AGENTS.md` (consumer) | 2,500 chars | 2,300 chars | ≤ 2,300 |
|
|
57
59
|
|
|
58
60
|
Char-count is raw file size (`wc -c`), frontmatter included. Enforcement: `scripts/lint_agents_md.py` (Phase 7), wired into the package's CI pipeline via the `lint-agents-md` task. WARN is a soft signal in CI; FAIL blocks merge.
|
|
59
61
|
|
|
@@ -91,7 +93,7 @@ Every substantive pointer specifies, on the same line or the immediately followi
|
|
|
91
93
|
|
|
92
94
|
## The contract — emergency-triage block
|
|
93
95
|
|
|
94
|
-
Every Thin-Root AGENTS.md MUST contain an **Emergency Triage** section verbatim from
|
|
96
|
+
Every Thin-Root AGENTS.md MUST contain an **Emergency Triage** section verbatim from `packages/core/.agent-src.uncompressed/contexts/contracts/emergency-triage-block.md` (Phase 6.4 will create that file as the canonical source). The block lists the five questions a host agent answers from the root file alone when network / tool access is degraded:
|
|
95
97
|
|
|
96
98
|
1. What is this repository?
|
|
97
99
|
2. What language(s) does this repository accept?
|
|
@@ -105,22 +107,22 @@ Each answer must fit on one line. The block exists so the root never silently de
|
|
|
105
107
|
|
|
106
108
|
1. **Measure baseline.** `wc -c AGENTS.md` and `python3 scripts/measure_augment_budget.py`. Record current char-count and the gap to 2,200 / 2,500.
|
|
107
109
|
2. **Inventory sections.** List every `## ` heading and its char-count. Mark each as `keep-inline` (Iron-Law-adjacent, ≤ 200 chars, no good outboard target) or `outboard-candidate` (longer-form prose, table-only sections, narrative).
|
|
108
|
-
3. **Identify outboard targets.** For each `outboard-candidate`, name the destination —
|
|
110
|
+
3. **Identify outboard targets.** For each `outboard-candidate`, name the destination — `packages/core/.agent-src.uncompressed/contexts/`, `docs/contracts/`, an existing rule body, an existing skill body. Never invent a new top-level directory.
|
|
109
111
|
4. **Move content; insert pointer.** Cut the section into the target file. Replace it in AGENTS.md with a single substantive pointer per anatomy above. Verify the *why*-clause length.
|
|
110
112
|
5. **Re-measure.** `wc -c AGENTS.md` again. If above 2,200, repeat steps 2–4 on the next-largest section. Above 2,500 = must outboard further before commit.
|
|
111
113
|
6. **Validate pointer ratio.** Count non-blank lines and substantive-pointer lines. Ratio < 0.40 = collapse decorative or boilerplate lines into a single pointer or remove.
|
|
112
|
-
7. **Verify emergency-triage block.** Diff the in-file block against
|
|
114
|
+
7. **Verify emergency-triage block.** Diff the in-file block against `packages/core/.agent-src.uncompressed/contexts/contracts/emergency-triage-block.md`. Drift = revert to canonical.
|
|
113
115
|
8. **Run lints.** `task lint-agents-md && task check-refs && task lint-skills`. All green before commit.
|
|
114
116
|
|
|
115
117
|
## Procedure — apply Thin-Root to consumer template
|
|
116
118
|
|
|
117
|
-
Same procedure, applied to
|
|
119
|
+
Same procedure, applied to `packages/core/.agent-src.uncompressed/templates/AGENTS.md`. Hard cap shifts to 2,000 / 1,700. The consumer template intentionally lacks the package-self-references — its pointers target files that exist in the **consumer's** repo (`.augment/skills/`, `agents/settings/contexts/`, ...), not this package's authoring tree.
|
|
118
120
|
|
|
119
121
|
## Gotchas
|
|
120
122
|
|
|
121
|
-
- **Outboarding to a new top-level dir.** Inventing `agents/explainers/` or `docs/notes/` for the moved content silently widens the contract surface. Outboard only into
|
|
123
|
+
- **Outboarding to a new top-level dir.** Inventing `agents/explainers/` or `docs/notes/` for the moved content silently widens the contract surface. Outboard only into `packages/core/.agent-src.uncompressed/contexts/`, `docs/contracts/`, an existing rule body, or an existing skill body.
|
|
122
124
|
- **Pointer-ratio inflation by decoration.** Adding boilerplate "Browse all skills" / "See also" links to lift the ratio above 40 % defeats the purpose. The lint counts only substantive pointers (with a *why*-clause ≥ 60 chars); decorative links get filtered out and the ratio drops back below threshold.
|
|
123
|
-
- **Emergency-triage drift.** Editing the in-file emergency-triage block instead of the canonical
|
|
125
|
+
- **Emergency-triage drift.** Editing the in-file emergency-triage block instead of the canonical `packages/core/.agent-src.uncompressed/contexts/contracts/emergency-triage-block.md` causes the package-root and consumer-template versions to diverge silently. Always edit the canonical file and let the lint diff pull both back in sync.
|
|
124
126
|
- **Cap inversion under WARN.** A 2,250-char AGENTS.md (above 2,200 WARN, below 2,500 FAIL) is a yellow signal not a green one — every additional sentence raises the probability of the next FAIL. Treat WARN as the spend boundary, not a buffer.
|
|
125
127
|
- **Char-count includes frontmatter.** `wc -c` counts every byte including the YAML preamble, blank lines, and the trailing newline. Stripping a section to "look smaller" without re-running `wc -c` understates the true budget impact.
|
|
126
128
|
- **Path enumeration.** A run of three or more bare `` `path/to/dir/` `` bullets without *why*-clauses is the classic re-bloat pattern. The lint emits a WARN at ≥ 3 such lines. Collapse them into one capability-style pointer — see the recipe in [`agents-md-anatomy § Iron Law`](../../contexts/contracts/agents-md-anatomy.md#iron-law--capabilities-over-structure).
|
|
@@ -136,6 +138,10 @@ When invoked as a planning step, produce:
|
|
|
136
138
|
4. Specific outboarding edits as a numbered diff plan.
|
|
137
139
|
5. The four lint commands the agent must run before claiming completion.
|
|
138
140
|
|
|
141
|
+
## Cloud Behavior
|
|
142
|
+
|
|
143
|
+
Inert on cloud surfaces. The skill governs the package-root `AGENTS.md` and the consumer-shipped template — both authoring artifacts inside this repository. Cloud agents working on consumer projects never edit those files directly; their copy is delivered by the package install pipeline and refreshed by the package sync pipeline. The Thin-Root contract therefore has no cloud-side procedure to execute, which is why this skill is marked `cloud_safe: noop`.
|
|
144
|
+
|
|
139
145
|
## See also
|
|
140
146
|
|
|
141
147
|
- [`agents-md-anatomy`](../../contexts/contracts/agents-md-anatomy.md) — Capabilities-over-Structure Iron Law, multi-tool symlink strategy, monorepo per-package layout, refactor recipe, full gotcha catalog.
|
|
@@ -67,7 +67,7 @@ Inspect truth-defining files:
|
|
|
67
67
|
- Config files, tests, existing docs
|
|
68
68
|
|
|
69
69
|
Verify: install steps exist, commands work, features are implemented,
|
|
70
|
-
|
|
70
|
+
dependencies are real.
|
|
71
71
|
|
|
72
72
|
### 3. Validate installation and setup
|
|
73
73
|
|
|
@@ -153,8 +153,54 @@ Structure checks:
|
|
|
153
153
|
→ See `docs/guidelines/docs/readme-size-and-splitting.md` for full thresholds,
|
|
154
154
|
splitting strategies, and anti-patterns.
|
|
155
155
|
|
|
156
|
+
### 9. Validate every link and detect orphans — MANDATORY
|
|
157
|
+
|
|
158
|
+
For every internal link in the README:
|
|
159
|
+
|
|
160
|
+
1. Resolve the path. `test -f` files, `test -d` directories. Strip
|
|
161
|
+
`#anchor` and `?query` before the check.
|
|
162
|
+
2. For every anchor link (`file.md#section`), grep the target file for
|
|
163
|
+
the heading slug. Missing slug = broken anchor.
|
|
164
|
+
3. Group findings:
|
|
165
|
+
- **broken** — target does not exist (❌ Critical)
|
|
166
|
+
- **anchor-broken** — file exists, anchor does not (⚠️ Major)
|
|
167
|
+
- **path-drift** — target moved but a valid path exists elsewhere
|
|
168
|
+
(⚠️ Major, propose the corrected path)
|
|
169
|
+
|
|
170
|
+
For every documentation file referenced by the README, check whether
|
|
171
|
+
it has any **other** references in the repo (`grep -r` over
|
|
172
|
+
`AGENTS.md`, `docs/`, `.agent-src*/`, `.augment/`, `packages/`).
|
|
173
|
+
Files referenced only by this README are **single-use** — note them
|
|
174
|
+
so they can be moved or inlined later.
|
|
175
|
+
|
|
176
|
+
For every doc under `/docs/` that the README **does not** link, check
|
|
177
|
+
whether anything else in the repo links it. Files with zero inbound
|
|
178
|
+
references are **orphan-candidates** — surface them, never delete
|
|
179
|
+
silently.
|
|
180
|
+
|
|
181
|
+
### 10. Currency check — drift detection
|
|
182
|
+
|
|
183
|
+
The README may have been correct at write-time but drifted since.
|
|
184
|
+
Compare the README's claims to the live repository:
|
|
185
|
+
|
|
186
|
+
- **Counts** (badges like "Skills: 218") — recount from the source tree
|
|
187
|
+
and flag any drift > 0
|
|
188
|
+
- **Commands** — every documented `task`, `npm run`, `npx`, or `bash`
|
|
189
|
+
call must exist in `Taskfile.yml`, `package.json scripts`, or the
|
|
190
|
+
named script file at its claimed path
|
|
191
|
+
- **Profiles / user-types / packs** — list members against the live
|
|
192
|
+
directory listing
|
|
193
|
+
- **Version pins** — runtime, framework, peer-dep versions stated in
|
|
194
|
+
README vs. the manifest's `engines` / `require` / `dependencies`
|
|
195
|
+
- **Visual identity** — banner / hero image references resolve to real
|
|
196
|
+
files (not 404s in GitHub rendering)
|
|
197
|
+
|
|
156
198
|
## Output format
|
|
157
199
|
|
|
200
|
+
1. Produce three subsections in order: Summary, Findings, Confidence; no prose outside them.
|
|
201
|
+
2. Findings table must use the severity vocabulary (❌ Critical / ⚠️ Major / ℹ️ Minor) and cite the exact section name.
|
|
202
|
+
3. Close the report with a *Confidence* block that separates confirmed-correct, needs-verification, and unclear-due-to-missing-context.
|
|
203
|
+
|
|
158
204
|
### 1. Summary
|
|
159
205
|
|
|
160
206
|
| Field | Value |
|
|
@@ -168,8 +214,11 @@ splitting strategies, and anti-patterns.
|
|
|
168
214
|
| # | Severity | Section | Issue | Fix |
|
|
169
215
|
|---|---|---|---|---|
|
|
170
216
|
| 1 | ❌ Critical | Install | Command `X` does not exist | Replace with `Y` |
|
|
171
|
-
| 2 |
|
|
172
|
-
| 3 |
|
|
217
|
+
| 2 | ❌ Critical | Profile grid | Link `.agent-src.uncompressed/profiles/` 404s | Repoint to `packages/core/.agent-src.uncompressed/profiles/` |
|
|
218
|
+
| 3 | ⚠️ Major | Badges | "Skills: 218" — live count is 207 | Update badge or note drift |
|
|
219
|
+
| 4 | ⚠️ Major | Usage | Example uses deprecated API | Update to current API |
|
|
220
|
+
| 5 | ℹ️ Minor | Structure | Requirements buried below usage | Move above install |
|
|
221
|
+
| 6 | ℹ️ Minor | Docs | `docs/foo.md` only linked by README | Either inline or keep as standalone |
|
|
173
222
|
|
|
174
223
|
Severity levels:
|
|
175
224
|
|
|
@@ -49,9 +49,34 @@ the intended audience. Reflects the real repository — not assumptions.
|
|
|
49
49
|
- **Strong quickstart over exhaustive noise** — a reader should get started in 30 seconds
|
|
50
50
|
- **Right scope** — high-level overview in README, deep content in dedicated docs
|
|
51
51
|
- **Match the repo type** — a package README differs from an app, CLI tool, or framework
|
|
52
|
+
- **Re-analyze every time** — never trust cached knowledge of the repo; the README that drifted yesterday is the README the model wrote from memory
|
|
53
|
+
- **Preserve existing visual identity** — banner, badges, profile/role grids, official logo lockups stay byte-identical unless the user explicitly asks to change them
|
|
52
54
|
|
|
53
55
|
## Procedure
|
|
54
56
|
|
|
57
|
+
### 0. Re-analysis gate — MANDATORY before any writing
|
|
58
|
+
|
|
59
|
+
Before drafting a single line, run a fresh repository inspection in **this**
|
|
60
|
+
session. Do not rely on prior knowledge, prior turns, or the existing README
|
|
61
|
+
prose. Produce an explicit evidence ledger:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
ledger:
|
|
65
|
+
package: <name + version from manifest>
|
|
66
|
+
description: <verbatim from manifest>
|
|
67
|
+
cli_entry: <bin / entry from manifest, if any>
|
|
68
|
+
commands: <list of real commands from Taskfile / Makefile / package.json scripts>
|
|
69
|
+
install: <verified install path(s) from scripts/install.* or docs>
|
|
70
|
+
doc_targets: <list of /docs files actually linked from the new draft>
|
|
71
|
+
counts: <skills / rules / commands / personas / advisors — if surfaced as badges>
|
|
72
|
+
visual_keep: <line range of existing README header, banner, badge block to preserve>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If any cell is unknown, run `ls`, `grep`, `find`, or read the file before
|
|
76
|
+
writing — never invent. If the user asks to "use the existing banner",
|
|
77
|
+
locate the exact source lines and reproduce them byte-for-byte, including
|
|
78
|
+
the surrounding HTML.
|
|
79
|
+
|
|
55
80
|
### 1. Identify README type and audience
|
|
56
81
|
|
|
57
82
|
Determine repository type:
|
|
@@ -139,26 +164,49 @@ for install, first example, or requirements).
|
|
|
139
164
|
splitting strategies (reference-split, deep-link tables, collapsibles),
|
|
140
165
|
multi-audience handling, and anti-patterns.
|
|
141
166
|
|
|
142
|
-
### 7. Validate
|
|
167
|
+
### 7. Validate links and detect orphans — MANDATORY
|
|
168
|
+
|
|
169
|
+
For every internal link in the new draft:
|
|
170
|
+
|
|
171
|
+
1. Resolve the path. If it points to a file, `test -f` the path. If a
|
|
172
|
+
directory, `test -d`. Strip `#anchor` and `?query` before the check.
|
|
173
|
+
2. For every anchor link (`file.md#section`), grep the target file for
|
|
174
|
+
the heading slug. Missing anchor = broken link.
|
|
175
|
+
3. Build the **link-delta** between the old README and the new one:
|
|
176
|
+
- **kept**: linked in both
|
|
177
|
+
- **added**: only linked by the new README
|
|
178
|
+
- **dropped**: only linked by the old README
|
|
179
|
+
|
|
180
|
+
For every `dropped` target, search the rest of the repository
|
|
181
|
+
(`grep -r "<path>"` over `AGENTS.md`, `docs/`, `.agent-src*/`,
|
|
182
|
+
`.augment/`, `packages/`). If no other file references it, mark
|
|
183
|
+
**orphan-candidate**. Surface the list to the user — do not delete
|
|
184
|
+
silently.
|
|
185
|
+
|
|
186
|
+
### 8. Validate
|
|
143
187
|
|
|
144
188
|
After writing, verify:
|
|
145
189
|
|
|
146
190
|
- [ ] Every documented command exists in the repo (`Taskfile.yml`, `Makefile`, `package.json scripts`, etc.)
|
|
147
191
|
- [ ] Setup steps are reproducible (no missing prerequisites)
|
|
148
192
|
- [ ] No features or capabilities are invented
|
|
149
|
-
- [ ] First screen
|
|
193
|
+
- [ ] **First screen contract** — within the first ~40 lines: project name, one-sentence pitch, install command (or pointer), and the primary CTA
|
|
194
|
+
- [ ] Banner, badges, and any explicit "preserve" block from Step 0 are byte-identical to source
|
|
150
195
|
- [ ] No dead sections (heading with 1-2 trivial sentences)
|
|
151
196
|
- [ ] Scope is right — deep content moved to dedicated docs, not crammed in
|
|
152
197
|
- [ ] Size below the "overloaded" threshold, or splitting is in place (see size guideline)
|
|
153
198
|
- [ ] ToC present if README > 150 lines or > 6 top-level sections
|
|
154
199
|
- [ ] Matches existing tonality if repo has established voice
|
|
155
|
-
- [ ]
|
|
200
|
+
- [ ] Every internal link resolved per Step 7 — zero broken file or anchor links
|
|
201
|
+
- [ ] Orphan-candidate list produced even if empty
|
|
156
202
|
|
|
157
203
|
## Output format
|
|
158
204
|
|
|
159
205
|
1. Full README draft
|
|
160
206
|
2. Short note: detected repo type + audience
|
|
161
|
-
3.
|
|
207
|
+
3. **Link delta** — `kept` / `added` / `dropped` with orphan-candidates flagged
|
|
208
|
+
4. Evidence ledger (Step 0) so the user can audit assumptions
|
|
209
|
+
5. Any uncertainties or assumptions that need confirmation
|
|
162
210
|
|
|
163
211
|
## Gotcha
|
|
164
212
|
|
|
@@ -48,9 +48,33 @@ what it does, whether it fits their stack, how to install it, and how to use it.
|
|
|
48
48
|
- **Compatibility must be explicit** — don't imply broad support without evidence
|
|
49
49
|
- **First code example must be real, minimal, and verified** — no pseudo-code
|
|
50
50
|
- **README = onboarding, /docs = reference** — keep README focused
|
|
51
|
+
- **Re-analyze every time** — never write from cached knowledge; verify the manifest, source, and CI matrix in this session
|
|
52
|
+
- **Preserve existing visual identity** — banner, badges, hero images, and logo lockups stay byte-identical unless the user explicitly asks to change them
|
|
51
53
|
|
|
52
54
|
## Procedure
|
|
53
55
|
|
|
56
|
+
### 0. Re-analysis gate — MANDATORY before any writing
|
|
57
|
+
|
|
58
|
+
Before drafting, produce an evidence ledger from a fresh inspection of
|
|
59
|
+
the package — manifest, source, CI, examples. Do not rely on prior turns
|
|
60
|
+
or the existing README prose.
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
ledger:
|
|
64
|
+
package: <name + version from manifest>
|
|
65
|
+
description: <verbatim from manifest>
|
|
66
|
+
install_cmd: <verified against the manifest's package manager>
|
|
67
|
+
requirements: <language version, framework version, ext-*, services>
|
|
68
|
+
public_api: <entry classes / functions / exports from source>
|
|
69
|
+
test_command: <real command from manifest scripts / Taskfile>
|
|
70
|
+
doc_targets: <list of /docs files actually linked from the new draft>
|
|
71
|
+
visual_keep: <line range of existing README header / banner / badges to preserve>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If any cell is unknown, run `ls`, `grep`, `find`, or read the file before
|
|
75
|
+
writing — never invent. When the user asks to keep the existing banner
|
|
76
|
+
or badge row, reproduce it byte-for-byte from the source.
|
|
77
|
+
|
|
54
78
|
### 1. Identify package type and audience
|
|
55
79
|
|
|
56
80
|
| Type | Audience | README focus |
|
|
@@ -63,7 +87,7 @@ what it does, whether it fits their stack, how to install it, and how to use it.
|
|
|
63
87
|
|
|
64
88
|
### 2. Inspect package truth sources
|
|
65
89
|
|
|
66
|
-
Read files that define actual package behavior:
|
|
90
|
+
Read and **verify** files that define actual package behavior (confirm each claim against the source — never paraphrase from memory):
|
|
67
91
|
|
|
68
92
|
- Manifest: `composer.json`, `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, or `*.gemspec` — name, description, requirements, scripts
|
|
69
93
|
- Source entrypoints — public API surface, main classes/functions
|
|
@@ -255,7 +279,21 @@ capability comparison. They serve different jobs — install vs. coverage.
|
|
|
255
279
|
|
|
256
280
|
README = enough to adopt. Docs = enough to master.
|
|
257
281
|
|
|
258
|
-
### 8. Validate
|
|
282
|
+
### 8. Validate links and detect orphans — MANDATORY
|
|
283
|
+
|
|
284
|
+
For every internal link in the new draft:
|
|
285
|
+
|
|
286
|
+
1. Resolve the path. `test -f` files, `test -d` directories. Strip
|
|
287
|
+
`#anchor` and `?query` before the check.
|
|
288
|
+
2. For every anchor link, grep the target for the heading slug.
|
|
289
|
+
3. Build the **link-delta** vs. the old README — `kept` / `added` /
|
|
290
|
+
`dropped`. For every `dropped` target, search the rest of the repo
|
|
291
|
+
(`grep -r` over `AGENTS.md`, `docs/`, `.agent-src*/`, `packages/`).
|
|
292
|
+
No other reference → mark **orphan-candidate**.
|
|
293
|
+
|
|
294
|
+
Surface the orphan-candidate list to the user — never delete silently.
|
|
295
|
+
|
|
296
|
+
### 9. Validate
|
|
259
297
|
|
|
260
298
|
- [ ] Install command is correct and complete
|
|
261
299
|
- [ ] Compatibility/requirements match the manifest (`composer.json`, `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `*.gemspec`) and the CI matrix
|
|
@@ -266,15 +304,20 @@ README = enough to adopt. Docs = enough to master.
|
|
|
266
304
|
- [ ] Deep content is in docs, not README (see size guideline)
|
|
267
305
|
- [ ] Multi-platform install uses a table, not stacked blocks
|
|
268
306
|
- [ ] No duplication between README and `/docs/`
|
|
269
|
-
- [ ] First screen
|
|
307
|
+
- [ ] **First screen contract** — within ~40 lines: name, one-sentence pitch, install command, requirements (or pointer)
|
|
308
|
+
- [ ] Banner / badges / hero from Step 0 visual_keep are byte-identical to source
|
|
309
|
+
- [ ] Every internal link resolved per Step 8 — zero broken file or anchor links
|
|
310
|
+
- [ ] Orphan-candidate list produced even if empty
|
|
270
311
|
|
|
271
312
|
## Output format
|
|
272
313
|
|
|
273
314
|
1. Full README draft
|
|
274
315
|
2. Detected package type + audience
|
|
275
316
|
3. Compatibility summary
|
|
276
|
-
4.
|
|
277
|
-
5.
|
|
317
|
+
4. **Link delta** — `kept` / `added` / `dropped` with orphan-candidates flagged
|
|
318
|
+
5. Evidence ledger (Step 0) so the user can audit assumptions
|
|
319
|
+
6. Uncertainties needing confirmation
|
|
320
|
+
7. Suggested follow-up docs if README would become too large
|
|
278
321
|
|
|
279
322
|
## Gotcha
|
|
280
323
|
|
|
@@ -170,6 +170,40 @@ If you have tried **three** fixes and the bug is still present:
|
|
|
170
170
|
design that keeps producing this class of bug?
|
|
171
171
|
* Surface the question to the user. Do not attempt fix #4 silently.
|
|
172
172
|
|
|
173
|
+
## Debug micro-loop — one test, one fix, one re-run
|
|
174
|
+
|
|
175
|
+
Tactical complement to the 6-phase loop, for failing test suites,
|
|
176
|
+
broken builds, and regressions. Each lap completes in **one turn**.
|
|
177
|
+
Pairs with [`context-hygiene § Read-Loop Detection`](../../rules/context-hygiene.md#read-loop-detection--the-15--25-rule)
|
|
178
|
+
— if you catch yourself reading-without-acting, run this loop.
|
|
179
|
+
|
|
180
|
+
1. **Pick ONE failing test.** Run it isolated:
|
|
181
|
+
`npx vitest run path/to/single.test.ts`,
|
|
182
|
+
`pytest tests/x.py::test_y`, `phpunit --filter test_y`. Full suite
|
|
183
|
+
between laps is forbidden — it drowns the signal.
|
|
184
|
+
2. **Read the assertion, not the file.** `expected X to be Y` names
|
|
185
|
+
the gap. Hypothesis comes from the error, not a hunch.
|
|
186
|
+
3. **Source first, test second.** Shape mismatch → read the producer
|
|
187
|
+
(route, function, component) **once**, then align the test (or fix
|
|
188
|
+
the producer if it's the regression — Phase 2 decides which).
|
|
189
|
+
4. **Use git as a diagnostic.** Regression in code that worked →
|
|
190
|
+
`git log --oneline -- <file>` → `git show <sha> -- <file>`. The
|
|
191
|
+
before/after diff names the dropped logic faster than re-reading.
|
|
192
|
+
5. **One edit, then re-run the same single test.** Green → next
|
|
193
|
+
failing test. Red → step 2 with the new assertion. **Never** edit
|
|
194
|
+
two unrelated things before re-running.
|
|
195
|
+
6. **Full suite at the end, not between laps.** It is the gate, not
|
|
196
|
+
the feedback loop.
|
|
197
|
+
|
|
198
|
+
**Anti-patterns this loop prevents:**
|
|
199
|
+
|
|
200
|
+
* Editing source to make tests pass when the test was wrong (or
|
|
201
|
+
vice versa) — step 3 forces "read producer first".
|
|
202
|
+
* Drowning in full-suite output every lap — step 1 pins one file.
|
|
203
|
+
* Three reads in a row without a fix — step 5 forces an edit per lap.
|
|
204
|
+
* Guessing at mock / payload shape — step 3 forces reading the route
|
|
205
|
+
handler or component the mock substitutes for.
|
|
206
|
+
|
|
173
207
|
## Gathering evidence — cheap tools first
|
|
174
208
|
|
|
175
209
|
| What you need | Tool |
|
|
@@ -252,6 +286,13 @@ When reporting debug findings to the user:
|
|
|
252
286
|
* A green test run after changes, without having first seen it red
|
|
253
287
|
* "This looks similar to bug X, so it's the same fix"
|
|
254
288
|
* Suppressing a log, warning, or exception instead of tracing its source
|
|
289
|
+
* **Three consecutive read-only turns** (only `view` / `grep` /
|
|
290
|
+
`git log` / `codebase-retrieval`, no edits, no test runs) — trips the
|
|
291
|
+
Read-Loop Detection 15-minute warning. See
|
|
292
|
+
[`context-hygiene § Read-Loop Detection`](../../rules/context-hygiene.md#read-loop-detection--the-15--25-rule)
|
|
293
|
+
and run the Debug micro-loop instead: one failing test → read the
|
|
294
|
+
assertion → read the producer once → one edit → re-run that single
|
|
295
|
+
test.
|
|
255
296
|
|
|
256
297
|
## Do NOT
|
|
257
298
|
|
|
@@ -39,7 +39,7 @@ schema_version: 1
|
|
|
39
39
|
# CI guard: a release bump of `package.json` must update this value
|
|
40
40
|
# in lockstep — see scripts/check_template_pin_drift.py (road-to-
|
|
41
41
|
# portable-runtime-and-update-check P3.3).
|
|
42
|
-
agent_config_version: "
|
|
42
|
+
agent_config_version: "3.0.0"
|
|
43
43
|
|
|
44
44
|
# --- Project identity ---
|
|
45
45
|
project:
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Pre-commit hook: artefact frontmatter lint (event4u/agent-config, ADR-013)
|
|
3
|
+
#
|
|
4
|
+
# Aborts the commit when any staged .md file under
|
|
5
|
+
# `.agent-src.uncompressed/` violates the per-artefact frontmatter
|
|
6
|
+
# contract (workspaces / packs / lifecycle / trust / install). Exits
|
|
7
|
+
# silently when no such files are staged — zero overhead on unrelated
|
|
8
|
+
# commits.
|
|
9
|
+
#
|
|
10
|
+
# To run manually:
|
|
11
|
+
# ./agent-config hooks:install-frontmatter
|
|
12
|
+
# python3 scripts/lint_artefact_frontmatter.py
|
|
13
|
+
#
|
|
14
|
+
# To uninstall:
|
|
15
|
+
# rm .git/hooks/pre-commit
|
|
16
|
+
set -e
|
|
17
|
+
|
|
18
|
+
# Only act on commits that touch the source-of-truth artefact tree
|
|
19
|
+
# (or the linter / vocabulary that govern it).
|
|
20
|
+
staged="$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null || true)"
|
|
21
|
+
case "$staged" in
|
|
22
|
+
*.agent-src.uncompressed/*.md*|*config/discovery/*.yml*|*scripts/lint_artefact_frontmatter.py*)
|
|
23
|
+
: ;;
|
|
24
|
+
*)
|
|
25
|
+
exit 0 ;;
|
|
26
|
+
esac
|
|
27
|
+
|
|
28
|
+
# Resolve the linter — prefer the consumer-shipped path, fall back to
|
|
29
|
+
# the source-of-truth copy when run from inside the package itself.
|
|
30
|
+
script=""
|
|
31
|
+
for cand in \
|
|
32
|
+
".augment/scripts/lint_artefact_frontmatter.py" \
|
|
33
|
+
".agent-src/scripts/lint_artefact_frontmatter.py" \
|
|
34
|
+
"scripts/lint_artefact_frontmatter.py"; do
|
|
35
|
+
if [ -f "$cand" ]; then
|
|
36
|
+
script="$cand"
|
|
37
|
+
break
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
if [ -z "$script" ]; then
|
|
42
|
+
echo "⚠️ pre-commit-frontmatter: lint_artefact_frontmatter.py not found." >&2
|
|
43
|
+
echo " Run \`task install\` (or \`./agent-config install\`) and retry." >&2
|
|
44
|
+
echo " Skipping check — letting commit through." >&2
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
if ! python3 "$script" --quiet >/dev/null 2>&1; then
|
|
49
|
+
echo "❌ Artefact frontmatter lint failed (ADR-013 contract violation)." >&2
|
|
50
|
+
echo "" >&2
|
|
51
|
+
echo " Re-run for details:" >&2
|
|
52
|
+
echo " python3 $script" >&2
|
|
53
|
+
echo " task lint-artefact-frontmatter" >&2
|
|
54
|
+
echo "" >&2
|
|
55
|
+
echo " Common fixes:" >&2
|
|
56
|
+
echo " • Add missing workspaces/packs/lifecycle/trust/install keys." >&2
|
|
57
|
+
echo " • Pick values from config/discovery/{workspaces,packs}.yml." >&2
|
|
58
|
+
echo " • For scaffolds, add the path to" >&2
|
|
59
|
+
echo " config/discovery/unassigned-artefacts.yml with a reason." >&2
|
|
60
|
+
echo "" >&2
|
|
61
|
+
echo " To bypass once (NOT recommended):" >&2
|
|
62
|
+
echo " git commit --no-verify" >&2
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
exit 0
|