Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions .claude/skills/research-link/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ allowed-tools:

# Research Link

Research any external content — URL, tool, concept, pasted article, code snippet — and evaluate what it means for the ai-company project. Produces a decision-oriented assessment with concrete verdicts and next-step options.
Research any external content — URL, tool, concept, pasted article, code snippet — and evaluate what it means for the SynthOrg project. Produces a decision-oriented assessment with concrete verdicts and next-step options.

**Arguments:** "$ARGUMENTS"

---

## Phase 0: Load Project Context

**Before doing anything else**, read `DESIGN_SPEC.md` in the project root. This is the authoritative source for the project's architecture, module design, technology choices, milestones, and risk register. You need this context loaded to produce accurate project mappings and verdicts in later phases. Read it in parallel with the Phase 1 content acquisition.
**Before doing anything else**, read `DESIGN_SPEC.md` in the project root. This is the authoritative source for the project's architecture, module design, technology choices, and risk register. You need this context loaded to produce accurate project mappings and verdicts in later phases. Read it in parallel with the Phase 1 content acquisition.

## Phase 1: Identify Input Type and Acquire Content

Expand Down Expand Up @@ -86,7 +86,7 @@ For each tool/library/framework mentioned:

## Phase 3: Map to Project

Cross-reference findings against the ai-company project. Search these in parallel:
Cross-reference findings against the SynthOrg project. Search these in parallel:

1. **DESIGN_SPEC.md** — Grep for related sections (memory, providers, communication, agents, etc.)
2. **Source code** — Grep `src/ai_company/` for overlapping implementations or modules
Expand All @@ -109,15 +109,15 @@ For each relevant concept, tool, or pattern found, assign exactly one verdict:
| **ADAPT** | The concept applies but needs our own implementation | What to adapt, which module it goes in, rough approach |
| **REPLACE** | Better than what we have or planned | What it replaces, migration effort, why it's better |
| **RETHINK** | Fundamentally challenges an architectural assumption | Which assumption, what the alternative is, impact scope |
| **LATER** | Relevant but not for current milestone | When it becomes relevant, what triggers revisiting |
| **LATER** | Relevant but not for current scope | When it becomes relevant, what triggers revisiting |
| **SKIP** | Not applicable to this project | Brief explanation why |

### Verdict Rules

- Every verdict must reference a specific part of the project (module, design section, convention)
- **USE** and **REPLACE** require a license check against the repo's dependency review allow-list (see CI workflow and `CLAUDE.md` dependency notes; must be permissive and CI-compatible)
- **RETHINK** must explain the scope of impact — is it one module or the whole architecture?
- **LATER** must specify the trigger condition (e.g., "when we start M5 Memory & Budget")
- **LATER** must specify the trigger condition (e.g., "when we add the memory and budget subsystems")
- Be honest — most research produces ADAPT or LATER, not USE or RETHINK

## Phase 5: Present Results
Expand Down
61 changes: 27 additions & 34 deletions .claude/skills/worktree/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ allowed-tools:

# Worktree Manager

Manage parallel git worktrees for multi-issue development across phases. Handles creation, settings propagation, prompt generation, cleanup after merge, milestone tree view, and status overview.
Manage parallel git worktrees for multi-issue development across phases. Handles creation, settings propagation, prompt generation, cleanup after merge, dependency tree view, and status overview.

**Arguments:** "$ARGUMENTS"

Expand Down Expand Up @@ -40,9 +40,10 @@ feat/parallel-execution #22 "Parallel Agent Execution"
Branch names auto-generated from description: `feat/delegation-loop-prevention`.
Default branch type prefix is `feat/` unless the user specifies otherwise or the issue labels suggest a different type (e.g., `type:bug` → `fix/`, `type:refactor` → `refactor/`).

**Mode 3 — Milestone-aware:**
```
/worktree setup --milestone M4 --issues #26,#30,#133,#168
**Mode 3 — Issue list only:**

```text
/worktree setup --issues #26,#30,#133,#168
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Fetches issue titles from GitHub, groups by the user's worktree definitions (or asks for grouping via AskUserQuestion if not provided).

Expand All @@ -53,9 +54,9 @@ If no definitions are provided at all, ask the user via AskUserQuestion for:
### Directory naming

Directory suffix is auto-derived from the branch name:
- `feat/delegation-loop-prevention` → `../ai-company-wt-delegation-loop-prevention`
- `feat/delegation-loop-prevention` → `../synthorg-wt-delegation-loop-prevention`
- Strip everything up to and including the first `/` in the branch name (covers `feat/`, `fix/`, `refactor/`, `chore/`, `docs/`, `test/`, `perf/`, `ci/`), then prepend `wt-`
- Repo name extracted from the current working directory basename
- Repo name extracted from the repository's canonical root metadata (e.g. `basename $(git rev-parse --show-toplevel)`), not the current working directory basename. If running inside a linked worktree, derive the base repo name from shared Git metadata before composing `../<repo-name>-wt-<slug>`

### Steps

Expand Down Expand Up @@ -108,7 +109,7 @@ Directory suffix is auto-derived from the branch name:

3. **For each worktree definition**, run in sequence:

a. Determine the directory path: `../<repo-name>-wt-<slug>` (e.g. `../ai-company-wt-delegation-loop-prevention`)
a. Determine the directory path: `../<repo-name>-wt-<slug>` (e.g. `../synthorg-wt-delegation-loop-prevention`)

b. Create the worktree. For **new** branches:

Expand Down Expand Up @@ -201,7 +202,7 @@ Directory suffix is auto-derived from the branch name:
If there are multiple issues in one worktree that have a natural ordering (from dependency parsing or logical sequence), add an `## Implementation order` section.

6. **Present the output** to the user:
- For each worktree: show the **absolute path** to the worktree directory and a separate `claude` invocation command, followed by the prompt in a code block. Derive the absolute path dynamically by resolving the worktree directory (e.g., using `realpath <dir-path>` or `pwd` from within the worktree) and converting to the platform's native format. On Windows, use backslash paths (e.g., `C:\Users\Aurelio\ai-company-wt-delegation-loop-prevention`).
- For each worktree: show the **absolute path** to the worktree directory and a separate `claude` invocation command, followed by the prompt in a code block. Derive the absolute path dynamically by resolving the worktree directory (e.g., using `realpath <dir-path>` or `pwd` from within the worktree) and converting to the platform's native format. On Windows, use backslash paths (e.g., `C:\Users\Aurelio\synthorg-wt-delegation-loop-prevention`).
- **Note:** The `cd <path> && claude` instruction is for the **user's own terminal** (they will paste it into a new shell). This is NOT a Bash tool invocation — do not confuse with CLAUDE.md's "never use cd in Bash commands" rule, which applies to Bash tool calls within the skill.
- End with a count: "N worktrees ready. Go."

Expand Down Expand Up @@ -267,13 +268,9 @@ Remove worktrees and clean up branches after PRs are merged.
git branch -a
```

8. **Show milestone progress** (if determinable). Detect the milestone from the branches/issues that were cleaned up:

```bash
gh issue list --repo <owner/repo> --milestone "<milestone>" --state all --json state --jq '[sort_by(.state) | group_by(.state) | .[] | {state: .[0].state, count: length}]'
```
8. **Report summary:**

Report: "Clean. Main up to date, N worktrees removed, N branches deleted. Milestone: X/Y issues closed, Z remaining."
Report: "Clean. Main up to date, N worktrees removed, N branches deleted."

---

Expand Down Expand Up @@ -321,35 +318,30 @@ Show current worktree state and how they compare to main.

## Command: `tree`

Auto-generate a phase/dependency tree view from milestone issues.
Auto-generate a phase/dependency tree view from a set of issues.

### Input format

```
/worktree tree --milestone M4
```text
/worktree tree --issues #26,#30,#133,#168
```

If no milestone specified, try to detect from current worktree branches or ask via AskUserQuestion.
If no issues specified, try to detect from current worktree branches or ask via AskUserQuestion.

### Steps

1. **Fetch all issues for the milestone:**
1. **Fetch the specified issues:**

```bash
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.

medium

The gh issue view <number> command only fetches a single issue. To fetch multiple issues as shown in the example (/worktree tree --issues #26,#30,#133,#168), the gh CLI can accept multiple issue numbers. The documentation should be updated to reflect this to avoid ambiguity. A more accurate command would be gh issue view <numbers...>. For example: gh issue view 26 30 133 168.

Suggested change
```bash
gh issue view <numbers...> --repo <owner/repo> --json number,title,state,labels,body

gh issue list --repo <owner/repo> --milestone "<milestone-title>" --state all --limit 500 --json number,title,state,labels,body
```

Find the milestone title by querying:
```bash
gh api repos/<owner/repo>/milestones --jq '.[] | select(.title | test("<milestone-pattern>")) | {number, title}'
gh issue view <number> --repo <owner/repo> --json number,title,state,labels,body
```

2. **Parse dependency graph.** For each issue, extract `## Dependencies` section and resolve `#<N>` references. Build an adjacency list.

3. **Compute tiers** using topological sort:
- Tier 0: issues with no open M-internal dependencies (all deps are closed or external)
- Tier 1: depends only on Tier 0 issues
- Tier N: depends on Tier N-1 issues
- Tier 0: issues with no open internal dependencies (all deps are closed or external)
- Tier 1: all open internal dependencies are in Tier 0
- Tier N: all open internal dependencies are in earlier tiers; assign the tier as `1 + max(dependency tier)`
- Flag circular dependencies as errors. When detected, report the cycle (e.g. "#12 → #17 → #12"), render the remaining non-circular issues in their tiers, and suggest: "Break the cycle by removing one dependency edge, or implement the circular group in a single worktree."
Comment thread
coderabbitai[bot] marked this conversation as resolved.

4. **Identify current active worktrees** (if any):
Expand All @@ -365,7 +357,7 @@ If no milestone specified, try to detect from current worktree branches or ask v

Format:
```
MILESTONE: M4 — Communication & Multi-Agent Orchestration (15/19 done)
ISSUES: 4 total (3/4 done)

TIER 0 — No dependencies (all prereqs closed)
✅ #8 Message bus [critical] communication/
Expand Down Expand Up @@ -444,7 +436,7 @@ Update all worktrees to latest main. Pulls main first, then rebases clean worktr
- **Never force-remove** a worktree without asking the user first.
- **Never delete branches** without checking PR merge status first.
- **Always check `.claude/` local files exist** before copying — warn if missing.
- **Repo name detection**: extract from the current directory basename (e.g. `ai-company`).
- **Repo name detection**: extract from the repository's canonical root (`basename $(git rev-parse --show-toplevel)`), not the current directory basename. Strip any existing `wt-` prefix to avoid nested names when running from inside a linked worktree.
- **Owner/repo detection**: extract from `git remote get-url origin`.
- **Platform-aware paths**: derive worktree absolute paths dynamically at runtime. On Windows, convert to backslash paths for user-facing output. The `cd <path> && claude` instructions are for the user's own terminal, not Bash tool invocations.
- Worktree directories are always siblings of the main repo directory (`../`).
Expand All @@ -454,16 +446,17 @@ Update all worktrees to latest main. Pulls main first, then rebases clean worktr
- **Input validation (CRITICAL):** Before interpolating any user-provided value into shell commands, validate:
- Issue numbers: must match `^[0-9]+$`
- Branch names: must match `^[a-zA-Z0-9/_.-]+$`
- Milestone identifiers: must match `^M[0-9]+$` or a reasonable alphanumeric pattern
- Label/filter values: must be a reasonable alphanumeric pattern (no shell metacharacters)
- Owner/repo (from `git remote`): must match `^[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+$`
- Directory paths: must not contain shell metacharacters (`;`, `|`, `&`, `$`, `` ` ``, `(`, `)`)
- Reject and warn if any value fails validation — do not execute the command.
- If `$ARGUMENTS` is empty or doesn't match a command, show a brief usage guide:
```

```text
/worktree setup <definitions> — Create worktrees with prompts
/worktree setup --milestone M4 --issues #26,#30 — Milestone-aware setup
/worktree setup --issues #26,#30 — Issue-aware setup
/worktree cleanup — Remove worktrees after merge
/worktree status — Show worktree state
/worktree tree --milestone M4 — Dependency tree view
/worktree tree --issues #26,#30 — Dependency tree view
/worktree rebase — Update worktrees to latest main
```
12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing to AI Company
# Contributing to SynthOrg

## Quick Start

```bash
git clone https://github.com/Aureliolo/ai-company.git
cd ai-company
git clone https://github.com/Aureliolo/synthorg.git
cd synthorg
uv sync
```

Expand Down Expand Up @@ -85,9 +85,9 @@ uv run ruff format src/ tests/
## Running Tests

```bash
uv run pytest tests/ -m unit # unit tests (fast)
uv run pytest tests/ -m integration # integration tests
uv run pytest tests/ -m e2e # end-to-end tests
uv run pytest tests/ -m unit -n auto # unit tests (fast)
uv run pytest tests/ -m integration -n auto # integration tests
uv run pytest tests/ -m e2e -n auto # end-to-end tests
uv run pytest tests/ -n auto --cov=ai_company --cov-fail-under=80 # full suite + coverage
```

Expand Down
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you discover a security vulnerability, please report it responsibly.

**Do not open a public GitHub issue.**

Instead, use [GitHub's private vulnerability reporting](https://github.com/Aureliolo/ai-company/security/advisories/new) to submit your report.
Instead, use [GitHub's private vulnerability reporting](https://github.com/Aureliolo/synthorg/security/advisories/new) to submit your report.

You should receive a response within 72 hours. If the vulnerability is confirmed, we aim to provide a fix within 90 days for non-critical issues, and as quickly as possible for actively exploited vulnerabilities.

Expand Down
2 changes: 1 addition & 1 deletion .github/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": {
".": {
"release-type": "python",
"package-name": "ai-company",
"package-name": "synthorg",
"include-component-in-tag": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: ghcr.io/aureliolo/ai-company-backend
images: ghcr.io/aureliolo/synthorg-backend
tags: |
type=raw,value=${{ needs.version.outputs.app_version }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
Expand All @@ -94,7 +94,7 @@ jobs:
# SHA tag always exists (version/semver tags only on v* tags)
- name: Compute scan image ref
id: scan-ref
run: echo "ref=ghcr.io/aureliolo/ai-company-backend:sha-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
run: echo "ref=ghcr.io/aureliolo/synthorg-backend:sha-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"

- name: Trivy scan (critical — hard fail)
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
echo "::error::Push step did not produce a digest — cannot sign image"
exit 1
fi
cosign sign --yes ghcr.io/aureliolo/ai-company-backend@${DIGEST}
cosign sign --yes ghcr.io/aureliolo/synthorg-backend@${DIGEST}

build-web:
name: Build Web
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: ghcr.io/aureliolo/ai-company-web
images: ghcr.io/aureliolo/synthorg-web
tags: |
type=raw,value=${{ needs.version.outputs.app_version }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
Expand All @@ -205,7 +205,7 @@ jobs:
# SHA tag always exists (version/semver tags only on v* tags)
- name: Compute scan image ref
id: scan-ref
run: echo "ref=ghcr.io/aureliolo/ai-company-web:sha-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
run: echo "ref=ghcr.io/aureliolo/synthorg-web:sha-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"

- name: Trivy scan (critical — hard fail)
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
Expand Down Expand Up @@ -262,4 +262,4 @@ jobs:
echo "::error::Push step did not produce a digest — cannot sign image"
exit 1
fi
cosign sign --yes ghcr.io/aureliolo/ai-company-web@${DIGEST}
cosign sign --yes ghcr.io/aureliolo/synthorg-web@${DIGEST}
14 changes: 7 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CLAUDE.md — AI Company
# CLAUDE.md — SynthOrg

## Project

- **What**: Framework for orchestrating autonomous AI agents within a virtual company structure
- **What**: Framework for building synthetic organizations — autonomous AI agents orchestrated as a virtual company
- **Python**: 3.14+ (PEP 649 native lazy annotations)
- **License**: BUSL-1.1 (converts to Apache 2.0 on 2030-02-27)
- **Layout**: `src/ai_company/` (src layout), `tests/` (unit/integration/e2e)
Expand Down Expand Up @@ -32,9 +32,9 @@ uv run ruff check src/ tests/ # lint
uv run ruff check src/ tests/ --fix # lint + auto-fix
uv run ruff format src/ tests/ # format
uv run mypy src/ tests/ # type-check (strict)
uv run pytest tests/ -m unit # unit tests only
uv run pytest tests/ -m integration # integration tests only
uv run pytest tests/ -m e2e # e2e tests only
uv run pytest tests/ -m unit -n auto # unit tests only
uv run pytest tests/ -m integration -n auto # integration tests only
uv run pytest tests/ -m e2e -n auto # e2e tests only
uv run pytest tests/ -n auto --cov=ai_company --cov-fail-under=80 # full suite + coverage
uv run pre-commit run --all-files # all pre-commit hooks
```
Expand Down Expand Up @@ -84,7 +84,7 @@ src/ai_company/

## Shell Usage

- **NEVER use `cd` in Bash commands** — the working directory is already set to the project root. Use absolute paths or run commands directly. Do NOT prefix commands with `cd C:/Users/Aurelio/ai-company &&`.
- **NEVER use `cd` in Bash commands** — the working directory is already set to the project root. Use absolute paths or run commands directly. Do NOT prefix commands with `cd C:/Users/Aurelio/synthorg &&`.

## Code Conventions

Expand Down Expand Up @@ -129,7 +129,7 @@ src/ai_company/
- **Coverage**: 80% minimum (enforced in CI)
- **Async**: `asyncio_mode = "auto"` — no manual `@pytest.mark.asyncio` needed
- **Timeout**: 30 seconds per test
- **Parallelism**: `pytest-xdist` via `-n auto`
- **Parallelism**: `pytest-xdist` via `-n auto` — **ALWAYS** include `-n auto` when running pytest, never run tests sequentially
- **Parametrize**: Prefer `@pytest.mark.parametrize` for testing similar cases
- **Vendor-agnostic everywhere**: NEVER use real vendor names (Anthropic, OpenAI, Claude, GPT, etc.) in project-owned code, docstrings, comments, tests, or config examples. Use generic names: `example-provider`, `example-large-001`, `example-medium-001`, `example-small-001`, `large`/`medium`/`small` as aliases. Vendor names may only appear in: (1) DESIGN_SPEC.md provider list (listing supported providers), (2) `.claude/` skill/agent files, (3) third-party import paths/module names (e.g. `litellm.types.llms.openai`). Tests must use `test-provider`, `test-small-001`, etc.

Expand Down
Loading
Loading