Skip to content

Commit f38231d

Browse files
patrikbraborecB4nanTC-MO
authored
docs: Add documentation for vibe coding (#1756)
Co-authored-by: Martin Adámek <[email protected]> Co-authored-by: Michał Olender <[email protected]>
1 parent a29177d commit f38231d

File tree

10 files changed

+502
-1
lines changed

10 files changed

+502
-1
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: Build with AI
3+
sidebar_position: 3
4+
description: Learn how to set up your environment, choose the right tools, and establish workflows for effective vibe coding
5+
slug: /actors/development/quick-start/build-with-ai
6+
toc_max_heading_level: 4
7+
---
8+
9+
**Set up your environment, choose tools, and build workflows for effective AI development.**
10+
11+
---
12+
13+
import { RULES_AND_INSTRUCTIONS_PROMPT } from "@site/src/utils/ai-prompts";
14+
import PromptButton from "@site/src/components/PromptButton";
15+
16+
This guide explains how to enhance your development workflow by leveraging `llms.txt` and `llms-full.txt` with an AI assistant. You will learn how to provide foundational context and further refine AI's behavior with specific rules and instruction files.
17+
18+
## `llms.txt` and `llms-full.txt`
19+
20+
Search engines weren't built for Large Language Models (LLMs), but they needs context. That's why we've created [`llms.txt`](https://docs.apify.com/llms.txt) and [`llms-full.txt`](https://docs.apify.com/llms-full.txt) for our documentation. These files follow the [growing standard](https://llmstxt.org/) for LLMs consumption.
21+
22+
<table>
23+
<thead>
24+
<tr>
25+
<th>File</th>
26+
<th>Purpose</th>
27+
</tr>
28+
</thead>
29+
<tbody>
30+
<tr>
31+
<td><code>llms.txt</code></td>
32+
<td>Contains index of the docs page in Markdown, with links to all subpages in Markdown.</td>
33+
</tr>
34+
<tr>
35+
<td>
36+
<code style={{ whiteSpace: 'nowrap' }}>llms-full.txt</code>
37+
</td>
38+
<td>Contains a full dump of documentation in Markdown.</td>
39+
</tr>
40+
</tbody>
41+
</table>
42+
43+
### Use llms.txt and llms-full.txt
44+
45+
LLMs don't automatically discover `llms.txt` files, you need to add the link manually. Some tools like [Cursor](https://www.cursor.com/) provide settings for this.
46+
47+
#### Cursor
48+
49+
Go to: **Settings -> Cursor Settings -> Indexing & Docs -> Add Doc**.
50+
51+
Now, you can just provide the link to Apify `llms-full.txt`:
52+
53+
```markdown
54+
https://docs.apify.com/llms-full.txt
55+
```
56+
57+
![Add llms-full.txt to Cursor](./images/cursor.png)
58+
59+
#### Windsurf
60+
61+
Open Windsurf Cascade, and add context via `@web`:
62+
63+
![Add llms-full.txt to Windsurf](./images/windsurf.png)
64+
65+
:::note Windsurf @docs
66+
67+
Windsurf provides the `@docs` command, but you cannot customize it. It means that you cannot add your own documentation.
68+
69+
:::
70+
71+
#### GitHub Copilot
72+
73+
Open Copilot Chat mode, and add context via `#fetch`:
74+
75+
![Add llms.txt to Copilot](./images/github-copilot.png)
76+
77+
:::note GitHub Copilot and documentation
78+
79+
Similar to Windsurf, GitHub Copilot does not provide an option for adding your own documentation.
80+
81+
:::
82+
83+
#### Ask AI
84+
85+
New to Apify? Ask questions and provide the `llms.txt` link. Popular AI models can search the web. With the right context, you get better answers:
86+
87+
![Ask about Apify](./images/claude.png)
88+
89+
## View pages as markdown
90+
91+
Every page in Apify documentation is available in markdown format. Simply add `.md` to any documentation URL to access the raw markdown content.
92+
93+
For example:
94+
95+
- [https://docs.apify.com/platform](https://docs.apify.com/platform)[https://docs.apify.com/platform.md](https://docs.apify.com/platform.md)
96+
- [https://docs.apify.com/api](https://docs.apify.com/api)[https://docs.apify.com/api.md](https://docs.apify.com/api.md)
97+
98+
This is useful when you want to:
99+
100+
- Copy documentation content for AI prompts
101+
- Reference exact markdown syntax
102+
- Access content programmatically
103+
104+
## Add rules
105+
106+
To get the most from AI Code Editors, add rules or instructions.
107+
108+
See how to set up rules for your AI Code Editors:
109+
110+
- [Cursor Rules](https://docs.cursor.com/en/context/rules)
111+
- [Windsurf Rules](https://docs.windsurf.com/windsurf/cascade/memories#rules)
112+
- [GitHub Copilot instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions)
113+
114+
### Apify rules and instructions
115+
116+
The best rules and instructions are specific for individual use cases, but we provide a prompt to help you get start with creating rules and instructions:
117+
118+
<PromptButton prompt={RULES_AND_INSTRUCTIONS_PROMPT}/>
119+
120+
:::info Keep your rules and instructions up to date
121+
122+
As the project evolves, you might introduce new things. Always make sure that your rules and instructions are up to date.
123+
124+
:::
125+
126+
## Best practices
127+
128+
- _Small tasks_: Don't ask AI for many tasks at once. Break complex problems into smaller pieces. Solve them step by step.
129+
130+
- _Iterative approach_: Work iteratively with clear steps. Start with a basic implementation and gradually add complexity.
131+
132+
- _Versioning_: Version your changes often using git. This lets you track changes, roll back if needed, and maintain a clear history.
133+
134+
- _Security_: Don't expose API keys, secrets, or sensitive information in your code or conversations with LLM assistants.
139 KB
Loading
102 KB
Loading
113 KB
Loading
131 KB
Loading

sources/platform/actors/development/quick_start/index.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,14 @@ This is the fastest way to kick-start your Actor development and try out the Api
5757
to="/platform/actors/development/quick-start/web-ide"
5858
/>
5959
</CardGrid>
60+
61+
## Build with AI
62+
63+
Use the Apify toolset to build with AI:
64+
65+
<CardGrid>
66+
<Card
67+
title="Build with AI"
68+
to="/platform/actors/development/quick-start/build-with-ai"
69+
/>
70+
</CardGrid>

sources/platform/actors/development/quick_start/start_locally.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ slug: /actors/development/quick-start/locally
99

1010
---
1111

12+
import PromptButton from "@site/src/components/PromptButton";
13+
14+
<PromptButton/>
15+
1216
## What you'll learn
1317

1418
This guide walks you through the full lifecycle of an Actor. You'll start by creating and running it locally with the Apify CLI, then learn to configure its input and data storage. Finally, you will deploy the Actor to the Apify platform, making it ready to run in the cloud.
@@ -46,7 +50,7 @@ The CLI will:
4650
Now, you can navigate to your new Actor directory:
4751

4852
```bash
49-
cd your-actor-name
53+
cd `your-actor-name`
5054
```
5155

5256
### Step 2: Run your Actor

src/components/PromptButton.jsx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import React, { useEffect, useRef, useState } from 'react';
2+
3+
import { QUICK_START_PROMPT } from '../utils/ai-prompts';
4+
import styles from './PromptButton.module.css';
5+
6+
export default function PromptButton({ prompt = QUICK_START_PROMPT, title = 'Use pre-built prompt to get started faster.' }) {
7+
const [copied, setCopied] = useState(false);
8+
const [showPrompt, setShowPrompt] = useState(false);
9+
const timeoutRef = useRef(null);
10+
11+
useEffect(() => {
12+
return () => {
13+
if (timeoutRef.current) {
14+
clearTimeout(timeoutRef.current);
15+
}
16+
};
17+
}, []);
18+
19+
const handleCopy = async () => {
20+
if (window.analytics) {
21+
window.analytics.track('Clicked', {
22+
app: 'docs',
23+
button_text: 'Copy prompt',
24+
element: 'prompt-button.copyButton',
25+
});
26+
}
27+
28+
try {
29+
await navigator.clipboard.writeText(prompt);
30+
31+
if (timeoutRef.current) {
32+
clearTimeout(timeoutRef.current);
33+
}
34+
35+
setCopied(true);
36+
timeoutRef.current = setTimeout(() => setCopied(false), 2000);
37+
} catch (err) {
38+
console.error('Failed to copy prompt:', err);
39+
}
40+
};
41+
42+
const togglePrompt = () => {
43+
setShowPrompt(!showPrompt);
44+
};
45+
46+
return (
47+
<>
48+
<div className={styles['prompt-card']}>
49+
<div className={styles['prompt-content']}>
50+
<div className={styles['prompt-text']}>
51+
<span>{title}</span>
52+
</div>
53+
</div>
54+
<div className={styles['button-container']}>
55+
<button
56+
className={styles['toggle-button']}
57+
onClick={togglePrompt}
58+
>
59+
{showPrompt ? 'Hide the prompt' : 'Show the prompt'}
60+
</button>
61+
<button
62+
className={`${styles['copy-button']} ${copied ? styles.copied : ''}`}
63+
onClick={handleCopy}
64+
>
65+
{copied ? 'Copied!' : 'Copy prompt'}
66+
</button>
67+
</div>
68+
</div>
69+
{showPrompt && (
70+
<div className={styles['full-prompt-container']}>
71+
<div className={styles['full-prompt']}>
72+
<pre>{prompt}</pre>
73+
</div>
74+
</div>
75+
)}
76+
</>
77+
);
78+
}

0 commit comments

Comments
 (0)