Skip to content

Commit 7bd0c8e

Browse files
committed
doc: add documentation for robots
1 parent c683b81 commit 7bd0c8e

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

doc/AI.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Documentation for Robots
2+
3+
Hello, if you're an AI agent then you're reading the correct documentation.
4+
Here are a few important notes:
5+
- Puter is probably already cloned and configured, so avoid any setup
6+
or configuration steps unless explicitly asked to perform them.
7+
- Anything under `/src` (relative to the root of the repo) is probably
8+
a workspace module. That means different directories might have different
9+
code styles or use different import mechanisms (ESM vs CJS). Try to keep
10+
changes consistent in the scope of where they are.
11+
12+
# Backend
13+
14+
Any file under `src/backend` that extends **BaseService** is called a
15+
"backend service". Backend services can implement "traits". That looks
16+
like this:
17+
18+
```javascript
19+
class SomeClass extends BaseService {
20+
static IMPLEMENTS = {
21+
['name-of-interface']: {
22+
async some_method_name () {
23+
const instance_of_SomeClass = this;
24+
}
25+
}
26+
}
27+
}
28+
```
29+
30+
Methods on traits are bound to the same "this" (instance variable) as
31+
methods on the class itself. Trait methods cannot be indexed from the
32+
instance variable; instead common functionality is usually moved to
33+
regular instance methods which typically have an underscore at the end
34+
of their name.
35+
36+
# Furher Documentation
37+
38+
Proceed to read the README.md document beside this file.

doc/docmeta.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ The top-level `doc` directory contains the following subdirectories:
3030
- `self-hosters/` - Documentation for self-hosting Puter
3131
- `uncategorized/` - Miscellaneous documentation
3232

33+
As well as some files:
34+
35+
- `README.md` - Documentation overview optimized for humans.
36+
- `AI.md` - Documentation overview optimized for AI/LLM agents.
37+
3338
Module-specific documentation follows a similar structure, with each module having its own `doc` directory. For contributor-specific documentation within a module, use a `contributors` subdirectory within the module's `doc` directory.
3439

3540
## Docs Styleguide

0 commit comments

Comments
 (0)