Skip to content

Commit d72f296

Browse files
authored
docs: add github source of truth principle and update deep init (#585)
1 parent 46f6be2 commit d72f296

File tree

8 files changed

+62
-12
lines changed

8 files changed

+62
-12
lines changed

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# AGENTS.md — Sub-Agent Instructions
22

3+
## Core Working Principle: GitHub Source of Truth
4+
5+
**GitHub is our source of truth.** You have all history here. Use it when you're tackling a problem:
6+
- Search through previous issues.
7+
- Check commits and comments to understand what was tried before.
8+
- Maybe you've tried to fix this bug before.
9+
10+
Always check the repository history before starting implementation.
11+
12+
13+
314
## Repo Overview
415

516
LinkedIn Buddy — Playwright-based browser automation for LinkedIn with CLI and MCP server.

packages/cli/src/AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Overview
44

55
Commander-based CLI exposing all core services as terminal commands. 127+ commands across 15 categories.
6-
Entry point: `bin/linkedin.ts` (11,100+ lines — largest file in the repo).
6+
Entry point: `bin/linkedin.ts` (14,077+ lines — largest file in the repo).
77

88
## Files
99

@@ -63,3 +63,8 @@ program
6363
- NEVER call core services without `try/finally` for `runtime.close()`
6464
- NEVER skip `--profile` option — every command needs profile selection
6565
- Output formatters belong in dedicated `*Output.ts` files, not inline in the command
66+
67+
68+
## Core Principle
69+
70+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

packages/core/src/AGENTS.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ Each follows the same pattern: TypeScript interfaces + service class + `prepare*
77

88
| Module | Lines | Executors | Key Complexity |
99
|--------|-------|-----------|----------------|
10-
| `linkedinProfile.ts` | 8,448 | 14 (intro, sections, photos, skills, etc.) | Largest service; multi-step profile editing |
11-
| `linkedinPosts.ts` | 5,216 | 3 (create, edit, delete) | Media handling, safety linting, async generators |
12-
| `linkedinInbox.ts` | 4,097 | 5 (send, react, archive, mute, add recipients) | Thread state management, SelectorCandidate pattern |
13-
| `linkedinFeed.ts` | 3,659 | 7 (like, comment, repost, share, save, unsave, remove) | Heavy selector fallback strategy |
14-
| `linkedinJobs.ts` | 3,102 | 4 (save, unsave, apply, alert) | Complex form filling for Easy Apply |
15-
| `linkedinPublishing.ts` | 2,676 | 2 (create article, publish newsletter) | Rich text composition |
16-
| `linkedinConnections.ts` | 2,406 | 8 (send, accept, withdraw, ignore, remove, follow, unfollow) | Full relationship lifecycle |
10+
| `linkedinProfile.ts` | 9,564 | 14 (intro, sections, photos, skills, etc.) | Largest service; multi-step profile editing |
11+
| `linkedinPosts.ts` | 5,905 | 3 (create, edit, delete) | Media handling, safety linting, async generators |
12+
| `linkedinInbox.ts` | 4,287 | 5 (send, react, archive, mute, add recipients) | Thread state management, SelectorCandidate pattern |
13+
| `linkedinFeed.ts` | 4,190 | 7 (like, comment, repost, share, save, unsave, remove) | Heavy selector fallback strategy |
14+
| `linkedinJobs.ts` | 3,821 | 4 (save, unsave, apply, alert) | Complex form filling for Easy Apply |
15+
| `linkedinPublishing.ts` | 2,977 | 2 (create article, publish newsletter) | Rich text composition |
16+
| `linkedinConnections.ts` | 2,780 | 8 (send, accept, withdraw, ignore, remove, follow, unfollow) | Full relationship lifecycle |
1717

1818
### Infrastructure
19-
- `runtime.ts` — Service graph factory (519 lines). **Central wiring point** — modify here to add services.
20-
- `twoPhaseCommit.ts` — Prepare/confirm framework (542 lines). Security-critical: token sealing, expiry, DB persistence.
19+
- `runtime.ts` — Service graph factory (546 lines). **Central wiring point** — modify here to add services.
20+
- `twoPhaseCommit.ts` — Prepare/confirm framework (685 lines). Security-critical: token sealing, expiry, DB persistence.
2121
- `config.ts` — Config resolution (1,297 lines, 53 exports). Paths, evasion, locale, privacy, webhooks.
2222
- `db/database.ts` — SQLite abstraction (2,615 lines, 50 exports). All persistent state lives here.
2323
- `rateLimiter.ts` — Token bucket. `peek()` for preview, `consume()` for enforcement.
@@ -29,7 +29,7 @@ Each follows the same pattern: TypeScript interfaces + service class + `prepare*
2929
- `linkedinPage.ts` — Page navigation, waiting strategies, selector helpers. Uses async generators.
3030

3131
### Humanization & Evasion
32-
- `humanize.ts` — Typing simulation (1,993 lines). Grapheme-level control, Intl.Segmenter for Unicode.
32+
- `humanize.ts` — Typing simulation (277 lines). Grapheme-level control, Intl.Segmenter for Unicode.
3333
- `evasion/` — Anti-bot subsystem (see `evasion/AGENTS.md`).
3434

3535
### Activity & Scheduling
@@ -58,3 +58,8 @@ Each follows the same pattern: TypeScript interfaces + service class + `prepare*
5858
- `SelectorCandidate[]` arrays: define in priority order (role → attribute → text → xpath)
5959
- All page interactions go through `humanize()` wrapper for typing, or `evasion` for mouse/scroll
6060
- DB queries use prepared statements — never raw string interpolation
61+
62+
63+
## Core Principle
64+
65+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

packages/core/src/__tests__/AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ __tests__/
4141
- Mock the runtime object — never instantiate real services in unit tests
4242
- Use `vi.useFakeTimers()` for time-dependent tests (rate limiting, token expiry)
4343
- Test error paths: verify `LinkedInBuddyError` codes, not just "throws"
44+
45+
46+
## Core Principle
47+
48+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

packages/core/src/__tests__/e2e/AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,8 @@ Without these flags, write tests only execute prepare (no confirm).
8080
3. For read tests: call service methods, assert response structure
8181
4. For write tests: ONLY call `prepare*()` unless confirm opt-in flag is set
8282
5. Always clean up: close runtime in `afterAll()`
83+
84+
85+
## Core Principle
86+
87+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

packages/core/src/auth/AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
| `sessionInspection.ts` | Session diagnostics and health probes |
1010
| `loginSelectors.ts` | Login page selector strategies (email field, password field, submit button) |
1111
| `rateLimitState.ts` | Rate limit cooldown state — persisted to `rate-limit-state.json`, checked before operations |
12+
| `identityCache.ts` | Caches identity resolution results for sub-second identity checks |
13+
| `whoami.ts` | Fast identity extraction from cookies/DOM using cached hints |
14+
| `fingerprint.ts` | Browser fingerprinting utilities |
15+
| `sessionHealthCheck.ts` | Additional checks for session validity |
1216

1317
## Auth Flow
1418

@@ -41,3 +45,8 @@ When LinkedIn returns HTTP 429/999 or a checkpoint URL:
4145
1. `rateLimitState.ts` records expiry timestamp
4246
2. All subsequent operations check cooldown before proceeding
4347
3. `keepAlive.ts` monitors and alerts on cooldown state
48+
49+
50+
## Core Principle
51+
52+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

packages/core/src/evasion/AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,8 @@ Diagnostics: set `LINKEDIN_BUDDY_EVASION_DIAGNOSTICS=true` for verbose logging.
4545
- NEVER make evasion patterns too uniform — randomization is critical for avoiding detection
4646
- NEVER skip evasion for credential entry — use `humanize.ts` typing profiles for sensitive fields
4747
- Changes to math distributions require careful validation — small changes can make patterns detectable
48+
49+
50+
## Core Principle
51+
52+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

packages/mcp/src/AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Overview
44

55
Model Context Protocol stdio server exposing all core services as AI-consumable tools.
6-
100+ tools across 15 categories. Entry point: `bin/linkedin-mcp.ts` (8,000+ lines).
6+
100+ tools across 15 categories. Entry point: `bin/linkedin-mcp.ts` (7,555+ lines).
77

88
## Files
99

@@ -87,3 +87,8 @@ async function handleToolName(args: ToolArgs): Promise<ToolResult> {
8787
- NEVER forget `runtime.close()` — always use try/finally
8888
- Tool names follow `linkedin.<domain>.<action>` convention — never deviate
8989
- All tools include optional `cdpUrl` and `selectorLocale` parameters
90+
91+
92+
## Core Principle
93+
94+
**GitHub is our source of truth.** Always check issue history, commits, and comments before starting implementation.

0 commit comments

Comments
 (0)