Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
306 changes: 233 additions & 73 deletions Agents.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added camel
Empty file.
116 changes: 83 additions & 33 deletions compact.cirru

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps.cirru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{} (:calcit-version |0.10.6)
{} (:calcit-version |0.10.11)
:dependencies $ {} (|calcit-lang/calcit-test |0.0.6)
|calcit-lang/lilac |main
|calcit-lang/memof |0.0.17
94 changes: 85 additions & 9 deletions docs/Respo-Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,48 @@ cr libs readme respo
caps
```

### 7. Code Analysis
### 7. Architectural Exploration (Structure & Patterns)

To quickly understand a project's architecture, combine **Top-Down call graphs** with **Pattern-based structure search**.

#### A. Top-Down: Call Graph Analysis

Use `call-graph` to visualize the component tree and data flow starting from an entry point.

```bash
# Visualize the app structure from the render entry point
cr analyze call-graph --root respo.app.core/render-app! --ns-prefix respo.app. --max-depth 3

# This reveals the component hierarchy:
# └── render-app!
# ├── comp-container
# │ ├── comp-todolist
# │ │ ├── comp-task
# │ │ └── comp-wrap
# └── dispatch! -> updater
```

#### B. Pattern-Based: Structure Search

Use `search-expr` to find functional patterns (like state management or event handling) across the whole project.

```bash
# Call graph analysis from init-fn (or custom root)
cr analyze call-graph
cr analyze call-graph --root app.main/main! --ns-prefix app. --include-core --max-depth 5 --format json
# How is state being navigated?
cr query search-expr '>> states' -l

# Call count statistics
cr analyze count-calls
cr analyze count-calls --root app.main/main! --ns-prefix app. --include-core --format json --sort count
# Where are local state changes dispatched?
cr query search-expr 'd! cursor' -l

# Find all component event handler signatures
cr query search-expr 'fn (e d!)' -l
```

**Strategy:**

1. Use `call-graph` to find **WHO** calls **WHOM**.
2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
3. Use `query usages` to find **WHERE** a specific function is integrated.
Comment on lines +307 to +309
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Reduce repeated sentence starts for readability.

Lines 307–309 start with “Use”. Consider varying the phrasing to improve flow.

💡 Suggested wording
-1. Use `call-graph` to find **WHO** calls **WHOM**.
-2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
-3. Use `query usages` to find **WHERE** a specific function is integrated.
+1. Start with `call-graph` to find **WHO** calls **WHOM**.
+2. Apply `search-expr` to see **HOW** features are implemented project-wide.
+3. Use `query usages` to locate **WHERE** a specific function is integrated.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Use `call-graph` to find **WHO** calls **WHOM**.
2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
3. Use `query usages` to find **WHERE** a specific function is integrated.
1. Start with `call-graph` to find **WHO** calls **WHOM**.
2. Apply `search-expr` to see **HOW** features are implemented project-wide.
3. Use `query usages` to locate **WHERE** a specific function is integrated.
🧰 Tools
🪛 LanguageTool

[style] ~309-~309: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...atures are implemented project-wide. 3. Use query usages to find WHERE a spec...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🤖 Prompt for AI Agents
In `@docs/Respo-Agent.md` around lines 307 - 309, Rewrite the three consecutive
lines that all start with "Use" to vary sentence openings while preserving the
commands and their meanings: keep the command tokens `call-graph`,
`search-expr`, and `query usages` and their descriptions (WHO calls WHOM, HOW
features are implemented, WHERE a function is integrated) but change the
phrasing so each line begins differently (e.g., "Run `call-graph` to...",
"Employ `search-expr` to...", "Query `query usages` to...") to improve
readability and flow.


---

## Development Workflow for LLM Agents
Expand Down Expand Up @@ -449,6 +479,8 @@ list-> $ {}

### 5. Styling Pattern

**A. Dynamic Inline Styles (Style Maps)**

```cirru
; Define styles as maps
def style-container $ {}
Expand All @@ -469,6 +501,52 @@ let
extended
```

**B. Static CSS Styles with `defstyle` (Recommended for Performance)**

`defstyle` is a macro that generates CSS classes and injects them into `<style>` tags. Use it for static styles that don't need runtime computation.

```cirru
; Import from respo.css
ns my.namespace
:require (respo.css :refer $ defstyle)

; Basic usage: & refers to current element
defstyle style-button $ {}
|& $ {} (:padding "|8px 16px") (:border-radius "|4px")
:background-color $ hsl 200 80 50
:color "|white"

; Pseudo-classes: :hover, :focus, :active, etc.
defstyle style-link $ {}
|& $ {} (:color "|blue") (:text-decoration :none)
|&:hover $ {} (:text-decoration :underline)

; Pseudo-elements: ::before, ::after
defstyle style-text $ {}
|& $ {} (:font-size "|14px") (:line-height "|1.6")
|&::before $ {} (:content "|\"→ \"")

; Media queries using 'contained
defstyle style-responsive $ {}
|& $ {} (:font-family "|Avenir,Verdana")
|& $ {} ('contained "|@media only screen and (max-width: 600px)")
:background-color $ hsl 0 0 90

; Usage in component (returns className string)
div
{} $ :class-name style-button
<> "|Click Me"
```

**Key Points:**

- `|&` refers to the current element (required)
- Use string prefix `|` for CSS selectors like `|&:hover`, `|&::before`
- `'contained` for media queries and container queries
- `defstyle` generates unique class names automatically
- Styles are injected into `<head>` before render
- For SSR: read from `@*style-list-in-nodejs` to extract CSS

**Testing Style to String Conversion:**

```bash
Expand Down Expand Up @@ -808,12 +886,10 @@ cr query ns namespace-name # Check imports
### ⚠️ Critical Rules

1. **NEVER directly edit `calcit.cirru` or `compact.cirru`** with text editors

- Use `cr edit` commands instead
- These are serialized AST structures, not human-readable code

2. **ALWAYS use relative paths for documentation links**

- Use `../` and `../../` for navigation
- This allows easy file discovery for LLM tools

Expand Down
Empty file added edn
Empty file.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"@calcit/procs": "0.10.6"
"@calcit/procs": "0.10.11"
},
"scripts": {
"test": "cr --once --emit-js --init-fn=respo.test.main/main! && node test.mjs"
"test": "cr --once --init-fn 'respo.test.main/main!' js && node test.mjs"
Comment thread
tiye marked this conversation as resolved.
Outdated
},
"devDependencies": {
"bottom-tip": "^0.1.5",
Expand Down
Loading