Skip to main content

Implementation Plan: Work Import

Feature ID: work-import Spec: ./spec.md Status: Done (Retrospective) Last updated: 2026-05-01


1. Architecture

2. Tech Choices

ConcernChoiceRationale
Repo detectionTry .works/works.yml paths; fall back to READMEworks-config has highest fidelity
Awesome parserMarkdown AST traversal of nested listsTolerates varied formatting; no JS evaluation
Dry-runPlanner returns a preview without DB writesUX — user can review before committing
Slug conflictCase-insensitive lookup against worksMatches GitHub repo naming

3. Data Model

  • Additive columns on works: worksConfigPath (nullable string), importedFromUrl (nullable string).

4. API Surface

MethodEndpointDescription
POST/api/works/import/previewDry-run; returns parsed preview
POST/api/works/importConfirm import; creates the work

5. Plugin / Web / CLI

  • Plugins: uses existing git provider + (optional) AI plugins for content enrichment.
  • Web: import wizard with paste-URL → preview → confirm steps.
  • CLI: ever-works work import <url>.

6. Background Jobs

Awesome-List item normalisation (extracting structured fields per item) runs as a Trigger.dev fan-out task once the work is created.

7. Security & Permissions

  • User's git provider plugin credentials read the source repo.
  • Slug uniqueness scoped per user.

8. Observability

  • Activity log: work_import action with status and detected shape.

9. Risks & Mitigations

RiskMitigation
Awesome-List with non-standard formatSkip on parse failure; user can hand-author later
Plugin id changed after the source's .works/works.yml was authoredValidation + clear error
Race between two users importing same repoFirst-creator wins; second gets uniqueness conflict

10. Constitution Reconciliation

See spec.md §9.

11. References

  • Spec: ./spec.md
  • Implementation:
    • packages/agent/src/works-config/services/works-config-import-planner.service.ts
    • packages/agent/src/works-config/services/works-config-import-applier.service.ts
    • packages/agent/src/import/