create-project-cortex-agent 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mateusz Zwierzycki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# create-project-cortex-agent
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
A command-line tool to instantly initialize your workspace with the **Project Cortex** AI Agent directory structure.
|
|
4
6
|
|
|
5
|
-
This package bootstraps the foundational architecture needed for long-term AI-assisted development by preventing context degradation. It sets up strict boundaries, rules, and calendar-based memory logs for AI coding agents (such as Claude, Gemini, ChatGPT, or IDEs like Cursor and Copilot).
|
|
7
|
+
This package bootstraps the foundational architecture needed for long-term AI-assisted development by preventing context degradation. It sets up strict boundaries, rules, and calendar-based .memory logs for AI coding agents (such as Claude, Gemini, ChatGPT, or IDEs like Cursor and Copilot).
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
@@ -58,11 +60,11 @@ The CLI safely injects the necessary constraints and guidelines into your reposi
|
|
|
58
60
|
│ │ └── arch_hard_tech_stack.md # Immutable tech stack rules for the AI
|
|
59
61
|
│ └── workflows/
|
|
60
62
|
│ ├── init.md # Workflow to start a new session
|
|
61
|
-
│ └── save-memory.md # Workflow template for memory operations
|
|
63
|
+
│ └── save-memory.md # Workflow template for .memory operations
|
|
62
64
|
├── code/
|
|
63
65
|
│ └── README.md # Codebase operating rules for the AI
|
|
64
|
-
└── memory/
|
|
65
|
-
└── README.md # Instructions on calendar-based long-term memory
|
|
66
|
+
└── .memory/
|
|
67
|
+
└── README.md # Instructions on calendar-based long-term .memory
|
|
66
68
|
```
|
|
67
69
|
|
|
68
70
|
---
|
|
@@ -77,7 +79,7 @@ After running the initializer, your project is ready for smart AI assistance, bu
|
|
|
77
79
|
> "Run Cortex" / "hey cortex, lets start" / "hey cortex, lets continue"
|
|
78
80
|
|
|
79
81
|
*\*If your agent requires explicit file references (like Cursor), you can type `@init.md Run Cortex`.*
|
|
80
|
-
3. **Log Your Sessions:** Simply use natural language like "that's it for today", "we are done", or "see ya later" to trigger the chronological summary in the
|
|
82
|
+
3. **Log Your Sessions:** Simply use natural language like "that's it for today", "we are done", or "see ya later" to trigger the chronological summary in the `.memory/` logs!
|
|
81
83
|
|
|
82
84
|
---
|
|
83
85
|
|
package/dist/cli.js
CHANGED
|
@@ -63,6 +63,7 @@ program
|
|
|
63
63
|
const dirs = [
|
|
64
64
|
path.join(targetDir, '.agents', 'rules'),
|
|
65
65
|
path.join(targetDir, '.agents', 'workflows'),
|
|
66
|
+
path.join(targetDir, '.memory'),
|
|
66
67
|
path.join(targetDir, 'code'),
|
|
67
68
|
];
|
|
68
69
|
for (const dir of dirs) {
|
|
@@ -88,8 +89,8 @@ program
|
|
|
88
89
|
dest: path.join(targetDir, '.agents', 'workflows', 'init.md')
|
|
89
90
|
},
|
|
90
91
|
{
|
|
91
|
-
src: path.join(templatesDir, 'memory', 'README.md'),
|
|
92
|
-
dest: path.join(targetDir, 'memory', 'README.md')
|
|
92
|
+
src: path.join(templatesDir, '.memory', 'README.md'),
|
|
93
|
+
dest: path.join(targetDir, '.memory', 'README.md')
|
|
93
94
|
},
|
|
94
95
|
{
|
|
95
96
|
src: path.join(templatesDir, 'code', 'README.md'),
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ description: Bootstraps the AI's context for a new coding session.
|
|
|
6
6
|
|
|
7
7
|
When the human says something like "Run Cortex", "hey cortex, lets start", "hey cortex, lets continue", "hey, let's start a new session", "initialize", or directly referring to this file, you must strictly follow these steps before answering any other prompt or writing any code.
|
|
8
8
|
|
|
9
|
-
1. **Read System Rules:** Read the AI-only documentation in
|
|
10
|
-
2. **Contextualize
|
|
11
|
-
3. **Check for Ghost Changes:** Check the state of the `code/` directory (e.g., using `git status` or `git diff`). If there are undocumented code changes that occurred after the last recorded memory log, you MUST retroactively create a `log_*.md` file summarizing those changes in the proper week's folder.
|
|
9
|
+
1. **Read System Rules:** Read the AI-only documentation in `.memory/README.md`, `.agents/rules/arch_hard_tech_stack.md`, and `code/README.md`.
|
|
10
|
+
2. **Contextualize .memory:** Review the `.memory/` directory to understand what was done in the previous session (read the most recent log or rolling summary).
|
|
11
|
+
3. **Check for Ghost Changes:** Check the state of the `code/` directory (e.g., using `git status` or `git diff`). If there are undocumented code changes that occurred after the last recorded .memory log, you MUST retroactively create a `log_*.md` file summarizing those changes in the proper week's folder.
|
|
12
12
|
4. **Ready:** Acknowledge you have loaded the context and ask the user what they want to work on.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Trigger memory rollup on natural language '/save
|
|
2
|
+
description: Trigger .memory rollup on natural language '/save-.memory' or 'thats it for today'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Save
|
|
5
|
+
# Save .memory Workflow
|
|
6
6
|
|
|
7
7
|
## Triggers
|
|
8
8
|
The user signals the end of a chat session using phrases like:
|
|
@@ -14,6 +14,6 @@ The user signals the end of a chat session using phrases like:
|
|
|
14
14
|
## Execution
|
|
15
15
|
When the above intent is detected:
|
|
16
16
|
1. Generate an overview log of the current conversation.
|
|
17
|
-
2. Store this log inside
|
|
17
|
+
2. Store this log inside `.memory/` or update `.agents/rules/` if an architecture rule changed.
|
|
18
18
|
3. Archive older logs to ensure a maximum of 30 active files in the working directory.
|
|
19
|
-
4. Announce that the session memory has been effectively committed.
|
|
19
|
+
4. Announce that the session .memory has been effectively committed.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# .memory Context
|
|
2
2
|
|
|
3
3
|
> **Important: [AI-ONLY SYSTEM INSTRUCTION]**
|
|
4
|
-
> This file establishes the operational requirements for AI agents managing the project's memory. Humans do not need to read or edit this file unless fundamentally changing the rules of the template.
|
|
5
|
-
> This folder stores conversation logs organized into a nested calendar structure, acting as the long-term memory for the AI.
|
|
4
|
+
> This file establishes the operational requirements for AI agents managing the project's .memory. Humans do not need to read or edit this file unless fundamentally changing the rules of the template.
|
|
5
|
+
> This folder stores conversation logs organized into a nested calendar structure, acting as the long-term .memory for the AI.
|
|
6
6
|
|
|
7
7
|
## Folder Hierarchy
|
|
8
8
|
|
|
9
9
|
* **`.agents/rules/`**: Holds system constraints, architectural rules, and core states that bypass all standard archiving rules. These files are permanently kept.
|
|
10
|
-
*
|
|
10
|
+
* **`.memory/[YYYY]/`**: The root folder for a given year.
|
|
11
11
|
* `year_[YYYY].md`: Annual summary of the months.
|
|
12
12
|
* **`[MM]/`**: Folder for the month (01 to 12).
|
|
13
13
|
* `month_[YYYY]-[MM].md`: Monthly summary of the weeks.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
3. **Month (Summarization):** At the month's end, the `week_` summaries are synthesized into `month_[YYYY]-[MM].md`.
|
|
23
23
|
4. **Year (Summarization):** At the year's end, the `month_` summaries are synthesized into `year_[YYYY].md`.
|
|
24
24
|
5. **Overrides:** Files in `.agents/rules/` are permanently kept and NEVER summarized or deleted by the calendar cleanup process.
|
|
25
|
-
6. **Session Termination Trigger:** Whenever the human user uses natural language indicating the end of a session (e.g., "that's it for today", "we are done", "wrap it up", "see ya later"), you MUST automatically initiate the memory rollup process, generating the required summaries and `log_` files in the
|
|
25
|
+
6. **Session Termination Trigger:** Whenever the human user uses natural language indicating the end of a session (e.g., "that's it for today", "we are done", "wrap it up", "see ya later"), you MUST automatically initiate the .memory rollup process, generating the required summaries and `log_` files in the `.memory/` directory.
|
|
26
26
|
7. **Auto-Recovery (Missing Logs):** If you are initialized in a new session and detect that the `code/` directory contains updates, new files, or Git changes that are NOT documented in the most recent `log_` or `week_` file, you must assume the previous session ended without a proper rollup. You MUST immediately analyze the undocumented code changes and generate a retroactive `log_` file summarizing them before proceeding with new human requests.
|
|
27
27
|
|
|
28
28
|
## Mandatory Formatting & Retention Rules
|
|
@@ -36,4 +36,4 @@ To prevent knowledge loss and context degradation during the summarization proce
|
|
|
36
36
|
* **Context & Notes:** Any specific commands, environment variables, or quirks needed to run the current codebase.
|
|
37
37
|
* **Critical Retention Tags:** If a raw daily log or a lower-level summary contains the tag `[CRITICAL_DECISION]` or `[ADR]`, the exact text associated with that tag MUST be copied verbatim into the higher-level summaries. Do not paraphrase or compress these points.
|
|
38
38
|
* **Task Rollover:** Any incomplete tasks or open bugs mentioned in the active period MUST be explicitly listed under "Unresolved Issues & WIP" in the newly generated summary so the next AI session can immediately resume work.
|
|
39
|
-
* **Knowledge Extraction:** While summarizing at the end of a week/month, if a core architectural pattern, tech stack, or global rule has changed, you MUST automatically update the relevant files in `.agents/rules/` to reflect the current state of the project.
|
|
39
|
+
* **Knowledge Extraction:** While summarizing at the end of a week/month, if a core architectural pattern, tech stack, or global rule has changed, you MUST automatically update the relevant files in `.agents/rules/` to reflect the current state of the project.
|