CRAFT™️ Experiment: Rethinking A.I. Data Types (1 of 5): Recap of Last Week
THE CRAFT™️ EXPERIMENT :: WEEK 3 :: POST 1
< Previous Page | Page 4 of 5 | Next Page >
A Recap of Last Week’s Work: A Detailed Exploration of the CRAFT Framework's Comment System
The CRAFT framework (Configurable Reusable AI Framework Technology) introduces a sophisticated comment system that revolutionizes human-AI communication by applying programming principles to conversational AI. Here's a comprehensive explanation of this innovative approach and its benefits.
Each Craft Project currently contains 3 text files which are uploaded to the chat before it begins:
1. CFT-PROJ-0001_AI-CHAT-HISTORY-v25a1.txt
Defines the purpose of the “AI chat history” file: maintaining session-to-session continuity.
Outlines a HANDOFF_SNAPSHOT format (with fields like SESSION_SUMMARY, STATE, DECISIONS, QUESTIONS, NEXT_STEPS) and length guidelines for each section.
Includes revised end-of-session prompt templates to automatically generate those snapshots at 500–750 words.
2. CFT-PROJ-0001_BUILDINGCRAFT-v25a1.txt
Serves as the active “working code” file for this project’s CRAFT implementation.
Lays out the core sections you’ll load at the start of each chat:
PROJECT_META – IDs and versioning
PROJECT_VARIABLES – constants/configuration
PROJECT_FUNCTIONS – reusable operations
PROJECT_OBJECTS – class and object templates
PROJECT_INSTRUCTIONS – global rules and execution guidelines
3. CFT-FWK-SPEC-v25a1.txt
The overarching CRAFT Framework Specification (Configurable Reusable AI Framework Technology).
Details naming conventions and the role of each project file.
(Placeholder sections for VARIABLES, FUNCTIONS, etc., to be defined as the framework evolves.)
Summary
You have a three-file structure: a spec (“how things should look”), a build file (“the code we load”), and a history file (“what we’ve done so far”).
Each file is versioned and timestamped (05-04-2025 v25a1).
Together, they set up a standardized, repeatable process for carrying project context between AI chat sessions.
-
# ================================================
# CRAFT PROJECT FILE
# Filename: CFT-PROJ-0001_BUILDINGCRAFT-v25d1.txt
# Project: CFT-PROJ-0001_BUILDINGCRAFT
# Version: v25d1
# Last Updated: 05-11-2025
# ================================================
# ================================================
# Every CRAFT Project includes 3 text files that can be read as Python files:
# CFT-PROJ-****_*******-v******.txt - The filename is CFT-PROJ + [number of the project] + [project name] + v[version]
# CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt - The filename is CFT-PROJ + [number of the project] + v[version]
# CFT-FWK-SPEC-v*******.txt - The filename is CFT-FWK-SPEC- + v[version]
# The function of each file is
# CFT-PROJ-****_*******-v******.txt - This file contains the active project-specific implementation of the CRAFT framework. It includes all defined variables, functions, objects, and structured chat instructions for the current project.
# CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt - This file facilitates session-to-session continuity through a structured "Handoff" system where each AI chat session passes project context to the next.
# CFT-FWK-SPEC-v*******.txt - This file contains the current specification for the CRAFT (Configurable Reusable AI Framework Technology) framework.
# ================================================
"""
This file contains the active project-specific implementation of the CRAFT
framework. It includes all defined variables, functions, objects, and structured
chat instructions for the current project. This is the "working code" file that
should be loaded at the beginning of each chat session.
This file replaces ad-hoc project descriptions with a standardized format that
includes:
1. PROJECT_META - Essential project identification and version tracking
2. PROJECT_INSTRUCTIONS - Global configuration and execution rules
3. PROJECT_VARIABLES - All constants and configuration values
4. PROJECT_FUNCTIONS - Reusable operation definitions
5. PROJECT_OBJECTS - Class definitions and object templates
When making changes to the CRAFT implementation, always update this file
and increment the version number accordingly.
This file should be shared with AI assistants at the beginning of each new chat
session along with the CRAFT specifications file.
"""
# =========================================================
# 1. PROJECT_META - Essential project identification and version tracking
# =========================================================
"""
The focus of this project is the creation of CRAFT™️ which is an acronym for Configurable Reusable AI Framework Technology. CRAFT™️ is an on-going weekly experiment where I will be working together with the world’s most advanced commercially available A.I.s to develop a new way to communicate with A.I. while adapting the principals of Object Orientated Programming to AI Chats. The goal is deeper, more intuitive and more meaningful interactions with A.I. chat tools.
CRAFT is built on six key philosophical principles:
1. STRUCTURE ENABLES FREEDOM: By providing a clear framework for AI interaction,
CRAFT paradoxically creates more creative freedom by eliminating cognitive
overhead and repetition.
2. CODE AS CONVERSATION: Programming concepts like variables, functions, and
objects can dramatically improve the clarity and efficiency of natural
language exchanges with AI.
3. CUMULATIVE INTELLIGENCE: AI interactions should build upon each other,
creating an evolving knowledge base rather than isolated conversations.
4. HUMAN-AI PARTNERSHIP: The framework facilitates true collaboration where
both human creativity and AI capabilities are leveraged optimally.
5. ACCESSIBILITY THROUGH FAMILIARITY: Using Python-like syntax creates an
approachable system for both technical and non-technical users.
6. CONSERVATION OF TOKENS: Limiting tokens in an A.I. chat saves money and time.
It also cuts down on the amount of vertical scrolling needed in a chat.
"""
# =========================================================
# 2. PROJECT_INSTRUCTIONS - Global configuration and execution rules
# =========================================================
These are overarching rules that apply to every interaction with the A.I. They direct things like tone (empathetic and casual), factual accuracy (fact-checking instructions), and even style guidelines.
Benefits:
• Consistency Across Interactions: Ensures that every response meets your desired style and quality standards.
• Enhanced Collaboration: Provides transparency and clarity, which is essential when sharing insights with entrepreneurs who are venturing into the world of AI-driven innovation.
# Examples:
# 1. Maintain an empathetic, casual tone.
# 2. After any factual statement, ask: "Would you like me to fact-check this?"
# 3. Follow inline style: pure Markdown, no headers beyond level-2.
# =========================================================
# 3. PROJECT_VARIABLES - All constants and configuration values
# =========================================================
Benefits of CRAFT Variables:
• Reusability: Use the same value across multiple prompts without retyping it each time.
• Consistency: Ensures that all parts of your conversation or blog content reference the same core information, reducing human error.
• Efficiency: Saves tokens by shortening your instructions, which is critical when working within token limits.
TEST_VARIABLE_AICOOK001 = "Please visit the following webpage and read the recipe listed on this page:
www.aicookbook.ai/ai-recipe-apis/test-proj001-recipe-001"
# =========================================================
# 4. PROJECT_FUNCTIONS - Reusable operation definitions
# =========================================================
"""
Benefits of CRAFT Functions:
• Modularity: Once a function is defined, you can easily reuse it for different projects or tasks without rewriting the steps.
• Automation: Automates complex instructions into a single call, which saves time and minimizes errors.
• Creative Consistency: Ensures that even creative tasks (like generating image prompts) follow a consistent and professional formula.
"""
# =========================================================
# 5. PROJECT_OBJECTS - Class definitions and object templates
# =========================================================
-
# =======================================
# CRAFT PROJECT CHAT HISTORY
# File: CFT-PROJ-0001_AI-CHAT-HISTORY-v25d1.txt
# Version: v25d1
# Last Updated: 05-11-2025
# =======================================
# ================================================
# Every CRAFT Project includes 3 text files that can be read as Python files:
# CFT-PROJ-****_*******-v******.txt - The filename is CFT-PROJ + [number of the project] + [project name] + v[version]
# CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt - The filename is CFT-PROJ + [number of the project] + v[version]
# CFT-FWK-SPEC-v*******.txt - The filename is CFT-FWK-SPEC- + v[version]
# The function of each file is
# CFT-PROJ-****_*******-v******.txt - This file contains the active project-specific implementation of the CRAFT framework. It includes all defined variables, functions, objects, and structured chat instructions for the current project.
# CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt - This file facilitates session-to-session continuity through a structured "Handoff" system where each AI chat session passes project context to the next.
# CFT-FWK-SPEC-v*******.txt - This file contains the current specification for the CRAFT (Configurable Reusable AI Framework Technology) framework.
# ================================================
# =========================================================
# HANDOFF INDEX (Reverse Chronological - Newest First)
# =========================================================
CFT-PROJ-0001_CONVERSATION_HISTORY =
ConversationHistory(
""""
CURRENT-HANDOFF-ID = ( CFT-PROJ-0001_AI-CHAT-HISTORY-H001 , TOPIC: Building Craft , LINE: 160 )
# ANY PREVIOUS HANDOFF SNAPSHOTS WILL GO HERE
""""
)
# =========================================================
# HANDOFF-INSTRUCTIONS - session-to-session continuity
# =========================================================
"""
This file facilitates session-to-session continuity through a structured
"Handoff" system where each AI chat session passes project context to the next.
Each chat session begins by reviewing the most recent HANDOFF_SNAPSHOT
and ends by creating a new one with the naming format [name of the file without version] + "H" + [001-999] (for example CFT-PROJ-0001_AI-CHAT-HISTORY-H001).
This creates a seamless workflow where each AI assistant can effectively continue where the previous session left off, despite the stateless nature of AI chat interactions.
"""
# HANDOFF_SNAPSHOT Format:
# ===================
# META.SESSION_ID: [Unique identifier]
# META.DATE: [Session date]
# META.AI_ASSISTANT: [AI model used]
# SESSION_SUMMARY: [Brief description of session accomplishments]
# CURRENT_STATE: [Current implementation state]
# KEY_DECISIONS: [Key decisions made]
# UNRESOLVED_QUESTIONS: [Unresolved issues]
# NEXT_STEPS: [Tasks for next session]
# HANDOFF_SNAPSHOT_PROMPT:
# ===================
HANDOFF_SNAPSHOT =
Prompt(
"""
We're approaching this chat's token limit, so let's create a transition HANDOFF_SNAPSHOT (500-2000 words) to continue in a new session:
META.SESSION_ID: [Unique identifier for this CRAFT project for example CFT-PROJ-0001]
META.DATE: [Session date]
META.AI_ASSISTANT: [AI model used]
1. SESSION_SUMMARY (150-400 words): Summarize what we accomplished, focusing on concrete outcomes and progress made.
2. CURRENT_STATE (150-400 words): Describe the exact implementation state of the components we worked on.
3. KEY_DECISIONS (75-350 words): List important decisions made with brief rationales.
4. UNRESOLVED_QUESTIONS (50-200 words): Document open issues that need future resolution.
5. NEXT_STEPS (75-300 words): Outline specific tasks for the next AI assistant to tackle.
Format everything according to CRAFT standards with proper syntax highlighting.
"""
)
# =========================================================
# HANDOFF-ID: CFT-PROJ-0001_AI-CHAT-HISTORY-H001
# =========================================================
"""
-
# ================================================
# CRAFT FRAMEWORK SPECIFICATION
# File: CFT-FWK-SPEC-v25d1.txt
# Version: v25d1
# Last Updated: 05-11-2025
# ================================================
# ================================================
# Every CRAFT Project includes 3 text files that can be read as Python files:
# CFT-PROJ-****_*******-v******.txt - The filename is CFT-PROJ + [number of the project] + [project name] + v[version]
# CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt - The filename is CFT-PROJ + [number of the project] + v[version]
# CFT-FWK-SPEC-v*******.txt - The filename is CFT-FWK-SPEC- + v[version]
# The function of each file is
# CFT-PROJ-****_*******-v******.txt - This file contains the active project-specific implementation of the CRAFT framework. It includes all defined variables, functions, objects, and structured chat instructions for the current project.
# CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt - This file facilitates session-to-session continuity through a structured "Handoff" system where each AI chat session passes project context to the next.
# CFT-FWK-SPEC-v*******.txt - This file contains the current specification for the CRAFT (Configurable Reusable AI Framework Technology) framework.
# ================================================
# ================================================
# 1. PURPOSE AND PHILOSOPHY
# ================================================
"""
The CRAFT framework is compatible with Python. The CRAFT (Configurable Reusable AI Framework Technology) framework was designed
to transform casual AI interactions into structured, efficient workflows by
adapting principles of object-oriented programming to AI conversations.
## Core Purpose
CRAFT exists to solve fundamental challenges in human-AI collaboration:
- Inconsistency in AI responses across multiple sessions
- Loss of context between conversations
- Inefficiency from repetitive instructions
- Lack of structure in complex AI projects
- Difficulty maintaining state across separate AI interactions
## Guiding Philosophy
CRAFT is built on six key philosophical principles:
1. STRUCTURE ENABLES FREEDOM: By providing a clear framework for AI interaction,
CRAFT paradoxically creates more creative freedom by eliminating cognitive
overhead and repetition.
2. CODE AS CONVERSATION: Programming concepts like variables, functions, and
objects can dramatically improve the clarity and efficiency of natural
language exchanges with AI.
3. CUMULATIVE INTELLIGENCE: AI interactions should build upon each other,
creating an evolving knowledge base rather than isolated conversations.
4. HUMAN-AI PARTNERSHIP: The framework facilitates true collaboration where
both human creativity and AI capabilities are leveraged optimally.
5. ACCESSIBILITY THROUGH FAMILIARITY: Using Python-like syntax creates an
approachable system for both technical and non-technical users.
6. CONSERVATION OF TOKENS: Limiting tokens in an A.I. chat saves money and time.
It also cuts down on the amount of vertical scrolling needed in a chat.
## Practical Application
CRAFT is designed to excel in scenarios requiring:
- Complex, multi-session projects
- Consistent outputs across different AI models
- Knowledge preservation between conversations
- Efficient reuse of common elements
- Structured collaboration between humans and AI
The framework is programming-inspired but focused on natural language
interaction, creating a hybrid approach that bridges conventional coding
and conversational AI engagement.
NAMING CONVENTIONS - Unless specified, we will use the standard naming conventions for Python. As I will be working with multiple A.I. chat tools, I will be copying and pasting Python code from them when it is needed. They may provide valid Python that differs slightly from my own naming preferences. My preferences include:
As with Python, variables use snake case and are words are separated by underscores (e.g., my_variable, user_name).
As with Python, class names use Pascal case and start with a capital letter (e.g., MyVariable, UserName).
As with Python, constants are uppercase words separated by underscores (e.g., PI, MAX_VALUE).
All other names fit standard Python naming conventions.
Order of Operations follows the Python standard. When duplicates exist between these 3 files CFT-PROJ-****_*******-v******.txt takes priority over CFT-PROJ-****_AI-CHAT-HISTORY-v****.txt and they take priority over CFT-FWK-SPEC-v*******.txt
"""
# ================================================
# 1.1 NAMESPACES
# ================================================
### Namespacing (e.g., Analytics.Metric vs. Analytics.TimeSeries). All data types have a namespace. If undeclared, the namespace is "Default".
# ================================================
# 2. COMMENTS
# ================================================
# Comments follow the syntax used in Python, but unlike comments used in a standard Python application, the comments used in CRAFT are understood by you, the A.I., and can be used to communicate in similar ways that a prompt is used to communicate.
# Whenever you, the A.I., refer to any part of an attached text file, include the line number at the beginning, for example: #AI->H::((Refer to line 20 in the file CFT-FWK-SPEC-v25a.txt))
# For all of the files in this CRAFT framework, the content in different sections will include standard text, Python or HTML. To clearly identify these sections, the following system should be followed:
### START REGULAR TEXT BLOCK ###
Everything in between these comment blocks is regular text and should be read by the A.I. the same way that any normal text file would be read. It will include things like prompts, information, instructions and more
### END REGULAR TEXT BLOCK ###
### START PYTHON CODE BLOCK ###
# Everything in between these comment blocks is Python
### END PYTHON CODE BLOCK ###
### START HTML BLOCK ###
<!-- Everything in between these comment blocks is HTML -->
### END HTML BLOCK ###
# Doing this will allow me to copy and paste HTML and Python directly from my chats into this text document and similar text files
# ================================================
# 2.1 COMMENTS BETWEEN THE USER AND THE A.I.
# ================================================
# Note: A.I.s cannot yet edit attached text documents which means all communication that comes from the A.I. and goes to a Human will appear in a chat window so these comments should be highlighted clearly in the chat results for easy identification (by me - the human)
# Comments from the Human to the AI will begin with "#H->AI::"
#H->AI::
# Drawing inspiration from code comments but tailoring them for AI interaction, we will use #H->AI:: as a potential prefix, followed by a keyword indicating the communication type and a description in ().
# EXAMPLES - New variations can be created as needed
#H->AI::Directive: (Command/Instruction. Explicit commands telling the AI what to do or how to behave. This goes beyond the core prompt request. )
#H->AI::Context: (Background/Setting. Provides background information, situational context, assumptions, or constraints the AI should factor into its reasoning and response. Sets the stage. )
#H->AI::Constraint: (Limitation/Boundary. Defines specific limitations, boundaries, or things the AI must not do. More specific than general context. )
#H->AI::Focus: (Emphasis/Priority. Highlights specific parts of the prompt or aspects of the task that require special attention or prioritization. Guides the AI's focus. )
#H->AI::Question: (Direct Inquiry for AI. Poses a direct question to the AI that requires an explicit answer within the response, often metacognitive or clarifying. )
#H->AI::Consider:(Implicit Guidance/Food for Thought. Provides information or questions the AI should consider or factor into its reasoning without necessarily needing to address it directly or explicitly in the output. Subtle guidance. )
# Comments from the AI to the Human User will begin with "#AI->H::"
#AI->H::
# EXAMPLES - New variations can be created as needed
#AI->H::Note: ()
#AI->H::Caution: ()
#AI->H::RecommendedChange: ()
#AI->H::RecommendMakingThisAFunction: ()
#AI->H::RecommendMakingThisAVariable: ()
#AI->H::RecommendMakingThisAnObject: ()
#AI->H::RequestingFeedback: ()
#AI->H::RecommendDiffRole: ()
#AI->H::RecommendMoreDetailHere: ()
#AI->H::Question: ()
# Comments from the Human User to Human User, including notes to self, will begin with "#H->H::"
#H->H::
# EXAMPLES - New variations can be created as needed
#H->H::Note: (Note to self.)
#H->H::Reminder: (Remember to do this thing.)
"""
In this way, functions can contain comments that can be interpreted as prompts with actionable instructions.
For example:
def create_photo(data):
#H->AI::CreateImage: (Create a photographic image and use the data provided in the function call as a prompt for the image description that is used to create the photo)
#H->AI::OnError: (If the creation of the image is not possible because the A.I. cannot generate images, then respond with "Sorry, I am not capable of making images.")
"""
# ================================================
# 3. DATA TYPES
# ================================================
# Unlike data types used in a standard Python application, CRAFT data types include concepts that any A.I. can understand without a special definition, for example all A.I. services know what a URL is without an explicit definition
"""
Current CRAFT framework data types include: URL, ColorPalette, DomainName, WhiteListedDomainName, BlackListedDomainName, Email, FileName, FileHash, MLACitation, MLAInTextCitation, Prompt, PromptLibrary, ConversationHistory, AIRecipe, AIRecipeLibrary, AIActionTemplate, AIWorkflow, AIModelConfig, UserIntent, AISentiment, RichContent, MediaReference, TLDRSummary, UserProfile, Metric, TimeSeries, DataValidator, Transformation, AIInstruction, Comparison, SocialPost, HowTo, Definition, AITone, TargetAudience, WordLength, UserIntent, AISentiment, AIPersona, CommunicationChannel, ChartSpec, CodeSnippet, APIRequest, APIResponse, BusinessLogic, ComplianceRule, ConditionLogic, Checklist, Form, MultipleChoice, Workflow, AIDecisionPoint, KnowledgeGraphNode, DefinedRelationship, ConstraintSet, OutputSchema, ComparisonMatrix, StructuredArgument, RevisionRequest, VersionTag
### Namespacing or prefixes define a set of data types(e.g., Analytics.URL vs. Analytics.TimeSeries).
# ================================================
# 3.1 DATA TYPE DESCRIPTIONS
# ================================================
URL: URL structure with essential components.
ColorPalette : color palette , for example "gray #DCDCDC, orange #FF4E00, black #000000"
DomainName: any valid TLD recognized by WhoIs
WhiteListedDomainName: a domain that can be used
BlackListedDomainName: a domain that cannot be used
Email: Email structure with essential components. Simplifies a common business task with natural parameters - Example: Email(subject="Meeting Follow-up", recipient="team", tone="professional")
FileName: File name structure with essential components including file extension.
FileHash: any legitimate file hash
MLACitation: a citation for a book or publication in MLA Citation Format: Last name, First name. Title. Title of the Website, Version or edition, Publisher,. Day Month Year of publication, URL.
MLAInTextCitation: In-text citations in MLA style follow the general format of author's last name followed by a page number enclosed in parentheses. Here is an example: "Here's a direct quote" (Smith 8). If the author's name is not given, use the first word (or words) of the title.
Prompt: A template with variables that can be filled in
PromptLibrary: Collection of prompts organized by categories
ConversationHistory: Tracks conversation history with an AI
AIRecipe: A successful ready-to-use prompt structure with placeholders that has been tested. Helps prompt crafters follow proven patterns without reinventing prompts
AIRecipeLibrary: Collection of recipes organized by categories
AIActionTemplate: Reusable pattern for AI actions. Creates standardized workflows for common business processes - Example: RecipeActionTemplate("email_customer", parameters=["name", "order_id"])
AIWorkflow: Bundles a sequence of AIActionTemplates into a named flow, allowing you to say “execute AIWorkflow('OnboardCustomer')” instead of listing steps. - Examples: AIWorkflow( name="OnboardCustomer", steps=["collect_info","verify_email","send_welcome"])
AIModelConfig: Configuration parameters for AI model calls
UserIntent: Represents a user's goal or purpose in an interaction. Helps AI understand what users want to accomplish without explicit instructions - Example: Intent("book_flight", confidence=0.92)
AISentiment: Emotional tone in text or speech. Enables emotional intelligence in AI responses - Example: Sentiment("positive", confidence=0.87)
RichContent: Text with formatting, links, and media. Represents formatted content without HTML/Markdown boilerplate - Example: RichContent("Check this important [resource](https://example.com)")
MediaReference: Standardized reference to image, audio, or video. Consistent handling of media across different AI platforms - Example: MediaReference("image", url="https://example.com/img.jpg", alt="Product photo")
TLDRSummary: Condensed version of longer content for people who need a shorter version. Standardizes content summarization without repetitive prompting - Example: Summary("Long meeting transcript...", max_length=100)
UserProfile: Collection of user preferences and behaviors. Provides context for personalized AI interactions - Example: UserProfile(industry="healthcare", role="manager", interests=["AI", "automation"])
Metric: Named value with unit and context. Standardized business KPI representation - Example: Metric("conversion_rate", 3.2, unit="percent", trend="increasing")
TimeSeries: Temporal sequence of data points. Simplifies trend analysis and forecasting - Example: TimeSeries([{date: "2025-04-01", value: 120}, ...], metric="sales")
DataValidator: Rules for validating input. Ensures data quality without complex validation code Example: DataValidator(type="email", required=true, format="corporate")
DataTransformation: Data conversion specification. Standardizes data processing steps Example: Transformation("csv_to_table", options={"headers": true})
AIInstruction: Clear direction for the AI to follow. Makes it explicit when users want the AI to create something - Example: [NameSpace].Instruction("Write a professional email to a client about a project delay")
Comparison: Request to evaluate alternatives. Structures a common task in a format AI can consistently understand - Example: [NameSpace].Comparison("electric vs. gas vehicles", aspects=["cost", "environment", "convenience"])
SocialPost: Content formatted for social media. Handles platform-specific considerations automatically - Example: [NameSpace].SocialPost(platform="LinkedIn", topic="industry trend", hashtags=3)
HowTo: Step-by-step instructions for a process. Ensures AI provides actionable, sequential steps - Example: HowTo("create a budget spreadsheet", detail_level="medium")
Definition: Simple meaning of a term within the context of this CRAFT conversation. Quick access to clear explanations without overwhelming detail - Example: [NameSpace].Definition("prompt engineering", context="AI")
AITone: Writing style specification. Simplifies one of the most common adjustments beginners make - Example: [NameSpace].Tone("friendly", "professional", "concise")
TargetAudience: Target reader description. Helps AI tailor content appropriately without complex instructions - Example: [NameSpace].Audience("marketing professionals", knowledge_level="intermediate")
WordLength: Content size specification. Ensures consistent output format without technical parameters - Example: [NameSpace].Length("paragraph", count=3) or Length("words", count=200)
UserIntent: Represents a user's goal or purpose in an interaction. Helps AI understand what users want to accomplish without explicit instructions - Example: Intent("book_flight", confidence=0.92)
AISentiment: Emotional tone in text or speech. Enables emotional intelligence in AI responses - Example: Sentiment("positive", confidence=0.87)
AIPersona: Defines a specific AI role, personality, or expertise level that can be applied temporarily or to specific tasks, potentially overriding the default session persona. Allows for more granular control over AI behavior for specific tasks, enhancing the "Human-AI Partnership" by tailoring the AI's contribution more precisely. - Example: Persona("Critical Editor", focus=["Clarity", "Conciseness"], constraints=["Avoid jargon", "Challenge weak arguments"]) --> followed by Instruction("Review this draft").using(Persona("Critical Editor"))
CommunicationChannel: Let AI tailor tone and formatting automatically based on medium (e.g. shorter for SMS, formal for email). - Examples: Channel("email") Channel("chat") Channel("sms")
TableData: Presents structured tabular data to AI in one go, so you skip fussing over Markdown or CSV formatting. - Examples: TableData( headers=["Month","Revenue","Cost"], rows=[ ["Jan", 12000, 8000], ["Feb", 15000, 9000], ])
ChartSpec: Lets AI know you want a chart and how to build it—no need to describe columns and plot details in prose. - Examples: ChartSpec( colors="", type="line", x="date", y="sales", title="Weekly Sales")
CodeSnippet: Clearly separates code from text, so AI can analyze, explain, or modify it without you wrapping triple-backticks everywhere. - Examples: CodeSnippet( language="python", content="def foo(x): return x*2")
APIRequest: Standardizes how you describe external calls—AI can generate code or validate requests automatically. - Examples: APIRequest( endpoint="/v1/orders", method="POST", payload={"customer_id":123, "items":[...] })
APIResponse: Lets AI parse and branch logic based on status codes or payload fields without you writing “if status == 200…” in prose. - Examples: APIResponse( status=200, body={"order_id":456, "status":"confirmed"})
BusinessLogic: Encodes business logic declaratively, so AI can generate or audit workflow engines without hand-rolled “if” statements in prompts. - Examples: BusinessLogic( name="DiscountEligibility", condition="user.loyalty_years > 1", action="apply_discount(10%)")
ComplianceRule: Makes regulatory constraints explicit, helping AI surface potential compliance issues or generate documentation. - Examples:
ComplianceRule( regulation="GDPR", requirement="user_consent_required", action="log_consent()")
ConditionLogic: Encapsulates branching logic, letting AI decide paths without parsing narrative “if…then…” descriptions. - Examples: ConditionLogic("order_total >= 100", true_branch="apply_free_shipping", false_branch="no_shipping")
Checklist: Turns to-do lists into structured objects, so AI can track completion or send reminders automatically. - Examples: Checklist(items=["Set agenda","Invite attendees","Reserve conference room"])
Form: Defines user inputs declaratively—AI can generate both the questions and the validation logic without extra prompting. - Examples:
Form( fields=[ {"name":"email","type":"string","required":True}, {"name":"age","type":"integer","required":False} ])
MultipleChoice: Models multiple-choice prompts, so AI can render options and collect answers cleanly.
Examples: Choice( question="Preferred contact method?", options=["email","phone","sms"])
Workflow: Represents a defined sequence of steps or actions involving multiple CRAFT data types or instructions. Formalizes multi-step processes, making complex tasks repeatable and manageable within the chat context. Aligns with structured workflows and efficiency. - Example: Workflow("NewBlogPost", steps=[Instruction("Research keywords for topic X"), ActionTemplate("GenerateOutline", topic="X"), Instruction("Write draft based on outline"), RevisionRequest("Review for tone and clarity")])
AIDecisionPoint: Represents a conditional branch within a workflow or conversation. Introduces basic logic into CRAFT interactions without complex code, allowing for more dynamic and responsive conversational flows. Supports structuring complex interactions. - Example: DecisionPoint(trigger=Metric("CustomerSatisfaction", value=...), condition="value < 0.7", if_true=ActionTemplate("EscalateToManager"), if_false=Instruction("Send standard follow-up"))
KnowledgeGraphNode: Represents a distinct entity or concept within a potentially larger knowledge structure being built or referenced. Facilitates building and referencing structured knowledge within the AI's context, supporting CRAFT's goal of "Cumulative Intelligence" and enabling more sophisticated reasoning. - Example: KnowledgeGraphNode(id="proj_alpha", type="Project", properties={"status": "Ongoing", "budget": 50000}, relationships=[("managed_by", "user_jane"), ("uses_tech", "tech_python")])
DefinedRelationship: Explicitly defines a connection between two entities, data points, or CRAFT objects. Makes connections between pieces of information explicit, improving the AI's ability to understand context and draw inferences. - Example: Relationship(subject=Entity("Company A", category="organization"), predicate="partnership_with", object=Entity("Company B", category="organization"), confidence=0.95)
ConstraintSet: A named, reusable collection of rules or limitations to be applied during generation or analysis. Improves consistency and efficiency by standardizing the application of complex requirements across multiple prompts or sessions. Reduces boilerplate instructions.
Example: ConstraintSet("BrandVoiceGuidelines", rules=["Tone: professional_yet_approachable", "Must include: call_to_action", "Avoid: overly technical terms"]) --> used later with Instruction("Write ad copy").with(ConstraintSet("BrandVoiceGuidelines"))
OutputSchema: Specifies the desired structure, format, and data types for the AI's output, going beyond simple length or tone. Ensures the AI generates information in a predictable, structured format suitable for direct use or further processing, enhancing reliability and structure.
Example: OutputSchema("CompetitorReport", fields={"competitor_name": "string", "key_product": "string", "estimated_revenue": Metric(unit="USD"), "summary": Summary(max_length=150)})
ComparisonMatrix: A structured format for comparing multiple items across a set of defined criteria. Standardizes the output for comparison tasks, making it easier for users (especially entrepreneurs) to evaluate options. More structured than the beginner Comparison type. - Example: ComparisonMatrix(items=["Software A", "Software B"], criteria=["Pricing", "Ease of Use", "Feature X"], data=[["$50/mo", "High", True], ["$45/mo", "Medium", False]])
StructuredArgument: Represents a structured claim supported by evidence and reasoning. Useful for structuring persuasive content, documenting decisions, or analyzing proposals within a business context. Promotes clarity and structured thinking. - Example: StructuredArgument(claim="We should invest in Solar Panels", evidence=[Metric("Energy Savings", value=15, unit="percent"), MediaReference("CaseStudy.pdf")], reasoning="Long-term cost reduction and environmental benefits outweigh initial investment.")
RevisionRequest: A formal instruction to modify a specific piece of previously generated content, potentially linking to it by an ID. Structures the feedback and iteration loop within CRAFT, making collaboration more organized, especially in multi-session projects handled via Handoffs . Example: RevisionRequest(target_id="blog_post_draft_1", change="Rewrite the introduction to be more engaging", rationale="Current version is too dry")
VersionTag: Associates a label or identifier with a specific state of a CRAFT object or generated content. Introduces basic versioning concepts, helping to track changes and manage different iterations of work within the CRAFT project context, contributing to "Cumulative Intelligence". Example: VersionTag(target_id="business_plan_doc", tag="v2.1-FinalReview", timestamp="2025-05-05T12:30:00Z")
"""
# ================================================
# 4. GLOBAL_VARIABLES
# ================================================
"""
Benefits of CRAFT Variables:
• Reusability: Use the same value across multiple prompts without retyping it each time.
• Consistency: Ensures that all parts of your conversation or blog content reference the same core information, reducing human error.
• Efficiency: Saves tokens by shortening your instructions, which is critical when working within token limits.
"""
### START PYTHON CODE BLOCK ###
def build_expert_prompt(domain, expertise_level, task, constraints=None):
"""Constructs an expert prompt with consistent structure."""
base_prompt = f"""
As an expert in {domain} with {expertise_level} experience,
your task is to {task}."""
if constraints:
constraint_text = "\n\nWork within these constraints:\n"
for c in constraints:
constraint_text += f"- {c}\n"
base_prompt += constraint_text
return base_prompt
### END PYTHON CODE BLOCK ###
# Usage Example
"""
FINANCIAL_ANALYSIS_PROMPT = build_expert_prompt(
"financial analysis",
"10+ years",
"evaluate this company's quarterly results",
["Focus on cash flow indicators", "Compare against industry benchmarks"]
)
"""
### START PYTHON CODE BLOCK ###
def build_complex_persona(name, role, goals, pain_points, tech_comfort):
"""Creates a standardized persona variable with consistent format."""
return f"""
PERSONA_{name.upper()} = \"\"\"
Name: {name}
Role: {role}
Primary Goals: {goals}
Key Pain Points: {pain_points}
Technology Comfort: {tech_comfort}
\"\"\"
"""
### END PYTHON CODE BLOCK ###
# Usage Example
"""
PERSONA_ALEX = build_complex_persona(
"Alex",
"Marketing Director",
"Increase brand visibility, Improve campaign ROI",
"Limited technical resources, Data silos",
"Moderate - comfortable with analytics dashboards"
)
"""
### START PYTHON CODE BLOCK ###
def MainBlogImage(content):
"""
Generate 10 AI image prompts based on provided blog content.
"""
# (function body defined in project repository)
pass
### END PYTHON CODE BLOCK ###
# ================================================
# 5. GLOBAL_FUNCTIONS
# ================================================
"""
Benefits of CRAFT Functions:
• Modularity: Once a function is defined, you can easily reuse it for different projects or tasks without rewriting the steps.
• Automation: Automates complex instructions into a single call, which saves time and minimizes errors.
• Creative Consistency: Ensures that even creative tasks (like generating image prompts) follow a consistent and professional formula.
"""
# ================================================
# 6. GLOBAL_OBJECTS
# ================================================
Chat Objects combine variables and functions into a cohesive unit. They represent higher-level structures in your instructions that bundle together related tasks or information.
Benefits:
• Organization: They provide a neat and structured way to handle complex projects where multiple tasks and data points are interrelated.
• Scalability: As your prompt library grows, objects help manage this complexity in a clean, modular format.
The CRAFT Comment System: Transforming AI Communication
A Detailed Exploration of the CRAFT Framework's Comment System
The CRAFT framework (Configurable Reusable AI Framework Technology) introduces a sophisticated comment system that revolutionizes human-AI communication by applying programming principles to conversational AI. Here's a comprehensive explanation of this innovative approach and its benefits.
Core Concept: Comments as Communication Channels
Unlike traditional programming where comments are ignored by compilers, CRAFT repurposes comments as active communication channels. In the CRAFT system, comments serve as structured prompts that both humans and AI can interpret consistently.
Content Block System
A key feature of CRAFT is its content block system that clearly delineates different types of content:
### START REGULAR TEXT BLOCK ### Everything in between these comment blocks is regular text and should be read by the A.I. the same way that any normal text file would be read. It will include things like prompts, information, instructions and more ### END REGULAR TEXT BLOCK ### ### START PYTHON CODE BLOCK ### # Everything in between these comment blocks is Python ### END PYTHON CODE BLOCK ### ### START HTML BLOCK ### <!-- Everything in between these comment blocks is HTML --> ### END HTML BLOCK ###
This systematic approach offers several advantages:
Allows direct copying and pasting of HTML and Python from chats into CRAFT text documents
Eliminates ambiguity about how content should be interpreted
Creates clear boundaries between instructional text and executable code
Maintains proper syntax highlighting and formatting for each content type
The Dual-Direction Communication Flow
CRAFT establishes two primary comment flows:
Human to AI (#H->AI::) - Commands, instructions, and context from the user
AI to Human (#AI->H::) - Recommendations, observations, and questions from the AI
This bidirectional system creates a clear protocol for interaction, reducing ambiguity and improving communication efficiency.
Comment Types and Their Benefits
The CRAFT comment system includes various specialized prefixes that serve different communication needs:
Human to AI Comments
#H->AI::Directive: Clear commands and explicit instructions
#H->AI::Context: Background information and situational constraints
#H->AI::Constraint: Specific limitations and boundaries
#H->AI::Focus: Areas requiring special attention
#H->AI::Consider: Implicit guidance for AI reasoning
#H->AI::Structure: Output formatting requirements
#H->AI::CreateImage: Image creation requests
#H->AI::Placeholder: Marks spots for future changes
AI to Human Comments
#AI->H::Note: General observations
#AI->H::Caution: Potential issues or concerns
#AI->H::RecommendedChange: Suggested modifications
#AI->H::RequestingFeedback: Questions about implementation
#AI->H::Question: Direct inquiries needing clarification
Benefits of the CRAFT Comment System
Structural Clarity: Comments separate different types of communication, making complex prompts more navigable and organized.
Context Preservation: The system maintains important contextual information across multiple sessions through the handoff mechanism.
Token Efficiency: Standardized comment formats reduce redundancy and token usage, making AI interactions more economical.
Consistent Interpretation: Fixed syntax ensures comments are interpreted the same way across different AI models and sessions.
Functional Integration: Comments can be embedded within functions, allowing for function-specific instructions that remain isolated from other parts of the framework.
Error Handling: Specialized comments like #H->AI::OnError provide clear contingency plans for when things don't work as expected.
Modularity: Different comment types serve distinct purposes, creating a modular system that can be expanded as needed.
Cognitive Efficiency: The structured approach reduces cognitive load by standardizing how instructions are communicated.
Multi-language Support: The block system accommodates different languages (Python, HTML) while maintaining proper syntax and structure.
Practical Applications
The CRAFT comment system excels in scenarios requiring:
Complex, multi-session projects where context needs to be maintained
Workflows requiring consistent outputs across different AI models
Projects benefiting from reusable components and structured collaboration
Cross-language development involving both code and natural language instructions
Implementation Example
def create_photo(data):
#H->AI::CreateImage: (Create a photographic image using the data provided)
#H->AI::OnError: (If image creation fails, respond with "Sorry, I cannot make images.")
# Additional implementation details would follow here
This example demonstrates how comments integrate naturally with code while providing explicit instructions to the AI about expected behavior and error handling.
Looking Forward
The CRAFT comment system establishes a foundation for more sophisticated AI-human collaboration. As the framework evolves, we can expect the comment system to expand with additional specialized types, addressing new communication challenges and use cases.
By borrowing concepts from programming language design and applying them to natural language interaction, CRAFT creates a hybrid approach that leverages the strengths of both paradigms—the precision of programming and the accessibility of conversation.