@sumrco/cli 0.3.5 → 0.3.8
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/README.md +137 -2
- package/ai/modules/kontract/resources/api-generation-standards.rf.md +2 -0
- package/ai/modules/kontract/resources/authoring/configuration.rf.md +13 -0
- package/ai/modules/kontract/resources/authoring/design-profile/api-styles.rf.md +11 -0
- package/ai/modules/kontract/resources/authoring/design-profile/async-styles.rf.md +53 -0
- package/ai/modules/kontract/resources/authoring/overview.md +3 -0
- package/ai/modules/kontract/resources/authoring/schema-reuse.rf.md +3 -0
- package/ai/modules/kontract/resources/authoring/spec-layout.rf.md +12 -4
- package/ai/modules/kontract/resources/authoring/team-members/spec-author.tm.md +3 -0
- package/ai/modules/kontract/resources/authoring/workflows/{spec-change.wf.md → spec-change.cmd.md} +5 -3
- package/ai/modules/kontract/resources/generated-output.rf.md +99 -4
- package/ai/modules/kontract/resources/overview.md +3 -0
- package/ai/modules/mission/resources/flow-actions.rf.md +28 -3
- package/ai/modules/mission/resources/flow-config.rf.md +2 -2
- package/ai/modules/mission/resources/flow-safety-boundaries.rf.md +7 -0
- package/ai/modules/mission/resources/overview.md +69 -11
- package/ai/modules/mission/resources/stage-closeout.rf.md +15 -5
- package/ai/modules/mission/resources/stage-delivery.rf.md +19 -6
- package/ai/modules/mission/resources/stage-intake.rf.md +58 -8
- package/ai/modules/mission/resources/stage-planning.rf.md +17 -3
- package/ai/modules/mission/resources/stage-pull-request.rf.md +5 -2
- package/ai/modules/mission/resources/stage-quality.rf.md +25 -4
- package/ai/modules/mission/resources/team-members/delivery-lead.tm.md +5 -3
- package/ai/modules/mission/resources/team-members/implementer.tm.md +10 -3
- package/ai/modules/mission/resources/team-members/planner.tm.md +25 -15
- package/ai/modules/mission/resources/team-members/pr-writer.tm.md +4 -3
- package/ai/modules/mission/resources/team-members/product-owner.tm.md +8 -2
- package/ai/modules/mission/resources/team-members/quality-lead.tm.md +16 -3
- package/ai/modules/mission/resources/workflows/{daily-triage.wf.md → daily-triage.cmd.md} +5 -4
- package/ai/modules/mission/resources/workflows/{full-delivery.wf.md → full-delivery.cmd.md} +3 -3
- package/ai/modules/mission/resources/workflows/{mission-cycle.wf.md → mission-cycle.cmd.md} +9 -5
- package/ai/modules/mission/resources/workflows/{planning-only.wf.md → planning-only.cmd.md} +5 -4
- package/ai/modules/mission/resources/workflows/{pr-assist.wf.md → pr-assist.cmd.md} +5 -4
- package/ai/modules/mission/resources/workflows/{standard-delivery.wf.md → standard-delivery.cmd.md} +3 -3
- package/ai/modules/mission/sumr.module.yaml +20 -2
- package/ai/modules/playbook/resources/authoring/content-structure.rf.md +16 -1
- package/ai/modules/playbook/resources/authoring/extraction.rf.md +4 -2
- package/ai/modules/playbook/resources/authoring/markdown.rf.md +20 -0
- package/ai/modules/playbook/resources/authoring/overview.md +31 -1
- package/ai/modules/playbook/resources/authoring/patterns.rf.md +99 -0
- package/ai/modules/playbook/sumr.module.yaml +3 -0
- package/index.js +565 -397
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
category:
|
|
2
|
+
category: command
|
|
3
3
|
name: daily-triage
|
|
4
4
|
title: Daily Mission Triage
|
|
5
5
|
description: "Builds a daily SUMR Mission triage queue from configured trackers, open Mission state, or provided work items, then stops before approval or implementation."
|
|
@@ -40,7 +40,7 @@ Run SUMR Mission planning only for {{issueOrWorkItem}}.
|
|
|
40
40
|
Create or update the Mission, read full tracker context including description,
|
|
41
41
|
comments, todos/checklists, linked docs, and images/screenshots, inspect relevant
|
|
42
42
|
code paths read-only, write a draft implementation plan, register the plan
|
|
43
|
-
without
|
|
43
|
+
without running the separate approval command, then stop.
|
|
44
44
|
|
|
45
45
|
Do not approve the plan.
|
|
46
46
|
Do not claim the mission.
|
|
@@ -62,7 +62,8 @@ Use the `sumr-mission-planner` agent when the channel supports custom agents.
|
|
|
62
62
|
|
|
63
63
|
2. Collect candidate work items from the caller, the repo-specific tracker query, or the configured tracker.
|
|
64
64
|
3. Normalize every candidate to a Mission issue key.
|
|
65
|
-
4. Skip candidates that already have an approved plan, claim,
|
|
65
|
+
4. Skip candidates that already have an approved plan, claim, execution-ledger progress, task
|
|
66
|
+
submissions, validation evidence, or close-ready state.
|
|
66
67
|
5. For each selected candidate, check current state:
|
|
67
68
|
|
|
68
69
|
```bash
|
|
@@ -108,7 +109,7 @@ Return a concise daily triage queue:
|
|
|
108
109
|
|
|
109
110
|
## Rules
|
|
110
111
|
|
|
111
|
-
- Do not
|
|
112
|
+
- Do not run `sumr mission approve` during daily triage.
|
|
112
113
|
- Do not run `sumr mission claim`.
|
|
113
114
|
- Do not spawn implementation agents from this workflow.
|
|
114
115
|
- Do not create worktrees during triage.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
category:
|
|
2
|
+
category: command
|
|
3
3
|
name: full-delivery
|
|
4
4
|
title: Full Mission Delivery
|
|
5
|
-
description: "Runs the richer Mission flow with issue sync, research, plan approval, branch check, delivery, quality, PR assist, and closeout."
|
|
5
|
+
description: "Runs the richer Mission flow with issue sync, research, plan approval, branch check, delivery, quality, PR assist, and closeout. Use when the task is broad, risky, or benefits from explicit research and quality gates."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Full Mission Delivery
|
|
@@ -10,7 +10,7 @@ description: "Runs the richer Mission flow with issue sync, research, plan appro
|
|
|
10
10
|
Use this workflow when the task is broad, risky, or benefits from explicit research and quality gates.
|
|
11
11
|
|
|
12
12
|
```text
|
|
13
|
-
issue.sync -> context.research -> plan.create -> plan.approve(human) -> branch.check(ask) -> work.claim ->
|
|
13
|
+
issue.sync -> context.research -> plan.create -> plan.approve(human) -> branch.check(ask) -> work.claim -> tasks.execute -> tasks.review -> validation.report -> quality.gate -> pr.prepare(ask) -> pr.create(human) -> mission.close
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Do not collapse research, plan approval, PR creation, or closeout unless the user explicitly approves.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
category:
|
|
2
|
+
category: command
|
|
3
3
|
name: cycle
|
|
4
4
|
title: Mission Cycle
|
|
5
|
-
description: "Guides an AI agent through the configured Mission flow, next action, planning, implementation, validation, PR assist, handoff, and closeout."
|
|
5
|
+
description: "Guides an AI agent through the configured Mission flow, next action, planning, implementation, validation, PR assist, handoff, and closeout. Use when a user gives an issue key, tracker ID, or mission ID, or asks to resume AI-assisted work."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Mission Cycle
|
|
@@ -23,8 +23,12 @@ This repo uses `{{MISSION_FLOW_PRESET}}`.
|
|
|
23
23
|
2. Identify or create the mission with `sumr mission start`.
|
|
24
24
|
3. Run `sumr mission status <key>` or `sumr mission next`.
|
|
25
25
|
4. Follow the returned next action and stop at `human` or `ask` gates.
|
|
26
|
-
5.
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
5. For each accepted-plan task, use `task start`, `task submit`, `verify record`, structured
|
|
27
|
+
`review` imports, `finding resolve` plus re-review when needed, then `task complete`.
|
|
28
|
+
6. Use Mission reports only for remaining mission-level research, handoff, validation, and quality
|
|
29
|
+
evidence.
|
|
30
|
+
7. Use `sumr mission pr <key> --preview` before asking to create a PR.
|
|
31
|
+
8. Record `finish` before close. Never push, create PRs, mutate work providers, merge, deploy, or
|
|
32
|
+
remove a workspace without the separate authority that owns that action.
|
|
29
33
|
|
|
30
34
|
ARGUMENTS: $ARGUMENTS
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
category:
|
|
2
|
+
category: command
|
|
3
3
|
name: planning-only
|
|
4
4
|
title: Mission Planning Only
|
|
5
5
|
description: "Creates SUMR Mission draft plans for one or more work items, then stops before approval, claim, worktree creation, or implementation."
|
|
@@ -23,7 +23,7 @@ Run SUMR Mission planning only for {{issueOrWorkItem}}.
|
|
|
23
23
|
Create or update the Mission, read full tracker context including description,
|
|
24
24
|
comments, todos/checklists, linked docs, and images/screenshots, inspect relevant
|
|
25
25
|
code paths read-only, write a draft implementation plan, register the plan
|
|
26
|
-
without
|
|
26
|
+
without running the separate approval command, then stop.
|
|
27
27
|
|
|
28
28
|
Do not approve the plan.
|
|
29
29
|
Do not claim the mission.
|
|
@@ -59,10 +59,11 @@ Use the `sumr-mission-planner` agent when the channel supports custom agents.
|
|
|
59
59
|
|
|
60
60
|
## Rules
|
|
61
61
|
|
|
62
|
-
- Do not
|
|
62
|
+
- Do not run `sumr mission approve` during planning-only runs.
|
|
63
63
|
- Do not run `sumr mission claim`.
|
|
64
64
|
- Do not spawn implementation agents from this workflow.
|
|
65
65
|
- Do not create worktrees during planning.
|
|
66
66
|
- Do not mutate external trackers, labels, assignees, project status, PRs, deployments, or external systems without explicit approval.
|
|
67
|
-
- If a mission already has an approved plan, claim,
|
|
67
|
+
- If a mission already has an approved plan, claim, execution-ledger progress, task submission, or
|
|
68
|
+
validation evidence, skip planning and report the existing state instead of overwriting it.
|
|
68
69
|
- If the issue is ambiguous or blocked by missing product context, create the draft plan with open questions and leave the Mission waiting for approval.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
category:
|
|
2
|
+
category: command
|
|
3
3
|
name: pr-assist
|
|
4
4
|
title: Mission PR Assist
|
|
5
|
-
description: "Prepares a scoped PR preview from Mission artifacts, issue context, verification evidence, and repo PR conventions."
|
|
5
|
+
description: "Prepares a scoped PR preview from Mission artifacts, issue context, verification evidence, and repo PR conventions. Use when implementation and validation evidence exists and a PR is ready to prepare."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Mission PR Assist
|
|
@@ -12,9 +12,10 @@ Use this workflow after implementation and validation evidence exists.
|
|
|
12
12
|
1. Run `sumr mission status <key>`.
|
|
13
13
|
2. Confirm the current branch is not protected.
|
|
14
14
|
3. Run `sumr mission pr <key> --preview`.
|
|
15
|
-
4. Review the generated PR body for scope drift, local-only paths, raw commit logs, and raw diff stats.
|
|
15
|
+
4. Review and edit the generated PR body for scope drift, local-only paths, raw commit logs, and raw diff stats.
|
|
16
16
|
5. Remove or split unrelated dependency, audit, tooling, infrastructure, or cleanup changes unless they are required for the issue.
|
|
17
|
-
6.
|
|
17
|
+
6. Record the reviewed body with `sumr mission pr <key> --accept-preview`.
|
|
18
|
+
7. Ask before `--create-draft` or `--create`.
|
|
18
19
|
|
|
19
20
|
Never merge or mutate issue/project state.
|
|
20
21
|
|
package/ai/modules/mission/resources/workflows/{standard-delivery.wf.md → standard-delivery.cmd.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
category:
|
|
2
|
+
category: command
|
|
3
3
|
name: standard-delivery
|
|
4
4
|
title: Standard Mission Delivery
|
|
5
|
-
description: "Runs the default practical Mission flow from issue intake through plan approval, implementation evidence, validation, quality gate, and PR preview."
|
|
5
|
+
description: "Runs the default practical Mission flow from issue intake through plan approval, implementation evidence, validation, quality gate, and PR preview. Use when delivering a normal, well-scoped issue."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Standard Mission Delivery
|
|
@@ -10,7 +10,7 @@ description: "Runs the default practical Mission flow from issue intake through
|
|
|
10
10
|
Use this workflow for normal issue delivery.
|
|
11
11
|
|
|
12
12
|
```text
|
|
13
|
-
issue.sync -> context.research(skipped) -> plan.create -> plan.approve(human) -> branch.check(ask) -> work.claim ->
|
|
13
|
+
issue.sync -> context.research(skipped) -> plan.create -> plan.approve(human) -> branch.check(ask) -> work.claim -> tasks.execute -> tasks.review -> validation.report -> quality.gate -> pr.prepare(ask) -> pr.create(human)
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Stop for human approval before implementation and before PR creation.
|
|
@@ -45,7 +45,7 @@ spec:
|
|
|
45
45
|
summary: Claim a mission for implementation
|
|
46
46
|
visibility: public
|
|
47
47
|
- name: report
|
|
48
|
-
summary: Create a mission report
|
|
48
|
+
summary: Create a mission-level research, handoff, validation, or quality report
|
|
49
49
|
visibility: public
|
|
50
50
|
- name: reopen
|
|
51
51
|
summary: Record a QA failure and drive a corrective cycle
|
|
@@ -57,7 +57,7 @@ spec:
|
|
|
57
57
|
summary: Clear a mission blocker
|
|
58
58
|
visibility: public
|
|
59
59
|
- name: close
|
|
60
|
-
summary: Close a
|
|
60
|
+
summary: Close an eligible mission after a terminal finish disposition
|
|
61
61
|
visibility: public
|
|
62
62
|
- name: clean
|
|
63
63
|
summary: Remove expired closed mission cache
|
|
@@ -65,9 +65,27 @@ spec:
|
|
|
65
65
|
- name: flow
|
|
66
66
|
summary: Inspect and configure Mission flow presets
|
|
67
67
|
visibility: public
|
|
68
|
+
- name: providers
|
|
69
|
+
summary: Inspect registered work and repository provider capabilities
|
|
70
|
+
visibility: public
|
|
68
71
|
- name: pr
|
|
69
72
|
summary: Prepare or create a pull request from Mission evidence
|
|
70
73
|
visibility: public
|
|
74
|
+
- name: task
|
|
75
|
+
summary: Inspect and advance accepted-plan execution tasks
|
|
76
|
+
visibility: public
|
|
77
|
+
- name: review
|
|
78
|
+
summary: Import a structured spec or quality review for a submitted task
|
|
79
|
+
visibility: public
|
|
80
|
+
- name: finding
|
|
81
|
+
summary: Append a resolution to a task review finding
|
|
82
|
+
visibility: public
|
|
83
|
+
- name: verify
|
|
84
|
+
summary: Import and inspect structured verification receipts
|
|
85
|
+
visibility: public
|
|
86
|
+
- name: finish
|
|
87
|
+
summary: Record an explicit finish disposition without external or destructive actions
|
|
88
|
+
visibility: public
|
|
71
89
|
exports:
|
|
72
90
|
resources: []
|
|
73
91
|
binaries: []
|
|
@@ -35,12 +35,19 @@ Brief intro — one or two sentences. Optional.
|
|
|
35
35
|
High-level rules or overview. Keep concise.
|
|
36
36
|
Push deep details to reference files in the same folder.
|
|
37
37
|
|
|
38
|
+
## Non-Negotiables
|
|
39
|
+
|
|
40
|
+
- **MUST** state hard rules with a signal word, one per line.
|
|
41
|
+
- **NEVER** bury an absolute rule inside prose — it belongs here.
|
|
42
|
+
|
|
38
43
|
## Key Section
|
|
39
44
|
|
|
40
45
|
Main content. Code snippets inline for short examples.
|
|
41
46
|
|
|
42
47
|
<!-- extract:examples -->
|
|
43
|
-
##
|
|
48
|
+
## State Map Example
|
|
49
|
+
|
|
50
|
+
**✅ Good** — model transitions as data so the AI extends one object
|
|
44
51
|
|
|
45
52
|
\`\`\`ts
|
|
46
53
|
const stateByTransition = {
|
|
@@ -48,11 +55,19 @@ const stateByTransition = {
|
|
|
48
55
|
review: ['approved', 'changes-requested'],
|
|
49
56
|
} as const;
|
|
50
57
|
\`\`\`
|
|
58
|
+
|
|
59
|
+
**❌ Bad** — scattered if/else branches the AI cannot reason about as a whole
|
|
60
|
+
|
|
61
|
+
\`\`\`ts
|
|
62
|
+
if (state === 'draft') return ['review'];
|
|
63
|
+
if (state === 'review') return ['approved', 'changes-requested'];
|
|
64
|
+
\`\`\`
|
|
51
65
|
<!-- /extract:examples -->
|
|
52
66
|
```
|
|
53
67
|
|
|
54
68
|
Rules:
|
|
55
69
|
- `## When to Use` is required in every main doc.
|
|
70
|
+
- Use a `## Non-Negotiables` section for hard rules and a ✅/❌ paired example for non-obvious conventions — see **Patterns**.
|
|
56
71
|
- Keep the main doc under ~180 lines. If it goes over, move deep sections to `category: reference` files.
|
|
57
72
|
- Do not add a `## References` or `## Related` section manually — the playbook sync generates the reference table automatically.
|
|
58
73
|
|
|
@@ -29,15 +29,17 @@ Wrap dedicated examples sections with extraction markers:
|
|
|
29
29
|
<!-- /extract:examples -->
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Skill-folder channels remove the extracted block from `SKILL.md`, write it to `examples
|
|
32
|
+
Skill-folder channels remove the extracted block from `SKILL.md`, write it to a heading-based support file under `examples/`, and add an `## Additional resources` link. Main-topic extracts render as `examples/<heading-slug>.md` (for example `examples/examples.md`). Reference doc extracts render as `examples/<reference-stem>-<heading-slug>.md`. Flat-file channels keep extracted content inline because they cannot attach supporting files.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Each `<!-- extract:examples -->` block must start with a Markdown heading because the heading becomes the generated file name. Blocks that produce the same file name are merged with a separator. Each block must be self-contained — include any intro or title inside the marker, not outside it.
|
|
35
35
|
|
|
36
36
|
> [!CAUTION]
|
|
37
37
|
> Do not leave an intro sentence outside the marker with nothing below it:
|
|
38
38
|
> ```markdown
|
|
39
39
|
> Use the following pattern: ← orphaned intro — BAD
|
|
40
40
|
> <!-- extract:examples -->
|
|
41
|
+
> ## Role Map Example
|
|
42
|
+
>
|
|
41
43
|
> \`\`\`ts
|
|
42
44
|
> const roleByStatus = { draft: 'writer', ready: 'reviewer' } as const;
|
|
43
45
|
> \`\`\`
|
|
@@ -56,6 +56,24 @@ Limit to **1-2 callouts per major section**. If everything is critical, nothing
|
|
|
56
56
|
- `*italic*` sparingly for secondary emphasis
|
|
57
57
|
- Pick asterisks consistently — never mix `*` and `_`
|
|
58
58
|
|
|
59
|
+
## Signal Words and Status Markers
|
|
60
|
+
|
|
61
|
+
Calibrate rule strength with keywords agents weight: `MUST`, `MUST NEVER`, `ALWAYS`, `NEVER` for hard rules; `SHOULD`, `PREFER`, `AVOID` for defaults. Reserve the hard words for the few truly absolute rules — see **Patterns** for the full calibration table and non-negotiable conventions.
|
|
62
|
+
|
|
63
|
+
Status markers (`✅`, `❌`, `⚠`) are allowed as inline labels and inside callout bodies — never in headings. Use them to mark paired good/bad examples, not as decoration.
|
|
64
|
+
|
|
65
|
+
## Validation Checklists
|
|
66
|
+
|
|
67
|
+
When a doc describes a process the agent must follow, end it with a task checklist it can walk literally:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
- [ ] Run `sumr playbook validate --source docs`
|
|
71
|
+
- [ ] Preview with `sumr playbook sync --source docs --dry-run`
|
|
72
|
+
- [ ] Resolve every warning before a real sync
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
A checklist is more reliable than the same steps buried in a paragraph.
|
|
76
|
+
|
|
59
77
|
## Lists
|
|
60
78
|
|
|
61
79
|
- Ordered (`1.`) when sequence matters (steps, priority order)
|
|
@@ -106,3 +124,5 @@ Limit to **1-2 callouts per major section**. If everything is critical, nothing
|
|
|
106
124
|
| Trailing colon on heading (`## When to Use:`) | Remove trailing punctuation |
|
|
107
125
|
| Bare URLs | Wrap in `[text](url)` |
|
|
108
126
|
| Table for non-tabular data | Use a list instead |
|
|
127
|
+
| Hard signal word on a soft preference (`MUST` for a nicety) | Use `SHOULD`/`PREFER` for defaults |
|
|
128
|
+
| Prose "do X, not Y" with no example | Add a ✅/❌ paired block (see **Patterns**) |
|
|
@@ -48,6 +48,24 @@ source of truth.
|
|
|
48
48
|
See **Lifecycle Hooks** for event fields, generated Claude and Codex outputs,
|
|
49
49
|
placement rules, and validation flow.
|
|
50
50
|
|
|
51
|
+
## Generated Output Ownership
|
|
52
|
+
|
|
53
|
+
Treat every AI-channel folder as generated output, never as an authoring
|
|
54
|
+
surface. Durable guidance, trigger language, role behavior, orchestration, and
|
|
55
|
+
lifecycle automation must originate in canonical Playbook sources under
|
|
56
|
+
`{{PLAYBOOK_PATH}}/`.
|
|
57
|
+
|
|
58
|
+
- Edit topics/references for reusable guidance.
|
|
59
|
+
- Edit `team-member` docs for delegated role behavior.
|
|
60
|
+
- Edit `command` or `workflow` docs for invoked flows and orchestration.
|
|
61
|
+
- Edit `lifecycle` docs for automatic tool/session behavior.
|
|
62
|
+
- If a renderer cannot express the source correctly, fix the customer-agnostic
|
|
63
|
+
renderer and regenerate; never patch its output.
|
|
64
|
+
|
|
65
|
+
Renderer templates may provide only tool-native structure and generic generated
|
|
66
|
+
resource navigation. They must not infer a domain workflow from filenames,
|
|
67
|
+
agent names, or customer conventions.
|
|
68
|
+
|
|
51
69
|
## Splitting Existing Docs
|
|
52
70
|
|
|
53
71
|
Before splitting a file, decide the owning context folder. Do not just create another peer `.md` file in a broad folder when the split content is really its own topic.
|
|
@@ -176,12 +194,18 @@ Wrap dedicated examples sections with markers so they can be consumed separately
|
|
|
176
194
|
<!-- /extract:examples -->
|
|
177
195
|
```
|
|
178
196
|
|
|
179
|
-
**When to extract:** Dedicated `## Examples` sections, sample templates, and long boilerplate blocks.
|
|
197
|
+
**When to extract:** Dedicated `## Examples` sections, sample templates, and long boilerplate blocks. Each extract block must start with a Markdown heading; skill-folder channels use that heading for the support filename, remove the block from `SKILL.md`, and add an `## Additional resources` link. Main-topic extracts render as `examples/<heading-slug>.md`; reference extracts render as `examples/<reference-stem>-<heading-slug>.md`.
|
|
180
198
|
|
|
181
199
|
**Keep in main doc:** Short inline snippets, file structure trees, ASCII diagrams, schema outlines that are core to the instructions.
|
|
182
200
|
|
|
183
201
|
See **Extraction** for the full code-block classification table.
|
|
184
202
|
|
|
203
|
+
## Good/Bad Patterns and Non-Negotiables
|
|
204
|
+
|
|
205
|
+
Teach AI channels with contrast, not prose. For any non-obvious naming, folder, or structure convention, show a ✅ Good example beside an ❌ Bad one — each with a one-line *why* — and wrap the pair with `<!-- extract:examples -->`. Put absolute rules in a dedicated `## Non-Negotiables` section using `MUST`/`NEVER`; keep softer defaults as `SHOULD`/`PREFER`.
|
|
206
|
+
|
|
207
|
+
See **Patterns** for the labelling convention, the signal-word calibration table, and where emoji belong.
|
|
208
|
+
|
|
185
209
|
## Flow Documentation
|
|
186
210
|
|
|
187
211
|
Use a compact arrow flow for simple workflows:
|
|
@@ -227,10 +251,16 @@ Before committing any `.md` file under `{{PLAYBOOK_PATH}}/`:
|
|
|
227
251
|
- [ ] Main how-to docs have `## When to Use` section
|
|
228
252
|
- [ ] Reference files have `title`, `label`, `when`, `order` — and no `## When to Use` in body
|
|
229
253
|
- [ ] Dedicated examples, samples, and templates wrapped with `<!-- extract:examples -->`; no standalone examples section left unwrapped
|
|
254
|
+
- [ ] Non-obvious naming, folder, or structure conventions show a ✅ Good / ❌ Bad pair with a one-line why
|
|
255
|
+
- [ ] Absolute rules sit in a `## Non-Negotiables` section using `MUST`/`NEVER`; soft defaults use `SHOULD`/`PREFER`
|
|
230
256
|
- [ ] Workflow and lifecycle docs use a compact arrow flow or Mermaid diagram when state transitions matter
|
|
231
257
|
- [ ] No `references:` frontmatter field
|
|
232
258
|
- [ ] No `## References` or `## Related` sections added manually
|
|
233
259
|
- [ ] Doc is under the soft cap (~180 lines); if over, split to references
|
|
234
260
|
- [ ] `{{PLAYBOOK_PATH}}` used instead of hard-coded `docs/` or similar paths in body
|
|
261
|
+
- [ ] No generated `.codex`, `.claude`, `.cursor`, `.opencode`, `.agents`, or
|
|
262
|
+
tool-entrypoint file was hand-edited
|
|
263
|
+
- [ ] Every generated behavioral instruction is traceable to canonical source
|
|
264
|
+
prose or metadata, not renderer inference
|
|
235
265
|
|
|
236
266
|
See **Markdown** for formatting rules (headings, callouts, code blocks, anti-patterns).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: reference
|
|
3
|
+
name: authoring-patterns
|
|
4
|
+
title: Good/Bad Patterns and Non-Negotiables
|
|
5
|
+
description: "Conventions for paired good/bad code examples and non-negotiable rules that steer how AI channels name, structure, and build code."
|
|
6
|
+
label: Patterns
|
|
7
|
+
when: Writing good/bad code examples, adding non-negotiable rules, calibrating MUST/NEVER vs SHOULD/PREFER, teaching naming and folder conventions
|
|
8
|
+
order: 25
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Good/Bad Patterns and Non-Negotiables
|
|
12
|
+
|
|
13
|
+
Contrastive examples and absolute rules are the highest-signal way to steer an AI channel's output. A paired good/bad example teaches the *principle*; a non-negotiable draws a hard line the agent must not cross. A doc that only describes rules in prose produces vaguer code than a doc that shows the right shape beside the wrong one.
|
|
14
|
+
|
|
15
|
+
## Paired Good/Bad Examples
|
|
16
|
+
|
|
17
|
+
Show the correct shape next to the wrong one, each with a one-line reason. The *why* is what generalizes — without it the agent copies the shape but misses the rule.
|
|
18
|
+
|
|
19
|
+
Rules:
|
|
20
|
+
|
|
21
|
+
- Label each block with a bold header: `**✅ Good** — <why>` then `**❌ Bad** — <why>`.
|
|
22
|
+
- Put the ✅ Good block first.
|
|
23
|
+
- Keep both blocks minimal — only the lines that carry the contrast.
|
|
24
|
+
- Always wrap the pair with `<!-- extract:examples -->` so it becomes a standalone example file (see **Extraction**).
|
|
25
|
+
|
|
26
|
+
Rendered, a pair looks like this:
|
|
27
|
+
|
|
28
|
+
**✅ Good** — colocate the test beside the unit so they move and rename together
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
user/
|
|
32
|
+
├── user.service.ts
|
|
33
|
+
└── user.service.test.ts
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**❌ Bad** — a parallel mirror tree drifts out of sync the moment a file moves
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
tests/unit/user/user.service.test.ts
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
In the source doc, wrap the pair so it extracts as a self-contained example file:
|
|
43
|
+
|
|
44
|
+
````markdown
|
|
45
|
+
<!-- extract:examples -->
|
|
46
|
+
## Test Colocation
|
|
47
|
+
|
|
48
|
+
**✅ Good** — colocate the test beside the unit
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
user/
|
|
52
|
+
├── user.service.ts
|
|
53
|
+
└── user.service.test.ts
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**❌ Bad** — a distant mirror tree drifts out of sync
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
tests/unit/user/user.service.test.ts
|
|
60
|
+
```
|
|
61
|
+
<!-- /extract:examples -->
|
|
62
|
+
````
|
|
63
|
+
|
|
64
|
+
When the example is real code rather than a tree, the labels can also live as `// ✅ DO` / `// ❌ DON'T` comments inside the block so they survive copy-paste.
|
|
65
|
+
|
|
66
|
+
## Non-Negotiables
|
|
67
|
+
|
|
68
|
+
Hard rules go in a dedicated `## Non-Negotiables` section near the top of the doc, as a short list. Keep it to the few rules that are truly inviolable — if everything is non-negotiable, nothing is.
|
|
69
|
+
|
|
70
|
+
- State each rule on one line, imperative, with a signal word.
|
|
71
|
+
- Pair a prohibition with its correct alternative where one exists.
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
## Non-Negotiables
|
|
75
|
+
|
|
76
|
+
- **MUST** validate external input against a schema at the boundary before use.
|
|
77
|
+
- **NEVER** edit generated channel folders (`.claude/`, `.agents/`) — edit the source doc.
|
|
78
|
+
- **ALWAYS** colocate a test with the unit it covers.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For the single hardest rule, a callout adds weight without inflating the list:
|
|
82
|
+
|
|
83
|
+
> [!CAUTION]
|
|
84
|
+
> Never commit secrets or `.env` files. A leaked credential cannot be un-leaked.
|
|
85
|
+
|
|
86
|
+
## Signal-Word Calibration
|
|
87
|
+
|
|
88
|
+
Match the keyword to how absolute the rule is. Don't spend hard words on soft preferences — the contrast is what gives MUST and NEVER their weight.
|
|
89
|
+
|
|
90
|
+
| Strength | Keywords | Use for |
|
|
91
|
+
|----------|----------|---------|
|
|
92
|
+
| Hard | MUST, MUST NEVER, ALWAYS, NEVER | Non-negotiables, security, data-loss risk |
|
|
93
|
+
| Soft | SHOULD, PREFER, AVOID | Defaults the agent may override with a stated reason |
|
|
94
|
+
|
|
95
|
+
## Where Emoji and Signal Words Belong
|
|
96
|
+
|
|
97
|
+
- ✅ / ❌ / ⚠ are allowed as **inline pattern labels** and **inside callout bodies**.
|
|
98
|
+
- Keep emoji and signal words out of **headings** — headings stay structural (see **Markdown**).
|
|
99
|
+
- One ✅/❌ pair per concept. Stacking many pairs or callouts flattens the signal.
|
|
@@ -38,6 +38,9 @@ spec:
|
|
|
38
38
|
- name: authoring
|
|
39
39
|
summary: Print the canonical Playbook Markdown authoring contract
|
|
40
40
|
visibility: public
|
|
41
|
+
- name: migrate
|
|
42
|
+
summary: Move command-era category workflow docs to command and .wf.md to .cmd.md
|
|
43
|
+
visibility: public
|
|
41
44
|
exports:
|
|
42
45
|
resources: []
|
|
43
46
|
binaries: []
|