@deftai/directive-content 0.66.2 → 0.67.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/Taskfile.yml +3 -1
- package/UPGRADING.md +20 -0
- package/docs/agent-docs.md +44 -0
- package/package.json +1 -1
- package/packs/skills/skills-pack-0.1.json +57 -35
- package/scm/github.md +23 -0
- package/skills/deft-directive-pre-pr/SKILL.md +1 -0
- package/skills/deft-directive-sync/SKILL.md +22 -0
- package/tasks/verify.yml +36 -0
- package/templates/agent-prompt-preamble.md +1 -1
- package/templates/agents-consumer-header.md +18 -0
- package/templates/agents-entry.md +18 -54
- package/templates/embed.go +6 -0
- package/templates/embed_test.go +27 -0
- package/tools/package-manager-network.md +29 -0
package/Taskfile.yml
CHANGED
|
@@ -345,6 +345,7 @@ tasks:
|
|
|
345
345
|
- verify:stubs
|
|
346
346
|
- verify:links
|
|
347
347
|
- verify:rule-ownership
|
|
348
|
+
- verify:biome-config
|
|
348
349
|
- verify:content-manifest
|
|
349
350
|
- verify:contract-drift
|
|
350
351
|
- verify:cursor-tier1
|
|
@@ -360,6 +361,7 @@ tasks:
|
|
|
360
361
|
- verify:cache-fresh
|
|
361
362
|
- verify:pack-drift
|
|
362
363
|
- verify-wip-cap-framework-self-check
|
|
364
|
+
- verify:agents-md-budget
|
|
363
365
|
- vbrief:validate
|
|
364
366
|
- codebase:validate-structure
|
|
365
367
|
- verify:codebase-map-fresh
|
|
@@ -479,7 +481,7 @@ tasks:
|
|
|
479
481
|
# in ``tasks/framework.yml`` now prints a redaction notice pointing
|
|
480
482
|
# the operator at this surface.
|
|
481
483
|
doctor:
|
|
482
|
-
desc: "Canonical doctor surface (#1272) -- task doctor [-- --session | --fix | --json | --quiet]. Uses vendored bin.js in source checkouts or global deft on npm consumer deposits (#2022 Phase 3)."
|
|
484
|
+
desc: "Canonical doctor surface (#1272) -- task doctor [-- --session | --fix | --json | --quiet | --network]. Uses vendored bin.js in source checkouts or global deft on npm consumer deposits (#2022 Phase 3). --network is required to run the payload-staleness check (git remote, then npm registry fallback); it is offline (skipped) by default and discloses the tool + registry class before contacting either (#2182)."
|
|
483
485
|
dir: '{{.USER_WORKING_DIR}}'
|
|
484
486
|
cmds:
|
|
485
487
|
- task: engine:invoke
|
package/UPGRADING.md
CHANGED
|
@@ -56,6 +56,26 @@ deft migrate:xbrief
|
|
|
56
56
|
|
|
57
57
|
(or `task migrate:xbrief` from a maintainer checkout). The command requires a clean working tree unless you pass `--force`. Legacy `vbrief/` paths and `x-vbrief/` tokens remain **read-accepted** until this migration runs; `deft update` may signpost the same guidance on non-patch upgrades.
|
|
58
58
|
|
|
59
|
+
Post-migration behavior check (#2149): on xbrief-only projects (`vbrief/` removed), `task issue:ingest -- <N>` now emits `xbrief/proposed/*.xbrief.json` with `xBRIEFInfo.version` from `xbrief/PROJECT-DEFINITION.xbrief.json` (fallback `0.8`), while legacy `vbrief/` projects keep `.vbrief.json` + `vBRIEFInfo.version: "0.6"` until migrated. `task project:render` / `project-render` also stays on `xbrief/PROJECT-DEFINITION.xbrief.json` and no longer recreates `vbrief/` in migrated trees.
|
|
60
|
+
|
|
61
|
+
### AGENTS.md: managed vs unmanaged header (#2154)
|
|
62
|
+
|
|
63
|
+
`migrate:xbrief` touches your `AGENTS.md` in two distinct regions:
|
|
64
|
+
|
|
65
|
+
- **Managed section** (between the `<!-- deft:managed-section ... -->` / `<!-- /deft:managed-section -->` markers): regenerated wholesale by `agents:refresh`, so it always reflects the current framework layout. This region is rendered from the framework template — do not hand-edit it.
|
|
66
|
+
- **Unmanaged header/tail** (everything outside those markers — your project-specific `Session orientation`, `Lifecycle` examples, `Local dev` notes): preserved verbatim across upgrades so your consumer notes survive. Because it is preserved, a rename migration would otherwise leave stale `vbrief/` path literals here. `migrate:xbrief` now applies a **bounded, idempotent** rewrite over the unmanaged region only, replacing the known crossover tokens (`vbrief/` → `xbrief/`, `*.vbrief.json` → `*.xbrief.json`, `vbrief:preflight` → `xbrief:preflight`) while leaving freeform prose untouched. It prints a summary of the replacements.
|
|
67
|
+
|
|
68
|
+
If you upgraded before this fix landed and your header still points at `vbrief/`, `deft doctor` now emits an `AGENTS.md header drift:` signpost. Re-run `deft migrate:xbrief` (idempotent) to patch the header, or hand-edit the offending path literals.
|
|
69
|
+
|
|
70
|
+
**Option A (canonical, #2065):** new installs scaffold a **bounded** unmanaged header only — a project one-liner plus a **Session orientation** pointer at the canonical sources below. Do **not** add freeform `Status`, `Next:`, or `Known Issues` blocks; they are retired because the framework preserves the header verbatim while `deft doctor` only checks the managed section (#794, #1308). Session orientation comes from:
|
|
71
|
+
|
|
72
|
+
- `xbrief/PROJECT-DEFINITION.xbrief.json` (project identity)
|
|
73
|
+
- `xbrief/` lifecycle folders (scoped work)
|
|
74
|
+
- `deft triage:queue` / `deft triage:welcome` (ranked queue)
|
|
75
|
+
- GitHub issues (tracked bugs)
|
|
76
|
+
|
|
77
|
+
If your header still carries `Status` / `Known Issues` from an older handoff, replace them with the Session orientation pointer (reference implementation: [deftai/cartograph#75](https://github.com/deftai/cartograph/pull/75)). Ephemeral shell quirks MAY stay under a `Local dev` heading only.
|
|
78
|
+
|
|
59
79
|
## Public contract layer — `@deftai/directive-types` (#1799)
|
|
60
80
|
|
|
61
81
|
Downstream TypeScript projects can import the canonical xBRIEF/policy contract instead of hand-mirroring JSON shapes:
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Authoring agent docs (AGENTS.md) for a project
|
|
2
|
+
|
|
3
|
+
Guidance for structuring the AGENTS.md (and its reference docs) of a project directive creates or maintains. Unlike most style advice, the patterns here are **empirically measured**, not opinion: Augment Code's April 2026 AuggieBench study ran real PRs with and without each pattern and scored the agent's output against the human-reviewed golden PR. Full write-up: [good-agents-md.md](./good-agents-md.md).
|
|
4
|
+
|
|
5
|
+
Legend (RFC2119): `!`=MUST, `~`=SHOULD, `≉`=SHOULD NOT, `⊗`=MUST NOT, `?`=MAY.
|
|
6
|
+
|
|
7
|
+
> The headline finding: a good AGENTS.md gave the agent a quality jump equivalent to a model upgrade; a bad one made output **worse than no AGENTS.md at all**. The same file boosted `best_practices` +25% on a routine bug fix and dropped `completeness` -30% on a complex feature in the same module. Structure is the difference.
|
|
8
|
+
|
|
9
|
+
## The pattern (what the study measured)
|
|
10
|
+
|
|
11
|
+
| Pattern | Measured effect |
|
|
12
|
+
|---|---|
|
|
13
|
+
| 100–150 line main file + a handful of focused reference files | Top performers; **10–15%** improvement across all metrics in mid-size modules. Gains **reverse** once the main file grows past ~150 lines. |
|
|
14
|
+
| Numbered procedural workflows for multi-step tasks | Missing-wiring PRs **40% → 10%**; correctness **+25%**, completeness **+20%**. |
|
|
15
|
+
| Decision tables for common ambiguities (2–3 reasonable options) | **+25%** best-practices adherence — resolves the choice before the agent writes a line. |
|
|
16
|
+
| 3–10 line snippets from the **real** codebase | Improved reuse and pattern adherence. More than a few, and the agent pattern-matches on the wrong thing. |
|
|
17
|
+
| Paired don't/do rules | Warning-only docs underperform; **15+ unpaired don'ts** measurably cause overexploration. |
|
|
18
|
+
| Module-level files over a root cross-cutting file | Root-level cross-cutting AGENTS.md underperforms module-scoped files. |
|
|
19
|
+
|
|
20
|
+
## How to structure a project's AGENTS.md
|
|
21
|
+
|
|
22
|
+
1. ! Keep the always-loaded AGENTS.md to **~100–150 lines**. It is a map (what exists, where to look, the few load-bearing rules), not a manual.
|
|
23
|
+
2. ! Push detail into **focused reference files** the agent loads on demand, each with a clear "load when…" scope. See the reference-chain contract below.
|
|
24
|
+
3. ~ Express multi-step tasks (deploy an integration, add a migration, wire a new endpoint) as **numbered workflows**, not prose. Keep branching cases in reference files.
|
|
25
|
+
4. ~ For each recurring "which of these two approaches?" ambiguity, add a **decision table** that forces the choice up front.
|
|
26
|
+
5. ~ Include a few **short, real** code snippets (3–10 lines) for the patterns you most want reused. Do not paste large or duplicative examples.
|
|
27
|
+
6. ! Write rules as **paired don't/do**, not lone warnings — an unpaired "don't" leaves the agent to guess the "do", and a pile of them triggers overexploration.
|
|
28
|
+
7. ~ Prefer **module-level** agent docs (scoped to the package/app the agent is working in) over one root file that tries to cover everything.
|
|
29
|
+
|
|
30
|
+
## The reference-chain contract
|
|
31
|
+
|
|
32
|
+
The discovery-rate principle that governs *what to reference* is named in `REFERENCES.md` ("The reference-chain contract", #644) — read it there rather than duplicating it here. In one line: **if a rule must be followed, it must be reachable in the reference chain; orphan docs (<10% discovery) are effectively invisible, and reachable-but-unreferenced docs are still found and still cost context.**
|
|
33
|
+
|
|
34
|
+
## The overexploration trap (measured failure modes, not style)
|
|
35
|
+
|
|
36
|
+
These are the specific blocks the study measured *hurting* agent quality — treat them as defects, not taste:
|
|
37
|
+
|
|
38
|
+
- ⊗ Do **not** add an "architecture overview" / broad-context section to an always-loaded agent file. On complex tasks it pulls the agent into the reference section to verify its approach against every guideline, producing unnecessary abstractions and incomplete solutions (the measured -30% completeness case).
|
|
39
|
+
- ⊗ Do **not** accumulate 15+ unpaired warnings. Past that threshold the agent over-explores instead of acting.
|
|
40
|
+
- ≉ Avoid stacking dozens of domain-specific gotchas. Domain rules help when specific and enforceable; they stop helping when piled up. Prefer a deterministic gate over prose where one exists (the gate is platform-correct by construction and travels with the repo).
|
|
41
|
+
|
|
42
|
+
## Relationship to directive's own dogfooding
|
|
43
|
+
|
|
44
|
+
Directive holds its own AGENTS.md to this bar via the `verify:agents-md-budget` ratchet (#645) and the consumer-side advisory signal (`agentsMdAdvisory`, #2155). The doc-sprawl awareness step in the `deft-directive-sync` skill (#647) surfaces reachable-doc-volume drift before it silently degrades agent quality. This doc is the "how to structure it well" companion to those "keep it from bloating" guards.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive-content",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "Shippable Directive framework content in the consumer .deft/core/ layout (C1 flatten), plus the engine surfaces (.githooks/, Taskfile.yml, tasks/) the deposit wires. Python-free per #2022 Phase 3. Refs #11, #1669, #1967.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|