# Core & Plugin Development

## Local Development Setup

First, clone the necessary repositories:

```bash
$ git clone git@github.com:cortex-cms/cortex-starter.git
$ git clone git@github.com:cortex-cms/cortex.git
$ git clone git@github.com:cortex-cms/cortex-plugins-core.git
$ git clone your-plugin-repo-here.git
```

Use `pwd` to retrieve the fully qualified path for each engine, then modify each of the following files to point to the relevant local dependencies:

* `cortex/Gemfile`
* `cortex/spec/dummy/package.json`
* `cortex-starter/Gemfile`
* `cortex-starter/package.json`

For example:

{% code title="cortex-starter/Gemfile" %}

```ruby
# Cortex
gem 'cortex', path: '/home/testuser/repos/cortex'
gem 'cortex-plugins-core', path: '/home/testuser/repos/cortex-plugins-core'
```

{% endcode %}

{% code title="cortex-starter/package.json" %}

```javascript
"cortex": "/home/testuser/repos/cortex",
"cortex-plugins-core": "/home/testuser/repos/cortex-plugins-core"
```

{% endcode %}

Lastly, re-install dependencies in the relevant projects.

## Running Test Suite

Initialize the dummy application:

```bash
$ cd cortex
$ RAILS_ENV=test spec/dummy/bin/setup
```

To run Ruby and JavaScript specs, utilize:

```bash
$ RAILS_ENV=test bin/rails app:spec
$ RAILS_ENV=test bin/rails app:spec:javascript
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortexcms.org/basics/setup/core-and-plugin-development.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
