@erclx/canon 4.127.0 → 5.2.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.
Files changed (97) hide show
  1. package/README.md +5 -7
  2. package/claude/.claude-plugin/plugin.json +1 -1
  3. package/claude/skills/auto-ship/references/verb-absent.md +0 -1
  4. package/claude/skills/canon-feedback/REQUIREMENT.md +1 -1
  5. package/claude/skills/canon-feedback/SKILL.md +2 -2
  6. package/claude/skills/canon-operator/REQUIREMENT.md +2 -2
  7. package/claude/skills/canon-operator/SKILL.md +3 -3
  8. package/claude/skills/codebase-layout/REQUIREMENT.md +1 -0
  9. package/claude/skills/codebase-layout/SKILL.md +6 -0
  10. package/claude/skills/create-rule/REQUIREMENT.md +1 -1
  11. package/claude/skills/create-standard/REQUIREMENT.md +0 -2
  12. package/claude/skills/decision-escalate/REQUIREMENT.md +1 -2
  13. package/claude/skills/draft-context/REQUIREMENT.md +1 -1
  14. package/claude/skills/draft-docs/REQUIREMENT.md +1 -1
  15. package/claude/skills/draft-wireframes/REQUIREMENT.md +1 -1
  16. package/claude/skills/plan-intake/SKILL.md +1 -1
  17. package/claude/skills/target-setup/REQUIREMENT.md +2 -2
  18. package/claude/skills/target-setup/SKILL.md +1 -1
  19. package/claude/skills/target-setup/references/detect.md +1 -1
  20. package/claude/skills/target-setup/references/indexes.md +1 -5
  21. package/docs/agents/commands.md +7 -3
  22. package/docs/agents/counts.md +1 -2
  23. package/docs/agents/docs.md +1 -1
  24. package/docs/agents/drift-surfaces.md +6 -4
  25. package/docs/agents/index.md +1 -1
  26. package/docs/agents/indexes.md +1 -1
  27. package/docs/agents/install-and-sync.md +1 -8
  28. package/docs/agents/markdown-audit.md +2 -2
  29. package/docs/agents/restated.md +7 -5
  30. package/docs/agents/review-classification.md +1 -2
  31. package/docs/agents/scripting.md +2 -3
  32. package/docs/agents/skills-reach.md +3 -3
  33. package/docs/agents/state-scoped-risk.md +1 -1
  34. package/docs/target/index.md +4 -4
  35. package/docs/target/{target-migrations.md → migrations.md} +17 -1
  36. package/docs/target/{target-projects.md → projects.md} +5 -7
  37. package/docs/target/{target-scenarios.md → scenarios.md} +1 -1
  38. package/docs/target/{target-sync.md → sync.md} +4 -2
  39. package/docs/workflow/ai-workflow.md +3 -7
  40. package/docs/workflow/operating-model.md +4 -4
  41. package/docs/workflow/parallel-features.md +1 -1
  42. package/docs/workflow/skill-map.md +1 -2
  43. package/docs/workflow/visual-design-workflow.md +5 -5
  44. package/docs/workflow/zshrc-aliases.md +1 -1
  45. package/package.json +1 -2
  46. package/scripts/core/check-plugin-boundary.sh +1 -1
  47. package/scripts/core/install-check.sh +3 -4
  48. package/scripts/core/regen-hero.sh +2 -9
  49. package/src/autoship/paths.ts +3 -5
  50. package/src/claude/cases/authoring.ts +1 -5
  51. package/src/claude/plugin-update.ts +2 -2
  52. package/src/claude/skills-reach.ts +1 -2
  53. package/src/cli.ts +0 -2
  54. package/src/commands/feedback-format.ts +0 -1
  55. package/src/commands/gov.ts +8 -7
  56. package/src/commands/markdown.ts +2 -2
  57. package/src/commands/upgrade.ts +62 -6
  58. package/src/counts/catalogs.ts +0 -16
  59. package/src/counts/scan.ts +1 -1
  60. package/src/docs/read.ts +25 -25
  61. package/src/gate/measures.ts +52 -0
  62. package/src/gate/stages.ts +9 -0
  63. package/src/gov/restated.ts +60 -22
  64. package/src/help.ts +0 -2
  65. package/src/init/steps.ts +1 -1
  66. package/src/migrate/skill-names.ts +4 -5
  67. package/src/secrets/shipped.ts +2 -2
  68. package/src/serve/static.ts +1 -2
  69. package/src/shipped/references.ts +7 -8
  70. package/src/sync/engine.ts +2 -2
  71. package/standards/context.md +2 -0
  72. package/standards/docs.md +1 -0
  73. package/standards/index.md +0 -1
  74. package/standards/skill.md +1 -2
  75. package/standards/wiki.md +2 -1
  76. package/tooling/base/reference.md +2 -2
  77. package/tooling/claude/reference.md +1 -1
  78. package/claude/skills/create-snippet/REQUIREMENT.md +0 -39
  79. package/claude/skills/create-snippet/SKILL.md +0 -30
  80. package/scripts/snippets/create.sh +0 -156
  81. package/snippets/align.md +0 -12
  82. package/snippets/claude/decision-memo.md +0 -39
  83. package/snippets/claude/feature-recap.md +0 -19
  84. package/snippets/claude/figma-steps.md +0 -24
  85. package/snippets/compact-summary.md +0 -5
  86. package/snippets/decision-help.md +0 -6
  87. package/snippets/meta-prompt.md +0 -14
  88. package/snippets/research-prompt.md +0 -7
  89. package/snippets/session-notes.md +0 -11
  90. package/snippets/snippets.toml +0 -5
  91. package/snippets/step-by-step.md +0 -10
  92. package/snippets/web-research.md +0 -21
  93. package/src/commands/snippets.ts +0 -90
  94. package/src/snippets/categories.ts +0 -66
  95. package/src/snippets/list.ts +0 -32
  96. package/src/snippets/presets.ts +0 -50
  97. package/standards/snippets.md +0 -76
@@ -1,50 +0,0 @@
1
- import { existsSync, readFileSync } from 'node:fs'
2
- import { join } from 'node:path'
3
- import { snippetsSourceDir } from '@/snippets/categories'
4
-
5
- export interface Preset {
6
- readonly name: string
7
- readonly slugs: readonly string[]
8
- }
9
-
10
- export function presetsPath(root: string): string {
11
- return join(snippetsSourceDir(root), 'snippets.toml')
12
- }
13
-
14
- /**
15
- * Reads every preset from `snippets.toml`. The bash read section headers with
16
- * `grep '^\['` and then re-walked the file per preset with a `BASH_REMATCH`
17
- * loop, so a name carrying a bracket or a slug split across lines parsed by
18
- * accident rather than by rule.
19
- */
20
- export function loadPresets(root: string): Preset[] {
21
- const path = presetsPath(root)
22
- if (!existsSync(path)) return []
23
-
24
- const parsed = Bun.TOML.parse(readFileSync(path, 'utf8')) as Record<
25
- string,
26
- unknown
27
- >
28
- const presets: Preset[] = []
29
-
30
- for (const [name, table] of Object.entries(parsed)) {
31
- if (typeof table !== 'object' || table === null || Array.isArray(table)) {
32
- continue
33
- }
34
- const names = (table as Record<string, unknown>).names
35
- presets.push({
36
- name,
37
- slugs: Array.isArray(names)
38
- ? names.filter(
39
- (slug): slug is string => typeof slug === 'string' && slug !== '',
40
- )
41
- : [],
42
- })
43
- }
44
-
45
- return presets.sort((left, right) => left.name.localeCompare(right.name))
46
- }
47
-
48
- export function findPreset(root: string, name: string): Preset | undefined {
49
- return loadPresets(root).find((preset) => preset.name === name)
50
- }
@@ -1,76 +0,0 @@
1
- ---
2
- title: Snippet reference
3
- description: Snippet reference and authoring conventions
4
- ---
5
-
6
- # Snippet reference
7
-
8
- ## Scope
9
-
10
- Governs a snippet file: what one is for, whether a prompt qualifies as one, how it is invoked, and the structure of its body.
11
-
12
- Does not govern:
13
-
14
- - Skill folders, which carry frontmatter, references, and scripts a snippet has none of: `skill.md`
15
- - Voice, rhythm, and sentence construction in snippet prose: the `write-human` skill
16
- - Punctuation, formatting, and word choice in snippet prose: `markdown.md`
17
-
18
- ## What a snippet is
19
-
20
- A snippet is a short, focused prompt stored as a plain markdown file. Invoke one to insert a prepared instruction into any AI chat without retyping it. Each snippet covers one purpose. If a prompt needs headers or multiple goals, use a system prompt instead.
21
-
22
- ## Admission
23
-
24
- Two tests decide whether a prompt becomes a snippet, and both have to pass. Apply them when adding one and when auditing the catalog.
25
-
26
- - Cadence: a prompt invoked many times across sessions qualifies. A one-shot audit, migration, or bootstrap prompt does not, and belongs in notes outside the catalog.
27
- - Audience: a prompt the consuming project would invoke ships in `snippets/`. One only the authoring repository can run stays outside every installable folder, which is a rule for a repository that authors snippets for others rather than for one that only consumes them.
28
-
29
- A subfolder under `snippets/` names where a prompt is invoked rather than what it is about. A prompt that reads or writes the project's own files goes in a folder, and one carrying its whole context in the message goes at the root.
30
-
31
- Overlapping a skill that does the same job is not disqualifying on its own. A snippet fires when a person asks for it by name and a skill fires on a description match, so the two coexist when those paths differ and the outputs do. Record the reason where the project keeps its decisions, or drop the snippet.
32
-
33
- ## Invocation channels
34
-
35
- - Chrome extension: type `>slug` in a supported chat UI (claude.ai, gemini.google.com) to insert the snippet text inline
36
- - Claude Code terminal: prefix the plugin path with `@` (e.g. `@claude/snippets/claude/feature-recap`). `claude/snippets` is a symlink to the authoring root, so the folder a snippet is written in is the folder it is invoked from
37
-
38
- ## Use patterns
39
-
40
- - Run-as-is: invoke and send immediately. The snippet is self-contained and needs no extra context.
41
- - Invoke-then-add-context: invoke the snippet, then append specifics in the same message (e.g. invoke `plan-feature`, then add the feature name or extra constraints)
42
- - Invoke-on-history: invoke after a discussion. The snippet uses prior conversation as implicit context with no additional input needed (e.g. invoke `claude-figma` after discussing a design).
43
-
44
- ## Authoring
45
-
46
- - One focused purpose per snippet. If it needs headers or multiple goals, use a system prompt instead.
47
- - Self-contained. No references to external files or assumed prior context.
48
- - No user fill-in placeholders. If a value depends on context, the user adds it after invocation.
49
- - Plain markdown only. No YAML frontmatter, no headers, no nested structure.
50
- - Filename is the slug: kebab-case, no capitals, no underscores
51
-
52
- ## Structure
53
-
54
- - Lead with a verb. Open with an imperative that states the job immediately.
55
- - One instruction per sentence. Do not stack multiple actions into one sentence.
56
- - For sequential steps, use a numbered list with one action per item.
57
- - When the output has a fixed shape, show it in a fenced code block with a language identifier.
58
- - Put constraints and exclusions last, not inline with the main instructions.
59
-
60
- ## Examples
61
-
62
- ### Correct
63
-
64
- ```markdown
65
- I want to implement the following. Scan relevant files and list conflicts. Do not implement. # user adds feature after invocation
66
- Scan relevant files and list conflicts. Do not implement. # run-as-is, no context needed
67
- ```
68
-
69
- ### Incorrect
70
-
71
- ```markdown
72
- I want to implement: <feature or task name> # redundant fill-in, add context after invocation instead
73
- See ARCHITECTURE.md before starting. # external dependency, not self-contained
74
-
75
- ## Overview\n## Steps # headers belong in a system prompt, not a snippet
76
- ```