Skip to content

Commit 49b37f8

Browse files
Update comment-system.md
1 parent a687f60 commit 49b37f8

File tree

1 file changed

+35
-43
lines changed

1 file changed

+35
-43
lines changed

docs/comment-system.md

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@ Audience: Beginners implementing CRAFT in repos
55

66
Note: This guide summarizes and operationalizes the official CRAFT Framework Specification’s comment system. When in doubt, the Spec is the source of truth.
77

8-
1) What it is (and how to think about it)
8+
What it is (and how to think about it)
99

10-
The CRAFT Comment System is a lightweight markup you and the AI both use inside chats and project files to make instructions explicit, routable, and auditable. You write comments that start with #H->AI::... (human to AI), and the AI must respond with #AI->H::... in the most specific response type available. Think of it like structured headers for a conversation, not code.
10+
The CRAFT Comment System is a lightweight markup you and the AI both use inside chats and project files to make instructions explicit, routable, and auditable.
11+
You write comments that start with #H->AI::… (human → AI), and the AI must respond with #AI->H::… using the most specific response type available. Think of it like structured headers for a conversation, not code.
1112

12-
2) Why it’s useful
13+
Why it’s useful
1314

1415
Eliminates ambiguity: Every instruction carries a clear intent (Directive, Context, Constraint, etc.).
1516

1617
Forces acknowledgments: The AI must acknowledge and act on each human comment type.
1718

18-
Enables QA: You can audit who said what and why across sessions and files.
19+
Enables QA: You can audit who said what and why across sessions and files.
1920

2021
Pairs with persistence & handoff: Works with the four-file model so sessions stay aligned.
2122

22-
3) The two directions (syntax you’ll actually use)
23+
The two directions (syntax you’ll actually use)
2324
Human → AI (you write these)
2425

2526
Prefix your instruction with #H->AI::Type: and put your content in parentheses.
2627

27-
Common types you’ll use most:
28+
Common types
2829

2930
#H->AI::Directive: (Do X now…)
3031

@@ -54,13 +55,13 @@ AI → Human (the assistant must use these)
5455

5556
#AI->H::Status: (Progress update)
5657

57-
#AI->H::RecipeFound/RecipeExecuting/RecipeStatus: (Recipe lifecycle)
58+
#AI->H::RecipeFound / RecipeExecuting / RecipeStatus (Recipe lifecycle)
5859

5960
#AI->H::SecurityWarning: (Security block on recipes)
6061

6162
#AI->H::COM::Status: (Operations Manager tracking — must appear once per response)
6263

63-
4) Quick Start (60second setup)
64+
Quick Start (60-second setup)
6465

6566
Copy this starter block into the top of any instruction you give the AI:
6667

@@ -69,39 +70,41 @@ Copy this starter block into the top of any instruction you give the AI:
6970
#H->AI::Structure: (Use headings + bullets, include one #AI->H::COM::Status at end)
7071

7172

73+
Then:
74+
7275
Write your actual instruction using the types above.
7376

74-
Expect an acknowledgment (#AI->H::Note: or more specific) before content.
77+
Expect an acknowledgment (#AI->H::Note: or a more specific response) before content.
7578

7679
Look for COM tracking at the bottom of every response:
7780
#AI->H::COM::Status: (…status text…)
7881

79-
5) Mustfollow companion rules (you’ll see these in the Spec)
82+
Must-follow companion rules (you’ll see these in the Spec)
8083

8184
Clarifying questions protocol:
82-
Start every task with either “No questions. Ready.” or explicit #AI->H::RequiredQuestion: / #AI->H::OptionalQuestion:. This reduces backandforth and keeps scope tight.
85+
Start every task with either “No questions. Ready.” or explicit #AI->H::RequiredQuestion: / #AI->H::OptionalQuestion:. This reduces back-and-forth and keeps scope tight.
8386

8487
Code inclusion rule:
85-
If code is to be included in a response, the AI should first ask:
88+
If code will be included, the AI should first ask:
8689
#AI->H::Question: (I will be including code in my response. Should I proceed?)
8790
If execution is simulated, the AI must prefix with “SIMULATION:”.
8891

8992
Content labeling:
9093
Require the AI to mark speculative vs. factual content with:
9194

92-
#AI->H::SuggestedContent:(…) for speculative;
95+
#AI->H::SuggestedContent:(…) for speculative
9396

94-
#AI->H::BestGuess::ConfidenceLevel:XX%:(…) for estimates;
97+
#AI->H::BestGuess::ConfidenceLevel:XX%:(…) for estimates
9598

9699
Factual claims must include citations.
97100

98101
Citations:
99-
Use APA-style references to CRAFT files in prose and include inline citation markers when referencing specific sections of the Spec (this doc includes those).
102+
Use APA-style references to CRAFT files in prose and include inline citation markers when referencing specific sections of the Spec.
100103

101-
Recipe security (only for recipes):
102-
If a recipe URL doesn’t match the allowed domain, the AI must block execution with #AI->H::SecurityWarning:. General web access is still allowed; this check is recipespecific.
104+
Recipe security (recipes only):
105+
If a recipe URL doesn’t match the allowed domain, the AI must block execution with #AI->H::SecurityWarning:. (General web access is still allowed; this check is recipe-specific.)
103106

104-
6) Comment types — Complete reference (copy/paste cheatsheet)
107+
Comment types — Complete reference (copy/paste cheat-sheet)
105108
Human → AI (you)
106109

107110
Directive – “Do this”
@@ -130,44 +133,38 @@ Recipe – “Execute recipe X with Y params”
130133

131134
AI → Human (assistant)
132135

133-
Note / Status / Caution / Question (incl. Required/Optional)
136+
Note / Status / Caution / Question (incl. Required / Optional)
134137

135-
RecommendedChange / RecommendMakingThisAFunction/Variable/Object
138+
RecommendedChange / RecommendMakingThisAFunction / Variable / Object
136139

137140
RecipeFound / RecipeExecuting / RecipeStatus / RecipeSuggestion / RecipeWarning
138141

139142
SecurityWarning / PolicyCaution / PolicyBlock / PolicySuggestion
140143

141144
COM::Status (required once per response)
142145

143-
7) Patterns you’ll use a lot
144-
146+
Patterns you’ll use a lot
145147
Pattern: Question differentiation
146-
147148
#AI->H::RequiredQuestion: (What is the exact output format you need?)
148149
#AI->H::OptionalQuestion: (Any preferred tone or examples to emulate?)
149150

150-
151-
Pattern: Multi‑directive handling
152-
151+
Pattern: Multi-directive handling
153152
#H->AI::Context: (We’re documenting the repo)
154153
#H->AI::Directive: (Draft the README sections)
155154
#H->AI::Constraint: (≤ 200 words per section)
156155

157156
#AI->H::Note: (Context acknowledged; proceeding under 200-word limit)
158157

159-
160158
Pattern: Error handling
161-
162159
#H->AI::Directive: (Access multiple URLs simultaneously)
163160

164161
#AI->H::Caution: (Platform limitation—sequential access only)
165162
#AI->H::RecommendedChange: (Process URLs one by one across steps)
166163

167164

168-
These are lifted from the Spec’s examples and phrased for quick application.
165+
(These are lifted from Spec examples and phrased for quick application.)
169166

170-
8) Block markers for mixed content (when pasting into files)
167+
Block markers for mixed content (when pasting into files)
171168

172169
Use these markers to clearly label the content type inside project files:
173170

@@ -187,23 +184,24 @@ Use these markers to clearly label the content type inside project files:
187184
When you reference a file line, include a note like:
188185
#AI->H::((Refer to line 20 in CFT-FWK-SPEC-v0.0825g6.txt)) for traceability.
189186

190-
9) Enforcement tips (for your repo)
187+
Enforcement tips (for your repo)
191188

192189
PR checklist: “Does this PR use CRAFT comment types in prompts/docs?”
193190

194191
Issue template: Include a small “Use CRAFT comment headers” section.
195192

196193
Docs linter (manual): Scan for missing #AI->H::COM::Status in example replies.
197194

198-
Team habit: Begin work items with #H->AI::Directive: + #H->AI::Constraint: + #H->AI::Structure:.
195+
Team habit: Begin work items with
196+
#H->AI::Directive: + #H->AI::Constraint: + #H->AI::Structure:.
199197

200-
10) Minimal “starter prompt” (paste into new tasks)
198+
Minimal “starter prompt” (paste into new tasks)
201199
#H->AI::Directive: (Complete the requested task)
202200
#H->AI::Context: (Use CRAFT comment system & COM tracking)
203201
#H->AI::Constraint: (Be concise; cite any factual claims from the Spec)
204202
#H->AI::Structure: (Headings + bullets; include one final #AI->H::COM::Status)
205203

206-
11) FAQ (fast answers)
204+
FAQ (fast answers)
207205

208206
Do I always need COM tracking?
209207
Yes—include one #AI->H::COM::Status: per AI response after initialization.
@@ -212,14 +210,8 @@ When should the AI ask questions vs. proceed?
212210
Begin with either “No questions. Ready.” or use RequiredQuestion/OptionalQuestion to clarify.
213211

214212
Can I mix speculative and factual content?
215-
Yes, but label speculative (#AI->H::SuggestedContent:) and estimates with confidence; cite factual claims.
216-
217-
12) License & source‑of‑truth
218-
219-
This project uses the Business Source License 1.1 (BSL 1.1) as attached with the four CRAFT files; non‑commercial use is allowed, commercial use requires a license; converts to Apache 2.0 on the date specified in the files. See the license header in the Spec for exact terms and conversion date.
220-
221-
13) References
213+
Yes, but label speculative with #AI->H::SuggestedContent: and estimates with confidence; cite factual claims.
222214

223-
CRAFT Framework Specification v0.0825g6 – Sections: 1.1, 1.2–1.7, 1.10, 2 (2.1–2.6) (CFT-FWK-SPEC-v0.0825g6.txt).
215+
License & source-of-truth
224216

225-
Copy this entire document into ./docs/comment-system.md in your repository.
217+
This project uses the Business Source License 1.1 (BSL 1.1) as attached with the four CRAFT files; non-commercial use is allowed, commercial use requires a license; converts to Apache 2.0 on the date specified in the files. See the license header in the Spec for exact terms and conversion date.

0 commit comments

Comments
 (0)