Record a design decision as a lesson_learned on AIN blockchain. Use when the developer makes an architectural choice, picks a library, or resolves a trade-off.
Record the following design decision as a lesson_learned on the AIN blockchain knowledge graph.
Decision: $ARGUMENTS
Analyze the conversation context and extract:
lessons/architecture, lessons/engineering, lessons/ai, lessons/blockchain, lessons/security, or a custom lessons/{category}lesson_learned)Find and run the record-lesson.js script. It exists in one of these locations:
# Check project-level first, then global
SCRIPT="$(dirname "$(readlink -f "$0")")/scripts/record-lesson.js"
if [ ! -f "$SCRIPT" ]; then
SCRIPT="$HOME/.claude/skills/lesson/scripts/record-lesson.js"
fi
Run it:
node "$HOME/.claude/skills/lesson/scripts/record-lesson.js" \
--title "Your title here" \
--content "Full decision context..." \
--summary "Brief summary" \
--topic "lessons/architecture" \
--tags "tag1,tag2,tag3"
The script auto-installs ain-js on first run if needed. The AIN private key is loaded automatically from ~/.claude/ain-config.json — do NOT pass it via env var or command line.
If the script fails, fall back to calling the Cogito container API:
curl -X POST http://localhost:3402/lesson \
-H "Content-Type: application/json" \
-d '{
"title": "Your title here",
"content": "Full decision context...",
"summary": "Brief summary",
"topicPath": "lessons/architecture",
"tags": ["tag1", "tag2"]
}'
Confirm to the user: