@moritakaaz/markflow 0.0.0-stage → 0.2.0
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/README.md +32 -2
- package/package.json +21 -4
- package/src/agents.js +17 -0
- package/src/discover.js +188 -0
- package/src/doctor.js +284 -0
- package/src/hash.js +7 -0
- package/src/index.js +61 -0
- package/src/init.js +228 -0
- package/src/minimal.js +22 -0
- package/src/templates.js +17 -0
- package/src/update.js +146 -0
- package/src/versions.js +6 -0
- package/templates/AGENTS.md +26 -0
- package/templates/markflow/.agents/MEMORY.md +17 -0
- package/templates/markflow/.agents/PROMPTS.md +21 -0
- package/templates/markflow/.agents/RULES.md +7 -0
- package/templates/markflow/.agents/mcp.json +3 -0
- package/templates/markflow/.agents/workflows/create-feature.md +14 -0
- package/templates/markflow/.agents/workflows/implement-spec.md +13 -0
- package/templates/markflow/.agents/workflows/onboarding.md +22 -0
- package/templates/markflow/.agents/workflows/pre-deploy-check.md +13 -0
- package/templates/markflow/.agents/workflows/review-spec.md +13 -0
- package/templates/markflow/.agents/workflows/sync-docs.md +13 -0
- package/templates/markflow/CHANGELOG.md +9 -0
- package/templates/markflow/README.md +30 -0
- package/templates/markflow/TASKS.md +13 -0
- package/templates/markflow/docs/API.md +24 -0
- package/templates/markflow/docs/ARCHITECTURE.md +29 -0
- package/templates/markflow/docs/CODING_STANDARDS.md +40 -0
- package/templates/markflow/docs/DATA_MODEL.md +23 -0
- package/templates/markflow/docs/DEPLOY.md +23 -0
- package/templates/markflow/docs/GLOSSARY.md +16 -0
- package/templates/markflow/docs/MCP.md +19 -0
- package/templates/markflow/docs/PRD.md +29 -0
- package/templates/markflow/docs/STACK.md +19 -0
- package/templates/markflow/docs/TESTING.md +27 -0
- package/templates/markflow/docs/adr/001-initial-stack.md +25 -0
- package/templates/markflow/docs/adr/_template.md +27 -0
- package/templates/markflow/specs/_template.md +33 -0
- package/templates/markflow/specs/index.md +15 -0
- package/test/cli.test.js +590 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# API.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file is the contract for the API of {{project_name}}.
|
|
4
|
+
Read when. You work on an endpoint or a client that calls it.
|
|
5
|
+
Do not read when. You work on code that does not touch the API.
|
|
6
|
+
|
|
7
|
+
## Auth
|
|
8
|
+
|
|
9
|
+
<!-- Write how auth works. If there is no auth yet, write TBD. -->
|
|
10
|
+
|
|
11
|
+
## Endpoints
|
|
12
|
+
|
|
13
|
+
<!-- List each endpoint with method, path, request, and response. Keep each entry short. -->
|
|
14
|
+
|
|
15
|
+
### TBD
|
|
16
|
+
|
|
17
|
+
- Method. TBD
|
|
18
|
+
- Request. TBD
|
|
19
|
+
- Response. TBD
|
|
20
|
+
- Errors. TBD
|
|
21
|
+
|
|
22
|
+
## Rules
|
|
23
|
+
|
|
24
|
+
<!-- Write the shared rules. Examples are error format and pagination. Do not repeat one endpoint detail here. -->
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# ARCHITECTURE.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file explains the stack, the layout, and the flow of {{project_name}}.
|
|
4
|
+
Read when. You pick a stack or decide where code goes.
|
|
5
|
+
Do not read when. You need one feature detail. Open its spec instead.
|
|
6
|
+
|
|
7
|
+
## Detected stack
|
|
8
|
+
|
|
9
|
+
<!-- Write what discovery found. If discovery found nothing yet, write TBD. -->
|
|
10
|
+
|
|
11
|
+
- Language. TBD
|
|
12
|
+
- Framework. TBD
|
|
13
|
+
- Database. TBD
|
|
14
|
+
|
|
15
|
+
## Layout
|
|
16
|
+
|
|
17
|
+
<!-- Write where code lives. Write where tests live. Do not invent folders that do not exist yet. Mark planned folders as planned. -->
|
|
18
|
+
|
|
19
|
+
## Flow
|
|
20
|
+
|
|
21
|
+
<!-- Write how a request or a job moves through the system. Use short steps. Keep it to five steps or less when you can. -->
|
|
22
|
+
|
|
23
|
+
1. TBD
|
|
24
|
+
2. TBD
|
|
25
|
+
3. TBD
|
|
26
|
+
|
|
27
|
+
## Decisions
|
|
28
|
+
|
|
29
|
+
Link to ADRs in `adr` when a choice affects architecture. Do not repeat the full reason here.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# CODING_STANDARDS.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file holds the code rules for {{project_name}}.
|
|
4
|
+
Read when. You write or review code.
|
|
5
|
+
Do not read when. You only edit docs. Docs do not need code rules.
|
|
6
|
+
|
|
7
|
+
## 1. Language
|
|
8
|
+
|
|
9
|
+
Code, variable names, function names, class names, file names, and folder names use English.
|
|
10
|
+
Docs use English for this template. Change the doc language in PRD when the project needs another language.
|
|
11
|
+
|
|
12
|
+
## 2. Naming
|
|
13
|
+
|
|
14
|
+
<!-- Write your naming pattern here. Decide the case for files, functions, and constants. Then follow it everywhere. -->
|
|
15
|
+
|
|
16
|
+
- Files. TBD
|
|
17
|
+
- Functions. TBD
|
|
18
|
+
- Constants. TBD
|
|
19
|
+
|
|
20
|
+
## 3. Function format
|
|
21
|
+
|
|
22
|
+
<!-- Write your function format here. Decide how long a function can be and how many tasks it should do. -->
|
|
23
|
+
|
|
24
|
+
One function should do one task.
|
|
25
|
+
|
|
26
|
+
## 4. Comments
|
|
27
|
+
|
|
28
|
+
Write a comment only when logic is hard to follow without it. Use simple comments. For one line use two slashes. For many lines use slash star and star slash. Do not use decorative comment lines.
|
|
29
|
+
|
|
30
|
+
## 5. File structure
|
|
31
|
+
|
|
32
|
+
<!-- Write the order of parts in a file here. Decide what comes first, imports or constants or the main function. Then follow it. -->
|
|
33
|
+
|
|
34
|
+
## 6. What to avoid
|
|
35
|
+
|
|
36
|
+
Avoid em dashes. Avoid colons in prose. Avoid formal and cliché words. Avoid words like delve, leverage, seamless, robust, and cutting edge. If a sentence sounds like a sales page, rewrite it.
|
|
37
|
+
|
|
38
|
+
## 7. Enforcement
|
|
39
|
+
|
|
40
|
+
This file states intent. Config files enforce it. Examples are editor config, lint config, and format config. Keep both in sync. When a rule here changes, update the config too.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# DATA_MODEL.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file explains the data for {{project_name}}.
|
|
4
|
+
Read when. You change data, add a table, or change a relation.
|
|
5
|
+
Do not read when. You only change UI text. That does not touch data.
|
|
6
|
+
|
|
7
|
+
## Entities
|
|
8
|
+
|
|
9
|
+
<!-- List the main entities. One line per entity. Say what it holds. -->
|
|
10
|
+
|
|
11
|
+
- TBD
|
|
12
|
+
|
|
13
|
+
## Relations
|
|
14
|
+
|
|
15
|
+
<!-- Write how entities link to each other. Use plain words. Avoid jargon when you can. -->
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
<!-- Write the rules for data. Examples are what must stay unique and what must never be deleted. Mark rules you are unsure about as TBD. -->
|
|
20
|
+
|
|
21
|
+
## Migrations
|
|
22
|
+
|
|
23
|
+
<!-- Write how schema changes are made and tested. Keep it short. -->
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# DEPLOY.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file explains how {{project_name}} is released.
|
|
4
|
+
Read when. You deploy or you set up env vars.
|
|
5
|
+
Do not read when. You only change local code. That does not need deploy notes.
|
|
6
|
+
|
|
7
|
+
## Release flow
|
|
8
|
+
|
|
9
|
+
<!-- Write the steps from main branch to production. Keep each step to one line. -->
|
|
10
|
+
|
|
11
|
+
1. TBD
|
|
12
|
+
2. TBD
|
|
13
|
+
3. TBD
|
|
14
|
+
|
|
15
|
+
## Env vars
|
|
16
|
+
|
|
17
|
+
<!-- List the env vars that are required. Do not write real secrets here. Write example values only. Real values live in local env files. -->
|
|
18
|
+
|
|
19
|
+
- TBD
|
|
20
|
+
|
|
21
|
+
## Rollback
|
|
22
|
+
|
|
23
|
+
<!-- Write how to roll back a bad release. Keep it short. -->
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# GLOSSARY.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file defines domain terms for {{project_name}}.
|
|
4
|
+
Read when. A term is unclear or two people use the same word in different ways.
|
|
5
|
+
Do not read when. You already know the term. Skip it.
|
|
6
|
+
|
|
7
|
+
## Terms
|
|
8
|
+
|
|
9
|
+
<!-- Add one entry per term. Keep each definition to one or two sentences. -->
|
|
10
|
+
|
|
11
|
+
- PRD. A product requirements document. It says what the product is for, who uses it, and what it must do. It does not say how to build it.
|
|
12
|
+
- Spec. A specification for one piece of work. It lists the goal, the scope, the steps, and the acceptance cases that prove the work is done. Code starts only after a spec is approved.
|
|
13
|
+
- Task. One small unit of work from TASKS.md. A task belongs to a spec or to a fix that is too small for a spec.
|
|
14
|
+
- Architecture. The layout of the system. It names the stack, the main parts, and how they connect. It also records the evidence for each choice.
|
|
15
|
+
- TBD. To be decided. A mark for something unknown. Never guess a TBD. Ask a human or check the code, then replace the mark with the answer.
|
|
16
|
+
- Evidence. Proof from the repo. A file, a test result, or a line of code that shows a claim is true. A claim without evidence is a guess.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# MCP.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file lists MCP servers for {{project_name}}.
|
|
4
|
+
Read when. You set up an AI tool or you add a library that has an MCP server.
|
|
5
|
+
Do not read when. You work without AI. MCP is optional for humans.
|
|
6
|
+
|
|
7
|
+
## Servers
|
|
8
|
+
|
|
9
|
+
<!-- Add one entry per server. Say what it is for and what env it needs. -->
|
|
10
|
+
|
|
11
|
+
- TBD. Purpose. TBD. Env needed. TBD.
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
<!-- Write how the master config in `.agents/mcp.json` is copied to your AI tool. Do not put API keys in that file. Use env vars. List the env names in DEPLOY.md, not the real values. -->
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
A library with an MCP server should list it in STACK.md too. Keep both files in sync.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# PRD.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file explains what {{project_name}} is for, who uses it, and what it must do.
|
|
4
|
+
Read when. You start a new feature or check if a feature still fits the vision.
|
|
5
|
+
Do not read when. You need code detail. Open a spec in `specs` instead.
|
|
6
|
+
|
|
7
|
+
## Vision
|
|
8
|
+
|
|
9
|
+
<!-- Write one short paragraph. What problem does this project solve. Who has that problem today. -->
|
|
10
|
+
|
|
11
|
+
## Users
|
|
12
|
+
|
|
13
|
+
<!-- List the main users. Write one line per user type. Say what each type needs most. -->
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
<!-- List the core features. Keep each item to one line for now. Detail goes in a spec later. -->
|
|
18
|
+
|
|
19
|
+
- TBD
|
|
20
|
+
|
|
21
|
+
## Out of scope
|
|
22
|
+
|
|
23
|
+
<!-- List what this project will not do. This stops scope creep early. -->
|
|
24
|
+
|
|
25
|
+
- TBD
|
|
26
|
+
|
|
27
|
+
## Success
|
|
28
|
+
|
|
29
|
+
<!-- Write how you will know this project works. Use plain words. Avoid numbers you cannot check. -->
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# STACK.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file lists libraries for {{project_name}} and why each one is used.
|
|
4
|
+
Read when. You add or replace a library.
|
|
5
|
+
Do not read when. You only fix a bug in existing code. That does not change the stack.
|
|
6
|
+
|
|
7
|
+
## Libraries
|
|
8
|
+
|
|
9
|
+
<!-- Add one row per library. Keep the reason short. -->
|
|
10
|
+
|
|
11
|
+
| Need | Library | MCP server | Reason |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| Auth | TBD | TBD | TBD |
|
|
14
|
+
| Database | TBD | TBD | TBD |
|
|
15
|
+
| UI | TBD | TBD | TBD |
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
Do not add a library without a need and a reason. A library must bring its MCP server when one exists. Update MCP.md when you add a row here.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# TESTING.md
|
|
2
|
+
|
|
3
|
+
Purpose. This file explains how {{project_name}} is tested.
|
|
4
|
+
Read when. You write tests or you check if a change is safe.
|
|
5
|
+
Do not read when. You only edit docs. Docs do not need tests.
|
|
6
|
+
|
|
7
|
+
## Levels
|
|
8
|
+
|
|
9
|
+
<!-- Write what you test at each level. Keep it short. -->
|
|
10
|
+
|
|
11
|
+
- Unit. TBD
|
|
12
|
+
- Integration. TBD
|
|
13
|
+
- End to end. TBD
|
|
14
|
+
|
|
15
|
+
## How to run tests
|
|
16
|
+
|
|
17
|
+
<!-- Write the exact command to run tests. Write what a pass looks like. -->
|
|
18
|
+
|
|
19
|
+
## Edge cases
|
|
20
|
+
|
|
21
|
+
<!-- List the edge cases that often break. Add new ones when you find them. -->
|
|
22
|
+
|
|
23
|
+
- TBD
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
Do not claim work is done without test evidence. A green test run is the evidence. A manual check alone is not enough for risky changes.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 001 Initial Stack
|
|
2
|
+
|
|
3
|
+
Purpose. This file records the first stack choice for {{project_name}}.
|
|
4
|
+
Read when. You wonder why this stack was picked.
|
|
5
|
+
Do not read when. You work on a single feature. Open its spec instead.
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
The initial stack is TBD. Discovery will fill this in during init.
|
|
10
|
+
|
|
11
|
+
## Context
|
|
12
|
+
|
|
13
|
+
<!-- Write what discovery found. List the manifest files that proved the stack. -->
|
|
14
|
+
|
|
15
|
+
## Options considered
|
|
16
|
+
|
|
17
|
+
- TBD
|
|
18
|
+
|
|
19
|
+
## Outcome
|
|
20
|
+
|
|
21
|
+
<!-- Write the picked stack and the main reason. Mark anything unsure as TBD. -->
|
|
22
|
+
|
|
23
|
+
## Status
|
|
24
|
+
|
|
25
|
+
Draft
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# ADR Template
|
|
2
|
+
|
|
3
|
+
Purpose. This file is the template for a new architecture decision.
|
|
4
|
+
Read when. You need to record a decision that affects architecture.
|
|
5
|
+
Do not read when. You only fix a small bug. That does not need an ADR.
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
<!-- Write the decision in one sentence. -->
|
|
10
|
+
|
|
11
|
+
## Context
|
|
12
|
+
|
|
13
|
+
<!-- Write why this decision was needed. Keep it short. -->
|
|
14
|
+
|
|
15
|
+
## Options considered
|
|
16
|
+
|
|
17
|
+
<!-- List the options you considered. One line per option. -->
|
|
18
|
+
|
|
19
|
+
- TBD
|
|
20
|
+
|
|
21
|
+
## Outcome
|
|
22
|
+
|
|
23
|
+
<!-- Write what you picked and why. Write what you gave up. -->
|
|
24
|
+
|
|
25
|
+
## Status
|
|
26
|
+
|
|
27
|
+
<!-- Write Draft or Approved. -->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Spec Template
|
|
2
|
+
|
|
3
|
+
Purpose. This file is the template for a new feature spec.
|
|
4
|
+
Read when. You create a new spec.
|
|
5
|
+
Do not read when. You implement a spec that already exists. Open that spec instead.
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
<!-- Write what this feature must do in one or two sentences. -->
|
|
10
|
+
|
|
11
|
+
## Users
|
|
12
|
+
|
|
13
|
+
<!-- Write who uses this feature. -->
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
<!-- List what must be true when this feature is done. Use plain words. Each item must be checkable. -->
|
|
18
|
+
|
|
19
|
+
- [ ] TBD
|
|
20
|
+
|
|
21
|
+
## Out of scope
|
|
22
|
+
|
|
23
|
+
<!-- List what this feature will not do. -->
|
|
24
|
+
|
|
25
|
+
- TBD
|
|
26
|
+
|
|
27
|
+
## Acceptance
|
|
28
|
+
|
|
29
|
+
<!-- Write how you will test this feature. List the main cases. -->
|
|
30
|
+
|
|
31
|
+
## Status
|
|
32
|
+
|
|
33
|
+
Draft
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Specs Index
|
|
2
|
+
|
|
3
|
+
Purpose. This file lists all specs for {{project_name}} plus status.
|
|
4
|
+
Read when. You start work and need to pick a spec.
|
|
5
|
+
Do not read when. You already know which spec you need. Open it directly.
|
|
6
|
+
|
|
7
|
+
## Status guide
|
|
8
|
+
|
|
9
|
+
Draft means the spec is still being written. Approved means it is ready to build. In Progress means work has started. Done means it passed tests.
|
|
10
|
+
|
|
11
|
+
## Specs
|
|
12
|
+
|
|
13
|
+
| ID | Title | Status |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| 01 | TBD | Draft |
|