sisyo 1.0.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/LICENSE ADDED
@@ -0,0 +1,16 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 HoangThang (hoang.jp)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files, to deal in the Software
7
+ without restriction, including without limitation the rights to use, copy,
8
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the
9
+ Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # sisyo
2
+
3
+ Smart documentation system for vibe coding with Claude Code.
4
+ Docs auto-update as you build. Token-efficient MAP.md routing pattern.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ npx sisyo
10
+ ```
11
+
12
+ Run it in your project root.
13
+
14
+ ## What it creates
15
+
16
+ ```
17
+ your-project/
18
+ CLAUDE.md # Project rules (auto-loaded)
19
+ .claude/
20
+ rules/docs.md # Doc rules (auto-loaded, 10 lines)
21
+ skills/vibe-docs/SKILL.md # Brain (loaded on trigger)
22
+ docs/
23
+ MAP.md # Routing table
24
+ 99_progress/todo.md # Task backlog
25
+ 99_progress/handoff.md # Session recovery
26
+ ```
27
+
28
+ ## How it works
29
+
30
+ **Problem:** Loading all docs into context = 20K+ tokens = runs out fast.
31
+
32
+ **Solution:** `MAP.md` is a routing table with 1-line summary per doc (~500 tokens).
33
+ Claude reads MAP.md first, then loads only the specific file it needs.
34
+
35
+ ```
36
+ CLAUDE.md (auto-load)
37
+ |
38
+ v
39
+ docs/MAP.md (routing table, ~30 lines)
40
+ |
41
+ +--> 03_database/schema.md (only if working on DB)
42
+ +--> 04_api/auth.md (only if working on API)
43
+ +--> 99_progress/todo.md (only if checking tasks)
44
+ ```
45
+
46
+ ### Auto-triggers
47
+
48
+ The vibe-docs skill triggers automatically when you:
49
+ - Design database tables -> creates/updates `03_database/schema.md`
50
+ - Add API endpoints -> creates/updates `04_api/[module].md`
51
+ - Plan features -> creates `01_requirements/[name].md`
52
+ - Make architecture decisions -> updates `02_architecture/decisions.md`
53
+ - Complete any task -> updates `99_progress/todo.md`
54
+ - End a session -> writes `99_progress/handoff.md`
55
+
56
+ Every doc change also updates its summary line in MAP.md.
57
+
58
+ ### Session recovery
59
+
60
+ After `/clear` or starting fresh:
61
+ ```
62
+ Read handoff and continue
63
+ ```
64
+ Claude reads MAP.md + handoff.md + todo.md (~3K tokens) and picks up where you left off.
65
+
66
+ ## Doc folders
67
+
68
+ | Folder | Purpose |
69
+ |---|---|
70
+ | `00_schedule/` | Roadmap, milestones, sprint plans |
71
+ | `01_requirements/` | Feature specs, user stories |
72
+ | `02_architecture/` | System design, tech decisions (ADR) |
73
+ | `03_database/` | Schema, ERD, migration log |
74
+ | `04_api/` | API endpoint specs by module |
75
+ | `05_frontend/` | Pages, components, routing |
76
+ | `06_infra/` | Deploy, Docker, CI/CD, env vars |
77
+ | `99_progress/` | TODO, changelog, session handoff |
78
+
79
+ Folders are created on-demand. No empty placeholders.
80
+
81
+ ## After install
82
+
83
+ 1. Edit `CLAUDE.md` - replace `[Project Name]` with yours
84
+ 2. Open Claude Code and start building
85
+ 3. Docs update automatically as you work
86
+
87
+ ## Author
88
+
89
+ HoangThang - [hoang.jp](https://hoang.jp)
90
+
91
+ ## License
92
+
93
+ MIT
package/bin/sisyo.js ADDED
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+
6
+ const RESET = "\x1b[0m";
7
+ const GREEN = "\x1b[32m";
8
+ const CYAN = "\x1b[36m";
9
+ const BOLD = "\x1b[1m";
10
+ const DIM = "\x1b[2m";
11
+
12
+ function log(msg) { console.log(msg); }
13
+ function ok(msg) { log(`${GREEN}+${RESET} ${msg}`); }
14
+ function info(msg) { log(`${DIM} ${msg}${RESET}`); }
15
+
16
+ function copyDir(src, dest) {
17
+ fs.mkdirSync(dest, { recursive: true });
18
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
19
+ const srcPath = path.join(src, entry.name);
20
+ const destPath = path.join(dest, entry.name);
21
+ if (entry.isDirectory()) {
22
+ copyDir(srcPath, destPath);
23
+ } else {
24
+ // Skip if file already exists
25
+ if (fs.existsSync(destPath)) {
26
+ info(`skip ${path.relative(process.cwd(), destPath)} (exists)`);
27
+ continue;
28
+ }
29
+ fs.copyFileSync(srcPath, destPath);
30
+ ok(path.relative(process.cwd(), destPath));
31
+ }
32
+ }
33
+ }
34
+
35
+ function main() {
36
+ const targetDir = process.argv[2] || ".";
37
+ const target = path.resolve(targetDir);
38
+ const templatesDir = path.join(__dirname, "..", "templates");
39
+
40
+ log("");
41
+ log(`${BOLD}${CYAN}sisyo${RESET} ${DIM}Smart docs for Claude Code${RESET}`);
42
+ log("");
43
+
44
+ if (!fs.existsSync(templatesDir)) {
45
+ console.error("Error: templates directory not found");
46
+ process.exit(1);
47
+ }
48
+
49
+ // Copy all templates
50
+ copyDir(templatesDir, target);
51
+
52
+ // Get today's date
53
+ const today = new Date().toISOString().split("T")[0];
54
+
55
+ // Update dates in MAP.md and handoff
56
+ const mapPath = path.join(target, "docs", "MAP.md");
57
+ if (fs.existsSync(mapPath)) {
58
+ let mapContent = fs.readFileSync(mapPath, "utf8");
59
+ mapContent = mapContent.replace(/YYYY-MM-DD/g, today);
60
+ fs.writeFileSync(mapPath, mapContent);
61
+ }
62
+
63
+ const handoffPath = path.join(target, "docs", "99_progress", "handoff.md");
64
+ if (fs.existsSync(handoffPath)) {
65
+ let content = fs.readFileSync(handoffPath, "utf8");
66
+ content = content.replace(/YYYY-MM-DD/g, today);
67
+ fs.writeFileSync(handoffPath, content);
68
+ }
69
+
70
+ const todoPath = path.join(target, "docs", "99_progress", "todo.md");
71
+ if (fs.existsSync(todoPath)) {
72
+ let content = fs.readFileSync(todoPath, "utf8");
73
+ content = content.replace(/YYYY-MM-DD/g, today);
74
+ fs.writeFileSync(todoPath, content);
75
+ }
76
+
77
+ // Add to .gitignore if exists
78
+ const gitignorePath = path.join(target, ".gitignore");
79
+ if (fs.existsSync(gitignorePath)) {
80
+ const gitignore = fs.readFileSync(gitignorePath, "utf8");
81
+ if (!gitignore.includes("CLAUDE.local.md")) {
82
+ fs.appendFileSync(gitignorePath,
83
+ "\n# Claude Code local\nCLAUDE.local.md\n.claude/settings.local.json\n"
84
+ );
85
+ ok(".gitignore updated");
86
+ }
87
+ }
88
+
89
+ log("");
90
+ log(`${BOLD}Done!${RESET} Next steps:`);
91
+ log("");
92
+ log(` 1. Edit ${CYAN}CLAUDE.md${RESET} — replace [Project Name] with yours`);
93
+ log(` 2. Open Claude Code and start building`);
94
+ log(` 3. Docs auto-update as you work`);
95
+ log("");
96
+ log(`${DIM}Docs system: CLAUDE.md -> docs/MAP.md -> load only what's needed${RESET}`);
97
+ log("");
98
+ }
99
+
100
+ main();
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "sisyo",
3
+ "version": "1.0.0",
4
+ "description": "Smart documentation system for vibe coding with Claude Code. Token-efficient MAP.md routing.",
5
+ "bin": {
6
+ "sisyo": "./bin/sisyo.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "templates/"
11
+ ],
12
+ "keywords": [
13
+ "claude-code",
14
+ "vibe-coding",
15
+ "documentation",
16
+ "ai-coding",
17
+ "developer-tools",
18
+ "sisyo"
19
+ ],
20
+ "author": "HoangThang <hoang.jp>",
21
+ "homepage": "https://hoang.jp",
22
+ "license": "MIT",
23
+ "engines": {
24
+ "node": ">=16"
25
+ }
26
+ }
@@ -0,0 +1,12 @@
1
+ # Doc Management Rule
2
+
3
+ When changing code that affects project structure or behavior:
4
+ 1. Read docs/MAP.md to find related docs
5
+ 2. Update the relevant doc (or create if new)
6
+ 3. Update that doc summary line in MAP.md
7
+
8
+ Before ending session or when context gets large:
9
+ - Write docs/99_progress/handoff.md
10
+
11
+ At session start:
12
+ - Read docs/MAP.md then docs/99_progress/handoff.md
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: vibe-docs
3
+ description: |
4
+ Auto-manage project documentation during vibe coding. MUST trigger when:
5
+ creating/modifying features, database schema, API endpoints, frontend pages,
6
+ infrastructure, or completing any task that changes the project.
7
+ Also trigger when user asks about project status, says "what is next",
8
+ "update docs", "create a plan", "log this", or references any design doc.
9
+ Core principle: always read docs/MAP.md first to find relevant docs,
10
+ never load all docs at once.
11
+ ---
12
+
13
+ # Vibe Docs
14
+
15
+ Keep project docs in sync with code -- automatically, without wasting tokens.
16
+
17
+ ## Golden Rule: MAP.md First
18
+
19
+ `docs/MAP.md` is the routing table -- a 1-line summary of every doc in the project.
20
+ ALWAYS read MAP.md before loading any other doc file.
21
+ Only load the specific doc you actually need for the current task.
22
+
23
+ Why: 30 docs as MAP.md lines = ~500 tokens. Loading all 30 files = ~20K tokens.
24
+
25
+ ## Folder Structure
26
+
27
+ ```
28
+ docs/
29
+ MAP.md # ROUTING TABLE -- read FIRST, always
30
+ 00_schedule/ # Roadmap, milestones, sprint plans
31
+ 01_requirements/ # Feature specs, user stories
32
+ 02_architecture/ # System design, tech stack, decisions
33
+ 03_database/ # Schema, ERD, migration log
34
+ 04_api/ # Endpoint specs grouped by module
35
+ 05_frontend/ # Pages, components, routing map
36
+ 06_infra/ # Deploy, Docker, CI/CD, env vars
37
+ 99_progress/ # TODO, changelog, session handoff
38
+ ```
39
+
40
+ Folders are created on-demand. Never create empty folders or placeholder files.
41
+
42
+ ## MAP.md Format
43
+
44
+ Every doc = exactly 1 line with keyword-rich summary + date:
45
+
46
+ ```
47
+ # Project Map
48
+ > Updated: YYYY-MM-DD | Docs: N
49
+
50
+ ## 00_schedule
51
+ - 00_schedule/roadmap.md -- MVP phase 1 by April, phase 2 by June (2025-03-03)
52
+
53
+ ## 01_requirements
54
+ - 01_requirements/auth.md -- Email login, JWT tokens, password reset flow (2025-03-03)
55
+ - 01_requirements/posts.md -- Blog CRUD: create, edit, publish, draft (2025-03-02)
56
+
57
+ ## 03_database
58
+ - 03_database/schema.md -- Tables: users, posts, comments, categories (2025-03-03)
59
+ ```
60
+
61
+ Rules for MAP.md entries:
62
+ - Max ~15 words per summary -- include key nouns for scanning
63
+ - Always end with (YYYY-MM-DD) update date
64
+ - Group by folder number, skip empty sections
65
+ - Update total doc count in header
66
+
67
+ ## Auto-trigger Matrix
68
+
69
+ | Action completed | Create/update | + MAP.md |
70
+ |--------------------------------|---------------------------------|:--------:|
71
+ | Discussed/planned a feature | 01_requirements/[name].md | yes |
72
+ | Designed DB tables/columns | 03_database/schema.md | yes |
73
+ | Added/changed API endpoints | 04_api/[module].md | yes |
74
+ | Built frontend pages/routes | 05_frontend/pages.md | yes |
75
+ | Made tech/architecture choice | 02_architecture/decisions.md | yes |
76
+ | Changed deploy/infra/env | 06_infra/[topic].md | yes |
77
+ | Completed any task | 99_progress/todo.md | yes |
78
+ | Set timeline/milestone | 00_schedule/roadmap.md | yes |
79
+ | Ending session or /clear | 99_progress/handoff.md | yes |
80
+
81
+ IMPORTANT: Every doc create or update must also update its line in MAP.md.
82
+
83
+ ## Doc Format Standard
84
+
85
+ Every doc starts with:
86
+ ```
87
+ # [Title]
88
+ > Updated: YYYY-MM-DD | Status: draft/active/done
89
+ ```
90
+
91
+ Formatting rules:
92
+ - Tables over prose for structured data
93
+ - Mermaid for all diagrams
94
+ - Code blocks for configs, schemas, commands
95
+ - Keep each file under 200 lines -- split if longer
96
+ - Use relative links between docs
97
+
98
+ ## Context Recovery Protocol
99
+
100
+ After /clear or starting new session -- 4 steps, ~2-3K tokens total:
101
+ 1. Read docs/MAP.md -- understand full project scope
102
+ 2. Read docs/99_progress/handoff.md -- what happened last session
103
+ 3. Read docs/99_progress/todo.md -- what to do next
104
+ 4. Load ONLY the docs relevant to the current task (find via MAP.md)
105
+
106
+ ## Task Tracking
107
+
108
+ 99_progress/todo.md format:
109
+ ```
110
+ # TODO
111
+ > Updated: YYYY-MM-DD
112
+
113
+ ## Doing
114
+ - [ ] Task description -- see 01_requirements/feature.md
115
+
116
+ ## Next
117
+ - [ ] Task description
118
+
119
+ ## Done
120
+ - [x] [2025-03-03] Task description
121
+ ```
122
+
123
+ When user asks "what is next" -- read this file.
124
+ When task is done -- move to Done section with date.
125
+
126
+ ## Session Handoff
127
+
128
+ Write 99_progress/handoff.md before /clear or end of session:
129
+ ```
130
+ # Handoff
131
+ > Updated: YYYY-MM-DD HH:MM
132
+
133
+ ## Done this session
134
+ - Completed X (files: path/a.ts, path/b.py)
135
+
136
+ ## State
137
+ - Working: [what functions correctly]
138
+ - Broken: [known issues]
139
+ - In progress: [incomplete work]
140
+
141
+ ## Next
142
+ 1. Highest priority task
143
+ 2. Second priority
144
+
145
+ ## Decisions
146
+ - Chose X over Y: reason
147
+ ```
148
+
149
+ ## Project Init Protocol
150
+
151
+ When docs/ directory does not exist yet:
152
+ 1. Create docs/MAP.md with section headers (no entries)
153
+ 2. Create docs/99_progress/todo.md with initial tasks from conversation
154
+ 3. Create docs/99_progress/handoff.md with initial state
155
+ 4. Everything else is created on-demand when content exists
@@ -0,0 +1,38 @@
1
+ # [Project Name]
2
+
3
+ ## Stack
4
+ - Frontend: Next.js 14 (App Router) + TypeScript + Tailwind
5
+ - Backend: FastAPI + SQLAlchemy 2 + Pydantic v2
6
+ - Database: PostgreSQL 16
7
+
8
+ ## Structure
9
+ - `frontend/` -- Next.js app
10
+ - `backend/` -- FastAPI app
11
+ - `docs/` -- Project docs (auto-managed by vibe-docs skill)
12
+
13
+ ## Commands
14
+ - `make dev` -- Start all services
15
+ - `cd frontend && npm run dev` -- Frontend dev server
16
+ - `cd backend && uvicorn app.main:app --reload` -- Backend dev server
17
+ - `cd backend && pytest` -- Run backend tests
18
+ - `cd backend && alembic upgrade head` -- Run DB migrations
19
+
20
+ ## Code Rules
21
+ - TypeScript: strict mode, never `any`, prefer `interface`
22
+ - Python: type hints on all functions, Pydantic for validation
23
+ - Always create feature branch before changes
24
+ - Run lint + typecheck before commit
25
+
26
+ ## Docs System
27
+ `docs/MAP.md` is the routing table -- 1-line summary of every doc.
28
+
29
+ Session start -- read in order:
30
+ 1. `docs/MAP.md` -- full project scope in ~30 lines
31
+ 2. `docs/99_progress/handoff.md` -- last session context
32
+ 3. `docs/99_progress/todo.md` -- active tasks
33
+ 4. Load ONLY the specific docs needed for current task
34
+
35
+ During work -- vibe-docs skill auto-updates docs on code changes.
36
+ Every doc change MUST also update its summary line in MAP.md.
37
+
38
+ Before `/clear` -- always write `docs/99_progress/handoff.md` first.
@@ -0,0 +1,19 @@
1
+ # Handoff
2
+ > Updated: YYYY-MM-DD
3
+
4
+ ## Done this session
5
+ - Initialized vibe-docs documentation system
6
+ - Created CLAUDE.md, MAP.md, skill, and rules
7
+
8
+ ## State
9
+ - Working: Documentation structure is ready
10
+ - In progress: Nothing yet, project is fresh
11
+
12
+ ## Next
13
+ 1. Define what this project does (edit CLAUDE.md and docs/MAP.md)
14
+ 2. Design the database schema
15
+ 3. Set up dev environment (Docker, env vars)
16
+
17
+ ## Decisions
18
+ - Using MAP.md routing pattern: load summaries first, full docs on-demand
19
+ - Numbered folders (00-99) for consistent ordering
@@ -0,0 +1,15 @@
1
+ # TODO
2
+ > Updated: YYYY-MM-DD
3
+
4
+ ## Doing
5
+
6
+ ## Next
7
+ - [ ] Define project scope and features
8
+ - [ ] Design database schema
9
+ - [ ] Set up development environment
10
+ - [ ] Create API skeleton
11
+ - [ ] Create frontend page structure
12
+ - [ ] Implement authentication
13
+
14
+ ## Done
15
+ - [x] [YYYY-MM-DD] Initialize project documentation
@@ -0,0 +1,20 @@
1
+ # Project Map
2
+ > Updated: YYYY-MM-DD | Docs: 2
3
+
4
+ ## 00_schedule
5
+
6
+ ## 01_requirements
7
+
8
+ ## 02_architecture
9
+
10
+ ## 03_database
11
+
12
+ ## 04_api
13
+
14
+ ## 05_frontend
15
+
16
+ ## 06_infra
17
+
18
+ ## 99_progress
19
+ - `99_progress/todo.md` -- Initial backlog, project just started (YYYY-MM-DD)
20
+ - `99_progress/handoff.md` -- Project initialized, ready to build (YYYY-MM-DD)