Commit 346a950
authored
* fix(cli): align charter subcommand path to .straymark/charters/
The `straymark charter list/audit/close/drift/new` subcommands hardcoded
`docs/charters/` as the discovery root, while `straymark init` and
`straymark status` already validated `.straymark/charters/` as the
canonical structure. Projects on the post-rebrand layout (fw-4.11.0)
were silently invisible to the CLI: charters created with `charter new`
landed in `docs/charters/` but `straymark status` only looked under
`.straymark/`, and reciprocally `charter list/audit/close` could not
see charters living under `.straymark/charters/`.
This change unifies on `.straymark/charters/` (the canonical post-rebrand
location), where declarative `*.md` and telemetry `*.telemetry.yaml`
sidecars now share one directory. The drift bash script and its
documentation are updated to match.
Changes:
- New `charter::charters_dir(project_root)` helper as the single source
of truth for the Charter discovery path.
- `discover_charters` and `commands/charter/new.rs` now route through
it; previously they constructed `docs/charters/` directly.
- `commands/charter/close.rs` reuses the same helper for telemetry
destination — declarative + telemetry are no longer split.
- Error messages in `audit/close/drift` now name the path that was
searched and hint at `straymark charter list` (per the Issue #119
workaround request).
- `dist/.straymark/scripts/check-charter-drift.sh` matches against
`.straymark/charters/*` instead of `docs/charters/*`.
- All existing tests (`cli/tests/charter_*.rs`, inline tests in
`charter.rs`, `tui/index.rs`, `commands/charter/list.rs`,
`commands/charter/status.rs`) updated to the new path.
Tested: `cargo test --release` (479 passed); smoke test
(`charter new` → `charter list` round-trip on `.straymark/charters/`).
Closes #119
* docs(framework): surface Charter as top-level concept
Address the discoverability gap reported in #113: STRAYMARK.md and
QUICK-REFERENCE.md (EN/ES/zh-CN) did not name Charters anywhere, so
agents onboarding via canonical entry points built binary mental
models (SpecKit = planning, StrayMark = audit-trail) and silently
dropped the third layer where Charters live.
- STRAYMARK.md §6: add Charter trigger ("multi-session implementation
block, >1 day, >5 tasks") to the When-to-Document table.
- STRAYMARK.md §9: add Charter row to the Autonomy Limits table.
- STRAYMARK.md §10: add charters/ to the documentation map tree.
- STRAYMARK.md §11: add Charter rows to the When-to-Load table
(template path + how to list existing Charters + bridge doc).
- STRAYMARK.md §13: add Charter to the Quick Type Reference, noting
the NN-slug.md filename divergence from TYPE-YYYY-...-NNN-*.
- STRAYMARK.md §15 (new): dedicated section explaining what a Charter
is, when to declare one, the lifecycle (declared → in-progress →
closed), and how it relates to AILOG/ADR/SpecKit.
- QUICK-REFERENCE.md (×3 langs): add "Bounded Units of Work — Charter"
subsection alongside the doc-type tables, charters/ entry in the
folder tree, Charter trigger row in When-to-Document, and
/straymark-charter-new in the skills table.
* docs(directives): add Charter trigger to pre-commit checklist
Inject the Charter declaration trigger into the directive templates
(CLAUDE.md, GEMINI.md, copilot-instructions.md) that `straymark init`
fans out to adopting projects. Now agents reading the local
CLAUDE.md / GEMINI.md / .github/copilot-instructions.md see Charter
in their pre-commit checklist alongside AILOG / AIDEC / ADR / ETH
triggers, instead of having to hunt for it in STRAYMARK.md §15.
Trigger wording: "Starting a multi-session implementation block (>1
day, >5 tasks, multi-phase)? → Declare a Charter via
`straymark charter new` (see STRAYMARK.md §15)".
Closes the second contributing factor of #113 (root cause #2:
"CLAUDE.md Pre-commit Checklist has no Charter trigger").
* feat(cli): scan .straymark/charters/ in straymark status
Surface Charters in the canonical health view. Until now `straymark
status` enumerated only the 12 governance doc types — Charters were
structurally invisible to the compliance-observability tool, even
when present. That blind spot is the fifth contributing factor of
#113 ("/straymark-status excludes Charters from its scan").
The new "Charters" block sits below "Documentation":
- When the project has no Charters yet: a single dimmed line
pointing at `/straymark-charter-new` and STRAYMARK.md §15.
- When Charters exist: a status-keyed table (declared / in-progress
/ closed / TOTAL), with declared in normal weight, in-progress in
yellow, closed in green — matching the colorize_status convention
already used by `charter list`.
- Unparseable Charter files (Charter-shaped filename, schema
mismatch) are surfaced as a warning row so the operator knows to
fix them.
Counts come from `charter::discover_and_parse(project_root)` — the
same source of truth that `straymark charter list` uses, ensuring
the two commands cannot disagree about what's in the project.
* feat(skills): add /straymark-charter-new + Charter mentions in status/new
Add a dedicated /straymark-charter-new skill across the three skill
surfaces (Claude Code, Gemini, agnostic) so Charter declaration is
discoverable through skill autocomplete and through any "what slash
commands exist?" exploration. Previously Charter creation was only
reachable via the bare `straymark charter new` CLI invocation, which
the issue (#113 root cause #4) flagged as the reason agents miss
the concept entirely.
The new skill drives the existing CLI — slug derivation, sequential
numbering and template substitution stay server-side; the skill's
job is to gather title/effort/origin (--from-ailog vs --from-spec
vs none), confirm with the operator, then run `straymark charter
new` with the right flags. The skill explicitly does NOT flip
status, run drift, or run audit — those have their own skills /
CLI surfaces and shouldn't be conflated with declaration.
Also amend the existing skills:
- /straymark-status (×3): scan `.straymark/charters/` after the
doc-type prefixes, surface "no Charters yet but the work fits the
trigger → recommend /straymark-charter-new" as a gap.
- /straymark-new (×3): add Charter as a *redirect* row (not a doc
type that `straymark new` can produce) — the skill recognizes
"create a Charter" / "declare a Charter" intent and points at
/straymark-charter-new instead of trying to handle it inline.
Closes the third, fourth, fifth and sixth contributing factors of
#113 (no charter-new skill, /straymark-status excludes Charters,
audit-* skills' framing).
* refactor(framework): wire CLI to charter templates' new subdirectory
Templates were moved to `dist/.straymark/templates/charter/` in the
preceding "surface Charter as top-level concept" commit so that the
charter-* templates are visually distinguishable from auxiliary doc
templates (root cause #7 of #113: "charter-template.md and
charter-telemetry-template.yaml are listed in `.straymark/templates/`
but indistinguishable from auxiliary templates").
This commit wires the CLI and tests to the new layout:
- `commands/charter/new.rs` resolves the declarative template
through `templates/charter/charter-template.md` (with i18n fallback
via `templates/charter/i18n/<lang>/`).
- `commands/charter/close.rs` reads the telemetry template from
`templates/charter/charter-telemetry-template.yaml`.
- `cli/tests/charter_{test,drift,close}.rs` build their fixtures
under `templates/charter/` and create the subdir explicitly.
`utils::resolve_localized_path` already handles arbitrary base
directories, so no change was needed there.
* docs(governance): add SPECKIT-CHARTER-BRIDGE.md (EN/ES/zh-CN)
Close root cause #8 of #113: "no documented bridge between SpecKit
and StrayMark Charters". The Charter frontmatter has had
`originating_spec: specs/NNN-feature/spec.md` from day one — the
schema slot was the bridge, but nothing told operators or agents
*when* a SpecKit feature should yield a Charter, *how granular* it
should be (1 per feature? 1 per phase? 1 per User Story?), or
*who triggers the creation* (after `/speckit-tasks`? before
`/speckit-implement`?). Without that, agents formed the binary
mental model the issue flagged — "SpecKit = planning, StrayMark =
audit-trail" — and silently dropped the Charter layer.
The new doc:
- Names the three layers (specification → Charter → AILOG/AIDEC/ADR)
and the handoff pattern between them.
- Lists four "yes-Charter" conditions (≥5 tasks across sessions,
multi-phase, audit-worthy, telemetry-worthy) and three "no-Charter"
conditions (single-session, planning-only, ad-hoc maintenance).
- Gives four granularity heuristics with the rule "one Charter per
shippable cut" — explicitly NOT per User Story, NOT per feature.
- Anchors the creation timing to the SpecKit pipeline:
/speckit-tasks → declare Charter → /speckit-implement → drift →
audit (optional) → close.
- Documents the frontmatter linkage in both directions
(Charter.originating_spec, AILOG.originating_charter).
- Lists five anti-patterns (Charter "to be safe", per-US, missing
origin, premature close, audit without auditors).
- Names five cases where the pattern doesn't apply (single-session,
arch-only, pure refactor, incident response, compliance refresh).
Cited in STRAYMARK.md §11 ("SpecKit user — when does a feature yield
a Charter?"), STRAYMARK.md §15 ("Charters as bounded units of work"),
and the QUICK-REFERENCE Charter subsection. Skill `/straymark-charter-new`
also points to it.
Translations follow the same patterns established for
`docs/i18n/{es,zh-CN}/` — preserve technical terms (Charter,
SpecKit, drift, scope), localize narrative.
1 parent 464b15f commit 346a950
28 files changed
Lines changed: 1106 additions & 16 deletions
File tree
- cli
- src/commands
- charter
- tests
- dist
- .agent/workflows
- .claude/skills
- straymark-charter-new
- straymark-new
- straymark-status
- .gemini/skills
- straymark-charter-new
- straymark-new
- straymark-status
- .straymark
- 00-governance
- i18n
- es
- zh-CN
- templates/charter
- i18n/es
- dist-templates/directives
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
508 | | - | |
| 510 | + | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
| |||
313 | 321 | | |
314 | 322 | | |
315 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| 321 | + | |
| 322 | + | |
319 | 323 | | |
320 | | - | |
| 324 | + | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
325 | | - | |
| 329 | + | |
326 | 330 | | |
327 | 331 | | |
328 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
| 81 | + | |
72 | 82 | | |
73 | 83 | | |
74 | 84 | | |
| |||
0 commit comments